diff --git a/src/relations.jl b/src/relations.jl index a1aa188b..2afd3754 100644 --- a/src/relations.jl +++ b/src/relations.jl @@ -1569,16 +1569,13 @@ See also [`saturation_adjustment`](@ref). relative_temperature_tol::FT, T_guess::Union{FT, Nothing} = nothing, ) where {FT <: Real, sat_adjust_method, phase_type <: PhaseEquil} - _T_min::FT = TP.T_min(param_set) 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 - q_v_sat = q_vap_saturation(param_set, T_1, ρ, phase_type) - unsaturated = q_tot <= q_v_sat - if unsaturated - return T_1 - end + T_1 = air_temperature(param_set, e_int, 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 + return T_1 end _T_freeze::FT = TP.T_freeze(param_set) @inline e_int_sat(T) = @@ -1709,15 +1706,14 @@ See also [`saturation_adjustment`](@ref). relative_temperature_tol::FT, T_guess::Union{FT, Nothing} = nothing, ) where {FT <: Real, sat_adjust_method, phase_type <: PhaseEquil} - _T_min::FT = TP.T_min(param_set) tol = RS.RelativeSolutionTolerance(relative_temperature_tol) - T_1 = max(_T_min, air_temperature(param_set, e_int, PhasePartition(q_tot))) # Assume all vapor + T_1 = air_temperature(param_set, e_int, PhasePartition(q_tot)) # Assume all vapor @inline ρ_T(T) = air_density(param_set, T, p, PhasePartition(q_tot)) ρ_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 return T_1 end _T_freeze::FT = TP.T_freeze(param_set) @@ -1814,18 +1810,14 @@ See also [`saturation_adjustment`](@ref). relative_temperature_tol::FT, T_guess::Union{FT, Nothing} = nothing, ) where {FT <: Real, sat_adjust_method, phase_type <: PhaseEquil} - _T_min::FT = TP.T_min(param_set) tol = RS.RelativeSolutionTolerance(relative_temperature_tol) - T_1 = max( - _T_min, - air_temperature_from_enthalpy(param_set, h, PhasePartition(q_tot)), - ) # Assume all vapor + T_1 = air_temperature_from_enthalpy(param_set, h, PhasePartition(q_tot)) # Assume all vapor @inline ρ_T(T) = air_density(param_set, T, p, PhasePartition(q_tot)) ρ_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 return T_1 end _T_freeze::FT = TP.T_freeze(param_set) @@ -2043,12 +2035,11 @@ See also [`saturation_adjustment`](@ref). tol::RS.AbstractTolerance, T_guess::Union{FT, Nothing} = nothing, ) where {FT <: Real, phase_type <: PhaseEquil} - _T_min::FT = TP.T_min(param_set) @inline air_temp(q) = air_temperature_given_ρθq(param_set, ρ, θ_liq_ice, q) - T_1 = max(_T_min, air_temp(PhasePartition(q_tot))) # Assume all vapor + T_1 = 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 return T_1 end T_2 = air_temp(PhasePartition(q_tot, FT(0), q_tot)) # Assume all ice