Skip to content

Commit

Permalink
Merge #2256
Browse files Browse the repository at this point in the history
2256: change advective edmf horizontal advection r=szy21 a=szy21



Co-authored-by: Zhaoyi Shen <11598433+szy21@users.noreply.github.com>
  • Loading branch information
bors[bot] and szy21 authored Oct 19, 2023
2 parents 76be7f0 + 09954bb commit b65e481
Showing 1 changed file with 6 additions and 3 deletions.
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

0 comments on commit b65e481

Please sign in to comment.