Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

More stable implementation #482

Merged
merged 1 commit into from
Nov 15, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/Common.jl
Original file line number Diff line number Diff line change
Expand Up @@ -332,7 +332,7 @@ Assuming exponential size distribution and hence μ=0.
function Chen2022_exponential_pdf(a::FT, b::FT, c::FT, λ::FT, k::Int) where {FT}
μ = 0 # Exponential instead of gamma distribution
δ = FT(μ + k + 1)
return a * λ^δ * Γ(b + δ) / (λ + c)^(b + δ) / Γ(δ)
return a * exp(δ * log(λ) - (b + δ) * log(λ + c)) * Γ(b + δ) / Γ(δ)
end

end # module end
2 changes: 1 addition & 1 deletion test/microphysics1M_tests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ function test_microphysics1M(FT)
v_bigger = CM1.terminal_velocity(snow, Ch2022.large_ice, ρ, q_sno * 2)

#test
TT.@test vt_sno ≈ 0.5151154754853093 rtol = 2e-6
TT.@test vt_sno ≈ 0.5151154754853068 rtol = 3e-6
TT.@test CM1.terminal_velocity(snow, Ch2022.large_ice, ρ, FT(0)) ≈ 0 atol =
eps(FT)
TT.@test v_bigger > vt_sno
Expand Down
Loading