1
- ! It is a proxy of clm 4.0 and clm 4.5
1
+ ! It is a proxy of CNCLM40 and CNCLM51
2
2
3
3
#include " MAPL_Generic.h"
4
4
@@ -86,33 +86,39 @@ subroutine SetServices ( GC, RC )
86
86
call MAPL_GetResource ( MAPL, CATCHCN_INTERNAL_STATE% CATCH_SPINUP, Label= " CATCHMENT_SPINUP:" , DEFAULT= 0 , RC= STATUS)
87
87
VERIFY_(STATUS)
88
88
89
- ! resource variables from GEOS_SurfaceGridComp.rc
89
+ ! put resource variables from rc file into SCF config object (GCM: SURFRC= GEOS_SurfaceGridComp.rc, LDAS: SURFRC=LDAS.rc)
90
90
call MAPL_GetResource ( MAPL, SURFRC, label = ' SURFRC:' , default = ' GEOS_SurfaceGridComp.rc' , RC= STATUS) ; VERIFY_(STATUS)
91
91
SCF = ESMF_ConfigCreate(rc= status) ; VERIFY_(STATUS)
92
92
call ESMF_ConfigLoadFile(SCF,SURFRC,rc= status) ; VERIFY_(STATUS)
93
93
94
+ ! assemble internal state from SCF config object
94
95
call surface_params_to_wrap_state(statePtr, SCF, _RC)
95
96
96
97
call ESMF_ConfigDestroy(SCF, _RC)
97
-
98
- call MAPL_Get (MAPL, CF= CF, _RC)
99
-
100
- call ESMF_ConfigSetAttribute(CF, value= CATCHCN_INTERNAL_STATE% CN_CLM51_NML_FILE, Label= ' CN_CLM51_NML_FILE:' , _RC)
101
- call ESMF_ConfigSetAttribute(CF, value= CATCHCN_INTERNAL_STATE% ATM_CO2, Label= ' ATM_CO2:' , _RC)
102
- call ESMF_ConfigSetAttribute(CF, value= CATCHCN_INTERNAL_STATE% N_CONST_LAND4SNWALB, Label= ' N_CONST_LAND4SNWALB:' , _RC)
103
- call ESMF_ConfigSetAttribute(CF, value= CATCHCN_INTERNAL_STATE% RUN_IRRIG, Label= ' RUN_IRRIG:' , _RC)
104
- call ESMF_ConfigSetAttribute(CF, value= CATCHCN_INTERNAL_STATE% PRESCRIBE_DVG, Label= ' PRESCRIBE_DVG:' , _RC)
105
- call ESMF_ConfigSetAttribute(CF, value= CATCHCN_INTERNAL_STATE% SNOW_ALBEDO_INFO, Label= ' SNOW_ALBEDO_INFO:' , _RC)
106
- call MAPL_Set (MAPL, CF= CF, _RC)
107
-
98
+
108
99
call MAPL_GetResource ( MAPL, LSM_CHOICE, Label= " LSM_CHOICE:" , DEFAULT= 2 , RC= STATUS)
109
100
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)
110
115
116
+ ! prep CatchCN ensemble and Children
111
117
tmp = ' '
112
118
if (NUM_LDAS_ENSEMBLE >1 ) then
113
- ! catchcn_exxxx
114
- tmp(1 :ens_id_width)= COMP_NAME(8 :8 + ens_id_width-1 )
115
- endif
119
+ ! catchcn_exxxx
120
+ tmp(1 :ens_id_width)= COMP_NAME(8 :8 + ens_id_width-1 )
121
+ endif
116
122
117
123
if ( LSM_CHOICE == 2 ) then
118
124
CATCHCN = MAPL_AddChild(' CATCHCNCLM40' // trim (tmp), ' setservices_' , parentGC= GC, sharedObj= ' libGEOScatchCNCLM40_GridComp.so' , RC= STATUS)
@@ -131,13 +137,13 @@ subroutine SetServices ( GC, RC )
131
137
call MAPL_GridCompSetEntryPoint ( GC, ESMF_METHOD_INITIALIZE, Initialize, RC= STATUS )
132
138
VERIFY_(STATUS)
133
139
134
- call MAPL_GridCompSetEntryPoint ( GC, ESMF_METHOD_RUN, RUN1, RC= STATUS )
140
+ call MAPL_GridCompSetEntryPoint ( GC, ESMF_METHOD_RUN, RUN1, RC= STATUS )
135
141
VERIFY_(STATUS)
136
142
137
- call MAPL_GridCompSetEntryPoint ( GC, ESMF_METHOD_RUN, RUN2, RC= STATUS )
143
+ call MAPL_GridCompSetEntryPoint ( GC, ESMF_METHOD_RUN, RUN2, RC= STATUS )
138
144
VERIFY_(STATUS)
139
145
140
- call MAPL_GridCompSetEntryPoint ( GC, ESMF_METHOD_FINALIZE, Finalize, RC= status)
146
+ call MAPL_GridCompSetEntryPoint ( GC, ESMF_METHOD_FINALIZE, Finalize, RC= status)
141
147
VERIFY_(status)
142
148
143
149
! Set the state variable specs. ( should be the combinations of clm4.0 and clm4.5
0 commit comments