Changeset 914 in lmdz_wrf
- Timestamp:
- Jun 20, 2016, 8:01:02 PM (8 years ago)
- Location:
- trunk/tools
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/tools/diagnostics.inf
r885 r914 26 26 tds, TStd, psfc@t@q 27 27 tds, WRFtds, PSFC@T2@Q2 28 ua, WRFua, U@V@SINALPHA@COSALPHA 29 va, WRFva, U@V@SINALPHA@COSALPHA 28 30 wds, TSwds, u@v 29 31 wds, WRFwds, U10@V10 -
trunk/tools/diagnostics.py
r884 r914 878 878 'OMEGAw', 'RAINTOT', \ 879 879 'rvors', 'td', 'turbulence', 'WRFgeop', 'WRFp', 'WRFrvors', 'wds', 'wss', \ 880 'WRFheight' ]880 'WRFheight', 'WRFua', 'WRFva'] 881 881 882 882 methods = ['accum', 'deaccum'] … … 887 887 'WRFp', 'WRFtd', \ 888 888 'WRFpos', 'WRFprc', 'WRFprls', 'WRFrh', 'LMDZrh', 'LMDZrhs', 'WRFrhs', 'WRFrvors', \ 889 'WRFt', 'WRFtime', 'WRF wds', 'WRFwss', 'WRFheight']889 'WRFt', 'WRFtime', 'WRFua', 'WRFva', 'WRFwds', 'WRFwss', 'WRFheight'] 890 890 891 891 ofile = 'diagnostics.nc' … … 1489 1489 ncvar.insert_variable(ncobj, 'ta', WRFt, dnames, dvnames, newnc) 1490 1490 1491 # WRFtime (u10, v10, WRFpos) 1491 # WRFua (U, V, SINALPHA, COSALPHA) to be rotated !! 1492 elif diag == 'WRFua': 1493 var0 = ncobj.variables[depvars[0]][:] 1494 var1 = ncobj.variables[depvars[1]][:] 1495 var2 = ncobj.variables[depvars[2]][:] 1496 var3 = ncobj.variables[depvars[3]][:] 1497 1498 # un-staggering variables 1499 unstgdims = [var0.shape[0], var0.shape[1], var0.shape[2], var0.shape[3]-1] 1500 ua = np.zeros(tuple(unstgdims), dtype=np.float) 1501 unstgvar0 = np.zeros(tuple(unstgdims), dtype=np.float) 1502 unstgvar1 = np.zeros(tuple(unstgdims), dtype=np.float) 1503 unstgvar0 = 0.5*(var0[:,:,:,0:var0.shape[3]-1] + var0[:,:,:,1:var0.shape[3]]) 1504 unstgvar1 = 0.5*(var1[:,:,0:var1.shape[2]-1,:] + var1[:,:,1:var1.shape[2],:]) 1505 1506 for iz in range(var0.shape[1]): 1507 ua[:,iz,:,:] = unstgvar0[:,iz,:,:]*var3 - unstgvar1[:,iz,:,:]*var2 1508 1509 dnamesvar = list(ncobj.variables[depvars[0]].dimensions) 1510 dvnamesvar = ncvar.var_dim_dimv(dnamesvar,dnames,dvnames) 1511 1512 ncvar.insert_variable(ncobj, 'ua', ua, dnames, dvnames, newnc) 1513 1514 # WRFua (U, V, SINALPHA, COSALPHA) to be rotated !! 1515 elif diag == 'WRFva': 1516 var0 = ncobj.variables[depvars[0]][:] 1517 var1 = ncobj.variables[depvars[1]][:] 1518 var2 = ncobj.variables[depvars[2]][:] 1519 var3 = ncobj.variables[depvars[3]][:] 1520 1521 # un-staggering variables 1522 unstgdims = [var0.shape[0], var0.shape[1], var0.shape[2], var0.shape[3]-1] 1523 va = np.zeros(tuple(unstgdims), dtype=np.float) 1524 unstgvar0 = np.zeros(tuple(unstgdims), dtype=np.float) 1525 unstgvar1 = np.zeros(tuple(unstgdims), dtype=np.float) 1526 unstgvar0 = 0.5*(var0[:,:,:,0:var0.shape[3]-1] + var0[:,:,:,1:var0.shape[3]]) 1527 unstgvar1 = 0.5*(var1[:,:,0:var1.shape[2]-1,:] + var1[:,:,1:var1.shape[2],:]) 1528 for iz in range(var0.shape[1]): 1529 va[:,iz,:,:] = unstgvar0[:,iz,:,:]*var2 + unstgvar1[:,iz,:,:]*var3 1530 1531 dnamesvar = list(ncobj.variables[depvars[0]].dimensions) 1532 dvnamesvar = ncvar.var_dim_dimv(dnamesvar,dnames,dvnames) 1533 1534 ncvar.insert_variable(ncobj, 'va', va, dnames, dvnames, newnc) 1535 1536 # WRFtime 1492 1537 elif diag == 'WRFtime': 1493 1538
Note: See TracChangeset
for help on using the changeset viewer.