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

Add a threshold for diagnostic edmf updraft velocity #2454

Merged
merged 1 commit into from
Dec 27, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 36 additions & 0 deletions src/cache/diagnostic_edmf_precomputed_quantities.jl
Original file line number Diff line number Diff line change
Expand Up @@ -631,6 +631,42 @@ function set_diagnostic_edmf_precomputed_quantities_do_integral!(Y, p, t)
ρaʲu³ʲ_dataq_tot / ρaʲu³ʲ_data,
)

# set updraft to grid-mean if vertical velocity is too small
if i > 2
@. ρaʲ_level = ifelse(
(
u³ʲ_data_prev_halflevel * u³ʲ_data_prev_halflevel <
∇Φ³_data_prev_level * (ρʲ_prev_level - ρ_prev_level) / ρʲ_prev_level
),
0,
ρaʲ_level,
)
@. u³ʲ_halflevel = ifelse(
(
u³ʲ_data_prev_halflevel * u³ʲ_data_prev_halflevel <
∇Φ³_data_prev_level * (ρʲ_prev_level - ρ_prev_level) / ρʲ_prev_level
),
u³_halflevel,
u³ʲ_halflevel,
)
@. h_totʲ_level = ifelse(
(
u³ʲ_data_prev_halflevel * u³ʲ_data_prev_halflevel <
∇Φ³_data_prev_level * (ρʲ_prev_level - ρ_prev_level) / ρʲ_prev_level
),
h_tot_level,
h_totʲ_level,
)
@. q_totʲ_level = ifelse(
(
u³ʲ_data_prev_halflevel * u³ʲ_data_prev_halflevel <
∇Φ³_data_prev_level * (ρʲ_prev_level - ρ_prev_level) / ρʲ_prev_level
),
q_tot_level,
q_totʲ_level,
)
end

set_diagnostic_edmfx_draft_quantities_level!(
thermo_params,
Kʲ_level,
Expand Down
Loading