Changeset 970 in lmdz_wrf for trunk/tools
- Timestamp:
- Jun 29, 2016, 4:56:59 PM (8 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/tools/nc_var_tools.py
r967 r970 6844 6844 # Variables for dimensions 6845 6845 for varn in dimovars: 6846 varobj = objnc.variables[varn] 6847 newvar = objofile.createVariable(varn, varobj.dtype, varobj.dimensions) 6848 for attrn in varobj.ncattrs(): 6849 attrval = varobj.getncattr(attrn) 6850 newattr = newvar.setncattr(attrn, attrval) 6851 newvar[:] = varobj[:] 6846 if not gen.searchInlist(list(objnc.variables.keys()), varn): 6847 print warnmsg 6848 print ' ' + fname + " file does not have dimension variable '" + varn + \ 6849 "' skipping it !!" 6850 else: 6851 varobj = objnc.variables[varn] 6852 newvar = objofile.createVariable(varn, varobj.dtype, varobj.dimensions) 6853 for attrn in varobj.ncattrs(): 6854 attrval = varobj.getncattr(attrn) 6855 newattr = newvar.setncattr(attrn, attrval) 6856 newvar[:] = varobj[:] 6852 6857 6853 6858 newvar = objofile.createVariable(varname, vartype, vardims)
Note: See TracChangeset
for help on using the changeset viewer.