Skip to content

Commit

Permalink
Merge pull request #408 from GEOS-ESM/develop
Browse files Browse the repository at this point in the history
Sync dev into main
  • Loading branch information
sdrabenh authored Feb 12, 2021
2 parents fb293fc + 0e7ac3e commit deca210
Show file tree
Hide file tree
Showing 92 changed files with 131 additions and 51 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -22,5 +22,6 @@ else ()

endif()

esma_add_subdirectories(Utils)


Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,14 @@ module GEOS_LakeGridCompMod
integer, parameter :: WATER = 2
integer, parameter :: NUM_SUBTILES = 2

type lake_state
integer:: CHOOSEMOSFC
end type lake_state

type lake_state_wrap
type(lake_state), pointer :: ptr
end type

! !PUBLIC MEMBER FUNCTIONS:

public SetServices
Expand Down Expand Up @@ -69,8 +77,15 @@ subroutine SetServices ( GC, RC )
integer :: STATUS
character(len=ESMF_MAXSTR) :: COMP_NAME

type(lake_state_wrap) :: wrap
type(lake_state), pointer :: mystate
character(len=ESMF_MAXSTR) :: SURFRC
type(ESMF_Config) :: SCF
type (MAPL_MetaComp), pointer :: MAPL
type(ESMF_Config) :: CF

!=============================================================================
!_VERIFY(status)

! Begin...

Expand Down Expand Up @@ -831,6 +846,22 @@ subroutine SetServices ( GC, RC )

!EOS

call MAPL_GetObjectFromGC ( GC, MAPL, RC=STATUS)
VERIFY_(STATUS)

call MAPL_Get(MAPL,cf=cf,RC=STATUS )
VERIFY_(STATUS)

allocate(mystate,stat=status)
VERIFY_(status)
call MAPL_GetResource (MAPL, SURFRC, label = 'SURFRC:', default = 'GEOS_SurfaceGridComp.rc', RC=STATUS) ; VERIFY_(STATUS)
SCF = ESMF_ConfigCreate(rc=status) ; VERIFY_(STATUS)
call ESMF_ConfigLoadFile (SCF,SURFRC,rc=status) ; VERIFY_(STATUS)
call ESMF_ConfigGetAttribute (SCF, label='CHOOSEMOSFC:', value=mystate%CHOOSEMOSFC, DEFAULT=1, __RC__ )
call ESMF_ConfigDestroy (SCF, __RC__)
wrap%ptr => mystate
call ESMF_UserCompSetInternalState(gc, 'lake_private', wrap,status)
VERIFY_(status)

! Set the Profiling timers
! ------------------------
Expand Down Expand Up @@ -983,8 +1014,8 @@ subroutine RUN1 ( GC, IMPORT, EXPORT, CLOCK, RC )

integer :: CHOOSEMOSFC
integer :: CHOOSEZ0
character(len=ESMF_MAXSTR) :: SURFRC
type(ESMF_Config) :: SCF
type(lake_state_wrap) :: wrap
type(lake_state), pointer :: mystate

!=============================================================================

Expand Down Expand Up @@ -1019,11 +1050,10 @@ subroutine RUN1 ( GC, IMPORT, EXPORT, CLOCK, RC )

! Get parameters (0:Louis, 1:Monin-Obukhov)
! -----------------------------------------
call MAPL_GetResource (MAPL, SURFRC, label = 'SURFRC:', default = 'GEOS_SurfaceGridComp.rc', RC=STATUS) ; VERIFY_(STATUS)
SCF = ESMF_ConfigCreate(rc=status) ; VERIFY_(STATUS)
call ESMF_ConfigLoadFile (SCF,SURFRC,rc=status) ; VERIFY_(STATUS)
call ESMF_ConfigGetAttribute (SCF, label='CHOOSEMOSFC:', value=CHOOSEMOSFC, DEFAULT=1, __RC__ )
call ESMF_ConfigDestroy (SCF, __RC__)
call ESMF_UserCompGetInternalState(gc,'lake_private',wrap,status)
VERIFY_(status)
mystate => wrap%ptr
CHOOSEMOSFC = mystate%CHOOSEMOSFC

call MAPL_GetResource ( MAPL, CHOOSEZ0, Label="CHOOSEZ0:", DEFAULT=3, RC=STATUS)
VERIFY_(STATUS)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,3 @@ esma_add_library (${this}
DEPENDENCIES GEOS_SurfaceShared GEOS_LandShared MAPL
INCLUDES ${INC_ESMF})

# Special case for GEOScatch and GEOScatchCN components - build with / without openmp
if (USE_OPENMP)
add_subdirectory (GEOScatch_GridComp GEOScatch_GridComp_openmp)
add_subdirectory (GEOScatchCN_GridComp GEOScatchCN_GridComp_openmp)
endif ()

Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
esma_set_this ()
string (REPLACE GEOScatchCN_GridComp_ "" is_openmp ${this})

set (srcs
clmtype.F90
Expand Down Expand Up @@ -47,7 +46,3 @@ esma_add_library (${this}
DEPENDENCIES MAPL GEOS_Shared GEOS_LandShared)
target_include_directories (${this} PUBLIC ${INC_ESMF} ${INC_NETCDF})

if (is_openmp)
target_compile_options(${this} PRIVATE ${OpenMP_Fortran_FLAGS})
endif ()

Original file line number Diff line number Diff line change
Expand Up @@ -5138,7 +5138,7 @@ subroutine Driver ( RC )
logical, save :: first = .true.
integer*8, save :: istep = 1 ! gkw: legacy variable from offline

real :: co2
! real :: co2
real, external :: getco2

! temporaries for call to SIBALB for each type
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
esma_set_this ()
string (REPLACE GEOScatch_GridComp_ "" is_openmp ${this})


set (srcs
GEOS_CatchGridComp.F90
Expand All @@ -13,9 +11,3 @@ esma_add_library (${this}
DEPENDENCIES MAPL GEOS_LandShared)
target_include_directories (${this} PUBLIC ${INC_ESMF} ${INC_NETCDF})

add_subdirectory(mk_restarts)

if (is_openmp)
target_compile_options(${this} PRIVATE ${OpenMP_Fortran_FLAGS})
endif ()

Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,14 @@ module GEOS_CICE4ColumnPhysGridComp

logical :: DUAL_OCEAN

type cice_state
integer:: CHOOSEMOSFC
end type cice_state

type cice_state_wrap
type(cice_state), pointer :: ptr
end type

contains

!BOP
Expand Down Expand Up @@ -115,6 +123,11 @@ subroutine SetServices ( GC, RC )
integer :: NUM_ICE_CATEGORIES ! set via resource parameter
integer :: iDUAL_OCEAN

type(cice_state_wrap) :: wrap
type(cice_state), pointer :: mystate
character(len=ESMF_MAXSTR) :: SURFRC
type(ESMF_Config) :: SCF

!=============================================================================

! Begin...
Expand Down Expand Up @@ -1904,6 +1917,16 @@ subroutine SetServices ( GC, RC )

!EOS

allocate(mystate,stat=status)
VERIFY_(status)
call MAPL_GetResource (MAPL, SURFRC, label = 'SURFRC:', default = 'GEOS_SurfaceGridComp.rc', RC=STATUS) ; VERIFY_(STATUS)
SCF = ESMF_ConfigCreate(rc=status) ; VERIFY_(STATUS)
call ESMF_ConfigLoadFile (SCF,SURFRC,rc=status) ; VERIFY_(STATUS)
call ESMF_ConfigGetAttribute (SCF, label='CHOOSEMOSFC:', value=mystate%CHOOSEMOSFC, DEFAULT=1, __RC__ )
call ESMF_ConfigDestroy (SCF, __RC__)
wrap%ptr => mystate
call ESMF_UserCompSetInternalState(gc, 'cice_private', wrap,status)
VERIFY_(status)

! Set the Profiling timers
! ------------------------
Expand Down Expand Up @@ -2294,8 +2317,8 @@ subroutine RUN1 ( GC, IMPORT, EXPORT, CLOCK, RC )
integer :: PRES_ICE
integer :: CHOOSEMOSFC
integer :: CHOOSEZ0
character(len=ESMF_MAXSTR) :: SURFRC
type(ESMF_Config) :: SCF
type(cice_state_wrap) :: wrap
type(cice_state), pointer :: mystate

!=============================================================================

Expand Down Expand Up @@ -2340,11 +2363,10 @@ subroutine RUN1 ( GC, IMPORT, EXPORT, CLOCK, RC )

! Get parameters (0:Louis, 1:Monin-Obukhov)
! -----------------------------------------
call MAPL_GetResource (MAPL, SURFRC, label = 'SURFRC:', default = 'GEOS_SurfaceGridComp.rc', RC=STATUS) ; VERIFY_(STATUS)
SCF = ESMF_ConfigCreate(rc=status) ; VERIFY_(STATUS)
call ESMF_ConfigLoadFile (SCF,SURFRC,rc=status) ; VERIFY_(STATUS)
call ESMF_ConfigGetAttribute (SCF, label='CHOOSEMOSFC:', value=CHOOSEMOSFC, DEFAULT=1, __RC__ )
call ESMF_ConfigDestroy (SCF, __RC__)
call ESMF_UserCompGetInternalState(gc,'cice_private',wrap,status)
VERIFY_(status)
mystate => wrap%ptr
CHOOSEMOSFC = mystate%CHOOSEMOSFC

call MAPL_GetResource ( MAPL, CHOOSEZ0, Label="CHOOSEZ0:", DEFAULT=3, RC=STATUS)
VERIFY_(STATUS)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,14 @@ module GEOS_OpenwaterGridCompMod
integer, parameter :: NUM_SUBTILES = 1 ! number of sub-tiles
real, parameter :: KUVR = 0.09

type openwater_state
integer:: CHOOSEMOSFC
end type openwater_state

type openwater_state_wrap
type(openwater_state), pointer :: ptr
end type

contains

!BOP
Expand Down Expand Up @@ -132,6 +140,11 @@ subroutine SetServices ( GC, RC )
type (MAPL_MetaComp), pointer :: MAPL
type (ESMF_Config) :: CF

type(openwater_state_wrap) :: wrap
type(openwater_state), pointer :: mystate
character(len=ESMF_MAXSTR) :: SURFRC
type(ESMF_Config) :: SCF

!=============================================================================

! Begin...
Expand Down Expand Up @@ -1436,6 +1449,17 @@ subroutine SetServices ( GC, RC )

!EOS

allocate(mystate,stat=status)
VERIFY_(status)
call MAPL_GetResource (MAPL, SURFRC, label = 'SURFRC:', default = 'GEOS_SurfaceGridComp.rc', RC=STATUS) ; VERIFY_(STATUS)
SCF = ESMF_ConfigCreate(rc=status) ; VERIFY_(STATUS)
call ESMF_ConfigLoadFile (SCF,SURFRC,rc=status) ; VERIFY_(STATUS)
call ESMF_ConfigGetAttribute (SCF, label='CHOOSEMOSFC:', value=mystate%CHOOSEMOSFC, DEFAULT=1, __RC__ )
call ESMF_ConfigDestroy (SCF, __RC__)
wrap%ptr => mystate
call ESMF_UserCompSetInternalState(gc, 'openwater_private', wrap,status)
VERIFY_(status)

! Set the Profiling timers
! ------------------------

Expand Down Expand Up @@ -1611,8 +1635,8 @@ subroutine RUN1 ( GC, IMPORT, EXPORT, CLOCK, RC )
real :: MinWaterDepth
real :: OGCM_top_thickness ! thickness of OGCM top layer (D) in AS2018

character(len=ESMF_MAXSTR) :: SURFRC
type(ESMF_Config) :: SCF
type(openwater_state_wrap) :: wrap
type(openwater_state), pointer :: mystate
character(len=100) :: WHICH_T_TO_SFCLAYER ! what temperature does the sfclayer get from AOIL?
real :: DEPTH_T_TO_SFCLAYER ! temperature (at what depth) does the sfclayer get from AOIL?

Expand Down Expand Up @@ -1655,11 +1679,11 @@ subroutine RUN1 ( GC, IMPORT, EXPORT, CLOCK, RC )

! Get parameters (0:Louis, 1:Monin-Obukhov)
! -----------------------------------------
call MAPL_GetResource (MAPL, SURFRC, label = 'SURFRC:', default = 'GEOS_SurfaceGridComp.rc', RC=STATUS) ; VERIFY_(STATUS)
SCF = ESMF_ConfigCreate(rc=status) ; VERIFY_(STATUS)
call ESMF_ConfigLoadFile (SCF,SURFRC,rc=status) ; VERIFY_(STATUS)
call ESMF_ConfigGetAttribute (SCF, label='CHOOSEMOSFC:', value=CHOOSEMOSFC, DEFAULT=1, __RC__ )
call ESMF_ConfigDestroy (SCF, __RC__)
! -----------------------------------------
call ESMF_UserCompGetInternalState(gc,'openwater_private',wrap,status)
VERIFY_(status)
mystate => wrap%ptr
CHOOSEMOSFC = mystate%CHOOSEMOSFC

call MAPL_GetResource ( MAPL, CHOOSEZ0, Label="CHOOSEZ0:", DEFAULT=3, RC=STATUS)
VERIFY_(STATUS)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,15 @@ module GEOS_SimpleSeaiceGridCompMod
!EOP

integer, parameter :: ICE = 1
integer, parameter :: NUM_SUBTILES = 1
integer, parameter :: NUM_SUBTILES = 1

type ssi_state
integer:: CHOOSEMOSFC
end type ssi_state

type ssi_state_wrap
type(ssi_state), pointer :: ptr
end type

contains

Expand Down Expand Up @@ -84,6 +92,11 @@ subroutine SetServices ( GC, RC )
type (MAPL_MetaComp), pointer :: MAPL
type (ESMF_Config) :: CF

type(ssi_state_wrap) :: wrap
type(ssi_state), pointer :: mystate
character(len=ESMF_MAXSTR) :: SURFRC
type(ESMF_Config) :: SCF

!=============================================================================

! Begin...
Expand Down Expand Up @@ -1181,6 +1194,16 @@ subroutine SetServices ( GC, RC )

!EOS

allocate(mystate,stat=status)
VERIFY_(status)
call MAPL_GetResource (MAPL, SURFRC, label = 'SURFRC:', default = 'GEOS_SurfaceGridComp.rc', RC=STATUS) ; VERIFY_(STATUS)
SCF = ESMF_ConfigCreate(rc=status) ; VERIFY_(STATUS)
call ESMF_ConfigLoadFile (SCF,SURFRC,rc=status) ; VERIFY_(STATUS)
call ESMF_ConfigGetAttribute (SCF, label='CHOOSEMOSFC:', value=mystate%CHOOSEMOSFC, DEFAULT=1, __RC__ )
call ESMF_ConfigDestroy (SCF, __RC__)
wrap%ptr => mystate
call ESMF_UserCompSetInternalState(gc, 'ssi_private', wrap,status)
VERIFY_(status)

! Set the Profiling timers
! ------------------------
Expand Down Expand Up @@ -1343,8 +1366,8 @@ subroutine RUN1 ( GC, IMPORT, EXPORT, CLOCK, RC )

integer :: CHOOSEMOSFC
integer :: CHOOSEZ0
character(len=ESMF_MAXSTR) :: SURFRC
type(ESMF_Config) :: SCF
type(ssi_state_wrap) :: wrap
type(ssi_state), pointer :: mystate

!=============================================================================

Expand Down Expand Up @@ -1380,11 +1403,10 @@ subroutine RUN1 ( GC, IMPORT, EXPORT, CLOCK, RC )

! Get parameters (0:Louis, 1:Monin-Obukhov)
! -----------------------------------------
call MAPL_GetResource (MAPL, SURFRC, label = 'SURFRC:', default = 'GEOS_SurfaceGridComp.rc', RC=STATUS) ; VERIFY_(STATUS)
SCF = ESMF_ConfigCreate(rc=status) ; VERIFY_(STATUS)
call ESMF_ConfigLoadFile (SCF,SURFRC,rc=status) ; VERIFY_(STATUS)
call ESMF_ConfigGetAttribute (SCF, label='CHOOSEMOSFC:', value=CHOOSEMOSFC, DEFAULT=1, __RC__ )
call ESMF_ConfigDestroy (SCF, __RC__)
call ESMF_UserCompGetInternalState(gc,'ssi_private',wrap,status)
VERIFY_(status)
mystate => wrap%ptr
CHOOSEMOSFC = mystate%CHOOSEMOSFC

call MAPL_GetResource ( MAPL, CHOOSEZ0, Label="CHOOSEZ0:", DEFAULT=3, RC=STATUS)
VERIFY_(STATUS)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
# Note that directory and library name do not correspond!
esma_set_this (OVERRIDE GEOS_SurfaceShared)
esma_add_subdirectories (Raster)

set (resource_files
GEOS_SurfaceGridComp.rc
Expand All @@ -15,4 +14,3 @@ set (srcs
SurfParams.F90)

esma_add_library (${this} SRCS ${srcs} DEPENDENCIES GEOS_Shared MAPL)
#target_compile_options (${this} PRIVATE $<$<COMPILE_LANGUAGE:Fortran>:${FREAL4}>)
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
#
esma_add_subdirectories (Raster mk_restarts)

0 comments on commit deca210

Please sign in to comment.