Changeset 2839 in lmdz_wrf for trunk/tools


Ignore:
Timestamp:
May 15, 2020, 11:07:24 PM (5 years ago)
Author:
lfita
Message:

Fixing humidity calculations

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/tools/diag_tools.py

    r2834 r2839  
    22742274    #print 'es:', es[5,5,5,5], 'ws:', ws[5,5,5,5], 'hur:', hur[5,5,5,5]
    22752275
     2276
     2277    # Complementary formula from where?
     2278    svp1=611.2
     2279    svp2=17.67
     2280    svp3=29.65
     2281    svpt0=273.15
     2282    eps = 0.622
     2283
     2284#    rh = 1.E2 * (p*q/(q*(1.-eps) + eps))/(svp1*exp(svp2*(t-svpt0)/(T-svp3)))
     2285    rh = 1.E2 * (p*q/(q*(1.-eps) + eps))/(svp1*np.exp(svp2*(t-svpt0)/(t-svp3)))
     2286    #print 'rh', rh
     2287
    22762288    return hur
    22772289
     
    23202332            tdps = c*gamma/(b-gamma)
    23212333         hur = 100*expr[b(tdps/(c+tdps)-tas/(c+tas))]
    2322 
     2334    >>> var_hur_tas_tds(10.+273.15, 8.+273.15, None, None)
     2335    0.8737387866043359
    23232336    """
    23242337    fname = 'compute_hur_tas_tds'
     
    23362349    hur = np.exp(b*(tdsC/(c+tdsC)-tasC/(c+tasC)))
    23372350               
     2351    Xlv = 2.5e6
     2352    Rv = 461.5
     2353
     2354    rh = np.exp(Xlv/Rv*(1./tas - 1./tds)) * 1.E2
     2355    print 'rh', rh
     2356
    23382357    return hur, dnamesvar, dvnamesvar
    23392358
Note: See TracChangeset for help on using the changeset viewer.