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
11
12pressure = make_interp_spline(
13    x=np.asarray([-10, -20, -30, -40, -50])[::-1] + T0,
14    y=np.asarray([925, 780, 690, 630, 600])[::-1] * si.mbar,
15)
16""" Table 1, first two columns: temperature and pressure"""
17pressure.extrapolate = False
18
19
20def ice_saturation_curve_4(const, T):
21    """eq. (15)"""
22    return 0.99 - 0.006 * (T - const.T0)
23
24
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
pressure = <scipy.interpolate._bsplines.BSpline object>

Table 1, first two columns: temperature and pressure

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

eq. (15)

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

mixing ratio with saturation wrt ice calculated with curve 4 equation