Changeset 1502 in lmdz_wrf for trunk


Ignore:
Timestamp:
Apr 8, 2017, 11:00:54 PM (8 years ago)
Author:
lfita
Message:

Fixing wrong addition of the extra dimension not sliced

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/tools/nc_var_tools.py

    r1499 r1502  
    1382213822    varslice = []
    1382313823
     13824    print 'Lluis sliced:', sliced
     13825
    1382413826    # Dictionary with the size of the sliced dimensions
    1382513827    newdimsizes = {}
     
    1384513847                else:
    1384613848                    if newdimsize > 0: newdim = onc.createDimension(dnv, newdimsize)
    13847         if not gen.searchInlist(onc.dimensions,dnv):
     13849        else:
     13850    #if not gen.searchInlist(onc.dimensions,dnv):
     13851            print '  ' + fname + ": adding not sliced dimension '" + dnv + "'"
    1384813852# Avoiding monotone dimensions!
    13849             if newdimsize > 0:
    13850                 od = inc.dimensions[dnv]
    13851                 if od.isunlimited():
    13852                     dsize = None
    13853                 else:
    13854                     dsize = len(od)
    13855                 newdim = onc.createDimension(dnv, dsize)
    13856             newdimsizes[dnv] = newdimsize
     13853            od = inc.dimensions[dnv]
     13854            if od.isunlimited():
     13855                dsize = None
     13856                dvsize = len(od)
     13857            else:
     13858                dsize = len(od)
     13859                dvsize = len(od)
     13860            newdim = onc.createDimension(dnv, dsize)
     13861            newdimsizes[dnv] = dvsize
     13862            sliced[dnv] = [0, dvsize, 1]
    1385713863
    1385813864    # Getting variable
Note: See TracChangeset for help on using the changeset viewer.