Changeset 1706 in lmdz_wrf for trunk/tools/get_stations.py
- Timestamp:
- Dec 8, 2017, 10:06:34 PM (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/tools/get_stations.py
r1704 r1706 30 30 NONcheckingvars = Cvars + WRFvars + ['None'] 31 31 32 def creation_sfcstation_file(filen, lv, Lv, hv, lab, tunits, sfcvars, dimt, ifilen): 32 def creation_sfcstation_file(filen, lv, Lv, hv, tv, lab, tunits, sfcvars, dimt, \ 33 ifilen): 33 34 """ Function to create the structure of the surface station file 34 35 filen: name of the file … … 53 54 # Variable-dimensions 54 55 newvar = onewnc.createVariable('time', 'f8', ('time')) 56 newvar[:] = tv 55 57 ncvar.basicvardef(newvar, 'time', 'Time', tunits) 56 58 ncvar.set_attribute(newvar, 'calendar', 'standard') … … 133 135 return 134 136 135 def creation_sndstation_file(filen, lv, Lv, hv, lab, tunits, punits, ptime, sndvars,\136 dimt, dimz, ifilen):137 def creation_sndstation_file(filen, lv, Lv, hv, tv, lab, tunits, punits, ptime, \ 138 sndvars, dimt, dimz, ifilen): 137 139 """ Function to create the structure of the surface station file 138 140 filen: name of the file … … 161 163 # Variable-dimensions 162 164 newvar = onewnc.createVariable('time', 'f8', ('time')) 165 newvar[:] = tv 163 166 ncvar.basicvardef(newvar, 'time', 'Time', tunits) 164 167 ncvar.set_attribute(newvar, 'calendar', 'standard') … … 248 251 249 252 # Global attributes 250 ncvar.add_global_PyNCplot(onewnc, 'get_stations.py', fname, '0.1') 253 ncvar.add_global_PyNCplot(onewnc, 'get_stations.py', fname, '0.1')< 251 254 ncvar.set_attribute(newvar, 'data_origin', 'SMN') 252 255 … … 409 412 dimvarvalues[dimvariables[yn]] = newYvarvals 410 413 414 tvals = dimvarvalues[dimvariables[CFdims['time']]] 415 411 416 # Retrieving surface data 412 417 ## … … 428 433 stfilen = 'sfc_station_' + labelv + '.nc' 429 434 430 creation_sfcstation_file(stfilen, lonv, latv, heightv, labelv, utime,\435 creation_sfcstation_file(stfilen, lonv, latv, heightv, tvals, labelv, utime, \ 431 436 sfcvariables.keys(), dt, simfilen) 432 437 … … 568 573 stfilen = 'snd_station_' + labelv + '.nc' 569 574 570 creation_sndstation_file(stfilen, lonv, latv, heightv, labelv, utime, UnitsPress,\571 presstime, sndvariables.keys(), dt, dz, simfilen)575 creation_sndstation_file(stfilen, lonv, latv, heightv, tvals, labelv, utime, \ 576 UnitsPress, presstime, sndvariables.keys(), dt, dz, simfilen) 572 577 573 578 onewnc = NetCDFFile(stfilen, 'a')
Note: See TracChangeset
for help on using the changeset viewer.