Skip to content

Commit

Permalink
Merge pull request #220 from CliMA/szy21-patch-2
Browse files Browse the repository at this point in the history
Change the upper limit of q_v_sat in relations.jl
  • Loading branch information
szy21 authored Jul 17, 2024
2 parents d150a35 + 121f953 commit 245f5d8
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 2 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.12.6"
version = "0.12.7"

[deps]
DocStringExtensions = "ffbed154-4ef7-542d-bbb7-c09d3a79fcae"
Expand Down
2 changes: 1 addition & 1 deletion src/relations.jl
Original file line number Diff line number Diff line change
Expand Up @@ -1165,7 +1165,7 @@ Compute the saturation specific humidity, given
q_v_sat = if p - p_v_sat eps(FT)
R_d / R_v * (1 - q_tot) * p_v_sat / (p - p_v_sat)
else
FT(1) / eps(FT)
FT(1)
end
return q_v_sat
end
Expand Down
9 changes: 9 additions & 0 deletions test/relations.jl
Original file line number Diff line number Diff line change
Expand Up @@ -172,6 +172,7 @@ end
q_tot = FT(0.23)
ρ = FT(1.0)
ρ_v_triple = _press_triple / _R_v / _T_triple
p_v_tripleminus = FT(0.99) * _press_triple
@test saturation_vapor_pressure(param_set, _T_triple, Liquid())
_press_triple
@test saturation_vapor_pressure(param_set, _T_triple, Ice()) _press_triple
Expand All @@ -193,6 +194,14 @@ end
phase_type,
) == _R_d / _R_v * (1 - q_tot) * _press_triple / (p - _press_triple)

@test TD.q_vap_saturation_from_pressure(
param_set,
q_tot,
p_v_tripleminus,
_T_triple,
phase_type,
) == FT(1)

phase_type = PhaseNonEquil
@test q_vap_saturation(
param_set,
Expand Down

2 comments on commit 245f5d8

@szy21
Copy link
Member Author

@szy21 szy21 commented on 245f5d8 Jul 17, 2024

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/111260

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.12.7 -m "<description of version>" 245f5d8a33bebaae5fe43c814212d7bbe57af2d5
git push origin v0.12.7

Please sign in to comment.