From 10a529ff2b44d86c4fc1955deb7ac34a8c782e91 Mon Sep 17 00:00:00 2001 From: Charles Kawczynski Date: Fri, 9 Feb 2024 11:45:34 -0500 Subject: [PATCH 1/2] Fix zero q_tot edge cases --- src/relations.jl | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/relations.jl b/src/relations.jl index 35b463f7..a1aa188b 100644 --- a/src/relations.jl +++ b/src/relations.jl @@ -1573,7 +1573,7 @@ See also [`saturation_adjustment`](@ref). tol = RS.RelativeSolutionTolerance(relative_temperature_tol) T_1 = max(_T_min, air_temperature(param_set, e_int, PhasePartition(q_tot))) # Assume all vapor - if T_1 > _T_min + if T_1 ≥ _T_min q_v_sat = q_vap_saturation(param_set, T_1, ρ, phase_type) unsaturated = q_tot <= q_v_sat if unsaturated @@ -1717,7 +1717,7 @@ See also [`saturation_adjustment`](@ref). ρ_1 = ρ_T(T_1) q_v_sat = q_vap_saturation(param_set, T_1, ρ_1, phase_type) unsaturated = q_tot <= q_v_sat - if unsaturated && T_1 > _T_min + if unsaturated && T_1 ≥ _T_min return T_1 end _T_freeze::FT = TP.T_freeze(param_set) @@ -1825,7 +1825,7 @@ See also [`saturation_adjustment`](@ref). ρ_1 = ρ_T(T_1) q_v_sat = q_vap_saturation(param_set, T_1, ρ_1, phase_type) unsaturated = q_tot <= q_v_sat - if unsaturated && T_1 > _T_min + if unsaturated && T_1 ≥ _T_min return T_1 end _T_freeze::FT = TP.T_freeze(param_set) @@ -2048,7 +2048,7 @@ See also [`saturation_adjustment`](@ref). T_1 = max(_T_min, air_temp(PhasePartition(q_tot))) # Assume all vapor q_v_sat = q_vap_saturation(param_set, T_1, ρ, phase_type) unsaturated = q_tot <= q_v_sat - if unsaturated && T_1 > _T_min + if unsaturated && T_1 ≥ _T_min return T_1 end T_2 = air_temp(PhasePartition(q_tot, FT(0), q_tot)) # Assume all ice @@ -2153,7 +2153,7 @@ See also [`saturation_adjustment`](@ref). T_1 = max(T_min, air_temp(PhasePartition(q_tot))) # Assume all vapor q_v_sat_1 = q_vap_sat(T_1) unsaturated = q_tot <= q_v_sat_1 - if unsaturated && T_1 > T_min + if unsaturated && T_1 ≥ T_min return T_1 end temperature_tol = T_freeze * relative_temperature_tol From 12e5121522fceb522e020a16fd4f0790d67ded48 Mon Sep 17 00:00:00 2001 From: Charles Kawczynski Date: Fri, 9 Feb 2024 12:06:19 -0500 Subject: [PATCH 2/2] Bump patch version --- Project.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Project.toml b/Project.toml index 70c72a96..b41bfcf9 100644 --- a/Project.toml +++ b/Project.toml @@ -1,7 +1,7 @@ name = "Thermodynamics" uuid = "b60c26fb-14c3-4610-9d3e-2d17fe7ff00c" authors = ["Climate Modeling Alliance"] -version = "0.11.6" +version = "0.11.7" [deps] DocStringExtensions = "ffbed154-4ef7-542d-bbb7-c09d3a79fcae"