Skip to content

Commit fb7b560

Browse files
authored
Merge pull request #2592 from CliMA/aj/rain_diff_fixes
fixes to rain diff
2 parents 2449c6c + f36c12f commit fb7b560

File tree

2 files changed

+7
-3
lines changed

2 files changed

+7
-3
lines changed

src/prognostic_equations/hyperdiffusion.jl

+4-2
Original file line numberDiff line numberDiff line change
@@ -219,9 +219,11 @@ NVTX.@annotate function tracer_hyperdiffusion_tendency!(Yₜ, Y, p, t)
219219
# by the limiter. Is this a significant problem?
220220
# TODO: Figure out why caching the duplicated tendencies in ᶜtemp_scalar
221221
# triggers allocations.
222-
for (ᶜρχₜ, ᶜ∇²χ, _) in matching_subfields(Yₜ.c, ᶜ∇²specific_tracers)
222+
for (ᶜρχₜ, ᶜ∇²χ, χ_name) in matching_subfields(Yₜ.c, ᶜ∇²specific_tracers)
223223
@. ᶜρχₜ -= ν₄_scalar * wdivₕ(Y.c.ρ * gradₕ(ᶜ∇²χ))
224-
@. Yₜ.c.ρ -= ν₄_scalar * wdivₕ(Y.c.ρ * gradₕ(ᶜ∇²χ))
224+
if !(χ_name in (:q_rai, :q_sno))
225+
@. Yₜ.c.ρ -= ν₄_scalar * wdivₕ(Y.c.ρ * gradₕ(ᶜ∇²χ))
226+
end
225227
end
226228
if turbconv_model isa PrognosticEDMFX
227229
for j in 1:n

src/prognostic_equations/vertical_diffusion_boundary_layer.jl

+3-1
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,8 @@ function vertical_diffusion_boundary_layer_tendency!(
9696
),
9797
)
9898
@. ᶜρχₜ[colidx] -= ᶜρχₜ_diffusion[colidx]
99-
@. Yₜ.c.ρ[colidx] -= ᶜρχₜ_diffusion[colidx]
99+
if !(χ_name in (:q_rai, :q_sno))
100+
@. Yₜ.c.ρ[colidx] -= ᶜρχₜ_diffusion[colidx]
101+
end
100102
end
101103
end

0 commit comments

Comments
 (0)