PySDM_examples.Jouzel_and_Merlivat_1984.thermodynamic_profiles

 1"""
 2From [Jouzel & Merlivat 1984](https://doi.org/10.1029/JD089iD07p11749).
 3"""
 4
 5import numpy as np
 6from scipy.interpolate import make_interp_spline
 7
 8from PySDM.physics.constants_defaults import T0
 9from PySDM.physics import si
10
11pressure = make_interp_spline(
12    x=np.asarray([-10, -20, -30, -40, -50])[::-1] + T0,
13    y=np.asarray([925, 780, 690, 630, 600])[::-1] * si.mbar,
14)
15""" Table 1, first two columns: temperature and pressure"""
16pressure.extrapolate = False
17
18
19def ice_saturation_curve_4(const, T):
20    """eq. (15)"""
21    return 0.99 - 0.006 * (T - const.T0)
22
23
24def vapour_mixing_ratio(formulae, T):
25    """mixing ratio with saturation wrt ice calculated with curve 4 equation"""
26    const = formulae.constants
27    svp = formulae.saturation_vapour_pressure
28    p_v = ice_saturation_curve_4(const, T) * svp.pvs_ice(T)
29    rho_v = p_v / const.Rv / T
30    rho_d = (pressure(T) - p_v) / const.Rd / T
31    return rho_v / rho_d
pressure = <scipy.interpolate._bsplines.BSpline object>

Table 1, first two columns: temperature and pressure

def ice_saturation_curve_4(const, T):
20def ice_saturation_curve_4(const, T):
21    """eq. (15)"""
22    return 0.99 - 0.006 * (T - const.T0)

eq. (15)

def vapour_mixing_ratio(formulae, T):
25def vapour_mixing_ratio(formulae, T):
26    """mixing ratio with saturation wrt ice calculated with curve 4 equation"""
27    const = formulae.constants
28    svp = formulae.saturation_vapour_pressure
29    p_v = ice_saturation_curve_4(const, T) * svp.pvs_ice(T)
30    rho_v = p_v / const.Rv / T
31    rho_d = (pressure(T) - p_v) / const.Rd / T
32    return rho_v / rho_d

mixing ratio with saturation wrt ice calculated with curve 4 equation