From 09954bbce344a1aa247143fa63b70729f313fbad Mon Sep 17 00:00:00 2001 From: Zhaoyi Shen <11598433+szy21@users.noreply.github.com> Date: Wed, 18 Oct 2023 23:19:41 -0700 Subject: [PATCH] change advective edmf horizontal advection --- src/prognostic_equations/advection.jl | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/prognostic_equations/advection.jl b/src/prognostic_equations/advection.jl index 0cb082fad54..7eb3a513fa3 100644 --- a/src/prognostic_equations/advection.jl +++ b/src/prognostic_equations/advection.jl @@ -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 @@ -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 @@ -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