Changeset 1749 in lmdz_wrf
- Timestamp:
- Dec 17, 2017, 4:45:04 PM (8 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/tools/ORforcing_reconstruct.py
r1748 r1749 12 12 import subprocess as sub 13 13 import module_ForSci as Sci 14 15 filen = 'cruncep_halfdeg_1950.nc' 14 from optparse import OptionParser 15 16 parser = OptionParser() 17 parser.add_option("-y", "--year", dest="year", help="year to process", \ 18 metavar="VALUE") 19 20 (opts, args) = parser.parse_args() 21 22 ####### ###### ##### #### ### ## # 23 24 filen = 'cruncep_halfdeg_' + opts.year + '.nc' 16 25 17 26 # Variable whcih provides the indices of a 1D vector from the dimy, dimx space … … 53 62 availProj = ['latlon'] 54 63 55 ofilen = 'reconstruct_matrix .nc'64 ofilen = 'reconstruct_matrix_' + opts.year + '.nc' 56 65 57 66 ncvars = onc.variables.keys() … … 260 269 onewnc.sync() 261 270 ncvar.add_global_PyNCplot(onewnc, main, fname, '0.1') 262 263 271 onc.close() 272 273 # Reconstructing times 274 otime = onewnc.variables['time'] 275 ncvar.set_attribute(otime, 'units', 'seconds since ' + opts.year + '-01-01 00:00:00') 276 264 277 onewnc.sync() 265 278 onewnc.close() 266 279 267 print fname + ": Successful writing of file ' reconstruct_matrix.nc' !!"280 print fname + ": Successful writing of file '" + ofilen + ".nc' !!"
Note: See TracChangeset
for help on using the changeset viewer.