Skip to content

Commit

Permalink
Merge pull request #3484 from CliMA/zs/add_zg_diagnostics
Browse files Browse the repository at this point in the history
add geopotential height diagnostics
  • Loading branch information
szy21 authored Dec 16, 2024
2 parents 3cc8b13 + 000e0cb commit 0b0103f
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 0 deletions.
17 changes: 17 additions & 0 deletions src/diagnostics/core_diagnostics.jl
Original file line number Diff line number Diff line change
Expand Up @@ -210,6 +210,23 @@ add_diagnostic_variable!(
end,
)

###
# Geopotential height (3d)
###
add_diagnostic_variable!(
short_name = "zg",
long_name = "Geopotential Height",
standard_name = "geopotential_height",
units = "m",
compute! = (out, state, cache, time) -> begin
if isnothing(out)
return cache.core.ᶜΦ ./ CAP.grav(cache.params)
else
out .= cache.core.ᶜΦ ./ CAP.grav(cache.params)
end
end,
)

###
# Cloud fraction (3d)
###
Expand Down
1 change: 1 addition & 0 deletions src/diagnostics/default_diagnostics.jl
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,7 @@ function core_default_diagnostics(output_writer, duration, start_date)
"thetaa",
"ha",
"pfull",
"zg",
"rhoa",
"ua",
"va",
Expand Down

0 comments on commit 0b0103f

Please sign in to comment.