Changeset 1906 in lmdz_wrf


Ignore:
Timestamp:
Apr 13, 2018, 3:22:33 PM (7 years ago)
Author:
lfita
Message:

Making use of 'Nstr' at each call of `datetimeStr_conversion' on cfTime

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/tools/nc_var_tools.py

    r1900 r1906  
    1103911039
    1104011040    for it in range(dt):
    11041         wrfdates = datetimeStr_conversion(str(timewrfv[it]) +',minutes since ' +    \
     11041        wrfdates = datetimeStr_conversion(gen.Nstr(timewrfv[it]) +',minutes since '+ \
    1104211042          startdate, 'cfTime', 'matYmdHMS')
    1104311043        cftimes[it] = realdatetime1_CFcompilant(wrfdates, refdate, tunitsval)
     
    1415614156            fdates = ncf.variables[varn][:]
    1415714157            for it in range(fdates.shape[0]):
    14158                 datesv.append(datetimeStr_conversion(fdates[it], 'cfTime,' + tunits ,\
    14159                   'YmdHMS'))
     14158                datesv.append(datetimeStr_conversion(gen.Nstr(fdates[it]), 'cfTime,'+\
     14159                  tunits , 'YmdHMS'))
    1416014160
    1416114161        ncobjs[filename] = datesv
     
    2286522865
    2286622866    # Times period
    22867     begTmat= gen.datetimeStr_conversion(str(timev[0]),'cfTime,'+tunits, 'matYmdHMS')
    22868     endTmat= gen.datetimeStr_conversion(str(timev[dimt-1]),'cfTime,'+tunits,'matYmdHMS')
     22867    begTmat=gen.datetimeStr_conversion(gen.Nstr(timev[0]),'cfTime,'+tunits,'matYmdHMS')
     22868    endTmat = gen.datetimeStr_conversion(gen.Nstr(timev[dimt-1]),'cfTime,'+tunits,   \
     22869      'matYmdHMS')
    2286922870    CFbeg = gen.realdatetime1_CFcompilant(begTmat, refdate, tunitsval)
    2287022871    CFend = gen.realdatetime1_CFcompilant(endTmat, refdate, tunitsval)
     
    2378023781            CFdimvalues['calendar'] = tcal
    2378123782           
    23782             Sinit = gen.datetimeStr_conversion(str(CFitime), 'cfTime,'+tunits,       \
     23783            Sinit = gen.datetimeStr_conversion(gen.Nstr(CFitime), 'cfTime,'+tunits,  \
    2378323784              'Y-m-dTH:M:SZ')
    23784             Sendt = gen.datetimeStr_conversion(str(CFetime), 'cfTime,'+tunits,       \
     23785            Sendt = gen.datetimeStr_conversion(gen.Nstr(CFetime), 'cfTime,'+tunits,  \
    2378523786              'Y-m-dTH:M:SZ')
    2378623787            secfreq = gen.CFtime_freq(axisv[0], axisv[1], tunits)
     
    2432724328        mattvals = np.zeros((itvals.shape[0],6), dtype=int)
    2432824329        for it in range(len(tvals)):
    24329             mattvals[it,:]= gen.datetimeStr_conversion(str(tvals[it]),               \
     24330            mattvals[it,:]= gen.datetimeStr_conversion(gen.Nstr(tvals[it]),          \
    2433024331              'cfTime,minutes since 1949-12-01 00:00:00', 'matYmdHMS')
    2433124332    elif tkind[0:6] == 'CFtime':
     
    2433424335        mattvals = np.zeros((itvals.shape[0],6), dtype=int)
    2433524336        for it in range(len(tvals)):
    24336             mattvals[it,:]= gen.datetimeStr_conversion(str(tvals[it]),               \
     24337            mattvals[it,:]= gen.datetimeStr_conversion(gen.Nstr(tvals[it]),          \
    2433724338              'cfTime,'+utime, 'matYmdHMS')
    2433824339    elif tkind[0:6] == 'string':
Note: See TracChangeset for help on using the changeset viewer.