Skip to content

Commit 6c710df

Browse files
authored
Merge pull request #3705 from CliMA/aj/prognostic_edmf_1M
Prognostic EDMF + 1M
2 parents 97e5a7e + a1cca2c commit 6c710df

17 files changed

+924
-204
lines changed

.buildkite/pipeline.yml

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -398,7 +398,7 @@ steps:
398398
artifact_paths: "aquaplanet_equil_clearsky_tvinsol_0M_slabocean_ft64/output_active/*"
399399
agents:
400400
slurm_mem: 20GB
401-
401+
402402
- label: ":computer: aquaplanet for coupler"
403403
command: >
404404
julia --color=yes --project=.buildkite .buildkite/ci_driver.jl
@@ -725,7 +725,7 @@ steps:
725725
artifact_paths: "prognostic_edmfx_simpleplume_column/output_active/*"
726726
agents:
727727
slurm_mem: 20GB
728-
728+
729729
- label: ":genie: Prognostic EDMFX Soares in a column"
730730
command: >
731731
julia --color=yes --project=.buildkite .buildkite/ci_driver.jl
@@ -811,7 +811,6 @@ steps:
811811
artifact_paths: "prognostic_edmfx_rico_column/output_active/*"
812812
agents:
813813
slurm_mem: 20GB
814-
soft_fail: true
815814

816815
- label: ":umbrella: Prognostic EDMFX TRMM in a column"
817816
command: >
@@ -906,7 +905,7 @@ steps:
906905
depends_on:
907906
- "baroclinic_wave"
908907
- "baroclinic_wave_gpu"
909-
908+
910909

911910
- label: "GPU: baroclinic wave - 2 gpus"
912911
key: "baroclinic_wave_2gpu"
@@ -956,7 +955,7 @@ steps:
956955
agents:
957956
slurm_gpus: 1
958957
slurm_mem: 20GB
959-
958+
960959
- label: "GPU: Diagnostic EDMFX aquaplanet"
961960
key: "diagnostic_edmfx_aquaplanet_gpu"
962961
command: >
@@ -1011,7 +1010,7 @@ steps:
10111010
--job_id bm_default
10121011
agents:
10131012
slurm_mem: 24GB
1014-
1013+
10151014
- label: ":computer: Benchmark: GPU default"
10161015
command: >
10171016
julia --color=yes --project=.buildkite perf/benchmark.jl
@@ -1078,7 +1077,7 @@ steps:
10781077
artifact_paths: "flame_default_1m/*"
10791078
agents:
10801079
slurm_mem: 24GB
1081-
1080+
10821081
- label: ":fire: Flame graph: diagnostics"
10831082
command: >
10841083
julia --color=yes --project=.buildkite perf/flame.jl
@@ -1105,7 +1104,7 @@ steps:
11051104
artifact_paths: "flame_aquaplanet_progedmf/*"
11061105
agents:
11071106
slurm_mem: 32GB
1108-
1107+
11091108
- label: ":fire: Flame graph: diffusion"
11101109
command: >
11111110
julia --color=yes --project=.buildkite perf/flame.jl

config/model_configs/prognostic_edmfx_rico_column.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ subsidence: "Rico"
33
ls_adv: "Rico"
44
surface_setup: "Rico"
55
turbconv: "prognostic_edmfx"
6-
implicit_diffusion: true
6+
implicit_diffusion: false
77
implicit_sgs_advection: false
88
approximate_linear_solve_iters: 2
99
edmfx_upwinding: first_order
@@ -33,7 +33,7 @@ netcdf_interpolation_num_points: [8, 8, 100]
3333
diagnostics:
3434
- short_name: [ts, ta, thetaa, ha, pfull, rhoa, ua, va, wa, hur, hus, cl, clw, cli, hussfc, evspsbl, pr]
3535
period: 10mins
36-
- short_name: [arup, waup, taup, thetaaup, haup, husup, hurup, clwup, cliup, waen, taen, thetaaen, haen, husen, huren, clwen, clien, tke]
36+
- short_name: [arup, waup, taup, thetaaup, haup, husup, hurup, clwup, cliup, husraup, hussnup, waen, taen, thetaaen, haen, husen, huren, clwen, clien, husraen, hussnen, tke]
3737
period: 10mins
3838
- short_name: [entr, detr, lmix, bgrad, strain, edt, evu]
3939
period: 10mins

config/model_configs/prognostic_edmfx_trmm_column.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ y_elem: 2
2525
z_elem: 82
2626
z_stretch: false
2727
dt: 10secs
28-
t_end: 6hours
28+
t_end: 285mins
2929
dt_save_state_to_disk: 10mins
3030
FLOAT_TYPE: "Float64"
3131
toml: [toml/prognostic_edmfx_1M.toml]
@@ -37,5 +37,5 @@ diagnostics:
3737
period: 10mins
3838
- short_name: [entr, detr, lmix, bgrad, strain, edt, evu]
3939
period: 10mins
40-
- short_name: [husra, hussn]
40+
- short_name: [husra, hussn, husraup, hussnup, husraen, hussnen]
4141
period: 10mins

post_processing/ci_plots.jl

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1460,7 +1460,9 @@ function make_plots(
14601460
)
14611461
simdirs = SimDir.(output_paths)
14621462

1463-
precip_names = sim_type isa EDMFBoxPlotsWithPrecip ? ("husra", "hussn") : ()
1463+
precip_names =
1464+
sim_type isa EDMFBoxPlotsWithPrecip ?
1465+
("husra", "hussn", "husraup", "hussnup", "husraen", "hussnen") : ()
14641466

14651467
short_names = [
14661468
"wa",

src/cache/precipitation_precomputed_quantities.jl

Lines changed: 12 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -228,8 +228,7 @@ function set_precipitation_cache!(Y, p, ::Microphysics1Moment, _)
228228
thp,
229229
)
230230

231-
# compute precipitation sinks
232-
# (For now only done on the grid mean)
231+
# compute precipitation sinks on the grid mean
233232
compute_precipitation_sinks!(
234233
ᶜSᵖ,
235234
ᶜSqᵣᵖ,
@@ -248,47 +247,19 @@ function set_precipitation_cache!(
248247
Y,
249248
p,
250249
::Microphysics1Moment,
251-
::Union{DiagnosticEDMFX, PrognosticEDMFX},
250+
::DiagnosticEDMFX,
252251
)
253252
error("Not implemented yet")
254-
255-
#FT = Spaces.undertype(axes(Y.c))
256-
#(; dt) = p
257-
#(; ᶜts, ᶜqᵣ, ᶜqₛ, ᶜwᵣ, ᶜwₛ, ᶜu) = p.precomputed
258-
#(; ᶜΦ) = p.core
259-
## Grid mean precipitation sinks
260-
#(; ᶜSqₜᵖ, ᶜSqᵣᵖ, ᶜSqₛᵖ, ᶜSeₜᵖ) = p.precipitation
261-
## additional scratch storage
262-
#ᶜSᵖ = p.scratch.ᶜtemp_scalar
263-
#ᶜ∇T = p.scratch.ᶜtemp_CT123
264-
265-
## get thermodynamics and 1-moment microphysics params
266-
#(; params) = p
267-
#cmp = CAP.microphysics_1m_params(params)
268-
#thp = CAP.thermodynamics_params(params)
269-
270-
## zero out the helper source terms
271-
#@. ᶜSqₜᵖ = FT(0)
272-
#@. ᶜSqᵣᵖ = FT(0)
273-
#@. ᶜSqₛᵖ = FT(0)
274-
#@. ᶜSeₜᵖ = FT(0)
275-
## compute precipitation sinks
276-
## (For now only done on the grid mean)
277-
#compute_precipitation_sinks!(
278-
# ᶜSᵖ,
279-
# ᶜSqₜᵖ,
280-
# ᶜSqᵣᵖ,
281-
# ᶜSqₛᵖ,
282-
# ᶜSeₜᵖ,
283-
# Y.c.ρ,
284-
# ᶜqᵣ,
285-
# ᶜqₛ,
286-
# ᶜts,
287-
# ᶜΦ,
288-
# dt,
289-
# cmp,
290-
# thp,
291-
#)
253+
return nothing
254+
end
255+
function set_precipitation_cache!(
256+
Y,
257+
p,
258+
::Microphysics1Moment,
259+
::PrognosticEDMFX,
260+
)
261+
# Nothing needs to be done on the grid mean. The Sources are computed
262+
# in edmf sub-domains.
292263
return nothing
293264
end
294265

src/cache/precomputed_quantities.jl

Lines changed: 17 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ For every other `AbstractEDMF`, only `ᶜtke⁰` is added as a precomputed quant
3737
TODO: Rename `ᶜK` to `ᶜκ`.
3838
"""
3939
function implicit_precomputed_quantities(Y, atmos)
40-
(; moisture_model, turbconv_model) = atmos
40+
(; moisture_model, turbconv_model, precip_model) = atmos
4141
FT = eltype(Y)
4242
TST = thermo_state_type(moisture_model, FT)
4343
n = n_mass_flux_subdomains(turbconv_model)
@@ -53,6 +53,17 @@ function implicit_precomputed_quantities(Y, atmos)
5353
)
5454
sgs_quantities =
5555
turbconv_model isa AbstractEDMF ? (; ᶜtke⁰ = similar(Y.c, FT)) : (;)
56+
moisture_sgs_quantities =
57+
(
58+
moisture_model isa NonEquilMoistModel &&
59+
precip_model isa Microphysics1Moment
60+
) ?
61+
(;
62+
ᶜq_liq⁰ = similar(Y.c, FT),
63+
ᶜq_ice⁰ = similar(Y.c, FT),
64+
ᶜq_rai⁰ = similar(Y.c, FT),
65+
ᶜq_sno⁰ = similar(Y.c, FT),
66+
) : (;)
5667
prognostic_sgs_quantities =
5768
turbconv_model isa PrognosticEDMFX ?
5869
(;
@@ -71,6 +82,7 @@ function implicit_precomputed_quantities(Y, atmos)
7182
ᶠKᵥʲs = similar(Y.f, NTuple{n, FT}),
7283
ᶜtsʲs = similar(Y.c, NTuple{n, TST}),
7384
ᶜρʲs = similar(Y.c, NTuple{n, FT}),
85+
moisture_sgs_quantities...,
7486
) : (;)
7587
return (; gs_quantities..., sgs_quantities..., prognostic_sgs_quantities...)
7688
end
@@ -133,12 +145,12 @@ function precomputed_quantities(Y, atmos)
133145
(; ᶜSqₜᵖʲs = similar(Y.c, NTuple{n, FT}), ᶜSqₜᵖ⁰ = similar(Y.c, FT)) :
134146
atmos.precip_model isa Microphysics1Moment ?
135147
(;
136-
ᶜSeₜᵖʲs = similar(Y.c, NTuple{n, FT}),
137-
ᶜSqₜᵖʲs = similar(Y.c, NTuple{n, FT}),
148+
ᶜSqₗᵖʲs = similar(Y.c, NTuple{n, FT}),
149+
ᶜSqᵢᵖʲs = similar(Y.c, NTuple{n, FT}),
138150
ᶜSqᵣᵖʲs = similar(Y.c, NTuple{n, FT}),
139151
ᶜSqₛᵖʲs = similar(Y.c, NTuple{n, FT}),
140-
ᶜSeₜᵖ= similar(Y.c, FT),
141-
ᶜSqₜᵖ= similar(Y.c, FT),
152+
ᶜSqₗᵖ= similar(Y.c, FT),
153+
ᶜSqᵢᵖ= similar(Y.c, FT),
142154
ᶜSqᵣᵖ⁰ = similar(Y.c, FT),
143155
ᶜSqₛᵖ⁰ = similar(Y.c, FT),
144156
) : (;)

0 commit comments

Comments
 (0)