Skip to content

Commit f54dc38

Browse files
authored
Merge pull request #3789 from CliMA/oa/noneq_implicit_flag
adding noneq implicit flag
2 parents 05225a0 + 6fe91f0 commit f54dc38

File tree

6 files changed

+35
-8
lines changed

6 files changed

+35
-8
lines changed

config/default_configs/default_config.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -202,6 +202,9 @@ precip_model:
202202
cloud_model:
203203
help: "Cloud model [`grid_scale`, `quadrature` (default), `quadrature_sgs`]"
204204
value: "quadrature"
205+
implicit_noneq_cloud_formation:
206+
help: "Whether to treat the nonequilibrium cloud condensate tendency implicitly [`true`, `false` (default)]"
207+
value: false
205208
perf_summary:
206209
help: "Flag for collecting performance summary information"
207210
value: false

config/model_configs/amip_target_edonly_nonequil.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ viscous_sponge: true
88
dt_save_state_to_disk: "30days"
99
cloud_model: "grid_scale"
1010
moist: "nonequil"
11+
implicit_noneq_cloud_formation: true
1112
precip_model: "1M"
1213
rad: "allskywithclear"
1314
dt_rad: "1hours"

src/prognostic_equations/implicit/implicit_tendency.jl

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,17 @@ NVTX.@annotate function implicit_tendency!(Yₜ, Y, p, t)
99
fill_with_nans!(p)
1010
Yₜ .= zero(eltype(Yₜ))
1111
implicit_vertical_advection_tendency!(Yₜ, Y, p, t)
12+
13+
if p.atmos.noneq_cloud_formation_mode == Implicit()
14+
cloud_condensate_tendency!(
15+
Yₜ,
16+
Y,
17+
p,
18+
p.atmos.moisture_model,
19+
p.atmos.precip_model,
20+
)
21+
end
22+
1223
if p.atmos.sgs_adv_mode == Implicit()
1324
edmfx_sgs_vertical_advection_tendency!(
1425
Yₜ,

src/prognostic_equations/remaining_tendency.jl

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -123,14 +123,17 @@ NVTX.@annotate function additional_tendency!(Yₜ, Y, p, t)
123123
end
124124
edmfx_filter_tendency!(Yₜ, Y, p, t, p.atmos.turbconv_model)
125125
edmfx_tke_tendency!(Yₜ, Y, p, t, p.atmos.turbconv_model)
126-
# Non-equilibrium cloud formation
127-
cloud_condensate_tendency!(
128-
Yₜ,
129-
Y,
130-
p,
131-
p.atmos.moisture_model,
132-
p.atmos.precip_model,
133-
)
126+
127+
if p.atmos.noneq_cloud_formation_mode == Explicit()
128+
cloud_condensate_tendency!(
129+
Yₜ,
130+
Y,
131+
p,
132+
p.atmos.moisture_model,
133+
p.atmos.precip_model,
134+
)
135+
end
136+
134137
edmfx_precipitation_tendency!(
135138
Yₜ,
136139
Y,

src/solver/type_getters.jl

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,11 @@ function get_atmos(config::AtmosConfig, params)
2323
moisture_model = get_moisture_model(parsed_args)
2424
precip_model = get_precipitation_model(parsed_args)
2525
cloud_model = get_cloud_model(parsed_args)
26+
27+
implicit_noneq_cloud_formation =
28+
parsed_args["implicit_noneq_cloud_formation"]
29+
@assert implicit_noneq_cloud_formation in (true, false)
30+
2631
ozone = get_ozone(parsed_args)
2732
radiation_mode = get_radiation_mode(parsed_args, FT)
2833
forcing_type = get_forcing_type(parsed_args)
@@ -93,6 +98,8 @@ function get_atmos(config::AtmosConfig, params)
9398
edmfx_model,
9499
precip_model,
95100
cloud_model,
101+
noneq_cloud_formation_mode = implicit_noneq_cloud_formation ?
102+
Implicit() : Explicit(),
96103
forcing_type,
97104
call_cloud_diagnostics_per_stage,
98105
turbconv_model = get_turbconv_model(FT, parsed_args, turbconv_params),

src/solver/types.jl

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -511,6 +511,7 @@ Base.@kwdef struct AtmosModel{
511511
MM,
512512
PM,
513513
CM,
514+
NCFM,
514515
CCDPS,
515516
F,
516517
S,
@@ -544,6 +545,7 @@ Base.@kwdef struct AtmosModel{
544545
moisture_model::MM = nothing
545546
precip_model::PM = nothing
546547
cloud_model::CM = nothing
548+
noneq_cloud_formation_mode::NCFM = nothing
547549
call_cloud_diagnostics_per_stage::CCDPS = nothing
548550
forcing_type::F = nothing
549551
subsidence::S = nothing

0 commit comments

Comments
 (0)