Skip to content

Add sedimentation of rhoa, q_tot and moisture tracers to edmf #3843

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
4 changes: 2 additions & 2 deletions .buildkite/Manifest-v1.11.toml
Original file line number Diff line number Diff line change
Expand Up @@ -381,9 +381,9 @@ weakdeps = ["CUDA", "MPI"]

[[deps.ClimaCore]]
deps = ["Adapt", "BandedMatrices", "BlockArrays", "ClimaComms", "CubedSphere", "DataStructures", "ForwardDiff", "GaussQuadrature", "GilbertCurves", "HDF5", "InteractiveUtils", "IntervalSets", "KrylovKit", "LazyBroadcast", "LinearAlgebra", "MultiBroadcastFusion", "NVTX", "PkgVersion", "RecursiveArrayTools", "RootSolvers", "SparseArrays", "StaticArrays", "Statistics", "UnrolledUtilities"]
git-tree-sha1 = "14d3d5810ce1e3c990450a2ce7abc6a1e162855f"
git-tree-sha1 = "a273452127dbb052f2963e3c1095730a996d49a6"
uuid = "d414da3d-4745-48bb-8d80-42e94e092884"
version = "0.14.35"
version = "0.14.36"
weakdeps = ["CUDA", "Krylov"]

[deps.ClimaCore.extensions]
Expand Down
15 changes: 12 additions & 3 deletions .buildkite/pipeline.yml
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ steps:
--config_file $CONFIG_PATH/single_column_precipitation_test.yml
--job_id single_column_precipitation_test
artifact_paths: "single_column_precipitation_test/output_active/*"

- label: ":umbrella: 2-moment precipitation sanity test single column"
command: >
julia --color=yes --project=.buildkite .buildkite/ci_driver.jl
Expand Down Expand Up @@ -854,6 +854,15 @@ steps:
agents:
slurm_mem: 20GB

- label: ":genie: Prognostic EDMFX Dycoms RF02 in a column"
command: >
julia --color=yes --project=.buildkite .buildkite/ci_driver.jl
--config_file $CONFIG_PATH/prognostic_edmfx_dycoms_rf02_column.yml
--job_id prognostic_edmfx_dycoms_rf02_column
artifact_paths: "prognostic_edmfx_dycoms_rf02_column/output_active/*"
agents:
slurm_mem: 20GB

- label: ":umbrella: Prognostic EDMFX Rico in a column"
command: >
julia --color=yes --project=.buildkite .buildkite/ci_driver.jl
Expand Down Expand Up @@ -1035,9 +1044,9 @@ steps:
agents:
slurm_gpus: 1
slurm_mem: 16GB

- label: ":earth_americas: GPU: Diagnostic EDMFX ERA5 Weather Model Initial Condition"
command: >
command: >
julia --color=yes --project=.buildkite .buildkite/ci_driver.jl
--config_file $CONFIG_PATH/diagnostic_edmfx_era5_initial_condition.yml
--job_id diagnostic_edmfx_era5_initial_condition
Expand Down
2 changes: 1 addition & 1 deletion Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ ArgParse = "1"
Artifacts = "1"
AtmosphericProfilesLibrary = "0.1.7"
ClimaComms = "0.6.8"
ClimaCore = "0.14.35"
ClimaCore = "0.14.36"
ClimaDiagnostics = "0.2.12"
ClimaInterpolations = "0.1.0"
ClimaParams = "0.10.35"
Expand Down
43 changes: 43 additions & 0 deletions config/model_configs/prognostic_edmfx_dycoms_rf02_column.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
initial_condition: DYCOMS_RF02
subsidence: DYCOMS
scm_coriolis: DYCOMS_RF02
rad: DYCOMS
surface_setup: DYCOMS_RF02
turbconv: "prognostic_edmfx"
implicit_diffusion: false
approximate_linear_solve_iters: 2
edmfx_upwinding: first_order
edmfx_entr_model: "Generalized"
edmfx_detr_model: "Generalized"
edmfx_sgs_mass_flux: true
edmfx_sgs_diffusive_flux: true
edmfx_nh_pressure: true
edmfx_filter: true
prognostic_tke: true
moist: "nonequil"
cloud_model: "quadrature_sgs"
precip_model: "1M"
call_cloud_diagnostics_per_stage: true
config: "column"
x_elem: 2
y_elem: 2
z_elem: 30
z_max: 1500
z_stretch: false
perturb_initstate: false
dt: 10secs
t_end: 6hours
dt_save_state_to_disk: 10mins
toml: [toml/prognostic_edmfx_1M.toml]
netcdf_interpolation_num_points: [8, 8, 30]
diagnostics:
- short_name: [ts, ta, thetaa, ha, pfull, rhoa, ua, va, wa, hur, hus, cl, clw, cli, hussfc, evspsbl, pr]
period: 10mins
- short_name: [arup, waup, taup, thetaaup, haup, husup, hurup, clwup, cliup, husraup, hussnup]
period: 10mins
- short_name: [waen, taen, thetaaen, haen, husen, huren, clwen, clien, husraen, hussnen, tke]
period: 10mins
- short_name: [entr, detr, lmix, bgrad, strain, edt, evu]
period: 10mins
- short_name: [husra, hussn]
period: 10mins
1 change: 1 addition & 0 deletions post_processing/ci_plots.jl
Original file line number Diff line number Diff line change
Expand Up @@ -1400,6 +1400,7 @@ EDMFBoxPlots = Union{
EDMFBoxPlotsWithPrecip = Union{
Val{:prognostic_edmfx_rico_column},
Val{:prognostic_edmfx_trmm_column},
Val{:prognostic_edmfx_dycoms_rf02_column},
}
"""
plot_edmf_vert_profile!(grid_loc, var_group)
Expand Down
6 changes: 6 additions & 0 deletions src/cache/precomputed_quantities.jl
Original file line number Diff line number Diff line change
Expand Up @@ -165,6 +165,12 @@ function precomputed_quantities(Y, atmos)
ᶜSqᵢᵖʲs = similar(Y.c, NTuple{n, FT}),
ᶜSqᵣᵖʲs = similar(Y.c, NTuple{n, FT}),
ᶜSqₛᵖʲs = similar(Y.c, NTuple{n, FT}),
ᶜwₗʲs = similar(Y.c, NTuple{n, FT}),
ᶜwᵢʲs = similar(Y.c, NTuple{n, FT}),
ᶜwᵣʲs = similar(Y.c, NTuple{n, FT}),
ᶜwₛʲs = similar(Y.c, NTuple{n, FT}),
ᶜwₜʲs = similar(Y.c, NTuple{n, FT}),
ᶜwₕʲs = similar(Y.c, NTuple{n, FT}),
ᶜSqₗᵖ⁰ = similar(Y.c, FT),
ᶜSqᵢᵖ⁰ = similar(Y.c, FT),
ᶜSqᵣᵖ⁰ = similar(Y.c, FT),
Expand Down
60 changes: 60 additions & 0 deletions src/cache/prognostic_edmf_precomputed_quantities.jl
Original file line number Diff line number Diff line change
Expand Up @@ -608,13 +608,73 @@ NVTX.@annotate function set_prognostic_edmf_precomputed_quantities_precipitation
(; ᶜSqₗᵖ⁰, ᶜSqᵢᵖ⁰, ᶜSqᵣᵖ⁰, ᶜSqₛᵖ⁰, ᶜρ⁰, ᶜts⁰) = p.precomputed
(; ᶜq_tot⁰, ᶜq_liq⁰, ᶜq_ice⁰, ᶜq_rai⁰, ᶜq_sno⁰) = p.precomputed

(; ᶜwₗʲs, ᶜwᵢʲs, ᶜwᵣʲs, ᶜwₛʲs, ᶜwₜʲs, ᶜwₕʲs) = p.precomputed

# TODO - can I re-use them between js and env?
ᶜSᵖ = p.scratch.ᶜtemp_scalar
ᶜSᵖ_snow = p.scratch.ᶜtemp_scalar_2

n = n_mass_flux_subdomains(p.atmos.turbconv_model)
FT = eltype(params)

for j in 1:n

# compute terminal velocity for precipitation
@. ᶜwᵣʲs.:($$j) = CM1.terminal_velocity(
cmp.pr,
cmp.tv.rain,
ᶜρʲs.:($$j),
max(zero(Y.c.ρ), Y.c.sgsʲs.:($$j).q_rai),
)
@. ᶜwₛʲs.:($$j) = CM1.terminal_velocity(
cmp.ps,
cmp.tv.snow,
ᶜρʲs.:($$j),
max(zero(Y.c.ρ), Y.c.sgsʲs.:($$j).q_sno),
)
# compute sedimentation velocity for cloud condensate [m/s]
@. ᶜwₗʲs.:($$j) = CMNe.terminal_velocity(
cmc.liquid,
cmc.Ch2022.rain,
ᶜρʲs.:($$j),
max(zero(Y.c.ρ), Y.c.sgsʲs.:($$j).q_liq),
)
@. ᶜwᵢʲs.:($$j) = CMNe.terminal_velocity(
cmc.ice,
cmc.Ch2022.small_ice,
ᶜρʲs.:($$j),
max(zero(Y.c.ρ), Y.c.sgsʲs.:($$j).q_ice),
)
# compute their contirbutions to energy and total water advection
@. ᶜwₜʲs.:($$j) = ifelse(
Y.c.sgsʲs.:($$j).ρa * Y.c.sgsʲs.:($$j).q_tot > FT(0),
(
ᶜwₗʲs.:($$j) * Y.c.sgsʲs.:($$j).q_liq +
ᶜwᵢʲs.:($$j) * Y.c.sgsʲs.:($$j).q_ice +
ᶜwᵣʲs.:($$j) * Y.c.sgsʲs.:($$j).q_rai +
ᶜwₛʲs.:($$j) * Y.c.sgsʲs.:($$j).q_sno
) / Y.c.sgsʲs.:($$j).ρa / Y.c.sgsʲs.:($$j).q_tot,
FT(0),
)
@. ᶜwₕʲs.:($$j) = ifelse(
Y.c.sgsʲs.:($$j).ρa * abs(Y.c.sgsʲs.:($$j).mse) > FT(0),
(
ᶜwₗʲs.:($$j) *
Y.c.sgsʲs.:($$j).q_liq *
(Iₗ(thp, ᶜtsʲs.:($$j)) + ᶜΦ) +
ᶜwᵢʲs.:($$j) *
Y.c.sgsʲs.:($$j).q_ice *
(Iᵢ(thp, ᶜtsʲs.:($$j)) + ᶜΦ) +
ᶜwᵣʲs.:($$j) *
Y.c.sgsʲs.:($$j).q_rai *
(Iₗ(thp, ᶜtsʲs.:($$j)) + ᶜΦ) +
ᶜwₛʲs.:($$j) *
Y.c.sgsʲs.:($$j).q_sno *
(Iᵢ(thp, ᶜtsʲs.:($$j)) + ᶜΦ)
) / Y.c.sgsʲs.:($$j).ρa / abs(Y.c.sgsʲs.:($$j).mse),
FT(0),
)

# Precipitation sources and sinks from the updrafts
compute_precipitation_sources!(
ᶜSᵖ,
Expand Down
Loading
Loading