Changeset 1306 in lmdz_wrf for trunk


Ignore:
Timestamp:
Nov 10, 2016, 2:19:56 PM (8 years ago)
Author:
lfita
Message:

Fixing on the right site of the 0000' time-units issue in LMDZ_toCF'

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/tools/nc_var_tools.py

    r1305 r1306  
    1760317603    tunits = tvaro.getncattr('units')
    1760417604
     17605    # Fixing 0000 year issue...
     17606    Stunits = tunits.split(' ')
     17607    Utunits = tunits[0]
     17608    if len(Stunits) == 4:
     17609        datetunits = Stunits[2] + ' ' + Stunits[3]
     17610    else:
     17611        datetunits = Stunits[2] + ' 00:00:00'
     17612
     17613    if int(datetunits[0:4]) == 0:
     17614        print warnmsg
     17615        print '  ' + fname + ": Imposing a new units year for dates on '1900' !!"
     17616        dateunits[0:4] = '1900'
     17617        tunits = Utunits + ' since ' + dateunits
     17618
    1760517619    RefDate = CFT.split(' ')[2]
    17606     # Fixing 0000 year issue...
    17607     if int(RefDate[0:4]) == 0:
    17608         print warnmsg
    17609         print '  ' + fname + ": Imposing a new reference year for dates on '1900' !!"
    17610         RefDate[0:4] = '1900'
    17611 
    1761217620    RefDateS = RefDate[0:4] + '-' + RefDate[4:6] + '-' + RefDate[6:8] + ' ' +        \
    1761317621      RefDate[8:10] + ':' + RefDate[10:12] + ':' + RefDate[12:14]
    1761417622    CFtimeUnits = ' '.join(CFT.split(' ')[0:2]) + ' '+ RefDateS
    17615 
    1761617623
    1761717624    newtvals = gen.coincident_CFtimes(tvals, CFtimeUnits, tunits)
Note: See TracChangeset for help on using the changeset viewer.