Changeset 1404 in lmdz_wrf for trunk/tools


Ignore:
Timestamp:
Jan 12, 2017, 3:49:37 PM (8 years ago)
Author:
lfita
Message:

Adding `Removing the nonChecking variable-dimensions from the initial list' on 'WRFua' and 'WRFva'

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/tools/diagnostics.py

    r1389 r1404  
    11291129### ## #
    11301130print '  ' + main + ' ...'
     1131varsadd = []
    11311132
    11321133for idiag in range(Ndiags):
     
    15981599            ua[:,iz,:,:] = unstgvar0[:,iz,:,:]*var3 - unstgvar1[:,iz,:,:]*var2
    15991600
    1600 #        dnamesvar = list(ncobj.variables[depvars[0]].dimensions)
    16011601        dnamesvar = ['Time','bottom_top','south_north','west_east']
    16021602        dvnamesvar = ncvar.var_dim_dimv(dnamesvar,dnames,dvnames)
    16031603
    1604         ncvar.insert_variable(ncobj, 'ua', ua, dnames, dvnames, newnc)
     1604        # Removing the nonChecking variable-dimensions from the initial list
     1605        varsadd = []
     1606        diagoutvd = list(dvnames)
     1607        for nonvd in NONchkvardims:
     1608            if gen.searchInlist(dvnames,nonvd): diagoutvd.remove(nonvd)
     1609            varsadd.append(nonvd)
     1610
     1611        ncvar.insert_variable(ncobj, 'ua', ua, dnames, diagoutvd, newnc)
    16051612
    16061613# WRFua (U, V, SINALPHA, COSALPHA) to be rotated !!
     
    16241631        dvnamesvar = ncvar.var_dim_dimv(dnamesvar,dnames,dvnames)
    16251632
    1626         ncvar.insert_variable(ncobj, 'va', va, dnames, dvnames, newnc)
     1633        # Removing the nonChecking variable-dimensions from the initial list
     1634        varsadd = []
     1635        diagoutvd = list(dvnames)
     1636        for nonvd in NONchkvardims:
     1637            if gen.searchInlist(dvnames,nonvd): diagoutvd.remove(nonvd)
     1638            varsadd.append(nonvd)
     1639        ncvar.insert_variable(ncobj, 'va', va, dnames, diagoutvd, newnc)
    16271640
    16281641# WRFtime
Note: See TracChangeset for help on using the changeset viewer.