Skip to content
This repository has been archived by the owner on Mar 1, 2023. It is now read-only.

Commit

Permalink
Merge #530
Browse files Browse the repository at this point in the history
530: Undo subtraction of `q_v_sat` in `saturation_adjustment` r=charleskawczynski a=charleskawczynski

Subtracting `q_v_sat` in `saturation_adjustment` is causing convergence issues in #529, so it's being removed here.

Co-authored-by: Charles Kawczynski <kawczynski.charles@gmail.com>
  • Loading branch information
bors[bot] and charleskawczynski authored Nov 12, 2019
2 parents b0a8857 + f21643e commit cdd2ddc
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/Common/MoistThermodynamics/MoistThermodynamics.jl
Original file line number Diff line number Diff line change
Expand Up @@ -756,7 +756,7 @@ function saturation_adjustment(e_int::FT, ρ::FT, q_tot::FT) where {FT<:Real}
return T_1
else
# FIXME here: need to revisit bounds for saturation adjustment to guarantee bracketing of zero.
T_2 = air_temperature(e_int, PhasePartition(q_tot, FT(0), q_tot-q_v_sat)) # Assume all ice
T_2 = air_temperature(e_int, PhasePartition(q_tot, FT(0), q_tot)) # Assume all ice
T, converged = find_zero(
T -> internal_energy_sat(T, ρ, q_tot) - e_int,
T_1, T_2, SecantMethod(), FT(1e-3), 10)
Expand Down Expand Up @@ -791,7 +791,7 @@ function saturation_adjustment_q_tot_θ_liq_ice(θ_liq_ice::FT, q_tot::FT, ρ::F
if unsaturated
return T_1
else
T_2 = air_temperature_from_liquid_ice_pottemp(θ_liq_ice, ρ, PhasePartition(q_tot, FT(0), q_tot-q_v_sat)) # Assume all ice
T_2 = air_temperature_from_liquid_ice_pottemp(θ_liq_ice, ρ, PhasePartition(q_tot, FT(0), q_tot)) # Assume all ice
T, converged = find_zero(
T -> liquid_ice_pottemp_sat(T, ρ, q_tot) - θ_liq_ice,
T_1, T_2, SecantMethod(), FT(1e-5), 40)
Expand Down

0 comments on commit cdd2ddc

Please sign in to comment.