Skip to content

Commit f74a08f

Browse files
committed
move nh pressure to edmf precomputed quantities
1 parent 2652e42 commit f74a08f

11 files changed

+49
-43
lines changed

.buildkite/longruns_gpu/pipeline.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,7 @@ steps:
140140
CLIMACOMMS_DEVICE: "CUDA"
141141
JOB_NAME: "longrun_aquaplanet_allsky_diagedmf_0M"
142142

143-
- label: ":computer: aquaplanet equilmoist allsky radiation + prognostic edmf diffusion only + 0M microphysics"
143+
- label: ":computer: aquaplanet equilmoist allsky radiation + prognostic edmf + 0M microphysics"
144144
command:
145145
- srun julia --project=.buildkite .buildkite/ci_driver.jl --config_file $CONFIG_PATH/$$JOB_NAME.yml --job_id $$JOB_NAME
146146
artifact_paths: "$$JOB_NAME/output_active/*"

.buildkite/pipeline.yml

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -785,10 +785,6 @@ steps:
785785
julia --color=yes --project=.buildkite .buildkite/ci_driver.jl
786786
--config_file $CONFIG_PATH/prognostic_edmfx_bomex_implicit_column.yml
787787
--job_id prognostic_edmfx_bomex_column_implicit
788-
789-
julia --color=yes --project=.buildkite reproducibility_tests/test_mse.jl
790-
--job_id prognostic_edmfx_bomex_column_implicit
791-
--out_dir prognostic_edmfx_bomex_column_implicit/output_active
792788
artifact_paths: "prognostic_edmfx_bomex_column_implicit/output_active/*"
793789
agents:
794790
slurm_mem: 20GB

config/longrun_configs/longrun_aquaplanet_allsky_progedmf_0M.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@ edmfx_entr_model: "Generalized"
2525
edmfx_detr_model: "Generalized"
2626
edmfx_nh_pressure: true
2727
edmfx_filter: true
28-
prognostic_tke: true
2928
edmfx_sgs_mass_flux: true
3029
edmfx_sgs_diffusive_flux: true
3130
precip_model: "0M"

config/model_configs/prognostic_edmfx_aquaplanet.yml

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -17,16 +17,15 @@ edmfx_sgs_mass_flux: true
1717
edmfx_sgs_diffusive_flux: true
1818
implicit_diffusion: true
1919
implicit_sgs_advection: true
20-
# This job crashes when setting the following to true. There is potentially a bug.
21-
# implicit_sgs_entr_detr: true
22-
# implicit_sgs_nh_pressure: true
23-
# implicit_sgs_mass_flux: true
20+
implicit_sgs_entr_detr: true
21+
implicit_sgs_nh_pressure: true
22+
implicit_sgs_mass_flux: true
2423
approximate_linear_solve_iters: 2
2524
max_newton_iters_ode: 3
2625
moist: equil
2726
cloud_model: "quadrature_sgs"
2827
precip_model: 0M
29-
dt: 10secs
28+
dt: 20secs
3029
t_end: 1hours
3130
dt_save_state_to_disk: 600secs
3231
toml: [toml/prognostic_edmfx.toml]

config/model_configs/prognostic_edmfx_aquaplanet_gpu.yml

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -17,16 +17,15 @@ edmfx_sgs_mass_flux: true
1717
edmfx_sgs_diffusive_flux: true
1818
implicit_diffusion: true
1919
implicit_sgs_advection: true
20-
# This job crashes when setting the following to true. There is potentially a bug.
21-
# implicit_sgs_entr_detr: true
22-
# implicit_sgs_nh_pressure: true
23-
# implicit_sgs_mass_flux: true
20+
implicit_sgs_entr_detr: true
21+
implicit_sgs_nh_pressure: true
22+
implicit_sgs_mass_flux: true
2423
approximate_linear_solve_iters: 2
2524
max_newton_iters_ode: 3
2625
moist: equil
2726
cloud_model: "quadrature_sgs"
2827
precip_model: 0M
29-
dt: 10secs
28+
dt: 20secs
3029
t_end: 1hours
3130
dt_save_state_to_disk: 600secs
3231
toml: [toml/prognostic_edmfx.toml]

config/model_configs/prognostic_edmfx_bomex_implicit_column.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,6 @@ perturb_initstate: false
3131
dt: "50secs"
3232
t_end: "6hours"
3333
dt_save_state_to_disk: "10mins"
34-
reproducibility_test: true
3534
toml: [toml/prognostic_edmfx_bomex.toml]
3635
netcdf_interpolation_num_points: [2, 2, 60]
3736
diagnostics:

reproducibility_tests/ref_counter.jl

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
224
1+
225
22

33
# **README**
44
#
@@ -21,6 +21,10 @@
2121

2222
#=
2323
24+
225
25+
- Move nonhydrostatic pressure drag calculation to precomputed quantities and
26+
remove one reproducibility job
27+
2428
224
2529
- Machine precision differences due to https://github.com/CliMA/ClimaCore.jl/pull/2232
2630

reproducibility_tests/reproducibility_test_job_ids.jl

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,5 @@ reproducibility_test_job_ids() = [
55
"aquaplanet_equil_allsky_gw_raw_zonalasym",
66
"diagnostic_edmfx_aquaplanet",
77
"single_column_hydrostatic_balance_ft64",
8-
"prognostic_edmfx_bomex_column_implicit",
98
"prognostic_edmfx_aquaplanet",
109
]

src/cache/precomputed_quantities.jl

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,7 @@ function implicit_precomputed_quantities(Y, atmos)
5555
turbconv_model isa AbstractEDMF ? (; ᶜtke⁰ = similar(Y.c, FT)) : (;)
5656
moisture_sgs_quantities =
5757
(
58+
turbconv_model isa PrognosticEDMFX &&
5859
moisture_model isa NonEquilMoistModel &&
5960
precip_model isa Microphysics1Moment
6061
) ?
@@ -82,6 +83,7 @@ function implicit_precomputed_quantities(Y, atmos)
8283
ᶠKᵥʲs = similar(Y.f, NTuple{n, FT}),
8384
ᶜtsʲs = similar(Y.c, NTuple{n, TST}),
8485
ᶜρʲs = similar(Y.c, NTuple{n, FT}),
86+
ᶠnh_pressure₃ʲs = similar(Y.f, NTuple{n, C3{FT}}),
8587
moisture_sgs_quantities...,
8688
) : (;)
8789
return (; gs_quantities..., sgs_quantities..., prognostic_sgs_quantities...)
@@ -167,7 +169,6 @@ function precomputed_quantities(Y, atmos)
167169
ᶜentrʲs = similar(Y.c, NTuple{n, FT}),
168170
ᶜdetrʲs = similar(Y.c, NTuple{n, FT}),
169171
ᶜturb_entrʲs = similar(Y.c, NTuple{n, FT}),
170-
ᶠnh_pressure₃ʲs = similar(Y.f, NTuple{n, C3{FT}}),
171172
ᶜgradᵥ_θ_virt⁰ = Fields.Field(C3{FT}, cspace),
172173
ᶜgradᵥ_q_tot⁰ = Fields.Field(C3{FT}, cspace),
173174
ᶜgradᵥ_θ_liq_ice⁰ = Fields.Field(C3{FT}, cspace),

src/cache/prognostic_edmf_precomputed_quantities.jl

Lines changed: 31 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -330,7 +330,8 @@ NVTX.@annotate function set_prognostic_edmf_precomputed_quantities_closures!(
330330
FT = eltype(params)
331331
n = n_mass_flux_subdomains(turbconv_model)
332332

333-
(; ᶜtke⁰, ᶜu, ᶜp, ᶜρa⁰, ᶠu³⁰, ᶜts⁰, ᶜq_tot⁰) = p.precomputed
333+
(; ᶠgradᵥ_ᶜΦ) = p.core
334+
(; ᶜtke⁰, ᶜu, ᶜp, ᶜρa⁰, ᶠu³⁰, ᶠu₃⁰, ᶜts⁰, ᶜq_tot⁰) = p.precomputed
334335
(;
335336
ᶜmixing_length_tuple,
336337
ᶜmixing_length,
@@ -340,13 +341,23 @@ NVTX.@annotate function set_prognostic_edmf_precomputed_quantities_closures!(
340341
ᶜK_h,
341342
ρatke_flux,
342343
) = p.precomputed
343-
(; ᶜuʲs, ᶜtsʲs, ᶠu³ʲs, ᶜρʲs, ᶜentrʲs, ᶜdetrʲs, ᶜturb_entrʲs) = p.precomputed
344+
(;
345+
ᶜuʲs,
346+
ᶜtsʲs,
347+
ᶠu³ʲs,
348+
ᶜρʲs,
349+
ᶜentrʲs,
350+
ᶜdetrʲs,
351+
ᶜturb_entrʲs,
352+
ᶠnh_pressure₃ʲs,
353+
) = p.precomputed
344354
(; ustar, obukhov_length) = p.precomputed.sfc_conditions
345355

346356
ᶜz = Fields.coordinate_field(Y.c).z
347357
z_sfc = Fields.level(Fields.coordinate_field(Y.f).z, Fields.half)
348358
ᶜdz = Fields.Δz_field(axes(Y.c))
349359
ᶜlg = Fields.local_geometry_field(Y.c)
360+
ᶠlg = Fields.local_geometry_field(Y.f)
350361

351362
ᶜvert_div = p.scratch.ᶜtemp_scalar
352363
ᶜmassflux_vert_div = p.scratch.ᶜtemp_scalar_2
@@ -417,6 +428,24 @@ NVTX.@annotate function set_prognostic_edmf_precomputed_quantities_closures!(
417428
draft_area(Y.c.sgsʲs.:($$j).ρa, ᶜρʲs.:($$j)),
418429
dt,
419430
)
431+
432+
# nonhydrostatic pressure drag
433+
scale_height =
434+
CAP.R_d(params) * CAP.T_surf_ref(params) / CAP.grav(params)
435+
for j in 1:n
436+
if p.atmos.edmfx_model.nh_pressure isa Val{true}
437+
@. ᶠnh_pressure₃ʲs.:($$j) = ᶠupdraft_nh_pressure(
438+
params,
439+
ᶠlg,
440+
ᶠbuoyancy(ᶠinterp(Y.c.ρ), ᶠinterp(ᶜρʲs.:($$j)), ᶠgradᵥ_ᶜΦ),
441+
Y.f.sgsʲs.:($$j).u₃,
442+
ᶠu₃⁰,
443+
scale_height,
444+
)
445+
else
446+
@. ᶠnh_pressure₃ʲs.:($$j) = C3(0)
447+
end
448+
end
420449
end
421450

422451
(; ᶜgradᵥ_θ_virt⁰, ᶜgradᵥ_q_tot⁰, ᶜgradᵥ_θ_liq_ice⁰) = p.precomputed

0 commit comments

Comments
 (0)