Changeset 1382 in lmdz_wrf for trunk/tools/diagnostics.py
- Timestamp:
- Dec 14, 2016, 10:17:49 AM (8 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/tools/diagnostics.py
r1351 r1382 1473 1473 # WRFgeop geopotential from WRF as PH + PHB 1474 1474 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) 1477 1493 1478 1494 ncvar.insert_variable(ncobj, 'zg', diagout, dnames, dvnames, newnc) … … 1553 1569 dnamesvar = list(ncobj.variables[depvars[0]].dimensions) 1554 1570 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) 1555 1577 1556 1578 ncvar.insert_variable(ncobj, 'ta', WRFt, dnames, dvnames, newnc)
Note: See TracChangeset
for help on using the changeset viewer.