Changeset 1942 in lmdz_wrf for trunk/tools


Ignore:
Timestamp:
Jul 17, 2018, 9:50:29 PM (7 years ago)
Author:
lfita
Message:

Adding:

  • `WRFtda:' dew-point temperature
Location:
trunk/tools
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/tools/diagnostics.inf

    r1927 r1942  
    3636slw, WRFslw,  SH2O@DZS
    3737ta, WRFt, T@P@PB
    38 td, WRFtd, WRFp@WRFt2@QVAPOR
     38td, WRFtd, WRFp@WRFt@QVAPOR
    3939tds, TStd, psfc@t@q
    4040tds, WRFtds, PSFC@T2@Q2
  • trunk/tools/diagnostics.py

    r1927 r1942  
    5757import datetime as dtime
    5858import module_ForDiag as fdin
     59import module_ForDef as fdef
    5960import diag_tools as diag
    6061
     
    8990  'WRFmrso', 'WRFpotevap_orPM', 'WRFp', 'WRFpsl_ecmwf',                              \
    9091  'WRFpsl_ptarget', 'WRFrvors', 'WRFslw', 'ws', 'wds', 'wss', 'WRFheight',           \
    91   'WRFheightrel', 'WRFua', 'WRFva', 'WRFzwind', 'WRFzwind_log', 'WRFzwindMO']
     92  'WRFheightrel', 'WRFtda', 'WRFua', 'WRFva', 'WRFzwind', 'WRFzwind_log',            \
     93  'WRFzwindMO']
    9294
    9395methods = ['accum', 'deaccum']
     
    12041206        ncvar.insert_variable(ncobj, 'ta', WRFt, dnames, diagoutvd, newnc)
    12051207
     1208# WRFtda (WRFrh, WRFt)
     1209    elif diagn == 'WRFtda':
     1210        ARM2 = fdef.module_definitions.arm2
     1211        ARM3 = fdef.module_definitions.arm3
     1212
     1213        gammatarh = np.log(WRFrh) + ARM2*(WRFt-273.15)/((WRFt-273.15)+ARM3)
     1214        td = ARM3*gammatarh/(ARM2-gammatarh) + 273.15
     1215
     1216        dnamesvar = list(ncobj.variables['T'].dimensions)
     1217        dvnamesvar = ncvar.var_dim_dimv(dnamesvar,dnames,dvnames)
     1218
     1219        # Removing the nonChecking variable-dimensions from the initial list
     1220        varsadd = []
     1221        diagoutvd = list(dvnames)
     1222        for nonvd in NONchkvardims:
     1223            if gen.searchInlist(dvnames,nonvd): diagoutvd.remove(nonvd)
     1224            varsadd.append(nonvd)
     1225
     1226        ncvar.insert_variable(ncobj, 'tda', td, dnames, diagoutvd, newnc)
     1227
    12061228# WRFua (U, V, SINALPHA, COSALPHA) to be rotated !!
    12071229    elif diagn == 'WRFua':
     
    14641486    #   where not in the original file
    14651487    for vadd in varsadd:
    1466         if not gen.searchInlist(newnc.variables.keys(),vadd):
     1488        if not gen.searchInlist(newnc.variables.keys(),vadd) and                     \
     1489          dictcompvars.has_key(vadd):
    14671490            attrs = dictcompvars[vadd]
    14681491            vvn = attrs['name']
Note: See TracChangeset for help on using the changeset viewer.