Changeset 1375 in lmdz_wrf
- Timestamp:
- Dec 6, 2016, 6:46:31 PM (8 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/tools/nc_var.py
r1360 r1375 34 34 ## e.g. # nc_var.py -o compute_opersvarsfiles -S 'lon|lon|-1;lat|lat|-1;time_counter|time_counter|-1@forwrdderiv,1,1,2|/ccc/store/cont003/gen7593/fitaborl/etudes/DynamicoESM/aquaplanet/AR40/19800101000000-19810101000000/histday.nc|t2m' -v 'tasderiv,x-derivative|of|air|temperature,K 35 35 ## e.g. # nc_var.py -o getvars_tofile -S soils_param_Zobler_textXIOS.nc -f soils_param_colorXIOS.nc -v 'soiltext,soiltexttypes' 36 ## e.g. # nc_var.py -o addVar -S 'lon,lat|mask@mask@1|f' -f new_ORCHIDEE_13PFTmap_2010_cmpi6_LUH2v2h.nc -v mask 37 ## e.g. # nc_var.py -o setvar_nc -S 'new_ORCHIDEE_13PFTmap_2010_cmpi6_LUH2v2h.nc,maxvegetfrac,veget;0' -f new_ORCHIDEE_13PFTmap_2010_cmpi6_LUH2v2h.nc -v mask 38 ## e.g. $ nc_var.py -o VarVal_FillValue -S '0.,eq,std' -f new_lai2D.nc -v LAI 39 ## e.g. # nc_var.py -o rm_FillValue -f new_ORCHIDEE_13PFTmap_2010_cmpi6_LUH2v2h.nc -S 0 -v mask 36 40 37 41 from optparse import OptionParser … … 44 48 import generic_tools as gen 45 49 50 # addVar: Operation to add a new variable in a file using exisintg dimensions 46 51 # addvals: Function to add values to a given variable at a given dimension 47 52 # CDO_toCF: Function to pass a CDO output file to CF-conventions … … 104 109 # giving Header, Middle, Tail for the name files 105 110 # reproject: Function to reproject values to another one 111 # rm_FillValue: Operation to remove the _FillValue from a variable inside a netCDF file 106 112 # Partialmap_Entiremap: Function to transform from a partial global map (e.g.: only land points) to an entire one 107 113 # Coincidence of points is done throughout a first guess from fractions of the total domain of search … … 117 123 # sellonlatlevbox: Function to select a lotlan box and a given level from a data-set 118 124 # selvar: Function to select a series of variables from a netcdf file. Variables with 119 # setvar_asciivalues: Function to set de values of a variable with an ASCII file (common 125 # setvar_asciivalues: Function to set de values of a variable with an ASCII file (common Fortran-like format) 126 # setvar_nc: Operation to set values of a variable from values of an other one 120 127 # sorttimesmat: Function to sort the time values of a given file 121 128 # spacemean: Function to retrieve a space mean series from a multidimensional variable of a file … … 146 153 # WRF_toCF: Function to pass a WRF original file to CF-conventions 147 154 148 operations=['add vals', 'CDO_toCF', 'chdimname', 'changevartype', 'checkallvars',\149 'check AllValues', 'checkNaNs',\155 operations=['addVar', 'addvals', 'CDO_toCF', 'chdimname', 'changevartype', \ 156 'checkallvars', 'checkAllValues', 'checkNaNs', \ 150 157 'chgtimestep', 'chvarname', 'cleaning_varsfile', 'compute_deaccum', \ 151 158 'compute_opersvarsfiles', \ … … 165 172 'netcdf_fold_concatenation_HMT', 'reproject', 'Partialmap_Entiremap', \ 166 173 'Partialmap_EntiremapFor', 'Partialmap_EntiremapForExact', \ 167 'pinterp', 'remapnn', 174 'pinterp', 'remapnn', 'rm_FillValue', \ 168 175 'seasmean', 'sellonlatbox', 'sellonlatlevbox', 'selvar', 'setvar_asciivalues', \ 169 'sorttimesmat', 'spacemean', 'SpatialWeightedMean', 'statcompare_files', \ 176 'setvar_nc', 'sorttimesmat', 'spacemean', 'SpatialWeightedMean', \ 177 'statcompare_files', \ 170 178 'subbasin', 'submns', 'subyrs', 'TimeInf', 'time_reset', \ 171 179 'TimeSplitmat', 'timemean', 'valmod', 'valmod_dim','varaddattrk', 'varaddattr', \ … … 249 257 quit(-1) 250 258 251 if oper == 'addvals': 259 if oper == 'addVar': 260 ncvar.addVar(opts.values, opts.ncfile, opts.varname) 261 elif oper == 'addvals': 252 262 ncvar.addvals(opts.values, opts.ncfile, opts.varname) 253 263 elif oper == 'CDO_toCF': … … 384 394 elif oper == 'reproject': 385 395 ncvar.reproject(opts.values, opts.ncfile, opts.varname) 396 elif oper == 'rm_FillValue': 397 ncvar.rm_FillValue(opts.values, opts.ncfile, opts.varname) 386 398 elif oper == 'seasmean': 387 399 ncvar.seasmean(timename, opts.ncfile, opts.varname) … … 394 406 elif oper == 'setvar_asciivalues': 395 407 ncvar.setvar_asciivalues(opts.values, opts.ncfile, opts.varname) 408 elif oper == 'setvar_nc': 409 ncvar.setvar_nc(opts.values, opts.ncfile, opts.varname) 396 410 elif oper == 'sorttimesmat': 397 411 ncvar.sorttimesmat(opts.ncfile, opts.varname)
Note: See TracChangeset
for help on using the changeset viewer.