Changeset 929 in lmdz_wrf for trunk/tools
- Timestamp:
- Jun 23, 2016, 12:51:47 PM (8 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/tools/nc_var_tools.py
r922 r929 1608 1608 fname = 'idims' 1609 1609 1610 if ncfile == 'h': 1611 print fname + '_____________________________________________________________' 1612 print idims.__doc__ 1613 quit() 1614 1610 1615 if not os.path.isfile(ncfile): 1611 1616 print errormsg … … 1734 1739 attribute name, '|', attribute value, '|', attribute kind ('S', string '!' as spaces; 'I', integer; 'R', real; 'D', double ) 1735 1740 """ 1741 fname = 'ivattrs' 1742 1743 if varn == 'h': 1744 print fname + '_____________________________________________________________' 1745 print idims.__doc__ 1746 quit() 1736 1747 1737 1748 if not os.path.isfile(ncfile): 1738 1749 print errormsg 1739 print ' ivattrs: File "' + ncfile + '" does not exist !!' 1740 print errormsg 1750 print ' ' + fname + ": File '" + ncfile + "' does not exist !!" 1741 1751 quit(-1) 1742 1752 … … 1744 1754 ncvars = ncf.variables 1745 1755 1746 if not searchInlist(ncvars, varn): 1747 print ' ivattrs: File "' + ncfile + '" does not have variable: "' + varn + '" ' 1756 if not gen.searchInlist(ncvars, varn): 1757 print ' ' + fname + ": File '" + ncfile + "' does not have variable: '" + \ 1758 varn + "' !!" 1748 1759 ncf.close() 1749 1760 quit(-1) … … 1753 1764 allattrs='' 1754 1765 allattrsdic = {} 1766 iattr = 0 1755 1767 for attr in ncattrs: 1756 1768 attrv=varval.getncattr(attr) … … 1775 1787 else: 1776 1788 print errormsg 1777 print ' ivattrs: Reading attribute "', type(attrv), '" not ready! value:', attrv 1789 print ' ' + fname + ": Attribute type '", type(attrv), "' value:", attrv, \ 1790 "' not ready !!" 1778 1791 ncf.close() 1779 1792 quit(-1) 1780 1793 print attr, '|', attrv, '|', attrk 1781 1794 allattrsdic[attr] = [attrv, attrk] 1782 allattrs=allattrs + ':' + attr + '|' + str(attrv) + '|' + attrk 1795 if iattr == 0: 1796 allattrs = attr + '|' + str(attrv) + '|' + attrk 1797 else: 1798 allattrs = allattrs + ':' + attr + '|' + str(attrv) + '|' + attrk 1799 1800 iattr=iattr + 1 1783 1801 1784 1802 print '####### ###### ##### #### ### ## #'
Note: See TracChangeset
for help on using the changeset viewer.