Changeset 1551 in lmdz_wrf


Ignore:
Timestamp:
May 1, 2017, 7:36:14 PM (8 years ago)
Author:
lfita
Message:

Fixing `compute_opersvarsfiles':

  • Adding complement variables for the non-sliced dimension-variable
  • Adding a counter increase which was missed
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/tools/nc_var_tools.py

    r1548 r1551  
    73917391                if dimv != 'WRFtime':
    73927392                    odimv = objnc.variables[dimv]
    7393                     print fname + ': Lluis dictslice:', dictslice
    7394                     print fname + ': Lluis odimv:', odimv.dimensions
    73957393                    varslice, Dddv[dimn] = SliceVarDict(odimv, dictslice)
    7396                     print fname + ': Lluis varslice:', varslice
    7397                     print fname + ': Lluis Dddv:', Dddv
    73987394                    Ddv[dimn] = odimv[tuple(varslice)]
    73997395                    Dtdv[dimn] = odimv.dtype
     
    74477443                found = False
    74487444                if not gen.searchInlist(Dddv.keys(), dimn):
     7445                    ovar = objnc.variables[dimn]
    74497446                    print warnmsg
    74507447                    print '  ' + fname + ": sliced variable has dimension '" + dimn+ \
     
    74527449                    print "    add range for the dimension as '[dim]|[dimv]|[range]'"
    74537450                    print '    trying now tacking all values of the dimension-variable'
    7454                     print "    ", varn + "'s dimensions:", dimvarvals
     7451                    print "    " + dimn + "'s dimensions:", ovar.dimensions
    74557452                    print '    provided slicing dimension-variables:', Dddv.keys()
    7456                     Dddv[dimn] = dimn
     7453                    Dddv[dimn] = [dimn]
     7454                    Ddv[dimn] = ovar[:]
     7455                    Dtdv[dimn] = ovar.dtype
     7456                    dicattrs = {}
     7457                    for attrn in odimv.ncattrs():
     7458                        attrval = odimv.getncattr(attrn)
     7459                        dicattrs[attrn] = attrval
     7460                    Dadv[dimn] = dicattrs
    74577461                    #quit(-1)
    74587462        else:
     
    75577561    #   dimension name: dim + '_' + operS + '_' + var
    75587562    #   dimension size: value from the shape of the additional values
     7563
    75597564
    75607565    for operSvarn in Dadditionalv.keys():
     
    75837588                    newdim = objofile.createDimension(newdimn,dsize)
    75847589                    newvdims.append(newdimn)
     7590                    idim = idim + 1
    75857591
    75867592                for Hvarn in Hvarns:
Note: See TracChangeset for help on using the changeset viewer.