Changeset 2167 in lmdz_wrf for trunk/tools


Ignore:
Timestamp:
Oct 4, 2018, 11:01:59 PM (7 years ago)
Author:
lfita
Message:

Adding some more checks to `temporal_stats'

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/tools/nc_var_tools.py

    r2165 r2167  
    2547525475    vartdim = {}
    2547625476    for varn in varnames:
     25477        if not onc.variables.has_key(varn):
     25478            print errormsg
     25479            print '  ' +fname+": file '" + ncfile + "' does not have variable '" +   \
     25480              varn + "' !!"
     25481            fvarns = onc.variables.keys()
     25482            fvarns.sort()
     25483            print '    avaialble ones:', fvarns
     25484            quit(-1)
     25485
    2547725486        ovar = onc.variables[varn]
    2547825487        if not gen.searchInlist(ovar.dimensions, timedimn):
     
    2554825557                        else: newdim = onewnc.createDimension(dn,Ldim)
    2554925558
     25559                    if not dimvarns.has_key(dn):
     25560                        print errormsg
     25561                        print '  '+fname+ ": required pair [dimension],[variable]" + \
     25562                          " has not been provided for '" + dn + "' !!"
     25563                        print '    provided ones _______'
     25564                        gen.printing_dictionary(dimvarns)
     25565                        quit(-1)
     25566 
    2555025567                    dimvn = dimvarns[dn]
    2555125568                    if not onewnc.variables.has_key(dimvn):
Note: See TracChangeset for help on using the changeset viewer.