Changeset 1715 in lmdz_wrf


Ignore:
Timestamp:
Dec 13, 2017, 10:21:41 PM (7 years ago)
Author:
lfita
Message:

Finally understanding RH formula!

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/tools/diag_tools.py

    r1714 r1715  
    12721272      [p] = pressure field (assuming in [Pa])
    12731273      [q] = mixing ratio in [kgkg-1]
     1274      ref.: M. G. Lawrence, BAMS, 2005, 225
     1275    >>> print var_rh(101300., 290., 3.)
     1276    0.250250256174
    12741277    """
    12751278    fname = 'var_rh'
    12761279
    1277     data1 = 10.*0.6112*np.exp(17.67*(t-273.16)/(t-29.65))
    1278     data2 = 0.622*data1/(0.01*p-(1.-0.622)*data1)
    1279 
    1280     rh = q/data2
     1280    # Enthalpy of vaporization [Jkg-1]
     1281    L = 2.453*10.**6
     1282    # Gas constant for water vapor [JK-1Kg-1]
     1283    Rv = 461.5
     1284
     1285    # Computing saturated pressure
     1286    #es = 10.*0.6112*np.exp(17.67*(t-273.16)/(t-29.65))
     1287    #es = 6.11*np.exp(L/Rv*(1.-273./t)/273.)
     1288
     1289    # August - Roche - Magnus formula
     1290    es = 6.1094*np.exp(17.625*(t-273.15)/((t-273.15)+243.04))
     1291
     1292    # Saturated mixing ratio [g/kg]
     1293    ws = 0.622*es/(0.01*p-es)
     1294
     1295    rh = q/(ws*1000.)
    12811296
    12821297    return rh
Note: See TracChangeset for help on using the changeset viewer.