@@ -200,12 +200,10 @@ subroutine SetServices ( GC, RC )
200
200
! Local Variables
201
201
202
202
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
208
203
204
+ integer :: OFFLINE_MODE, ATM_CO2, SNOW_ALBEDO_INFO, MOSFC_EXTRA_DERIVS_OFFL_LAND, N_CONST_LAND4SNWALB
205
+ integer :: RESTART
206
+
209
207
! Begin...
210
208
! --------
211
209
@@ -221,22 +219,20 @@ subroutine SetServices ( GC, RC )
221
219
! it in the private internal state of the GridComp. It is a little
222
220
! unusual to read resource file in SetServices, but we need to know
223
221
! 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
+
229
223
! 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
+
230
228
call MAPL_GetObjectFromGC(gc, MAPL, rc= status)
231
229
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)
238
230
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!
240
236
241
237
! Set the Run entry points
242
238
! ------------------------
@@ -438,7 +434,7 @@ subroutine SetServices ( GC, RC )
438
434
RC= STATUS )
439
435
VERIFY_(STATUS)
440
436
441
- IF (catchcn_internal % ATM_CO2 == 4 ) THEN
437
+ IF (ATM_CO2 == 4 ) THEN
442
438
call MAPL_AddImportSpec(GC, &
443
439
SHORT_NAME = ' CO2SC' , &
444
440
LONG_NAME = ' CO2 Surface Concentration Bin 001' , &
@@ -1393,7 +1389,7 @@ subroutine SetServices ( GC, RC )
1393
1389
RC= STATUS )
1394
1390
VERIFY_(STATUS)
1395
1391
1396
- if (catchcn_internal % SNOW_ALBEDO_INFO == 1 ) then
1392
+ if (SNOW_ALBEDO_INFO == 1 ) then
1397
1393
call MAPL_AddInternalSpec(GC ,&
1398
1394
LONG_NAME = ' effective_snow_reflectivity' ,&
1399
1395
UNITS = ' 1' ,&
@@ -1461,7 +1457,7 @@ subroutine SetServices ( GC, RC )
1461
1457
RC= STATUS )
1462
1458
VERIFY_(STATUS)
1463
1459
1464
- if (CATCHCN_INTERNAL % MOSFC_EXTRA_DERIVS_OFFL_LAND == 1 ) then
1460
+ if (MOSFC_EXTRA_DERIVS_OFFL_LAND == 1 ) then
1465
1461
1466
1462
! for *analytical* extra derivatives in louissurface
1467
1463
@@ -1487,7 +1483,7 @@ subroutine SetServices ( GC, RC )
1487
1483
RC= STATUS )
1488
1484
VERIFY_(STATUS)
1489
1485
1490
- elseif (CATCHCN_INTERNAL % MOSFC_EXTRA_DERIVS_OFFL_LAND >= 2 ) then
1486
+ elseif (MOSFC_EXTRA_DERIVS_OFFL_LAND >= 2 ) then
1491
1487
1492
1488
! for *numerical* extra derivatives in helfsurface and louissurface
1493
1489
@@ -1982,7 +1978,7 @@ subroutine SetServices ( GC, RC )
1982
1978
1983
1979
!- --------- GOSWIM snow impurity related variables ----------
1984
1980
1985
- if (catchcn_internal % N_CONST_LAND4SNWALB /= 0 ) then
1981
+ if (N_CONST_LAND4SNWALB /= 0 ) then
1986
1982
1987
1983
call MAPL_AddInternalSpec(GC ,&
1988
1984
LONG_NAME = ' dust_mass_in_snow_bin_1' ,&
0 commit comments