Changeset 2834 in lmdz_wrf


Ignore:
Timestamp:
Apr 29, 2020, 7:23:56 PM (5 years ago)
Author:
lfita
Message:

Fixing `var_hur' computation

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/tools/diag_tools.py

    r2766 r2834  
    22462246      [q] = mixing ratio in [kgkg-1]
    22472247      ref.: M. G. Lawrence, BAMS, 2005, 225
    2248     >>> print var_rh(101300., 290., 3.)
     2248    >>> var_hur(101300., 290., 0.003)
    22492249    0.250250256174
     2250    >>> var_hur(100000., 284.8892, 0.004031838)
     2251    0.464525998553
    22502252    """
    22512253    fname = 'var_hur'
     
    22602262    #es = 6.11*np.exp(L/Rv*(1.-273./t)/273.)
    22612263
     2264    tC = t - 273.15
    22622265    # August - Roche - Magnus formula
    2263     es = 6.1094*np.exp(17.625*(t-273.15)/((t-273.15)+243.04))
     2266    es = 6.1094*np.exp(17.625*tC/(tC+243.04))
    22642267
    22652268    # Saturated mixing ratio [g/kg]
    2266     ws = 0.622*es/(0.01*p-es)
    2267 
    2268     hur = q/(ws*1000.)
     2269    ws = 0.622*es/(p/100.-es)
     2270
     2271    hur = q/ws
    22692272
    22702273    #print 'q:', q[5,5,5,5], 't:', t[5,5,5,5], 'p:', p[5,5,5,5]
Note: See TracChangeset for help on using the changeset viewer.