Changeset 1382 in lmdz_wrf


Ignore:
Timestamp:
Dec 14, 2016, 10:17:49 AM (8 years ago)
Author:
lfita
Message:

Adding removal of non-checking variables from WRFt' and WRFgeop'
Fixing `WRFgeop' adding also de-staggering of the variable

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/tools/diagnostics.py

    r1351 r1382  
    14731473# WRFgeop geopotential from WRF as PH + PHB
    14741474    elif diag == 'WRFgeop':
    1475            
    1476         diagout = WRFgeop
     1475        var0 = ncobj.variables[depvars[0]][:]
     1476        var1 = ncobj.variables[depvars[1]][:]
     1477
     1478        # de-staggering geopotential
     1479        diagout0 = var0 + var1
     1480        dt = diagout0.shape[0]
     1481        dz = diagout0.shape[1]
     1482        dy = diagout0.shape[2]
     1483        dx = diagout0.shape[3]
     1484
     1485        diagout = np.zeros((dt,dz-1,dy,dx), dtype=np.float)
     1486        diagout = 0.5*(diagout0[:,1:dz,:,:]+diagout0[:,0:dz-1,:,:])
     1487
     1488        # Removing the nonChecking variable-dimensions from the initial list
     1489        varsadd = []
     1490        for nonvd in NONchkvardims:
     1491            if gen.searchInlist(dvnames,nonvd): dvnames.remove(nonvd)
     1492            varsadd.append(nonvd)
    14771493
    14781494        ncvar.insert_variable(ncobj, 'zg', diagout, dnames, dvnames, newnc)
     
    15531569        dnamesvar = list(ncobj.variables[depvars[0]].dimensions)
    15541570        dvnamesvar = ncvar.var_dim_dimv(dnamesvar,dnames,dvnames)
     1571
     1572        # Removing the nonChecking variable-dimensions from the initial list
     1573        varsadd = []
     1574        for nonvd in NONchkvardims:
     1575            if gen.searchInlist(dvnames,nonvd): dvnames.remove(nonvd)
     1576            varsadd.append(nonvd)
    15551577
    15561578        ncvar.insert_variable(ncobj, 'ta', WRFt, dnames, dvnames, newnc)
Note: See TracChangeset for help on using the changeset viewer.