Skip to content

Commit 35cb6aa

Browse files
committed
Now mark energy consistency variables in registry as initialized in dycore initialization
1 parent 6e5873e commit 35cb6aa

File tree

3 files changed

+15
-8
lines changed

3 files changed

+15
-8
lines changed

src/data/registry.xml

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -210,47 +210,41 @@
210210
type="real" kind="kind_phys"
211211
allocatable="pointer">
212212
<dimensions>horizontal_dimension</dimensions>
213-
<ic_file_input_names>te_ini_phys state_te_ini_phys</ic_file_input_names>
214213
</variable>
215214
<variable local_name="te_cur_phys"
216215
standard_name="vertically_integrated_total_energy_of_current_state_using_physics_energy_formula"
217216
units="J m-2"
218217
type="real" kind="kind_phys"
219218
allocatable="pointer">
220219
<dimensions>horizontal_dimension</dimensions>
221-
<ic_file_input_names>te_cur_phys state_te_cur_phys</ic_file_input_names>
222220
</variable>
223221
<variable local_name="te_ini_dyn"
224222
standard_name="vertically_integrated_total_energy_of_initial_state_using_dycore_energy_formula"
225223
units="J m-2"
226224
type="real" kind="kind_phys"
227225
allocatable="pointer">
228226
<dimensions>horizontal_dimension</dimensions>
229-
<ic_file_input_names>te_ini_dyn state_te_ini_dyn</ic_file_input_names>
230227
</variable>
231228
<variable local_name="te_cur_dyn"
232229
standard_name="vertically_integrated_total_energy_of_current_state_using_dycore_energy_formula"
233230
units="J m-2"
234231
type="real" kind="kind_phys"
235232
allocatable="pointer">
236233
<dimensions>horizontal_dimension</dimensions>
237-
<ic_file_input_names>te_cur_dyn state_te_cur_dyn</ic_file_input_names>
238234
</variable>
239235
<variable local_name="tw_ini"
240236
standard_name="vertically_integrated_water_vapor_and_condensed_water_of_initial_state"
241237
units="kg m-2"
242238
type="real" kind="kind_phys"
243239
allocatable="pointer">
244240
<dimensions>horizontal_dimension</dimensions>
245-
<ic_file_input_names>tw_ini state_tw_ini</ic_file_input_names>
246241
</variable>
247242
<variable local_name="tw_cur"
248243
standard_name="vertically_integrated_water_vapor_and_condensed_water_of_current_state"
249244
units="kg m-2"
250245
type="real" kind="kind_phys"
251246
allocatable="pointer">
252247
<dimensions>horizontal_dimension</dimensions>
253-
<ic_file_input_names>tw_cur state_tw_cur</ic_file_input_names>
254248
</variable>
255249
<!-- Timestep properties -->
256250
<variable local_name="is_first_timestep"
@@ -428,7 +422,6 @@
428422
allocatable="allocatable">
429423
<long_name>Enthalpy or internal energy scaling factor for energy consistency</long_name>
430424
<dimensions>horizontal_dimension vertical_layer_dimension</dimensions>
431-
<ic_file_input_names>cp_or_cv_dycore</ic_file_input_names>
432425
</variable>
433426
<!-- Constituent Variables -->
434427
<!-- These are only used to set possible IC file input names, as the constituents object handles allocation. -->

src/dynamics/mpas/dyn_comp.F90

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -184,7 +184,8 @@ end subroutine dyn_readnl
184184
!
185185
! Called by `cam_init` in `src/control/cam_comp.F90`.
186186
subroutine dyn_init(cam_runtime_opts, dyn_in, dyn_out)
187-
use cam_thermo_formula, only: energy_formula_dycore, ENERGY_FORMULA_DYCORE_MPAS
187+
use cam_thermo_formula, only: energy_formula_dycore, ENERGY_FORMULA_DYCORE_MPAS
188+
use phys_vars_init_check, only: mark_as_initialized
188189

189190
type(runtime_options), intent(in) :: cam_runtime_opts
190191
type(dyn_import_t), intent(in) :: dyn_in
@@ -204,6 +205,7 @@ subroutine dyn_init(cam_runtime_opts, dyn_in, dyn_out)
204205

205206
! Set dynamical core energy formula for use in cam_thermo.
206207
energy_formula_dycore = ENERGY_FORMULA_DYCORE_MPAS
208+
mark_as_initialized("total_energy_formula_for_dycore")
207209

208210
allocate(constituent_name(num_advected), stat=ierr)
209211
call check_allocate(ierr, subname, 'constituent_name(num_advected)', 'dyn_comp', __LINE__)

src/dynamics/se/dyn_comp.F90

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -567,6 +567,7 @@ subroutine dyn_init(cam_runtime_opts, dyn_in, dyn_out)
567567
!use cam_history, only: addfld, add_default, horiz_only, register_vector_field
568568
use gravity_waves_sources, only: gws_init
569569
use cam_thermo_formula, only: energy_formula_dycore, ENERGY_FORMULA_DYCORE_SE
570+
use phys_vars_init_check, only: mark_as_initialized
570571

571572
!SE dycore:
572573
use prim_advance_mod, only: prim_advance_init
@@ -645,6 +646,7 @@ subroutine dyn_init(cam_runtime_opts, dyn_in, dyn_out)
645646
!----------------------------------------------------------------------------
646647
! Set dynamical core energy formula for use in cam_thermo.
647648
energy_formula_dycore = ENERGY_FORMULA_DYCORE_SE
649+
mark_as_initialized("total_energy_formula_for_dycore")
648650

649651
! Now allocate and set condenstate vars
650652
allocate(cnst_name_gll(qsize), stat=iret) ! constituent names for gll tracers
@@ -1855,6 +1857,16 @@ subroutine read_inidat(dyn_in)
18551857
call mark_as_initialized("tendency_of_air_temperature_due_to_model_physics")
18561858
call mark_as_initialized("tendency_of_eastward_wind_due_to_model_physics")
18571859
call mark_as_initialized("tendency_of_northward_wind_due_to_model_physics")
1860+
call mark_as_initialized("specific_heat_for_air_used_in_dycore")
1861+
1862+
! These energy variables are calculated by check_energy_timestep_init
1863+
! but need to be marked here
1864+
call mark_as_initialized("vertically_integrated_total_energy_of_initial_state_using_physics_energy_formula")
1865+
call mark_as_initialized("vertically_integrated_total_energy_of_current_state_using_physics_energy_formula")
1866+
call mark_as_initialized("vertically_integrated_total_energy_of_initial_state_using_dycore_energy_formula")
1867+
call mark_as_initialized("vertically_integrated_total_energy_of_current_state_using_dycore_energy_formula")
1868+
call mark_as_initialized("vertically_integrated_water_vapor_and_condensed_water_of_initial_state")
1869+
call mark_as_initialized("vertically_integrated_water_vapor_and_condensed_water_of_current_state")
18581870

18591871
end subroutine read_inidat
18601872

0 commit comments

Comments
 (0)