Changeset 2767 in lmdz_wrf for trunk/tools


Ignore:
Timestamp:
Nov 18, 2019, 2:48:10 AM (5 years ago)
Author:
lfita
Message:

Adding:

  • `gradient2Dh': 1st order Horizontal 2D-gradient of any variable
Location:
trunk/tools
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/tools/diagnostics.inf

    r2680 r2767  
    1919front, front_R04, T2@U10@V10@WRFdx@WRFdy@params:1.:0.0001
    2020frontogenesis, frontogenesis, WRFt@UNua:U@UNva:V@UNwa:W@WRFp@WRFdx@WRFdy@WRFdz@WRFtime
     21gradient2dh, gradient2Dh, W@WRFdx@WRFdy
    2122hur, LMDZrh, pres@t@r
    2223hur, WRFrh, WRFrh@T@P@PB
  • trunk/tools/diagnostics.py

    r2766 r2767  
    738738            varsadd.append(nonvd)
    739739
    740         CFvarn = ncvar.variables_values(depvars[0])[0]
     740        CFvarn = gen.variables_values(depvars[0])[0]
    741741
    742742# Removing the flux
     
    11861186
    11871187        var0 = ncobj.variables[depvars[0]]
    1188         var1 = ncobj.variables[depvars[1]][0,:,:]
    1189         var2 = ncobj.variables[depvars[2]][0,:,:]
     1188        if depvars[1] == 'WRFdx':
     1189            var1 = WRFdx
     1190        else:
     1191            var1 = ncobj.variables[depvars[1]][0,:,:]
     1192        if depvars[2] == 'WRFdy':
     1193            var2 = WRFdy
     1194        else:
     1195            var2 = ncobj.variables[depvars[2]][0,:,:]
    11901196
    11911197        dnamesvar = var0.dimensions
     
    12011207            varsadd.append(nonvd)
    12021208
    1203         CFvarn = ncvar.variables_values(depvars[0])[0]
     1209        CFvarn = gen.variables_values(depvars[0])[0]
    12041210        ncvar.insert_variable(ncobj, depvars[0], diagout, diagoutd, diagoutvd,       \
    12051211          newnc, gen.fillValueF)
    12061212        newnc.sync()
    1207         ovar = newnc.variables[depvars[0]]
     1213        CFvar = gen.variables_values(depvars[0])
     1214        newnc.renameVariable(CFvar[0], CFvar[0]+'grad2dh')
     1215        newnc.sync()
     1216        ovar = newnc.variables[CFvar[0]+'grad2dh'
    12081217        varu = ovar.units
    1209         newnc.renameVariable(depvars[0], depvars[0]+'2Dhgrad')
    12101218        ovar.setncattr('units', varu+'ds-1')
     1219        newnc.sync()
    12111220
    12121221# LMDZrh (pres, t, r)
Note: See TracChangeset for help on using the changeset viewer.