Changeset 2257 in lmdz_wrf for trunk/tools
- Timestamp:
- Nov 30, 2018, 8:21:12 PM (6 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/tools/diagnostics.py
r2223 r2257 104 104 'TStd', 'TSwds', 'TSwss', \ 105 105 'WRFbils', \ 106 'WRFclivi', 'WRFclwvi', 'WRFdens', 'WRFdx', 'WRFdxdy', 'WRFd y', 'WRFgeop',\107 'WRF p', 'WRFtd',\106 'WRFclivi', 'WRFclwvi', 'WRFdens', 'WRFdx', 'WRFdxdy', 'WRFdxdywps', 'WRFdy', \ 107 'WRFgeop', 'WRFp', 'WRFtd', \ 108 108 'WRFpos', 'WRFprc', 'WRFprls', 'WRFrh', 'LMDZrh', 'LMDZrhs', \ 109 109 'WRFrhs', 'WRFrvors', \ … … 167 167 WRFz_compute = False 168 168 WRFdxdy_compute = False 169 WRFdxdywps_compute = False 169 170 LONLATdxdy_compute = False 170 171 … … 193 194 if dnv == 'WRFz':WRFz_compute = True 194 195 if dnv == 'WRFdxdy':WRFdxdy_compute = True 196 if dnv == 'WRFdxdywps':WRFdxdywps_compute = True 195 197 if dnv == 'LONLATdxdy':LONLATdxdy_compute = True 196 198 … … 223 225 if gen.searchInlist(depvars, 'WRFz'): WRFz_compute = True 224 226 if gen.searchInlist(depvars, 'WRFdxdy'): WRFdxdy_compute = True 227 if gen.searchInlist(depvars, 'WRFdxdywps'): WRFdxdywps_compute = True 225 228 if gen.searchInlist(depvars, 'LONLATdxdy'): LONLATdxdy_compute = True 226 229 … … 413 416 WRFlon = ncobj.variables['XLONG'][0,:,:] 414 417 WRFlat = ncobj.variables['XLAT'][0,:,:] 418 WRFmapfac_m = ncobj.variables['MAPFAC_M'][0,:,:] 419 DX = ncobj.DX 420 DY = ncobj.DY 421 422 dimx = dimv[2] 423 dimy = dimv[1] 424 425 WRFdx = np.zeros((dimy,dimx), dtype=np.float) 426 WRFdy = np.zeros((dimy,dimx), dtype=np.float) 427 428 WRFdx[:,0:dimx-1]=(WRFlon[:,1:dimx]-WRFlon[:,0:dimx-1])*DX/WRFmapfac_m[:,0:dimx-1] 429 WRFdy[0:dimy-1,:]=(WRFlat[1:dimy,:]-WRFlat[0:dimy-1,:])*DY/WRFmapfac_m[0:dimy-1,:] 430 WRFds = np.sqrt(WRFdx**2 + WRFdy**2) 431 432 # Attributes of the variable 433 Vvals = gen.variables_values('WRFdx') 434 dictcompvars['WRFdx'] = {'name': Vvals[0], 'standard_name': Vvals[1], \ 435 'long_name': Vvals[4].replace('|',' '), 'units': Vvals[5]} 436 Vvals = gen.variables_values('WRFdy') 437 dictcompvars['WRFdy'] = {'name': Vvals[0], 'standard_name': Vvals[1], \ 438 'long_name': Vvals[4].replace('|',' '), 'units': Vvals[5]} 439 Vvals = gen.variables_values('WRFds') 440 dictcompvars['WRFds'] = {'name': Vvals[0], 'standard_name': Vvals[1], \ 441 'long_name': Vvals[4].replace('|',' '), 'units': Vvals[5]} 442 443 if WRFdxdywps_compute: 444 print ' ' + main + ': Retrieving dxdy: real distance between grid points ' + \ 445 'from wpsWRF as dx=(XLONG_M(i+1)-XLONG_M(i))*DX/MAPFAC_M, ' + \ 446 'dy=(XLAT_M(j+1)-XLAT_M(i))*DY/MAPFAC_M, ds=sqrt(dx**2+dy**2)' 447 dimv = ncobj.variables['XLONG_M'].shape 448 WRFlon = ncobj.variables['XLONG_M'][0,:,:] 449 WRFlat = ncobj.variables['XLAT_M'][0,:,:] 415 450 WRFmapfac_m = ncobj.variables['MAPFAC_M'][0,:,:] 416 451 DX = ncobj.DX
Note: See TracChangeset
for help on using the changeset viewer.