@@ -95,25 +95,30 @@ subroutine SetServices ( GC, RC )
9595 call surface_params_to_wrap_state(statePtr, SCF, _RC)
9696
9797 call ESMF_ConfigDestroy(SCF, _RC)
98-
99- ! add select rc variables to the CF config object within MAPL and (again) into the internal state
100- call MAPL_Get (MAPL, CF= CF, _RC)
101- call ESMF_ConfigSetAttribute(CF, value= CATCHCN_INTERNAL_STATE% CN_CLM51_NML_FILE, Label= ' CN_CLM51_NML_FILE:' , _RC)
102- call ESMF_ConfigSetAttribute(CF, value= CATCHCN_INTERNAL_STATE% ATM_CO2, Label= ' ATM_CO2:' , _RC)
103- call ESMF_ConfigSetAttribute(CF, value= CATCHCN_INTERNAL_STATE% N_CONST_LAND4SNWALB, Label= ' N_CONST_LAND4SNWALB:' , _RC)
104- call ESMF_ConfigSetAttribute(CF, value= CATCHCN_INTERNAL_STATE% RUN_IRRIG, Label= ' RUN_IRRIG:' , _RC)
105- call ESMF_ConfigSetAttribute(CF, value= CATCHCN_INTERNAL_STATE% PRESCRIBE_DVG, Label= ' PRESCRIBE_DVG:' , _RC)
106- call ESMF_ConfigSetAttribute(CF, value= CATCHCN_INTERNAL_STATE% SNOW_ALBEDO_INFO, Label= ' SNOW_ALBEDO_INFO:' , _RC)
107- call MAPL_Set (MAPL, CF= CF, _RC)
108-
98+
10999 call MAPL_GetResource ( MAPL, LSM_CHOICE, Label= " LSM_CHOICE:" , DEFAULT= 2 , RC= STATUS)
110100 VERIFY_(STATUS)
101+
102+ ! Add select rc variables to [the CF config object within] MAPL so that the Children GridComps (CNCLM40 and CNCLM51) can get
103+ ! them in SetServices() from MAPL. In the Children's SetServices(), "catchcn_internal" is not yet available.
104+ call MAPL_Get (MAPL, CF= CF, _RC)
105+ call ESMF_ConfigSetAttribute(CF, value= CATCHCN_INTERNAL_STATE% ATM_CO2, Label= ' ATM_CO2:' , _RC)
106+ call ESMF_ConfigSetAttribute(CF, value= CATCHCN_INTERNAL_STATE% N_CONST_LAND4SNWALB, Label= ' N_CONST_LAND4SNWALB:' , _RC)
107+ call ESMF_ConfigSetAttribute(CF, value= CATCHCN_INTERNAL_STATE% SNOW_ALBEDO_INFO, Label= ' SNOW_ALBEDO_INFO:' , _RC)
108+ if (LSM_CHOICE== 2 ) then
109+ call ESMF_ConfigSetAttribute(CF, value= CATCHCN_INTERNAL_STATE% RUN_IRRIG, Label= ' RUN_IRRIG:' , _RC)
110+ call ESMF_ConfigSetAttribute(CF, value= CATCHCN_INTERNAL_STATE% PRESCRIBE_DVG, Label= ' PRESCRIBE_DVG:' , _RC)
111+ elseif (LSM_CHOICE== 4 ) then
112+ call ESMF_ConfigSetAttribute(CF, value= CATCHCN_INTERNAL_STATE% MOSFC_EXTRA_DERIVS_OFFL_LAND, Label= ' MOSFC_EXTRA_DERIVS_OFFL_LAND:' , _RC)
113+ end if
114+ call MAPL_Set (MAPL, CF= CF, _RC)
111115
116+ ! prep CatchCN ensemble and Children
112117 tmp = ' '
113118 if (NUM_LDAS_ENSEMBLE >1 ) then
114- ! catchcn_exxxx
115- tmp(1 :ens_id_width)= COMP_NAME(8 :8 + ens_id_width-1 )
116- endif
119+ ! catchcn_exxxx
120+ tmp(1 :ens_id_width)= COMP_NAME(8 :8 + ens_id_width-1 )
121+ endif
117122
118123 if ( LSM_CHOICE == 2 ) then
119124 CATCHCN = MAPL_AddChild(' CATCHCNCLM40' // trim (tmp), ' setservices_' , parentGC= GC, sharedObj= ' libGEOScatchCNCLM40_GridComp.so' , RC= STATUS)
0 commit comments