Skip to content

Commit

Permalink
Add satvap over ice
Browse files Browse the repository at this point in the history
  • Loading branch information
dcamron committed Jan 9, 2025
1 parent dd12f6b commit 6243bfe
Showing 1 changed file with 46 additions and 0 deletions.
46 changes: 46 additions & 0 deletions src/metpy/calc/thermo.py
Original file line number Diff line number Diff line change
Expand Up @@ -1573,6 +1573,52 @@ def saturation_vapor_pressure(temperature):
)


@exporter.export
@preprocess_and_wrap(wrap_like='temperature')
@process_units({'temperature': '[temperature]'}, '[pressure]')
def saturation_vapor_pressure_ice(temperature):
r"""Calculate the saturation water vapor (partial) pressure over ice.
Parameters
----------
temperature : `pint.Quantity`
Air temperature
Returns
-------
`pint.Quantity`
Saturation water vapor (partial) pressure
Examples
--------
>>> from metpy.calc import saturation_vapor_pressure_ice
>>> from metpy.units import units
>>> saturation_vapor_pressure_ice(-25 * units.degC).to('hPa')
<Quantity(0.632434749, 'hectopascal')>
See Also
--------
saturation_vapor_pressure, vapor_pressure
Notes
-----
Implemented solution from [Ambaum2020]_, Eq. 17,
.. math:: e = e_{i0} \frac{T_0}{T}^{(c_{pi} - c_{pv}) / R_v} \exp{
\frac{L_{s0}}{R_v T_0} - \frac{L_s}{R_v T}}
"""
latent_heat = water_latent_heat_sublimation._nounit(temperature)
heat_power = (mpconsts.nounit.Cp_i - mpconsts.nounit.Cp_v) / mpconsts.nounit.Rv
exp_term = ((mpconsts.nounit.Ls / mpconsts.nounit.T0 - latent_heat / temperature)
/ mpconsts.nounit.Rv)

return (
mpconsts.nounit.sat_pressure_0c
* (mpconsts.nounit.T0 / temperature) ** heat_power
* np.exp(exp_term)
)


@exporter.export
@preprocess_and_wrap(wrap_like='temperature', broadcast=('temperature', 'relative_humidity'))
@check_units('[temperature]', '[dimensionless]')
Expand Down

0 comments on commit 6243bfe

Please sign in to comment.