Skip to content

Add Rainwater Path Diagnostic #3946

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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
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
5 changes: 4 additions & 1 deletion NEWS.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,13 @@ ClimaAtmos.jl Release Notes
main
-------

### Add RWP diagnostic
PR [#3946](https://github.com/CliMA/ClimaAtmos.jl/pull/3946) adds rainwater path diagnostic variable.

v0.31.1
-------

PR [#3917](https://github.com/CliMA/ClimaAtmos.jl/pull/3917) adds common numercis configs for different resolutions.
PR [#3917](https://github.com/CliMA/ClimaAtmos.jl/pull/3917) adds common numerics configs for different resolutions.
These configurations are intended to serve as the default settings. Please modify them only if you are certain of the implications.

v0.31.0
Expand Down
49 changes: 46 additions & 3 deletions src/diagnostics/core_diagnostics.jl
Original file line number Diff line number Diff line change
Expand Up @@ -1026,7 +1026,7 @@ add_diagnostic_variable!(
short_name = "clwvi",
long_name = "Condensed Water Path",
standard_name = "atmosphere_mass_content_of_cloud_condensed_water",
units = "kg m-2",
units = "kg m^-2",
comments = """
Mass of condensed (liquid + ice) water in the column divided by the area of the column
(not just the area of the cloudy portion of the column). It doesn't include precipitating hydrometeors.
Expand Down Expand Up @@ -1066,7 +1066,7 @@ add_diagnostic_variable!(
short_name = "lwp",
long_name = "Liquid Water Path",
standard_name = "atmosphere_mass_content_of_cloud_liquid_water",
units = "kg m-2",
units = "kg m^-2",
comments = """
The total mass of liquid water in cloud per unit area.
(not just the area of the cloudy portion of the column). It doesn't include precipitating hydrometeors.
Expand Down Expand Up @@ -1106,7 +1106,7 @@ add_diagnostic_variable!(
short_name = "clivi",
long_name = "Ice Water Path",
standard_name = "atmosphere_mass_content_of_cloud_ice",
units = "kg m-2",
units = "kg m^-2",
comments = """
The total mass of ice in cloud per unit area.
(not just the area of the cloudy portion of the column). It doesn't include precipitating hydrometeors.
Expand Down Expand Up @@ -1504,6 +1504,9 @@ add_diagnostic_variable!(
compute! = compute_cape!,
)

###
# Mean sea level pressure (2d)
###
function compute_mslp!(out, state, cache, time)
thermo_params = CAP.thermodynamics_params(cache.params)
g = TD.Parameters.grav(thermo_params)
Expand Down Expand Up @@ -1536,3 +1539,43 @@ add_diagnostic_variable!(
comments = "Mean sea level pressure computed from the hypsometric equation",
compute! = compute_mslp!,
)

###
# Rainwater path (2d)
###
compute_rwp!(out, state, cache, time) =
compute_rwp!(out, state, cache, time, cache.atmos.microphysics_model)
compute_rwp!(_, _, _, _, model::T) where {T} =
error_diagnostic_variable("rwp", model)

function compute_rwp!(
out,
state,
cache,
time,
moisture_model::T,
) where {T <: Union{Microphysics1Moment, Microphysics2Moment}}
if isnothing(out)
out = zeros(axes(Fields.level(state.f, half)))
rw = cache.scratch.ᶜtemp_scalar
@. rw = state.c.ρq_rai
Operators.column_integral_definite!(out, rw)
return out
else
rw = cache.scratch.ᶜtemp_scalar
@. rw = state.c.ρq_rai
Operators.column_integral_definite!(out, rw)
end
end

add_diagnostic_variable!(
short_name = "rwp",
long_name = "Rainwater Path",
standard_name = "atmosphere_mass_content_of_rainwater",
units = "kg m^-2",
comments = """
The total mass of rainwater per unit area.
(not just the area of the cloudy portion of the column).
""",
compute! = compute_rwp!,
)
Loading