Skip to content

Commit

Permalink
As suggested use tendencies for dycore_energy_consistency_adjust
Browse files Browse the repository at this point in the history
  • Loading branch information
jimmielin committed Nov 15, 2024
1 parent 7b188e3 commit 419bc0e
Show file tree
Hide file tree
Showing 4 changed files with 47 additions and 20 deletions.
31 changes: 19 additions & 12 deletions schemes/check_energy/dycore_energy_consistency_adjust.F90
Original file line number Diff line number Diff line change
Expand Up @@ -15,26 +15,33 @@ subroutine dycore_energy_consistency_adjust_run( &
ncol, pver, &
do_consistency_adjust, &
scaling_dycore, &
temp_ini, &
t, &
tend_dtdt)
tend_dTdt, &
T, &
tend_dTdt_local)

! Input arguments
integer, intent(in) :: ncol ! number of atmospheric columns
integer, intent(in) :: pver ! number of vertical layers
logical, intent(in) :: do_consistency_adjust ! do energy consistency adjustment?
real(kind_phys), intent(in) :: scaling_dycore(:,:) ! scaling for conversion of temperature increment [1]
real(kind_phys), intent(in) :: temp_ini(:,:) ! initial temperature [K]
real(kind_phys), intent(in) :: tend_dTdt(:,:) ! model physics temperature tendency [K s-1]

! Input/output arguments
real(kind_phys), intent(inout) :: T(:,:) ! temperature [K]
real(kind_phys), intent(inout) :: tend_dtdt(:,:) ! model phys temperature tendency [K s-1]

if(do_consistency_adjust) then
T(:ncol,:) = temp_ini(:ncol,:) + &
scaling_dycore(:ncol,:) * (T(:ncol,:) - temp_ini(:ncol,:))

tend_dtdt(:ncol,:) = scaling_dycore(:ncol,:) * tend_dtdt(:ncol,:)
real(kind_phys), intent(inout) :: T(:,:) ! air temperature [K]

! Output arguments
real(kind_phys), intent(out) :: tend_dTdt_local(:,:) ! (scheme) temperature tendency [K s-1]

if (do_consistency_adjust) then
! original formula for scaling of temperature:
! T(:ncol,:) = temp_ini(:ncol,:) + &
! scaling_dycore(:ncol,:) * (T(:ncol,:) - temp_ini(:ncol,:))
! and temperature tendency due to model physics:
! tend_dTdt(:ncol,:) = scaling_dycore(:ncol,:) * tend_dTdt(:ncol,:)
!
! the terms can be arranged for this scaling to be applied through scheme tendencies
! at the cost of a round-off level difference
tend_dTdt_local(:ncol,:) = (scaling_dycore(:ncol,:) - 1._kind_phys) * tend_dTdt(:ncol,:)
endif
! do nothing for dynamical cores with energy consistent with CAM physics

Expand Down
12 changes: 6 additions & 6 deletions schemes/check_energy/dycore_energy_consistency_adjust.meta
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,9 @@
type = real | kind = kind_phys
dimensions = (horizontal_loop_extent, vertical_layer_dimension)
intent = in
[ temp_ini ]
standard_name = air_temperature_at_start_of_physics_timestep
units = K
[ tend_dTdt ]
standard_name = tendency_of_air_temperature_due_to_model_physics
units = K s-1
type = real | kind = kind_phys
dimensions = (horizontal_loop_extent, vertical_layer_dimension)
intent = in
Expand All @@ -41,9 +41,9 @@
type = real | kind = kind_phys
dimensions = (horizontal_loop_extent, vertical_layer_dimension)
intent = inout
[ tend_dtdt ]
standard_name = tendency_of_air_temperature_due_to_model_physics
[ tend_dTdt_local ]
standard_name = tendency_of_air_temperature
units = K s-1
type = real | kind = kind_phys
dimensions = (horizontal_loop_extent, vertical_layer_dimension)
intent = inout
intent = out
12 changes: 11 additions & 1 deletion suites/suite_kessler.xml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,14 @@
<scheme>qneg</scheme>
<scheme>geopotential_temp</scheme>

<!-- Energy conservation error messages cannot be turned on in simple physics
unless the appropriate heat surface flux is computed
and supplied as an argument to check_energy_chng to account for
how the simplified physics forcings are changing the total energy. -->
<scheme>check_energy_zero_fluxes</scheme>
<scheme>check_energy_scaling</scheme>
<scheme>check_energy_chng</scheme>

<!-- State diagnostics -->
<scheme>sima_state_diagnostics</scheme>
<scheme>kessler_diagnostics</scheme>
Expand All @@ -26,9 +34,11 @@

<!-- MPAS and SE specific scaling of temperature for enforcing energy consistency:
First, calculate the scaling based off cp_or_cv_dycore (from cam_thermo_water_update)
Then, perform the temperature and temperature tendency scaling -->
Then, perform the temperature and temperature tendency scaling,
and apply tendencies resulting from such adjustment -->
<scheme>check_energy_scaling</scheme>
<scheme>dycore_energy_consistency_adjust</scheme>
<scheme>apply_tendency_of_air_temperature</scheme>

<!-- Tendency diagnostics -->
<scheme>sima_tend_diagnostics</scheme>
Expand Down
12 changes: 11 additions & 1 deletion suites/suite_tj2016.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,14 @@
<scheme>apply_heating_rate</scheme>
<scheme>qneg</scheme>

<!-- Energy conservation error messages cannot be turned on in simple physics
unless the appropriate heat surface flux is computed
and supplied as an argument to check_energy_chng to account for
how the simplified physics forcings are changing the total energy. -->
<scheme>check_energy_zero_fluxes</scheme>
<scheme>check_energy_scaling</scheme>
<scheme>check_energy_chng</scheme>

<!-- State diagnostics -->
<scheme>sima_state_diagnostics</scheme>
</group>
Expand All @@ -20,9 +28,11 @@

<!-- MPAS and SE specific scaling of temperature for enforcing energy consistency:
First, calculate the scaling based off cp_or_cv_dycore (from cam_thermo_water_update)
Then, perform the temperature and temperature tendency scaling -->
Then, perform the temperature and temperature tendency scaling,
and apply tendencies resulting from such adjustment -->
<scheme>check_energy_scaling</scheme>
<scheme>dycore_energy_consistency_adjust</scheme>
<scheme>apply_tendency_of_air_temperature</scheme>

<!-- Tendency diagnostics -->
<scheme>sima_tend_diagnostics</scheme>
Expand Down

0 comments on commit 419bc0e

Please sign in to comment.