Changeset 2259 in lmdz_wrf for trunk/tools/generic_tools.py


Ignore:
Timestamp:
Dec 13, 2018, 3:43:20 PM (6 years ago)
Author:
lfita
Message:

Adding into `realdatetime1_CFcompilant':

  • Fixing on empty dates to 1949-12-01 00:00:00
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/tools/generic_tools.py

    r2250 r2259  
    45454545    229784.33333333
    45464546    """
    4547 
    45484547    import datetime as dt
     4548    fname = 'realdatetime1_CFcompilant'
     4549
    45494550    yrref=int(Srefdate[0:4])
    45504551    monref=int(Srefdate[4:6])
     
    45554556 
    45564557    refdate=dt.datetime(yrref, monref, dayref, horref, minref, secref)
     4558
     4559    if np.all(np.array(time) == 0):
     4560        print warnmsg
     4561        print '  ' + fname + ": empty date !!"
     4562        print '    filling to 1949-12-01 00:00:00'
     4563        time[0] = 1949
     4564        time[1] = 12
     4565        time[2] = 1
     4566        time[3] = 0
     4567        time[4] = 0
     4568        time[5] = 0
    45574569
    45584570    if tunits == 'weeks':
Note: See TracChangeset for help on using the changeset viewer.