Changeset 1703 in lmdz_wrf for trunk/tools
- Timestamp:
- Dec 8, 2017, 7:42:45 PM (8 years ago)
- Location:
- trunk/tools
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/tools/config_get_stations.NNRP.py
r1697 r1703 47 47 sfcvariables = {'tas':'T2', 'uas':'WRFuas', 'vas':'WRFvas', 'huss':'Q2', 'ps':'PSFC',\ 48 48 'zhgt':'HGT'} 49 sfcrefvar = 'tas' 49 # Surface reference variable (it must be one variable from file which has 50 # the right right shape (e.g. un-staggered) and rang as 3D dimensions [T,Y,X]) 51 sfcrefvar = 'T2' 50 52 51 53 # Vertical Variables 52 54 sndvariables= {'ta':'air', 'ua':'uwnd', 'va':'vwnd', 'hus':'shum', \ 53 55 'zg':'hgt', 'plev':'level', 'tda': 'C_td', 'wd': 'C_wd', 'ws': 'C_ws'} 56 # Sounding reference variable (it must be one variable from file which has 57 # the right right shape (e.g. un-staggered) and rang as 4D dimensions [T,Z,Y,X]) 54 58 sndrefvar = 'air' 55 59 -
trunk/tools/config_get_stations.WRF.py
r1692 r1703 44 44 'T': ['WRFtime']} 45 45 46 # dim Variables ('H' to determine station height from file)46 # dim Variables 47 47 dimvariables = {'west_east': 'XLONG', 'south_north': 'XLAT', 'bottom_top': 'ZNU', \ 48 48 'Time': 'WRFtime', 'west_east_stag': 'XLONG_U', 'south_north_stag': 'XLAT_U', \ 49 'bottom_top_stag': 'ZNW' , 'H': 'HGT'}49 'bottom_top_stag': 'ZNW'} 50 50 51 51 # SFC Variables 52 sfcvariables = {'tas':'T2', 'uas':'WRFuas', 'vas':'WRFvas', 'huss':'Q2', 'ps':'PSFC'} 52 sfcvariables = {'tas':'T2', 'uas':'WRFuas', 'vas':'WRFvas', 'huss':'Q2', 'ps':'PSFC',\ 53 'zhgt':'HGT'} 53 54 sfcrefvar = 'tas' 54 55 -
trunk/tools/get_stations.py
r1702 r1703 386 386 387 387 if dimn == Pressdimref: dz = len(onc.dimensions[dimn]) 388 dt = onc.variables[sfcrefvar].shape[0] 388 389 389 390 # Looking for 2D 'lon', 'lat' related variables 390 for xn in axes vars['X']:391 for xn in axesdims['X']: 391 392 Xvarvals = dimvarvalues[dimvariables[xn]] 392 Yvarvals = dimvarvalues[ CFdims['lat']]393 Yvarvals = dimvarvalues[dimvariables[CFdims['lat']]] 393 394 if len(Xvarvals.shape) == 1: 394 395 newXvarvals, newYvarvals = np.meshgrid(Xvarvals, Yvarvals) 395 396 dimvarvalues[dimvariables[xn]] = newXvarvals 396 397 if len(Yvarvals.shape) == 1: 397 dimvarvalues[dimvariables[ 'lat']] = newYvarvals398 399 for yn in axes vars['Y']:400 Xvarvals = dimvarvalues[ CFdims['lon']]398 dimvarvalues[dimvariables[CFdims['lat']]] = newYvarvals 399 400 for yn in axesdims['Y']: 401 Xvarvals = dimvarvalues[dimvariables[CFdims['lon']]] 401 402 Yvarvals = dimvarvalues[dimvariables[yn]] 402 403 if len(Yvarvals.shape) == 1: … … 676 677 # Writting data and slicing 677 678 onewvar = onewnc.variables[sndv] 678 print 'Lluis sndv:', sndv, ' shapes onewvar:', onewvar.shape, 'slice:', slicevar679 679 onewvar[:] = ogetvar[tuple(slicevar)] 680 680 onewnc.sync()
Note: See TracChangeset
for help on using the changeset viewer.