Changeset 874 in lmdz_wrf for trunk/tools
- Timestamp:
- Jun 18, 2016, 3:56:46 PM (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/tools/nc_var_tools.py
r872 r874 1059 1059 print errormsg 1060 1060 print ' ' + fname +': File "' + ncfile + '" does not exist !!' 1061 print errormsg1062 1061 quit(-1) 1063 1062 … … 1071 1070 print errormsg 1072 1071 print ' ' + fname +': File "' + ncfile + '" does not have variable "' + varn + '" !!!!' 1073 print errormsg1074 1072 ncf.close() 1075 1073 quit(-1) … … 1086 1084 ncf.sync() 1087 1085 ncf.close() 1086 1087 return 1088 1088 1089 1089 def grmattr(values, ncfile): … … 1095 1095 print errormsg 1096 1096 print ' grmattr: File "' + ncfile + '" does not exist !!' 1097 print errormsg1098 1097 quit(-1) 1099 1098 … … 1385 1384 quit() 1386 1385 1387 1388 1386 if not os.path.isfile(ncfile): 1389 1387 print errormsg 1390 1388 print ' varrm: File "' + ncfile + '" does not exist !!' 1391 print errormsg1392 1389 quit(-1) 1393 1390 … … 1396 1393 ncf.close() 1397 1394 1398 if not searchInlist(ncvars, var):1395 if not gen.searchInlist(ncvars, var): 1399 1396 print ' varrm: File "' + ncfile + '" does not have variable: "' + var + '"' 1400 1397 ncf.close() … … 8916 8913 dimvn = values.split(',')[3] 8917 8914 8918 dimsoperS = numVector_String(dimsoper.split(':'),', ')8915 dimsoperS = gen.numVector_String(dimsoper.split(':'),', ') 8919 8916 objnc = NetCDFFile(ncfile, 'r') 8920 8917 … … 8954 8951 allfound = True 8955 8952 for idimt in dimstouse: 8956 if not searchInlist(objvar.dimensions, idimt):8953 if not gen.searchInlist(objvar.dimensions, idimt): 8957 8954 allfound = False 8958 8955 break … … 9023 9020 9024 9021 varname = variables_values(vn)[0] 9025 if searchInlist(oldvarattr, 'standard_name'):9022 if gen.searchInlist(oldvarattr, 'standard_name'): 9026 9023 stdname = objvar.getncattr('standard_name') 9027 9024 else: 9028 9025 stdname = variables_values(vn)[1] 9029 9026 9030 if searchInlist(oldvarattr, 'long_name'):9027 if gen.searchInlist(oldvarattr, 'long_name'): 9031 9028 lname = objvar.getncattr('long_name') 9032 9029 else: 9033 9030 lname = variables_values(vn)[4].replace('|',' ') 9034 9031 9035 if searchInlist(oldvarattr, 'units'):9032 if gen.searchInlist(oldvarattr, 'units'): 9036 9033 uname = objvar.getncattr('units') 9037 9034 else:
Note: See TracChangeset
for help on using the changeset viewer.