Skip to content
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

Adding nonequilibrium parameterization to EDMF #3518

Open
wants to merge 14 commits into
base: main
Choose a base branch
from
51 changes: 51 additions & 0 deletions config/model_configs/prognostic_edmfx_gcmdriven_column_noneq.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
initial_condition: "GCM"
external_forcing: "GCM"
external_forcing_file: artifact"cfsite_gcm_forcing"/HadGEM2-A_amip.2004-2008.07.nc
cfsite_number : "site23"
surface_setup: "GCM"
turbconv: "prognostic_edmfx"
implicit_diffusion: true
implicit_sgs_advection: false
approximate_linear_solve_iters: 2
edmfx_upwinding: first_order
rayleigh_sponge: true
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"
precip_model: "1M"
config: "column"
z_max: 40e3
z_elem: 60
z_stretch: true
dz_bottom: 30
perturb_initstate: false
dt: "1secs" # might need to make shorter
dt_rad: "30mins"
t_end: "6hours"
dt_save_state_to_disk: "6hours"
cloud_model: "grid_scale"
call_cloud_diagnostics_per_stage : true
toml: [toml/prognostic_edmfx_gcmdriven_noneq.toml]
netcdf_output_at_levels: true
netcdf_interpolation_num_points: [2, 2, 60]
output_default_diagnostics: false
rad: allskywithclear
insolation: "gcmdriven"
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, waen, taen, thetaaen, haen, husen, huren, clwen, clien, tke]
period: 10mins
- short_name: [entr, detr, lmix, bgrad, strain, edt, evu]
period: 10mins
- short_name: [rlut, rlutcs, rsut, rsutcs, clwvi, lwp, clivi, dsevi, clvi, prw, hurvi, husv]
period: 10mins
- reduction_time: max
short_name: tke
period: 10mins
ode_algo: ARS343
27 changes: 24 additions & 3 deletions src/cache/precomputed_quantities.jl
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,14 @@ function precomputed_quantities(Y, atmos)
sedimentation_quantities =
atmos.moisture_model isa NonEquilMoistModel ?
(; ᶜwₗ = similar(Y.c, FT), ᶜwᵢ = similar(Y.c, FT)) : (;)
moisture_sgs_quantities =
atmos.moisture_model isa NonEquilMoistModel ?
(;
ᶜq_liq⁰ = similar(Y.c, FT),
ᶜq_ice⁰ = similar(Y.c, FT),
Comment on lines +70 to +71
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
ᶜq_liq⁰ = similar(Y.c, FT),
ᶜq_ice⁰ = similar(Y.c, FT),

Can we instead compute these on the fly?

ᶜgradᵥ_q_liq⁰ = Fields.Field(C3{FT}, cspace),
ᶜgradᵥ_q_ice⁰ = Fields.Field(C3{FT}, cspace),
) : (;)
precipitation_sgs_quantities =
atmos.precip_model isa Microphysics0Moment ?
(; ᶜSqₜᵖʲs = similar(Y.c, NTuple{n, FT}), ᶜSqₜᵖ⁰ = similar(Y.c, FT)) :
Expand Down Expand Up @@ -110,8 +118,9 @@ function precomputed_quantities(Y, atmos)
ᶠnh_pressure₃ʲs = similar(Y.f, NTuple{n, C3{FT}}),
ᶜgradᵥ_θ_virt⁰ = Fields.Field(C3{FT}, cspace),
ᶜgradᵥ_q_tot⁰ = Fields.Field(C3{FT}, cspace),
ᶜgradᵥ_θ_liq_ice⁰ = Fields.Field(C3{FT}, cspace),
ᶜgradᵥ_θ_liq_ice⁰ = Fields.Field(C3{FT}, cspace), # does this need to be made different?
precipitation_sgs_quantities...,
moisture_sgs_quantities...,
) : (;)
sgs_quantities = (;
ᶜgradᵥ_θ_virt = Fields.Field(C3{FT}, cspace),
Expand Down Expand Up @@ -550,8 +559,20 @@ NVTX.@annotate function set_precomputed_quantities!(Y, p, t)
end

if turbconv_model isa PrognosticEDMFX
set_prognostic_edmf_precomputed_quantities_draft_and_bc!(Y, p, ᶠuₕ³, t)
set_prognostic_edmf_precomputed_quantities_environment!(Y, p, ᶠuₕ³, t)
set_prognostic_edmf_precomputed_quantities_draft_and_bc!(
Y,
p,
ᶠuₕ³,
t,
p.atmos.moisture_model,
)
set_prognostic_edmf_precomputed_quantities_environment!(
Y,
p,
ᶠuₕ³,
t,
p.atmos.moisture_model,
)
set_prognostic_edmf_precomputed_quantities_closures!(Y, p, t)
set_prognostic_edmf_precomputed_quantities_precipitation!(
Y,
Expand Down
Loading
Loading