Skip to content

Commit

Permalink
Merge pull request #192 from CliMA/ck/fix_zero_qtot_edge
Browse files Browse the repository at this point in the history
Fix zero `q_tot` edge case
  • Loading branch information
charleskawczynski authored Feb 9, 2024
2 parents 1508238 + 12e5121 commit 8806d64
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion Project.toml
Original file line number Diff line number Diff line change
@@ -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"
Expand Down
10 changes: 5 additions & 5 deletions src/relations.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down

2 comments on commit 8806d64

@charleskawczynski
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@JuliaRegistrator
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Registration pull request created: JuliaRegistries/General/100584

Tip: Release Notes

Did you know you can add release notes too? Just add markdown formatted text underneath the comment after the text
"Release notes:" and it will be added to the registry PR, and if TagBot is installed it will also be added to the
release that TagBot creates. i.e.

@JuliaRegistrator register

Release notes:

## Breaking changes

- blah

To add them here just re-invoke and the PR will be updated.

Tagging

After the above pull request is merged, it is recommended that a tag is created on this repository for the registered package version.

This will be done automatically if the Julia TagBot GitHub Action is installed, or can be done manually through the github interface, or via:

git tag -a v0.11.7 -m "<description of version>" 8806d6431e7e11382f11c3846850a91b0d99f482
git push origin v0.11.7

Please sign in to comment.