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

change advective edmf horizontal advection #2256

Merged
merged 1 commit into from
Oct 19, 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
9 changes: 6 additions & 3 deletions src/prognostic_equations/advection.jl
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,8 @@ NVTX.@annotate function horizontal_advection_tendency!(Yₜ, Y, p, t)
if p.atmos.turbconv_model isa AdvectiveEDMFX
for j in 1:n
@. Yₜ.c.sgsʲs.:($$j).h_tot -=
adjoint(CA.CT12(Y.c.uₕ)) * CA.gradₕ(Y.c.sgsʲs.:($$j).h_tot)
wdivₕ(Y.c.sgsʲs.:($$j).h_tot * ᶜuʲs.:($$j)) -
Y.c.sgsʲs.:($$j).h_tot * wdivₕ(ᶜuʲs.:($$j))
end
end

Expand All @@ -63,7 +64,8 @@ end
NVTX.@annotate function horizontal_tracer_advection_tendency!(Yₜ, Y, p, t)
n = n_mass_flux_subdomains(p.atmos.turbconv_model)
(; ᶜu) = p
if p.atmos.turbconv_model isa EDMFX
if p.atmos.turbconv_model isa EDMFX ||
p.atmos.turbconv_model isa AdvectiveEDMFX
(; ᶜuʲs) = p
end

Expand All @@ -84,7 +86,8 @@ NVTX.@annotate function horizontal_tracer_advection_tendency!(Yₜ, Y, p, t)
if p.atmos.turbconv_model isa AdvectiveEDMFX
for j in 1:n
@. Yₜ.c.sgsʲs.:($$j).q_tot -=
adjoint(CA.CT12(Y.c.uₕ)) * CA.gradₕ(Y.c.sgsʲs.:($$j).q_tot)
wdivₕ(Y.c.sgsʲs.:($$j).q_tot * ᶜuʲs.:($$j)) -
Y.c.sgsʲs.:($$j).q_tot * wdivₕ(ᶜuʲs.:($$j))
end
end

Expand Down
Loading