Skip to content

Commit b769e44

Browse files
authored
Merge pull request #1043 from GEOS-ESM/develop
2 parents f26a2d1 + 86f63ad commit b769e44

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

45 files changed

+3158
-215
lines changed

.circleci/config.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
version: 2.1
22

33
# Anchors in case we need to override the defaults from the orb
4-
#baselibs_version: &baselibs_version v7.17.0
5-
#bcs_version: &bcs_version v11.4.0
4+
#baselibs_version: &baselibs_version v7.27.0
5+
#bcs_version: &bcs_version v11.6.0
66

77
orbs:
8-
ci: geos-esm/circleci-tools@2
8+
ci: geos-esm/circleci-tools@4
99

1010
workflows:
1111
build-test:

CMakeLists.txt

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,11 @@ set (alldirs
88
GEOSwgcm_GridComp
99
)
1010

11+
option(BUILD_WITH_GIGATRAJ "Build GEOSgcm with Gigatraj" OFF)
12+
13+
if (BUILD_WITH_GIGATRAJ)
14+
list(APPEND alldirs GEOSgigatraj_GridComp)
15+
endif()
1116

1217
if (EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/GEOS_GcmGridComp.F90)
1318

@@ -17,6 +22,8 @@ if (EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/GEOS_GcmGridComp.F90)
1722
SUBCOMPONENTS ${alldirs}
1823
DEPENDENCIES MAPL ESMF::ESMF)
1924

25+
target_compile_definitions (${this} PRIVATE $<$<BOOL:${BUILD_WITH_GIGATRAJ}>:HAS_GIGATRAJ>)
26+
2027
ecbuild_install_project( NAME GEOSgcm_GridComp)
2128

2229
else ()

GEOS_GcmGridComp.F90

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,10 @@ module GEOS_GcmGridCompMod
2020
use GEOS_AgcmGridCompMod, only: AGCM_SetServices => SetServices
2121
use GEOS_mkiauGridCompMod, only: AIAU_SetServices => SetServices
2222
use DFI_GridCompMod, only: ADFI_SetServices => SetServices
23+
#ifdef HAS_GIGATRAJ
24+
use GEOS_GigatrajGridCompMod, only: GigaTraj_SetServices => SetServices
25+
#endif
26+
2327
use GEOS_OgcmGridCompMod, only: OGCM_SetServices => SetServices
2428
use GEOS_WgcmGridCompMod, only: WGCM_SetServices => SetServices
2529
use MAPL_HistoryGridCompMod, only: Hist_SetServices => SetServices
@@ -58,6 +62,7 @@ module GEOS_GcmGridCompMod
5862
integer :: ADFI
5963
integer :: WGCM
6064
integer :: hist
65+
integer :: gigatraj
6166

6267
integer :: bypass_ogcm
6368
integer :: k
@@ -251,6 +256,10 @@ subroutine SetServices ( GC, RC )
251256
else
252257
AGCM = MAPL_AddChild(GC, NAME='AGCM', SS=Agcm_SetServices, RC=STATUS)
253258
VERIFY_(STATUS)
259+
#ifdef HAS_GIGATRAJ
260+
gigatraj = MAPL_AddChild(GC, NAME='GIGATRAJ', SS=GigaTraj_SetServices, RC=STATUS)
261+
VERIFY_(STATUS)
262+
#endif
254263
AIAU = MAPL_AddChild(GC, NAME='AIAU', SS=AIAU_SetServices, RC=STATUS)
255264
VERIFY_(STATUS)
256265
ADFI = MAPL_AddChild(GC, NAME='ADFI', SS=ADFI_SetServices, RC=STATUS)
@@ -955,6 +964,10 @@ subroutine Initialize ( GC, IMPORT, EXPORT, CLOCK, RC )
955964
! Recursive setup of grids (should be disabled)
956965
call ESMF_GridCompSet(GCS(AGCM), grid=agrid, rc=status)
957966
VERIFY_(STATUS)
967+
#ifdef HAS_GIGATRAJ
968+
call ESMF_GridCompSet(GCS(gigatraj), grid=agrid, rc=status)
969+
VERIFY_(STATUS)
970+
#endif
958971
call ESMF_GridCompSet(GCS(OGCM), grid=ogrid, rc=status)
959972
VERIFY_(STATUS)
960973
if(.not. DO_DATA_ATM4OCN) then
@@ -2019,10 +2032,23 @@ subroutine Run ( GC, IMPORT, EXPORT, CLOCK, RC )
20192032
else
20202033
call MAPL_TimerOn(MAPL,"AGCM" )
20212034
endif
2035+
2036+
#ifdef HAS_GIGATRAJ
2037+
! use agcm export as gigatraj's import to get the initial state.
2038+
! it only runs at the begining of the first time step
2039+
call ESMF_GridCompRun ( GCS(gigatraj), importState=GEX(AGCM), exportState=GEX(gigatraj), clock=clock, phase=1, userRC=status )
2040+
VERIFY_(STATUS)
2041+
#endif
20222042

20232043
call ESMF_GridCompRun ( GCS(AGCM), importState=GIM(AGCM), exportState=GEX(AGCM), clock=clock, userRC=status )
20242044
VERIFY_(STATUS)
20252045

2046+
#ifdef HAS_GIGATRAJ
2047+
! use agcm export as gigatraj's import
2048+
call ESMF_GridCompRun ( GCS(gigatraj), importState=GEX(AGCM), exportState=GEX(gigatraj), clock=clock, phase=2, userRC=status )
2049+
VERIFY_(STATUS)
2050+
#endif
2051+
20262052
if(DO_DATA_ATM4OCN) then
20272053
call MAPL_TimerOff(MAPL,"DATAATM" )
20282054
else

GEOSagcm_GridComp/CMakeLists.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,8 @@ elseif (EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/GEOS_AgcmGridComp.F90)
2020
SUBCOMPONENTS ${alldirs}
2121
DEPENDENCIES MAPL GEOS_Shared Chem_Shared ESMF::ESMF)
2222

23+
target_compile_definitions (${this} PRIVATE $<$<BOOL:${BUILD_WITH_GIGATRAJ}>:HAS_GIGATRAJ>)
24+
2325
else ()
2426

2527
esma_add_subdirectories (${alldirs})

GEOSagcm_GridComp/GEOS_AgcmGridComp.F90

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -790,6 +790,34 @@ subroutine SetServices ( GC, RC )
790790
RC = STATUS)
791791
VERIFY_(STATUS)
792792

793+
#ifdef HAS_GIGATRAJ
794+
call MAPL_AddExportSpec(GC, &
795+
SHORT_NAME = 'PL', &
796+
CHILD_ID = SDYN, &
797+
RC = STATUS)
798+
VERIFY_(STATUS)
799+
call MAPL_AddExportSpec(GC, &
800+
SHORT_NAME = 'OMEGA', &
801+
CHILD_ID = SDYN, &
802+
RC = STATUS)
803+
VERIFY_(STATUS)
804+
call MAPL_AddExportSpec(GC, &
805+
SHORT_NAME = 'TH', &
806+
CHILD_ID = SDYN, &
807+
RC = STATUS)
808+
VERIFY_(STATUS)
809+
call MAPL_AddExportSpec(GC, &
810+
SHORT_NAME = 'DTDTDYN', &
811+
CHILD_ID = SDYN, &
812+
RC = STATUS)
813+
VERIFY_(STATUS)
814+
call MAPL_AddExportSpec(GC, &
815+
SHORT_NAME = 'ZL', &
816+
CHILD_ID = SDYN, &
817+
RC = STATUS)
818+
VERIFY_(STATUS)
819+
#endif
820+
793821
call MAPL_AddExportSpec( GC, &
794822
SHORT_NAME = 'PS', &
795823
CHILD_ID = SDYN, &

GEOSagcm_GridComp/GEOSphysics_GridComp/GEOS_PhysicsGridComp.F90

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1215,8 +1215,8 @@ subroutine SetServices ( GC, RC )
12151215
call MAPL_AddConnectivity ( GC, &
12161216
SHORT_NAME = (/ 'RL ', 'QL ', 'QLTOT ', 'DQLDT ', &
12171217
'RI ', 'QI ', 'QITOT ', 'DQIDT ', &
1218-
'QLCN ', 'PFL_CN ', 'PFL_LSAN', &
1219-
'QICN ', 'PFI_CN ', 'PFI_LSAN', &
1218+
'QLCN ', 'PFL_CN ', 'PFL_LSAN', 'ZLCL ', &
1219+
'QICN ', 'PFI_CN ', 'PFI_LSAN', 'ZLFC ', &
12201220
'FCLD ', 'QCTOT ', 'CNV_QC ', &
12211221
'REV_LS ', 'REV_AN ', 'REV_CN ', 'TPREC ', &
12221222
'Q ', 'DQDT ', 'DQRL ', 'DQRC ', &

GEOSagcm_GridComp/GEOSphysics_GridComp/GEOSmoist_GridComp/CMakeLists.txt

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,12 @@ esma_add_library (${this}
3636
SRCS ${srcs}
3737
DEPENDENCIES GEOS_Shared GMAO_mpeu MAPL Chem_Shared Chem_Base ESMF::ESMF)
3838

39+
# We need to add_dependencies for fms_r4 because CMake doesn't know we
40+
# need it for include purposes. In R4R8, we only ever link against
41+
# fms_r8, so it doesn't know to build the target fms_r4
42+
# NOTE NOTE NOTE: This should *not* be included in GEOSgcm v12
43+
# because FMS is pre-built library in that case.
44+
add_dependencies (${this} fms_r4)
3945
get_target_property (extra_incs fms_r4 INCLUDE_DIRECTORIES)
4046
target_include_directories(${this} PRIVATE
4147
$<BUILD_INTERFACE:${extra_incs}>

0 commit comments

Comments
 (0)