Changeset 749 in lmdz_wrf for trunk/tools/nc_var_tools.py
- Timestamp:
- May 4, 2016, 11:33:02 AM (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/tools/nc_var_tools.py
r747 r749 7 7 8 8 main = 'nc_var_tools.py' 9 errormsg = 'ERROR -- error -- ERROR -- error' 10 warnmsg = 'WARNING -- warning -- WARNING -- warning' 9 11 10 12 def varinfile(ncf, filen, emsg, vmsg, varn): … … 12100 12102 if weightk == 'varnames': 12101 12103 arguments = '[weightk],[varname],[oper],[xdimname],[ydimname],[addvars]' 12102 check_arguments(fname, values, arguments, ',')12104 gen.check_arguments(fname, values, arguments, ',') 12103 12105 varname = values.split(',')[1] 12104 12106 oper = values.split(',')[2] … … 12110 12112 elif weightk == 'reglonlat': 12111 12113 arguments = '[weightk],[lonname],[latname],[xdimname],[ydimname],[addvars]' 12112 check_arguments(fname, values, arguments, ',')12114 gen.check_arguments(fname, values, arguments, ',') 12113 12115 lonname = values.split(',')[1] 12114 12116 latname = values.split(',')[2] … … 12127 12129 quit(-1) 12128 12130 iovar = onc.variables[varn] 12129 if not searchInlist(list(iovar.dimensions),xdimname) and not\12130 searchInlist(list(iovar.dimensions),ydimname):12131 if not gen.searchInlist(list(iovar.dimensions),xdimname) and not \ 12132 gen.searchInlist(list(iovar.dimensions),ydimname): 12131 12133 print errormsg 12132 12134 print ' ' + fname + ": variable '" + varn + "' does not have dimension '" + \ … … 12137 12139 filemiss = False 12138 12140 ivarattrs = iovar.ncattrs() 12139 if searchInlist(ivarattrs, 'missing_value'):12141 if gen.searchInlist(ivarattrs, 'missing_value'): 12140 12142 filemissv = iovar.getncattr('missing_value') 12141 12143 filemiss = True … … 12143 12145 12144 12146 filefill = False 12145 if searchInlist(ivarattrs, '_FillValue'):12147 if gen.searchInlist(ivarattrs, '_FillValue'): 12146 12148 filefillv = iovar.getncattr('_FillValue') 12147 12149 filefill = True
Note: See TracChangeset
for help on using the changeset viewer.