Changeset 1706 in lmdz_wrf


Ignore:
Timestamp:
Dec 8, 2017, 10:06:34 PM (7 years ago)
Author:
lfita
Message:

Adding includion of time values!!

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/tools/get_stations.py

    r1704 r1706  
    3030NONcheckingvars = Cvars + WRFvars + ['None']
    3131
    32 def creation_sfcstation_file(filen, lv, Lv, hv, lab, tunits, sfcvars, dimt, ifilen):
     32def creation_sfcstation_file(filen, lv, Lv, hv, tv, lab, tunits, sfcvars, dimt,      \
     33  ifilen):
    3334    """ Function to create the structure of the surface station file
    3435      filen: name of the file
     
    5354    # Variable-dimensions
    5455    newvar = onewnc.createVariable('time', 'f8', ('time'))
     56    newvar[:] = tv
    5557    ncvar.basicvardef(newvar, 'time', 'Time', tunits)
    5658    ncvar.set_attribute(newvar, 'calendar', 'standard')
     
    133135    return
    134136
    135 def creation_sndstation_file(filen, lv, Lv, hv, lab, tunits, punits, ptime, sndvars, \
    136   dimt, dimz, ifilen):
     137def creation_sndstation_file(filen, lv, Lv, hv, tv, lab, tunits, punits, ptime,      \
     138  sndvars, dimt, dimz, ifilen):
    137139    """ Function to create the structure of the surface station file
    138140      filen: name of the file
     
    161163    # Variable-dimensions
    162164    newvar = onewnc.createVariable('time', 'f8', ('time'))
     165    newvar[:] = tv
    163166    ncvar.basicvardef(newvar, 'time', 'Time', tunits)
    164167    ncvar.set_attribute(newvar, 'calendar', 'standard')
     
    248251
    249252    # 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')<
    251254    ncvar.set_attribute(newvar, 'data_origin', 'SMN')
    252255
     
    409412        dimvarvalues[dimvariables[yn]] = newYvarvals
    410413
     414tvals = dimvarvalues[dimvariables[CFdims['time']]]
     415
    411416# Retrieving surface data
    412417##
     
    428433    stfilen = 'sfc_station_' + labelv + '.nc'
    429434
    430     creation_sfcstation_file(stfilen, lonv, latv, heightv, labelv, utime,            \
     435    creation_sfcstation_file(stfilen, lonv, latv, heightv, tvals, labelv, utime,     \
    431436      sfcvariables.keys(), dt, simfilen)
    432437
     
    568573    stfilen = 'snd_station_' + labelv + '.nc'
    569574
    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)
    572577
    573578    onewnc = NetCDFFile(stfilen, 'a')
Note: See TracChangeset for help on using the changeset viewer.