Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 14 additions & 1 deletion src/data/registry.xml
Original file line number Diff line number Diff line change
Expand Up @@ -575,8 +575,21 @@
standard_name="specific_heat_of_air_used_in_dycore"
units="J kg-1 K-1" type="real" kind="kind_phys"
allocatable="allocatable">
<long_name>specific heat of air used in the dynamical core (enthalpy for pressure-based dynamical cores and internal energy for z-based dynamical cores)</long_name>
<long_name>specific heat of air used in the dynamical core (enthalpy for pressure-based dynamical cores and internal energy for z-based dynamical cores), updated mid-physics for post-mass-adjustment total energy diagnostics</long_name>
<dimensions>horizontal_dimension vertical_layer_dimension</dimensions>
<initial_value>0._kind_phys</initial_value>
</variable>
<variable local_name="cp_or_cv_dycore_at_start_of_physics_timestep"
standard_name="specific_heat_of_air_used_in_dycore_at_start_of_physics_timestep"
units="J kg-1 K-1" type="real" kind="kind_phys"
allocatable="allocatable">
<long_name>Specific heat of air used in the dynamical core (enthalpy for pressure-based dynamical cores and internal energy for z-based dynamical cores), at start of physics timestep, for energy-consistency scaling and energy checker</long_name>
<dimensions>horizontal_dimension vertical_layer_dimension</dimensions>
<!-- Note: this quantity is read from CAM snapshot from the dycore value
since the CAM fix in cam6_4_173 (CAM#1554) restores the mid-physics update
value (for total energy diagnostics) to the start of physics timestep
(d_p_coupling) value. It is used for running the energy checker for
individual physics scheme tests. -->
<ic_file_input_names>cp_or_cv_dycore</ic_file_input_names>
</variable>

Expand Down
5 changes: 4 additions & 1 deletion src/dynamics/mpas/dyn_coupling_impl.F90
Original file line number Diff line number Diff line change
Expand Up @@ -507,7 +507,8 @@ subroutine set_physics_state_external()
use dyn_comp, only: advected_constituent_index, mpas_dynamical_core
use dyn_procedures, only: exner_function
use dynconst, only: constant_g => gravit
use physics_types, only: cappav, cp_or_cv_dycore, cpairv, lagrangian_vertical, phys_state, rairv, zvirv
use physics_types, only: cappav, cp_or_cv_dycore, cp_or_cv_dycore_at_start_of_physics_timestep, &
cpairv, lagrangian_vertical, phys_state, rairv, zvirv
use runtime_obj, only: cam_runtime_opts
use string_utils, only: stringify
use vert_coord, only: pver, pverp
Expand Down Expand Up @@ -565,6 +566,8 @@ subroutine set_physics_state_external()
call cam_thermo_water_update( &
constituents, ncells_solve, pver, energy_formula_dycore_mpas, cp_or_cv_dycore)

cp_or_cv_dycore_at_start_of_physics_timestep(:, :) = cp_or_cv_dycore(:, :)

! This variable name is really misleading. It actually represents the reciprocal of Exner function
! with respect to surface pressure. This definition is sometimes used for boundary layer work. See
! the paragraph below equation 1.5.1c in doi:10.1007/978-94-009-3027-8.
Expand Down
3 changes: 3 additions & 0 deletions src/dynamics/se/dp_coupling.F90
Original file line number Diff line number Diff line change
Expand Up @@ -588,6 +588,7 @@ subroutine derived_phys_dry(cam_runtime_opts, phys_state, phys_tend)
use air_composition, only: dry_air_species_num
use physics_types, only: cpairv, rairv, zvirv, cappav
use physics_types, only: cp_or_cv_dycore
use physics_types, only: cp_or_cv_dycore_at_start_of_physics_timestep
use physics_grid, only: columns_on_task
use geopotential_temp, only: geopotential_temp_run
use static_energy, only: update_dry_static_energy_run
Expand Down Expand Up @@ -807,6 +808,8 @@ subroutine derived_phys_dry(cam_runtime_opts, phys_state, phys_tend)
cp_or_cv_dycore = cp_or_cv_dycore &
)

cp_or_cv_dycore_at_start_of_physics_timestep(:,:) = cp_or_cv_dycore(:,:)

!$omp parallel do num_threads(horz_num_threads) private (k, i)
do k = 1, nlev
do i = 1, pcols
Expand Down
2 changes: 1 addition & 1 deletion tools/stdnames_to_inputnames_dictionary.xml
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,7 @@
<ic_file_input_name>state_tw_cur</ic_file_input_name>
</ic_file_input_names>
</entry>
<entry stdname="specific_heat_of_air_used_in_dycore">
<entry stdname="specific_heat_of_air_used_in_dycore_at_start_of_physics_timestep">
<ic_file_input_names>
<ic_file_input_name>cp_or_cv_dycore</ic_file_input_name>
</ic_file_input_names>
Expand Down
Loading