Changeset 877 in lmdz_wrf for trunk


Ignore:
Timestamp:
Jun 18, 2016, 4:38:48 PM (8 years ago)
Author:
lfita
Message:

Fixing more generalization for that variable-dimensions which are not in original file

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/tools/nc_var_tools.py

    r876 r877  
    89778977            Nvardims = len(vardims)
    89788978            for ivd in range(Nvardims):
    8979                 if not objnewnc.variables.has_key(vardims[ivd]):
    8980                     objvdim = objnc.variables[vardims[ivd]]
     8979                vdname = vardims[ivd]
     8980                if not objnewnc.variables.has_key(vdname) and                        \
     8981                  objnc.variables.has_key(vdname):
     8982                    objvdim = objnc.variables[vdname]
    89818983                    coinvardims = objvdim.dimensions
    89828984
     
    89938995# Introducing only that dimension variables with any dimension after the operation
    89948996                        if len(newdvards) > 0:
    8995                             newvar = objnewnc.createVariable(vardims[ivd],           \
    8996                               vdimtype, tuple(newdvards))
     8997                            newvar = objnewnc.createVariable(vdname, vdimtype,       \
     8998                              tuple(newdvards))
    89978999                            newvar[:] = newdvarv
    89989000                            dimvattrs = objvdim.ncattrs()
Note: See TracChangeset for help on using the changeset viewer.