Skip to content

Commit

Permalink
Merge pull request #789 from GEOS-ESM/bugfix/mathomp4/surfstate-termi…
Browse files Browse the repository at this point in the history
…nate-fix

Fix issue with Ocean TerminateImport in Surf
  • Loading branch information
sdrabenh authored Jul 28, 2023
2 parents ae33690 + eff867a commit c41a17a
Showing 1 changed file with 14 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,7 @@ subroutine SetServices ( GC, RC )
type (T_SURFACE_STATE), pointer :: SURF_INTERNAL_STATE
type (SURF_wrap) :: WRAP
type (MAPL_MetaComp ), pointer :: MAPL
INTEGER :: LSM_CHOICE
INTEGER :: LSM_CHOICE, DO_CICE_THERMO
character(len=ESMF_MAXSTR) :: SURFRC
type(ESMF_Config) :: SCF ! info from Surface Config File

Expand Down Expand Up @@ -3308,10 +3308,19 @@ subroutine SetServices ( GC, RC )
! the children; but our children do not talk to each other, only to us
! --------------------------------------------------------------------

! call MAPL_TerminateImport ( GC, CHILD = OCEAN, RC=STATUS )
call MAPL_TerminateImport ( GC, SHORT_NAMES=['SURFSTATE'], &
CHILD_IDS=[OCEAN], RC=STATUS )
VERIFY_(STATUS)
! Note; SURFSTATE is only connected between AGCM and OGCM if USE_CICE_Thermo is set
! to 2. Otherwise it is not and indeed, SURFSTATE does not seem to exist. As such,
! we use the old TerminateImport of all of ocean for less than 2

call MAPL_GetResource ( MAPL, DO_CICE_THERMO, Label="USE_CICE_Thermo:" , DEFAULT=0, _RC)
if (DO_CICE_THERMO == 2) then
call MAPL_TerminateImport ( GC, SHORT_NAMES=['SURFSTATE'], &
CHILD_IDS=[OCEAN], RC=STATUS )
VERIFY_(STATUS)
else
call MAPL_TerminateImport ( GC, CHILD = OCEAN, RC=STATUS )
VERIFY_(STATUS)
endif
#ifndef AQUA_PLANET
call MAPL_TerminateImport ( GC, CHILD = LAKE, RC=STATUS )
VERIFY_(STATUS)
Expand Down

0 comments on commit c41a17a

Please sign in to comment.