Changeset 1481 in lmdz_wrf for trunk


Ignore:
Timestamp:
Mar 31, 2017, 6:25:01 PM (8 years ago)
Author:
lfita
Message:

Fixing time-awarness of `netcdf_fold_concatenation_HMT'

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/tools/nc_var_tools.py

    r1480 r1481  
    1068710687    odimvar = ncobjs[0].variables[vardimname]
    1068810688    odimvardims = odimvar.dimensions
    10689     odimattrs = odimvar.ncattrs
     10689    odimattrs = odimvar.ncattrs()
    1069010690    for dimn in odimvardims:
    1069110691        if not gen.searchInlist(newnc.dimensions,dimn):
    1069210692            Ldim = len(odimvar.dimensions[dimn])
    10693     newvar = newnc.crateVarieble(vardimname, odimvar.dtype, odimvardims)
     10693    newvar = newnc.createVariable(vardimname, odimvar.dtype, odimvardims)
    1069410694    for attrn in odimattrs:
    1069510695        attrv = odimvar.getncattr(attrn)
     
    1071510715        print '  ' + fname + ': concatenating dimension-variable has time units!'
    1071610716        print '    shifting temporal-values since the date of the first file', refdate
    10717 
     10717    begslicetot = 0
    1071810718    for ifile in range(Nfiles):
    1071910719        slicevartot = []
     
    1072810728            if tunits:
    1072910729                uvals = objvar.getncattr('units')
    10730                 newtimes = gen.coincident_CFtimes(objvar[:], uvals, urefvals)
    10731                 newvar[tuple(slicevartot)] = objvar[:]
     10730                newtimes = gen.coincident_CFtimes(objvar[:], urefvals, uvals)
     10731                newvar[tuple(slicevartot)] = newtimes[:]
    1073210732            else:
    1073310733                newvar[tuple(slicevartot)] = objvar[:]
     
    1074610746            print '  ' + fname + ": files do not have variable '" + dvar + "' !!!"
    1074710747            quit(-1)
     10748
     10749    if gen.searchInlist(desvars, vardimname): desvars.remove(vardimname)
    1074810750
    1074910751    for dvar in desvars:
Note: See TracChangeset for help on using the changeset viewer.