diff --git a/Project.toml b/Project.toml index 75ec69253..bd6bb5b24 100644 --- a/Project.toml +++ b/Project.toml @@ -1,6 +1,6 @@ name = "CloudMicrophysics" uuid = "6a9e3e04-43cd-43ba-94b9-e8782df3c71b" -version = "0.33" +version = "0.34" authors = ["Climate Modeling Alliance"] [deps] diff --git a/src/MicrophysicsNonEq.jl b/src/MicrophysicsNonEq.jl index 231eae470..7ca4fbe8e 100644 --- a/src/MicrophysicsNonEq.jl +++ b/src/MicrophysicsNonEq.jl @@ -159,7 +159,7 @@ function conv_q_vap_to_q_lcl_icl_MM2015( # compute the tendency return ifelse( sat_excess < 0, - -max(FT(0), q_lcl) / timescale, + -min(-sat_excess, max(0, q_lcl)) / timescale, sat_excess / timescale, ) end @@ -184,7 +184,7 @@ function conv_q_vap_to_q_lcl_icl_MM2015( # compute the tendency tendency = ifelse( sat_excess < 0, - -max(FT(0), q_icl) / timescale, + -min(-sat_excess, max(0, q_icl)) / timescale, sat_excess / timescale, ) limiter = INP_limiter(tendency, tps, T) diff --git a/test/microphysics_noneq_tests.jl b/test/microphysics_noneq_tests.jl index 0b1f0266a..789259c29 100644 --- a/test/microphysics_noneq_tests.jl +++ b/test/microphysics_noneq_tests.jl @@ -91,7 +91,7 @@ function test_microphysics_noneq(FT) # Ice sublimation (negative tendency) above freezing should NOT be limited # When subsaturated w.r.t. ice and q_icl > 0, the tendency is negative (sublimation). # The INP limiter only zeroes positive tendencies above freezing, so sublimation passes through. - TT.@test CMNe.conv_q_vap_to_q_lcl_icl_MM2015(ice, tps, FT(0.5 * qᵥ_si_w), FT(0), FT(0.001), FT(0), FT(0), ρ, T_warm) < FT(0) + TT.@test CMNe.conv_q_vap_to_q_lcl_icl_MM2015(ice, tps, FT(0.5 * qᵥ_si_w), FT(0), FT(0.001), FT(0), FT(0), ρ, T_warm) <= FT(0) #! format: on end