Skip to content

Commit

Permalink
Fix logic control
Browse files Browse the repository at this point in the history
  • Loading branch information
gdecker1 committed Aug 8, 2023
1 parent 5c3139e commit 31722df
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/UniversalFunctions.jl
Original file line number Diff line number Diff line change
Expand Up @@ -643,13 +643,13 @@ function Psi(uf::Beljaars, ζ, tt::MomentumTransport)
_b_m = FT(b_m(uf))
_c_m = FT(c_m(uf))
_d_m = FT(d_m(uf))
if (abs(ζ) < eps(FT) && ζ >= 0) || (abs(ζ) >= eps(FT) && ζ < 0)
if ζ >= 0
# Volume-averaged form of Beljaars1991 Eq. 28
exp_term1 = _c_m * ((1 - exp(-_d_m * ζ)) /* _d_m^2) - 1 / _d_m)
exp_term2 = (exp(-_d_m * ζ) - 1) /* _d_m^2)
exp_term3 = exp(-_d_m * ζ) / _d_m
return _b_m * (exp_term1 + exp_term2 + exp_term3) - _a_m * ζ / 2
elseif (abs(ζ) < eps(FT) && ζ < 0)
elseif abs(ζ) < eps(FT) && ζ < 0
# Nishizawa2018 Eq. A13 (ζ < 0)
return -FT(15) * ζ / FT(8)
else
Expand All @@ -671,7 +671,7 @@ function Psi(uf::Beljaars, ζ, tt::HeatTransport)
linear_term = ζ * (_b_h * _c_h / _d_h - 1)
exp_term2 = _b_h * (1 - exp(-_d_h * ζ) * (_d_h * ζ + 1)) / (_d_h^2)
return (-1 / ζ) * (sqrt_term + exp_term1 + linear_term + exp_term2)
elseif (abs(ζ) < eps(FT) && ζ < 0)
elseif abs(ζ) < eps(FT) && ζ < 0
# Nishizawa2018 Eq. A14 (ζ < 0)
return -9 * ζ / 4
else
Expand Down

0 comments on commit 31722df

Please sign in to comment.