Skip to content

Commit dd17039

Browse files
Apply suggestions
1 parent ec41c97 commit dd17039

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

src/parameterized_tendencies/les_sgs_models/smagorinsky_lilly.jl

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -112,11 +112,10 @@ function horizontal_smagorinsky_lilly_tendency!(Yₜ, Y, p, t, ::SmagorinskyLill
112112
ᶜρχ = getproperty(Y.c, ρχ_name)
113113
ᶜρχₜ = getproperty(Yₜ.c, ρχ_name)
114114
ᶜχ = @. lazy(specific(ᶜρχ, Y.c.ρ))
115-
ᶜρχₜ_diffusion =
116-
@. p.scratch.ᶜtemp_scalar = wdivₕ(Y.c.ρ * ᶜD_smag * gradₕ(ᶜχ))
115+
ᶜρχₜ_diffusion = @. lazy(wdivₕ(Y.c.ρ * ᶜD_smag * gradₕ(ᶜχ)))
117116
@. ᶜρχₜ += ᶜρχₜ_diffusion
118117
# Rain and snow does not affect the mass
119-
if ρχ_name (:ρq_rai, :ρq_sno)
118+
if ρχ_name == :ρq_tot
120119
@. Yₜ.c.ρ += ᶜρχₜ_diffusion
121120
end
122121
end
@@ -128,7 +127,7 @@ import UnrolledUtilities as UU
128127

129128
function vertical_smagorinsky_lilly_tendency!(Yₜ, Y, p, t, ::SmagorinskyLilly)
130129
FT = eltype(Y)
131-
(; sfc_temp_C3, ᶠtemp_scalar, ᶜtemp_scalar) = p.scratch
130+
(; sfc_temp_C3, ᶠtemp_scalar) = p.scratch
132131
(; ᶜτ_smag, ᶠτ_smag, ᶠD_smag, ᶜspecific, ᶜh_tot, sfc_conditions) =
133132
p.precomputed
134133
(; ρ_flux_uₕ, ρ_flux_h_tot) = sfc_conditions
@@ -172,7 +171,7 @@ function vertical_smagorinsky_lilly_tendency!(Yₜ, Y, p, t, ::SmagorinskyLilly)
172171
bottom = Operators.SetValue(C3(FT(0))),
173172
)
174173

175-
ᶜ∇ᵥρD∇χₜ = @. ᶜtemp_scalar = ᶜdivᵥ_ρχ(-(ᶠρ * ᶠD_smag * ᶠgradᵥ(ᶜχ)))
174+
ᶜ∇ᵥρD∇χₜ = @. lazy(ᶜdivᵥ_ρχ(-(ᶠρ * ᶠD_smag * ᶠgradᵥ(ᶜχ))))
176175
@. ᶜρχₜ -= ᶜ∇ᵥρD∇χₜ
177176
# Rain and snow does not affect the mass
178177
if ρχ_name == :ρq_tot

0 commit comments

Comments
 (0)