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
8 changes: 4 additions & 4 deletions schemes/gravity_wave_drag/gravity_wave_drag_convection.F90
Original file line number Diff line number Diff line change
Expand Up @@ -184,8 +184,8 @@ subroutine gravity_wave_drag_convection_deep_run(&
real(kind_phys), intent(out) :: ttgw(:, :) ! Temperature tendency from gravity waves [K s-1]
real(kind_phys), intent(out) :: qtgw(:, :, :) ! Constituent tendencies from gravity waves [kg kg-1 s-1]
real(kind_phys), intent(inout) :: egwdffi_tot(:, :) ! Effective diffusivity coefficient from gravity waves, interfaces [m2 s-1]
real(kind_phys), intent(out) :: dttdf(:, :) ! Temperature tendency from diffusion [K s-1]
real(kind_phys), intent(out) :: dttke(:, :) ! Temperature tendency from kinetic energy dissipation [K s-1]
real(kind_phys), intent(out) :: dttdf(:, :) ! Dry air enthalpy tendency from diffusion [J kg-1 s-1]
real(kind_phys), intent(out) :: dttke(:, :) ! Dry air enthalpy tendency from kinetic energy dissipation [J kg-1 s-1]

! Copies of taucd in each direction for diagnostic.
real(kind_phys), intent(out) :: taucd_west(:, :) ! Reynolds stress for waves in W direction, interfaces [N m-2]
Expand Down Expand Up @@ -478,8 +478,8 @@ subroutine gravity_wave_drag_convection_shallow_run(&
real(kind_phys), intent(out) :: ttgw(:, :) ! Temperature tendency from gravity waves [K s-1]
real(kind_phys), intent(out) :: qtgw(:, :, :) ! Constituent tendencies from gravity waves [kg kg-1 s-1]
real(kind_phys), intent(inout) :: egwdffi_tot(:, :) ! Effective diffusivity coefficient from gravity waves, interfaces [m2 s-1]
real(kind_phys), intent(out) :: dttdf(:, :) ! Temperature tendency from diffusion [K s-1]
real(kind_phys), intent(out) :: dttke(:, :) ! Temperature tendency from kinetic energy dissipation [K s-1]
real(kind_phys), intent(out) :: dttdf(:, :) ! Dry air enthalpy tendency from diffusion [J kg-1 s-1]
real(kind_phys), intent(out) :: dttke(:, :) ! Dry air enthalpy tendency from kinetic energy dissipation [J kg-1 s-1]

character(len=512), intent(out) :: errmsg
integer, intent(out) :: errflg
Expand Down
16 changes: 8 additions & 8 deletions schemes/gravity_wave_drag/gravity_wave_drag_convection.meta
Original file line number Diff line number Diff line change
Expand Up @@ -275,8 +275,8 @@
dimensions = (horizontal_loop_extent)
intent = out
[ hdepth ]
standard_name = convective_heating_depth_due_to_deep_convective_gravity_wave_drag
units = km
standard_name = convective_heating_depth_for_deep_convective_gravity_wave_drag
units = m
type = real | kind = kind_phys
dimensions = (horizontal_loop_extent)
intent = out
Expand Down Expand Up @@ -317,13 +317,13 @@
dimensions = (horizontal_loop_extent, vertical_interface_dimension)
intent = inout
[ dttdf ]
standard_name = tendency_of_air_temperature_due_to_diffusion_due_to_deep_convective_gravity_wave_drag
standard_name = tendency_of_dry_air_enthalpy_at_constant_pressure_due_to_diffusion_due_to_deep_convective_gravity_wave_drag
units = J kg-1 s-1
type = real | kind = kind_phys
dimensions = (horizontal_loop_extent, vertical_layer_dimension)
intent = out
[ dttke ]
standard_name = tendency_of_air_temperature_due_to_kinetic_energy_dissipation_due_to_deep_convective_gravity_wave_drag
standard_name = tendency_of_dry_air_enthalpy_due_to_kinetic_energy_dissipation_due_to_deep_convective_gravity_wave_drag
units = J kg-1 s-1
type = real | kind = kind_phys
dimensions = (horizontal_loop_extent, vertical_layer_dimension)
Expand Down Expand Up @@ -642,7 +642,7 @@
dimensions = (horizontal_loop_extent)
intent = out
[ hdepth ]
standard_name = convective_heating_depth_due_to_shallow_convective_gravity_wave_drag
standard_name = convective_heating_depth_for_shallow_convective_gravity_wave_drag
units = km
type = real | kind = kind_phys
dimensions = (horizontal_loop_extent)
Expand All @@ -667,7 +667,7 @@
intent = out
[ ttgw ]
standard_name = tendency_of_air_temperature_due_to_shallow_convective_gravity_wave_drag
units = J kg-1 s-1
units = K s-1
type = real | kind = kind_phys
dimensions = (horizontal_loop_extent, vertical_layer_dimension)
intent = out
Expand All @@ -684,13 +684,13 @@
dimensions = (horizontal_loop_extent, vertical_interface_dimension)
intent = inout
[ dttdf ]
standard_name = tendency_of_air_temperature_due_to_diffusion_due_to_shallow_convective_gravity_wave_drag
standard_name = tendency_of_dry_air_enthalpy_at_constant_pressure_due_to_diffusion_due_to_shallow_convective_gravity_wave_drag
units = J kg-1 s-1
type = real | kind = kind_phys
dimensions = (horizontal_loop_extent, vertical_layer_dimension)
intent = out
[ dttke ]
standard_name = tendency_of_air_temperature_due_to_kinetic_energy_dissipation_due_to_shallow_convective_gravity_wave_drag
standard_name = tendency_of_dry_air_enthalpy_at_constant_pressure_due_to_kinetic_energy_dissipation_due_to_shallow_convective_gravity_wave_drag
units = J kg-1 s-1
type = real | kind = kind_phys
dimensions = (horizontal_loop_extent, vertical_layer_dimension)
Expand Down
8 changes: 4 additions & 4 deletions schemes/gravity_wave_drag/gravity_wave_drag_frontogenesis.F90
Original file line number Diff line number Diff line change
Expand Up @@ -302,8 +302,8 @@ subroutine gravity_wave_drag_frontogenesis_run( &
real(kind_phys), intent(out) :: vtgw(:, :) ! Meridional wind tendency from gravity waves [m s-2]
real(kind_phys), intent(out) :: ttgw(:, :) ! Temperature tendency from gravity waves [K s-1]
real(kind_phys), intent(out) :: qtgw(:, :, :) ! Constituent tendencies from gravity waves [kg kg-1 s-1]
real(kind_phys), intent(out) :: dttdf(:, :) ! Temperature tendency from diffusion [K s-1]
real(kind_phys), intent(out) :: dttke(:, :) ! Temperature tendency from kinetic energy dissipation [K s-1]
real(kind_phys), intent(out) :: dttdf(:, :) ! Dry air enthalpy tendency from diffusion [J kg-1 s-1]
real(kind_phys), intent(out) :: dttke(:, :) ! Dry air enthalpy tendency from kinetic energy dissipation [J kg-1 s-1]

! Copies of taucd in each direction for diagnostic.
real(kind_phys), intent(out) :: taucd_west(:, :) ! Reynolds stress for waves in W direction, interfaces [N m-2]
Expand Down Expand Up @@ -505,8 +505,8 @@ subroutine gravity_wave_drag_frontogenesis_inertial_run( &
real(kind_phys), intent(out) :: vtgw(:, :) ! Meridional wind tendency from gravity waves [m s-2]
real(kind_phys), intent(out) :: ttgw(:, :) ! Temperature tendency from gravity waves [K s-1]
real(kind_phys), intent(out) :: qtgw(:, :, :) ! Constituent tendencies from gravity waves [kg kg-1 s-1]
real(kind_phys), intent(out) :: dttdf(:, :) ! Temperature tendency from diffusion [K s-1]
real(kind_phys), intent(out) :: dttke(:, :) ! Temperature tendency from kinetic energy dissipation [K s-1]
real(kind_phys), intent(out) :: dttdf(:, :) ! Dry air enthalpy tendency from diffusion [J kg-1 s-1]
real(kind_phys), intent(out) :: dttke(:, :) ! Dry air enthalpy tendency from kinetic energy dissipation [J kg-1 s-1]
character(len=512), intent(out) :: errmsg
integer, intent(out) :: errflg

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -317,13 +317,13 @@
dimensions = (horizontal_loop_extent, vertical_layer_dimension, number_of_ccpp_constituents)
intent = out
[ dttdf ]
standard_name = tendency_of_air_temperature_due_to_diffusion_due_to_frontogenesis_gravity_wave_drag
standard_name = tendency_of_dry_air_enthalpy_at_constant_pressure_due_to_diffusion_due_to_frontogenesis_gravity_wave_drag
units = J kg-1 s-1
type = real | kind = kind_phys
dimensions = (horizontal_loop_extent, vertical_layer_dimension)
intent = out
[ dttke ]
standard_name = tendency_of_air_temperature_due_to_kinetic_energy_dissipation_due_to_frontogenesis_gravity_wave_drag
standard_name = tendency_of_dry_air_enthalpy_at_constant_pressure_due_to_kinetic_energy_dissipation_due_to_frontogenesis_gravity_wave_drag
units = J kg-1 s-1
type = real | kind = kind_phys
dimensions = (horizontal_loop_extent, vertical_layer_dimension)
Expand Down
10 changes: 5 additions & 5 deletions schemes/gravity_wave_drag/gravity_wave_drag_moving_mountain.meta
Original file line number Diff line number Diff line change
Expand Up @@ -306,8 +306,8 @@
dimensions = (horizontal_loop_extent)
intent = out
[ hdepth ]
standard_name = convective_heating_depth_due_to_moving_mountain_gravity_wave_drag
units = km
standard_name = convective_heating_depth_for_moving_mountain_gravity_wave_drag
units = m
type = real | kind = kind_phys
dimensions = (horizontal_loop_extent)
intent = out
Expand Down Expand Up @@ -342,13 +342,13 @@
dimensions = (horizontal_loop_extent, vertical_interface_dimension)
intent = inout
[ dttdf ]
standard_name = tendency_of_air_temperature_due_to_diffusion_due_to_moving_mountain_gravity_wave_drag
standard_name = tendency_of_dry_air_enthalpy_at_constant_pressure_due_to_diffusion_due_to_moving_mountain_gravity_wave_drag
units = J kg-1 s-1
type = real | kind = kind_phys
dimensions = (horizontal_loop_extent, vertical_layer_dimension)
intent = out
[ dttke ]
standard_name = tendency_of_air_temperature_due_to_kinetic_energy_dissipation_due_to_moving_mountain_gravity_wave_drag
standard_name = tendency_of_dry_air_enthalpy_at_constant_pressure_due_to_kinetic_energy_dissipation_due_to_moving_mountain_gravity_wave_drag
units = J kg-1 s-1
type = real | kind = kind_phys
dimensions = (horizontal_loop_extent, vertical_layer_dimension)
Expand Down Expand Up @@ -390,7 +390,7 @@
dimensions = (horizontal_loop_extent)
intent = out
[ xpwp_src ]
standard_name = momentum_flux_source_due_to_moving_mountain_gravity_wave_drag
standard_name = momentum_flux_source_for_moving_mountain_gravity_wave_drag
units = m2 s-2
type = real | kind = kind_phys
dimensions = (horizontal_loop_extent)
Expand Down
4 changes: 2 additions & 2 deletions schemes/gravity_wave_drag/gravity_wave_drag_orographic.F90
Original file line number Diff line number Diff line change
Expand Up @@ -125,8 +125,8 @@ subroutine gravity_wave_drag_orographic_run( &
real(kind_phys), intent(out) :: vtgw(:, :) ! Meridional wind tendency from gravity waves [m s-2]
real(kind_phys), intent(out) :: ttgw(:, :) ! Temperature tendency from gravity waves [K s-1]
real(kind_phys), intent(out) :: qtgw(:, :, :) ! Constituent tendencies from gravity waves [kg kg-1 s-1]
real(kind_phys), intent(out) :: dttdf(:, :) ! Temperature tendency from diffusion [K s-1]
real(kind_phys), intent(out) :: dttke(:, :) ! Temperature tendency from kinetic energy dissipation [K s-1]
real(kind_phys), intent(out) :: dttdf(:, :) ! Dry air enthalpy tendency from diffusion [J kg-1 s-1]
real(kind_phys), intent(out) :: dttke(:, :) ! Dry air enthalpy tendency from kinetic energy dissipation [J kg-1 s-1]
real(kind_phys), intent(inout) :: egwdffi_tot(:, :) ! Effective diffusivity coefficient from gravity waves, interfaces [m2 s-1]
real(kind_phys), intent(out) :: flx_heat(:) ! Surface heat flux for energy conservation check [W m-2]
real(kind_phys), intent(out) :: tau0x(:) ! Zonal gravity wave surface stress [N m-2]
Expand Down
4 changes: 2 additions & 2 deletions schemes/gravity_wave_drag/gravity_wave_drag_orographic.meta
Original file line number Diff line number Diff line change
Expand Up @@ -276,13 +276,13 @@
dimensions = (horizontal_loop_extent, vertical_layer_dimension, number_of_ccpp_constituents)
intent = out
[ dttdf ]
standard_name = tendency_of_air_temperature_due_to_diffusion_due_to_orographic_gravity_wave_drag
standard_name = tendency_of_dry_air_enthalpy_at_constant_pressure_due_to_diffusion_due_to_orographic_gravity_wave_drag
units = J kg-1 s-1
type = real | kind = kind_phys
dimensions = (horizontal_loop_extent, vertical_layer_dimension)
intent = out
[ dttke ]
standard_name = tendency_of_air_temperature_due_to_kinetic_energy_dissipation_due_to_orographic_gravity_wave_drag
standard_name = tendency_of_dry_air_enthalpy_at_constant_pressure_due_to_kinetic_energy_dissipation_due_to_orographic_gravity_wave_drag
units = J kg-1 s-1
type = real | kind = kind_phys
dimensions = (horizontal_loop_extent, vertical_layer_dimension)
Expand Down
58 changes: 56 additions & 2 deletions schemes/sima_diagnostics/gravity_wave_drag_common_diagnostics.F90
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
! Diagnostics for all gravity wave drag parameterizations
! (used to output total diagnostics in the end of all gravity wave drag schemes)
module gravity_wave_drag_common_diagnostics
use ccpp_kinds, only: kind_phys

implicit none
private

Expand All @@ -27,29 +25,85 @@ subroutine gravity_wave_drag_common_diagnostics_init(errmsg, errflg)

! History add field calls
call history_add_field('EKGW', 'effective_diffusivity_coefficient_at_interfaces_due_to_gravity_wave_drag', 'ilev', 'avg', 'm2 s-1')
call history_add_field('TTGW', 'tendency_of_air_temperature_due_to_gravity_wave_drag', 'lev', 'avg', 'K s-1')
call history_add_field('UTGW_TOTAL', 'tendency_of_eastward_wind_due_to_gravity_wave_drag', 'lev', 'avg', 'm s-2')
call history_add_field('VTGW_TOTAL', 'tendency_of_northward_wind_due_to_gravity_wave_drag', 'lev', 'avg', 'm s-2')

call history_add_field('QTGW', 'tendency_of_water_vapor_mixing_ratio_wrt_moist_air_and_condensed_water_due_to_gravity_wave_drag', 'lev', 'avg', 'kg kg-1 s-1')
call history_add_field('CLDLIQTGW', 'tendency_of_cloud_liquid_water_mixing_ratio_wrt_moist_air_and_condensed_water_due_to_gravity_wave_drag', 'lev', 'avg', 'kg kg-1 s-1')
call history_add_field('CLDICETGW', 'tendency_of_cloud_ice_mixing_ratio_wrt_moist_air_and_condensed_water_due_to_gravity_wave_drag', 'lev', 'avg', 'kg kg-1 s-1')
end subroutine gravity_wave_drag_common_diagnostics_init

!> \section arg_table_gravity_wave_drag_common_diagnostics_run Argument Table
!! \htmlinclude gravity_wave_drag_common_diagnostics_run.html
subroutine gravity_wave_drag_common_diagnostics_run( &
const_props, &
cpairv, &
egwdffi_tot, &
tend_q, & ! all ccpp constituent tendencies
tend_u, tend_v, tend_s, &
errmsg, errflg)

use ccpp_kinds, only: kind_phys

use cam_history, only: history_out_field

use runtime_obj, only: wv_stdname

use ccpp_const_utils, only: ccpp_const_get_idx

! framework dependency for const_props
use ccpp_constituent_prop_mod, only: ccpp_constituent_prop_ptr_t

! Input parameters
type(ccpp_constituent_prop_ptr_t), intent(in) :: const_props(:)
real(kind_phys), intent(in) :: cpairv(:,:)
real(kind_phys), intent(in) :: egwdffi_tot(:,:)
real(kind_phys), intent(in) :: tend_q(:,:,:)
real(kind_phys), intent(in) :: tend_u(:,:)
real(kind_phys), intent(in) :: tend_v(:,:)
real(kind_phys), intent(in) :: tend_s(:,:)

! CCPP error handling variables
character(len=512), intent(out) :: errmsg
integer, intent(out) :: errflg

! Local variables for constituent indices
integer :: const_wv_idx, const_cldliq_idx, const_cldice_idx

errmsg = ''
errflg = 0

! Get constituent indices for wv, cldliq, cldice
call ccpp_const_get_idx(const_props, &
wv_stdname, &
const_wv_idx, errmsg, errflg)
if (errflg /= 0) return

call ccpp_const_get_idx(const_props, &
'cloud_liquid_water_mixing_ratio_wrt_moist_air_and_condensed_water', &
const_cldliq_idx, errmsg, errflg)
if (errflg /= 0) return

call ccpp_const_get_idx(const_props, &
'cloud_ice_mixing_ratio_wrt_moist_air_and_condensed_water', &
const_cldice_idx, errmsg, errflg)
if (errflg /= 0) return

! History out field calls
call history_out_field('EKGW', egwdffi_tot)
call history_out_field('TTGW', tend_s/cpairv)
call history_out_field('UTGW_TOTAL', tend_u)
call history_out_field('VTGW_TOTAL', tend_v)

call history_out_field('QTGW', tend_q(:,:,const_wv_idx))
if(const_cldliq_idx > 0) then
call history_out_field('CLDLIQTGW', tend_q(:,:,const_cldliq_idx))
end if

if(const_cldice_idx > 0) then
call history_out_field('CLDICETGW', tend_q(:,:,const_cldice_idx))
end if

end subroutine gravity_wave_drag_common_diagnostics_run

Expand Down
36 changes: 36 additions & 0 deletions schemes/sima_diagnostics/gravity_wave_drag_common_diagnostics.meta
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,48 @@
[ccpp-arg-table]
name = gravity_wave_drag_common_diagnostics_run
type = scheme
[ const_props ]
standard_name = ccpp_constituent_properties
units = none
type = ccpp_constituent_prop_ptr_t
dimensions = (number_of_ccpp_constituents)
intent = in
[ cpairv ]
standard_name = composition_dependent_specific_heat_of_dry_air_at_constant_pressure
units = J kg-1 K-1
type = real | kind = kind_phys
dimensions = (horizontal_loop_extent, vertical_layer_dimension)
intent = in
[ egwdffi_tot ]
standard_name = effective_diffusivity_coefficient_at_interfaces_due_to_gravity_wave_drag
units = m2 s-1
type = real | kind = kind_phys
dimensions = (horizontal_loop_extent, vertical_interface_dimension)
intent = in
[ tend_q ]
standard_name = ccpp_constituent_tendencies
units = none
type = real | kind = kind_phys
dimensions = (horizontal_loop_extent, vertical_layer_dimension, number_of_ccpp_constituents)
intent = in
[ tend_u ]
standard_name = tendency_of_eastward_wind
units = m s-2
type = real | kind = kind_phys
dimensions = (horizontal_loop_extent, vertical_layer_dimension)
intent = in
[ tend_v ]
standard_name = tendency_of_northward_wind
units = m s-2
type = real | kind = kind_phys
dimensions = (horizontal_loop_extent, vertical_layer_dimension)
intent = in
[ tend_s ]
standard_name = tendency_of_dry_air_enthalpy_at_constant_pressure
units = J kg-1 s-1
type = real | kind = kind_phys
dimensions = (horizontal_loop_extent, vertical_layer_dimension)
intent = in
[ errmsg ]
standard_name = ccpp_error_message
units = none
Expand Down
Loading
Loading