Changeset 1703 in lmdz_wrf for trunk/tools


Ignore:
Timestamp:
Dec 8, 2017, 7:42:45 PM (8 years ago)
Author:
lfita
Message:

Fixing the right config files and the right variable/dimensions to use

Location:
trunk/tools
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/tools/config_get_stations.NNRP.py

    r1697 r1703  
    4747sfcvariables = {'tas':'T2', 'uas':'WRFuas', 'vas':'WRFvas', 'huss':'Q2', 'ps':'PSFC',\
    4848  '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])
     51sfcrefvar = 'T2'
    5052
    5153# Vertical Variables
    5254sndvariables= {'ta':'air', 'ua':'uwnd', 'va':'vwnd', 'hus':'shum',             \
    5355  '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])
    5458sndrefvar = 'air'
    5559
  • trunk/tools/config_get_stations.WRF.py

    r1692 r1703  
    4444  'T': ['WRFtime']}
    4545
    46 # dim Variables ('H' to determine station height from file)
     46# dim Variables
    4747dimvariables = {'west_east': 'XLONG', 'south_north': 'XLAT', 'bottom_top': 'ZNU',    \
    4848  'Time': 'WRFtime', 'west_east_stag': 'XLONG_U', 'south_north_stag': 'XLAT_U',      \
    49   'bottom_top_stag': 'ZNW', 'H': 'HGT'}
     49  'bottom_top_stag': 'ZNW'}
    5050
    5151# SFC Variables
    52 sfcvariables = {'tas':'T2', 'uas':'WRFuas', 'vas':'WRFvas', 'huss':'Q2', 'ps':'PSFC'}
     52sfcvariables = {'tas':'T2', 'uas':'WRFuas', 'vas':'WRFvas', 'huss':'Q2', 'ps':'PSFC',\
     53  'zhgt':'HGT'}
    5354sfcrefvar = 'tas'
    5455
  • trunk/tools/get_stations.py

    r1702 r1703  
    386386
    387387    if dimn == Pressdimref: dz = len(onc.dimensions[dimn])
     388    dt = onc.variables[sfcrefvar].shape[0]
    388389
    389390# Looking for 2D 'lon', 'lat' related variables
    390 for xn in axesvars['X']:
     391for xn in axesdims['X']:
    391392    Xvarvals = dimvarvalues[dimvariables[xn]]
    392     Yvarvals = dimvarvalues[CFdims['lat']]
     393    Yvarvals = dimvarvalues[dimvariables[CFdims['lat']]]
    393394    if len(Xvarvals.shape) == 1:
    394395        newXvarvals, newYvarvals = np.meshgrid(Xvarvals, Yvarvals)
    395396        dimvarvalues[dimvariables[xn]] = newXvarvals
    396397        if len(Yvarvals.shape) == 1:
    397             dimvarvalues[dimvariables['lat']] = newYvarvals
    398 
    399 for yn in axesvars['Y']:
    400     Xvarvals = dimvarvalues[CFdims['lon']]
     398            dimvarvalues[dimvariables[CFdims['lat']]] = newYvarvals
     399
     400for yn in axesdims['Y']:
     401    Xvarvals = dimvarvalues[dimvariables[CFdims['lon']]]
    401402    Yvarvals = dimvarvalues[dimvariables[yn]]
    402403    if len(Yvarvals.shape) == 1:
     
    676677        # Writting data and slicing
    677678        onewvar = onewnc.variables[sndv]
    678         print 'Lluis sndv:', sndv, ' shapes onewvar:', onewvar.shape, 'slice:', slicevar
    679679        onewvar[:] = ogetvar[tuple(slicevar)]   
    680680        onewnc.sync()
Note: See TracChangeset for help on using the changeset viewer.