Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add constituent tendency updater #111

Merged
merged 7 commits into from
Nov 27, 2024
Merged
Show file tree
Hide file tree
Changes from 4 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
1 change: 1 addition & 0 deletions schemes/dry_adiabatic_adjust/dadadj.meta
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,7 @@
type = real | kind = kind_phys
dimensions = (horizontal_loop_extent, vertical_layer_dimension)
intent = out
constituent = True
[ dadpdf ]
standard_name = binary_indicator_for_dry_adiabatic_adjusted_grid_cell
units = fraction
Expand Down
33 changes: 0 additions & 33 deletions schemes/dry_adiabatic_adjust/dadadj_apply_qv_tendency.F90

This file was deleted.

42 changes: 0 additions & 42 deletions schemes/dry_adiabatic_adjust/dadadj_apply_qv_tendency.meta

This file was deleted.

26 changes: 26 additions & 0 deletions schemes/utilities/physics_tendency_updaters.F90
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ module physics_tendency_updaters
public :: apply_tendency_of_northward_wind_run
public :: apply_heating_rate_run
public :: apply_tendency_of_air_temperature_run
public :: apply_constituent_tendencies_run

CONTAINS

Expand Down Expand Up @@ -117,4 +118,29 @@ subroutine apply_tendency_of_air_temperature_run(nz, t_tend, temp, dtdT_total,

end subroutine apply_tendency_of_air_temperature_run

!> \section arg_table_apply_constituent_tendencies_run Argument Table
!!! \htmlinclude apply_constituent_tendencies_run.html
subroutine apply_constituent_tendencies_run(nz, const_tend, const, dt, errcode, errmsg)
! Dummy arguments
integer, intent(in) :: nz ! Num vertical layers
real(kind_phys), intent(inout) :: const_tend(:,:,:) ! constituent tendency array
real(kind_phys), intent(inout) :: const(:,:,:) ! constituent state array
real(kind_phys), intent(in) :: dt ! physics time step
integer, intent(out) :: errcode
character(len=512), intent(out) :: errmsg

! Local variables
integer :: klev

errcode = 0
errmsg = ''

do klev = 1, nz
const(:, klev, :) = const(:, klev, :) + (const_tend(:, klev, :) * dt)
end do

const_tend = 0._kind_phys

end subroutine apply_constituent_tendencies_run

end module physics_tendency_updaters
49 changes: 49 additions & 0 deletions schemes/utilities/physics_tendency_updaters.meta
Original file line number Diff line number Diff line change
Expand Up @@ -215,4 +215,53 @@
type = character | kind = len=512
dimensions = ()
intent = out
#####################################################################
[ccpp-table-properties]
name = apply_constituent_tendencies
type = scheme
[ccpp-arg-table]
name = apply_constituent_tendencies_run
type = scheme
[ nz ]
standard_name = vertical_layer_dimension
long_name = Number of vertical layers
units = count
type = integer
dimensions = ()
intent = in
[ const_tend ]
standard_name = ccpp_constituent_tendencies
long_name = ccpp constituent tendencies
units = none
type = real | kind = kind_phys
dimensions = (horizontal_loop_extent, vertical_layer_dimension, number_of_ccpp_constituents)
intent = inout
[ const ]
standard_name = ccpp_constituents
long_name = ccpp constituents
units = none
type = real | kind = kind_phys
dimensions = (horizontal_loop_extent, vertical_layer_dimension, number_of_ccpp_constituents)
intent = inout
[ dt ]
standard_name = timestep_for_physics
long_name = time step
units = s
dimensions = ()
type = real | kind = kind_phys
intent = in
[ errcode ]
standard_name = ccpp_error_code
long_name = Error flag for error handling in CCPP
units = 1
type = integer
dimensions = ()
intent = out
[ errmsg ]
standard_name = ccpp_error_message
long_name = Error message for error handling in CCPP
units = none
type = character | kind = len=512
dimensions = ()
intent = out
#########################################################
2 changes: 1 addition & 1 deletion test/test_suites/suite_dry_adiabatic_adjust.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<group name="physics_before_coupler">
<!-- Dry Adiabatic Adjustment -->
<scheme>dadadj</scheme>
<scheme>dadadj_apply_qv_tendency</scheme>
<scheme>apply_constituent_tendencies</scheme>
<scheme>apply_heating_rate</scheme>
<scheme>qneg</scheme>
<scheme>geopotential_temp</scheme>
Expand Down