Changeset 2390 in lmdz_wrf for trunk/tools/diagnostics.py


Ignore:
Timestamp:
Mar 11, 2019, 2:42:10 PM (6 years ago)
Author:
lfita
Message:

Adding:

  • `rhs_tas_tds': Computation of relative humidity from tas and tds
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/tools/diagnostics.py

    r2387 r2390  
    9090    #######
    9191availdiags = ['ACRAINTOT', 'accum', 'clt', 'cllmh', 'convini', 'deaccum', 'fog_K84', \
    92   'fog_RUC', 'LMDZrh', 'mslp', 'OMEGAw', 'RAINTOT', 'range_faces',                   \
    93   'rvors', 'td', 'timemax', 'timeoverthres', 'turbulence', 'uavaFROMwswd',           \
     92  'fog_RUC', 'rhs_tas_tds', 'LMDZrh', 'mslp', 'OMEGAw', 'RAINTOT', 'range_faces',    \
     93  'rvors', 'td', 'timemax', 'timeoverthres', 'turbulence', 'tws', 'uavaFROMwswd',    \
    9494  'WRFbnds', 'WRFcape_afwa', 'WRFclivi', 'WRFclwvi', 'WRF_denszint', 'WRFgeop',      \
    9595  'WRFmrso', 'WRFmrsos', 'WRFpotevap_orPM', 'WRFp', 'WRFpsl_ecmwf',                  \
    9696  'WRFpsl_ptarget', 'WRFrvors', 'WRFslw', 'ws', 'wds', 'wss', 'WRFheight',           \
    97   'WRFheightrel', 'WRFtda', 'WRFtdas', 'WRFua', 'WRFva', 'WRFzwind', 'WRFzwind_log', \
    98   'WRFzwindMO']
     97  'WRFheightrel', 'WRFtda', 'WRFtdas', 'WRFtws', 'WRFua', 'WRFva', 'WRFzwind',      \
     98  'WRFzwind_log', 'WRFzwindMO']
    9999
    100100methods = ['accum', 'deaccum']
     
    516516varsadd = []
    517517
     518Varns = ncobj.variables.keys()
     519Varns.sort()
     520
    518521for idiag in range(Ndiags):
    519522    print '    diagnostic:',diags[idiag]
     
    535538                    print '  ' + main + ": file '" + opts.ncfile +                   \
    536539                      "' does not have variable '" + depv + "' !!"
     540                    print '    available ones:', Varns
    537541                    quit(-1)
    538542        else:
     
    544548                print '  ' + main + ": file '" + opts.ncfile +                       \
    545549                  "' does not have variable '" + depvars + "' !!"
     550                print '    available ones:', Varns
    546551                quit(-1)
    547552
     
    928933        ncvar.insert_variable(ncobj, 'lat_bnds', cellbndsy, diagoutd, diagoutvd, newnc)
    929934
    930 # tws: Bet Wulb temperature following Stull 2011 (tas, hur)
    931     elif diagn == 'rws':
    932            
    933         var0 = ncobj.variables[depvars[0]][:]
    934         var1 = ncobj.variables[depvars[1]][:]
    935 
    936         diagout, diagoutd, diagoutvd = diag.var_tws_S11(var0,var1,dnames,dvnames)
     935# tws: Bet Wulb temperature following Stull 2011 (tas, hurs)
     936    elif diagn == 'tws':
     937           
     938        var0 = ncobj.variables[depvars[0]][:]
     939        var1 = ncobj.variables[depvars[1]][:]
     940
     941        dnamesvar = list(ncobj.variables[depvars[0]].dimensions)
     942        dvnamesvar = ncvar.var_dim_dimv(dnamesvar,dnames,dvnames)
     943        diagoutd = dnames
     944        diagoutvd = ncvar.var_dim_dimv(dnamesvar,dnames,dvnames)
     945
     946        diagout = diag.var_tws_S11(var0,var1)
    937947        ncvar.insert_variable(ncobj, 'tws', diagout, diagoutd, diagoutvd, newnc)
    938948
     
    12241234        ncvar.insert_variable(ncobj, 'hurs', diagout, diagoutd, diagoutvd, newnc)
    12251235
     1236# rhs (psfc, t, q) from tas, tds
     1237    elif diagn == 'rhs_tas_tds':
     1238           
     1239        var0 = ncobj.variables[depvars[0]][:]
     1240        var1 = ncobj.variables[depvars[1]][:]
     1241
     1242        dnamesvar = ncobj.variables[depvars[0]].dimensions
     1243        dvnamesvar = ncvar.var_dim_dimv(dnamesvar,dnames,dvnames)
     1244
     1245        diagout, diagoutd, diagoutvd = diag.var_hur_tas_tds(var0,var1,dnamesvar,     \
     1246          dvnamesvar)
     1247
     1248        ncvar.insert_variable(ncobj, 'hurs', diagout, diagoutd, diagoutvd, newnc)
     1249
    12261250# slw: total soil liquid water SH2O, DZS
    12271251    elif diagn == 'WRFslw':
Note: See TracChangeset for help on using the changeset viewer.