Skip to content

Commit cb851e3

Browse files
authored
Merge pull request #4000 from CliMA/zs/implicit_1m_entr
make entrainment implicit in 1m
2 parents cbc2c82 + 29d0b15 commit cb851e3

File tree

2 files changed

+24
-2
lines changed

2 files changed

+24
-2
lines changed

config/model_configs/prognostic_edmfx_rico_implicit_column.yml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@ surface_setup: "Rico"
55
turbconv: "prognostic_edmfx"
66
implicit_diffusion: true
77
implicit_sgs_advection: true
8+
implicit_sgs_entr_detr: true
9+
implicit_nh_pressure: true
810
approximate_linear_solve_iters: 2
911
max_newton_iters_ode: 3
1012
edmfx_upwinding: first_order
@@ -26,8 +28,8 @@ y_elem: 2
2628
z_elem: 100
2729
z_stretch: false
2830
perturb_initstate: false
29-
dt: "60secs"
30-
t_end: "6hours"
31+
dt: "50secs"
32+
t_end: "8hours"
3133
dt_save_state_to_disk: "60mins"
3234
toml: [toml/prognostic_edmfx_1M.toml]
3335
netcdf_interpolation_num_points: [8, 8, 100]

src/prognostic_equations/implicit/manual_sparse_jacobian.jl

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -997,6 +997,26 @@ function update_jacobian!(alg::ManualSparseJacobian, cache, Y, p, dtγ, t)
997997
(ᶠinterp(ᶜentrʲs.:(1) + ᶜturb_entrʲs.:(1))) *
998998
(one_C3xACT3,),
999999
))
1000+
if p.atmos.moisture_model isa NonEquilMoistModel && (
1001+
p.atmos.microphysics_model isa Microphysics1Moment ||
1002+
p.atmos.microphysics_model isa Microphysics2Moment
1003+
)
1004+
sgs_microphysics_tracers = (
1005+
(@name(c.sgsʲs.:(1).q_liq)),
1006+
(@name(c.sgsʲs.:(1).q_ice)),
1007+
(@name(c.sgsʲs.:(1).q_rai)),
1008+
(@name(c.sgsʲs.:(1).q_sno)),
1009+
)
1010+
MatrixFields.unrolled_foreach(
1011+
sgs_microphysics_tracers,
1012+
) do (qʲ_name)
1013+
MatrixFields.has_field(Y, qʲ_name) || return
1014+
1015+
∂ᶜqʲ_err_∂ᶜqʲ = matrix[qʲ_name, qʲ_name]
1016+
@. ∂ᶜqʲ_err_∂ᶜqʲ -=
1017+
dtγ * DiagonalMatrixRow(ᶜentrʲs.:(1) + ᶜturb_entrʲs.:(1))
1018+
end
1019+
end
10001020
end
10011021

10021022
# non-hydrostatic pressure drag

0 commit comments

Comments
 (0)