Skip to content

Commit

Permalink
Merge pull request #2732 from CliMA/as/deepsphere-edmf
Browse files Browse the repository at this point in the history
deep-sphere branch in edmf advection equation
  • Loading branch information
akshaysridhar authored Mar 4, 2024
2 parents 3ca0ca9 + cdaa4e8 commit 84f7a70
Showing 1 changed file with 11 additions and 5 deletions.
16 changes: 11 additions & 5 deletions src/prognostic_equations/advection.jl
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,11 @@ NVTX.@annotate function explicit_vertical_advection_tendency!(Yₜ, Y, p, t)
(ᶜf³[colidx] + ᶜω³[colidx]) × CT12(ᶜu[colidx])
@. Yₜ.f.u₃[colidx] -=
ᶠω¹²[colidx] × ᶠinterp(CT12(ᶜu[colidx])) + ᶠgradᵥ(ᶜK[colidx])
for j in 1:n
@. Yₜ.f.sgsʲs.:($$j).u₃[colidx] -=
ᶠω¹²ʲs.:($$j)[colidx] × ᶠinterp(CT12(ᶜuʲs.:($$j)[colidx])) +
ᶠgradᵥ(ᶜKʲs.:($$j)[colidx] - ᶜKᵥʲs.:($$j)[colidx])
end
else
# deep atmosphere
@. Yₜ.c.uₕ[colidx] -=
Expand All @@ -165,11 +170,12 @@ NVTX.@annotate function explicit_vertical_advection_tendency!(Yₜ, Y, p, t)
@. Yₜ.f.u₃[colidx] -=
(ᶠf¹²[colidx] + ᶠω¹²[colidx]) × ᶠinterp(CT12(ᶜu[colidx])) +
ᶠgradᵥ(ᶜK[colidx])
end
for j in 1:n
@. Yₜ.f.sgsʲs.:($$j).u₃[colidx] -=
ᶠω¹²ʲs.:($$j)[colidx] × ᶠinterp(CT12(ᶜuʲs.:($$j)[colidx])) +
ᶠgradᵥ(ᶜKʲs.:($$j)[colidx] - ᶜKᵥʲs.:($$j)[colidx])
for j in 1:n
@. Yₜ.f.sgsʲs.:($$j).u₃[colidx] -=
(ᶠf¹²[colidx] + ᶠω¹²ʲs.:($$j)[colidx]) ×
ᶠinterp(CT12(ᶜuʲs.:($$j)[colidx])) +
ᶠgradᵥ(ᶜKʲs.:($$j)[colidx] - ᶜKᵥʲs.:($$j)[colidx])
end
end

if use_prognostic_tke(turbconv_model) # advect_tke triggers allocations
Expand Down

0 comments on commit 84f7a70

Please sign in to comment.