Skip to content

Commit

Permalink
format
Browse files Browse the repository at this point in the history
  • Loading branch information
szy21 committed Dec 19, 2023
1 parent b5a7327 commit 7227c95
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 4 deletions.
9 changes: 6 additions & 3 deletions src/prognostic_equations/hyperdiffusion.jl
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,8 @@ NVTX.@annotate function hyperdiffusion_tendency!(Yₜ, Y, p, t)
κ₄_vorticity * ᶠwinterp(ᶜJ * Y.c.ρ, ᶜ∇²uᵥʲs.:($$j))
end
# Note: It is more correct to have ρa inside and outside the divergence
@. Yₜ.c.sgsʲs.:($$j).mse -= κ₄_tracer * wdivₕ(gradₕ(ᶜ∇²mseʲs.:($$j)))
@. Yₜ.c.sgsʲs.:($$j).mse -=
κ₄_tracer * wdivₕ(gradₕ(ᶜ∇²mseʲs.:($$j)))
end
end

Expand Down Expand Up @@ -215,8 +216,10 @@ NVTX.@annotate function tracer_hyperdiffusion_tendency!(Yₜ, Y, p, t)
if turbconv_model isa PrognosticEDMFX
for j in 1:n
@. Yₜ.c.sgsʲs.:($$j).ρa -=
κ₄_tracer * wdivₕ(Y.c.sgsʲs.:($$j).ρa * gradₕ(ᶜ∇²q_totʲs.:($$j)))
@. Yₜ.c.sgsʲs.:($$j).q_tot -= κ₄_tracer * wdivₕ(gradₕ(ᶜ∇²q_totʲs.:($$j)))
κ₄_tracer *
wdivₕ(Y.c.sgsʲs.:($$j).ρa * gradₕ(ᶜ∇²q_totʲs.:($$j)))
@. Yₜ.c.sgsʲs.:($$j).q_tot -=
κ₄_tracer * wdivₕ(gradₕ(ᶜ∇²q_totʲs.:($$j)))
end
end
return nothing
Expand Down
6 changes: 5 additions & 1 deletion src/solver/model_getters.jl
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,11 @@ function get_hyperdiffusion_model(parsed_args, ::Type{FT}) where {FT}
κ₄_tracer = FT(parsed_args["kappa_4_tracer"])
divergence_damping_factor = FT(parsed_args["divergence_damping_factor"])
return if hyperdiff_name in ("ClimaHyperdiffusion", "true", true)
ClimaHyperdiffusion(; κ₄_vorticity, κ₄_tracer, divergence_damping_factor)
ClimaHyperdiffusion(;
κ₄_vorticity,
κ₄_tracer,
divergence_damping_factor,
)
elseif hyperdiff_name in ("none", "false", false)
nothing
else
Expand Down

0 comments on commit 7227c95

Please sign in to comment.