Changeset 1810 in lmdz_wrf
- Timestamp:
- Mar 16, 2018, 9:11:22 PM (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/tools/nc_var_tools.py
r1781 r1810 18051 18051 def pinterp(values, ncfile, variables): 18052 18052 """ Function to vertically interpolate using subroutines from the p_interp.F90 NCAR program 18053 Using fortran codes: module_generic.F9018054 foudre: f2py -m module_ForInterpolate --f90exec=/usr/bin/gfortran-4.7 -c module_generic.F90 module_ForInterpolate.F90 >& run_f2py.log18055 ciclad: f2py --f90flags="-fPIC" -L/opt/canopy-1.3.0/Canopy_64bit/System/lib/ -L/usr/lib64/ -L/opt/canopy-1.3.0/Canopy_64bit/System/lib/ -m module_ForInterpolate -c module_generic.F90 module_ForInterpolate.F9018056 18053 values= [interplevs],[linloginterp],[extrap] 18057 18054 [interplevs]: ':' separated list of pressure values to interpolate [Pa] (decreassing in Pa) … … 18063 18060 variables = ',' separated list of names of variables to interpolate ('all', fo all 4D-atmospheric variables) 18064 18061 'WRFght': for WRF geopotential height 18062 'WRFhus': for WRF specific humidity 18065 18063 'WRFrh': for WRF relative humidity 18066 18064 'WRFt': for WRF temperature 18067 18065 'WRFu': for WRF x-wind de-staggered 18068 18066 'WRFv': for WRF y-wind de-staggered 18067 'WRFw': for WRF z-wind de-staggered 18069 18068 """ 18070 18069 import module_ForInt as fin … … 18352 18351 isgeop = True 18353 18352 varattrs = gen.variables_values('WRFght') 18353 CFvn = varattrs[0] 18354 newvarattr['standard_name'] = varattrs[1] 18355 newvarattr['long_name'] = varattrs[4].replace('|',' ') 18356 newvarattr['units'] = varattrs[5] 18357 elif vn == 'WRFhus': 18358 # relative humidity 18359 varin = qv/(1.+qv) 18360 isgeop = False 18361 varattrs = gen.variables_values('hus') 18354 18362 CFvn = varattrs[0] 18355 18363 newvarattr['standard_name'] = varattrs[1] … … 18401 18409 newvarattr['long_name'] = varattrs[4].replace('|',' ') 18402 18410 newvarattr['units'] = varattrs[5] 18411 elif vn == 'WRFw': 18412 ovarin = onc.variables['W'] 18413 print infmsg 18414 print ' ' + fname + ': De-staggering z-wind variable !!' 18415 print ' from:', ovarin.shape, 'to', (dimt, dimz, dimy, dimx) 18416 varin = np.zeros((dimt, dimz, dimy, dimx), dtype=np.float64) 18417 varin[:] = 0.5*(ovarin[:,0:dimz,:,:] + ovarin[:,1:dimz+1,:,:]) 18418 isgeop = False 18419 varattrs = gen.variables_values('wa') 18420 CFvn = varattrs[0] 18421 newvarattr['standard_name'] = varattrs[1] 18422 newvarattr['long_name'] = varattrs[4].replace('|',' ') 18423 newvarattr['units'] = varattrs[5] 18403 18424 elif vn == 'pres': 18404 18425 varin = pres
Note: See TracChangeset
for help on using the changeset viewer.