Skip to content

Commit 7bb81c7

Browse files
committed
fixed treatment of rc variables in SetServices() (GEOS_CatchCNCLM51GridComp.F90)
1 parent e463354 commit 7bb81c7

File tree

1 file changed

+18
-22
lines changed
  • GEOSagcm_GridComp/GEOSphysics_GridComp/GEOSsurface_GridComp/GEOSland_GridComp/GEOScatchCN_GridComp/GEOScatchCNCLM51_GridComp

1 file changed

+18
-22
lines changed

GEOSagcm_GridComp/GEOSphysics_GridComp/GEOSsurface_GridComp/GEOSland_GridComp/GEOScatchCN_GridComp/GEOScatchCNCLM51_GridComp/GEOS_CatchCNCLM51GridComp.F90

Lines changed: 18 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -200,12 +200,10 @@ subroutine SetServices ( GC, RC )
200200
! Local Variables
201201

202202
type(MAPL_MetaComp), pointer :: MAPL=>null()
203-
type(T_CATCHCN_STATE), pointer :: CATCHCN_INTERNAL
204-
class(T_CATCHCN_STATE), pointer :: statePtr
205-
type(CATCHCN_WRAP) :: wrap
206-
integer :: OFFLINE_MODE
207-
integer :: RESTART
208203

204+
integer :: OFFLINE_MODE, ATM_CO2, SNOW_ALBEDO_INFO, MOSFC_EXTRA_DERIVS_OFFL_LAND, N_CONST_LAND4SNWALB
205+
integer :: RESTART
206+
209207
! Begin...
210208
! --------
211209

@@ -221,22 +219,20 @@ subroutine SetServices ( GC, RC )
221219
! it in the private internal state of the GridComp. It is a little
222220
! unusual to read resource file in SetServices, but we need to know
223221
! at this stage where we are running Catch in the offline mode or not
224-
225-
allocate(CATCHCN_INTERNAL, stat=status)
226-
VERIFY_(status)
227-
statePtr => CATCHCN_INTERNAL
228-
222+
229223
! resource variables for offline GEOSldas; for documentation, see GEOSldas/src/Applications/LDAS_App/GEOSldas_LDAS.rc
224+
!
225+
! NOTE: In SetServices(), the internal state ("catchcn_internal") has not yet been passed down from the parent (CatchCN),
226+
! so it should not be used.
227+
230228
call MAPL_GetObjectFromGC(gc, MAPL, rc=status)
231229
VERIFY_(status)
232-
call MAPL_GetResource ( MAPL, CATCHCN_INTERNAL%CATCH_OFFLINE, Label="CATCHMENT_OFFLINE:", DEFAULT=0, RC=STATUS)
233-
VERIFY_(STATUS)
234-
call MAPL_GetResource ( MAPL, CATCHCN_INTERNAL%CATCH_SPINUP, Label="CATCHMENT_SPINUP:", DEFAULT=0, RC=STATUS)
235-
VERIFY_(STATUS)
236-
call MAPL_GetResource ( MAPL, CATCHCN_INTERNAL%MOSFC_EXTRA_DERIVS_OFFL_LAND, Label="MOSFC_EXTRA_DERIVS_OFFL_LAND:", DEFAULT=0, RC=STATUS )
237-
VERIFY_(STATUS)
238230

239-
OFFLINE_MODE = CATCHCN_INTERNAL%CATCH_OFFLINE ! shorthand
231+
call MAPL_GetResource ( MAPL, OFFLINE_MODE, Label="CATCHMENT_OFFLINE:", DEFAULT=0, _RC)
232+
call MAPL_GetResource ( MAPL, ATM_CO2, Label="ATM_CO2:", DEFAULT=2, _RC)
233+
call MAPL_GetResource ( MAPL, N_CONST_LAND4SNWALB, Label="N_CONST_LAND4SNWALB:", DEFAULT=0, _RC)
234+
call MAPL_GetResource ( MAPL, SNOW_ALBEDO_INFO, Label="SNOW_ALBEDO_INFO:", DEFAULT=0, _RC)
235+
call MAPL_GetResource ( MAPL, MOSFC_EXTRA_DERIVS_OFFL_LAND, Label="MOSFC_EXTRA_DERIVS_OFFL_LAND:", DEFAULT=0, _RC) ! 0 is default for GCM only!
240236

241237
! Set the Run entry points
242238
! ------------------------
@@ -438,7 +434,7 @@ subroutine SetServices ( GC, RC )
438434
RC=STATUS )
439435
VERIFY_(STATUS)
440436

441-
IF (catchcn_internal%ATM_CO2 == 4) THEN
437+
IF (ATM_CO2 == 4) THEN
442438
call MAPL_AddImportSpec(GC, &
443439
SHORT_NAME = 'CO2SC', &
444440
LONG_NAME = 'CO2 Surface Concentration Bin 001', &
@@ -1393,7 +1389,7 @@ subroutine SetServices ( GC, RC )
13931389
RC=STATUS )
13941390
VERIFY_(STATUS)
13951391

1396-
if (catchcn_internal%SNOW_ALBEDO_INFO == 1) then
1392+
if (SNOW_ALBEDO_INFO == 1) then
13971393
call MAPL_AddInternalSpec(GC ,&
13981394
LONG_NAME = 'effective_snow_reflectivity',&
13991395
UNITS = '1' ,&
@@ -1461,7 +1457,7 @@ subroutine SetServices ( GC, RC )
14611457
RC=STATUS )
14621458
VERIFY_(STATUS)
14631459

1464-
if (CATCHCN_INTERNAL%MOSFC_EXTRA_DERIVS_OFFL_LAND == 1) then
1460+
if (MOSFC_EXTRA_DERIVS_OFFL_LAND == 1) then
14651461

14661462
! for *analytical* extra derivatives in louissurface
14671463

@@ -1487,7 +1483,7 @@ subroutine SetServices ( GC, RC )
14871483
RC=STATUS )
14881484
VERIFY_(STATUS)
14891485

1490-
elseif (CATCHCN_INTERNAL%MOSFC_EXTRA_DERIVS_OFFL_LAND >= 2) then
1486+
elseif (MOSFC_EXTRA_DERIVS_OFFL_LAND >= 2) then
14911487

14921488
! for *numerical* extra derivatives in helfsurface and louissurface
14931489

@@ -1982,7 +1978,7 @@ subroutine SetServices ( GC, RC )
19821978

19831979
!---------- GOSWIM snow impurity related variables ----------
19841980

1985-
if (catchcn_internal%N_CONST_LAND4SNWALB /= 0) then
1981+
if (N_CONST_LAND4SNWALB /= 0) then
19861982

19871983
call MAPL_AddInternalSpec(GC ,&
19881984
LONG_NAME = 'dust_mass_in_snow_bin_1' ,&

0 commit comments

Comments
 (0)