From d59464374428685009936a32098c04ef7b1c487d Mon Sep 17 00:00:00 2001 From: Simon Byrne Date: Mon, 2 Oct 2023 15:10:44 -0700 Subject: [PATCH] fix for Rayleigh sponge --- src/parameterized_tendencies/sponge/rayleigh_sponge.jl | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/parameterized_tendencies/sponge/rayleigh_sponge.jl b/src/parameterized_tendencies/sponge/rayleigh_sponge.jl index f1347c6d25..92f506e35b 100644 --- a/src/parameterized_tendencies/sponge/rayleigh_sponge.jl +++ b/src/parameterized_tendencies/sponge/rayleigh_sponge.jl @@ -12,11 +12,11 @@ function rayleigh_sponge_cache(rs::RayleighSponge, Y) (; zd, α_uₕ, α_w) = rs ᶜz = Fields.coordinate_field(Y.c).z ᶠz = Fields.coordinate_field(Y.f).z - ᶜαₘ_uₕ = @. ifelse(ᶜz > zd, α_uₕ, FT(0)) - ᶠαₘ_w = @. ifelse(ᶠz > zd, α_w, FT(0)) + ᶜαₘ_uₕ = @. ifelse(ᶜz > zd, α_uₕ, $(FT(0))) + ᶠαₘ_w = @. ifelse(ᶠz > zd, α_w, $(FT(0))) zmax = maximum(ᶠz) - ᶜβ_rayleigh_uₕ = @. ᶜαₘ_uₕ * sin(FT(π) / 2 * (ᶜz - zd) / (zmax - zd))^2 - ᶠβ_rayleigh_w = @. ᶠαₘ_w * sin(FT(π) / 2 * (ᶠz - zd) / (zmax - zd))^2 + ᶜβ_rayleigh_uₕ = @. ᶜαₘ_uₕ * sin($(FT(π)) / 2 * (ᶜz - zd) / (zmax - zd))^2 + ᶠβ_rayleigh_w = @. ᶠαₘ_w * sin($(FT(π)) / 2 * (ᶠz - zd) / (zmax - zd))^2 return (; ᶜβ_rayleigh_uₕ, ᶠβ_rayleigh_w) end