1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 865 866 867 868 869 870 871 872 873 874 875 876 877 878 879 880 881 882 883 884 885 886 887 888 889 890 891 892 893 894 895 896 897 898 899 900 901 902 903 904 905 906 907 908 909 910 911 912 913 914 915 916 917 918 919 920 921 922 923 924 925 926 927 928 929 930 931 932 933 934 935 936 937 938 939 940 941 942 943 944 945 946 947 948 949 950 951 952 953 954 955 956 957 958 959 960 961 962 963 964 965 966 967 968 969 970 971 972 973 974 975 976 977 978 979 980 981 982 983 984 985 986 987 988 989 990 991 992 993 994 995 996 997 998 999 1000 1001 1002 1003 1004 1005 1006 1007 1008 1009 1010 1011 1012 1013 1014 1015 1016 1017 1018 1019 1020 1021 1022 1023 1024 1025 1026 1027 1028 1029 1030 1031 1032 1033 1034 1035 1036 1037 1038 1039 1040 1041 1042 1043 1044 1045 1046 1047 1048 1049 1050 1051 1052 1053 1054 1055 1056 1057 1058 1059 1060 1061 1062 1063 1064 1065 1066 1067 1068 1069 1070 1071 1072 1073 1074 1075 1076 1077 1078 1079 1080 1081 1082 1083 1084 1085 1086 1087 1088 1089 1090 1091 1092 1093 1094 1095 1096 1097 1098 1099 1100 1101 1102 1103 1104 1105 1106 1107 1108 1109 1110 1111 1112 1113 1114 1115 1116 1117 1118 1119 1120 1121 1122 1123 1124 1125 1126 1127 1128 1129 1130 1131 1132 1133 1134 1135 1136 1137 1138 1139 1140 1141 1142 1143 1144 1145 1146 1147 1148 1149 1150 1151 1152 1153 1154 1155 1156 1157 1158 1159 1160 1161 1162 1163 1164 1165 1166 1167 1168 1169 1170 1171 1172 1173 1174 1175 1176 1177 1178 1179 1180 1181 1182 1183 1184 1185 1186 1187 1188 1189 1190 1191 1192 1193 1194 1195 1196 1197 1198 1199 1200 1201 1202 1203 1204 1205 1206 1207 1208 1209 1210 1211 1212 1213 1214 1215 1216 1217 1218 1219 1220 1221 1222 1223 1224 1225 1226 1227 1228 1229 1230 1231 1232 1233 1234 1235 1236 1237 1238 1239 1240 1241 1242 1243 1244 1245 1246 1247 1248 1249 1250 1251 1252 1253 1254 1255 1256 1257 1258 1259 1260 1261 1262 1263 1264 1265 1266 1267 1268 1269 1270 1271 1272 1273 1274 1275 1276 1277 1278 1279 1280 1281 1282 1283 1284 1285 1286 1287 1288 1289 1290 1291 1292 1293 1294 1295 1296 1297 1298 1299 1300 1301 1302 1303 1304 1305 1306 1307 1308 1309 1310 1311 1312 1313 1314 1315 1316 1317 1318 1319 1320 1321 1322 1323 1324 1325 1326 1327 1328 1329 1330 1331 1332 1333 1334 1335 1336 1337 1338 1339 1340 1341 1342 1343 1344 1345 1346 1347 1348 1349 1350 1351 1352 1353 1354 1355 1356 1357 1358 1359 1360 1361 1362 1363 1364 1365 1366 1367 1368 1369 1370 1371 1372 1373 1374 1375 1376 1377 1378 1379 1380 1381 1382 1383 1384 1385 1386 1387 1388 1389 1390 1391 1392 1393 1394 1395 1396 1397 1398 1399 1400 1401 1402 1403 1404 1405 1406 1407 1408 1409 1410 1411 1412 1413 1414 1415 1416 1417 1418 1419 1420 1421 1422 1423 1424 1425 1426 1427 1428 1429 1430 1431 1432 1433 1434 1435 1436 1437 1438 1439 1440 1441 1442 1443 1444 1445 1446 1447 1448 1449 1450 1451 1452 1453 1454 1455 1456 1457 1458 1459 1460 1461 1462 1463 1464 1465 1466 1467 1468 1469 1470 1471 1472 1473 1474 1475 1476 1477 1478 1479 1480 1481 1482 1483 1484 1485 1486 1487 1488 1489 1490 1491 1492 1493 1494 1495 1496 1497 1498 1499 1500 1501 1502 1503 1504 1505 1506 1507 1508 1509 1510 1511 1512 1513 1514 1515 1516 1517 1518 1519 1520 1521 1522 1523 1524 1525 1526 1527 1528 1529 1530 1531 1532 1533 1534 1535 1536 1537 1538 1539 1540 1541 1542 1543 1544 1545 1546 1547 1548 1549 1550 1551 1552 1553 1554 1555 1556 1557 1558 1559 1560 1561 1562 1563 1564 1565 1566 1567 1568 1569 1570 1571 1572 1573 1574 1575 1576 1577 1578 1579 1580 1581 1582 1583 1584 1585 1586 1587 1588 1589 1590 1591 1592 1593 1594 1595 1596 1597 1598 1599 1600 1601 1602 1603 1604 1605 1606 1607 1608 1609 1610 1611 1612 1613 1614 1615 1616 1617 1618 1619 1620 1621 1622 1623 1624 1625 1626 1627 1628 1629 1630 1631 1632 1633 1634 1635 1636 1637 1638 1639 1640 1641 1642 1643 1644 1645 1646 1647 1648 1649 1650 1651 1652 1653 1654 1655 1656 1657 1658 1659 1660 1661 1662 1663 1664 1665 1666 1667 1668 1669 1670 1671 1672 1673 1674 1675 1676 1677 1678 1679 1680 1681 1682 1683 1684 1685 1686 1687 1688 1689 1690 1691 1692 1693 1694 1695 1696 1697 1698 1699 1700 1701 1702 1703 1704 1705 1706 1707 1708 1709 1710 1711 1712 1713 1714 1715 1716 1717 1718 1719 1720 1721 1722 1723 1724 1725 1726 1727 1728 1729 1730 1731 1732 1733 1734 1735 1736 1737 1738 1739 1740 1741 1742 1743 1744 1745 1746 1747 1748 1749 1750 1751 1752 1753 1754 1755 1756 1757 1758 1759 1760 1761 1762 1763 1764 1765 1766 1767 1768 1769 1770 1771 1772 1773 1774 1775 1776 1777 1778 1779 1780 1781 1782 1783 1784 1785 1786 1787 1788 1789 1790 1791 1792 1793 1794 1795 1796 1797 1798 1799 1800 1801 1802 1803 1804 1805 1806 1807 1808 1809 1810 1811 1812 1813 1814 1815 1816 1817 1818 1819 1820 1821 1822 1823 1824 1825 1826 1827 1828 1829 1830 1831 1832 1833 1834 1835 1836 1837 1838 1839 1840 1841 1842 1843 1844 1845 1846 1847 1848 1849 1850 1851 1852 1853 1854 1855 1856 1857 1858 1859 1860 1861 1862 1863 1864 1865 1866 1867 1868 1869 1870 1871 1872 1873 1874 1875 1876 1877 1878 1879 1880 1881 1882 1883 1884 1885 1886 1887 1888 1889 1890 1891 1892 1893 1894 1895 1896 1897 1898 1899 1900 1901 1902 1903 1904 1905 1906 1907 1908 1909 1910 1911 1912 1913 1914 1915 1916 1917 1918 1919 1920 1921 1922 1923 1924 1925 1926 1927 1928 1929 1930 1931 1932 1933 1934 1935 1936 1937 1938 1939 1940 1941 1942 1943 1944 1945 1946 1947 1948 1949 1950 1951 1952 1953 1954 1955 1956 1957 1958 1959 1960 1961 1962 1963 1964 1965 1966 1967 1968 1969 1970 1971 1972 1973 1974 1975 1976 1977 1978 1979 1980 1981 1982 1983 1984 1985 1986 1987 1988 1989 1990 1991 1992 1993 1994 1995 1996 1997 1998 1999 2000 2001 2002 2003 2004 2005 2006 2007 2008 2009 2010 2011 2012 2013 2014 2015 2016 2017 2018 2019 2020 2021 2022 2023 2024 2025 2026 2027 2028 2029 2030 2031 2032 2033 2034 2035 2036 2037 2038 2039 2040 2041 2042 2043 2044 2045 2046 2047 2048 2049 2050 2051 2052 2053 2054 2055 2056 2057 2058 2059 2060 2061 2062 2063 2064 2065 2066 2067 2068 2069 2070 2071 2072 2073 2074 2075 2076 2077 2078 2079 2080 2081 2082 2083 2084 2085 2086 2087 2088 2089 2090 2091 2092 2093 2094 2095 2096 2097 2098 2099 2100 2101 2102 2103 2104 2105 2106 2107 2108 2109 2110 2111 2112 2113 2114 2115 2116 2117 2118 2119 2120 2121 2122 2123 2124 2125 2126 2127 2128 2129 2130 2131 2132 2133 2134 2135 2136 2137 2138 2139 2140 2141 2142 2143 2144 2145 2146 2147 2148 2149 2150 2151 2152 2153 2154 2155 2156 2157 2158 2159 2160 2161 2162 2163 2164 2165 2166 2167 2168 2169 2170 2171 2172 2173 2174 2175 2176 2177 2178 2179 2180 2181 2182 2183 2184 2185 2186 2187 2188 2189 2190 2191 2192 2193 2194 2195 2196 2197 2198 2199 2200 2201 2202 2203 2204 2205 2206 2207 2208 2209 2210 2211 2212 2213 2214 2215 2216 2217 2218 2219 2220 2221 2222 2223 2224 2225 2226 2227 2228 2229 2230 2231 2232 2233 2234 2235 2236 2237 2238 2239 2240 2241 2242 2243 2244 2245 2246 2247 2248 2249 2250 2251 2252 2253 2254 2255 2256 2257 2258 2259 2260 2261 2262 2263 2264 2265 2266 2267 2268 2269 2270 2271 2272 2273 2274 2275 2276 2277 2278 2279 2280 2281 2282 2283 2284 2285 2286 2287 2288 2289 2290 2291 2292 2293 2294 2295 2296 2297 2298 2299 2300 2301 2302 2303 2304 2305 2306 2307 2308 2309 2310 2311 2312 2313 2314 2315 2316 2317 2318 2319 2320 2321 2322 2323 2324 2325 2326 2327 2328 2329 2330 2331 2332 2333 2334 2335 2336 2337 2338 2339 2340 2341 2342 2343 2344 2345 2346 2347 2348 2349 2350 2351 2352 2353 2354 2355 2356 2357 2358 2359 2360 2361 2362 2363 2364 2365 2366 2367 2368 2369 2370 2371 2372 2373 2374 2375 2376 2377 2378 2379 2380 2381 2382 2383 2384 2385 2386 2387 2388 2389 2390 2391 2392 2393 2394 2395 2396 2397 2398 2399 2400 2401 2402 2403 2404 2405 2406 2407 2408 2409 2410 2411 2412 2413 2414 2415 2416 2417 2418 2419 2420 2421 2422 2423 2424 2425 2426 2427 2428 2429 2430 2431 2432 2433 2434 2435 2436 2437 2438 2439 2440 2441 2442 2443 2444 2445 2446 2447 2448 2449 2450 2451 2452 2453 2454 2455 2456 2457 2458 2459 2460 2461 2462 2463 2464 2465 2466 2467 2468 2469 2470 2471 2472 2473 2474 2475 2476 2477 2478 2479 2480 2481 2482 2483 2484 2485 2486 2487 2488 2489 2490 2491 2492 2493 2494 2495 2496 2497 2498 2499 2500 2501 2502 2503 2504 2505 2506 2507 2508 2509 2510 2511 2512 2513 2514 2515 2516 2517 2518 2519 2520 2521 2522 2523 2524 2525 2526 2527 2528 2529 2530 2531 2532 2533 2534 2535 2536 2537 2538 2539 2540 2541 2542 2543 2544 2545 2546 2547 2548 2549 2550 2551 2552 2553 2554 2555 2556 2557 2558 2559 2560 2561 2562 2563 2564 2565 2566 2567 2568 2569 2570 2571 2572 2573 2574 2575 2576 2577 2578 2579 2580 2581 2582 2583 2584 2585 2586 2587 2588 2589 2590 2591 2592 2593 2594 2595 2596 2597 2598 2599 2600 2601 2602 2603 2604 2605 2606 2607 2608 2609 2610 2611 2612 2613 2614 2615 2616 2617 2618 2619 2620 2621 2622 2623 2624 2625 2626 2627 2628 2629 2630 2631 2632 2633 2634 2635 2636 2637 2638 2639 2640 2641 2642 2643 2644 2645 2646 2647 2648 2649 2650 2651 2652 2653 2654 2655 2656 2657 2658 2659 2660 2661 2662 2663 2664 2665 2666 2667 2668 2669 2670 2671 2672 2673 2674 2675 2676 2677 2678 2679 2680 2681 2682 2683 2684 2685 2686 2687 2688 2689 2690 2691 2692 2693 2694 2695 2696 2697 2698 2699 2700 2701 2702 2703 2704 2705 2706 2707 2708 2709 2710 2711 2712 2713 2714 2715 2716 2717 2718 2719 2720 2721 2722 2723 2724 2725 2726 2727 2728 2729 2730 2731 2732 2733 2734 2735 2736 2737 2738 2739 2740 2741 2742 2743 2744 2745 2746 2747 2748 2749 2750 2751 2752 2753 2754 2755 2756 2757 2758 2759 2760 2761 2762 2763 2764 2765 2766 2767 2768 2769 2770 2771 2772 2773 2774 2775 2776 2777 2778 2779 2780 2781 2782 2783 2784 2785 2786 2787 2788 2789 2790 2791 2792 2793 2794 2795 2796 2797 2798 2799 2800 2801 2802 2803 2804 2805 2806 2807 2808 2809 2810 2811 2812 2813 2814 2815 2816 2817 2818 2819 2820 2821 2822 2823 2824 2825 2826 2827 2828 2829 2830 2831 2832 2833 2834 2835 2836 2837 2838 2839 2840 2841 2842 2843 2844 2845 2846 2847 2848 2849 2850 2851 2852 2853 2854 2855 2856 2857 2858 2859 2860 2861 2862 2863 2864 2865 2866 2867 2868 2869 2870 2871 2872 2873 2874 2875 2876 2877 2878 2879 2880 2881 2882 2883 2884 2885 2886 2887 2888 2889 2890 2891 2892 2893 2894 2895 2896 2897 2898 2899 2900 2901 2902 2903 2904 2905 2906 2907 2908 2909 2910 2911 2912 2913 2914 2915 2916 2917 2918 2919 2920 2921 2922 2923 2924 2925 2926 2927 2928 2929 2930 2931 2932 2933 2934 2935 2936 2937 2938 2939 2940 2941 2942 2943 2944 2945 2946 2947 2948 2949 2950 2951 2952 2953 2954 2955 2956 2957 2958 2959 2960 2961 2962 2963 2964 2965 2966 2967 2968 2969 2970 2971 2972 2973 2974 2975 2976 2977 2978 2979 2980 2981 2982 2983 2984 2985 2986 2987 2988 2989 2990 2991 2992 2993 2994 2995 2996 2997 2998 2999 3000 3001 3002 3003 3004 3005 3006 3007 3008 3009 3010 3011 3012 3013 3014 3015 3016 3017 3018 3019 3020 3021 3022 3023 3024 3025 3026 3027 3028 3029 3030 3031 3032 3033 3034 3035 3036 3037 3038 3039 3040 3041 3042 3043 3044 3045 3046 3047 3048 3049 3050 3051 3052 3053 3054 3055 3056 3057 3058 3059 3060 3061 3062 3063 3064 3065 3066 3067 3068 3069 3070 3071 3072 3073 3074 3075 3076 3077 3078 3079 3080 3081 3082 3083 3084 3085 3086 3087 3088 3089 3090 3091 3092 3093 3094 3095 3096 3097 3098 3099 3100 3101 3102 3103 3104 3105 3106 3107 3108 3109 3110 3111 3112 3113 3114 3115 3116 3117 3118 3119 3120 3121 3122 3123 3124 3125 3126 3127 3128 3129 3130 3131 3132 3133 3134 3135 3136 3137 3138 3139 3140 3141 3142 3143 3144 3145 3146 3147 3148 3149 3150 3151 3152 3153 3154 3155 3156 3157 3158 3159 3160 3161 3162 3163 3164 3165 3166 3167 3168 3169 3170 3171 3172 3173 3174 3175 3176 3177 3178 3179 3180 3181 3182 3183 3184 3185 3186 3187 3188 3189 3190 3191 3192 3193 3194 3195 3196 3197 3198 3199 3200 3201 3202 3203 3204 3205 3206 3207 3208 3209 3210 3211 3212 3213 3214 3215 3216 3217 3218 3219 3220 3221 3222 3223 3224 3225 3226 3227 3228 3229 3230 3231 3232 3233 3234 3235 3236 3237 3238 3239 3240 3241 3242 3243 3244 3245 3246 3247 3248 3249 3250 3251 3252 3253 3254 3255 3256 3257 3258 3259 3260 3261 3262 3263 3264 3265 3266 3267 3268 3269 3270 3271 3272 3273 3274 3275 3276 3277 3278 3279 3280 3281 3282 3283 3284 3285 3286 3287 3288 3289 3290 3291 3292 3293 3294 3295 3296 3297 3298 3299 3300 3301 3302 3303 3304 3305 3306 3307 3308 3309 3310 3311 3312 3313 3314 3315 3316 3317 3318 3319 3320 3321 3322 3323 3324 3325 3326 3327 3328 3329 3330 3331 3332 3333 3334 3335 3336 3337 3338 3339 3340 3341 3342 3343 3344 3345 3346 3347 3348 3349 3350 3351 3352 3353 3354 3355 3356 3357 3358 3359 3360 3361 3362 3363 3364 3365 3366 3367 3368 3369 3370 3371 3372 3373 3374 3375 3376 3377 3378 3379 3380 3381 3382 3383 3384 3385 3386 3387 3388 3389 3390 3391 3392 3393 3394 3395 3396 3397 3398 3399 3400 3401 3402 3403 3404 3405 3406 3407 3408 3409 3410 3411 3412 3413 3414 3415 3416 3417 3418 3419 3420 3421 3422 3423 3424 3425 3426 3427 3428 3429 3430 3431 3432 3433 3434 3435 3436 3437 3438 3439 3440 3441 3442 3443 3444 3445 3446 3447 3448 3449 3450 3451 3452 3453 3454 3455 3456 3457 3458 3459 3460 3461 3462 3463 3464 3465 3466 3467 3468 3469 3470 3471 3472 3473 3474 3475 3476 3477 3478 3479 3480 3481 3482 3483 3484 3485 3486 3487 3488 3489 3490 3491 3492 3493 3494 3495 3496 3497 3498 3499 3500 3501 3502 3503 3504 3505 3506 3507 3508 3509 3510 3511 3512 3513 3514 3515 3516 3517 3518 3519 3520 3521 3522 3523 3524 3525 3526 3527 3528 3529 3530 3531 3532 3533 3534 3535 3536 3537 3538 3539 3540 3541 3542 3543 3544 3545 3546 3547 3548 3549 3550 3551 3552 3553 3554 3555 3556 3557 3558 3559 3560 3561 3562 3563 3564 3565 3566 3567 3568 3569 3570 3571 3572 3573 3574 3575 3576 3577 3578 3579 3580 3581 3582 3583 3584 3585 3586 3587 3588 3589 3590 3591 3592 3593 3594 3595 3596 3597 3598 3599 3600 3601 3602 3603 3604 3605 3606 3607 3608 3609 3610 3611 3612 3613 3614 3615 3616 3617 3618 3619 3620 3621 3622 3623 3624 3625 3626 3627 3628 3629 3630 3631 3632 3633 3634 3635 3636 3637 3638 3639 3640 3641 3642 3643 3644 3645 3646 3647 3648 3649 3650 3651 3652 3653 3654 3655 3656 3657 3658 3659 3660 3661 3662 3663 3664 3665 3666 3667 3668 3669 3670 3671 3672 3673 3674 3675 3676 3677 3678 3679 3680 3681 3682 3683 3684 3685 3686 3687 3688 3689 3690 3691 3692 3693 3694 3695 3696 3697 3698 3699 3700 3701 3702 3703 3704 3705 3706 3707 3708 3709 3710 3711 3712 3713 3714 3715 3716 3717 3718 3719 3720 3721 3722 3723 3724 3725 3726 3727 3728 3729 3730 3731 3732 3733 3734 3735 3736 3737 3738 3739 3740 3741 3742 3743 3744 3745 3746 3747 3748 3749 3750 3751 3752 3753 3754 3755 3756 3757 3758 3759 3760 3761 3762 3763 3764 3765 3766 3767 3768 3769 3770 3771 3772 3773 3774 3775 3776 3777 3778 3779 3780 3781 3782 3783 3784 3785 3786 3787 3788 3789 3790 3791 3792 3793 3794 3795 3796 3797 3798 3799 3800 3801 3802 3803 3804 3805 3806 3807 3808 3809 3810 3811 3812 3813 3814 3815 3816 3817 3818 3819 3820 3821 3822 3823 3824 3825 3826 3827 3828 3829 3830 3831 3832 3833 3834 3835 3836 3837 3838 3839 3840 3841 3842 3843 3844 3845 3846 3847 3848 3849 3850 3851 3852 3853 3854 3855 3856 3857 3858 3859 3860 3861 3862 3863 3864 3865 3866 3867 3868 3869 3870 3871 3872 3873 3874 3875 3876 3877 3878 3879 3880 3881 3882 3883 3884 3885 3886 3887 3888 3889 3890 3891 3892 3893 3894 3895 3896 3897 3898 3899 3900 3901 3902 3903 3904 3905 3906 3907 3908 3909 3910 3911 3912 3913 3914 3915 3916 3917 3918 3919 3920 3921 3922 3923 3924 3925 3926 3927 3928 3929 3930 3931 3932 3933 3934 3935 3936 3937 3938 3939 3940 3941 3942 3943 3944 3945 3946 3947 3948 3949 3950 3951 3952 3953 3954 3955 3956 3957 3958 3959 3960 3961 3962 3963 3964 3965 3966 3967 3968 3969 3970 3971 3972 3973 3974 3975 3976 3977 3978 3979 3980 3981 3982 3983 3984 3985 3986 3987 3988 3989 3990 3991 3992 3993 3994 3995 3996 3997 3998 3999 4000 4001 4002 4003 4004 4005 4006 4007 4008 4009 4010 4011 4012 4013 4014 4015 4016 4017 4018 4019 4020 4021 4022 4023 4024 4025 4026 4027 4028 4029 4030 4031 4032 4033 4034 4035 4036 4037 4038 4039 4040 4041 4042 4043 4044 4045 4046 4047 4048 4049 4050 4051 4052 4053 4054 4055 4056 4057 4058 4059 4060 4061 4062 4063 4064 4065 4066 4067 4068 4069 4070 4071 4072 4073 4074 4075 4076 4077 4078 4079 4080 4081 4082 4083 4084 4085 4086 4087 4088 4089 4090 4091 4092 4093 4094 4095 4096 4097 4098 4099 4100 4101 4102 4103 4104 4105 4106 4107 4108 4109 4110 4111 4112 4113 4114 4115 4116 4117 4118 4119 4120 4121 4122 4123 4124 4125 4126 4127 4128 4129 4130 4131 4132 4133 4134 4135 4136 4137 4138 4139 4140 4141 4142 4143 4144 4145 4146 4147 4148 4149 4150 4151 4152 4153 4154 4155 4156 4157 4158 4159 4160 4161 4162 4163 4164 4165 4166 4167 4168 4169 4170 4171 4172 4173 4174 4175 4176 4177 4178 4179 4180 4181 4182 4183 4184 4185 4186 4187 4188 4189 4190 4191 4192 4193 4194 4195 4196 4197 4198 4199 4200 4201 4202 4203 4204 4205 4206 4207 4208 4209 4210 4211 4212 4213 4214 4215 4216 4217 4218 4219 4220 4221 4222 4223 4224 4225 4226 4227 4228 4229 4230 4231 4232 4233 4234 4235 4236 4237 4238 4239 4240 4241 4242 4243 4244 4245 4246 4247 4248 4249 4250 4251 4252 4253 4254 4255 4256 4257 4258 4259 4260 4261 4262 4263 4264 4265 4266 4267 4268 4269 4270 4271 4272 4273 4274 4275 4276 4277 4278 4279 4280 4281 4282 4283 4284 4285 4286 4287 4288 4289 4290 4291 4292 4293 4294 4295 4296 4297 4298 4299 4300 4301 4302 4303 4304 4305 4306 4307 4308 4309 4310 4311 4312 4313 4314 4315 4316 4317 4318 4319 4320 4321 4322 4323 4324 4325 4326 4327 4328 4329 4330 4331 4332 4333 4334 4335 4336 4337 4338 4339 4340 4341 4342 4343 4344 4345 4346 4347 4348 4349 4350 4351 4352 4353 4354 4355 4356 4357 4358 4359 4360 4361 4362 4363 4364 4365 4366 4367 4368 4369 4370 4371 4372 4373 4374 4375 4376 4377 4378 4379 4380 4381 4382 4383 4384 4385 4386 4387 4388 4389 4390 4391 4392 4393 4394 4395 4396 4397 4398 4399 4400 4401 4402 4403 4404 4405 4406 4407 4408 4409 4410 4411 4412 4413 4414 4415 4416 4417 4418 4419 4420 4421 4422 4423 4424 4425 4426 4427 4428 4429 4430 4431 4432 4433 4434 4435 4436 4437 4438 4439 4440 4441 4442 4443 4444 4445 4446 4447 4448 4449 4450 4451 4452 4453 4454 4455 4456 4457 4458 4459 4460 4461 4462 4463 4464 4465 4466 4467 4468 4469 4470 4471 4472 4473 4474 4475 4476 4477 4478 4479 4480 4481 4482 4483 4484 4485 4486 4487 4488 4489 4490 4491 4492 4493 4494 4495 4496 4497 4498 4499 4500 4501 4502 4503 4504 4505 4506 4507 4508 4509 4510 4511 4512 4513 4514 4515 4516 4517 4518 4519 4520 4521 4522 4523 4524 4525 4526 4527 4528 4529 4530 4531 4532 4533 4534 4535 4536 4537 4538 4539 4540 4541 4542 4543 4544 4545 4546 4547 4548 4549 4550 4551 4552 4553 4554 4555 4556 4557 4558 4559 4560 4561 4562 4563 4564 4565 4566 4567 4568 4569 4570 4571 4572 4573 4574 4575 4576 4577 4578 4579 4580 4581 4582 4583 4584 4585 4586 4587 4588 4589 4590 4591 4592 4593 4594 4595 4596 4597 4598 4599 4600 4601 4602 4603 4604 4605 4606 4607 4608 4609 4610 4611 4612 4613 4614 4615 4616 4617 4618 4619 4620 4621 4622 4623 4624 4625 4626 4627 4628 4629 4630 4631 4632 4633 4634 4635 4636 4637 4638 4639 4640 4641 4642 4643 4644 4645 4646 4647 4648 4649 4650 4651 4652 4653 4654 4655 4656 4657 4658 4659 4660 4661 4662 4663 4664 4665 4666 4667 4668 4669 4670 4671 4672 4673 4674 4675 4676 4677 4678 4679 4680 4681 4682 4683 4684 4685 4686 4687 4688 4689 4690 4691 4692 4693 4694 4695 4696 4697 4698 4699 4700 4701 4702 4703 4704 4705 4706 4707 4708 4709 4710 4711 4712 4713 4714 4715 4716 4717 4718 4719 4720 4721 4722 4723 4724 4725 4726 4727 4728 4729 4730 4731 4732 4733 4734 4735 4736 4737 4738 4739 4740 4741 4742 4743 4744 4745 4746 4747 4748 4749 4750 4751 4752 4753 4754 4755 4756 4757 4758 4759 4760 4761 4762 4763 4764 4765 4766 4767 4768 4769 4770 4771 4772 4773 4774 4775 4776 4777 4778 4779 4780 4781 4782 4783 4784 4785 4786 4787 4788 4789 4790 4791 4792 4793 4794 4795 4796 4797 4798 4799 4800 4801 4802 4803 4804 4805 4806 4807 4808 4809 4810 4811 4812 4813 4814 4815 4816 4817 4818 4819 4820 4821 4822 4823 4824 4825 4826 4827 4828 4829 4830 4831 4832 4833 4834 4835 4836 4837 4838 4839 4840 4841 4842 4843 4844 4845 4846 4847 4848 4849 4850 4851 4852 4853 4854 4855 4856 4857 4858 4859 4860 4861 4862 4863 4864 4865 4866 4867 4868 4869 4870 4871 4872 4873 4874 4875 4876 4877 4878 4879 4880 4881 4882 4883 4884 4885 4886 4887 4888 4889 4890 4891 4892 4893 4894 4895 4896 4897 4898 4899 4900 4901 4902 4903 4904 4905 4906 4907 4908 4909 4910 4911 4912 4913 4914 4915 4916 4917 4918 4919 4920 4921 4922 4923 4924 4925 4926 4927 4928 4929 4930 4931 4932 4933 4934 4935 4936 4937 4938 4939 4940 4941 4942 4943 4944 4945 4946 4947 4948 4949 4950 4951 4952 4953 4954 4955 4956 4957 4958 4959 4960 4961 4962 4963 4964 4965 4966 4967 4968 4969 4970 4971 4972 4973 4974 4975 4976 4977 4978 4979 4980 4981 4982 4983 4984 4985 4986 4987 4988 4989 4990 4991 4992 4993 4994 4995 4996 4997 4998 4999 5000 5001 5002 5003 5004 5005 5006 5007 5008 5009 5010 5011 5012 5013 5014 5015 5016 5017 5018 5019 5020 5021 5022 5023 5024 5025 5026 5027 5028 5029 5030 5031 5032 5033 5034 5035 5036 5037 5038 5039 5040 5041 5042 5043 5044 5045 5046 5047 5048 5049 5050 5051 5052 5053 5054 5055 5056 5057 5058 5059 5060 5061 5062 5063 5064 5065 5066 5067 5068 5069 5070 5071 5072 5073 5074 5075 5076 5077 5078 5079 5080 5081 5082 5083 5084 5085 5086 5087 5088 5089 5090 5091 5092 5093 5094 5095 5096 5097 5098 5099 5100 5101 5102 5103 5104 5105 5106 5107 5108 5109 5110 5111 5112 5113 5114 5115 5116 5117 5118 5119 5120 5121 5122 5123 5124 5125 5126 5127 5128 5129 5130 5131 5132 5133 5134 5135 5136 5137 5138 5139 5140 5141 5142 5143 5144 5145 5146 5147 5148 5149 5150 5151 5152 5153 5154 5155 5156 5157 5158 5159 5160 5161 5162 5163 5164 5165 5166 5167 5168 5169 5170 5171 5172 5173 5174 5175 5176 5177 5178 5179 5180 5181 5182 5183 5184 5185 5186 5187 5188 5189 5190 5191 5192 5193 5194 5195 5196 5197 5198 5199 5200 5201 5202 5203 5204 5205 5206 5207 5208 5209 5210 5211 5212 5213 5214 5215 5216 5217 5218 5219 5220 5221 5222 5223 5224 5225 5226 5227 5228 5229 5230 5231 5232 5233 5234 5235 5236 5237 5238 5239 5240 5241 5242 5243 5244 5245 5246 5247 5248 5249 5250 5251 5252 5253 5254 5255 5256 5257 5258 5259 5260 5261 5262 5263 5264 5265 5266 5267 5268 5269 5270 5271 5272 5273 5274 5275 5276 5277 5278 5279 5280 5281 5282 5283 5284 5285 5286 5287 5288 5289 5290 5291 5292 5293 5294 5295 5296 5297 5298 5299 5300 5301 5302 5303 5304 5305 5306 5307 5308 5309 5310 5311 5312 5313 5314 5315 5316 5317 5318 5319 5320 5321 5322 5323 5324 5325 5326 5327 5328 5329 5330 5331 5332 5333 5334 5335 5336 5337 5338 5339 5340 5341 5342 5343 5344 5345 5346 5347 5348 5349 5350 5351 5352 5353 5354 5355 5356 5357 5358 5359 5360 5361 5362 5363 5364 5365 5366 5367 5368 5369 5370 5371 5372 5373 5374 5375 5376 5377 5378 5379 5380 5381 5382 5383 5384 5385 5386 5387 5388 5389 5390 5391 5392 5393 5394 5395 5396 5397 5398 5399 5400 5401 5402 5403 5404 5405 5406 5407 5408 5409 5410 5411 5412 5413 5414 5415 5416 5417 5418 5419 5420 5421 5422 5423 5424 5425 5426 5427 5428 5429 5430 5431 5432 5433 5434 5435 5436 5437 5438 5439 5440 5441 5442 5443 5444 5445 5446 5447 5448 5449 5450 5451 5452 5453 5454 5455 5456 5457 5458 5459 5460 5461 5462 5463 5464 5465 5466 5467 5468 5469 5470 5471 5472 5473 5474 5475 5476 5477 5478 5479 5480 5481 5482 5483 5484 5485 5486 5487 5488 5489 5490 5491 5492 5493 5494 5495 5496 5497 5498 5499 5500 5501 5502 5503 5504 5505 5506 5507 5508 5509 5510 5511 5512 5513 5514 5515 5516 5517 5518 5519 5520 5521 5522 5523 5524 5525 5526 5527 5528 5529 5530 5531 5532 5533 5534 5535 5536 5537 5538 5539 5540 5541 5542 5543 5544 5545 5546 5547 5548 5549 5550 5551 5552 5553 5554 5555 5556 5557 5558 5559 5560 5561 5562 5563 5564 5565 5566 5567 5568 5569 5570 5571 5572 5573 5574 5575 5576 5577 5578 5579 5580 5581 5582 5583 5584 5585 5586 5587 5588 5589 5590 5591 5592 5593 5594 5595 5596 5597 5598 5599 5600 5601 5602 5603 5604 5605 5606 5607 5608 5609 5610 5611 5612 5613 5614 5615 5616 5617 5618 5619 5620 5621 5622 5623 5624 5625 5626 5627 5628 5629 5630 5631 5632 5633 5634 5635 5636 5637 5638 5639 5640 5641 5642 5643 5644 5645 5646 5647 5648 5649 5650 5651 5652 5653 5654 5655 5656 5657 5658 5659 5660 5661 5662 5663 5664 5665 5666 5667 5668 5669 5670 5671 5672 5673 5674 5675 5676 5677 5678 5679 5680 5681 5682 5683 5684 5685 5686 5687 5688 5689 5690 5691 5692 5693 5694 5695 5696 5697 5698 5699 5700 5701 5702 5703 5704 5705 5706 5707 5708 5709 5710 5711 5712 5713 5714 5715 5716 5717 5718 5719 5720 5721 5722 5723 5724 5725 5726 5727 5728 5729 5730 5731 5732 5733 5734 5735 5736 5737 5738 5739 5740 5741 5742 5743 5744 5745 5746 5747 5748 5749 5750 5751 5752 5753 5754 5755 5756 5757 5758 5759 5760 5761 5762 5763 5764 5765 5766 5767 5768 5769 5770 5771 5772 5773 5774 5775 5776 5777 5778 5779 5780 5781 5782 5783 5784 5785 5786 5787 5788 5789 5790 5791 5792 5793 5794 5795 5796 5797 5798 5799 5800 5801 5802 5803 5804 5805 5806 5807 5808 5809 5810 5811 5812 5813 5814 5815 5816 5817 5818 5819 5820 5821 5822 5823 5824 5825 5826 5827 5828 5829 5830 5831 5832 5833 5834 5835 5836 5837 5838 5839 5840 5841 5842 5843 5844 5845 5846 5847 5848 5849 5850 5851 5852 5853 5854 5855 5856 5857 5858 5859 5860 5861 5862 5863 5864 5865 5866 5867 5868 5869 5870 5871 5872 5873 5874 5875 5876 5877 5878 5879 5880 5881 5882 5883 5884 5885 5886 5887 5888 5889 5890 5891 5892 5893 5894 5895 5896 5897 5898 5899 5900 5901 5902 5903 5904 5905 5906 5907 5908 5909 5910 5911 5912 5913 5914 5915 5916 5917 5918 5919 5920 5921 5922 5923 5924 5925 5926 5927 5928 5929 5930 5931 5932 5933 5934 5935 5936 5937 5938 5939 5940 5941 5942 5943 5944 5945 5946 5947 5948 5949 5950 5951 5952 5953 5954 5955 5956 5957 5958 5959 5960 5961 5962 5963 5964 5965 5966 5967 5968 5969 5970 5971 5972 5973 5974 5975 5976 5977 5978 5979 5980 5981 5982 5983 5984 5985 5986 5987 5988 5989 5990 5991 5992 5993 5994 5995 5996 5997 5998 5999 6000 6001 6002 6003 6004 6005 6006 6007 6008 6009 6010 6011 6012 6013 6014 6015 6016 6017 6018 6019 6020 6021 6022 6023 6024 6025 6026 6027 6028 6029 6030 6031 6032 6033 6034 6035 6036 6037 6038 6039 6040 6041 6042 6043 6044 6045 6046 6047 6048 6049 6050 6051 6052 6053 6054 6055 6056 6057 6058 6059 6060 6061 6062 6063 6064 6065 6066 6067 6068 6069 6070 6071 6072 6073 6074 6075 6076 6077 6078 6079 6080 6081 6082 6083 6084 6085 6086 6087 6088 6089 6090 6091 6092 6093 6094 6095 6096 6097 6098 6099 6100 6101 6102 6103 6104 6105 6106 6107 6108 6109 6110 6111 6112 6113 6114 6115 6116 6117 6118 6119 6120 6121 6122 6123 6124 6125 6126 6127 6128 6129 6130 6131 6132 6133 6134 6135 6136 6137 6138 6139 6140 6141 6142 6143 6144 6145 6146 6147 6148 6149 6150 6151 6152 6153 6154 6155 6156 6157 6158 6159 6160 6161 6162 6163 6164 6165 6166 6167 6168 6169 6170 6171 6172 6173 6174 6175 6176 6177 6178 6179 6180 6181 6182 6183 6184 6185 6186 6187 6188 6189 6190 6191 6192 6193 6194 6195 6196 6197 6198 6199 6200 6201 6202 6203 6204 6205 6206 6207 6208 6209 6210 6211 6212 6213 6214 6215 6216 6217 6218 6219 6220 6221 6222 6223 6224 6225 6226 6227 6228 6229 6230 6231 6232 6233 6234 6235 6236 6237 6238 6239 6240 6241 6242 6243 6244 6245 6246 6247 6248 6249 6250 6251 6252 6253 6254 6255 6256 6257 6258 6259 6260 6261 6262 6263 6264 6265 6266 6267 6268 6269 6270 6271 6272 6273 6274 6275 6276 6277 6278 6279 6280 6281 6282 6283 6284 6285 6286 6287 6288 6289 6290 6291 6292 6293 6294 6295 6296 6297 6298 6299 6300 6301 6302 6303 6304 6305 6306 6307 6308 6309 6310 6311 6312 6313 6314 6315 6316 6317 6318 6319 6320 6321 6322 6323 6324 6325 6326 6327 6328 6329 6330 6331 6332 6333 6334 6335 6336 6337 6338 6339 6340 6341 6342 6343 6344 6345 6346 6347 6348 6349 6350 6351 6352 6353 6354 6355 6356 6357 6358 6359 6360 6361 6362 6363 6364 6365 6366 6367 6368 6369 6370 6371 6372 6373 6374 6375 6376 6377 6378 6379 6380 6381 6382 6383 6384 6385 6386 6387 6388 6389 6390 6391 6392 6393 6394 6395 6396 6397 6398 6399 6400 6401 6402 6403 6404 6405 6406 6407 6408 6409 6410 6411 6412 6413 6414 6415 6416 6417 6418 6419 6420 6421 6422 6423 6424 6425 6426 6427 6428 6429 6430 6431 6432 6433 6434 6435 6436 6437 6438 6439 6440 6441 6442 6443 6444 6445 6446 6447 6448 6449 6450 6451 6452 6453 6454 6455 6456 6457 6458 6459 6460 6461 6462 6463 6464 6465 6466 6467 6468 6469 6470 6471 6472 6473 6474 6475 6476 6477 6478 6479 6480 6481 6482 6483 6484 6485 6486 6487 6488 6489 6490 6491 6492 6493 6494 6495 6496 6497 6498 6499 6500 6501 6502 6503 6504 6505 6506 6507 6508 6509 6510 6511 6512 6513 6514 6515 6516 6517 6518 6519 6520 6521 6522 6523 6524 6525 6526 6527 6528 6529 6530 6531 6532 6533 6534 6535 6536 6537 6538 6539 6540 6541 6542 6543 6544 6545 6546 6547 6548 6549 6550 6551 6552 6553 6554 6555 6556 6557 6558 6559 6560 6561 6562 6563 6564 6565 6566 6567 6568 6569 6570 6571 6572 6573 6574 6575 6576 6577 6578 6579 6580 6581 6582 6583 6584 6585 6586 6587 6588 6589 6590 6591 6592 6593 6594 6595 6596 6597 6598 6599 6600 6601 6602 6603 6604 6605 6606 6607 6608 6609 6610 6611 6612 6613 6614 6615 6616 6617 6618 6619 6620 6621 6622 6623 6624 6625 6626 6627 6628 6629 6630 6631 6632 6633 6634 6635 6636 6637 6638 6639 6640 6641 6642 6643 6644 6645 6646 6647 6648 6649 6650 6651 6652 6653 6654 6655 6656 6657 6658 6659 6660 6661 6662 6663 6664 6665 6666 6667 6668 6669 6670 6671 6672 6673 6674 6675 6676 6677 6678 6679 6680 6681 6682 6683 6684 6685 6686 6687 6688 6689 6690 6691 6692 6693 6694 6695 6696 6697 6698 6699 6700 6701 6702 6703 6704 6705 6706 6707 6708 6709 6710 6711 6712 6713 6714 6715 6716 6717 6718 6719 6720 6721 6722 6723 6724 6725 6726 6727 6728 6729 6730 6731 6732 6733 6734 6735 6736 6737 6738 6739 6740 6741 6742 6743 6744 6745 6746 6747 6748 6749 6750 6751 6752 6753 6754 6755 6756 6757 6758 6759 6760 6761 6762 6763 6764 6765 6766 6767 6768 6769 6770 6771 6772 6773 6774 6775 6776 6777 6778 6779 6780 6781 6782 6783 6784 6785 6786 6787 6788 6789 6790 6791 6792 6793 6794 6795 6796 6797 6798 6799 6800 6801 6802 6803 6804 6805 6806 6807 6808 6809 6810 6811 6812 6813 6814 6815 6816 6817 6818 6819 6820 6821 6822 6823 6824 6825 6826 6827 6828 6829 6830 6831 6832 6833 6834 6835 6836 6837 6838 6839 6840 6841 6842 6843 6844 6845 6846 6847 6848 6849 6850 6851 6852 6853 6854 6855 6856 6857 6858 6859 6860 6861 6862 6863 6864 6865 6866 6867 6868 6869 6870 6871 6872 6873 6874 6875 6876 6877 6878 6879 6880 6881 6882 6883 6884 6885 6886 6887 6888 6889 6890 6891 6892 6893 6894 6895 6896 6897 6898 6899 6900 6901 6902 6903 6904 6905 6906 6907 6908 6909 6910 6911 6912 6913 6914 6915 6916 6917 6918 6919 6920 6921 6922 6923 6924 6925 6926 6927 6928 6929 6930 6931 6932 6933 6934 6935 6936 6937 6938 6939 6940 6941 6942 6943 6944 6945 6946 6947 6948 6949 6950 6951 6952 6953 6954 6955 6956 6957 6958 6959 6960 6961 6962 6963 6964 6965 6966 6967 6968 6969 6970 6971 6972 6973 6974 6975 6976 6977 6978 6979 6980 6981 6982 6983 6984 6985 6986 6987 6988 6989 6990 6991 6992 6993 6994 6995 6996 6997 6998 6999 7000 7001 7002 7003 7004 7005 7006 7007 7008 7009 7010 7011 7012 7013 7014 7015 7016 7017 7018 7019 7020 7021 7022 7023 7024 7025 7026 7027 7028 7029 7030 7031 7032 7033 7034 7035 7036 7037 7038 7039 7040 7041 7042 7043 7044 7045 7046 7047 7048 7049 7050 7051 7052 7053 7054 7055 7056 7057 7058 7059 7060 7061 7062 7063 7064 7065 7066 7067 7068 7069 7070 7071 7072 7073 7074 7075 7076 7077 7078 7079 7080 7081 7082 7083 7084 7085 7086 7087 7088 7089 7090 7091 7092 7093 7094 7095 7096 7097 7098 7099 7100 7101 7102 7103 7104 7105 7106 7107 7108 7109 7110 7111 7112 7113 7114 7115 7116 7117 7118 7119 7120 7121 7122 7123 7124 7125 7126 7127 7128 7129 7130 7131 7132 7133 7134 7135 7136 7137 7138 7139 7140 7141 7142 7143 7144 7145 7146 7147 7148 7149 7150 7151 7152 7153 7154 7155 7156 7157 7158 7159 7160 7161 7162 7163 7164 7165 7166 7167 7168 7169 7170 7171 7172 7173 7174 7175 7176 7177 7178 7179 7180 7181 7182 7183 7184 7185 7186 7187 7188 7189 7190 7191 7192 7193 7194 7195 7196 7197 7198 7199 7200 7201 7202 7203 7204 7205 7206 7207 7208 7209 7210 7211 7212 7213 7214 7215 7216 7217 7218 7219 7220 7221 7222 7223 7224 7225 7226 7227 7228 7229 7230 7231 7232 7233 7234 7235 7236 7237 7238 7239 7240 7241 7242 7243 7244 7245 7246 7247 7248 7249 7250 7251 7252 7253 7254 7255 7256 7257 7258 7259 7260 7261 7262 7263 7264 7265 7266 7267 7268 7269 7270 7271 7272 7273 7274 7275 7276 7277 7278 7279 7280 7281 7282 7283 7284 7285 7286 7287 7288 7289 7290 7291 7292 7293 7294 7295 7296 7297 7298 7299 7300 7301 7302 7303 7304 7305 7306 7307 7308 7309 7310 7311 7312 7313 7314 7315 7316 7317 7318 7319 7320 7321 7322 7323 7324 7325 7326 7327 7328 7329 7330 7331 7332 7333 7334 7335 7336 7337 7338 7339 7340 7341 7342 7343 7344 7345 7346 7347 7348 7349 7350 7351 7352 7353 7354 7355 7356 7357 7358 7359 7360 7361 7362 7363 7364 7365 7366 7367 7368 7369 7370 7371 7372 7373 7374 7375 7376 7377 7378 7379 7380 7381 7382 7383 7384 7385 7386 7387 7388 7389 7390 7391 7392 7393 7394 7395 7396 7397 7398 7399 7400 7401 7402 7403 7404 7405 7406 7407 7408 7409 7410 7411 7412 7413 7414 7415 7416 7417 7418 7419 7420 7421 7422 7423 7424 7425 7426 7427 7428 7429 7430 7431 7432 7433 7434 7435 7436 7437 7438 7439 7440 7441 7442 7443 7444 7445 7446 7447 7448 7449 7450 7451 7452 7453 7454 7455 7456 7457 7458 7459 7460 7461 7462 7463 7464 7465 7466 7467 7468 7469 7470 7471 7472 7473 7474 7475 7476 7477 7478 7479 7480 7481 7482 7483 7484 7485 7486 7487 7488 7489 7490 7491 7492 7493 7494 7495 7496 7497 7498 7499 7500 7501 7502 7503 7504 7505 7506 7507 7508 7509 7510 7511 7512 7513 7514 7515 7516 7517 7518 7519 7520 7521 7522 7523 7524 7525 7526 7527 7528 7529 7530 7531 7532 7533 7534 7535 7536 7537 7538 7539 7540 7541 7542 7543 7544 7545 7546 7547 7548 7549 7550 7551 7552 7553 7554 7555 7556 7557 7558 7559 7560 7561 7562 7563 7564 7565 7566 7567 7568 7569 7570 7571 7572 7573 7574 7575 7576 7577 7578 7579 7580 7581 7582 7583 7584 7585 7586 7587 7588 7589 7590 7591 7592 7593 7594 7595 7596 7597 7598 7599 7600 7601 7602 7603 7604 7605 7606 7607 7608 7609 7610 7611 7612 7613 7614 7615 7616 7617 7618 7619 7620 7621 7622 7623 7624 7625 7626 7627 7628 7629 7630 7631 7632 7633 7634 7635 7636 7637 7638 7639 7640 7641 7642 7643 7644 7645 7646 7647 7648 7649 7650 7651 7652 7653 7654 7655 7656 7657 7658 7659 7660 7661 7662 7663 7664 7665 7666 7667 7668 7669 7670 7671 7672 7673 7674 7675 7676 7677 7678 7679 7680 7681 7682 7683 7684 7685 7686 7687 7688 7689 7690 7691 7692 7693 7694 7695 7696 7697 7698 7699 7700 7701 7702 7703 7704 7705 7706 7707 7708 7709 7710 7711 7712 7713 7714 7715 7716 7717 7718 7719 7720 7721 7722 7723 7724 7725 7726 7727 7728 7729 7730 7731 7732 7733 7734 7735 7736 7737 7738 7739 7740 7741 7742 7743 7744 7745 7746 7747 7748 7749 7750 7751 7752 7753 7754 7755 7756 7757 7758 7759 7760 7761 7762 7763 7764 7765 7766 7767 7768 7769 7770 7771 7772 7773 7774 7775 7776 7777 7778 7779 7780 7781 7782 7783 7784 7785 7786 7787 7788 7789 7790 7791 7792 7793 7794 7795 7796 7797 7798 7799 7800 7801 7802 7803 7804 7805 7806 7807 7808 7809 7810 7811 7812 7813 7814 7815 7816 7817 7818 7819 7820 7821 7822 7823 7824 7825 7826 7827 7828 7829 7830 7831 7832 7833 7834 7835 7836 7837 7838 7839 7840 7841 7842 7843 7844 7845 7846 7847 7848 7849 7850 7851 7852 7853 7854 7855 7856 7857 7858 7859 7860 7861 7862 7863 7864 7865 7866 7867 7868 7869 7870 7871 7872 7873 7874 7875 7876 7877 7878 7879 7880 7881 7882 7883 7884 7885 7886 7887 7888 7889 7890 7891 7892 7893 7894 7895 7896 7897 7898 7899 7900 7901 7902 7903 7904 7905 7906 7907 7908 7909 7910 7911 7912 7913 7914 7915 7916 7917 7918 7919 7920 7921 7922 7923 7924 7925 7926 7927 7928 7929 7930 7931 7932 7933 7934 7935 7936 7937 7938 7939 7940 7941 7942 7943 7944 7945 7946 7947 7948 7949 7950 7951 7952 7953 7954 7955 7956 7957 7958 7959 7960 7961 7962 7963 7964 7965 7966 7967 7968 7969 7970 7971 7972 7973 7974 7975 7976 7977 7978 7979 7980 7981 7982 7983 7984 7985 7986 7987 7988 7989 7990 7991 7992 7993 7994 7995 7996 7997 7998 7999 8000 8001 8002 8003 8004 8005 8006 8007 8008 8009 8010 8011 8012 8013 8014 8015 8016 8017 8018 8019 8020 8021 8022 8023 8024 8025 8026 8027 8028 8029 8030 8031 8032 8033 8034 8035 8036 8037 8038 8039 8040 8041 8042 8043 8044 8045 8046 8047 8048 8049 8050 8051 8052 8053 8054 8055 8056 8057 8058 8059 8060 8061 8062 8063 8064 8065 8066 8067 8068 8069 8070 8071 8072 8073 8074 8075 8076 8077 8078 8079 8080 8081 8082 8083 8084 8085 8086 8087 8088 8089 8090 8091 8092 8093 8094 8095 8096 8097 8098 8099 8100 8101 8102 8103 8104 8105 8106 8107 8108 8109 8110 8111 8112 8113 8114 8115 8116 8117 8118 8119 8120 8121 8122 8123 8124 8125 8126 8127 8128 8129 8130 8131 8132 8133 8134 8135 8136 8137 8138 8139 8140 8141 8142 8143 8144 8145 8146 8147 8148 8149 8150 8151 8152 8153 8154 8155 8156 8157 8158 8159 8160 8161 8162 8163 8164 8165 8166 8167 8168 8169 8170 8171 8172 8173 8174 8175 8176 8177 8178 8179 8180 8181 8182 8183 8184 8185 8186 8187 8188 8189 8190 8191 8192 8193 8194 8195 8196 8197 8198 8199 8200 8201 8202 8203 8204 8205 8206 8207 8208 8209 8210 8211 8212 8213 8214 8215 8216 8217 8218 8219 8220 8221 8222 8223 8224 8225 8226 8227 8228 8229 8230 8231 8232 8233 8234 8235 8236 8237 8238 8239 8240 8241 8242 8243 8244 8245 8246 8247 8248 8249 8250 8251 8252 8253 8254 8255 8256 8257 8258 8259 8260 8261 8262 8263 8264 8265 8266 8267 8268 8269 8270 8271 8272 8273 8274 8275 8276 8277 8278 8279 8280 8281 8282 8283 8284 8285 8286 8287 8288 8289 8290 8291 8292 8293 8294 8295 8296 8297 8298 8299 8300 8301 8302 8303 8304 8305 8306 8307 8308 8309 8310 8311 8312 8313 8314 8315 8316 8317 8318 8319 8320 8321 8322 8323 8324 8325 8326 8327 8328 8329 8330 8331 8332 8333 8334 8335 8336 8337 8338 8339 8340 8341 8342 8343 8344 8345 8346 8347 8348 8349 8350 8351 8352 8353 8354 8355 8356 8357 8358 8359 8360 8361 8362 8363 8364 8365 8366 8367 8368 8369 8370 8371 8372 8373 8374 8375 8376 8377 8378 8379 8380 8381 8382 8383 8384 8385 8386 8387 8388 8389 8390 8391 8392 8393 8394 8395 8396 8397 8398 8399 8400 8401 8402 8403 8404 8405 8406 8407 8408 8409 8410 8411 8412 8413 8414 8415 8416 8417 8418 8419 8420 8421 8422 8423 8424 8425 8426 8427 8428 8429 8430 8431 8432 8433 8434 8435 8436 8437 8438 8439 8440 8441 8442 8443 8444 8445 8446 8447 8448 8449 8450 8451 8452 8453 8454 8455 8456 8457 8458 8459 8460 8461 8462 8463 8464 8465 8466 8467 8468 8469 8470 8471 8472 8473 8474 8475 8476 8477 8478 8479 8480 8481 8482 8483 8484 8485 8486 8487 8488 8489 8490 8491 8492 8493 8494 8495 8496 8497 8498 8499 8500 8501 8502 8503 8504 8505 8506 8507 8508 8509 8510 8511 8512 8513 8514 8515 8516 8517 8518 8519 8520 8521 8522 8523 8524 8525 8526 8527 8528 8529 8530 8531 8532 8533 8534 8535 8536 8537 8538 8539 8540 8541 8542 8543 8544 8545 8546 8547 8548 8549 8550 8551 8552 8553 8554 8555 8556 8557 8558 8559 8560 8561 8562 8563 8564 8565 8566 8567 8568 8569 8570 8571 8572 8573 8574 8575 8576 8577 8578 8579 8580 8581 8582 8583 8584 8585 8586 8587 8588 8589 8590 8591 8592 8593 8594 8595 8596 8597 8598 8599 8600 8601 8602 8603 8604 8605 8606 8607 8608 8609 8610 8611 8612 8613 8614 8615 8616 8617 8618 8619 8620 8621 8622 8623 8624 8625 8626 8627 8628 8629 8630 8631 8632 8633 8634 8635 8636 8637 8638 8639 8640 8641 8642 8643 8644 8645 8646 8647 8648 8649 8650 8651 8652 8653 8654 8655 8656 8657 8658 8659 8660 8661 8662 8663 8664 8665 8666 8667 8668 8669 8670 8671 8672 8673 8674 8675 8676 8677 8678 8679 8680 8681 8682 8683 8684 8685 8686 8687 8688 8689 8690 8691 8692 8693 8694 8695 8696 8697 8698 8699 8700 8701 8702 8703 8704 8705 8706 8707 8708 8709 8710 8711 8712 8713 8714 8715 8716 8717 8718 8719 8720 8721 8722 8723 8724 8725 8726 8727 8728 8729 8730 8731 8732 8733 8734 8735 8736 8737 8738 8739 8740 8741 8742 8743 8744 8745 8746 8747 8748 8749 8750 8751 8752 8753 8754 8755 8756 8757 8758 8759 8760 8761 8762 8763 8764 8765 8766 8767 8768 8769 8770 8771 8772 8773 8774 8775 8776 8777 8778 8779 8780 8781 8782 8783 8784 8785 8786 8787 8788 8789 8790 8791 8792 8793 8794 8795 8796 8797 8798 8799 8800 8801 8802 8803 8804 8805 8806 8807 8808 8809 8810 8811 8812 8813 8814 8815 8816 8817 8818 8819 8820 8821 8822 8823 8824 8825 8826 8827 8828 8829 8830 8831 8832 8833 8834 8835 8836 8837 8838 8839 8840 8841 8842 8843 8844 8845 8846 8847 8848 8849 8850 8851 8852 8853 8854 8855 8856 8857 8858 8859 8860 8861 8862 8863 8864 8865 8866 8867 8868 8869 8870 8871 8872 8873 8874 8875 8876 8877 8878 8879 8880 8881 8882 8883 8884 8885 8886 8887 8888 8889 8890 8891 8892 8893 8894 8895 8896 8897 8898 8899 8900 8901 8902 8903 8904 8905 8906 8907 8908 8909 8910 8911 8912 8913 8914 8915 8916 8917 8918 8919 8920 8921 8922 8923 8924 8925 8926 8927 8928 8929 8930 8931 8932 8933 8934 8935 8936 8937 8938 8939 8940 8941 8942 8943 8944 8945 8946 8947 8948 8949 8950 8951 8952 8953 8954 8955 8956 8957 8958 8959 8960 8961 8962 8963 8964 8965 8966 8967 8968 8969 8970 8971 8972 8973 8974 8975 8976 8977 8978 8979 8980 8981 8982 8983 8984 8985 8986 8987 8988 8989 8990 8991 8992 8993 8994 8995 8996 8997 8998 8999 9000 9001 9002 9003 9004 9005 9006 9007 9008 9009 9010 9011 9012 9013 9014 9015 9016 9017 9018 9019 9020 9021 9022 9023 9024 9025 9026 9027 9028 9029 9030 9031 9032 9033 9034 9035 9036 9037 9038 9039 9040 9041 9042 9043 9044 9045 9046 9047 9048 9049 9050 9051 9052 9053 9054 9055 9056 9057 9058 9059 9060 9061 9062 9063 9064 9065 9066 9067 9068 9069 9070 9071 9072 9073 9074 9075 9076 9077 9078 9079 9080 9081 9082 9083 9084 9085 9086 9087 9088 9089 9090 9091 9092 9093 9094 9095 9096 9097 9098 9099 9100 9101 9102 9103 9104 9105 9106 9107 9108 9109 9110 9111 9112 9113 9114 9115 9116 9117 9118 9119 9120 9121 9122 9123 9124 9125 9126 9127 9128 9129 9130 9131 9132 9133 9134 9135 9136 9137 9138 9139 9140 9141 9142 9143 9144 9145 9146 9147 9148 9149 9150 9151 9152 9153 9154 9155 9156 9157 9158 9159 9160 9161 9162 9163 9164 9165 9166 9167 9168 9169 9170 9171 9172 9173 9174 9175 9176 9177 9178 9179 9180 9181 9182 9183 9184 9185 9186 9187 9188 9189 9190 9191 9192 9193 9194 9195 9196 9197 9198 9199 9200 9201 9202 9203 9204 9205 9206 9207 9208 9209 9210 9211 9212 9213 9214 9215 9216 9217 9218 9219 9220 9221 9222 9223 9224 9225 9226 9227 9228 9229 9230 9231 9232 9233 9234 9235 9236 9237 9238 9239 9240 9241 9242 9243 9244 9245 9246 9247 9248 9249 9250 9251 9252 9253 9254 9255 9256 9257 9258 9259 9260 9261 9262 9263 9264 9265 9266 9267 9268 9269 9270 9271 9272 9273 9274 9275 9276 9277 9278 9279 9280 9281 9282 9283 9284 9285 9286 9287 9288 9289 9290 9291 9292 9293 9294 9295 9296 9297 9298 9299 9300 9301 9302 9303 9304 9305 9306 9307 9308 9309 9310 9311 9312 9313 9314 9315 9316 9317 9318 9319 9320 9321 9322 9323 9324 9325 9326 9327 9328 9329 9330 9331 9332 9333 9334 9335 9336 9337 9338 9339 9340 9341 9342 9343 9344 9345 9346 9347 9348 9349 9350 9351 9352 9353 9354 9355 9356 9357 9358 9359 9360 9361 9362 9363 9364 9365 9366 9367 9368 9369 9370 9371 9372 9373 9374 9375 9376 9377 9378 9379 9380 9381 9382 9383 9384 9385 9386 9387 9388 9389 9390 9391 9392 9393 9394 9395 9396 9397 9398 9399 9400 9401 9402 9403 9404 9405 9406 9407 9408 9409 9410 9411 9412 9413 9414 9415 9416 9417 9418 9419 9420 9421 9422 9423 9424 9425 9426 9427 9428 9429 9430 9431 9432 9433 9434 9435 9436 9437 9438 9439 9440 9441 9442 9443 9444 9445 9446 9447 9448 9449 9450 9451 9452 9453 9454 9455 9456 9457 9458 9459 9460 9461 9462 9463 9464 9465 9466 9467 9468 9469 9470 9471 9472 9473 9474 9475 9476 9477 9478 9479 9480 9481 9482 9483 9484 9485 9486 9487 9488 9489 9490 9491 9492 9493 9494 9495 9496 9497 9498 9499 9500 9501 9502 9503 9504 9505 9506 9507 9508 9509 9510 9511 9512 9513 9514 9515 9516 9517 9518 9519 9520 9521 9522 9523 9524 9525 9526 9527 9528 9529 9530 9531 9532 9533 9534 9535 9536 9537 9538 9539 9540 9541 9542 9543 9544 9545 9546 9547 9548 9549 9550 9551 9552 9553 9554 9555 9556 9557 9558 9559 9560 9561 9562 9563 9564 9565 9566 9567 9568 9569 9570 9571 9572 9573 9574 9575 9576 9577 9578 9579 9580 9581 9582 9583 9584 9585 9586 9587 9588 9589 9590 9591 9592 9593 9594 9595 9596 9597 9598 9599 9600 9601 9602 9603 9604 9605 9606 9607 9608 9609 9610 9611 9612 9613 9614 9615 9616 9617 9618 9619 9620 9621 9622 9623 9624 9625 9626 9627 9628 9629 9630 9631 9632 9633 9634 9635 9636 9637 9638 9639 9640 9641 9642 9643 9644 9645 9646 9647 9648 9649 9650 9651 9652 9653 9654 9655 9656 9657 9658 9659 9660 9661 9662 9663 9664 9665 9666 9667 9668 9669 9670 9671 9672 9673 9674 9675 9676 9677 9678 9679 9680 9681 9682 9683 9684 9685 9686 9687 9688 9689 9690 9691 9692 9693 9694 9695 9696 9697 9698 9699 9700 9701 9702 9703 9704 9705 9706 9707 9708 9709 9710 9711 9712 9713 9714 9715 9716 9717 9718 9719 9720 9721 9722 9723 9724 9725 9726 9727 9728 9729 9730 9731 9732 9733 9734 9735 9736 9737 9738 9739 9740 9741 9742 9743 9744 9745 9746 9747 9748 9749 9750 9751 9752 9753 9754 9755 9756 9757 9758 9759 9760 9761 9762 9763 9764 9765 9766 9767 9768 9769 9770 9771 9772 9773 9774 9775 9776 9777 9778 9779 9780 9781 9782 9783 9784 9785 9786 9787 9788 9789 9790 9791 9792 9793 9794 9795 9796 9797 9798 9799 9800 9801 9802 9803 9804 9805 9806 9807 9808 9809 9810 9811 9812 9813 9814 9815 9816 9817 9818 9819 9820 9821 9822 9823 9824 9825 9826 9827 9828 9829 9830 9831 9832 9833 9834 9835 9836 9837 9838 9839 9840 9841 9842 9843 9844 9845 9846 9847 9848 9849 9850 9851 9852 9853 9854 9855 9856 9857 9858 9859 9860 9861 9862 9863 9864 9865 9866 9867 9868 9869 9870 9871 9872 9873 9874 9875 9876 9877 9878 9879 9880 9881 9882 9883 9884 9885 9886 9887 9888 9889 9890 9891 9892 9893 9894 9895 9896 9897 9898 9899 9900 9901 9902 9903 9904 9905 9906 9907 9908 9909 9910 9911 9912 9913 9914 9915 9916 9917 9918 9919 9920 9921 9922 9923 9924 9925 9926 9927 9928 9929 9930 9931 9932 9933 9934 9935 9936 9937 9938 9939 9940 9941 9942 9943 9944 9945 9946 9947 9948 9949 9950 9951 9952 9953 9954 9955 9956 9957 9958 9959 9960 9961 9962 9963 9964 9965 9966 9967 9968 9969 9970 9971 9972 9973 9974 9975 9976 9977 9978 9979 9980 9981 9982 9983 9984 9985 9986 9987 9988 9989 9990 9991 9992 9993 9994 9995 9996 9997 9998 9999 10000 10001 10002 10003 10004 10005 10006 10007 10008 10009 10010 10011 10012 10013 10014 10015 10016 10017 10018 10019 10020 10021 10022 10023 10024 10025 10026 10027 10028 10029 10030 10031 10032 10033 10034 10035 10036 10037 10038 10039 10040 10041 10042 10043 10044 10045 10046 10047 10048 10049 10050 10051 10052 10053 10054 10055 10056 10057 10058 10059 10060 10061 10062 10063 10064 10065 10066 10067 10068 10069 10070 10071 10072 10073 10074 10075 10076 10077 10078 10079 10080 10081 10082 10083 10084 10085 10086 10087 10088 10089 10090 10091 10092 10093 10094 10095 10096 10097 10098 10099 10100 10101 10102 10103 10104 10105 10106 10107 10108 10109 10110 10111 10112 10113 10114 10115 10116 10117 10118 10119 10120 10121 10122 10123 10124 10125 10126 10127 10128 10129 10130 10131 10132 10133 10134 10135 10136 10137 10138 10139 10140 10141 10142 10143 10144 10145 10146 10147 10148 10149 10150 10151 10152 10153 10154 10155 10156 10157 10158 10159 10160 10161 10162 10163 10164 10165 10166 10167 10168 10169 10170 10171 10172 10173 10174 10175 10176 10177 10178 10179 10180 10181 10182 10183 10184 10185 10186 10187 10188 10189 10190 10191 10192 10193 10194 10195 10196 10197 10198 10199 10200 10201 10202 10203 10204 10205 10206 10207 10208 10209 10210 10211 10212 10213 10214 10215 10216 10217 10218 10219 10220 10221 10222 10223 10224 10225 10226 10227 10228 10229 10230 10231 10232 10233 10234 10235 10236 10237 10238 10239 10240 10241 10242 10243 10244 10245 10246 10247 10248 10249 10250 10251 10252 10253 10254 10255 10256 10257 10258 10259 10260 10261 10262 10263 10264 10265 10266 10267 10268 10269 10270 10271 10272 10273 10274 10275 10276 10277 10278 10279 10280 10281 10282 10283 10284 10285 10286 10287 10288 10289 10290 10291 10292 10293 10294 10295 10296 10297 10298 10299 10300 10301 10302 10303 10304 10305 10306 10307 10308 10309 10310 10311 10312 10313 10314 10315 10316 10317 10318 10319 10320 10321 10322 10323 10324 10325 10326 10327 10328 10329 10330 10331 10332 10333 10334 10335 10336 10337 10338 10339 10340 10341 10342 10343 10344 10345 10346 10347 10348 10349 10350 10351 10352 10353 10354 10355 10356 10357 10358 10359 10360 10361 10362 10363 10364 10365 10366 10367 10368 10369 10370 10371 10372 10373 10374 10375 10376 10377 10378 10379 10380 10381 10382 10383 10384 10385 10386 10387 10388 10389 10390 10391 10392 10393 10394 10395 10396 10397 10398 10399 10400 10401 10402 10403 10404 10405 10406 10407 10408 10409 10410 10411 10412 10413 10414 10415 10416 10417 10418 10419 10420 10421 10422 10423 10424 10425 10426 10427 10428 10429 10430 10431 10432 10433 10434 10435 10436 10437 10438 10439 10440 10441 10442 10443 10444 10445 10446 10447 10448 10449 10450 10451 10452 10453 10454 10455 10456 10457 10458 10459 10460 10461 10462 10463 10464 10465 10466 10467 10468 10469 10470 10471 10472 10473 10474 10475 10476 10477 10478 10479 10480 10481 10482 10483 10484 10485 10486 10487 10488 10489 10490 10491 10492 10493 10494 10495 10496 10497 10498 10499 10500 10501 10502 10503 10504 10505 10506 10507 10508 10509 10510 10511 10512 10513 10514 10515 10516 10517 10518 10519 10520 10521 10522 10523 10524 10525 10526 10527 10528 10529 10530 10531 10532 10533 10534 10535 10536 10537 10538 10539 10540 10541 10542 10543 10544 10545 10546 10547 10548 10549 10550 10551 10552 10553 10554 10555 10556 10557 10558 10559 10560 10561 10562 10563 10564 10565 10566 10567 10568 10569 10570 10571 10572 10573 10574 10575 10576 10577 10578 10579 10580 10581 10582 10583 10584 10585 10586 10587 10588 10589 10590 10591 10592 10593 10594 10595 10596 10597 10598 10599 10600 10601 10602 10603 10604 10605 10606 10607 10608 10609 10610 10611 10612 10613 10614 10615 10616 10617 10618 10619 10620 10621 10622 10623 10624 10625 10626 10627 10628 10629 10630 10631 10632 10633 10634 10635 10636 10637 10638 10639 10640 10641 10642 10643 10644 10645 10646 10647 10648 10649 10650 10651 10652 10653 10654 10655 10656 10657 10658 10659 10660 10661 10662 10663 10664 10665 10666 10667 10668 10669 10670 10671 10672 10673 10674 10675 10676 10677 10678 10679 10680 10681 10682 10683 10684 10685 10686 10687 10688 10689 10690 10691 10692 10693 10694 10695 10696 10697 10698 10699 10700 10701 10702 10703 10704 10705 10706 10707 10708 10709 10710 10711 10712 10713 10714 10715 10716 10717 10718 10719 10720 10721 10722 10723 10724 10725 10726 10727 10728 10729 10730 10731 10732 10733 10734 10735 10736 10737 10738 10739 10740 10741 10742 10743 10744 10745 10746 10747 10748 10749 10750 10751 10752 10753 10754 10755 10756 10757 10758 10759 10760 10761 10762 10763 10764 10765 10766 10767 10768 10769 10770 10771 10772 10773 10774 10775 10776 10777 10778 10779 10780 10781 10782 10783 10784 10785 10786 10787 10788 10789 10790 10791 10792 10793 10794 10795 10796 10797 10798 10799 10800 10801 10802 10803 10804 10805 10806 10807 10808 10809 10810 10811 10812 10813 10814 10815 10816 10817 10818 10819 10820 10821 10822 10823 10824 10825 10826 10827 10828 10829 10830 10831 10832 10833 10834 10835 10836 10837 10838 10839 10840 10841 10842 10843 10844 10845 10846 10847 10848 10849 10850 10851 10852 10853 10854 10855 10856 10857 10858 10859 10860 10861 10862 10863 10864 10865 10866 10867 10868 10869 10870 10871 10872 10873 10874 10875 10876 10877 10878 10879 10880 10881 10882 10883 10884 10885 10886 10887 10888 10889 10890 10891 10892 10893 10894 10895 10896 10897 10898 10899 10900 10901 10902 10903 10904 10905 10906 10907 10908 10909 10910 10911 10912 10913 10914 10915 10916 10917 10918 10919 10920 10921 10922 10923 10924 10925 10926 10927 10928 10929 10930 10931 10932 10933 10934 10935 10936 10937 10938 10939 10940 10941 10942 10943 10944 10945 10946 10947 10948 10949 10950 10951 10952 10953 10954 10955 10956 10957 10958 10959 10960 10961 10962 10963 10964 10965 10966 10967 10968 10969 10970 10971 10972 10973 10974 10975 10976 10977 10978 10979 10980 10981 10982 10983 10984 10985 10986 10987 10988 10989 10990 10991 10992 10993 10994 10995 10996 10997 10998 10999 11000 11001 11002 11003 11004 11005 11006 11007 11008 11009 11010 11011 11012 11013 11014 11015 11016 11017 11018 11019 11020 11021 11022 11023 11024 11025 11026 11027 11028 11029 11030 11031 11032 11033 11034 11035 11036 11037 11038 11039 11040 11041 11042 11043 11044 11045 11046 11047 11048 11049 11050 11051 11052 11053 11054 11055 11056 11057 11058 11059 11060 11061 11062 11063 11064 11065 11066 11067 11068 11069 11070 11071 11072 11073 11074 11075 11076 11077 11078 11079 11080 11081 11082 11083 11084 11085 11086 11087 11088 11089 11090 11091 11092 11093 11094 11095 11096 11097 11098 11099 11100 11101 11102 11103 11104 11105 11106 11107 11108 11109 11110 11111 11112 11113 11114 11115 11116 11117 11118 11119 11120 11121 11122 11123 11124 11125 11126 11127 11128 11129 11130 11131 11132 11133 11134 11135 11136 11137 11138 11139 11140 11141 11142 11143 11144 11145 11146 11147 11148 11149 11150 11151 11152 11153 11154 11155 11156 11157 11158 11159 11160 11161 11162 11163 11164 11165 11166 11167 11168 11169 11170 11171 11172 11173 11174 11175 11176 11177 11178 11179 11180 11181 11182 11183 11184 11185 11186 11187 11188 11189 11190 11191 11192 11193 11194 11195 11196 11197 11198 11199 11200 11201 11202 11203 11204 11205 11206 11207 11208 11209 11210 11211 11212 11213 11214 11215 11216 11217 11218 11219 11220 11221 11222 11223 11224 11225 11226 11227 11228 11229 11230 11231 11232 11233 11234 11235 11236 11237 11238 11239 11240 11241 11242 11243 11244 11245 11246 11247 11248 11249 11250 11251 11252 11253 11254 11255 11256 11257 11258 11259 11260 11261 11262 11263 11264 11265 11266 11267 11268 11269 11270 11271 11272 11273 11274 11275 11276 11277 11278 11279 11280 11281 11282 11283 11284 11285 11286 11287 11288 11289 11290 11291 11292 11293 11294 11295 11296 11297 11298 11299 11300 11301 11302 11303 11304 11305 11306 11307 11308 11309 11310 11311 11312 11313 11314 11315 11316 11317 11318 11319 11320 11321 11322 11323 11324 11325 11326 11327 11328 11329 11330 11331 11332 11333 11334 11335 11336 11337 11338 11339 11340 11341 11342 11343 11344 11345 11346 11347 11348 11349 11350 11351 11352 11353 11354 11355 11356 11357 11358 11359 11360 11361 11362 11363 11364 11365 11366 11367 11368 11369 11370 11371 11372 11373 11374 11375 11376 11377 11378 11379 11380 11381 11382 11383 11384 11385 11386 11387 11388 11389 11390 11391 11392 11393 11394 11395 11396 11397 11398 11399 11400 11401 11402 11403 11404 11405 11406 11407 11408 11409 11410 11411 11412 11413 11414 11415 11416 11417 11418 11419 11420 11421 11422 11423 11424 11425 11426 11427 11428 11429 11430 11431 11432 11433 11434 11435 11436 11437 11438 11439 11440 11441 11442 11443 11444 11445 11446 11447 11448 11449 11450 11451 11452 11453 11454 11455 11456 11457 11458 11459 11460 11461 11462 11463 11464 11465 11466 11467 11468 11469 11470 11471 11472 11473 11474 11475 11476 11477 11478 11479 11480 11481 11482 11483 11484 11485 11486 11487 11488 11489 11490 11491 11492 11493 11494 11495 11496 11497 11498 11499 11500 11501 11502 11503 11504 11505 11506 11507 11508 11509 11510 11511 11512 11513 11514 11515 11516 11517 11518 11519 11520 11521 11522 11523 11524 11525 11526 11527 11528 11529 11530 11531 11532 11533 11534 11535 11536 11537 11538 11539 11540 11541 11542 11543 11544 11545 11546 11547 11548 11549 11550 11551 11552 11553 11554 11555 11556 11557 11558 11559 11560 11561 11562 11563 11564 11565 11566 11567 11568 11569 11570 11571 11572 11573 11574 11575 11576 11577 11578 11579 11580 11581 11582 11583 11584 11585 11586 11587 11588 11589 11590 11591 11592 11593 11594 11595 11596 11597 11598 11599 11600 11601 11602 11603 11604 11605 11606 11607 11608 11609 11610 11611 11612 11613 11614 11615 11616 11617 11618 11619 11620 11621 11622 11623 11624 11625 11626 11627 11628 11629 11630 11631 11632 11633 11634 11635 11636 11637 11638 11639 11640 11641 11642 11643 11644 11645 11646 11647 11648 11649 11650 11651 11652 11653 11654 11655 11656 11657 11658 11659 11660 11661 11662 11663 11664 11665 11666 11667 11668 11669 11670 11671 11672 11673 11674 11675 11676 11677 11678 11679 11680 11681 11682 11683 11684 11685 11686 11687 11688 11689 11690 11691 11692 11693 11694 11695 11696 11697 11698 11699 11700 11701 11702 11703 11704 11705 11706 11707 11708 11709 11710 11711 11712 11713 11714 11715 11716 11717 11718 11719 11720 11721 11722 11723 11724 11725 11726 11727 11728 11729 11730 11731 11732 11733 11734 11735 11736 11737 11738 11739 11740 11741 11742 11743 11744 11745 11746 11747 11748 11749 11750 11751 11752 11753 11754 11755 11756 11757 11758 11759 11760 11761 11762 11763 11764 11765 11766 11767 11768 11769 11770 11771 11772 11773 11774 11775 11776 11777 11778 11779 11780 11781 11782 11783 11784 11785 11786 11787 11788 11789 11790 11791 11792 11793 11794 11795 11796 11797 11798 11799 11800 11801 11802 11803 11804 11805 11806 11807 11808 11809 11810 11811 11812 11813 11814 11815 11816 11817 11818 11819 11820 11821 11822 11823 11824 11825 11826 11827 11828 11829 11830 11831 11832 11833 11834 11835 11836 11837 11838 11839 11840 11841 11842 11843 11844 11845 11846 11847 11848 11849 11850 11851 11852 11853 11854 11855 11856 11857 11858 11859 11860 11861 11862 11863 11864 11865 11866 11867 11868 11869 11870 11871 11872 11873 11874 11875 11876 11877 11878 11879 11880 11881 11882 11883 11884 11885 11886 11887 11888 11889 11890 11891 11892 11893 11894 11895 11896 11897 11898 11899 11900 11901 11902 11903 11904 11905 11906 11907 11908 11909 11910 11911 11912 11913 11914 11915 11916 11917 11918 11919 11920 11921 11922 11923 11924 11925 11926 11927 11928 11929 11930 11931 11932 11933 11934 11935 11936 11937 11938 11939 11940 11941 11942 11943 11944 11945 11946 11947 11948 11949 11950 11951 11952 11953 11954 11955 11956 11957 11958 11959 11960 11961 11962 11963 11964 11965 11966 11967 11968 11969 11970 11971 11972 11973 11974 11975 11976 11977 11978 11979 11980 11981 11982 11983 11984 11985 11986 11987 11988 11989 11990 11991 11992 11993 11994 11995 11996 11997 11998 11999 12000 12001 12002 12003 12004 12005 12006 12007 12008 12009 12010 12011 12012 12013 12014 12015 12016 12017 12018 12019 12020 12021 12022 12023 12024 12025 12026 12027 12028 12029 12030 12031 12032 12033 12034 12035 12036 12037 12038 12039 12040 12041 12042 12043 12044 12045 12046 12047 12048 12049 12050 12051 12052 12053 12054 12055 12056 12057 12058 12059 12060 12061 12062 12063 12064 12065 12066 12067 12068 12069 12070 12071 12072 12073 12074 12075 12076 12077 12078 12079 12080 12081 12082 12083 12084 12085 12086 12087 12088 12089 12090 12091 12092 12093 12094 12095 12096 12097 12098 12099 12100 12101 12102 12103 12104 12105 12106 12107 12108 12109 12110 12111 12112 12113 12114 12115 12116 12117 12118 12119 12120 12121 12122 12123 12124 12125 12126 12127 12128 12129 12130 12131 12132 12133 12134 12135 12136 12137 12138 12139 12140 12141 12142 12143 12144 12145 12146 12147 12148 12149 12150 12151 12152 12153 12154 12155 12156 12157 12158 12159 12160 12161 12162 12163 12164 12165 12166 12167 12168 12169 12170 12171 12172 12173 12174 12175 12176 12177 12178 12179 12180 12181 12182 12183 12184 12185 12186 12187 12188 12189 12190 12191 12192 12193 12194 12195 12196 12197 12198 12199 12200 12201 12202 12203 12204 12205 12206 12207 12208 12209 12210 12211 12212 12213 12214 12215 12216 12217 12218 12219 12220 12221 12222 12223 12224 12225 12226 12227 12228 12229 12230 12231 12232 12233 12234 12235 12236 12237 12238 12239 12240 12241 12242 12243 12244 12245 12246 12247 12248 12249 12250 12251 12252 12253 12254 12255 12256 12257 12258 12259 12260 12261 12262 12263 12264 12265 12266 12267 12268 12269 12270 12271 12272 12273 12274 12275 12276 12277 12278 12279 12280 12281 12282 12283 12284 12285 12286 12287 12288 12289 12290 12291 12292 12293 12294 12295 12296 12297 12298 12299 12300 12301 12302 12303 12304 12305 12306 12307 12308 12309 12310 12311 12312 12313 12314 12315 12316 12317 12318 12319 12320 12321 12322 12323 12324 12325 12326 12327 12328 12329 12330 12331 12332 12333 12334 12335 12336 12337 12338 12339 12340 12341 12342 12343 12344 12345 12346 12347 12348 12349 12350 12351 12352 12353 12354 12355 12356 12357 12358 12359 12360 12361 12362 12363 12364 12365 12366 12367 12368 12369 12370 12371 12372 12373 12374 12375 12376 12377 12378 12379 12380 12381 12382 12383 12384 12385 12386 12387 12388 12389 12390 12391 12392 12393 12394 12395 12396 12397 12398 12399 12400 12401 12402 12403 12404 12405 12406 12407 12408 12409 12410 12411 12412 12413 12414 12415 12416 12417 12418 12419 12420 12421 12422 12423 12424 12425 12426 12427 12428 12429 12430 12431 12432 12433 12434 12435 12436 12437 12438 12439 12440 12441 12442 12443 12444 12445 12446 12447 12448 12449 12450 12451 12452 12453 12454 12455 12456 12457 12458 12459 12460 12461 12462 12463 12464 12465 12466 12467 12468 12469 12470 12471 12472 12473 12474 12475 12476 12477 12478 12479 12480 12481 12482 12483 12484 12485 12486 12487 12488 12489 12490 12491 12492 12493 12494 12495 12496 12497 12498 12499 12500 12501 12502 12503 12504 12505 12506 12507 12508 12509 12510 12511 12512 12513 12514 12515 12516 12517 12518 12519 12520 12521 12522 12523 12524 12525 12526 12527 12528 12529 12530 12531 12532 12533 12534 12535 12536 12537 12538 12539 12540 12541 12542 12543 12544 12545 12546 12547 12548 12549 12550 12551 12552 12553 12554 12555 12556 12557 12558 12559 12560 12561 12562 12563 12564 12565 12566 12567 12568 12569 12570 12571 12572 12573 12574 12575 12576 12577 12578 12579 12580 12581 12582 12583 12584 12585 12586 12587 12588 12589 12590 12591 12592 12593 12594 12595 12596 12597 12598 12599 12600 12601 12602 12603 12604 12605 12606 12607 12608 12609 12610 12611 12612 12613 12614 12615 12616 12617 12618 12619 12620 12621 12622 12623 12624 12625 12626 12627 12628 12629 12630 12631 12632 12633 12634 12635 12636 12637 12638 12639 12640 12641 12642 12643 12644 12645 12646 12647 12648 12649 12650 12651 12652 12653 12654 12655 12656 12657 12658 12659 12660 12661 12662 12663 12664 12665 12666 12667 12668 12669 12670 12671 12672 12673 12674 12675 12676 12677 12678 12679 12680 12681 12682 12683 12684 12685 12686 12687 12688 12689 12690 12691 12692 12693 12694 12695 12696 12697 12698 12699 12700 12701 12702 12703 12704 12705 12706 12707 12708 12709 12710 12711 12712 12713 12714 12715 12716 12717 12718 12719 12720 12721 12722 12723 12724 12725 12726 12727 12728 12729 12730 12731 12732 12733 12734 12735 12736 12737 12738 12739 12740 12741 12742 12743 12744 12745 12746 12747 12748 12749 12750 12751 12752 12753 12754 12755 12756 12757 12758 12759 12760 12761 12762 12763 12764 12765 12766 12767 12768 12769 12770 12771 12772 12773 12774 12775 12776 12777 12778 12779 12780 12781 12782 12783 12784 12785 12786 12787 12788 12789 12790 12791 12792 12793 12794 12795 12796 12797 12798 12799 12800 12801 12802 12803 12804 12805 12806 12807 12808 12809 12810 12811 12812 12813 12814 12815 12816 12817 12818 12819 12820 12821 12822 12823 12824 12825 12826 12827 12828 12829 12830 12831 12832 12833 12834 12835 12836 12837 12838 12839 12840 12841 12842 12843 12844 12845 12846 12847 12848 12849 12850 12851 12852 12853 12854 12855 12856 12857 12858 12859 12860 12861 12862 12863 12864 12865 12866 12867 12868 12869 12870 12871 12872 12873 12874 12875 12876 12877 12878 12879 12880 12881 12882 12883 12884 12885 12886 12887 12888 12889 12890 12891 12892 12893 12894 12895 12896 12897 12898 12899 12900 12901 12902 12903 12904 12905 12906 12907 12908 12909 12910 12911 12912 12913 12914 12915 12916 12917 12918 12919 12920 12921 12922 12923 12924 12925 12926 12927 12928 12929 12930 12931 12932 12933 12934 12935 12936 12937 12938 12939 12940 12941 12942 12943 12944 12945 12946 12947 12948 12949 12950 12951 12952 12953 12954 12955 12956 12957 12958 12959 12960 12961 12962 12963 12964 12965 12966 12967 12968 12969 12970 12971 12972 12973 12974 12975 12976 12977 12978 12979 12980 12981 12982 12983 12984 12985 12986 12987 12988 12989 12990 12991 12992 12993 12994 12995 12996 12997 12998 12999 13000 13001 13002 13003 13004 13005 13006 13007 13008 13009 13010 13011 13012 13013 13014 13015 13016 13017 13018 13019 13020 13021 13022 13023 13024 13025 13026 13027 13028 13029 13030 13031 13032 13033 13034 13035 13036 13037 13038 13039 13040 13041 13042 13043 13044 13045 13046 13047 13048 13049 13050 13051 13052 13053 13054 13055 13056 13057 13058 13059 13060 13061 13062 13063 13064 13065 13066 13067 13068 13069 13070 13071 13072 13073 13074 13075 13076 13077 13078 13079 13080 13081 13082 13083 13084 13085 13086 13087 13088 13089 13090 13091 13092 13093 13094 13095 13096 13097 13098 13099 13100 13101 13102 13103 13104 13105 13106 13107 13108 13109 13110 13111 13112 13113 13114 13115 13116 13117 13118 13119 13120 13121 13122 13123 13124 13125 13126 13127 13128 13129 13130 13131 13132 13133 13134 13135 13136 13137 13138 13139 13140 13141 13142 13143 13144 13145 13146 13147 13148 13149 13150 13151 13152 13153 13154 13155 13156 13157 13158 13159 13160 13161 13162 13163 13164 13165 13166 13167 13168 13169 13170 13171 13172 13173 13174 13175 13176 13177 13178 13179 13180 13181 13182 13183 13184 13185 13186 13187 13188 13189 13190 13191 13192 13193 13194 13195 13196 13197 13198 13199 13200 13201 13202 13203 13204 13205 13206 13207 13208 13209 13210 13211 13212 13213 13214 13215 13216 13217 13218 13219 13220 13221 13222 13223 13224 13225 13226 13227 13228 13229 13230 13231 13232 13233 13234 13235 13236 13237 13238 13239 13240 13241 13242 13243 13244 13245 13246 13247 13248 13249 13250 13251 13252 13253 13254 13255 13256 13257 13258 13259 13260 13261 13262 13263 13264 13265 13266 13267 13268 13269 13270 13271 13272 13273 13274 13275 13276 13277 13278 13279 13280 13281 13282 13283 13284 13285 13286 13287 13288 13289 13290 13291 13292 13293 13294 13295 13296 13297 13298 13299 13300 13301 13302 13303 13304 13305 13306 13307 13308 13309 13310 13311 13312 13313 13314 13315 13316 13317 13318 13319 13320 13321 13322 13323 13324 13325 13326 13327 13328 13329 13330 13331 13332 13333 13334 13335 13336 13337 13338 13339 13340 13341 13342 13343 13344 13345 13346 13347 13348 13349 13350 13351 13352 13353 13354 13355 13356 13357 13358 13359 13360 13361 13362 13363 13364 13365 13366 13367 13368 13369 13370 13371 13372 13373 13374 13375 13376 13377 13378 13379 13380 13381 13382 13383 13384 13385 13386 13387 13388 13389 13390 13391 13392 13393 13394 13395 13396 13397 13398 13399 13400 13401 13402 13403 13404 13405 13406 13407 13408 13409 13410 13411 13412 13413 13414 13415 13416 13417 13418 13419 13420 13421 13422 13423 13424 13425 13426 13427 13428 13429 13430 13431 13432 13433 13434 13435 13436 13437 13438 13439 13440 13441 13442 13443 13444 13445 13446 13447 13448 13449 13450 13451 13452 13453 13454 13455 13456 13457 13458 13459 13460 13461 13462 13463 13464 13465 13466 13467 13468 13469 13470 13471 13472 13473 13474 13475 13476 13477 13478 13479 13480 13481 13482 13483 13484 13485 13486 13487 13488 13489 13490 13491 13492 13493 13494 13495 13496 13497 13498 13499 13500 13501 13502 13503 13504 13505 13506 13507 13508 13509 13510 13511 13512 13513 13514 13515 13516 13517 13518 13519 13520 13521 13522 13523 13524 13525 13526 13527 13528 13529 13530 13531 13532 13533 13534 13535 13536 13537 13538 13539 13540 13541 13542 13543 13544 13545 13546 13547 13548 13549 13550 13551 13552 13553 13554 13555 13556 13557 13558 13559 13560 13561 13562 13563 13564 13565 13566 13567 13568 13569 13570 13571 13572 13573 13574 13575 13576 13577 13578 13579 13580 13581 13582 13583 13584 13585 13586 13587 13588 13589 13590 13591 13592 13593 13594 13595 13596 13597 13598 13599 13600 13601 13602 13603 13604 13605 13606 13607 13608 13609 13610 13611 13612 13613 13614 13615 13616 13617 13618 13619 13620 13621 13622 13623 13624 13625 13626 13627 13628 13629 13630 13631 13632 13633 13634 13635 13636 13637 13638 13639 13640 13641 13642 13643 13644 13645 13646 13647 13648 13649 13650 13651 13652 13653 13654 13655 13656 13657 13658 13659 13660 13661 13662 13663 13664 13665 13666 13667 13668 13669 13670 13671 13672 13673 13674 13675 13676 13677 13678 13679 13680 13681 13682 13683 13684 13685 13686 13687 13688 13689 13690 13691 13692 13693 13694 13695 13696 13697 13698 13699 13700 13701 13702 13703 13704 13705 13706 13707 13708 13709 13710 13711 13712 13713 13714 13715 13716 13717 13718 13719 13720 13721 13722 13723 13724 13725 13726 13727 13728 13729 13730 13731 13732 13733 13734 13735 13736 13737 13738 13739 13740 13741 13742 13743 13744 13745 13746 13747 13748 13749 13750 13751 13752 13753 13754 13755 13756 13757 13758 13759 13760 13761 13762 13763 13764 13765 13766 13767 13768 13769 13770 13771 13772 13773 13774 13775 13776 13777 13778 13779 13780 13781 13782 13783 13784 13785 13786 13787 13788 13789 13790 13791 13792 13793 13794 13795 13796 13797 13798 13799 13800 13801 13802 13803 13804 13805 13806 13807 13808 13809 13810 13811 13812 13813 13814 13815 13816 13817 13818 13819 13820 13821 13822 13823 13824 13825 13826 13827 13828 13829 13830 13831 13832 13833 13834 13835 13836 13837 13838 13839 13840 13841 13842 13843 13844 13845 13846 13847 13848 13849 13850 13851 13852 13853 13854 13855 13856 13857 13858 13859 13860 13861 13862 13863 13864 13865 13866 13867 13868 13869 13870 13871 13872 13873 13874 13875 13876 13877 13878 13879 13880 13881 13882 13883 13884 13885 13886 13887 13888 13889 13890 13891 13892 13893 13894 13895 13896 13897 13898 13899 13900 13901 13902 13903 13904 13905 13906 13907 13908 13909 13910 13911 13912 13913 13914 13915 13916 13917 13918 13919 13920 13921 13922 13923 13924 13925 13926 13927 13928 13929 13930 13931 13932 13933 13934 13935 13936 13937 13938 13939 13940 13941 13942 13943 13944 13945 13946 13947 13948 13949 13950 13951 13952 13953 13954 13955 13956 13957 13958 13959 13960 13961 13962 13963 13964 13965 13966 13967 13968 13969 13970 13971 13972 13973 13974 13975 13976 13977 13978 13979 13980 13981 13982 13983 13984 13985 13986 13987 13988 13989 13990 13991 13992 13993 13994 13995 13996 13997 13998 13999 14000 14001 14002 14003 14004 14005 14006 14007 14008 14009 14010 14011 14012 14013 14014 14015 14016 14017 14018 14019 14020 14021 14022 14023 14024 14025 14026 14027 14028 14029 14030 14031 14032 14033 14034 14035 14036 14037 14038 14039 14040 14041 14042 14043 14044 14045 14046 14047 14048 14049 14050 14051 14052 14053 14054 14055 14056 14057 14058 14059 14060 14061 14062 14063 14064 14065 14066 14067 14068 14069 14070 14071 14072 14073 14074 14075 14076 14077 14078 14079 14080 14081 14082 14083 14084 14085 14086 14087 14088 14089 14090 14091 14092 14093 14094 14095 14096 14097 14098 14099 14100 14101 14102 14103 14104 14105 14106 14107 14108 14109 14110 14111 14112 14113 14114 14115 14116 14117 14118 14119 14120 14121 14122 14123 14124 14125 14126 14127 14128 14129 14130 14131 14132 14133 14134 14135 14136 14137 14138 14139 14140 14141 14142 14143 14144 14145 14146 14147 14148 14149 14150 14151 14152 14153 14154 14155 14156 14157 14158 14159 14160 14161 14162 14163 14164 14165 14166 14167 14168 14169 14170 14171 14172 14173 14174 14175 14176 14177 14178 14179 14180 14181 14182 14183 14184 14185 14186 14187 14188 14189 14190 14191 14192 14193 14194 14195 14196 14197 14198 14199 14200 14201 14202 14203 14204 14205 14206 14207 14208 14209 14210 14211 14212 14213 14214 14215 14216 14217 14218 14219 14220 14221 14222 14223 14224 14225 14226 14227 14228 14229 14230 14231 14232 14233 14234 14235 14236 14237 14238 14239 14240 14241 14242 14243 14244 14245 14246 14247 14248 14249 14250 14251 14252 14253 14254 14255 14256 14257 14258 14259 14260 14261 14262 14263 14264 14265 14266 14267 14268 14269 14270 14271 14272 14273 14274 14275 14276 14277 14278 14279 14280 14281 14282 14283 14284 14285 14286 14287 14288 14289 14290 14291 14292 14293 14294 14295 14296 14297 14298 14299 14300 14301 14302 14303 14304 14305 14306 14307 14308 14309 14310 14311 14312 14313 14314 14315 14316 14317 14318 14319 14320 14321 14322 14323 14324 14325 14326 14327 14328 14329 14330 14331 14332 14333 14334 14335 14336 14337 14338 14339 14340 14341 14342 14343 14344 14345 14346 14347 14348 14349 14350 14351 14352 14353 14354 14355 14356 14357 14358 14359 14360 14361 14362 14363 14364 14365 14366 14367 14368 14369 14370 14371 14372 14373 14374 14375 14376 14377 14378 14379 14380 14381 14382 14383 14384 14385 14386 14387 14388 14389 14390 14391 14392 14393 14394 14395 14396 14397 14398 14399 14400 14401 14402 14403 14404 14405 14406 14407 14408 14409 14410 14411 14412 14413 14414 14415 14416 14417 14418 14419 14420 14421 14422 14423 14424 14425 14426 14427 14428 14429 14430 14431 14432 14433 14434 14435 14436 14437 14438 14439 14440 14441 14442 14443 14444 14445 14446 14447 14448 14449 14450 14451 14452 14453 14454 14455 14456 14457 14458 14459 14460 14461 14462 14463 14464 14465 14466 14467 14468 14469 14470 14471 14472 14473 14474 14475 14476 14477 14478 14479 14480 14481 14482 14483 14484 14485 14486 14487 14488 14489 14490 14491 14492 14493 14494 14495 14496 14497 14498 14499 14500 14501 14502 14503 14504 14505 14506 14507 14508 14509 14510 14511 14512 14513 14514 14515 14516 14517 14518 14519 14520 14521 14522 14523 14524 14525 14526 14527 14528 14529 14530 14531 14532 14533 14534 14535 14536 14537 14538 14539 14540 14541 14542 14543 14544 14545 14546 14547 14548 14549 14550 14551 14552 14553 14554 14555 14556 14557 14558 14559 14560 14561 14562 14563 14564 14565 14566 14567 14568 14569 14570 14571 14572 14573 14574 14575 14576 14577 14578 14579 14580 14581 14582 14583 14584 14585 14586 14587 14588 14589 14590 14591 14592 14593 14594 14595 14596 14597 14598 14599 14600 14601 14602 14603 14604 14605 14606 14607 14608 14609 14610 14611 14612 14613 14614 14615 14616 14617 14618 14619 14620 14621 14622 14623 14624 14625 14626 14627 14628 14629 14630 14631 14632 14633 14634 14635 14636 14637 14638 14639 14640 14641 14642 14643 14644 14645 14646 14647 14648 14649 14650 14651 14652 14653 14654 14655 14656 14657 14658 14659 14660 14661 14662 14663 14664 14665 14666 14667 14668 14669 14670 14671 14672 14673 14674 14675 14676 14677 14678 14679 14680 14681 14682 14683 14684 14685 14686 14687 14688 14689 14690 14691 14692 14693 14694 14695 14696 14697 14698 14699 14700 14701 14702 14703 14704 14705 14706 14707 14708 14709 14710 14711 14712 14713 14714 14715 14716 14717 14718 14719 14720 14721 14722 14723 14724 14725 14726 14727 14728 14729 14730 14731 14732 14733 14734 14735 14736 14737 14738 14739 14740 14741 14742 14743 14744 14745 14746 14747 14748 14749 14750 14751 14752 14753 14754 14755 14756 14757 14758 14759 14760 14761 14762 14763 14764 14765 14766 14767 14768 14769 14770 14771 14772 14773 14774 14775 14776 14777 14778 14779 14780 14781 14782 14783 14784 14785 14786 14787 14788 14789 14790 14791 14792 14793 14794 14795 14796 14797 14798 14799 14800 14801 14802 14803 14804 14805 14806 14807 14808 14809 14810 14811 14812 14813 14814 14815 14816 14817 14818 14819 14820 14821 14822 14823 14824 14825 14826 14827 14828 14829 14830 14831 14832 14833 14834 14835 14836 14837 14838 14839 14840 14841 14842 14843 14844 14845 14846 14847 14848 14849 14850 14851 14852 14853 14854 14855 14856 14857 14858 14859 14860 14861 14862 14863 14864 14865 14866 14867 14868 14869 14870 14871 14872 14873 14874 14875 14876 14877 14878 14879 14880 14881 14882 14883 14884 14885 14886 14887 14888 14889 14890 14891 14892 14893 14894 14895 14896 14897 14898 14899 14900 14901 14902 14903 14904 14905 14906 14907 14908 14909 14910 14911 14912 14913 14914 14915 14916 14917 14918 14919 14920 14921 14922 14923 14924 14925 14926 14927 14928 14929 14930 14931 14932 14933 14934 14935 14936 14937 14938 14939 14940 14941 14942 14943 14944 14945 14946 14947 14948 14949 14950 14951 14952 14953 14954 14955 14956 14957 14958 14959 14960 14961 14962 14963 14964 14965 14966 14967 14968 14969 14970 14971 14972 14973 14974 14975 14976 14977 14978 14979 14980 14981 14982 14983 14984 14985 14986 14987 14988 14989 14990 14991 14992 14993 14994 14995 14996 14997 14998 14999 15000 15001 15002 15003 15004 15005 15006 15007 15008 15009 15010 15011 15012 15013 15014 15015 15016 15017 15018 15019 15020 15021 15022 15023 15024 15025 15026 15027 15028 15029 15030 15031 15032 15033 15034 15035 15036 15037 15038 15039 15040 15041 15042 15043 15044 15045 15046 15047 15048 15049 15050 15051 15052 15053 15054 15055 15056 15057 15058 15059 15060 15061 15062 15063 15064 15065 15066 15067 15068 15069 15070 15071 15072 15073 15074 15075 15076 15077 15078 15079 15080 15081 15082 15083 15084 15085 15086 15087 15088 15089 15090 15091 15092 15093 15094 15095 15096 15097 15098 15099 15100 15101 15102 15103 15104 15105 15106 15107 15108 15109 15110 15111 15112 15113 15114 15115 15116 15117 15118 15119 15120 15121 15122 15123 15124 15125 15126 15127 15128 15129 15130 15131 15132 15133 15134 15135 15136 15137 15138 15139 15140 15141 15142 15143 15144 15145 15146 15147 15148 15149 15150 15151 15152 15153 15154 15155 15156 15157 15158 15159 15160 15161 15162 15163 15164 15165 15166 15167 15168 15169 15170 15171 15172 15173 15174 15175 15176 15177 15178 15179 15180 15181 15182 15183 15184 15185 15186 15187 15188 15189 15190 15191 15192 15193 15194 15195 15196 15197 15198 15199 15200 15201 15202 15203 15204 15205 15206 15207 15208 15209 15210 15211 15212 15213 15214 15215 15216 15217 15218 15219 15220 15221 15222 15223 15224 15225 15226 15227 15228 15229 15230 15231 15232 15233 15234 15235 15236 15237 15238 15239 15240 15241 15242 15243 15244 15245 15246 15247 15248 15249 15250 15251 15252 15253 15254 15255 15256 15257 15258 15259 15260 15261 15262 15263 15264 15265 15266 15267 15268 15269 15270 15271 15272 15273 15274 15275 15276 15277 15278 15279 15280 15281 15282 15283 15284 15285 15286 15287 15288 15289 15290 15291 15292 15293 15294 15295 15296 15297 15298 15299 15300 15301 15302 15303 15304 15305 15306 15307 15308 15309 15310 15311 15312 15313 15314 15315 15316 15317 15318 15319 15320 15321 15322 15323 15324 15325 15326 15327 15328 15329 15330 15331 15332 15333 15334 15335 15336 15337 15338 15339 15340 15341 15342 15343 15344 15345 15346 15347 15348 15349 15350 15351 15352 15353 15354 15355 15356 15357 15358 15359 15360 15361 15362 15363 15364 15365 15366 15367 15368 15369 15370 15371 15372 15373 15374 15375 15376 15377 15378 15379 15380 15381 15382 15383 15384 15385 15386 15387 15388 15389 15390 15391 15392 15393 15394 15395 15396 15397 15398 15399 15400 15401 15402 15403 15404 15405 15406 15407 15408 15409 15410 15411 15412 15413 15414 15415 15416 15417 15418 15419 15420 15421 15422 15423 15424 15425 15426 15427 15428 15429 15430 15431 15432 15433 15434 15435 15436 15437 15438 15439 15440 15441 15442 15443 15444 15445 15446 15447 15448 15449 15450 15451 15452 15453 15454 15455 15456 15457 15458 15459 15460 15461 15462 15463 15464 15465 15466 15467 15468 15469 15470 15471 15472 15473 15474 15475 15476 15477 15478 15479 15480 15481 15482 15483 15484 15485 15486 15487 15488 15489 15490 15491 15492 15493 15494 15495 15496 15497 15498 15499 15500 15501 15502 15503 15504 15505 15506 15507 15508 15509 15510 15511 15512 15513 15514 15515 15516 15517 15518 15519 15520 15521 15522 15523 15524 15525 15526 15527 15528 15529 15530 15531 15532 15533 15534 15535 15536 15537 15538 15539 15540 15541 15542 15543 15544 15545 15546 15547 15548 15549 15550 15551 15552 15553 15554 15555 15556 15557 15558 15559 15560 15561 15562 15563 15564 15565 15566 15567 15568 15569 15570 15571 15572 15573 15574 15575 15576 15577 15578 15579 15580 15581 15582 15583 15584 15585 15586 15587 15588 15589 15590 15591 15592 15593 15594 15595 15596 15597 15598 15599 15600 15601 15602 15603 15604 15605 15606 15607 15608 15609 15610 15611 15612 15613 15614 15615 15616 15617 15618 15619 15620 15621 15622 15623 15624 15625 15626 15627 15628 15629 15630 15631 15632 15633 15634 15635 15636 15637 15638 15639 15640 15641 15642 15643 15644 15645 15646 15647 15648 15649 15650 15651 15652 15653 15654 15655 15656 15657 15658 15659 15660 15661 15662 15663 15664 15665 15666 15667 15668 15669 15670 15671 15672 15673 15674 15675 15676 15677 15678 15679 15680 15681 15682 15683 15684 15685 15686 15687 15688 15689 15690 15691 15692 15693 15694 15695 15696 15697 15698 15699 15700 15701 15702 15703 15704 15705 15706 15707 15708 15709 15710 15711 15712 15713 15714 15715 15716 15717 15718 15719 15720 15721 15722 15723 15724 15725 15726 15727 15728 15729 15730 15731 15732 15733 15734 15735 15736 15737 15738 15739 15740 15741 15742 15743 15744 15745 15746 15747 15748 15749 15750 15751 15752 15753 15754 15755 15756 15757 15758 15759 15760 15761 15762 15763 15764 15765 15766 15767 15768 15769 15770 15771 15772 15773 15774 15775 15776 15777 15778 15779 15780 15781 15782 15783 15784 15785 15786 15787 15788 15789 15790 15791 15792 15793 15794 15795 15796 15797 15798 15799 15800 15801 15802 15803 15804 15805 15806 15807 15808 15809 15810 15811 15812 15813 15814 15815 15816 15817 15818 15819 15820 15821 15822 15823 15824 15825 15826 15827 15828 15829 15830 15831 15832 15833 15834 15835 15836 15837 15838 15839 15840 15841 15842 15843 15844 15845 15846 15847 15848 15849 15850 15851 15852 15853 15854 15855 15856 15857 15858 15859 15860 15861 15862 15863 15864 15865 15866 15867 15868 15869 15870 15871 15872 15873 15874 15875 15876 15877 15878 15879 15880 15881 15882 15883 15884 15885 15886 15887 15888 15889 15890 15891 15892 15893 15894 15895 15896 15897 15898 15899 15900 15901 15902 15903 15904 15905 15906 15907 15908 15909 15910 15911 15912 15913 15914 15915 15916 15917 15918 15919 15920 15921 15922 15923 15924 15925 15926 15927 15928 15929 15930 15931 15932 15933 15934 15935 15936 15937 15938 15939 15940 15941 15942 15943 15944 15945 15946 15947 15948 15949 15950 15951 15952 15953 15954 15955 15956 15957 15958 15959 15960 15961 15962 15963 15964 15965 15966 15967 15968 15969 15970 15971 15972 15973 15974 15975 15976 15977 15978 15979 15980 15981 15982 15983 15984 15985 15986 15987 15988 15989 15990 15991 15992 15993 15994 15995 15996 15997 15998 15999 16000 16001 16002 16003 16004 16005 16006 16007 16008 16009 16010 16011 16012 16013 16014 16015 16016 16017 16018 16019 16020 16021 16022 16023 16024 16025 16026 16027 16028 16029 16030 16031 16032 16033 16034 16035 16036 16037 16038 16039 16040 16041 16042 16043 16044 16045 16046 16047 16048 16049 16050 16051 16052 16053 16054 16055 16056 16057 16058 16059 16060 16061 16062 16063 16064 16065 16066 16067 16068 16069 16070 16071 16072 16073 16074 16075 16076 16077 16078 16079 16080 16081 16082 16083 16084 16085 16086 16087 16088 16089 16090 16091 16092 16093 16094 16095 16096 16097 16098 16099 16100 16101 16102 16103 16104 16105 16106 16107 16108 16109 16110 16111 16112 16113 16114 16115 16116 16117 16118 16119 16120 16121 16122 16123 16124 16125 16126 16127 16128 16129 16130 16131 16132 16133 16134 16135 16136 16137 16138 16139 16140 16141 16142 16143 16144 16145 16146 16147 16148 16149 16150 16151 16152 16153 16154 16155 16156 16157 16158 16159 16160 16161 16162 16163 16164 16165 16166 16167 16168 16169 16170 16171 16172 16173 16174 16175 16176 16177 16178 16179 16180 16181 16182 16183 16184 16185 16186 16187 16188 16189 16190 16191 16192 16193 16194 16195 16196 16197 16198 16199 16200 16201 16202 16203 16204 16205 16206 16207 16208 16209 16210 16211 16212 16213 16214 16215 16216 16217 16218 16219 16220 16221 16222 16223 16224 16225 16226 16227 16228 16229 16230 16231 16232 16233 16234 16235 16236 16237 16238 16239 16240 16241 16242 16243 16244 16245 16246 16247 16248 16249 16250 16251 16252 16253 16254 16255 16256 16257 16258 16259 16260 16261 16262 16263 16264 16265 16266 16267 16268 16269 16270 16271 16272 16273 16274 16275 16276 16277 16278 16279 16280 16281 16282 16283 16284 16285 16286 16287 16288 16289 16290 16291 16292 16293 16294 16295 16296 16297 16298 16299 16300 16301 16302 16303 16304 16305 16306 16307 16308 16309 16310 16311 16312 16313 16314 16315 16316 16317 16318 16319 16320 16321 16322 16323 16324 16325 16326 16327 16328 16329 16330 16331 16332 16333 16334 16335 16336 16337 16338 16339 16340 16341 16342 16343 16344 16345 16346 16347 16348 16349 16350 16351 16352 16353 16354 16355 16356 16357 16358 16359 16360 16361 16362 16363 16364 16365 16366 16367 16368 16369 16370 16371 16372 16373 16374 16375 16376 16377 16378 16379 16380 16381 16382 16383 16384 16385 16386 16387 16388 16389 16390 16391 16392 16393 16394 16395 16396 16397 16398 16399 16400 16401 16402 16403 16404 16405 16406 16407 16408 16409 16410 16411 16412 16413 16414 16415 16416 16417 16418 16419 16420 16421 16422 16423 16424 16425 16426 16427 16428 16429 16430 16431 16432 16433 16434 16435 16436 16437 16438 16439 16440 16441 16442 16443 16444 16445 16446 16447 16448 16449 16450 16451 16452 16453 16454 16455 16456 16457 16458 16459 16460 16461 16462 16463 16464 16465 16466 16467 16468 16469 16470 16471 16472 16473 16474 16475 16476 16477 16478 16479 16480 16481 16482 16483 16484 16485 16486 16487 16488 16489 16490 16491 16492 16493 16494 16495 16496 16497 16498 16499 16500 16501 16502 16503 16504 16505 16506 16507 16508 16509 16510 16511 16512 16513 16514 16515 16516 16517 16518 16519 16520 16521 16522 16523 16524 16525 16526 16527 16528 16529 16530 16531 16532 16533 16534 16535 16536 16537 16538 16539 16540 16541 16542 16543 16544 16545 16546 16547 16548 16549 16550 16551 16552 16553 16554 16555 16556 16557 16558 16559 16560 16561 16562 16563 16564 16565 16566 16567 16568 16569 16570 16571 16572 16573 16574 16575 16576 16577 16578 16579 16580 16581 16582 16583 16584 16585 16586 16587 16588 16589 16590 16591 16592 16593 16594 16595 16596 16597 16598 16599 16600 16601 16602 16603 16604 16605 16606 16607 16608 16609 16610 16611 16612 16613 16614 16615 16616 16617 16618 16619 16620 16621 16622 16623 16624 16625 16626 16627 16628 16629 16630 16631 16632 16633 16634 16635 16636 16637 16638 16639 16640 16641 16642 16643 16644 16645 16646 16647 16648 16649 16650 16651 16652 16653 16654 16655 16656 16657 16658 16659 16660 16661 16662 16663 16664 16665 16666 16667 16668 16669 16670 16671 16672 16673 16674 16675 16676 16677 16678 16679 16680 16681 16682 16683 16684 16685 16686 16687 16688 16689 16690 16691 16692 16693 16694 16695 16696 16697 16698 16699 16700 16701 16702 16703 16704 16705 16706 16707 16708 16709 16710 16711 16712 16713 16714 16715 16716 16717 16718 16719 16720 16721 16722 16723 16724 16725 16726 16727 16728 16729 16730 16731 16732 16733 16734 16735 16736 16737 16738 16739 16740 16741 16742 16743 16744 16745 16746 16747 16748 16749 16750 16751 16752 16753 16754 16755 16756 16757 16758 16759 16760 16761 16762 16763 16764 16765 16766 16767 16768 16769 16770 16771 16772 16773 16774 16775 16776 16777 16778 16779 16780 16781 16782 16783 16784 16785 16786 16787 16788 16789 16790 16791 16792 16793 16794 16795 16796 16797 16798 16799 16800 16801 16802 16803 16804 16805 16806 16807 16808 16809 16810 16811 16812 16813 16814 16815 16816 16817 16818 16819 16820 16821 16822 16823 16824 16825 16826 16827 16828 16829 16830 16831 16832 16833 16834 16835 16836 16837 16838 16839 16840 16841 16842 16843 16844 16845 16846 16847 16848 16849 16850 16851 16852 16853 16854 16855 16856 16857 16858 16859 16860 16861 16862 16863 16864 16865 16866 16867 16868 16869 16870 16871 16872 16873 16874 16875 16876 16877 16878 16879 16880 16881 16882 16883 16884 16885 16886 16887 16888 16889 16890 16891 16892 16893 16894 16895 16896 16897 16898 16899 16900 16901 16902 16903 16904 16905 16906 16907 16908 16909 16910 16911 16912 16913 16914 16915 16916 16917 16918 16919 16920 16921 16922 16923 16924 16925 16926 16927 16928 16929 16930 16931 16932 16933 16934 16935 16936 16937 16938 16939 16940 16941 16942 16943 16944 16945 16946 16947 16948 16949 16950 16951 16952 16953 16954 16955 16956 16957 16958 16959 16960 16961 16962 16963 16964 16965 16966 16967 16968 16969 16970 16971 16972 16973 16974 16975 16976 16977 16978 16979 16980 16981 16982 16983 16984 16985 16986 16987 16988 16989 16990 16991 16992 16993 16994 16995 16996 16997 16998 16999 17000 17001 17002 17003 17004 17005 17006 17007 17008 17009 17010 17011 17012 17013 17014 17015 17016 17017 17018 17019 17020 17021 17022 17023 17024 17025 17026 17027 17028 17029 17030 17031 17032 17033 17034 17035 17036 17037 17038 17039 17040 17041 17042 17043 17044 17045 17046 17047 17048 17049 17050 17051 17052 17053 17054 17055 17056 17057 17058 17059 17060 17061 17062 17063 17064 17065 17066 17067 17068 17069 17070 17071 17072 17073 17074 17075 17076 17077 17078 17079 17080 17081 17082 17083 17084 17085 17086 17087 17088 17089 17090 17091 17092 17093 17094 17095 17096 17097 17098 17099 17100 17101 17102 17103 17104 17105 17106 17107 17108 17109 17110 17111 17112 17113 17114 17115 17116 17117 17118 17119 17120 17121 17122 17123 17124 17125 17126 17127 17128 17129 17130 17131 17132 17133 17134 17135 17136 17137 17138 17139 17140 17141 17142 17143 17144 17145 17146 17147 17148 17149 17150 17151 17152 17153 17154 17155 17156 17157 17158 17159 17160 17161 17162 17163 17164 17165 17166 17167 17168 17169 17170 17171 17172 17173 17174 17175 17176 17177 17178 17179 17180 17181 17182 17183 17184 17185 17186 17187 17188 17189 17190 17191 17192 17193 17194 17195 17196 17197 17198 17199 17200 17201 17202 17203 17204 17205 17206 17207 17208 17209 17210 17211 17212 17213 17214 17215 17216 17217 17218 17219 17220 17221 17222 17223 17224 17225 17226 17227 17228 17229 17230 17231 17232 17233 17234 17235 17236 17237 17238 17239 17240 17241 17242 17243 17244 17245 17246 17247 17248 17249 17250 17251 17252 17253 17254 17255 17256 17257 17258 17259 17260 17261 17262 17263 17264 17265 17266 17267 17268 17269 17270 17271 17272 17273 17274 17275 17276 17277 17278 17279 17280 17281 17282 17283 17284 17285 17286 17287 17288 17289 17290 17291 17292 17293 17294 17295 17296 17297 17298 17299 17300 17301 17302 17303 17304 17305 17306 17307 17308 17309 17310 17311 17312 17313 17314 17315 17316 17317 17318 17319 17320 17321 17322 17323 17324 17325 17326 17327 17328 17329 17330 17331 17332 17333 17334 17335 17336 17337 17338 17339 17340 17341 17342 17343 17344 17345 17346 17347 17348 17349 17350 17351 17352 17353 17354 17355 17356 17357 17358 17359 17360 17361 17362 17363 17364 17365 17366 17367 17368 17369 17370 17371 17372 17373 17374 17375 17376 17377 17378 17379 17380 17381 17382 17383 17384 17385 17386 17387 17388 17389 17390 17391 17392 17393 17394 17395 17396 17397 17398 17399 17400 17401 17402 17403 17404 17405 17406 17407 17408 17409 17410 17411 17412 17413 17414 17415 17416 17417 17418 17419 17420 17421 17422 17423 17424 17425 17426 17427 17428 17429 17430 17431 17432 17433 17434 17435 17436 17437 17438 17439 17440 17441 17442 17443 17444 17445 17446 17447 17448 17449 17450 17451 17452 17453 17454 17455 17456 17457 17458 17459 17460 17461 17462 17463 17464 17465 17466 17467 17468 17469 17470 17471 17472 17473 17474 17475 17476 17477 17478 17479 17480 17481 17482 17483 17484 17485 17486 17487 17488 17489 17490 17491 17492 17493 17494 17495 17496 17497 17498 17499 17500 17501 17502 17503 17504 17505 17506 17507 17508 17509 17510 17511 17512 17513 17514 17515 17516 17517 17518 17519 17520 17521 17522 17523 17524 17525 17526 17527 17528 17529 17530 17531 17532 17533 17534 17535 17536 17537 17538 17539 17540 17541 17542 17543 17544 17545 17546 17547 17548 17549 17550 17551 17552 17553 17554 17555 17556 17557 17558 17559 17560 17561 17562 17563 17564 17565 17566 17567 17568 17569 17570 17571 17572 17573 17574 17575 17576 17577 17578 17579 17580 17581 17582 17583 17584 17585 17586 17587 17588 17589 17590 17591 17592 17593 17594 17595 17596 17597 17598 17599 17600 17601 17602 17603 17604 17605 17606 17607 17608 17609 17610 17611 17612 17613 17614 17615 17616 17617 17618 17619 17620 17621 17622 17623 17624 17625 17626 17627 17628 17629 17630 17631 17632 17633 17634 17635 17636 17637 17638 17639 17640 17641 17642 17643 17644 17645 17646 17647 17648 17649 17650 17651 17652 17653 17654 17655 17656 17657 17658 17659 17660 17661 17662 17663 17664 17665 17666 17667 17668 17669 17670 17671 17672 17673 17674 17675 17676 17677 17678 17679 17680 17681 17682 17683 17684 17685 17686 17687 17688 17689 17690 17691 17692 17693 17694 17695 17696 17697 17698 17699 17700 17701 17702 17703 17704 17705 17706 17707 17708 17709 17710 17711 17712 17713 17714 17715 17716 17717 17718 17719 17720 17721 17722 17723 17724 17725 17726 17727 17728 17729 17730 17731 17732 17733 17734 17735 17736 17737 17738 17739 17740 17741 17742 17743 17744 17745 17746 17747 17748 17749 17750 17751 17752 17753 17754 17755 17756 17757 17758 17759 17760 17761 17762 17763 17764 17765 17766 17767 17768 17769 17770 17771 17772 17773 17774 17775 17776 17777 17778 17779 17780 17781 17782 17783 17784 17785 17786 17787 17788 17789 17790 17791 17792 17793 17794 17795 17796 17797 17798 17799 17800 17801 17802 17803 17804 17805 17806 17807 17808 17809 17810 17811 17812 17813 17814 17815 17816 17817 17818 17819 17820 17821 17822 17823 17824 17825 17826 17827 17828 17829 17830 17831 17832 17833 17834 17835 17836 17837 17838 17839 17840 17841 17842 17843 17844 17845 17846 17847 17848 17849 17850 17851 17852 17853 17854 17855 17856 17857 17858 17859 17860 17861 17862 17863 17864 17865 17866 17867 17868 17869 17870 17871 17872 17873 17874 17875 17876 17877 17878 17879 17880 17881 17882 17883 17884 17885 17886 17887 17888 17889 17890 17891 17892 17893 17894 17895 17896 17897 17898 17899 17900 17901 17902 17903 17904 17905 17906 17907 17908 17909 17910 17911 17912 17913 17914 17915 17916 17917 17918 17919 17920 17921 17922 17923 17924 17925 17926 17927 17928 17929 17930 17931 17932 17933 17934 17935 17936 17937 17938 17939 17940 17941 17942 17943 17944 17945 17946 17947 17948 17949 17950 17951 17952 17953 17954 17955 17956 17957 17958 17959 17960 17961 17962 17963 17964 17965 17966 17967 17968 17969 17970 17971 17972 17973 17974 17975 17976 17977 17978 17979 17980 17981 17982 17983 17984 17985 17986 17987 17988 17989 17990 17991 17992 17993 17994 17995 17996 17997 17998 17999 18000 18001 18002 18003 18004 18005 18006 18007 18008 18009 18010 18011 18012 18013 18014 18015 18016 18017 18018 18019 18020 18021 18022 18023 18024 18025 18026 18027 18028 18029 18030 18031 18032 18033 18034 18035 18036 18037 18038 18039 18040 18041 18042 18043 18044 18045 18046 18047 18048 18049 18050 18051 18052 18053 18054 18055 18056 18057 18058 18059 18060 18061 18062 18063 18064 18065 18066 18067 18068 18069 18070 18071 18072 18073 18074 18075 18076 18077 18078 18079 18080 18081 18082 18083 18084 18085 18086 18087 18088 18089 18090 18091 18092 18093 18094 18095 18096 18097 18098 18099 18100 18101 18102 18103 18104 18105 18106 18107 18108 18109 18110 18111 18112 18113 18114 18115 18116 18117 18118 18119 18120 18121 18122 18123 18124 18125 18126 18127 18128 18129 18130 18131 18132 18133 18134 18135 18136 18137 18138 18139 18140 18141 18142 18143 18144 18145 18146 18147 18148 18149 18150 18151 18152 18153 18154 18155 18156 18157 18158 18159 18160 18161 18162 18163 18164 18165 18166 18167 18168 18169 18170 18171 18172 18173 18174 18175 18176 18177 18178 18179 18180 18181 18182 18183 18184 18185 18186 18187 18188 18189 18190 18191 18192 18193 18194 18195 18196 18197 18198 18199 18200 18201 18202 18203 18204 18205 18206 18207 18208 18209 18210 18211 18212 18213 18214 18215 18216 18217 18218 18219 18220 18221 18222 18223 18224 18225 18226 18227 18228 18229 18230 18231 18232 18233 18234 18235 18236 18237 18238 18239 18240 18241 18242 18243 18244 18245 18246 18247 18248 18249 18250 18251 18252 18253 18254 18255 18256 18257 18258 18259 18260 18261 18262 18263 18264 18265 18266 18267 18268 18269 18270 18271 18272 18273 18274 18275 18276 18277 18278 18279 18280 18281 18282 18283 18284 18285 18286 18287 18288 18289 18290 18291 18292 18293 18294 18295 18296 18297 18298 18299 18300 18301 18302 18303 18304 18305 18306 18307 18308 18309 18310 18311 18312 18313 18314 18315 18316 18317 18318 18319 18320 18321 18322 18323 18324 18325 18326 18327 18328 18329 18330 18331 18332 18333 18334 18335 18336 18337 18338 18339 18340 18341 18342 18343 18344 18345 18346 18347 18348 18349 18350 18351 18352 18353 18354 18355 18356 18357 18358 18359 18360 18361 18362 18363 18364 18365 18366 18367 18368 18369 18370 18371 18372 18373 18374 18375 18376 18377 18378 18379 18380 18381 18382 18383 18384 18385 18386 18387 18388 18389 18390 18391 18392 18393 18394 18395 18396 18397 18398 18399 18400 18401 18402 18403 18404 18405 18406 18407 18408 18409 18410 18411 18412 18413 18414 18415 18416 18417 18418 18419 18420 18421 18422 18423 18424 18425 18426 18427 18428 18429 18430 18431 18432 18433 18434 18435 18436 18437 18438 18439 18440 18441 18442 18443 18444 18445 18446 18447 18448 18449 18450 18451 18452 18453 18454 18455 18456 18457 18458 18459 18460 18461 18462 18463 18464 18465 18466 18467 18468 18469 18470 18471 18472 18473 18474 18475 18476 18477 18478 18479 18480 18481 18482 18483 18484 18485 18486 18487 18488 18489 18490 18491 18492 18493 18494 18495 18496 18497 18498 18499 18500 18501 18502 18503 18504 18505 18506 18507 18508 18509 18510 18511 18512 18513 18514 18515 18516 18517 18518 18519 18520 18521 18522 18523 18524 18525 18526 18527 18528 18529 18530 18531 18532 18533 18534 18535 18536 18537 18538 18539 18540 18541 18542 18543 18544 18545 18546 18547 18548 18549 18550 18551 18552 18553 18554 18555 18556 18557 18558 18559 18560 18561 18562 18563 18564 18565 18566 18567 18568 18569 18570 18571 18572 18573 18574 18575 18576 18577 18578 18579 18580 18581 18582 18583 18584 18585 18586 18587 18588 18589 18590 18591 18592 18593 18594 18595 18596 18597 18598 18599 18600 18601 18602 18603 18604 18605 18606 18607 18608 18609 18610 18611 18612 18613 18614 18615 18616 18617 18618 18619 18620 18621 18622 18623 18624 18625 18626 18627 18628 18629 18630 18631 18632 18633 18634 18635 18636 18637 18638 18639 18640 18641 18642 18643 18644 18645 18646 18647 18648 18649 18650 18651 18652 18653 18654 18655 18656 18657 18658 18659 18660 18661 18662 18663 18664 18665 18666 18667 18668 18669 18670 18671 18672 18673 18674 18675 18676 18677 18678 18679 18680 18681 18682 18683 18684 18685 18686 18687 18688 18689 18690 18691 18692 18693 18694 18695 18696 18697 18698 18699 18700 18701 18702 18703 18704 18705 18706 18707 18708 18709 18710 18711 18712 18713 18714 18715 18716 18717 18718 18719 18720 18721 18722 18723 18724 18725 18726 18727 18728 18729 18730 18731 18732 18733 18734 18735 18736 18737 18738 18739 18740 18741 18742 18743 18744 18745 18746 18747 18748 18749 18750 18751 18752 18753 18754 18755 18756 18757 18758 18759 18760 18761 18762 18763 18764 18765 18766 18767 18768 18769 18770 18771 18772 18773 18774 18775 18776 18777 18778 18779 18780 18781 18782 18783 18784 18785 18786 18787 18788 18789 18790 18791 18792 18793 18794 18795 18796 18797 18798 18799 18800 18801 18802 18803 18804 18805 18806 18807 18808 18809 18810 18811 18812 18813 18814 18815 18816 18817 18818 18819 18820 18821 18822 18823 18824 18825 18826 18827 18828 18829 18830 18831 18832 18833 18834 18835 18836 18837 18838 18839 18840 18841 18842 18843 18844 18845 18846 18847 18848 18849 18850 18851 18852 18853 18854 18855 18856 18857 18858 18859 18860 18861 18862 18863 18864 18865 18866 18867 18868 18869 18870 18871 18872 18873 18874 18875 18876 18877 18878 18879 18880 18881 18882 18883 18884 18885 18886 18887 18888 18889 18890 18891 18892 18893 18894 18895 18896 18897 18898 18899 18900 18901 18902 18903 18904 18905 18906 18907 18908 18909 18910 18911 18912 18913 18914 18915 18916 18917 18918 18919 18920 18921 18922 18923 18924 18925 18926 18927 18928 18929 18930 18931 18932 18933 18934 18935 18936 18937 18938 18939 18940 18941 18942 18943 18944 18945 18946 18947 18948 18949 18950 18951 18952 18953 18954 18955 18956 18957 18958 18959 18960 18961 18962 18963 18964 18965 18966 18967 18968 18969 18970 18971 18972 18973 18974 18975 18976 18977 18978 18979 18980 18981 18982 18983 18984 18985 18986 18987 18988 18989 18990 18991 18992 18993 18994 18995 18996 18997 18998 18999 19000 19001 19002 19003 19004 19005 19006 19007 19008 19009 19010 19011 19012 19013 19014 19015 19016 19017 19018 19019 19020 19021 19022 19023 19024 19025 19026 19027 19028 19029 19030 19031 19032 19033 19034 19035 19036 19037 19038 19039 19040 19041 19042 19043 19044 19045 19046 19047 19048 19049 19050 19051 19052 19053 19054 19055 19056 19057 19058 19059 19060 19061 19062 19063 19064 19065 19066 19067 19068 19069 19070 19071 19072 19073 19074 19075 19076 19077 19078 19079 19080 19081 19082 19083 19084 19085 19086 19087 19088 19089 19090 19091 19092 19093 19094 19095 19096 19097 19098 19099 19100 19101 19102 19103 19104 19105 19106 19107 19108 19109 19110 19111 19112 19113 19114 19115 19116 19117 19118 19119 19120 19121 19122 19123 19124 19125 19126 19127 19128 19129 19130 19131 19132 19133 19134 19135 19136 19137 19138 19139 19140 19141 19142 19143 19144 19145 19146 19147 19148 19149 19150 19151 19152 19153 19154 19155 19156 19157 19158 19159 19160 19161 19162 19163 19164 19165 19166 19167 19168 19169 19170 19171 19172 19173 19174 19175 19176 19177 19178 19179 19180 19181 19182 19183 19184 19185 19186 19187 19188 19189 19190 19191 19192 19193 19194 19195 19196 19197 19198 19199 19200 19201 19202 19203 19204 19205 19206 19207 19208 19209 19210 19211 19212 19213 19214 19215 19216 19217 19218 19219 19220 19221 19222 19223 19224 19225 19226 19227 19228 19229 19230 19231 19232 19233 19234 19235 19236 19237 19238 19239 19240 19241 19242 19243 19244 19245 19246 19247 19248 19249 19250 19251 19252 19253 19254 19255 19256 19257 19258 19259 19260 19261 19262 19263 19264 19265 19266 19267 19268 19269 19270 19271 19272 19273 19274 19275 19276 19277 19278 19279 19280 19281 19282 19283 19284 19285 19286 19287 19288 19289 19290 19291 19292 19293 19294 19295 19296 19297 19298 19299 19300 19301 19302 19303 19304 19305 19306 19307 19308 19309 19310 19311 19312 19313 19314 19315 19316 19317 19318 19319 19320 19321 19322 19323 19324 19325 19326 19327 19328 19329 19330 19331 19332 19333 19334 19335 19336 19337 19338 19339 19340 19341 19342 19343 19344 19345 19346 19347 19348 19349 19350 19351 19352 19353 19354 19355 19356 19357 19358 19359 19360 19361 19362 19363 19364 19365 19366 19367 19368 19369 19370 19371 19372 19373 19374 19375 19376 19377 19378 19379 19380 19381 19382 19383 19384 19385 19386 19387 19388 19389 19390 19391 19392 19393 19394 19395 19396 19397 19398 19399 19400 19401 19402 19403 19404 19405 19406 19407 19408 19409 19410 19411 19412 19413 19414 19415 19416 19417 19418 19419 19420 19421 19422 19423 19424 19425 19426 19427 19428 19429 19430 19431 19432 19433 19434 19435 19436 19437 19438 19439 19440 19441 19442 19443 19444 19445 19446 19447 19448 19449 19450 19451 19452 19453 19454 19455 19456 19457 19458 19459 19460 19461 19462 19463 19464 19465 19466 19467 19468 19469 19470 19471 19472 19473 19474 19475 19476 19477 19478 19479 19480 19481 19482 19483 19484 19485 19486 19487 19488 19489 19490 19491 19492 19493 19494 19495 19496 19497 19498 19499 19500 19501 19502 19503 19504 19505 19506 19507 19508 19509 19510 19511 19512 19513 19514 19515 19516 19517 19518 19519 19520 19521 19522 19523 19524 19525 19526 19527 19528 19529 19530 19531 19532 19533 19534 19535 19536 19537 19538 19539 19540 19541 19542 19543 19544 19545 19546 19547 19548 19549 19550 19551 19552 19553 19554 19555 19556 19557 19558 19559 19560 19561 19562 19563 19564 19565 19566 19567 19568 19569 19570 19571 19572 19573 19574 19575 19576 19577 19578 19579 19580 19581 19582 19583 19584 19585 19586 19587 19588 19589 19590 19591 19592 19593 19594 19595 19596 19597 19598 19599 19600 19601 19602 19603 19604 19605 19606 19607 19608 19609 19610 19611 19612 19613 19614 19615 19616 19617 19618 19619 19620 19621 19622 19623 19624 19625 19626 19627 19628 19629 19630 19631 19632 19633 19634 19635 19636 19637 19638 19639 19640 19641 19642 19643 19644 19645 19646 19647 19648 19649 19650 19651 19652 19653 19654 19655 19656 19657 19658 19659 19660 19661 19662 19663 19664 19665 19666 19667 19668 19669 19670 19671 19672 19673 19674 19675 19676 19677 19678 19679 19680 19681 19682 19683 19684 19685 19686 19687 19688 19689 19690 19691 19692 19693 19694 19695 19696 19697 19698 19699 19700 19701 19702 19703 19704 19705 19706 19707 19708 19709 19710 19711 19712 19713 19714 19715 19716 19717 19718 19719 19720 19721 19722 19723 19724 19725 19726 19727 19728 19729 19730 19731 19732 19733 19734 19735 19736 19737 19738 19739 19740 19741 19742 19743 19744 19745 19746 19747 19748 19749 19750 19751 19752 19753 19754 19755 19756 19757 19758 19759 19760 19761 19762 19763 19764 19765 19766 19767 19768 19769 19770 19771 19772 19773 19774 19775 19776 19777 19778 19779 19780 19781 19782 19783 19784 19785 19786 19787 19788 19789 19790 19791 19792 19793 19794 19795 19796 19797 19798 19799 19800 19801 19802 19803 19804 19805 19806 19807 19808 19809 19810 19811 19812 19813 19814 19815 19816 19817 19818 19819 19820 19821 19822 19823 19824 19825 19826 19827 19828 19829 19830 19831 19832 19833 19834 19835 19836 19837 19838 19839 19840 19841 19842 19843 19844 19845 19846 19847 19848 19849 19850 19851 19852 19853 19854 19855 19856 19857 19858 19859 19860 19861 19862 19863 19864 19865 19866 19867 19868 19869 19870 19871 19872 19873 19874 19875 19876 19877 19878 19879 19880 19881 19882 19883 19884 19885 19886 19887 19888 19889 19890 19891 19892 19893 19894 19895 19896 19897 19898 19899 19900 19901 19902 19903 19904 19905 19906 19907 19908 19909 19910 19911 19912 19913 19914 19915 19916 19917 19918 19919 19920 19921 19922 19923 19924 19925 19926 19927 19928 19929 19930 19931 19932 19933 19934 19935 19936 19937 19938 19939 19940 19941 19942 19943 19944 19945 19946 19947 19948 19949 19950 19951 19952 19953 19954 19955 19956 19957 19958 19959 19960 19961 19962 19963 19964 19965 19966 19967 19968 19969 19970 19971 19972 19973 19974 19975 19976 19977 19978 19979 19980 19981 19982 19983 19984 19985 19986 19987 19988 19989 19990 19991 19992 19993 19994 19995 19996 19997 19998 19999 20000 20001 20002 20003 20004 20005 20006 20007 20008 20009 20010 20011 20012 20013 20014 20015 20016 20017 20018 20019 20020 20021 20022 20023 20024 20025 20026 20027 20028 20029 20030 20031 20032 20033 20034 20035 20036 20037 20038 20039 20040 20041 20042 20043 20044 20045 20046 20047 20048 20049 20050 20051 20052 20053 20054 20055 20056 20057 20058 20059 20060 20061 20062 20063 20064 20065 20066 20067 20068 20069 20070 20071 20072 20073 20074 20075 20076 20077 20078 20079 20080 20081 20082 20083 20084 20085 20086 20087
|
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<!-- Created by GNU Texinfo 5.1, http://www.gnu.org/software/texinfo/ -->
<head>
<title>NCO 4.4.2 User Guide</title>
<meta name="description" content="NCO 4.4.2 User Guide">
<meta name="keywords" content="NCO 4.4.2 User Guide">
<meta name="resource-type" content="document">
<meta name="distribution" content="global">
<meta name="Generator" content="makeinfo">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<link href="#Top" rel="start" title="Top">
<link href="#General-Index" rel="index" title="General Index">
<link href="#SEC_Contents" rel="contents" title="Table of Contents">
<link href="dir.html#Top" rel="up" title="(dir)">
<style type="text/css">
<!--
a.summary-letter {text-decoration: none}
blockquote.smallquotation {font-size: smaller}
div.display {margin-left: 3.2em}
div.example {margin-left: 3.2em}
div.indentedblock {margin-left: 3.2em}
div.lisp {margin-left: 3.2em}
div.smalldisplay {margin-left: 3.2em}
div.smallexample {margin-left: 3.2em}
div.smallindentedblock {margin-left: 3.2em; font-size: smaller}
div.smalllisp {margin-left: 3.2em}
kbd {font-style:oblique}
pre.display {font-family: inherit}
pre.format {font-family: inherit}
pre.menu-comment {font-family: serif}
pre.menu-preformatted {font-family: serif}
pre.smalldisplay {font-family: inherit; font-size: smaller}
pre.smallexample {font-size: smaller}
pre.smallformat {font-family: inherit; font-size: smaller}
pre.smalllisp {font-size: smaller}
span.nocodebreak {white-space:nowrap}
span.nolinebreak {white-space:nowrap}
span.roman {font-family:serif; font-weight:normal}
span.sansserif {font-family:sans-serif; font-weight:normal}
ul.no-bullet {list-style: none}
-->
</style>
</head>
<body lang="en" bgcolor="#FFFFFF" text="#000000" link="#0000FF" vlink="#800080" alink="#FF0000">
<h1 class="settitle" align="center"><acronym>NCO</acronym> 4.4.2 User Guide</h1>
<p>This file documents <acronym>NCO</acronym>, a collection of utilities to
manipulate and analyze netCDF files.
</p>
<p>Copyright © 1995–2014 Charlie Zender
</p>
<p>This is the first edition of the <cite>NCO User Guide</cite>,<br>
and is consistent with version 2<!-- /@w --> of <samp>texinfo.tex</samp>.
</p>
<p>Permission is granted to copy, distribute and/or modify this document
under the terms of the <acronym>GNU</acronym> Free Documentation License, Version 1.3<!-- /@w -->
or any later version published by the Free Software Foundation;
with no Invariant Sections, no Front-Cover Texts, and no Back-Cover
Texts. The license is available online at
<a href="http://www.gnu.org/copyleft/fdl.html">http://www.gnu.org/copyleft/fdl.html</a>
</p>
<p>The original author of this software, Charlie Zender, wants to improve it
with the help of your suggestions, improvements, bug-reports, and patches.<br>
Charlie Zender <surname at uci dot edu> (yes, my surname is zender)<br>
3200 Croul Hall<br>
Department of Earth System Science<br>
University of California, Irvine<br>
Irvine, CA 92697-3100<br>
</p>
<a name="SEC_Contents"></a>
<h2 class="contents-heading">Table of Contents</h2>
<div class="contents">
<ul class="no-bullet">
<li><a name="toc-Foreword-1" href="#Foreword">Foreword</a></li>
<li><a name="toc-Summary-1" href="#Summary">Summary</a></li>
<li><a name="toc-Introduction-1" href="#Introduction">1 Introduction</a>
<ul class="no-bullet">
<li><a name="toc-Availability-1" href="#Availability">1.1 Availability</a></li>
<li><a name="toc-How-to-Use-This-Guide" href="#How-to-Use-This-guide">1.2 How to Use This Guide</a></li>
<li><a name="toc-Operating-systems-compatible-with-NCO" href="#Compatability">1.3 Operating systems compatible with <acronym>NCO</acronym></a>
<ul class="no-bullet">
<li><a name="toc-Compiling-NCO-for-Microsoft-Windows-OS" href="#Windows-Operating-System">1.3.1 Compiling <acronym>NCO</acronym> for Microsoft Windows <acronym>OS</acronym></a></li>
</ul></li>
<li><a name="toc-Symbolic-Links-1" href="#Symbolic-Links">1.4 Symbolic Links</a></li>
<li><a name="toc-Libraries-1" href="#Libraries">1.5 Libraries</a></li>
<li><a name="toc-netCDF2_002f3_002f4-and-HDF4_002f5-Support-1" href="#netCDF2_002f3_002f4-and-HDF4_002f5-Support">1.6 netCDF2/3/4 and HDF4/5 Support</a></li>
<li><a name="toc-Help-Requests-and-Bug-Reports-1" href="#Help-Requests-and-Bug-Reports">1.7 Help Requests and Bug Reports</a></li>
</ul></li>
<li><a name="toc-Operator-Strategies" href="#Strategies">2 Operator Strategies</a>
<ul class="no-bullet">
<li><a name="toc-Philosophy-1" href="#Philosophy">2.1 Philosophy</a></li>
<li><a name="toc-Climate-Model-Paradigm-1" href="#Climate-Model-Paradigm">2.2 Climate Model Paradigm</a></li>
<li><a name="toc-Temporary-Output-Files-1" href="#Temporary-Output-Files">2.3 Temporary Output Files</a></li>
<li><a name="toc-Appending-Variables-1" href="#Appending-Variables">2.4 Appending Variables</a></li>
<li><a name="toc-Simple-Arithmetic-and-Interpolation-1" href="#Simple-Arithmetic-and-Interpolation">2.5 Simple Arithmetic and Interpolation</a></li>
<li><a name="toc-Statistics-vs_002e-Concatenation-1" href="#Statistics-vs_002e-Concatenation">2.6 Statistics vs. Concatenation</a>
<ul class="no-bullet">
<li><a name="toc-Concatenators-ncrcat-and-ncecat" href="#Concatenation">2.6.1 Concatenators <code>ncrcat</code> and <code>ncecat</code></a></li>
<li><a name="toc-Averagers-nces_002c-ncra_002c-and-ncwa" href="#Averaging">2.6.2 Averagers <code>nces</code>, <code>ncra</code>, and <code>ncwa</code></a></li>
<li><a name="toc-Interpolator-ncflint" href="#Interpolating">2.6.3 Interpolator <code>ncflint</code></a></li>
</ul></li>
<li><a name="toc-Large-Numbers-of-Files-1" href="#Large-Numbers-of-Files">2.7 Large Numbers of Files</a></li>
<li><a name="toc-Large-Datasets-1" href="#Large-Datasets">2.8 Large Datasets</a></li>
<li><a name="toc-Memory-Requirements-1" href="#Memory-Requirements">2.9 Memory Requirements</a>
<ul class="no-bullet">
<li><a name="toc-Single-and-Multi_002dfile-Operators-1" href="#Single-and-Multi_002dfile-Operators">2.9.1 Single and Multi-file Operators</a></li>
<li><a name="toc-Memory-for-ncap2-1" href="#Memory-for-ncap2">2.9.2 Memory for <code>ncap2</code></a></li>
</ul></li>
<li><a name="toc-Performance-1" href="#Performance">2.10 Performance</a></li>
</ul></li>
<li><a name="toc-NCO-Features" href="#Common-features">3 NCO Features</a>
<ul class="no-bullet">
<li><a name="toc-Internationalization-1" href="#Internationalization">3.1 Internationalization</a></li>
<li><a name="toc-Metadata-Optimization-1" href="#Metadata-Optimization">3.2 Metadata Optimization</a></li>
<li><a name="toc-OpenMP-Threading-1" href="#OpenMP-Threading">3.3 OpenMP Threading</a></li>
<li><a name="toc-Command-Line-Options-1" href="#Command-Line-Options">3.4 Command Line Options</a></li>
<li><a name="toc-Specifying-Input-Files-1" href="#Specifying-Input-Files">3.5 Specifying Input Files</a></li>
<li><a name="toc-Specifying-Output-Files-1" href="#Specifying-Output-Files">3.6 Specifying Output Files</a></li>
<li><a name="toc-Accessing-Remote-Files" href="#Remote-storage">3.7 Accessing Remote Files</a>
<ul class="no-bullet">
<li><a name="toc-OPeNDAP-1" href="#OPeNDAP">3.7.1 <acronym>OPeNDAP</acronym></a></li>
</ul></li>
<li><a name="toc-Retaining-Retrieved-Files-1" href="#Retaining-Retrieved-Files">3.8 Retaining Retrieved Files</a></li>
<li><a name="toc-File-Formats-and-Conversion-1" href="#File-Formats-and-Conversion">3.9 File Formats and Conversion</a>
<ul class="no-bullet">
<li><a name="toc-File-Formats-1" href="#File-Formats">3.9.1 File Formats</a></li>
<li><a name="toc-Determining-File-Format-1" href="#Determining-File-Format">3.9.2 Determining File Format</a></li>
<li><a name="toc-File-Conversion-1" href="#File-Conversion">3.9.3 File Conversion</a></li>
<li><a name="toc-Autoconversion-1" href="#Autoconversion">3.9.4 Autoconversion</a></li>
</ul></li>
<li><a name="toc-Large-File-Support-1" href="#Large-File-Support">3.10 Large File Support</a></li>
<li><a name="toc-Subsetting-Files-1" href="#Subsetting-Files">3.11 Subsetting Files</a></li>
<li><a name="toc-Subsetting-Coordinate-Variables-1" href="#Subsetting-Coordinate-Variables">3.12 Subsetting Coordinate Variables</a></li>
<li><a name="toc-Group-Path-Editing-1" href="#Group-Path-Editing">3.13 Group Path Editing</a></li>
<li><a name="toc-C-and-Fortran-Index-conventions" href="#C-and-Fortran-Index-Conventions">3.14 C and Fortran Index conventions</a></li>
<li><a name="toc-Hyperslabs-1" href="#Hyperslabs">3.15 Hyperslabs</a></li>
<li><a name="toc-Stride-1" href="#Stride">3.16 Stride</a></li>
<li><a name="toc-Record-Appending-1" href="#Record-Appending">3.17 Record Appending</a></li>
<li><a name="toc-Subcycle-1" href="#Subcycle">3.18 Subcycle</a></li>
<li><a name="toc-Multislabs-1" href="#Multislabs">3.19 Multislabs</a></li>
<li><a name="toc-Wrapped-Coordinates-1" href="#Wrapped-Coordinates">3.20 Wrapped Coordinates</a></li>
<li><a name="toc-Auxiliary-Coordinates-1" href="#Auxiliary-Coordinates">3.21 Auxiliary Coordinates</a></li>
<li><a name="toc-UDUnits-Support-1" href="#UDUnits-Support">3.22 UDUnits Support</a></li>
<li><a name="toc-Rebasing-Time-Coordinate-1" href="#Rebasing-Time-Coordinate">3.23 Rebasing Time Coordinate</a></li>
<li><a name="toc-Multiple-Record-Dimensions-1" href="#Multiple-Record-Dimensions">3.24 Multiple Record Dimensions</a></li>
<li><a name="toc-Missing-values" href="#Missing-Values">3.25 Missing values</a></li>
<li><a name="toc-Chunking-1" href="#Chunking">3.26 Chunking</a></li>
<li><a name="toc-Deflation-1" href="#Deflation">3.27 Deflation</a></li>
<li><a name="toc-MD5-digests-1" href="#MD5-digests">3.28 MD5 digests</a></li>
<li><a name="toc-Buffer-sizes-1" href="#Buffer-sizes">3.29 Buffer sizes</a></li>
<li><a name="toc-RAM-disks-1" href="#RAM-disks">3.30 RAM disks</a></li>
<li><a name="toc-Packed-data-1" href="#Packed-data">3.31 Packed data</a>
<ul class="no-bullet">
<li><a name="toc-Packing-Algorithm" href="#Packing-Algorithm">Packing Algorithm</a></li>
<li><a name="toc-Unpacking-Algorithm" href="#Unpacking-Algorithm">Unpacking Algorithm</a></li>
<li><a name="toc-Default-Handling-of-Packed-Data" href="#Default-Handling-of-Packed-Data">Default Handling of Packed Data</a></li>
<li><a name="toc-Default-Handling-of-Packed-Data-1" href="#Default-Handling-of-Packed-Data-1">Default Handling of Packed Data</a></li>
</ul></li>
<li><a name="toc-Operation-Types-1" href="#Operation-Types">3.32 Operation Types</a></li>
<li><a name="toc-Type-Conversion-1" href="#Type-Conversion">3.33 Type Conversion</a>
<ul class="no-bullet">
<li><a name="toc-Automatic-type-conversion-1" href="#Automatic-type-conversion">3.33.1 Automatic type conversion</a></li>
<li><a name="toc-Promoting-Single_002dprecision-to-Double-1" href="#Promoting-Single_002dprecision-to-Double">3.33.2 Promoting Single-precision to Double</a></li>
<li><a name="toc-Manual-type-conversion-1" href="#Manual-type-conversion">3.33.3 Manual type conversion</a></li>
</ul></li>
<li><a name="toc-Batch-Mode-1" href="#Batch-Mode">3.34 Batch Mode</a></li>
<li><a name="toc-History-Attribute-1" href="#History-Attribute">3.35 History Attribute</a></li>
<li><a name="toc-File-List-Attributes-1" href="#File-List-Attributes">3.36 File List Attributes</a></li>
<li><a name="toc-CF-Conventions-1" href="#CF-Conventions">3.37 <acronym>CF</acronym> Conventions</a></li>
<li><a name="toc-ARM-Conventions-1" href="#ARM-Conventions">3.38 <acronym>ARM</acronym> Conventions</a></li>
<li><a name="toc-Operator-Version-1" href="#Operator-Version">3.39 Operator Version</a></li>
</ul></li>
<li><a name="toc-Operator-Reference-Manual-1" href="#Operator-Reference-Manual">4 Operator Reference Manual</a>
<ul class="no-bullet">
<li><a name="toc-ncap2-netCDF-Arithmetic-Processor-1" href="#ncap2-netCDF-Arithmetic-Processor">4.1 <code>ncap2</code> netCDF Arithmetic Processor</a>
<ul class="no-bullet">
<li><a name="toc-Syntax-of-ncap2-statements-1" href="#Syntax-of-ncap2-statements">4.1.1 Syntax of <code>ncap2</code> statements</a></li>
<li><a name="toc-Expressions-1" href="#Expressions">4.1.2 Expressions</a></li>
<li><a name="toc-Dimensions-1" href="#Dimensions">4.1.3 Dimensions</a></li>
<li><a name="toc-Left-hand-casting-1" href="#Left-hand-casting">4.1.4 Left hand casting</a></li>
<li><a name="toc-Arrays-and-hyperslabs-1" href="#Arrays-and-hyperslabs">4.1.5 Arrays and hyperslabs</a></li>
<li><a name="toc-Attributes-1" href="#Attributes">4.1.6 Attributes</a></li>
<li><a name="toc-Number-literals-1" href="#Number-literals">4.1.7 Number literals</a></li>
<li><a name="toc-if-statement-1" href="#if-statement">4.1.8 if statement</a></li>
<li><a name="toc-print-statement-1" href="#print-statement">4.1.9 print statement</a></li>
<li><a name="toc-Missing-values-ncap2-1" href="#Missing-values-ncap2">4.1.10 Missing values ncap2</a></li>
<li><a name="toc-Methods-and-functions-1" href="#Methods-and-functions">4.1.11 Methods and functions</a></li>
<li><a name="toc-RAM-variables-1" href="#RAM-variables">4.1.12 <acronym>RAM</acronym> variables</a></li>
<li><a name="toc-Where-statement-1" href="#Where-statement">4.1.13 Where statement</a></li>
<li><a name="toc-Loops-1" href="#Loops">4.1.14 Loops</a></li>
<li><a name="toc-Include-files-1" href="#Include-files">4.1.15 Include files</a></li>
<li><a name="toc-sort-methods" href="#Sort-methods">4.1.16 <code>sort</code> methods</a></li>
<li><a name="toc-Irregular-Grids" href="#Irregular-grids">4.1.17 Irregular Grids</a></li>
<li><a name="toc-Bilinear-interpolation-1" href="#Bilinear-interpolation">4.1.18 Bilinear interpolation</a></li>
<li><a name="toc-GSL-special-functions-1" href="#GSL-special-functions">4.1.19 GSL special functions</a></li>
<li><a name="toc-GSL-interpolation-1" href="#GSL-interpolation">4.1.20 GSL interpolation</a></li>
<li><a name="toc-GSL-least_002dsquares-fitting-1" href="#GSL-least_002dsquares-fitting">4.1.21 GSL least-squares fitting</a></li>
<li><a name="toc-GSL-statistics-1" href="#GSL-statistics">4.1.22 GSL statistics</a></li>
<li><a name="toc-GSL-random-number-generation-1" href="#GSL-random-number-generation">4.1.23 GSL random number generation</a></li>
<li><a name="toc-Examples-ncap2-1" href="#Examples-ncap2">4.1.24 Examples ncap2</a></li>
<li><a name="toc-Intrinsic-mathematical-methods-1" href="#Intrinsic-mathematical-methods">4.1.25 Intrinsic mathematical methods</a></li>
<li><a name="toc-Operator-precedence-and-associativity-1" href="#Operator-precedence-and-associativity">4.1.26 Operator precedence and associativity</a></li>
<li><a name="toc-ID-Quoting-1" href="#ID-Quoting">4.1.27 ID Quoting</a></li>
</ul></li>
<li><a name="toc-ncatted-netCDF-Attribute-Editor-1" href="#ncatted-netCDF-Attribute-Editor">4.2 <code>ncatted</code> netCDF Attribute Editor</a></li>
<li><a name="toc-ncbo-netCDF-Binary-Operator-1" href="#ncbo-netCDF-Binary-Operator">4.3 <code>ncbo</code> netCDF Binary Operator</a></li>
<li><a name="toc-nces-netCDF-Ensemble-Statistics-1" href="#nces-netCDF-Ensemble-Statistics">4.4 <code>nces</code> netCDF Ensemble Statistics</a></li>
<li><a name="toc-ncecat-netCDF-Ensemble-Concatenator-1" href="#ncecat-netCDF-Ensemble-Concatenator">4.5 <code>ncecat</code> netCDF Ensemble Concatenator</a></li>
<li><a name="toc-ncflint-netCDF-File-Interpolator-1" href="#ncflint-netCDF-File-Interpolator">4.6 <code>ncflint</code> netCDF File Interpolator</a></li>
<li><a name="toc-ncks-netCDF-Kitchen-Sink-1" href="#ncks-netCDF-Kitchen-Sink">4.7 <code>ncks</code> netCDF Kitchen Sink</a>
<ul class="no-bullet">
<li><a name="toc-Options-specific-to-ncks" href="#Options-specific-to-ncks">Options specific to <code>ncks</code></a></li>
<li><a name="toc-Filters-for-ncks-1" href="#Filters-for-ncks">4.7.1 Filters for <code>ncks</code></a></li>
</ul></li>
<li><a name="toc-ncpdq-netCDF-Permute-Dimensions-Quickly-1" href="#ncpdq-netCDF-Permute-Dimensions-Quickly">4.8 <code>ncpdq</code> netCDF Permute Dimensions Quickly</a>
<ul class="no-bullet">
<li><a name="toc-Packing-and-Unpacking-Functions" href="#Packing-and-Unpacking-Functions">Packing and Unpacking Functions</a></li>
<li><a name="toc-Dimension-Permutation" href="#Dimension-Permutation">Dimension Permutation</a></li>
</ul></li>
<li><a name="toc-ncra-netCDF-Record-Averager-1" href="#ncra-netCDF-Record-Averager">4.9 <code>ncra</code> netCDF Record Averager</a></li>
<li><a name="toc-ncrcat-netCDF-Record-Concatenator-1" href="#ncrcat-netCDF-Record-Concatenator">4.10 <code>ncrcat</code> netCDF Record Concatenator</a></li>
<li><a name="toc-ncrename-netCDF-Renamer-1" href="#ncrename-netCDF-Renamer">4.11 <code>ncrename</code> netCDF Renamer</a></li>
<li><a name="toc-ncwa-netCDF-Weighted-Averager-1" href="#ncwa-netCDF-Weighted-Averager">4.12 <code>ncwa</code> netCDF Weighted Averager</a>
<ul class="no-bullet">
<li><a name="toc-Mask-condition-1" href="#Mask-condition">4.12.1 Mask condition</a></li>
<li><a name="toc-Normalization-and-Integration-1" href="#Normalization-and-Integration">4.12.2 Normalization and Integration</a></li>
</ul></li>
</ul></li>
<li><a name="toc-Contributing-1" href="#Contributing">5 Contributing</a>
<ul class="no-bullet">
<li><a name="toc-Contributors-1" href="#Contributors">5.1 Contributors</a></li>
<li><a name="toc-Proposals-for-Institutional-Funding-1" href="#Proposals-for-Institutional-Funding">5.2 Proposals for Institutional Funding</a></li>
</ul></li>
<li><a name="toc-Quick-Start-1" href="#Quick-Start">6 Quick Start</a>
<ul class="no-bullet">
<li><a name="toc-Daily-data-in-one-file-1" href="#Daily-data-in-one-file">6.1 Daily data in one file</a></li>
<li><a name="toc-Monthly-data-in-one-file-1" href="#Monthly-data-in-one-file">6.2 Monthly data in one file</a></li>
<li><a name="toc-One-time-point-one-file-1" href="#One-time-point-one-file">6.3 One time point one file</a></li>
<li><a name="toc-Multiple-files-with-multiple-time-points-1" href="#Multiple-files-with-multiple-time-points">6.4 Multiple files with multiple time points</a></li>
</ul></li>
<li><a name="toc-CMIP5-Example-1" href="#CMIP5-Example">7 <acronym>CMIP5</acronym> Example</a>
<ul class="no-bullet">
<li><a name="toc-Combine-Files-1" href="#Combine-Files">7.1 Combine Files</a></li>
<li><a name="toc-Global-Distribution-of-Long_002dterm-Average-1" href="#Global-Distribution-of-Long_002dterm-Average">7.2 Global Distribution of Long-term Average</a></li>
<li><a name="toc-Annual-Average-over-Regions-1" href="#Annual-Average-over-Regions">7.3 Annual Average over Regions</a></li>
<li><a name="toc-Monthly-Cycle-1" href="#Monthly-Cycle">7.4 Monthly Cycle</a></li>
<li><a name="toc-Regrid-MODIS-Data-1" href="#Regrid-MODIS-Data">7.5 Regrid <acronym>MODIS</acronym> Data</a></li>
<li><a name="toc-Add-Coordinates-to-MODIS-Data-1" href="#Add-Coordinates-to-MODIS-Data">7.6 Add Coordinates to <acronym>MODIS</acronym> Data</a></li>
<li><a name="toc-Permute-MODIS-Coordinates-1" href="#Permute-MODIS-Coordinates">7.7 Permute <acronym>MODIS</acronym> Coordinates</a></li>
</ul></li>
<li><a name="toc-Parallel-1" href="#Parallel">8 Parallel</a></li>
<li><a name="toc-CCSM-Example-1" href="#CCSM-Example">9 CCSM Example</a></li>
<li><a name="toc-References" href="#mybibnode">10 References</a></li>
<li><a name="toc-General-Index-1" href="#General-Index">General Index</a></li>
</ul>
</div>
<a name="Top"></a>
<div class="header">
<p>
Next: <a href="#Foreword" accesskey="n" rel="next">Foreword</a>, Previous: <a href="dir.html#Top" accesskey="p" rel="previous">(dir)</a>, Up: <a href="dir.html#Top" accesskey="u" rel="up">(dir)</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#General-Index" title="Index" rel="index">Index</a>]</p>
</div>
<a name="NCO-User-Guide"></a>
<h1 class="top">NCO User Guide</h1>
<table class="cartouche" border="1"><tr><td>
<p><b>Note to readers of the NCO User Guide in HTML format</b>:
<b>The <a href="./nco.pdf">NCO User Guide in PDF format</a>
(also on <a href="http://nco.sf.net/nco.pdf">SourceForge</a>)
contains the complete NCO documentation.</b>
<br>This HTML documentation is equivalent except it refers you to the
printed (i.e., DVI, PostScript, and PDF) documentation for description
of complex mathematical expressions. Also, images appear only in the
PDF document due to SourceForge limitations.</td></tr></table>
<p>The netCDF Operators, or <acronym>NCO</acronym>, are a suite of programs known as
operators.
The operators facilitate manipulation and analysis of data stored in the
self-describing netCDF format, available from
(<a href="http://www.unidata.ucar.edu/packages/netcdf">http://www.unidata.ucar.edu/packages/netcdf</a>).
Each <acronym>NCO</acronym> operator (e.g., ncks) takes netCDF input
file(s), performs an operation (e.g., averaging, hyperslabbing, or
renaming), and outputs a processed netCDF file.
Although most users of netCDF data are involved in scientific research,
these data formats, and thus <acronym>NCO</acronym>, are generic and are equally
useful in fields from agriculture to zoology.
The <acronym>NCO</acronym> User Guide illustrates <acronym>NCO</acronym> use with
examples from the field of climate modeling and analysis.
The <acronym>NCO</acronym> homepage is <a href="http://nco.sf.net">http://nco.sf.net</a>, and
there is a mirror at <a href="http://dust.ess.uci.edu/nco">http://dust.ess.uci.edu/nco</a>.
</p>
<p>This documentation is for <acronym>NCO</acronym> version 4.4.2.
It was last updated 19 February 2014.
Corrections, additions, and rewrites of this documentation are very
welcome.
</p>
<p>Enjoy,<br>
Charlie Zender
</p>
<table class="menu" border="0" cellspacing="0">
<tr><td align="left" valign="top">• <a href="#Foreword" accesskey="1">Foreword</a>:</td><td> </td><td align="left" valign="top">
</td></tr>
<tr><td align="left" valign="top">• <a href="#Summary" accesskey="2">Summary</a>:</td><td> </td><td align="left" valign="top">
</td></tr>
<tr><td align="left" valign="top">• <a href="#Introduction" accesskey="3">Introduction</a>:</td><td> </td><td align="left" valign="top">
</td></tr>
<tr><td align="left" valign="top">• <a href="#Strategies" accesskey="4">Strategies</a>:</td><td> </td><td align="left" valign="top">
</td></tr>
<tr><td align="left" valign="top">• <a href="#Common-features" accesskey="5">Common features</a>:</td><td> </td><td align="left" valign="top">
</td></tr>
<tr><td align="left" valign="top">• <a href="#Operator-Reference-Manual" accesskey="6">Operator Reference Manual</a>:</td><td> </td><td align="left" valign="top">
</td></tr>
<tr><td align="left" valign="top">• <a href="#Contributing" accesskey="7">Contributing</a>:</td><td> </td><td align="left" valign="top">
</td></tr>
<tr><td align="left" valign="top">• <a href="#Quick-Start" accesskey="8">Quick Start</a>:</td><td> </td><td align="left" valign="top">
</td></tr>
<tr><td align="left" valign="top">• <a href="#CMIP5-Example" accesskey="9">CMIP5 Example</a>:</td><td> </td><td align="left" valign="top">
</td></tr>
<tr><td align="left" valign="top">• <a href="#Parallel">Parallel</a>:</td><td> </td><td align="left" valign="top">
</td></tr>
<tr><td align="left" valign="top">• <a href="#CCSM-Example">CCSM Example</a>:</td><td> </td><td align="left" valign="top">
</td></tr>
<tr><td align="left" valign="top">• <a href="#mybibnode">mybibnode</a>:</td><td> </td><td align="left" valign="top">
</td></tr>
<tr><td align="left" valign="top">• <a href="#General-Index">General Index</a>:</td><td> </td><td align="left" valign="top">
</td></tr>
</table>
<a name="fwd"></a> <!-- http://nco.sf.net/nco.html#fwd --><hr>
<a name="Foreword"></a>
<div class="header">
<p>
Next: <a href="#Summary" accesskey="n" rel="next">Summary</a>, Previous: <a href="#Top" accesskey="p" rel="previous">Top</a>, Up: <a href="#Top" accesskey="u" rel="up">Top</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#General-Index" title="Index" rel="index">Index</a>]</p>
</div>
<a name="Foreword-1"></a>
<h2 class="unnumbered">Foreword</h2>
<a name="index-foreword"></a>
<a name="index-Charlie-Zender"></a>
<p><acronym>NCO</acronym> is the result of software needs that arose while I worked
on projects funded by <acronym>NCAR</acronym>, <acronym>NASA</acronym>, and <acronym>ARM</acronym>.
Thinking they might prove useful as tools or templates to others,
it is my pleasure to provide them freely to the scientific community.
Many users (most of whom I have never met) have encouraged the
development of <acronym>NCO</acronym>.
Thanks espcially to Jan Polcher, Keith Lindsay, Arlindo da Silva<!-- /@w -->,
John Sheldon, and William Weibel for stimulating suggestions and
correspondence.
Your encouragment motivated me to complete the <cite>NCO User Guide</cite>.
So if you like <acronym>NCO</acronym>, send me a note!
I should<!-- /@w --> mention that <acronym>NCO</acronym> is not connected to or
officially endorsed by Unidata, <acronym>ACD</acronym>, <acronym>ASP</acronym>,
<acronym>CGD</acronym>, or Nike.<br>
</p><br>
<p>Charlie Zender<br>
May 1997<br>
Boulder, Colorado<br>
</p>
<br>
<br>
<p>Major feature improvements entitle me to write another Foreword.
In the last five years a lot of work has been done to refine
<acronym>NCO</acronym>.
<a name="index-open-source"></a>
<acronym>NCO</acronym> is now an open source project and appears to be much
healthier for it.
The list of illustrious institutions that do not endorse <acronym>NCO</acronym>
continues to grow, and now includes <acronym>UCI</acronym>.<br>
</p><br>
<p>Charlie Zender<br>
October 2000<br>
Irvine, California<br>
</p>
<br>
<br>
<p>The most remarkable advances in <acronym>NCO</acronym> capabilities in the last
few years are due to contributions from the Open Source community.
Especially noteworthy are the contributions of Henry Butowsky and Rorik
Peterson.<br>
</p><br>
<p>Charlie Zender<br>
January 2003<br>
Irvine, California<br>
</p>
<br>
<br>
<p><acronym>NCO</acronym> was generously supported from 2004–2008 by US
National Science Foundation (<acronym>NSF</acronym>) grant
<a href="http://www.nsf.gov/awardsearch/showAward.do?AwardNumber=0431203">IIS-0431203</a>.
This support allowed me to maintain and extend core <acronym>NCO</acronym> code,
and others to advance <acronym>NCO</acronym> in new directions:
Gayathri Venkitachalam helped implement <acronym>MPI</acronym>;
Harry Mangalam improved regression testing and benchmarking;
Daniel Wang developed the server-side capability, <acronym>SWAMP</acronym>;
and Henry Butowsky, a long-time contributor, developed <code>ncap2</code>.
This support also led <acronym>NCO</acronym> to debut in professional journals
and meetings.
The personal and professional contacts made during this evolution have
been immensely rewarding.<br>
</p><br>
<p>Charlie Zender<br>
March 2008<br>
Grenoble, France<br>
</p>
<br>
<br>
<p>The end of the <acronym>NSF</acronym> SEI grant in August, 2008 curtailed <acronym>NCO</acronym>
development.
Fortunately we could justify supporting Henry Butowsky on other research
grants until May, 2010 while he developed the key <code>ncap2</code>
features used in our climate research.
And recentely the NASA ACCESS program commenced funding NCO support for
netCDF4 group functionality.<br>
Thus <acronym>NCO</acronym> will grow and evade bit-rot for the foreseeable future.
</p>
<p>On a personal level, I continue to receive with gratitude the thanks of
<acronym>NCO</acronym> users at nearly every scientific meeting I attend.
People introduce themselves, shake my hand and extol, sometimes rather
effusively, these time-saving tools.
These exchanges lighten me like anti-gravity.
Sometimes I daydream how many hours <acronym>NCO</acronym> has turned from grunt
work to productive research for researchers world-wide, or from research
into early happy hours.
It’s a cool feeling.
</p>
<br>
<p>Charlie Zender<br>
April, 2012<br>
Irvine, California<br>
</p>
<a name="smr"></a> <!-- http://nco.sf.net/nco.html#smr --><hr>
<a name="Summary"></a>
<div class="header">
<p>
Next: <a href="#Introduction" accesskey="n" rel="next">Introduction</a>, Previous: <a href="#Foreword" accesskey="p" rel="previous">Foreword</a>, Up: <a href="#Top" accesskey="u" rel="up">Top</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#General-Index" title="Index" rel="index">Index</a>]</p>
</div>
<a name="Summary-1"></a>
<h2 class="unnumbered">Summary</h2>
<a name="index-operators"></a>
<a name="index-summary"></a>
<p>This manual describes <acronym>NCO</acronym>, which stands for netCDF Operators.
<acronym>NCO</acronym> is a suite of programs known as <em>operators</em>.
Each operator is a standalone, command line program executed at the
shell-level like, e.g., <code>ls</code> or <code>mkdir</code>.
The operators take netCDF files (including <acronym>HDF5</acronym> files
constructed using the netCDF <acronym>API</acronym>) as input, perform an
operation (e.g., averaging or hyperslabbing), and produce a netCDF file
as output.
The operators are primarily designed to aid manipulation and analysis of
data.
The examples in this documentation are typical applications of the
operators for processing climate model output.
This stems from their origin, though the operators are as general as
netCDF itself.
</p>
<a name="ntr"></a> <!-- http://nco.sf.net/nco.html#ntr --><hr>
<a name="Introduction"></a>
<div class="header">
<p>
Next: <a href="#Strategies" accesskey="n" rel="next">Strategies</a>, Previous: <a href="#Summary" accesskey="p" rel="previous">Summary</a>, Up: <a href="#Top" accesskey="u" rel="up">Top</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#General-Index" title="Index" rel="index">Index</a>]</p>
</div>
<a name="Introduction-1"></a>
<h2 class="chapter">1 Introduction</h2>
<a name="index-introduction"></a>
<table class="menu" border="0" cellspacing="0">
<tr><td align="left" valign="top">• <a href="#Availability" accesskey="1">Availability</a>:</td><td> </td><td align="left" valign="top">
</td></tr>
<tr><td align="left" valign="top">• <a href="#How-to-Use-This-guide" accesskey="2">How to Use This guide</a>:</td><td> </td><td align="left" valign="top">
</td></tr>
<tr><td align="left" valign="top">• <a href="#Compatability" accesskey="3">Compatability</a>:</td><td> </td><td align="left" valign="top">
</td></tr>
<tr><td align="left" valign="top">• <a href="#Symbolic-Links" accesskey="4">Symbolic Links</a>:</td><td> </td><td align="left" valign="top">
</td></tr>
<tr><td align="left" valign="top">• <a href="#Libraries" accesskey="5">Libraries</a>:</td><td> </td><td align="left" valign="top">
</td></tr>
<tr><td align="left" valign="top">• <a href="#netCDF2_002f3_002f4-and-HDF4_002f5-Support" accesskey="6">netCDF2/3/4 and HDF4/5 Support</a>:</td><td> </td><td align="left" valign="top">
</td></tr>
<tr><td align="left" valign="top">• <a href="#Help-Requests-and-Bug-Reports" accesskey="7">Help Requests and Bug Reports</a>:</td><td> </td><td align="left" valign="top">
</td></tr>
</table>
<hr>
<a name="Availability"></a>
<div class="header">
<p>
Next: <a href="#How-to-Use-This-guide" accesskey="n" rel="next">How to Use This guide</a>, Previous: <a href="#Introduction" accesskey="p" rel="previous">Introduction</a>, Up: <a href="#Introduction" accesskey="u" rel="up">Introduction</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#General-Index" title="Index" rel="index">Index</a>]</p>
</div>
<a name="Availability-1"></a>
<h3 class="section">1.1 Availability</h3>
<a name="index-NCO-availability"></a>
<a name="index-source-code"></a>
<p>The complete <acronym>NCO</acronym> source distribution is currently distributed
as a <em>compressed tarfile</em> from
<a href="http://sf.net/projects/nco">http://sf.net/projects/nco</a>
and from
<a href="http://dust.ess.uci.edu/nco/nco.tar.gz">http://dust.ess.uci.edu/nco/nco.tar.gz</a>.
The compressed tarfile must be uncompressed and untarred before building
<acronym>NCO</acronym>.
Uncompress the file with ‘<samp>gunzip nco.tar.gz</samp>’.
Extract the source files from the resulting tarfile with ‘<samp>tar -xvf
nco.tar</samp>’.
<acronym>GNU</acronym> <code>tar</code> lets you perform both operations in one step
with ‘<samp>tar -xvzf nco.tar.gz</samp>’.
</p>
<a name="index-documentation"></a>
<a name="index-WWW-documentation"></a>
<a name="index-on_002dline-documentation"></a>
<a name="index-HTML"></a>
<a name="index-TeXinfo"></a>
<a name="index-Info"></a>
<a name="index-User-Guide"></a>
<a name="index-NCO-User-Guide"></a>
<p>The documentation for <acronym>NCO</acronym> is called the
<cite>NCO User Guide</cite>.
The <cite>User Guide</cite> is available in <acronym>PDF</acronym>, Postscript,
<acronym>HTML</acronym>, <acronym>DVI</acronym>, TeXinfo, and Info formats.
These formats are included in the source distribution in the files
<samp>nco.pdf</samp>, <samp>nco.ps</samp>, <samp>nco.html</samp>, <samp>nco.dvi</samp>,
<samp>nco.texi</samp>, and <samp>nco.info*</samp>, respectively.
All the documentation descends from a single source file,
<samp>nco.texi</samp>
<a name="DOCF1" href="#FOOT1"><sup>1</sup></a>.
Hence the documentation in every format is very similar.
However, some of the complex mathematical expressions needed to describe
<code>ncwa</code> can only be displayed in <acronym>DVI</acronym>, Postscript, and
<acronym>PDF</acronym> formats.
</p>
<a name="index-publications"></a>
<a name="index-presentations"></a>
<p>A complete list of papers and publications on/about <acronym>NCO</acronym>
is available on the <acronym>NCO</acronym> homepage.
Most of these are freely available.
The primary refereed publications are ZeM06 and Zen08.
These contain copyright restrictions which limit their redistribution,
but they are freely available in preprint form from the <acronym>NCO</acronym>.
</p>
<a name="index-NCO-homepage"></a>
<p>If you want to quickly see what the latest improvements in <acronym>NCO</acronym>
are (without downloading the entire source distribution), visit the
<acronym>NCO</acronym> homepage at
<a href="http://nco.sf.net">http://nco.sf.net</a>.
The <acronym>HTML</acronym> version of the <cite>User Guide</cite> is also available
online through the World Wide Web at <acronym>URL</acronym>
<a href="http://nco.sf.net/nco.html">http://nco.sf.net/nco.html</a>.
<a name="index-netCDF"></a>
To build and use <acronym>NCO</acronym>, you must have netCDF installed.
The netCDF homepage is
<a href="http://www.unidata.ucar.edu/packages/netcdf">http://www.unidata.ucar.edu/packages/netcdf</a>.
</p>
<p>New <acronym>NCO</acronym> releases are announced on the netCDF list
and on the <code>nco-announce</code> mailing list
<a href="http://lists.sf.net/mailman/listinfo/nco-announce">http://lists.sf.net/mailman/listinfo/nco-announce</a>.
</p>
<hr>
<a name="How-to-Use-This-guide"></a>
<div class="header">
<p>
Next: <a href="#Compatability" accesskey="n" rel="next">Compatability</a>, Previous: <a href="#Availability" accesskey="p" rel="previous">Availability</a>, Up: <a href="#Introduction" accesskey="u" rel="up">Introduction</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#General-Index" title="Index" rel="index">Index</a>]</p>
</div>
<a name="How-to-Use-This-Guide"></a>
<h3 class="section">1.2 How to Use This Guide</h3>
<a name="index-contents"></a>
<a name="index-introduction-1"></a>
<p>Detailed instructions about
<a href="http://nco.sf.net/#Source">how to download the newest version</a>,
and <a href="http://nco.sf.net/#bld">how to complie source code</a>,
as well as a <a href="http://nco.sf.net/#FAQ"><acronym>FAQ</acronym></a> and
descriptions of <a href="http://nco.sf.net/#bug">Known Problems</a> etc.
are on our homepage
(<a href="http://nco.sf.net/">http://nco.sf.net/</a>).
</p>
<p>There are twelve operators in the current version (4.4.2).
The function of each is explained in <a href="#Operator-Reference-Manual">Operator Reference Manual</a>.
Many of the tasks that <acronym>NCO</acronym> can accomplish are described during
the explanation of common <acronym>NCO</acronym> Features (see <a href="#Common-features">Common features</a>).
More specific use examples for each operator can be seen by visiting the
operator-specific examples in the <a href="#Operator-Reference-Manual">Operator Reference Manual</a>.
These can be found directly by prepending the operator name with the
<code>xmp_</code> tag, e.g., <a href="http://nco.sf.net/nco.html#xmp_ncks">http://nco.sf.net/nco.html#xmp_ncks</a>.
Also, users can type the operator name on the shell command line to
see all the available options, or type, e.g., ‘<samp>man ncks</samp>’ to see
a help man-page.
</p>
<p><acronym>NCO</acronym> is a command-line language.
You can either use an operator after the prompt (e.g., ‘<samp>$</samp>’ here),
like,
</p><div class="example">
<pre class="example">$ <code>operator</code> <samp>[options]</samp> <samp>input</samp> <samp>[output]</samp>
</pre></div>
<p>or write all commands lines into a shell script, as in
the <acronym>CMIP5</acronym> Example (see <a href="#CMIP5-Example">CMIP5 Example</a>).
</p>
<p>If you are new to <acronym>NCO</acronym>, the Quick Start (see <a href="#Quick-Start">Quick Start</a>)
shows simple examples about how to use <acronym>NCO</acronym> on different kinds
of data files.
More detailed “real-world” examples are in the
<a href="#CMIP5-Example"><acronym>CMIP5</acronym> Example</a>.
The <a href="#General-Index">Index</a> is presents multiple keyword entries for
the same subject.
If these resources do not help enough, please
see <a href="#Help-Requests-and-Bug-Reports">Help Requests and Bug Reports</a>.
</p>
<hr>
<a name="Compatability"></a>
<div class="header">
<p>
Next: <a href="#Symbolic-Links" accesskey="n" rel="next">Symbolic Links</a>, Previous: <a href="#How-to-Use-This-guide" accesskey="p" rel="previous">How to Use This guide</a>, Up: <a href="#Introduction" accesskey="u" rel="up">Introduction</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#General-Index" title="Index" rel="index">Index</a>]</p>
</div>
<a name="Operating-systems-compatible-with-NCO"></a>
<h3 class="section">1.3 Operating systems compatible with <acronym>NCO</acronym></h3>
<a name="index-OS"></a>
<a name="index-IBM"></a>
<a name="index-NEC"></a>
<a name="index-SGI"></a>
<a name="index-HP"></a>
<a name="index-DEC"></a>
<a name="index-PGI"></a>
<a name="index-Cray"></a>
<a name="index-Digital"></a>
<a name="index-Sun"></a>
<a name="index-Intel"></a>
<a name="index-Comeau"></a>
<a name="index-Compaq"></a>
<a name="index-Macintosh"></a>
<a name="index-Microsoft"></a>
<a name="index-Windows"></a>
<a name="index-PathScale"></a>
<a name="index-QLogic"></a>
<a name="index-compatability"></a>
<a name="index-portability"></a>
<a name="index-installation"></a>
<p><acronym>NCO</acronym> has been successfully ported and tested and is known to
work on the following 32- and 64-bit platforms:
<acronym>IBM AIX</acronym> 4.x, 5.x,
FreeBSD 4.x,
<acronym>GNU</acronym>/Linux 2.x, LinuxPPC, LinuxAlpha, LinuxARM, LinuxSparc64,
<acronym>SGI IRIX</acronym> 5.x and 6.x,
MacOS X<!-- /@w --> 10.x,
<acronym>NEC</acronym> Super-UX 10.x,
<acronym>DEC OSF</acronym>,
Sun SunOS 4.1.x, Solaris 2.x,
<acronym>Cray UNICOS</acronym> 8.x–10.x,
and MS Windows95 and all later versions.
If you port the code to a new operating system, please send me a note
and any patches you required.
</p>
<a name="index-UNIX"></a>
<a name="index-Unidata"></a>
<a name="index-UDUnits"></a>
<p>The major prerequisite for installing <acronym>NCO</acronym> on a particular
platform is the successful, prior installation of the netCDF library
(and, as of 2003, the UDUnits library).
Unidata has shown a commitment to maintaining netCDF and UDUnits on all
popular <acronym>UNIX</acronym> platforms, and is moving towards full support for
the Microsoft Windows operating system (<acronym>OS</acronym>).
Given this, the only difficulty in implementing <acronym>NCO</acronym> on a
particular platform is standardization of various C<!-- /@w -->-language API
system calls.
<acronym>NCO</acronym> code is tested for <acronym>ANSI</acronym> compliance by
compiling with C99 compilers<!-- /@w --> including those from
<a name="index-CC"></a>
<a name="index-c_002b_002b"></a>
<a name="index-cc"></a>
<a name="index-clang"></a>
<a name="index-como"></a>
<a name="index-cxx"></a>
<a name="index-gcc"></a>
<a name="index-g_002b_002b"></a>
<a name="index-icc"></a>
<a name="index-MVS"></a>
<a name="index-pgcc"></a>
<a name="index-pgCC"></a>
<a name="index-pathcc"></a>
<a name="index-pathCC"></a>
<a name="index-xlC"></a>
<a name="index-xlc"></a>
<acronym>GNU</acronym> (‘<samp>gcc -std=c99 -pedantic -D_BSD_SOURCE -D_POSIX_SOURCE</samp>’ -Wall)
<a name="DOCF2" href="#FOOT2"><sup>2</sup></a>,
Comeau Computing (‘<samp>como --c99</samp>’),
Cray (‘<samp>cc</samp>’),
<acronym>HP</acronym>/Compaq/<acronym>DEC</acronym> (‘<samp>cc</samp>’),
<acronym>IBM</acronym> (‘<samp>xlc -c -qlanglvl=extc99</samp>’),
Intel (‘<samp>icc -std=c99</samp>’),
<a name="index-LLVM"></a>
<acronym>LLVM</acronym> (‘<samp>clang</samp>’),
<acronym>NEC</acronym> (‘<samp>cc</samp>’),
PathScale (QLogic) (‘<samp>pathcc -std=c99</samp>’),
<acronym>PGI</acronym> (‘<samp>pgcc -c9x</samp>’),
<acronym>SGI</acronym> (‘<samp>cc -c99</samp>’),
and
Sun (‘<samp>cc</samp>’).
<a name="index-C_002b_002b"></a>
<a name="index-ISO"></a>
<a name="index-libnco"></a>
<acronym>NCO</acronym> (all commands and the <code>libnco</code> library) and
the C++ interface to netCDF (called <code>libnco_c++</code>) comply with
the <acronym>ISO</acronym> C++ standards as implemented by
Comeau Computing (‘<samp>como</samp>’),
Cray (‘<samp>CC</samp>’),
<acronym>GNU</acronym> (‘<samp>g++ -Wall</samp>’),
<acronym>HP</acronym>/Compaq/<acronym>DEC</acronym> (‘<samp>cxx</samp>’),
<acronym>IBM</acronym> (‘<samp>xlC</samp>’),
Intel (‘<samp>icc</samp>’),
Microsoft (‘<samp>MVS</samp>’),
<acronym>NEC</acronym> (‘<samp>c++</samp>’),
PathScale (Qlogic) (‘<samp>pathCC</samp>’),
<acronym>PGI</acronym> (‘<samp>pgCC</samp>’),
<acronym>SGI</acronym> (‘<samp>CC -LANG:std</samp>’),
and
Sun (‘<samp>CC -LANG:std</samp>’).
<a name="index-Makefile"></a>
See <samp>nco/bld/Makefile</samp> and <samp>nco/src/nco_c++/Makefile.old</samp> for
more details and exact settings.
</p>
<a name="index-ANSI"></a>
<a name="index-C89"></a>
<a name="index-printf"></a>
<p>Until recently (and not even yet), <acronym>ANSI</acronym>-compliant has meant
compliance with the 1989 <acronym>ISO</acronym> C-standard, usually called C89 (with
minor revisions made in 1994 and 1995).
C89 lacks variable-size arrays, restricted pointers, some useful
<code>printf</code> formats, and many mathematical special functions.
<a name="index-C99"></a>
These are valuable features of C99, the 1999 <acronym>ISO</acronym> C-standard.
<acronym>NCO</acronym> is C99-compliant where possible and C89-compliant where
necessary.
Certain branches in the code are required to satisfy the native
<acronym>SGI</acronym> and SunOS C compilers<!-- /@w -->, which are strictly <acronym>ANSI</acronym>
C89 compliant, and cannot benefit from C99 features.
However, C99 features are fully supported by modern <acronym>AIX</acronym>,
<acronym>GNU</acronym>, Intel, <acronym>NEC</acronym>, Solaris, and <acronym>UNICOS</acronym>
compilers.
<acronym>NCO</acronym> requires a C99-compliant compiler as of <acronym>NCO</acronym>
version 2.9.8<!-- /@w -->, released in August, 2004.
</p>
<p>The most time-intensive portion of <acronym>NCO</acronym> execution is spent in
arithmetic operations, e.g., multiplication, averaging, subtraction.
These operations were performed in Fortran by default until August,
1999.
This was a design decision based on the relative speed of Fortran-based
object code vs. C-based object code in late 1994.
C compiler<!-- /@w --> vectorization capabilities have dramatically improved
since 1994.
We have accordingly replaced all Fortran subroutines with C functions<!-- /@w -->.
This greatly simplifies the task of building <acronym>NCO</acronym> on nominally
unsupported platforms.
<a name="index-C-language"></a>
As of August 1999, <acronym>NCO</acronym> built entirely in C<!-- /@w --> by default.
This allowed <acronym>NCO</acronym> to compile on any machine with an
<acronym>ANSI</acronym> C compiler<!-- /@w -->.
<a name="index-C99-1"></a>
<a name="index-C89-1"></a>
<a name="index-restrict"></a>
In August 2004, the first C99 feature, the <code>restrict</code> type
qualifier, entered <acronym>NCO</acronym> in version 2.9.8.
C compilers<!-- /@w --> can obtain better performance with C99 restricted
pointers since they inform the compiler when it may make Fortran-like
assumptions regarding pointer contents alteration.
Subsequently, <acronym>NCO</acronym> requires a C99 compiler to build correctly
<a name="DOCF3" href="#FOOT3"><sup>3</sup></a>.
</p>
<a name="index-GSL"></a>
<a name="index-ncap2-4"></a>
<p>In January 2009, <acronym>NCO</acronym> version 3.9.6 was the first to link
to the GNU Scientific Library (<acronym>GSL</acronym>).
<acronym>GSL</acronym> must be version 1.4<!-- /@w --> or later.
<acronym>NCO</acronym>, in particular <code>ncap2</code>, uses the <acronym>GSL</acronym>
special function library to evaluate geoscience-relevant mathematics
such as Bessel functions, Legendre polynomials, and incomplete gamma
functions (see <a href="#GSL-special-functions">GSL special functions</a>).
</p>
<a name="index-gamma"></a>
<p>In June 2005, <acronym>NCO</acronym> version 3.0.1 began to take advantage
of C99 mathematical special functions.
These include the standarized gamma function (called <code>tgamma()</code>
for “true gamma”).
<a name="index-automagic"></a>
<acronym>NCO</acronym> automagically takes advantage of some <acronym>GNU</acronym>
Compiler Collection (<acronym>GCC</acronym>) extensions to <acronym>ANSI</acronym> C<!-- /@w -->.
</p>
<p>As of July 2000 and <acronym>NCO</acronym> version 1.2<!-- /@w -->, <acronym>NCO</acronym> no
longer performs arithmetic operations in Fortran.
We decided to sacrifice executable speed for code maintainability.
Since no objective statistics were ever performed to quantify
the difference in speed between the Fortran and C code<!-- /@w -->,
the performance penalty incurred by this decision is unknown.
Supporting Fortran involves maintaining two sets of routines for every
arithmetic operation.
The <code>USE_FORTRAN_ARITHMETIC</code> flag is still retained in the
<samp>Makefile</samp>.
The file containing the Fortran code, <samp>nco_fortran.F</samp>, has been
deprecated but a volunteer (Dr. Frankenstein<!-- /@w -->?) could resurrect it.
If you would like to volunteer to maintain <samp>nco_fortran.F</samp> please
contact me.
</p>
<table class="menu" border="0" cellspacing="0">
<tr><td align="left" valign="top">• <a href="#Windows-Operating-System" accesskey="1">Windows Operating System</a>:</td><td> </td><td align="left" valign="top">
</td></tr>
</table>
<a name="wnd"></a> <!-- http://nco.sf.net/nco.html#wnd -->
<a name="windows"></a> <!-- http://nco.sf.net/nco.html#windows -->
<a name="qt"></a> <!-- http://nco.sf.net/nco.html#qt --><hr>
<a name="Windows-Operating-System"></a>
<div class="header">
<p>
Previous: <a href="#Compatability" accesskey="p" rel="previous">Compatability</a>, Up: <a href="#Compatability" accesskey="u" rel="up">Compatability</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#General-Index" title="Index" rel="index">Index</a>]</p>
</div>
<a name="Compiling-NCO-for-Microsoft-Windows-OS"></a>
<h4 class="subsection">1.3.1 Compiling <acronym>NCO</acronym> for Microsoft Windows <acronym>OS</acronym></h4>
<a name="index-Windows-1"></a>
<a name="index-Microsoft-1"></a>
<a name="index-XP-_0028Microsoft-operating-system_0029"></a>
<a name="index-NT-_0028Microsoft-operating-system_0029"></a>
<a name="index-Vista-_0028Microsoft-operating-system_0029"></a>
<a name="index-MVS-1"></a>
<a name="index-Microsoft-Visual-Studio"></a>
<p><acronym>NCO</acronym> has been successfully ported and tested on most Microsoft
Windows operating systems including: XP SP2/Vista/7.
Support is provided for compiling either native Windows executables,
using the Microsoft Visual Studio 2010 Compiler, or with Cygwin, the
UNIX-emulating compatibility layer with the GNU toolchain.
The switches necessary to accomplish both are included in the standard
distribution of <acronym>NCO</acronym>.
</p>
<a name="index-Qt"></a>
<a name="index-C99-2"></a>
<p>Using Microsoft Visual Studio (<acronym>MVS</acronym>), one must build
<acronym>NCO</acronym> with the C++ compiler since MVS does not support C99.
Qt, a convenient integrated development environment, was used to convert
the project files to <acronym>MVS</acronym> format.
The Qt files themselves are distributed in the <samp>nco/qt</samp> directory.
</p>
<p>Using the freely available Cygwin (formerly gnu-win32) development
environment
<a name="DOCF4" href="#FOOT4"><sup>4</sup></a>, the compilation process is very similar to
installing <acronym>NCO</acronym> on a <acronym>UNIX</acronym> system.
<a name="index-preprocessor-tokens"></a>
<a name="index-Cygwin"></a>
<a name="index-gnu_002dwin32"></a>
<a name="index-WIN32"></a>
<a name="index-GNUmakefile"></a>
<a name="index-Makefile-1"></a>
<a name="index-f90"></a>
Set the <code>PVM_ARCH</code> preprocessor token to <code>WIN32</code>.
Note that defining <code>WIN32</code> has the side effect of disabling
Internet features of <acronym>NCO</acronym> (see below).
<acronym>NCO</acronym> should now build like it does on <acronym>UNIX</acronym>.
</p>
<a name="index-UNIX-1"></a>
<a name="index-getuid"></a>
<a name="index-gethostname"></a>
<a name="index-_003carpa_002fnameser_002eh_003e"></a>
<a name="index-_003cresolv_002eh_003e"></a>
<p>The least portable section of the code is the use of standard
<acronym>UNIX</acronym> and Internet protocols (e.g., <code>ftp</code>, <code>rcp</code>,
<code>scp</code>, <code>sftp</code>, <code>getuid</code>, <code>gethostname</code>, and header
files <samp><arpa/nameser.h></samp> and
<samp><resolv.h></samp>).
<a name="index-ftp"></a>
<a name="index-sftp"></a>
<a name="index-rcp"></a>
<a name="index-scp"></a>
<a name="index-SSH"></a>
<a name="index-remote-files"></a>
Fortunately, these <acronym>UNIX</acronym>-y calls are only invoked by the single
<acronym>NCO</acronym> subroutine which is responsible for retrieving files
stored on remote systems (see <a href="#Remote-storage">Remote storage</a>).
In order to support <acronym>NCO</acronym> on the Microsoft Windows platforms,
this single feature was disabled (on Windows <acronym>OS</acronym> only).
This was required by Cygwin 18.x<!-- /@w -->—newer versions of Cygwin may
support these protocols (let me know if this is the case).
The <acronym>NCO</acronym> operators should behave identically on Windows and
<acronym>UNIX</acronym> platforms in all other respects.
</p>
<a name="sym"></a> <!-- http://nco.sf.net/nco.html#sym --><hr>
<a name="Symbolic-Links"></a>
<div class="header">
<p>
Next: <a href="#Libraries" accesskey="n" rel="next">Libraries</a>, Previous: <a href="#Compatability" accesskey="p" rel="previous">Compatability</a>, Up: <a href="#Introduction" accesskey="u" rel="up">Introduction</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#General-Index" title="Index" rel="index">Index</a>]</p>
</div>
<a name="Symbolic-Links-1"></a>
<h3 class="section">1.4 Symbolic Links</h3>
<a name="index-symbolic-links"></a>
<p><acronym>NCO</acronym> relies on a common set of underlying algorithms.
To minimize duplication of source code, multiple operators sometimes
share the same underlying source.
This is accomplished by symbolic links from a single underlying
executable program to one or more invoked executable names.
For example, <code>nces</code> and <code>ncrcat</code> are symbolically linked
to the <code>ncra</code> executable.
The <code>ncra</code> executable behaves slightly differently based on its
invocation name (i.e., ‘<samp>argv[0]</samp>’), which can be
<code>nces</code>, <code>ncra</code>, or <code>ncrcat</code>.
Logically, these are three different operators that happen to share
the same executable.
</p>
<a name="index-Cygwin-1"></a>
<a name="index-synonym"></a>
<a name="index-pseudonym"></a>
<a name="index-_002d_002dpseudonym"></a>
<p>For historical reasons, and to be more user friendly, multiple synonyms
(or pseudonyms) may refer to the same operator invoked with different
switches.
For example, <code>ncdiff</code> is the same as <code>ncbo</code> and
<code>ncpack</code> is the same as <code>ncpdq</code>.
We implement the symbolic links and synonyms by the executing the
following <acronym>UNIX</acronym> commands in the directory where the
<acronym>NCO</acronym> executables are installed.
</p><div class="example">
<pre class="example">ln -s -f ncbo ncdiff # ncbo --op_typ='+'
ln -s -f ncra ncecat # ncra --pseudonym='ncecat'
ln -s -f ncra ncrcat # ncra --pseudonym='ncrcat'
ln -s -f ncbo ncadd # ncbo --op_typ='+'
ln -s -f ncbo ncsubtract # ncbo --op_typ='-'
ln -s -f ncbo ncmultiply # ncbo --op_typ='*'
ln -s -f ncbo ncdivide # ncbo --op_typ='/'
ln -s -f ncpdq ncpack # ncpdq
ln -s -f ncpdq ncunpack # ncpdq --unpack
# NB: Cygwin executable (and link) names have an '.exe' suffix, e.g.,
ln -s -f ncbo.exe ncdiff.exe
...
</pre></div>
<p>The imputed command called by the link is given after the comment.
As can be seen, some these links impute the passing of a command line
argument to further modify the behavior of the underlying executable.
For example, <code>ncdivide</code> is a pseudonym for
<code>ncbo --op_typ='/'</code>.
</p>
<a name="lbr"></a> <!-- http://nco.sf.net/nco.html#lbr --><hr>
<a name="Libraries"></a>
<div class="header">
<p>
Next: <a href="#netCDF2_002f3_002f4-and-HDF4_002f5-Support" accesskey="n" rel="next">netCDF2/3/4 and HDF4/5 Support</a>, Previous: <a href="#Symbolic-Links" accesskey="p" rel="previous">Symbolic Links</a>, Up: <a href="#Introduction" accesskey="u" rel="up">Introduction</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#General-Index" title="Index" rel="index">Index</a>]</p>
</div>
<a name="Libraries-1"></a>
<h3 class="section">1.5 Libraries</h3>
<a name="index-libraries"></a>
<a name="index-LD_005fLIBRARY_005fPATH"></a>
<a name="index-dynamic-linking"></a>
<a name="index-static-linking"></a>
<p>Like all executables, the <acronym>NCO</acronym> operators can be built using dynamic
linking.
<a name="index-performance"></a>
<a name="index-operator-speed"></a>
<a name="index-speed"></a>
<a name="index-execution-time"></a>
This reduces the size of the executable and can result in significant
performance enhancements on multiuser systems.
Unfortunately, if your library search path (usually the
<code>LD_LIBRARY_PATH</code> environment variable) is not set correctly, or if
the system libraries have been moved, renamed, or deleted since
<acronym>NCO</acronym> was installed, it is possible <acronym>NCO</acronym> operators
will fail with a message that they cannot find a dynamically loaded (aka
<em>shared object</em> or ‘<samp>.so</samp>’) library.
This will produce a distinctive error message, such as
‘<samp>ld.so.1: /usr/local/bin/nces: fatal: libsunmath.so.1: can't
open file: errno=2</samp>’.
If you received an error message like this, ask your system
administrator to diagnose whether the library is truly missing
<a name="DOCF5" href="#FOOT5"><sup>5</sup></a>, or whether you
simply need to alter your library search path.
As a final remedy, you may re-compile and install <acronym>NCO</acronym> with all
operators statically linked.
</p>
<hr>
<a name="netCDF2_002f3_002f4-and-HDF4_002f5-Support"></a>
<div class="header">
<p>
Next: <a href="#Help-Requests-and-Bug-Reports" accesskey="n" rel="next">Help Requests and Bug Reports</a>, Previous: <a href="#Libraries" accesskey="p" rel="previous">Libraries</a>, Up: <a href="#Introduction" accesskey="u" rel="up">Introduction</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#General-Index" title="Index" rel="index">Index</a>]</p>
</div>
<a name="netCDF2_002f3_002f4-and-HDF4_002f5-Support-1"></a>
<h3 class="section">1.6 netCDF2/3/4 and HDF4/5 Support</h3>
<a name="index-netCDF2"></a>
<a name="index-netCDF3"></a>
<p>netCDF version 2<!-- /@w --> was released in 1993.
<acronym>NCO</acronym> (specifically <code>ncks</code>) began soon after this in 1994.
netCDF 3.0<!-- /@w --> was released in 1996, and we were not exactly eager to
convert all code to the newer, less tested netCDF implementation.
One netCDF3<!-- /@w --> interface call (<code>nc_inq_libvers</code>) was added to
<acronym>NCO</acronym> in January, 1998, to aid in maintainance and debugging.
In March, 2001, the final <acronym>NCO</acronym> conversion to netCDF3<!-- /@w -->
was completed (coincidentally on the same day netCDF 3.5<!-- /@w --> was
released).
<acronym>NCO</acronym> versions 2.0<!-- /@w --> and higher are built with the
<code>-DNO_NETCDF_2</code> flag to ensure no netCDF2<!-- /@w --> interface calls
are used.
<a name="index-NO_005fNETCDF_005f2"></a>
</p>
<a name="index-HDF"></a>
<a name="index-Hierarchical-Data-Format"></a>
<a name="index-Mike-Folk"></a>
<p>However, the ability to compile <acronym>NCO</acronym> with only netCDF2<!-- /@w -->
calls is worth maintaining because <acronym>HDF</acronym> version 4<!-- /@w -->,
aka <acronym>HDF4</acronym> or simply <acronym>HDF</acronym>,
<a name="DOCF6" href="#FOOT6"><sup>6</sup></a>
(available from <a href="http://hdfgroup.org">HDF</a>)
supports only the netCDF2<!-- /@w --> library calls
(see <a href="http://hdfgroup.org/UG41r3_html/SDS_SD.fm12.html#47784">http://hdfgroup.org/UG41r3_html/SDS_SD.fm12.html#47784</a>).
There are two versions of <acronym>HDF</acronym>.
Currently <acronym>HDF</acronym> version 4.x<!-- /@w --> supports the full netCDF2<!-- /@w -->
<acronym>API</acronym> and thus <acronym>NCO</acronym> version 1.2.x<!-- /@w -->.
If <acronym>NCO</acronym> version 1.2.x<!-- /@w --> (or earlier) is built with only
netCDF2<!-- /@w --> calls then all <acronym>NCO</acronym> operators should work with
<acronym>HDF4</acronym> files as well as netCDF files
<a name="DOCF7" href="#FOOT7"><sup>7</sup></a>.
<a name="index-NETCDF2_005fONLY"></a>
The preprocessor token <code>NETCDF2_ONLY</code> exists
in <acronym>NCO</acronym> version 1.2.x<!-- /@w --> to eliminate all netCDF3<!-- /@w -->
calls.
Only versions of <acronym>NCO</acronym> numbered 1.2.x and earlier have this
capability.
</p>
<a name="index-Unidata-1"></a>
<a name="index-NCSA"></a>
<a name="index-netCDF4"></a>
<a name="index-HDF5"></a>
<p><acronym>HDF</acronym> version 5<!-- /@w --> became available in 1999, but did not
support netCDF (or, for that matter, Fortran) as of December 1999.
By early 2001, <acronym>HDF5</acronym> did support Fortran90.
Thanks to an <acronym>NSF</acronym>-funded “harmonization” partnership,
<acronym>HDF</acronym> began to fully support the netCDF3<!-- /@w --> read interface
(which is employed by <acronym>NCO</acronym> 2.x<!-- /@w --> and later).
In 2004, Unidata and <acronym>THG</acronym> began a project to implement
the <acronym>HDF5</acronym> features necessary to support the netCDF API.
<acronym>NCO</acronym> version 3.0.3 added support for reading/writing
netCDF4-formatted <acronym>HDF5</acronym> files in October, 2005.
See <a href="#File-Formats-and-Conversion">File Formats and Conversion</a> for more details.
</p>
<p>HDF support for netCDF was completed with HDF5 version
version 1.8<!-- /@w --> in 2007.
The netCDF front-end that uses this <acronym>HDF5</acronym> back-end
was completed and released soon after as netCDF version 4<!-- /@w -->.
Download it from the
<a href="http://my.unidata.ucar.edu/content/software/netcdf/netcdf-4">netCDF4</a>
website.
</p>
<a name="nco4"></a> <!-- http://nco.sf.net/nco.html#nco4 --><p><acronym>NCO</acronym> version 3.9.0, released in May, 2007, added support for
all netCDF4 atomic data types except <code>NC_STRING</code>.
Support for <code>NC_STRING</code>, including ragged arrays of strings,
was finally added in version 3.9.9, released in June, 2009.
Support for additional netCDF4 features has been incremental.
We add one netCDF4 feature at a time.
You must build <acronym>NCO</acronym> with netCDF4 to obtain this support.
</p>
<a name="index-NC_005fUBYTE"></a>
<a name="index-NC_005fUSHORT"></a>
<a name="index-NC_005fUINT"></a>
<a name="index-NC_005fINT64"></a>
<a name="index-NC_005fUINT64"></a>
<p>The main netCDF4 features that NCO currently supports are the new
atomic data types, Lempel-Ziv compression (deflation), and chunking.
The new atomic data types are <code>NC_UBYTE</code>, <code>NC_USHORT</code>,
<code>NC_UINT</code>, <code>NC_INT64</code>, and <code>NC_UINT64</code>.
Eight-byte integer support is an especially useful improvement from
netCDF3.
All <acronym>NCO</acronym> operators support these types, e.g., <code>ncks</code>
copies and prints them, <code>ncra</code> averages them, and
<code>ncap2</code> processes algebraic scripts with them.
<code>ncks</code> prints compression information, if any, to screen.
</p>
<a name="index-deflation"></a>
<p><acronym>NCO</acronym> version 3.9.1 (June, 2007) added support for netCDF4
Lempel-Ziv deflation.
Lempel-Ziv deflation is a lossless compression technique.
See <a href="#Deflation">Deflation</a> for more details.
</p>
<a name="index-chunking"></a>
<p><acronym>NCO</acronym> version 3.9.9 (June, 2009) added support for netCDF4
chunking in <code>ncks</code> and <code>ncecat</code>.
<acronym>NCO</acronym> version 4.0.4 (September, 2010) completed support for
netCDF4 chunking in the remaining operators.
See <a href="#Chunking">Chunking</a> for more details.
</p>
<a name="index-groups"></a>
<p><acronym>NCO</acronym> version 4.2.2 (October, 2012) added support for netCDF4
groups in <code>ncks</code> and <code>ncecat</code>.
Group support for these operators was complete (e.g., regular
expressions to select groups and Group Path Editing) as of
<acronym>NCO</acronym> version 4.2.6 (March, 2013).
See <a href="#Group-Path-Editing">Group Path Editing</a> for more details.
Group support for all other operators was finished in the
<acronym>NCO</acronym> version 4.3.x series completed in December, 2013.
</p>
<a name="index-broadcasting-groups"></a>
<p>Support for netCDF4 in the first arithmetic operator, <code>ncbo</code>,
was introduced in <acronym>NCO</acronym> version 4.3.0 (March, 2013).
<acronym>NCO</acronym> version 4.3.1 (May, 2013) completed this support and
introduced the first example of automatic group broadcasting.
See <a href="#ncbo-netCDF-Binary-Operator">ncbo netCDF Binary Operator</a> for more details.
</p>
<a name="index-HDF5-1"></a>
<a name="index-_002d4"></a>
<a name="index-_002d3"></a>
<p>netCDF4-enabled <acronym>NCO</acronym> handles netCDF3 files without change.
In addition, it automagically handles netCDF4 (<acronym>HDF5</acronym>) files:
If you feed <acronym>NCO</acronym> netCDF3 files, it produces netCDF3 output.
If you feed <acronym>NCO</acronym> netCDF4 files, it produces netCDF4 output.
Use the handy-dandy ‘<samp>-4</samp>’ switch to request netCDF4 output from
netCDF3 input, i.e., to convert netCDF3 to netCDF4.
See <a href="#File-Formats-and-Conversion">File Formats and Conversion</a> for more details.
</p>
<a name="hdf4"></a> <!-- http://nco.sf.net/nco.html#hdf4 -->
<a name="HDF4"></a> <!-- http://nco.sf.net/nco.html#HDF4 --><a name="index-HDF4"></a>
<a name="index-_002d_002dhdf4"></a>
<p>When linked to a netCDF library that was built with <acronym>HDF4</acronym>
support
<a name="DOCF8" href="#FOOT8"><sup>8</sup></a>,
<acronym>NCO</acronym> automatically supports reading <acronym>HDF4</acronym>
files and writing them as netCDF3/netCDF4/<acronym>HDF5</acronym> files.
<acronym>NCO</acronym> can only write through the netCDF <acronym>API</acronym>, which
can only write netCDF3/netCDF4/<acronym>HDF5</acronym> files.
So <acronym>NCO</acronym> can <em>read</em> <acronym>HDF4</acronym> files, perform
manipulations and calculations, and then <em>write</em> the results in
netCDF format.
</p>
<p>Full support for these features is forthcoming, yet support as of
December, 2013 is quite functional.
For best results install <acronym>NCO</acronym> versions 4.4.0 or later on top of
netCDF versions 4.3.1 or later.
Getting to this point has been an iterative effort where Unidata
improved netCDF library capabilities in response to our requests.
<acronym>NCO</acronym> versions 4.3.6 and earlier do not explicitly support
<acronym>HDF4</acronym>, yet should work with <acronym>HDF4</acronym> if compiled with
a version of netCDF (4.3.2 or later?) that does not unexpectedly die
when probing <acronym>HDF4</acronym> files with standard netCDF calls.
<acronym>NCO</acronym> versions 4.3.7–4.3.9 (October–December, 2013)
use a special flag to workaround netCDF <acronym>HDF4</acronym> issues.
The user must tell these versions of <acronym>NCO</acronym> that an input file is
<acronym>HDF4</acronym> format by using the ‘<samp>--hdf4</samp>’ switch.
</p>
<p>When compiled with netCDF version 4.3.1 (20140116) or later,
<acronym>NCO</acronym> versions 4.4.0 (January, 2014) and later more gracefully
handle <acronym>HDF4</acronym> files.
In particular, the ‘<samp>--hdf4</samp>’ switch is obsolete.
Current versions of <acronym>NCO</acronym> use netCDF to determine automatically
whether the underlying file is <acronym>HDF4</acronym>, and then take appropriate
precautions to avoid calls not yet supported by the netCDF4 subset
<acronym>HDF4</acronym>.
The ‘<samp>--hdf4</samp>’ switch is supported (for backwards compatibility) yet
redundant (i.e., does no harm) with current versions of <acronym>NCO</acronym>
and netCDF.
</p>
<p>Converting <acronym>HDF4</acronym> files to netCDF:
Since <acronym>NCO</acronym> reads <acronym>HDF4</acronym> files natively, it is now easy
to convert <acronym>HDF4</acronym> files to netCDF files directly, e.g.,
</p><div class="example">
<pre class="example">ncks fl.hdf fl.nc # Convert HDF4->netCDF4 (NCO 4.4.0+, netCDF 4.3.1+)
ncks --hdf4 fl.hdf fl.nc # Convert HDF4->netCDF4 (NCO 4.3.7-4.3.9)
</pre></div>
<p>The most efficient and accurate way to convert <acronym>HDF4</acronym> data to
netCDF format is to convert to netCDF4 using <acronym>NCO</acronym> as above.
It suffices when the data will only be processed by <acronym>NCO</acronym>, or
other netCDF4-aware tools.
However, many tools are not fully netCDF4-aware, and so conversion to
netCDF3 may be desirable.
</p>
<p>Obtaining a netCDF3 file from an <acronym>HDF4</acronym> is now easy, even though
the <acronym>HDF4</acronym> file may contain netCDF4 atomic types (e.g., unsigned
bytes, 64-bit integers):
</p><div class="example">
<pre class="example">ncks -3 fl.hdf fl.nc # HDF4->netCDF3 (NCO 4.4.0+, netCDF 4.3.1+)
ncks -7 -L 1 fl.hdf fl.nc # HDF4->netCDF4 (NCO 4.4.0+, netCDF 4.3.1+)
ncks --hdf4 -3 fl.hdf fl.nc # HDF4->netCDF3 (netCDF 4.3.0-)
ncks --hdf4 -7 fl.hdf fl.nc # HDF4->netCDF4 classic (netCDF 4.3.0-)
</pre></div>
<p>As of <acronym>NCO</acronym> version 4.4.0 (January, 2014), these commands work
with netCDF4 atomic types
<a name="DOCF9" href="#FOOT9"><sup>9</sup></a>.
Many <acronym>HDF4</acronym> producers (<acronym>NASA</acronym>!) love to use netCDF4
types, e.g., unsigned bytes.
</p>
<a name="index-RPM"></a>
<a name="index-Debian"></a>
<p>As of 2012, netCDF4 is relatively stable software.
Problems with netCDF4 and <acronym>HDF</acronym> libraries have mainly been fixed.
Binary <acronym>NCO</acronym> distributions shipped as <acronym>RPM</acronym>s and as debs
have used the netCDF4 library since 2010 and 2011, respectively.
</p>
<a name="index-NETCDF4_005fROOT"></a>
<p>One must often build <acronym>NCO</acronym> from source to obtain netCDF4
support.
Typically, one specifies the root of the netCDF4
installation directory. Do this with the <code>NETCDF4_ROOT</code> variable.
Then use your preferred <acronym>NCO</acronym> build mechanism, e.g.,
</p><div class="example">
<pre class="example">export NETCDF4_ROOT=/usr/local/netcdf4 # Set netCDF4 location
cd ~/nco;./configure --enable-netcdf4 # Configure mechanism -or-
cd ~/nco/bld;./make NETCDF4=Y allinone # Old Makefile mechanism
</pre></div>
<p>We carefully track the netCDF4 releases, and keep the netCDF4 atomic
type support and other features working.
Our long term goal is to utilize more of the extensive new netCDF4
feature set. The next major netCDF4 feature we are likely to utilize
is parallel I/O. We will enable this in the <acronym>MPI</acronym> netCDF
operators.
</p>
<a name="help"></a> <!-- http://nco.sf.net/nco.html#help -->
<a name="hlp"></a> <!-- http://nco.sf.net/nco.html#hlp -->
<a name="bug"></a> <!-- http://nco.sf.net/nco.html#bug --><hr>
<a name="Help-Requests-and-Bug-Reports"></a>
<div class="header">
<p>
Previous: <a href="#netCDF2_002f3_002f4-and-HDF4_002f5-Support" accesskey="p" rel="previous">netCDF2/3/4 and HDF4/5 Support</a>, Up: <a href="#Introduction" accesskey="u" rel="up">Introduction</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#General-Index" title="Index" rel="index">Index</a>]</p>
</div>
<a name="Help-Requests-and-Bug-Reports-1"></a>
<h3 class="section">1.7 Help Requests and Bug Reports</h3>
<a name="index-reporting-bugs"></a>
<a name="index-bugs_002c-reporting"></a>
<a name="index-core-dump"></a>
<a name="index-help"></a>
<a name="index-features_002c-requesting"></a>
<p>We generally receive three categories of mail from users: help requests,
bug reports, and feature requests.
Notes saying the equivalent of "Hey, <acronym>NCO</acronym> continues to work
great and it saves me more time everyday than it took to write this
note" are a distant fourth.
</p>
<p>There is a different protocol for each type of request.
The preferred etiquette for all communications is via <acronym>NCO</acronym>
Project Forums.
Do not contact project members via personal e-mail unless your request
comes with money or you have damaging information about our personal
lives.
<em>Please use the Forums</em>—they preserve a record of the questions
and answers so that others can learn from our exchange.
Also, since <acronym>NCO</acronym> is government-funded, this record helps us
provide program officers with information they need to evaluate our
project.
</p>
<p>Before posting to the <acronym>NCO</acronym> forums described below, you might
first <a href="https://sf.net/account/register.php">register</a>
your name and email address with SourceForge.net or else all of your
postings will be attributed to "nobody".
Once registered you may choose to "monitor" any forum and to receive
(or not) email when there are any postings including responses to your
questions.
We usually reply to the forum message, not to the original poster.
</p>
<p>If you want us to include a new feature in <acronym>NCO</acronym>, check first to
see if that feature is already on the <a href="file:./TODO">TODO</a> list.
If it is, why not implement that feature yourself and send us the patch?
If the feature is not yet on the list, then send a note to the
<a href="http://sf.net/projects/nco/forums/forum/9829">NCO Discussion forum</a>.
</p>
<p>Read the manual before reporting a bug or posting a help request.
Sending questions whose answers are not in the manual is the best
way to motivate us to write more documentation.
We would also like to accentuate the contrapositive of this statement.
If you think you have found a real bug <em>the most helpful thing you
can do is simplify the problem to a manageable size and then report it</em>.
The first thing to do is to make sure you are running the latest
publicly released version of <acronym>NCO</acronym>.
</p>
<p>Once you have read the manual, if you are still unable to get
<acronym>NCO</acronym> to perform a documented function, submit a help request.
Follow the same procedure as described below for reporting bugs
(after all, it might be a bug).
<a name="index-debugging"></a>
<a name="index-_002dr"></a>
<a name="index-_002dD"></a>
That is, describe what you are trying to do, and include the complete
commands (run with ‘<samp>-D 5</samp>’), error messages, and version of
<acronym>NCO</acronym> (with ‘<samp>-r</samp>’).
Post your help request to the
<a href="http://sf.net/projects/nco/forums/forum/9830">NCO Help forum</a>.
</p>
<p>If you think you used the right command when <acronym>NCO</acronym> misbehaves,
then you might have found a bug.
Incorrect numerical answers are the highest priority.
We usually fix those within one or two days.
Core dumps and sementation violations receive lower priority.
They are always fixed, eventually.
</p>
<p>How do you simplify a problem that reveal a bug?
Cut out extraneous variables, dimensions, and metadata from the
offending files and re-run the command until it no longer breaks.
Then back up one step and report the problem.
Usually the file(s) will be very small, i.e., one variable with one or
two small dimensions ought to suffice.
<a name="dbg"></a> <!-- http://nco.sf.net/nco.html#dbg -->
<a name="-D"></a> <!-- http://nco.sf.net/nco.html#-D --><a name="index-_002dr-1"></a>
<a name="index-_002d_002drevision"></a>
<a name="index-_002d_002dversion"></a>
<a name="index-_002d_002dvrs"></a>
<a name="index-_002dD-debug_002dlevel"></a>
<a name="index-_002d_002ddebug_002dlevel-debug_002dlevel"></a>
<a name="index-_002d_002ddbg_005flvl-debug_002dlevel"></a>
<a name="index-debug_002dlevel"></a>
<a name="index-dbg_005flvl"></a>
Run the operator with ‘<samp>-r</samp>’ and then run the command with
‘<samp>-D 5</samp>’ to increase the verbosity of the debugging output.
It is very important that your report contain the exact error messages
and compile-time environment.
Include a copy of your sample input file, or place one on a
publically accessible location, of the file(s).
Post the full bug report to the
<a href="http://sf.net/bugs/?group_id=3331">NCO Project buglist</a>.
</p>
<a name="index-installation-1"></a>
<a name="index-autoconf"></a>
<a name="index-nco_002econfigure_002e_0024_007bGNU_005fTRP_007d_002efoo"></a>
<a name="index-nco_002econfig_002elog_002e_0024_007bGNU_005fTRP_007d_002efoo"></a>
<a name="index-nco_002emake_002e_0024_007bGNU_005fTRP_007d_002efoo"></a>
<a name="index-config_002eguess"></a>
<a name="index-configure_002eeg"></a>
<p>Build failures count as bugs.
Our limited machine access means we cannot fix all build failures.
The information we need to diagnose, and often fix, build failures
are the three files output by <acronym>GNU</acronym> build tools,
<samp>nco.config.log.${GNU_TRP}.foo</samp>,
<samp>nco.configure.${GNU_TRP}.foo</samp>,
and <samp>nco.make.${GNU_TRP}.foo</samp>.
The file <samp>configure.eg</samp> shows how to produce these files.
Here <code>${GNU_TRP}</code> is the "<acronym>GNU</acronym> architecture triplet",
the <var>chip-vendor-OS</var> string returned by <samp>config.guess</samp>.
Please send us your improvements to the examples supplied in
<samp>configure.eg</samp>.
<a name="index-regressions-archive"></a>
The regressions archive at <a href="http://dust.ess.uci.edu/nco/rgr">http://dust.ess.uci.edu/nco/rgr</a>
contains the build output from our standard test systems.
You may find you can solve the build problem yourself by examining the
differences between these files and your own.
</p>
<a name="str"></a> <!-- http://nco.sf.net/nco.html#str --><hr>
<a name="Strategies"></a>
<div class="header">
<p>
Next: <a href="#Common-features" accesskey="n" rel="next">Common features</a>, Previous: <a href="#Introduction" accesskey="p" rel="previous">Introduction</a>, Up: <a href="#Top" accesskey="u" rel="up">Top</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#General-Index" title="Index" rel="index">Index</a>]</p>
</div>
<a name="Operator-Strategies"></a>
<h2 class="chapter">2 Operator Strategies</h2>
<table class="menu" border="0" cellspacing="0">
<tr><td align="left" valign="top">• <a href="#Philosophy" accesskey="1">Philosophy</a>:</td><td> </td><td align="left" valign="top">
</td></tr>
<tr><td align="left" valign="top">• <a href="#Climate-Model-Paradigm" accesskey="2">Climate Model Paradigm</a>:</td><td> </td><td align="left" valign="top">
</td></tr>
<tr><td align="left" valign="top">• <a href="#Temporary-Output-Files" accesskey="3">Temporary Output Files</a>:</td><td> </td><td align="left" valign="top">
</td></tr>
<tr><td align="left" valign="top">• <a href="#Appending-Variables" accesskey="4">Appending Variables</a>:</td><td> </td><td align="left" valign="top">
</td></tr>
<tr><td align="left" valign="top">• <a href="#Simple-Arithmetic-and-Interpolation" accesskey="5">Simple Arithmetic and Interpolation</a>:</td><td> </td><td align="left" valign="top">
</td></tr>
<tr><td align="left" valign="top">• <a href="#Statistics-vs_002e-Concatenation" accesskey="6">Statistics vs. Concatenation</a>:</td><td> </td><td align="left" valign="top">
</td></tr>
<tr><td align="left" valign="top">• <a href="#Large-Numbers-of-Files" accesskey="7">Large Numbers of Files</a>:</td><td> </td><td align="left" valign="top">
</td></tr>
<tr><td align="left" valign="top">• <a href="#Large-Datasets" accesskey="8">Large Datasets</a>:</td><td> </td><td align="left" valign="top">
</td></tr>
<tr><td align="left" valign="top">• <a href="#Memory-Requirements" accesskey="9">Memory Requirements</a>:</td><td> </td><td align="left" valign="top">
</td></tr>
<tr><td align="left" valign="top">• <a href="#Performance">Performance</a>:</td><td> </td><td align="left" valign="top">
</td></tr>
</table>
<a name="phl"></a> <!-- http://nco.sf.net/nco.html#phl --><hr>
<a name="Philosophy"></a>
<div class="header">
<p>
Next: <a href="#Climate-Model-Paradigm" accesskey="n" rel="next">Climate Model Paradigm</a>, Previous: <a href="#Strategies" accesskey="p" rel="previous">Strategies</a>, Up: <a href="#Strategies" accesskey="u" rel="up">Strategies</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#General-Index" title="Index" rel="index">Index</a>]</p>
</div>
<a name="Philosophy-1"></a>
<h3 class="section">2.1 Philosophy</h3>
<a name="index-philosophy"></a>
<a name="index-climate-model"></a>
<p>The main design goal is command line operators which perform useful,
scriptable operations on netCDF files.
Many scientists work with models and observations which produce too much
data to analyze in tabular format.
Thus, it is often natural to reduce and massage this raw or primary
level data into summary, or second level data, e.g., temporal or spatial
averages.
These second level data may become the inputs to graphical and
statistical packages, and are often more suitable for archival and
dissemination to the scientific community.
<acronym>NCO</acronym> performs a suite of operations useful in manipulating data
from the primary to the second level state.
<a name="index-IDL"></a>
<a name="index-Matlab"></a>
<a name="index-NCL"></a>
<a name="index-Perl"></a>
<a name="index-Yorick"></a>
Higher level interpretive languages (e.g., <acronym>IDL</acronym>, Yorick,
Matlab, <acronym>NCL</acronym>, Perl, Python),
and lower level compiled languages (e.g., C, Fortran) can always perform
any task performed by <acronym>NCO</acronym>, but often with more overhead.
NCO, on the other hand, is limited to a much smaller set of arithmetic
and metadata operations than these full blown languages.
</p>
<a name="index-command-line-switches"></a>
<p>Another goal has been to implement enough command line switches so that
frequently used sequences of these operators can be executed from a
shell script or batch file.
Finally, <acronym>NCO</acronym> was written to consume the absolute minimum
amount of system memory required to perform a given job.
The arithmetic operators are extremely efficient; their exact memory
usage is detailed in <a href="#Memory-Requirements">Memory Requirements</a>.
</p>
<a name="clm"></a> <!-- http://nco.sf.net/nco.html#clm --><hr>
<a name="Climate-Model-Paradigm"></a>
<div class="header">
<p>
Next: <a href="#Temporary-Output-Files" accesskey="n" rel="next">Temporary Output Files</a>, Previous: <a href="#Philosophy" accesskey="p" rel="previous">Philosophy</a>, Up: <a href="#Strategies" accesskey="u" rel="up">Strategies</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#General-Index" title="Index" rel="index">Index</a>]</p>
</div>
<a name="Climate-Model-Paradigm-1"></a>
<h3 class="section">2.2 Climate Model Paradigm</h3>
<a name="index-climate-model-1"></a>
<a name="index-NCAR"></a>
<a name="index-GCM"></a>
<p><acronym>NCO</acronym> was developed at <acronym>NCAR</acronym> to aid analysis and
manipulation of datasets produced by General Circulation Models
(<acronym>GCM</acronym>s).
<acronym>GCM</acronym> datasets share many features with other gridded scientific
datasets and so provide a useful paradigm for the explication of the
<acronym>NCO</acronym> operator set.
Examples in this manual use a <acronym>GCM</acronym> paradigm because latitude,
longitude, time, temperature and other fields related to our natural
environment are as easy to visualize for the layman as the expert.
</p>
<a name="out"></a> <!-- http://nco.sf.net/nco.html#out --><hr>
<a name="Temporary-Output-Files"></a>
<div class="header">
<p>
Next: <a href="#Appending-Variables" accesskey="n" rel="next">Appending Variables</a>, Previous: <a href="#Climate-Model-Paradigm" accesskey="p" rel="previous">Climate Model Paradigm</a>, Up: <a href="#Strategies" accesskey="u" rel="up">Strategies</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#General-Index" title="Index" rel="index">Index</a>]</p>
</div>
<a name="Temporary-Output-Files-1"></a>
<h3 class="section">2.3 Temporary Output Files</h3>
<a name="index-data-safety"></a>
<a name="index-error-tolerance"></a>
<a name="index-safeguards"></a>
<a name="index-temporary-output-files"></a>
<a name="index-temporary-files"></a>
<p><acronym>NCO</acronym> operators are designed to be reasonably fault tolerant, so
that a system failure or user-abort of the operation (e.g., with
<kbd>C-c</kbd>) does not cause loss of data.
The user-specified <var>output-file</var> is only created upon successful
completion of the operation
<a name="DOCF10" href="#FOOT10"><sup>10</sup></a>.
This is accomplished by performing all operations in a temporary copy
of <var>output-file</var>.
The name of the temporary output file is constructed by appending
<code>.pid<var><process ID></var>.<var><operator name></var>.tmp</code> to the
user-specified <var>output-file</var> name.
When the operator completes its task with no fatal errors, the temporary
output file is moved to the user-specified <var>output-file</var>.
This imbues the process with fault-tolerance since fatal error
(e.g., disk space fills up) affect only the temporary output file,
leaving the final output file not created if it did not already exist.
Note the construction of a temporary output file uses more disk space
than just overwriting existing files “in place” (because there may be
two copies of the same file on disk until the <acronym>NCO</acronym> operation
successfully concludes and the temporary output file overwrites the
existing <var>output-file</var>).
<a name="index-performance-1"></a>
<a name="index-operator-speed-1"></a>
<a name="index-speed-1"></a>
<a name="index-execution-time-1"></a>
Also, note this feature increases the execution time of the operator
by approximately the time it takes to copy the <var>output-file</var>
<a name="DOCF11" href="#FOOT11"><sup>11</sup></a>.
Finally, note this fault-tolerant feature allows the <var>output-file</var>
to be the same as the <var>input-file</var> without any danger of
“overlap”.
</p>
<a name="tmp_fl"></a> <!-- http://nco.sf.net/nco.html#tmp_fl -->
<a name="no_tmp_fl"></a> <!-- http://nco.sf.net/nco.html#no_tmp_fl -->
<a name="wrt_tmp_fl"></a> <!-- http://nco.sf.net/nco.html#wrt_tmp_fl --><a name="index-_002d_002dno_005ftmp_005ffl"></a>
<a name="index-_002d_002dwrt_005ftmp_005ffl"></a>
<a name="index-_002d_002dwrite_005ftmp_005ffl"></a>
<a name="index-_002d_002dcreate_005fram"></a>
<a name="index-_002d_002dopen_005fram"></a>
<a name="index-RAM-disks"></a>
<a name="index-RAM-files"></a>
<p>Over time many “power users” have requested a way to turn-off the
fault-tolerance safety feature of automatically creating a temporary
file.
Often these users build and execute production data analysis scripts
that are repeated frequently on large datasets.
Obviating an extra file write can then conserve significant disk space
and time.
For this purpose <acronym>NCO</acronym> has, since version 4.2.1 in August, 2012,
made configurable the controls over temporary file creation.
The ‘<samp>--wrt_tmp_fl</samp>’ and equivalent ‘<samp>--write_tmp_fl</samp>’ switches
ensure <acronym>NCO</acronym> writes output to an intermediate temporary file.
This is and has always been the default behavior so there is currently
no need to specify these switches.
However, the default may change some day, especially since writing to
RAM disks (see <a href="#RAM-disks">RAM disks</a>) may some day become the default.
The ‘<samp>--no_tmp_fl</samp>’ switch causes <acronym>NCO</acronym> to write directly to
the final output file instead of to an intermediate temporary file.
“Power users” may wish to invoke this switch to increase performance
(i.e., reduce wallclock time) when manipulating large files.
When eschewing temporary files, users may forsake the ability to have
the same name for both <var>output-file</var> and <var>input-file</var> since, as
described above, the temporary file prevented overlap issues.
However, if the user creates the output file in <acronym>RAM</acronym> (see <a href="#RAM-disks">RAM disks</a>)
then it is still possible to have the same name for both
<var>output-file</var> and <var>input-file</var>.
</p><div class="example">
<pre class="example">ncks in.nc out.nc # Default: create out.pid.tmp.nc then move to out.nc
ncks --wrt_tmp_fl in.nc out.nc # Same as default
ncks --no_tmp_fl in.nc out.nc # Create out.nc directly on disk
ncks --no_tmp_fl in.nc in.nc # ERROR-prone! Overwrite in.nc with itself
ncks --create_ram --no_tmp_fl in.nc in.nc # Create in RAM, write to disk
ncks --open_ram --no_tmp_fl in.nc in.nc # Read into RAM, write to disk
</pre></div>
<p>There is no reason to expect the fourth example to work.
The behavior of overwriting a file while reading from the same file is
undefined, much as is the shell command ‘<samp>cat foo > foo</samp>’.
Although it may “work” in some cases, it is unreliable.
One way around this is to use ‘<samp>--create_ram</samp>’ so that the
output file is not written to disk until the input file is closed,
See <a href="#RAM-disks">RAM disks</a>.
However, as of 20130328, the behavior of the ‘<samp>--create_ram</samp>’ and
‘<samp>--open_ram</samp>’ examples has not been thoroughly tested.
</p>
<p>The <acronym>NCO</acronym> authors have seen compelling use cases for utilizing
the <acronym>RAM</acronym> switches, though not (yet) for combining them with
‘<samp>--no_tmp_fl</samp>’.
<acronym>NCO</acronym> implements both options because they are largely
independent of eachother.
It is up to “power users” to discover which best fit their needs.
We welcome accounts of your experiences posted to the forums.
</p>
<a name="-A"></a> <!-- http://nco.sf.net/nco.html#-A -->
<a name="-O"></a> <!-- http://nco.sf.net/nco.html#-O --><a name="index-_002dA"></a>
<a name="index-_002dO"></a>
<a name="index-_002d_002dapn"></a>
<a name="index-_002d_002dappend"></a>
<a name="index-_002d_002dovr"></a>
<a name="index-_002d_002doverwrite"></a>
<a name="index-overwriting-files"></a>
<a name="index-appending-variables"></a>
<a name="index-appending-to-files"></a>
<p>Other safeguards exist to protect the user from inadvertently
overwriting data.
If the <var>output-file</var> specified for a command is a pre-existing file,
then the operator will prompt the user whether to overwrite (erase) the
existing <var>output-file</var>, attempt to append to it, or abort the
operation.
However, in processing large amounts of data, too many interactive
questions slows productivity.
Therefore <acronym>NCO</acronym> also implements two ways to override its own
safety features, the ‘<samp>-O</samp>’ and ‘<samp>-A</samp>’ switches.
Specifying ‘<samp>-O</samp>’ tells the operator to overwrite any existing
<var>output-file</var> without prompting the user interactively.
Specifying ‘<samp>-A</samp>’ tells the operator to attempt to append to any
existing <var>output-file</var> without prompting the user interactively.
These switches are useful in batch environments because they suppress
interactive keyboard input.
</p>
<a name="apn"></a> <!-- http://nco.sf.net/nco.html#apn -->
<a name="append"></a> <!-- http://nco.sf.net/nco.html#append --><hr>
<a name="Appending-Variables"></a>
<div class="header">
<p>
Next: <a href="#Simple-Arithmetic-and-Interpolation" accesskey="n" rel="next">Simple Arithmetic and Interpolation</a>, Previous: <a href="#Temporary-Output-Files" accesskey="p" rel="previous">Temporary Output Files</a>, Up: <a href="#Strategies" accesskey="u" rel="up">Strategies</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#General-Index" title="Index" rel="index">Index</a>]</p>
</div>
<a name="Appending-Variables-1"></a>
<h3 class="section">2.4 Appending Variables</h3>
<p>Adding variables from one file to another is often desirable.
<a name="index-concatenation"></a>
<a name="index-appending-variables-1"></a>
<a name="index-merging-files"></a>
<a name="index-pasting-variables"></a>
This is referred to as <em>appending</em>, although some prefer the
terminology <em>merging</em> <a name="DOCF12" href="#FOOT12"><sup>12</sup></a> or <em>pasting</em>.
Appending is often confused with what <acronym>NCO</acronym> calls
<em>concatenation</em>.
<a name="index-record-dimension"></a>
In <acronym>NCO</acronym>, concatenation refers to splicing a variable
along the record dimension.
The length along the record dimension of the output is the sum of the
lengths of the input files.
Appending, on the other hand, refers to copying a variable from one file
to another file which may or may not already contain the variable
<a name="DOCF13" href="#FOOT13"><sup>13</sup></a>.
<acronym>NCO</acronym> can append or concatenate just one variable, or all the
variables in a file at the same time.
</p>
<p>In this sense, <code>ncks</code> can append variables from one file to
another file.
This capability is invoked by naming two files on the command line,
<var>input-file</var> and <var>output-file</var>.
When <var>output-file</var> already exists, the user is prompted whether to
<em>overwrite</em>, <em>append/replace</em>, or <em>exit</em> from the command.
Selecting <em>overwrite</em> tells the operator to erase the existing
<var>output-file</var> and replace it with the results of the operation.
Selecting <em>exit</em> causes the operator to exit—the <var>output-file</var>
will not be touched in this case.
Selecting <em>append/replace</em> causes the operator to attempt to place
the results of the operation in the existing <var>output-file</var>,
See <a href="#ncks-netCDF-Kitchen-Sink">ncks netCDF Kitchen Sink</a>.
</p>
<a name="unn"></a> <!-- http://nco.sf.net/nco.html#unn --><a name="index-union-of-files"></a>
<a name="index-disjoint-files"></a>
<p>The simplest way to create the union of two files is
</p><div class="example">
<pre class="example">ncks -A fl_1.nc fl_2.nc
</pre></div>
<p>This puts the contents of <samp>fl_1.nc</samp> into <samp>fl_2.nc</samp>.
The ‘<samp>-A</samp>’ is optional.
On output, <samp>fl_2.nc</samp> is the union of the input files,
regardless of whether they share dimensions and variables,
or are completely disjoint.
The append fails if the input files have differently named record
dimensions (since netCDF supports only one), or have dimensions of the
same name but different sizes.
</p>
<a name="bnr"></a> <!-- http://nco.sf.net/nco.html#bnr --><hr>
<a name="Simple-Arithmetic-and-Interpolation"></a>
<div class="header">
<p>
Next: <a href="#Statistics-vs_002e-Concatenation" accesskey="n" rel="next">Statistics vs. Concatenation</a>, Previous: <a href="#Appending-Variables" accesskey="p" rel="previous">Appending Variables</a>, Up: <a href="#Strategies" accesskey="u" rel="up">Strategies</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#General-Index" title="Index" rel="index">Index</a>]</p>
</div>
<a name="Simple-Arithmetic-and-Interpolation-1"></a>
<h3 class="section">2.5 Simple Arithmetic and Interpolation</h3>
<p>Users comfortable with <acronym>NCO</acronym> semantics may find it easier to
perform some simple mathematical operations in <acronym>NCO</acronym> rather than
higher level languages.
<code>ncbo</code> (see <a href="#ncbo-netCDF-Binary-Operator">ncbo netCDF Binary Operator</a>) does file
addition, subtraction, multiplication, division, and broadcasting.
It even does group broadcasting.
<code>ncflint</code> (see <a href="#ncflint-netCDF-File-Interpolator">ncflint netCDF File Interpolator</a>) does
file addition, subtraction, multiplication and interpolation.
Sequences of these commands can accomplish simple yet powerful
operations from the command line.
</p>
<a name="statisticians"></a> <!-- http://nco.sf.net/nco.html#statisticians -->
<a name="averagers"></a> <!-- http://nco.sf.net/nco.html#averagers --><hr>
<a name="Statistics-vs_002e-Concatenation"></a>
<div class="header">
<p>
Next: <a href="#Large-Numbers-of-Files" accesskey="n" rel="next">Large Numbers of Files</a>, Previous: <a href="#Simple-Arithmetic-and-Interpolation" accesskey="p" rel="previous">Simple Arithmetic and Interpolation</a>, Up: <a href="#Strategies" accesskey="u" rel="up">Strategies</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#General-Index" title="Index" rel="index">Index</a>]</p>
</div>
<a name="Statistics-vs_002e-Concatenation-1"></a>
<h3 class="section">2.6 Statistics vs. Concatenation</h3>
<a name="sym_ncea"></a> <!-- http://nco.sf.net/nco.html#sym_ncea -->
<a name="sym_nces"></a> <!-- http://nco.sf.net/nco.html#sym_nces -->
<a name="sym_ncrcat"></a> <!-- http://nco.sf.net/nco.html#sym_ncrcat --><a name="index-symbolic-links-1"></a>
<p>The most frequently used operators of <acronym>NCO</acronym> are probably the
<em>statisticians</em> (i.e., tools that do statistics) and concatenators.
Because there are so many types of statistics like averaging (e.g.,
across files, within a file, over the record dimension, over other
dimensions, with or without weights and masks) and of concatenating
(across files, along the record dimension, along other dimensions),
there are currently no fewer than five operators which tackle these two
purposes: <code>ncra</code>, <code>nces</code>, <code>ncwa</code>,
<code>ncrcat</code>, and <code>ncecat</code>.
These operators do share many capabilities <a name="DOCF14" href="#FOOT14"><sup>14</sup></a>, though each has its unique specialty.
Two of these operators, <code>ncrcat</code> and <code>ncecat</code>,
concatenate hyperslabs across files.
The other two operators, <code>ncra</code> and <code>nces</code>, compute
statistics across (and/or within) files
<a name="DOCF15" href="#FOOT15"><sup>15</sup></a>.
First, let’s describe the concatenators, then the statistics tools.
</p>
<table class="menu" border="0" cellspacing="0">
<tr><td align="left" valign="top">• <a href="#Concatenation" accesskey="1">Concatenation</a>:</td><td> </td><td align="left" valign="top">
</td></tr>
<tr><td align="left" valign="top">• <a href="#Averaging" accesskey="2">Averaging</a>:</td><td> </td><td align="left" valign="top">
</td></tr>
<tr><td align="left" valign="top">• <a href="#Interpolating" accesskey="3">Interpolating</a>:</td><td> </td><td align="left" valign="top">
</td></tr>
</table>
<a name="cnc"></a> <!-- http://nco.sf.net/nco.html#cnc --><hr>
<a name="Concatenation"></a>
<div class="header">
<p>
Next: <a href="#Averaging" accesskey="n" rel="next">Averaging</a>, Previous: <a href="#Statistics-vs_002e-Concatenation" accesskey="p" rel="previous">Statistics vs. Concatenation</a>, Up: <a href="#Statistics-vs_002e-Concatenation" accesskey="u" rel="up">Statistics vs. Concatenation</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#General-Index" title="Index" rel="index">Index</a>]</p>
</div>
<a name="Concatenators-ncrcat-and-ncecat"></a>
<h4 class="subsection">2.6.1 Concatenators <code>ncrcat</code> and <code>ncecat</code></h4>
<a name="index-ncecat"></a>
<a name="index-ncrcat"></a>
<p>Joining together independent files along a common record dimension is
called <em>concatenation</em>.
<code>ncrcat</code> is designed for concatenating record variables, while
<code>ncecat</code> is designed for concatenating fixed length variables.
Consider five files, <samp>85.nc</samp>, <samp>86.nc</samp>,
… <samp>89.nc</samp><!-- /@w --> each containing a year’s worth of data.
Say you wish to create from them a single file, <samp>8589.nc</samp>
containing all the data, i.e., spanning all five years.
If the annual files make use of the same record variable, then
<code>ncrcat</code> will do the job nicely with, e.g.,
<code>ncrcat 8?.nc 8589.nc</code>.
The number of records in the input files is arbitrary and can vary from
file to file.
See <a href="#ncrcat-netCDF-Record-Concatenator">ncrcat netCDF Record Concatenator</a>, for a complete description of
<code>ncrcat</code>.
</p>
<p>However, suppose the annual files have no record variable, and thus
their data are all fixed length.
<a name="index-ensemble"></a>
<a name="index-climate-model-2"></a>
For example, the files may not be conceptually sequential, but rather
members of the same group, or <em>ensemble</em>.
Members of an ensemble may have no reason to contain a record dimension.
<code>ncecat</code> will create a new record dimension (named <var>record</var>
by default) with which to glue together the individual files into the
single ensemble file.
If <code>ncecat</code> is used on files which contain an existing record
dimension, that record dimension is converted to a fixed-length
dimension of the same name and a new record dimension (named
<code>record</code>) is created.
Consider five realizations, <samp>85a.nc</samp>, <samp>85b.nc</samp>,
… <samp>85e.nc</samp><!-- /@w --> of 1985 predictions from the same climate
model.
Then <code>ncecat 85?.nc 85_ens.nc</code> glues together the individual
realizations into the single file, <samp>85_ens.nc</samp>.
If an input variable was dimensioned [<code>lat</code>,<code>lon</code>], it will
have dimensions [<code>record</code>,<code>lat</code>,<code>lon</code>] in the output file.
A restriction<!-- /@w --> of <code>ncecat</code> is that the hyperslabs of the
processed variables must be the same from file to file.
Normally this means all the input files are the same size, and contain
data on different realizations of the same variables.
See <a href="#ncecat-netCDF-Ensemble-Concatenator">ncecat netCDF Ensemble Concatenator</a>, for a complete description
of <code>ncecat</code>.
</p>
<a name="index-ncpdq"></a>
<a name="dmn_cat"></a> <!-- http://nco.sf.net/nco.html#dmn_cat --><p><code>ncpdq</code> makes it possible to concatenate files along any
dimension, not just the record dimension.
First, use <code>ncpdq</code> to convert the dimension to be concatenated
(i.e., extended with data from other files) into the record dimension.
Second, use <code>ncrcat</code> to concatenate these files.
Finally, if desirable, use <code>ncpdq</code> to revert to the original
dimensionality.
As a concrete example, say that files <samp>x_01.nc</samp>, <samp>x_02.nc</samp>,
… <samp><span class="nolinebreak">x_10.nc</span></samp><!-- /@w --> contain time-evolving datasets from spatially
adjacent regions.
The time and spatial coordinates are <code>time</code> and <code>x</code>, respectively.
Initially the record dimension is <code>time</code>.
Our goal is to create a single file that contains joins all the
spatially adjacent regions into one single time-evolving dataset.
</p><div class="example">
<pre class="example">for idx in 01 02 03 04 05 06 07 08 09 10; do # Bourne Shell
ncpdq -a x,time x_${idx}.nc foo_${idx}.nc # Make x record dimension
done
ncrcat foo_??.nc out.nc # Concatenate along x
ncpdq -a time,x out.nc out.nc # Revert to time as record dimension
</pre></div>
<p>Note that <code>ncrcat</code> will not concatenate fixed-length variables,
whereas <code>ncecat</code> concatenates both fixed-length and record
variables along a new record variable.
To conserve system memory, use <code>ncrcat</code> where possible.
</p>
<a name="avg"></a> <!-- http://nco.sf.net/nco.html#avg --><hr>
<a name="Averaging"></a>
<div class="header">
<p>
Next: <a href="#Interpolating" accesskey="n" rel="next">Interpolating</a>, Previous: <a href="#Concatenation" accesskey="p" rel="previous">Concatenation</a>, Up: <a href="#Statistics-vs_002e-Concatenation" accesskey="u" rel="up">Statistics vs. Concatenation</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#General-Index" title="Index" rel="index">Index</a>]</p>
</div>
<a name="Averagers-nces_002c-ncra_002c-and-ncwa"></a>
<h4 class="subsection">2.6.2 Averagers <code>nces</code>, <code>ncra</code>, and <code>ncwa</code></h4>
<a name="index-nces"></a>
<a name="index-ncra"></a>
<a name="index-ncwa"></a>
<p>The differences between the averagers <code>ncra</code> and <code>nces</code>
are analogous to the differences between the concatenators.
<code>ncra</code> is designed for averaging record variables from at least
one file, while <code>nces</code> is designed for averaging fixed length
variables from multiple files.
<code>ncra</code> performs a simple arithmetic average over the record
dimension of all the input files, with each record having an equal
weight in the average.
<code>nces</code> performs a simple arithmetic average of all the input
files, with each file having an equal weight in the average.
Note that <code>ncra</code> cannot average fixed-length variables,
but <code>nces</code> can average both fixed-length and record variables.
To conserve system memory, use <code>ncra</code> rather than
<code>nces</code> where possible (e.g., if each <var>input-file</var> is one
record long).
The file output from <code>nces</code> will have the same dimensions
(meaning dimension names as well as sizes) as the input hyperslabs
(see <a href="#nces-netCDF-Ensemble-Statistics">nces netCDF Ensemble Statistics</a>, for a complete description of
<code>nces</code>).
The file output from <code>ncra</code> will have the same dimensions as
the input hyperslabs except for the record dimension, which will have a
size of 1<!-- /@w --> (see <a href="#ncra-netCDF-Record-Averager">ncra netCDF Record Averager</a>, for a complete
description of <code>ncra</code>).
</p>
<a name="ntp"></a> <!-- http://nco.sf.net/nco.html#ntp --><hr>
<a name="Interpolating"></a>
<div class="header">
<p>
Previous: <a href="#Averaging" accesskey="p" rel="previous">Averaging</a>, Up: <a href="#Statistics-vs_002e-Concatenation" accesskey="u" rel="up">Statistics vs. Concatenation</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#General-Index" title="Index" rel="index">Index</a>]</p>
</div>
<a name="Interpolator-ncflint"></a>
<h4 class="subsection">2.6.3 Interpolator <code>ncflint</code></h4>
<a name="index-ncflint"></a>
<p><code>ncflint</code> can interpolate data between or two files.
Since no other operators have this ability, the description of
interpolation is given fully on the <code>ncflint</code> reference page
(see <a href="#ncflint-netCDF-File-Interpolator">ncflint netCDF File Interpolator</a>).
Note that this capability also allows <code>ncflint</code> to linearly
rescale any data in a netCDF file, e.g., to convert between differing
units.
</p>
<a name="lrg"></a> <!-- http://nco.sf.net/nco.html#lrg --><hr>
<a name="Large-Numbers-of-Files"></a>
<div class="header">
<p>
Next: <a href="#Large-Datasets" accesskey="n" rel="next">Large Datasets</a>, Previous: <a href="#Statistics-vs_002e-Concatenation" accesskey="p" rel="previous">Statistics vs. Concatenation</a>, Up: <a href="#Strategies" accesskey="u" rel="up">Strategies</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#General-Index" title="Index" rel="index">Index</a>]</p>
</div>
<a name="Large-Numbers-of-Files-1"></a>
<h3 class="section">2.7 Large Numbers of Files</h3>
<a name="index-files_002c-numerous-input"></a>
<a name="index-_002dn-loop"></a>
<p>Occasionally one desires to digest (i.e., concatenate or average)
hundreds or thousands of input files.
<a name="index-automagic-1"></a>
<a name="index-NASA-EOSDIS"></a>
Unfortunately, data archives (e.g., <acronym>NASA EOSDIS</acronym>) may not
name netCDF files in a format understood by the ‘<samp>-n <var>loop</var></samp>’
switch (see <a href="#Specifying-Input-Files">Specifying Input Files</a>) that automagically generates
arbitrary numbers of input filenames.
The ‘<samp>-n <var>loop</var></samp>’ switch has the virtue of being concise,
and of minimizing the command line.
This helps keeps output file small since the command line is stored
as metadata in the <code>history</code> attribute
(see <a href="#History-Attribute">History Attribute</a>).
However, the ‘<samp>-n <var>loop</var></samp>’ switch is useless when there is no
simple, arithmetic pattern to the input filenames (e.g.,
<samp>h00001.nc</samp>, <samp>h00002.nc</samp>, … <samp>h90210.nc</samp><!-- /@w -->).
Moreover, filename globbing does not work when the input files are too
numerous or their names are too lengthy (when strung together as a
single argument) to be passed by the calling shell to the <acronym>NCO</acronym>
operator
<a name="DOCF16" href="#FOOT16"><sup>16</sup></a>.
When this occurs, the <acronym>ANSI</acronym> C-standard <code>argc</code>-<code>argv</code>
method of passing arguments from the calling shell to a C-program (i.e.,
an <acronym>NCO</acronym> operator) breaks down.
There are (at least) three alternative methods of specifying the input
filenames to <acronym>NCO</acronym> in environment-limited situations.
</p>
<a name="stdin"></a> <!-- http://nco.sf.net/nco.html#stdin --><a name="index-standard-input"></a>
<a name="index-stdin"></a>
<p>The recommended method for sending very large numbers (hundreds or
more, typically) of input filenames to the multi-file operators is
to pass the filenames with the <acronym>UNIX</acronym> <em>standard input</em>
feature, aka <code>stdin</code>:
</p><div class="example">
<pre class="example"># Pipe large numbers of filenames to stdin
/bin/ls | grep ${CASEID}_'......'.nc | ncecat -o foo.nc
</pre></div>
<p>This method avoids all constraints on command line size imposed by
the operating system.
A drawback to this method is that the <code>history</code> attribute
(see <a href="#History-Attribute">History Attribute</a>) does not record the name of any input
files since the names were not passed on the command line.
This makes determining the data provenance at a later date difficult.
<a name="index-nco_005finput_005ffile_005fnumber"></a>
<a name="index-nco_005finput_005ffile_005flist"></a>
<a name="index-global-attributes"></a>
<a name="index-attributes_002c-global"></a>
To remedy this situation, multi-file operators store the number of
input files in the <code>nco_input_file_number</code> global attribute and the
input file list itself in the <code>nco_input_file_list</code> global attribute
(see <a href="#File-List-Attributes">File List Attributes</a>).
Although this does not preserve the exact command used to generate the
file, it does retains all the information required to reconstruct the
command and determine the data provenance.
</p>
<a name="index-globbing"></a>
<a name="index-shell"></a>
<a name="index-extended-regular-expressions"></a>
<a name="index-regular-expressions"></a>
<a name="index-pattern-matching"></a>
<a name="index-xargs"></a>
<a name="index-UNIX-2"></a>
<p>A second option is to use the <acronym>UNIX</acronym> <code>xargs</code> command.
This simple example selects as input to <code>xargs</code> all the
filenames in the current directory that match a given pattern.
For illustration, consider a user trying to average millions of
files which each have a six character filename.
If the shell buffer cannot hold the results of the corresponding
globbing operator, <samp>??????.nc</samp>, then the filename globbing
technique will fail.
Instead we express the filename pattern as an extended regular
expression, <samp>......\.nc</samp> (see <a href="#Subsetting-Files">Subsetting Files</a>).
We use <code>grep</code> to filter the directory listing for this pattern
and to pipe the results to <code>xargs</code> which, in turn, passes the
matching filenames to an <acronym>NCO</acronym> multi-file operator, e.g.,
<code>ncecat</code>.
</p><div class="example">
<pre class="example"># Use xargs to transfer filenames on the command line
/bin/ls | grep ${CASEID}_'......'.nc | xargs -x ncecat -o foo.nc
</pre></div>
<a name="index-pipes"></a>
<p>The single quotes protect the only sensitive parts of the extended
regular expression (the <code>grep</code> argument), and allow shell
interpolation (the <code>${CASEID}</code> variable substitution) to
proceed unhindered on the rest of the command.
<code>xargs</code> uses the <acronym>UNIX</acronym> pipe feature to append the
suitably filtered input file list to the end of the <code>ncecat</code>
command options.
<a name="index-output-file"></a>
<a name="index-input-files"></a>
<a name="index-_002do-fl_005fout"></a>
The <code>-o foo.nc</code> switch ensures that the input files supplied by
<code>xargs</code> are not confused with the output file name.
<code>xargs</code> does, unfortunately, have its own limit (usually about
20,000 characters) on the size of command lines it can pass.
Give <code>xargs</code> the ‘<samp>-x</samp>’ switch to ensure it dies if it
reaches this internal limit.
When this occurs, use either the <code>stdin</code> method above, or the
symbolic link presented next.
</p>
<a name="index-symbolic-links-2"></a>
<p>Even when its internal limits have not been reached, the
<code>xargs</code> technique may not be sophisticated enough to handle
all situations.
A full scripting language like Perl can handle any level of complexity
of filtering input filenames, and any number of filenames.
The technique of last resort is to write a script that creates symbolic
links between the irregular input filenames and a set of regular,
arithmetic filenames that the ‘<samp>-n <var>loop</var></samp>’ switch understands.
<a name="index-Perl-1"></a>
For example, the following Perl script creates a monotonically
enumerated symbolic link to up to one million <samp>.nc</samp> files in a
directory. If there are 999,999 netCDF files present, the links are
named <samp>000001.nc</samp> to <samp>999999.nc</samp>:
<a name="index-_002dn-loop-1"></a>
</p><div class="example">
<pre class="example"># Create enumerated symbolic links
/bin/ls | grep \.nc | perl -e \
'$idx=1;while(<STDIN>){chop;symlink $_,sprintf("%06d.nc",$idx++);}'
ncecat -n 999999,6,1 000001.nc foo.nc
# Remove symbolic links when finished
/bin/rm ??????.nc
</pre></div>
<p>The ‘<samp>-n <var>loop</var></samp>’ option tells the <acronym>NCO</acronym> operator to
automatically generate the filnames of the symbolic links.
This circumvents any <acronym>OS</acronym> and shell limits on command line size.
The symbolic links are easily removed once <acronym>NCO</acronym> is finished.
<a name="index-history"></a>
One drawback to this method is that the <code>history</code> attribute
(see <a href="#History-Attribute">History Attribute</a>) retains the filename list of the symbolic
links, rather than the data files themselves.
This makes it difficult to determine the data provenance at a later
date.
</p>
<hr>
<a name="Large-Datasets"></a>
<div class="header">
<p>
Next: <a href="#Memory-Requirements" accesskey="n" rel="next">Memory Requirements</a>, Previous: <a href="#Large-Numbers-of-Files" accesskey="p" rel="previous">Large Numbers of Files</a>, Up: <a href="#Strategies" accesskey="u" rel="up">Strategies</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#General-Index" title="Index" rel="index">Index</a>]</p>
</div>
<a name="Large-Datasets-1"></a>
<h3 class="section">2.8 Large Datasets</h3>
<a name="index-large-datasets"></a>
<a name="index-LFS"></a>
<a name="index-Large-File-Support"></a>
<p><em>Large datasets</em> are those files that are comparable in size to the
amount of random access memory (<acronym>RAM</acronym>) in your computer.
Many users of <acronym>NCO</acronym> work with files larger than 100 MB<!-- /@w -->.
Files this large not only push the current edge of storage technology,
they present special problems for programs which attempt to access the
entire file at once, such as <code>nces</code> and <code>ncecat</code>.
<a name="index-swap-space"></a>
If you work with a 300 MB<!-- /@w --> files on a machine with only 32 MB<!-- /@w --> of
memory then you will need large amounts of swap space (virtual memory on
disk) and <acronym>NCO</acronym> will work slowly, or even fail.
There is no easy solution for this.
The best strategy is to work on a machine with sufficient amounts of
memory and swap space.
Since about 2004, many users have begun to produce or analyze files
exceeding 2 GB<!-- /@w --> in size.
These users should familiarize themselves with <acronym>NCO</acronym>’s Large
File Support (<acronym>LFS</acronym>) capabilities (see <a href="#Large-File-Support">Large File Support</a>).
The next section will increase your familiarity with <acronym>NCO</acronym>’s
memory requirements.
With this knowledge you may re-design your data reduction approach to
divide the problem into pieces solvable in memory-limited situations.
</p>
<a name="index-server"></a>
<a name="index-UNICOS"></a>
<a name="index-Cray-1"></a>
<p>If your local machine has problems working with large files, try running
<acronym>NCO</acronym> from a more powerful machine, such as a network server.
Certain machine architectures, e.g., Cray <acronym>UNICOS</acronym>, have special
commands which allow one to increase the amount of interactive memory.
<a name="index-ilimit"></a>
On Cray systems, try to increase the available memory with the
<code>ilimit</code> command.
<a name="index-GNU_002fLinux"></a>
<a name="index-ulimit"></a>
<a name="index-core-dump-1"></a>
If you get a memory-related core dump
(e.g., ‘<samp>Error exit (core dumped)</samp>’) on a <acronym>GNU</acronym>/Linux system,
try increasing the process-available memory with <code>ulimit</code>.
</p>
<a name="index-speed-2"></a>
<p>The speed of the <acronym>NCO</acronym> operators also depends on file size.
When processing large files the operators may appear to hang, or do
nothing, for large periods of time.
In order to see what the operator is actually doing, it is useful to
activate a more verbose output mode.
This is accomplished by supplying a number greater than 0<!-- /@w --> to the
‘<samp>-D <var>debug-level</var></samp>’ (or ‘<samp>--debug-level</samp>’, or
‘<samp>--dbg_lvl</samp>’) switch.
<a name="index-_002dD-debug_002dlevel-1"></a>
<a name="index-_002d_002ddebug_002dlevel-debug_002dlevel-1"></a>
<a name="index-_002d_002ddbg_005flvl-debug_002dlevel-1"></a>
<a name="index-debug_002dlevel-1"></a>
<a name="index-dbg_005flvl-1"></a>
<a name="index-debugging-1"></a>
When the <var>debug-level</var> is nonzero, the operators report their
current status to the terminal through the <var>stderr</var> facility.
Using ‘<samp>-D</samp>’ does not slow the operators down.
Choose a <var>debug-level</var> between 1<!-- /@w --> and 3<!-- /@w --> for most situations,
e.g., <code>nces -D 2 85.nc 86.nc 8586.nc</code>.
A full<!-- /@w --> description of how to estimate the actual amount of memory the
multi-file <acronym>NCO</acronym> operators consume is given in
<a href="#Memory-Requirements">Memory Requirements</a>.
</p>
<a name="mmr"></a> <!-- http://nco.sf.net/nco.html#mmr --><hr>
<a name="Memory-Requirements"></a>
<div class="header">
<p>
Next: <a href="#Performance" accesskey="n" rel="next">Performance</a>, Previous: <a href="#Large-Datasets" accesskey="p" rel="previous">Large Datasets</a>, Up: <a href="#Strategies" accesskey="u" rel="up">Strategies</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#General-Index" title="Index" rel="index">Index</a>]</p>
</div>
<a name="Memory-Requirements-1"></a>
<h3 class="section">2.9 Memory Requirements</h3>
<a name="index-memory-requirements"></a>
<a name="index-memory-available"></a>
<a name="index-RAM"></a>
<a name="index-swap-space-1"></a>
<a name="index-peak-memory-usage"></a>
<a name="index-_002d_002dram_005fall"></a>
<a name="index-_002d_002dopen_005fram-1"></a>
<a name="index-_002d_002ddiskless_005fall"></a>
<p>Many people use <acronym>NCO</acronym> on gargantuan files which dwarf the
memory available (free <acronym>RAM</acronym> plus swap space) even on today’s powerful
machines.
These users want <acronym>NCO</acronym> to consume the least memory possible
so that their scripts do not have to tediously cut files into smaller
pieces that fit into memory.
We commend these greedy users for pushing <acronym>NCO</acronym> to its limits!
</p>
<a name="index-threads"></a>
<a name="index-OpenMP"></a>
<a name="index-shared-memory-machines"></a>
<p>This section describes the memory <acronym>NCO</acronym> requires during
operation.
The required memory is based on the underlying algorithms.
The description below is the memory usage per thread.
Users with shared memory machines may use the threaded <acronym>NCO</acronym>
operators (see <a href="#OpenMP-Threading">OpenMP Threading</a>).
The peak and sustained memory usage will scale accordingly,
i.e., by the number of threads.
Memory consumption patterns of all operators are similar, with
the exception of <code>ncap2</code>.
</p>
<table class="menu" border="0" cellspacing="0">
<tr><td align="left" valign="top">• <a href="#Single-and-Multi_002dfile-Operators" accesskey="1">Single and Multi-file Operators</a>:</td><td> </td><td align="left" valign="top">
</td></tr>
<tr><td align="left" valign="top">• <a href="#Memory-for-ncap2" accesskey="2">Memory for ncap2</a>:</td><td> </td><td align="left" valign="top">
</td></tr>
</table>
<hr>
<a name="Single-and-Multi_002dfile-Operators"></a>
<div class="header">
<p>
Next: <a href="#Memory-for-ncap2" accesskey="n" rel="next">Memory for ncap2</a>, Previous: <a href="#Memory-Requirements" accesskey="p" rel="previous">Memory Requirements</a>, Up: <a href="#Memory-Requirements" accesskey="u" rel="up">Memory Requirements</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#General-Index" title="Index" rel="index">Index</a>]</p>
</div>
<a name="Single-and-Multi_002dfile-Operators-1"></a>
<h4 class="subsection">2.9.1 Single and Multi-file Operators</h4>
<a name="index-multi_002dfile-operators"></a>
<p>The multi-file operators currently comprise the record operators,
<code>ncra</code> and <code>ncrcat</code>, and the ensemble operators,
<code>nces</code> and <code>ncecat</code>.
The record operators require <em>much less</em> memory than the ensemble
operators.
This is because the record operators operate on one single record (i.e.,
time-slice) at a time, whereas the ensemble operators retrieve the
entire variable into memory.
Let <em>MS</em> be the peak sustained memory demand of an operator,
<em>FT</em> be the memory required to store the entire contents of all the
variables to be processed in an input file,
<em>FR</em> be the memory required to store the entire contents of a
single record of each of the variables to be processed in an input file,
<em>VR</em> be the memory required to store a single record of the
largest record variable to be processed in an input file,
<em>VT</em> be the memory required to store the largest variable
to be processed in an input file,
<em>VI</em> be the memory required to store the largest variable
which is not processed, but is copied from the initial file to the
output file.
All operators require <em>MI = VI</em> during the initial copying of
variables from the first input file to the output file.
This is the <em>initial</em> (and transient) memory demand.
The <em>sustained</em> memory demand is that memory required by the
operators during the processing (i.e., averaging, concatenation)
phase which lasts until all the input files have been processed.
The operators have the following memory requirements:
<code>ncrcat</code> requires <em>MS <= VR</em>.
<code>ncecat</code> requires <em>MS <= VT</em>.
<code>ncra</code> requires <em>MS = 2FR + VR</em>.
<code>nces</code> requires <em>MS = 2FT + VT</em>.
<code>ncbo</code> requires <em>MS <= 3VT</em>
(both input variables and the output variable).
<code>ncflint</code> requires <em>MS <= 3VT</em>
(both input variables and the output variable).
<code>ncpdq</code> requires <em>MS <= 2VT</em>
(one input variable and the output variable).
<code>ncwa</code> requires <em>MS <= 8VT</em> (see below).
Note that only variables that are processed, e.g., averaged,
concatenated, or differenced, contribute to <em>MS</em>.
Variables which do not appear in the output file
(see <a href="#Subsetting-Files">Subsetting Files</a>) are never read and contribute nothing
to the memory requirements.
</p>
<p>Further note that some operators perform internal type-promotion on some
variables prior to arithmetic (see <a href="#Type-Conversion">Type Conversion</a>).
For example, <code>ncra</code> and <code>nces</code> both promote integer
types to double-precision floating point prior to arithmetic, then
perform the arithmetic, then demote back to the original integer type
after arithmetic.
This preserves the on-disk storage type while obtaining the accuracy
advantages of floating point arithmetic.
Since version 4.3.6 (released in September, 2013), <acronym>NCO</acronym> also
by default converts single-precision floating point to double-precision
prior to arithmetic, which incurs the same <acronym>RAM</acronym> penalty.
Hence, the sustained memory required for integer variables and
single-precision floats are two or four-times their on-disk,
uncompressed, unpacked sizes if they meet the rules for automatic
internal promotion.
Put another way, disabling auto-promotion of single-precision variables
(with ‘<samp>--flt</samp>’) considerably reduces the <acronym>RAM</acronym> footprint
of arithmetic operators.
</p>
<p>The ‘<samp>--open_ram</samp>’ switch (and switches that invoke it like
‘<samp>--ram_all</samp>’ and ‘<samp>--diskless_all</samp>’) incurs a <acronym>RAM</acronym>
penalty.
These switches cause each input file to be copied to <acronym>RAM</acronym> upon
opening.
Hence any operator invoking these switches utilizes an additional
<em>FT</em> of <acronym>RAM</acronym> (i.e., <em>MS += FT</em>).
See <a href="#RAM-disks">RAM disks</a> for further details.
</p>
<a name="mmr_ncwa"></a> <!-- http://nco.sf.net/nco.html#mmr_ncwa --><p><code>ncwa</code> consumes between two and seven times the memory of a
variable in order to process it.
Peak consumption occurs when storing simultaneously in memory
one input variable, one tally array,
one input weight, one conformed/working weight, one weight tally,
one input mask, one conformed/working mask, and
one output variable.
When invoked, the weighting and masking features contribute up to
three-sevenths and two-sevenths of these requirements apiece.
If weights and masks are <em>not</em> specified
(i.e., no ‘<samp>-w</samp>’ or ‘<samp>-a</samp>’ options)
then <code>ncwa</code> requirements drop to <em>MS <= 3VT</em>
(one input variable, one tally array, and the output variable).
</p>
<a name="index-OpenMP-1"></a>
<a name="index-threads-1"></a>
<p>The above memory requirements must be multiplied by the number of
threads <var>thr_nbr</var> (see <a href="#OpenMP-Threading">OpenMP Threading</a>).
<a name="index-_002dt-thr_005fnbr"></a>
If this causes problems then reduce (with ‘<samp>-t <var>thr_nbr</var></samp>’) the
number of threads.
</p>
<hr>
<a name="Memory-for-ncap2"></a>
<div class="header">
<p>
Previous: <a href="#Single-and-Multi_002dfile-Operators" accesskey="p" rel="previous">Single and Multi-file Operators</a>, Up: <a href="#Memory-Requirements" accesskey="u" rel="up">Memory Requirements</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#General-Index" title="Index" rel="index">Index</a>]</p>
</div>
<a name="Memory-for-ncap2-1"></a>
<h4 class="subsection">2.9.2 Memory for <code>ncap2</code></h4>
<a name="index-ncap2"></a>
<a name="index-binary-operations"></a>
<a name="index-unary-operations"></a>
<a name="index-memory-leaks"></a>
<a name="index-left-hand-casting"></a>
<p><code>ncap2</code> has unique memory requirements due its ability to process
arbitrarily long scripts of any complexity.
All scripts acceptable to <code>ncap2</code> are ultimately processed as a
sequence of binary or unary operations.
<code>ncap2</code> requires <em>MS <= 2VT</em> under most conditions.
An exception to this is when left hand casting (see <a href="#Left-hand-casting">Left hand casting</a>) is used to stretch the size of derived variables beyond the
size of any input variables.
Let <em>VC</em> be the memory required to store the largest variable
defined by left hand casting.
In this case, <em>MS <= 2VC</em>.
</p>
<a name="index-malloc_0028_0029"></a>
<p><code>ncap2</code> scripts are complete dynamic and may be of arbitrary
length.
A script that contains many thousands of operations, may uncover a
slow memory leak even though each single operation consumes little
additional memory.
Memory leaks are usually identifiable by their memory usage signature.
Leaks cause peak memory usage to increase monotonically with time
regardless of script complexity.
Slow leaks are very difficult to find.
Sometimes a <code>malloc()</code> (or <code>new[]</code>) failure is the
only noticeable clue to their existance.
If you have good reasons to believe that a memory allocation failure
is ultimately due to an <acronym>NCO</acronym> memory leak (rather than
inadequate <acronym>RAM</acronym> on your system), then we would be very
interested in receiving a detailed bug report.
</p>
<hr>
<a name="Performance"></a>
<div class="header">
<p>
Previous: <a href="#Memory-Requirements" accesskey="p" rel="previous">Memory Requirements</a>, Up: <a href="#Strategies" accesskey="u" rel="up">Strategies</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#General-Index" title="Index" rel="index">Index</a>]</p>
</div>
<a name="Performance-1"></a>
<h3 class="section">2.10 Performance</h3>
<a name="index-papers"></a>
<a name="index-overview"></a>
<p>An overview of <acronym>NCO</acronym> capabilities as of about 2006 is in
Zender, C. S. (2008),
“Analysis of Self-describing Gridded Geoscience Data with netCDF Operators (NCO)”,
Environ. Modell. Softw., doi:10.1016/j.envsoft.2008.03.004.
This paper is also available at
<a href="http://dust.ess.uci.edu/ppr/ppr_Zen08.pdf">http://dust.ess.uci.edu/ppr/ppr_Zen08.pdf</a>.
</p>
<a name="index-scaling"></a>
<a name="index-performance-2"></a>
<p><acronym>NCO</acronym> performance and scaling for arithmetic operations is
described in
Zender, C. S., and H. J. Mangalam (2007),
“Scaling Properties of Common Statistical Operators for Gridded Datasets”,
Int. J. High<!-- /@w --> Perform. Comput. Appl., 21(4), 485-498,
doi:10.1177/1094342007083802.
This paper is also available at
<a href="http://dust.ess.uci.edu/ppr/ppr_ZeM07.pdf">http://dust.ess.uci.edu/ppr/ppr_ZeM07.pdf</a>.
</p>
<p>It is helpful to be aware of the aspects of <acronym>NCO</acronym> design
that can limit its performance:
</p><ol>
<li> <a name="index-buffering"></a>
No data buffering is performed during <code>nc_get_var</code> and
<code>nc_put_var</code> operations.
<a name="index-performance-3"></a>
<a name="index-operator-speed-2"></a>
<a name="index-speed-3"></a>
<a name="index-execution-time-2"></a>
Hyperslabs too large too hold in core memory will suffer substantial
performance penalties because of this.
</li><li> <a name="index-monotonic-coordinates"></a>
Since coordinate variables are assumed to be monotonic, the search for
bracketing the user-specified limits should employ a quicker algorithm,
like bisection, than the two-sided incremental search currently
implemented.
</li><li> <a name="index-C_005fformat"></a>
<a name="index-FORTRAN_005fformat"></a>
<a name="index-signedness"></a>
<a name="index-scale_005fformat"></a>
<a name="index-add_005foffset"></a>
<var>C_format</var>, <var>FORTRAN_format</var>, <var>signedness</var>,
<var>scale_format</var> and <var>add_offset</var> attributes are ignored by
<code>ncks</code> when printing variables to screen.
</li><li> <a name="index-Yorick-1"></a>
In the late 1990s it was discovered that some random access operations
on large files on certain architectures (e.g., <acronym>UNICOS</acronym>) were
much slower with <acronym>NCO</acronym> than with similar operations performed
using languages that bypass the netCDF interface (e.g., Yorick).
This may have been a penalty of unnecessary byte-swapping in the netCDF
interface.
It is unclear whether such problems exist in present day (2007)
netCDF/<acronym>NCO</acronym> environments, where unnecessary byte-swapping has
been reduced or eliminated.
</li></ol>
<a name="ftr"></a> <!-- http://nco.sf.net/nco.html#ftr --><hr>
<a name="Common-features"></a>
<div class="header">
<p>
Next: <a href="#Operator-Reference-Manual" accesskey="n" rel="next">Operator Reference Manual</a>, Previous: <a href="#Strategies" accesskey="p" rel="previous">Strategies</a>, Up: <a href="#Top" accesskey="u" rel="up">Top</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#General-Index" title="Index" rel="index">Index</a>]</p>
</div>
<a name="NCO-Features"></a>
<h2 class="chapter">3 NCO Features</h2>
<p>Many features have been implemented in more than one operator and are
described here for brevity.
The description of each feature is preceded by a box listing the
operators for which the feature is implemented.
<a name="index-command-line-switches-1"></a>
Command line switches for a given feature are consistent across all
operators wherever possible.
If no “key switches” are listed for a feature, then that particular
feature is automatic and cannot be controlled by the user.
</p>
<table class="menu" border="0" cellspacing="0">
<tr><td align="left" valign="top">• <a href="#Internationalization" accesskey="1">Internationalization</a>:</td><td> </td><td align="left" valign="top">
</td></tr>
<tr><td align="left" valign="top">• <a href="#Metadata-Optimization" accesskey="2">Metadata Optimization</a>:</td><td> </td><td align="left" valign="top">
</td></tr>
<tr><td align="left" valign="top">• <a href="#OpenMP-Threading" accesskey="3">OpenMP Threading</a>:</td><td> </td><td align="left" valign="top">
</td></tr>
<tr><td align="left" valign="top">• <a href="#Command-Line-Options" accesskey="4">Command Line Options</a>:</td><td> </td><td align="left" valign="top">
</td></tr>
<tr><td align="left" valign="top">• <a href="#Specifying-Input-Files" accesskey="5">Specifying Input Files</a>:</td><td> </td><td align="left" valign="top">
</td></tr>
<tr><td align="left" valign="top">• <a href="#Specifying-Output-Files" accesskey="6">Specifying Output Files</a>:</td><td> </td><td align="left" valign="top">
</td></tr>
<tr><td align="left" valign="top">• <a href="#Remote-storage" accesskey="7">Remote storage</a>:</td><td> </td><td align="left" valign="top">
</td></tr>
<tr><td align="left" valign="top">• <a href="#Retaining-Retrieved-Files" accesskey="8">Retaining Retrieved Files</a>:</td><td> </td><td align="left" valign="top">
</td></tr>
<tr><td align="left" valign="top">• <a href="#File-Formats-and-Conversion" accesskey="9">File Formats and Conversion</a>:</td><td> </td><td align="left" valign="top">
</td></tr>
<tr><td align="left" valign="top">• <a href="#Large-File-Support">Large File Support</a>:</td><td> </td><td align="left" valign="top">
</td></tr>
<tr><td align="left" valign="top">• <a href="#Subsetting-Files">Subsetting Files</a>:</td><td> </td><td align="left" valign="top">
</td></tr>
<tr><td align="left" valign="top">• <a href="#Subsetting-Coordinate-Variables">Subsetting Coordinate Variables</a>:</td><td> </td><td align="left" valign="top">
</td></tr>
<tr><td align="left" valign="top">• <a href="#Group-Path-Editing">Group Path Editing</a>:</td><td> </td><td align="left" valign="top">
</td></tr>
<tr><td align="left" valign="top">• <a href="#C-and-Fortran-Index-Conventions">C and Fortran Index Conventions</a>:</td><td> </td><td align="left" valign="top">
</td></tr>
<tr><td align="left" valign="top">• <a href="#Hyperslabs">Hyperslabs</a>:</td><td> </td><td align="left" valign="top">
</td></tr>
<tr><td align="left" valign="top">• <a href="#Stride">Stride</a>:</td><td> </td><td align="left" valign="top">
</td></tr>
<tr><td align="left" valign="top">• <a href="#Record-Appending">Record Appending</a>:</td><td> </td><td align="left" valign="top">
</td></tr>
<tr><td align="left" valign="top">• <a href="#Subcycle">Subcycle</a>:</td><td> </td><td align="left" valign="top">
</td></tr>
<tr><td align="left" valign="top">• <a href="#Multislabs">Multislabs</a>:</td><td> </td><td align="left" valign="top">
</td></tr>
<tr><td align="left" valign="top">• <a href="#Wrapped-Coordinates">Wrapped Coordinates</a>:</td><td> </td><td align="left" valign="top">
</td></tr>
<tr><td align="left" valign="top">• <a href="#Auxiliary-Coordinates">Auxiliary Coordinates</a>:</td><td> </td><td align="left" valign="top">
</td></tr>
<tr><td align="left" valign="top">• <a href="#UDUnits-Support">UDUnits Support</a>:</td><td> </td><td align="left" valign="top">
</td></tr>
<tr><td align="left" valign="top">• <a href="#Rebasing-Time-Coordinate">Rebasing Time Coordinate</a>:</td><td> </td><td align="left" valign="top">
</td></tr>
<tr><td align="left" valign="top">• <a href="#Multiple-Record-Dimensions">Multiple Record Dimensions</a>:</td><td> </td><td align="left" valign="top">
</td></tr>
<tr><td align="left" valign="top">• <a href="#Missing-Values">Missing Values</a>:</td><td> </td><td align="left" valign="top">
</td></tr>
<tr><td align="left" valign="top">• <a href="#Chunking">Chunking</a>:</td><td> </td><td align="left" valign="top">
</td></tr>
<tr><td align="left" valign="top">• <a href="#Deflation">Deflation</a>:</td><td> </td><td align="left" valign="top">
</td></tr>
<tr><td align="left" valign="top">• <a href="#MD5-digests">MD5 digests</a>:</td><td> </td><td align="left" valign="top">
</td></tr>
<tr><td align="left" valign="top">• <a href="#Buffer-sizes">Buffer sizes</a>:</td><td> </td><td align="left" valign="top">
</td></tr>
<tr><td align="left" valign="top">• <a href="#RAM-disks">RAM disks</a>:</td><td> </td><td align="left" valign="top">
</td></tr>
<tr><td align="left" valign="top">• <a href="#Packed-data">Packed data</a>:</td><td> </td><td align="left" valign="top">
</td></tr>
<tr><td align="left" valign="top">• <a href="#Operation-Types">Operation Types</a>:</td><td> </td><td align="left" valign="top">
</td></tr>
<tr><td align="left" valign="top">• <a href="#Type-Conversion">Type Conversion</a>:</td><td> </td><td align="left" valign="top">
</td></tr>
<tr><td align="left" valign="top">• <a href="#Batch-Mode">Batch Mode</a>:</td><td> </td><td align="left" valign="top">
</td></tr>
<tr><td align="left" valign="top">• <a href="#History-Attribute">History Attribute</a>:</td><td> </td><td align="left" valign="top">
</td></tr>
<tr><td align="left" valign="top">• <a href="#File-List-Attributes">File List Attributes</a>:</td><td> </td><td align="left" valign="top">
</td></tr>
<tr><td align="left" valign="top">• <a href="#CF-Conventions">CF Conventions</a>:</td><td> </td><td align="left" valign="top">
</td></tr>
<tr><td align="left" valign="top">• <a href="#ARM-Conventions">ARM Conventions</a>:</td><td> </td><td align="left" valign="top">
</td></tr>
<tr><td align="left" valign="top">• <a href="#Operator-Version">Operator Version</a>:</td><td> </td><td align="left" valign="top">
</td></tr>
</table>
<a name="i18n"></a> <!-- http://nco.sf.net/nco.html#i18n --><hr>
<a name="Internationalization"></a>
<div class="header">
<p>
Next: <a href="#Metadata-Optimization" accesskey="n" rel="next">Metadata Optimization</a>, Previous: <a href="#Common-features" accesskey="p" rel="previous">Common features</a>, Up: <a href="#Common-features" accesskey="u" rel="up">Common features</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#General-Index" title="Index" rel="index">Index</a>]</p>
</div>
<a name="Internationalization-1"></a>
<h3 class="section">3.1 Internationalization</h3>
<a name="index-Internationalization"></a>
<a name="index-I18N"></a>
<table class="cartouche" border="1"><tr><td>
<p>Availability: All operators<br>
</p></td></tr></table>
<a name="index-L10N"></a>
<p><acronym>NCO</acronym> support for <em>internationalization</em> of textual input
and output (e.g., Warning messages) is nascent.
We hope to produce foreign language string catalogues in 2004.
</p>
<a name="hdr"></a> <!-- http://nco.sf.net/nco.html#hdr -->
<a name="hdr_pad"></a> <!-- http://nco.sf.net/nco.html#hdr_pad --><hr>
<a name="Metadata-Optimization"></a>
<div class="header">
<p>
Next: <a href="#OpenMP-Threading" accesskey="n" rel="next">OpenMP Threading</a>, Previous: <a href="#Internationalization" accesskey="p" rel="previous">Internationalization</a>, Up: <a href="#Common-features" accesskey="u" rel="up">Common features</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#General-Index" title="Index" rel="index">Index</a>]</p>
</div>
<a name="Metadata-Optimization-1"></a>
<h3 class="section">3.2 Metadata Optimization</h3>
<a name="index-metadata-optimization"></a>
<a name="index-performance-4"></a>
<a name="index-operator-speed-3"></a>
<a name="index-speed-4"></a>
<a name="index-execution-time-3"></a>
<a name="index-nc_005f_005fenddef_0028_0029"></a>
<a name="index-_002d_002dhdr_005fpad-hdr_005fpad"></a>
<a name="index-_002d_002dheader_005fpad-hdr_005fpad"></a>
<table class="cartouche" border="1"><tr><td>
<p>Availability: All operators<br>
Short options: None<br>
Long options: ‘<samp>--hdr_pad</samp>’, ‘<samp>--header_pad</samp>’<br>
</p></td></tr></table>
<p><acronym>NCO</acronym> supports padding headers to improve the speed of future
metadata operations.
Use the ‘<samp>--hdr_pad</samp>’ and ‘<samp>--header_pad</samp>’ switches to request
that <var>hdr_pad</var> bytes be inserted into the metadata section of the
output file.
Future metadata expansions will not incur the netCDF3 performance
penalty of copying the entire output file unless the expansion exceeds
the amount of header padding exceeded.
This can be beneficial when it is known that some metadata will be added
at a future date.
</p>
<p>This optimization exploits the netCDF library <code>nc__enddef()</code>
function, which behaves differently with different versions of netCDF.
It will improve speed of future metadata expansion with <code>CLASSIC</code>
and <code>64bit</code> netCDF files, though not necessarily with <code>NETCDF4</code>
files, i.e., those created by the netCDF interface to the <acronym>HDF5</acronym>
library (see <a href="#File-Formats-and-Conversion">File Formats and Conversion</a>).
</p>
<a name="omp"></a> <!-- http://nco.sf.net/nco.html#omp -->
<a name="openmp"></a> <!-- http://nco.sf.net/nco.html#openmp --><hr>
<a name="OpenMP-Threading"></a>
<div class="header">
<p>
Next: <a href="#Command-Line-Options" accesskey="n" rel="next">Command Line Options</a>, Previous: <a href="#Metadata-Optimization" accesskey="p" rel="previous">Metadata Optimization</a>, Up: <a href="#Common-features" accesskey="u" rel="up">Common features</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#General-Index" title="Index" rel="index">Index</a>]</p>
</div>
<a name="OpenMP-Threading-1"></a>
<h3 class="section">3.3 OpenMP Threading</h3>
<a name="index-OpenMP-2"></a>
<a name="index-threads-2"></a>
<a name="index-SMP"></a>
<a name="index-shared-memory-parallelism"></a>
<a name="index-parallelism"></a>
<a name="index-nco_005fopenmp_005fthread_005fnumber"></a>
<a name="index-_002d_002dthr_005fnbr-thr_005fnbr"></a>
<a name="index-_002d_002dthreads-thr_005fnbr"></a>
<a name="index-_002d_002domp_005fnum_005fthreads-thr_005fnbr"></a>
<a name="index-_002dt-thr_005fnbr-1"></a>
<table class="cartouche" border="1"><tr><td>
<p>Availability: <code>ncap2</code>, <code>ncbo</code>, <code>nces</code>, <code>ncecat</code>,
<code>ncflint</code>, <code>ncpdq</code>, <code>ncra</code>, <code>ncrcat</code>,
<code>ncwa</code><br>
Short options: ‘<samp>-t</samp>’<br>
Long options: ‘<samp>--thr_nbr</samp>’, ‘<samp>--threads</samp>’,
‘<samp>--omp_num_threads</samp>’<br>
</p></td></tr></table>
<p><acronym>NCO</acronym> supports shared memory parallelism (<acronym>SMP</acronym>) when
compiled with an OpenMP-enabled compiler.
Threads requests and allocations occur in two stages.
First, users may request a specific number of threads <var>thr_nbr</var> with
the ‘<samp>-t</samp>’ switch (or its long option equivalents, ‘<samp>--thr_nbr</samp>’,
‘<samp>--threads</samp>’, and ‘<samp>--omp_num_threads</samp>’).
If not user-specified, OpenMP obtains <var>thr_nbr</var> from the
<code>OMP_NUM_THREADS</code> environment variable, if present, or from the
<acronym>OS</acronym>, if not.
</p>
<table class="cartouche" border="1"><tr><td>
<p>Caveat:
Unfortunately, threading does not improve <acronym>NCO</acronym> throughput (i.e.,
wallclock time) because nearly all <acronym>NCO</acronym> operations are
I/O-bound.
This means that <acronym>NCO</acronym> spends negligible time doing anything
compared to reading and writing.
We have seen some and can imagine other use cases where
<code>ncwa</code>, <code>ncpdq</code>, and <code>ncap2</code> (with long scripts)
will complete faster due to threading.
The main benefits of threading so far have been to isolate the serial
from parallel portions of code.
This parallelism is now exploited by OpenMP but then runs into the I/O
bottleneck during output.
The bottleneck could be ameliorated for large files by the use of
MPI-enabled calls in the netCDF4 library when the underlying filesystem
is parallel (e.g., <acronym>PVFS</acronym> or <acronym>JFS</acronym>).
Implementation of the parallel output calls in <acronym>NCO</acronym> is not a
goal of our current funding and would require new volunteers or funding.
</p></td></tr></table>
<a name="index-thr_005fnbr"></a>
<a name="index-OMP_005fNUM_005fTHREADS"></a>
<a name="index-ncrcat-1"></a>
<a name="index-ncwa-1"></a>
<a name="index-ncap2-1"></a>
<a name="index-ncpdq-1"></a>
<a name="index-large-datasets-1"></a>
<p><acronym>NCO</acronym> may modify <var>thr_nbr</var> according to its own internal
settings before it requests any threads from the system.
Certain operators contain hard-code limits to the number of threads they
request.
We base these limits on our experience and common sense, and to reduce
potentially wasteful system usage by inexperienced users.
For example, <code>ncrcat</code> is extremely I/O-intensive so we restrict
<em><var>thr_nbr</var> <= 2</em> for <code>ncrcat</code>.
This is based on the notion that the best performance that can be
expected from an operator which does no arithmetic is to have one thread
reading and one thread writing simultaneously.
In the future (perhaps with netCDF4), we hope to demonstrate significant
threading improvements with operators like <code>ncrcat</code> by performing
multiple simultaneous writes.
</p>
<p>Compute-intensive operators (<code>ncap2</code>, <code>ncwa</code> and <code>ncpdq</code>)
benefit most from threading.
The greatest increases in throughput due to threading occur on
large datasets where each thread performs millions, at least,
of floating point operations.
Otherwise, the system overhead of setting up threads probably outweighs
the speed enhancements due to <acronym>SMP</acronym> parallelism.
However, we have not yet demonstrated that the <acronym>SMP</acronym> parallelism
scales beyond four threads for these operators.
Hence we restrict <em><var>thr_nbr</var> <= 4</em> for all operators.
We encourage users to play with these limits (edit file
<samp>nco_omp.c</samp>) and send us their feedback.
</p>
<a name="index-debugging-2"></a>
<a name="index-dbg_005flvl-2"></a>
<p>Once the initial <var>thr_nbr</var> has been modified for any
operator-specific limits, <acronym>NCO</acronym> requests the system to allocate
a team of <var>thr_nbr</var> threads for the body of the code.
The operating system then decides how many threads to allocate
based on this request.
Users may keep track of this information by running the operator with
<em><var>dbg_lvl</var> > 0</em>.
</p>
<p>By default, threaded operators attach one global attribute,
<code>nco_openmp_thread_number</code>, to any file they create or modify.
This attribute contains the number of threads the operator used to
process the input files.
This information helps to verify that the answers with threaded and
non-threaded operators are equal to within machine precision.
<a name="index-benchmarks"></a>
This information is also useful for benchmarking.
</p>
<a name="cmd_ln"></a> <!-- http://nco.sf.net/nco.html#cmd_ln --><hr>
<a name="Command-Line-Options"></a>
<div class="header">
<p>
Next: <a href="#Specifying-Input-Files" accesskey="n" rel="next">Specifying Input Files</a>, Previous: <a href="#OpenMP-Threading" accesskey="p" rel="previous">OpenMP Threading</a>, Up: <a href="#Common-features" accesskey="u" rel="up">Common features</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#General-Index" title="Index" rel="index">Index</a>]</p>
</div>
<a name="Command-Line-Options-1"></a>
<h3 class="section">3.4 Command Line Options</h3>
<a name="index-command-line-options"></a>
<table class="cartouche" border="1"><tr><td>
<p>Availability: All operators<br>
</p></td></tr></table>
<a name="index-POSIX"></a>
<a name="index-UNIX-3"></a>
<a name="index-GNU"></a>
<a name="index-switches"></a>
<p><acronym>NCO</acronym> achieves flexibility by using <em>command line options</em>.
These options are implemented in all traditional <acronym>UNIX</acronym> commands
as single letter <em>switches</em>, e.g., ‘<samp>ls -l</samp>’.
For many years <acronym>NCO</acronym> used only single letter option names.
In late 2002, we implemented <acronym>GNU</acronym>/<acronym>POSIX</acronym> extended
or long option names for all options.
This was done in a backward compatible way such that the full
functionality of <acronym>NCO</acronym> is still available through the familiar
single letter options.
In the future, however, some features of <acronym>NCO</acronym> may require the
use of long options, simply because we have nearly run out of single
letter options.
More importantly, mnemonics for single letter options are often
non-intuitive so that long options provide a more natural way of
expressing intent.
</p>
<a name="index-long-options"></a>
<p>Extended options, also called long options, are implemented using the
system-supplied <samp>getopt.h</samp> header file, if possible.
<a name="index-BSD"></a>
<a name="index-getopt"></a>
<a name="index-getopt_005flong"></a>
<a name="index-getopt_002eh"></a>
This provides the <code>getopt_long</code> function to <acronym>NCO</acronym>
<a name="DOCF17" href="#FOOT17"><sup>17</sup></a>.
</p>
<a name="index-_002dD-debug_002dlevel-2"></a>
<a name="index-_002d_002ddbg_005flvl-debug_002dlevel-2"></a>
<p>The syntax of <em>short options</em> (single letter options) is
<kbd>-<var>key</var> <var>value</var></kbd> (dash-key-space-value).
Here, <var>key</var> is the single letter option name, e.g.,
‘<samp>-D 2</samp>’.
</p>
<p>The syntax of <em>long options</em> (multi-letter options) is
<kbd>--<var>long_name</var> <var>value</var></kbd>
(dash-dash-key-space-value), e.g., ‘<samp>--dbg_lvl 2</samp>’ or
<kbd>--<var>long_name</var>=<var>value</var></kbd>
(dash-dash-key-equal-value), e.g., ‘<samp>--dbg_lvl=2</samp>’.
Thus the following are all valid for the ‘<samp>-D</samp>’ (short version)
or ‘<samp>--dbg_lvl</samp>’ (long version) command line option.
</p><div class="example">
<pre class="example">ncks -D 3 in.nc # Short option
ncks --dbg_lvl=3 in.nc # Long option, preferred form
ncks --dbg_lvl 3 in.nc # Long option, alternate form
</pre></div>
<p>The last example is preferred for two reasons.
First, ‘<samp>--dbg_lvl</samp>’ is more specific and less ambiguous than
‘<samp>-D</samp>’.
The long option form makes scripts more self documenting and less error
prone.
Often long options are named after the source code variable whose value
they carry.
Second, the equals sign <kbd>=</kbd> joins the key (i.e., <var>long_name</var>) to
the value in an uninterruptible text block.
Experience shows that users are less likely to mis-parse commands when
restricted to this form.
</p>
<p><acronym>GNU</acronym> implements a superset of the <acronym>POSIX</acronym> standard
which allows any unambiguous truncation of a valid option to be used.
</p><div class="example">
<pre class="example">ncks -D 3 in.nc # Short option
ncks --dbg_lvl=3 in.nc # Long option, full form
ncks --dbg=3 in.nc # Long option, unambiguous truncation
ncks --db=3 in.nc # Long option, unambiguous truncation
ncks --d=3 in.nc # Long option, ambiguous truncation
</pre></div>
<p>The first four examples are equivalent and will work as expected.
The final example will exit with an error since <code>ncks</code> cannot
disambiguate whether ‘<samp>--d</samp>’ is intended as a truncation of
‘<samp>--dbg_lvl</samp>’, of ‘<samp>--dimension</samp>’, or of some other long option.
</p>
<p><acronym>NCO</acronym> provides many long options for common switches.
For example, the debugging level may be set in all operators with any
of the switches ‘<samp>-D</samp>’, ‘<samp>--debug-level</samp>’, or ‘<samp>--dbg_lvl</samp>’.
This flexibility allows users to choose their favorite mnemonic.
For some, it will be ‘<samp>--debug</samp>’ (an unambiguous truncation of
‘<samp>--debug-level</samp>’, and other will prefer ‘<samp>--dbg</samp>’.
Interactive users usually prefer the minimal amount of typing, i.e.,
‘<samp>-D</samp>’.
We recommend that scripts which are re-usable employ some form of
the long options for future maintainability.
</p>
<p>This manual generally uses the short option syntax in examples.
This is for historical reasons and to conserve space in printed output.
Users are expected to pick the unambiguous truncation of each option
name that most suits their taste.
</p>
<a name="fl_in"></a> <!-- http://nco.sf.net/nco.html#fl_in -->
<a name="in"></a> <!-- http://nco.sf.net/nco.html#in -->
<a name="input"></a> <!-- http://nco.sf.net/nco.html#input --><hr>
<a name="Specifying-Input-Files"></a>
<div class="header">
<p>
Next: <a href="#Specifying-Output-Files" accesskey="n" rel="next">Specifying Output Files</a>, Previous: <a href="#Command-Line-Options" accesskey="p" rel="previous">Command Line Options</a>, Up: <a href="#Common-features" accesskey="u" rel="up">Common features</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#General-Index" title="Index" rel="index">Index</a>]</p>
</div>
<a name="Specifying-Input-Files-1"></a>
<h3 class="section">3.5 Specifying Input Files</h3>
<a name="index-input-files-1"></a>
<a name="index-globbing-1"></a>
<a name="index-regular-expressions-1"></a>
<a name="index-wildcards"></a>
<a name="index-NINTAP"></a>
<a name="index-Processor_002c-CCM"></a>
<a name="index-CCM-Processor"></a>
<a name="index-_002dn-loop-2"></a>
<a name="index-_002d_002dnintap-loop"></a>
<a name="index-_002dp-input_002dpath"></a>
<a name="index-_002d_002dpth-input_002dpath"></a>
<a name="index-_002d_002dpath-input_002dpath"></a>
<a name="index-input_002dpath"></a>
<table class="cartouche" border="1"><tr><td>
<p>Availability (<code>-n</code>): <code>nces</code>, <code>ncecat</code>, <code>ncra</code>, <code>ncrcat</code><br>
Availability (<code>-p</code>): All operators<br>
Short options: ‘<samp>-n</samp>’, ‘<samp>-p</samp>’<br>
Long options: ‘<samp>--nintap</samp>’, ‘<samp>--pth</samp>’, ‘<samp>--path</samp>’<br>
</p></td></tr></table>
<p>It is important that users be able to specify multiple input files
without typing every filename in full, often a tedious task even
by graduate student standards.
<a name="index-UNIX-4"></a>
There are four different ways of specifying input files to <acronym>NCO</acronym>:
explicitly typing each, using <acronym>UNIX</acronym> shell wildcards, and using
the <acronym>NCO</acronym> ‘<samp>-n</samp>’ and ‘<samp>-p</samp>’ switches (or their long option
equivalents, ‘<samp>--nintap</samp>’ or ‘<samp>--pth</samp>’ and ‘<samp>--path</samp>’,
respectively).
Techniques to augment these methods to specify arbitrary numbers (e.g.,
thousands) and patterns of filenames are discussed separately
(see <a href="#Large-Numbers-of-Files">Large Numbers of Files</a>).
</p>
<p>To illustrate these methods, consider the simple problem of using
<code>ncra</code> to average five input files, <samp>85.nc</samp>, <samp>86.nc</samp>,
… <samp>89.nc</samp><!-- /@w -->, and store the results in <samp>8589.nc</samp>.
Here are the four methods in order.
They produce identical answers.
</p><div class="example">
<pre class="example">ncra 85.nc 86.nc 87.nc 88.nc 89.nc 8589.nc
ncra 8[56789].nc 8589.nc
ncra -p <var>input-path</var> 85.nc 86.nc 87.nc 88.nc 89.nc 8589.nc
ncra -n 5,2,1 85.nc 8589.nc
</pre></div>
<p>The first method (explicitly specifying all filenames) works by brute
force.
The second method relies on the operating system shell to <em>glob</em>
(expand) the <em>regular expression</em> <code>8[56789].nc</code>.
The shell passes valid filenames which match the expansion to
<code>ncra</code>.
The third method uses the ‘<samp>-p <var>input-path</var></samp>’ argument to specify
the directory where all the input files reside.
<acronym>NCO</acronym> prepends <var>input-path</var> (e.g.,
<samp>/data/usrname/model</samp>) to all <var>input-files</var> (though not to
<var>output-file</var>).
Thus, using ‘<samp>-p</samp>’, the path to any number of input files need only
be specified once.
Note <var>input-path</var> need not end with ‘<samp>/</samp>’; the ‘<samp>/</samp>’ is
automatically generated if necessary.
</p>
<p>The last method passes (with ‘<samp>-n</samp>’) syntax concisely describing
the entire set of filenames
<a name="DOCF18" href="#FOOT18"><sup>18</sup></a>.
<a name="index-multi_002dfile-operators-1"></a>
<a name="index-files_002c-multiple"></a>
This option is only available with the <em>multi-file operators</em>:
<code>ncra</code>, <code>ncrcat</code>, <code>nces</code>, and <code>ncecat</code>.
By definition, multi-file operators are able to process an arbitrary
number of <var>input-files</var>.
This option is very useful for abbreviating lists of filenames
representable as
<var>alphanumeric_prefix</var>+<var>numeric_suffix</var>+<samp>.</samp>+<var>filetype</var>
where <var>alphanumeric_prefix</var> is a string of arbitrary length and
composition, <var>numeric_suffix</var> is a fixed width field of digits, and
<var>filetype</var> is a standard filetype indicator.
For example, in the file <samp>ccm3_h0001.nc</samp>, we have
<var>alphanumeric_prefix</var> = <samp>ccm3_h</samp>, <var>numeric_suffix</var> =
<samp>0001</samp>, and <var>filetype</var> = <samp>nc</samp>.
</p>
<p><acronym>NCO</acronym> is able to decode lists of such filenames encoded using the
‘<samp>-n</samp>’ option.
The simpler (3-argument) ‘<samp>-n</samp>’ usage takes the form
<code>-n <var>file_number</var>,<var>digit_number</var>,<var>numeric_increment</var></code>
where <var>file_number</var> is the number of files, <var>digit_number</var> is
the fixed number of numeric digits comprising the <var>numeric_suffix</var>,
and <var>numeric_increment</var> is the constant, integer-valued difference
between the <var>numeric_suffix</var> of any two consecutive files.
The value of <var>alphanumeric_prefix</var> is taken from the input file,
which serves as a template for decoding the filenames.
In the example above, the encoding <code>-n 5,2,1</code> along with the input
file name <samp>85.nc</samp> tells <acronym>NCO</acronym> to
construct five (5) filenames identical to the template <samp>85.nc</samp>
except that the final two (2) digits are a numeric suffix to be
incremented by one (1) for each successive file.
Currently <var>filetype</var> may be either be empty, <samp>nc</samp>,
<samp>cdf</samp>, <samp>hdf</samp>, or <samp>hd5</samp>.
If present, these <var>filetype</var> suffixes (and the preceding <samp>.</samp>)
are ignored by <acronym>NCO</acronym> as it uses the ‘<samp>-n</samp>’ arguments to
locate, evaluate, and compute the <var>numeric_suffix</var> component of
filenames.
</p>
<a name="index-wrapped-filenames"></a>
<a name="index-climate-model-3"></a>
<p>Recently the ‘<samp>-n</samp>’ option has been extended to allow convenient
specification of filenames with “circular” characteristics.
This means it is now possible for <acronym>NCO</acronym> to automatically
generate filenames which increment regularly until a specified maximum
value, and then wrap back to begin again at a specified minimum value.
The corresponding ‘<samp>-n</samp>’ usage becomes more complex, taking one or
two additional arguments for a total of four or five, respectively:
<code>-n
<var>file_number</var>,<var>digit_number</var>,<var>numeric_increment</var>[,<var>numeric_max</var>[,<var>numeric_min</var>]]</code>
where <var>numeric_max</var>, if present, is the maximum integer-value of
<var>numeric_suffix</var> and <var>numeric_min</var>, if present, is the minimum
integer-value of <var>numeric_suffix</var>.
Consider, for example, the problem of specifying non-consecutive input
files where the filename suffixes end with the month index.
In climate modeling it is common to create summertime and wintertime
averages which contain the averages of the months June–July–August,
and December–January–February, respectively:
</p><div class="example">
<pre class="example">ncra -n 3,2,1 85_06.nc 85_0608.nc
ncra -n 3,2,1,12 85_12.nc 85_1202.nc
ncra -n 3,2,1,12,1 85_12.nc 85_1202.nc
</pre></div>
<p>The first example shows that three arguments to the ‘<samp>-n</samp>’ option
suffice to specify consecutive months (<code>06, 07, 08</code>) which do not
“wrap” back to a minimum value.
The second example shows how to use the optional fourth and fifth
elements of the ‘<samp>-n</samp>’ option to specify a wrap value to <acronym>NCO</acronym>.
The fourth argument to ‘<samp>-n</samp>’, if present, specifies the maximum
integer value of <var>numeric_suffix</var>.
In this case the maximum value is 12,<!-- /@w --> and will be formatted as
<samp>12</samp> in the filename string.
The fifth argument to ‘<samp>-n</samp>’, if present, specifies the minimum
integer value of <var>numeric_suffix</var>.
The default minimum filename suffix is 1,<!-- /@w --> which is formatted as
<samp>01</samp> in this case.
Thus the second and third examples have the same effect, that is, they
automatically generate, in order, the filenames <samp>85_12.nc</samp>,
<samp>85_01.nc</samp>, and <samp>85_02.nc</samp> as input to <acronym>NCO</acronym>.
</p>
<a name="fl_out"></a> <!-- http://nco.sf.net/nco.html#fl_out -->
<a name="out"></a> <!-- http://nco.sf.net/nco.html#out -->
<a name="output"></a> <!-- http://nco.sf.net/nco.html#output --><hr>
<a name="Specifying-Output-Files"></a>
<div class="header">
<p>
Next: <a href="#Remote-storage" accesskey="n" rel="next">Remote storage</a>, Previous: <a href="#Specifying-Input-Files" accesskey="p" rel="previous">Specifying Input Files</a>, Up: <a href="#Common-features" accesskey="u" rel="up">Common features</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#General-Index" title="Index" rel="index">Index</a>]</p>
</div>
<a name="Specifying-Output-Files-1"></a>
<h3 class="section">3.6 Specifying Output Files</h3>
<a name="index-output-file-1"></a>
<a name="index-input-files-2"></a>
<a name="index-positional-arguments"></a>
<a name="index-command-line-switches-2"></a>
<a name="index-_002do-fl_005fout-1"></a>
<a name="index-_002d_002doutput-fl_005fout"></a>
<a name="index-_002d_002dfl_005fout-fl_005fout"></a>
<table class="cartouche" border="1"><tr><td>
<p>Availability: All operators<br>
Short options: ‘<samp>-o</samp>’<br>
Long options: ‘<samp>--fl_out</samp>’, ‘<samp>--output</samp>’<br>
</p></td></tr></table>
<p><acronym>NCO</acronym> commands produce no more than one output file, <var>fl_out</var>.
Traditionally, users specify <var>fl_out</var> as the final argument to the
operator, following all input file names.
This is the <em>positional argument</em> method of specifying input and
ouput file names.
The positional argument method works well in most applications.
<acronym>NCO</acronym> also supports specifying <var>fl_out</var> using the command
line switch argument method, ‘<samp>-o <var>fl_out</var></samp>’.
</p>
<p>Specifying <var>fl_out</var> with a switch, rather than as a positional
argument, allows <var>fl_out</var> to precede input files in the argument
list.
<a name="index-multi_002dfile-operators-2"></a>
This is particularly useful with multi-file operators for three reasons.
Multi-file operators may be invoked with hundreds (or more) filenames.
Visual or automatic location of <var>fl_out</var> in such a list is
difficult when the only syntactic distinction between input and output
files is their position.
<a name="index-xargs-1"></a>
<a name="index-input-files-3"></a>
Second, specification of a long list of input files may be difficult
(see <a href="#Large-Numbers-of-Files">Large Numbers of Files</a>).
Making the input file list the final argument to an operator facilitates
using <code>xargs</code> for this purpose.
Some alternatives to <code>xargs</code> are very ugly and undesirable.
Finally, many users are more comfortable specifying output files
with ‘<samp>-o <var>fl_out</var></samp>’ near the beginning of an argument list.
<a name="index-compilers"></a>
<a name="index-linkers"></a>
Compilers and linkers are usually invoked this way.
</p>
<p>Users should specify <var>fl_out</var> using either (not both) method.
If <var>fl_out</var> is specified twice (once with the switch and once as
the last positional argument), then the positional argument takes
precedence.
</p>
<a name="rmt"></a> <!-- http://nco.sf.net/nco.html#rmt --><hr>
<a name="Remote-storage"></a>
<div class="header">
<p>
Next: <a href="#Retaining-Retrieved-Files" accesskey="n" rel="next">Retaining Retrieved Files</a>, Previous: <a href="#Specifying-Output-Files" accesskey="p" rel="previous">Specifying Output Files</a>, Up: <a href="#Common-features" accesskey="u" rel="up">Common features</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#General-Index" title="Index" rel="index">Index</a>]</p>
</div>
<a name="Accessing-Remote-Files"></a>
<h3 class="section">3.7 Accessing Remote Files</h3>
<a name="index-rcp-1"></a>
<a name="index-scp-1"></a>
<a name="index-_002erhosts"></a>
<a name="index-NCAR-MSS"></a>
<a name="index-MSS"></a>
<a name="index-Mass-Store-System"></a>
<a name="index-URL"></a>
<a name="index-ftp-1"></a>
<a name="index-sftp-1"></a>
<a name="index-wget"></a>
<a name="index-remote-files-1"></a>
<a name="index-synchronous-file-access"></a>
<a name="index-asynchronous-file-access"></a>
<a name="index-_002d_002dpth-input_002dpath-1"></a>
<a name="index-_002d_002dpath-input_002dpath-1"></a>
<a name="index-_002d_002dlcl-output_002dpath"></a>
<a name="index-_002d_002dlocal-output_002dpath"></a>
<a name="index-_002dl-output_002dpath"></a>
<a name="index-_002enetrc"></a>
<a name="index-history-1"></a>
<table class="cartouche" border="1"><tr><td>
<p>Availability: All operators<br>
Short options: ‘<samp>-p</samp>’, ‘<samp>-l</samp>’<br>
Long options: ‘<samp>--pth</samp>’, ‘<samp>--path</samp>’, ‘<samp>--lcl</samp>’, ‘<samp>--local</samp>’<br>
</p></td></tr></table>
<p>All <acronym>NCO</acronym> operators can retrieve files from remote sites as well
as from the local file system.
A remote<!-- /@w --> site can be an anonymous <acronym>FTP</acronym> server, a machine on
which the user has <code>rcp</code>, <code>scp</code>, or <code>sftp</code>
privileges, <acronym>NCAR</acronym>’s Mass Storage System (<acronym>MSS</acronym>), or
an <acronym>OPeNDAP</acronym> server.
Examples of each are given below, following a brief description of the
particular access protocol.
</p>
<a name="ftp"></a> <!-- http://nco.sf.net/nco.html#ftp --><p>To access a file via an anonymous <acronym>FTP</acronym> server, supply the
remote file’s <acronym>URL</acronym>.
<acronym>FTP</acronym> is an intrinsically insecure protocol because it transfers
passwords in plain text format.
Users should access sites using anonymous <acronym>FTP</acronym>, or better yet,
secure <acronym>FTP</acronym> when possible.
Some <acronym>FTP</acronym> servers require a login/password combination for a
valid user account.
<acronym>NCO</acronym> allows these transactions so long as the required
information is stored in the <samp>.netrc</samp> file.
Usually this information is the remote machine name, login, and
password, in plain text, separated by those very keywords, e.g.,
</p><div class="example">
<pre class="example">machine dust.ess.uci.edu login zender password bushlied
</pre></div>
<p>Eschew using valuable passwords for <acronym>FTP</acronym> transactions, since
<samp>.netrc</samp> passwords are potentially exposed to eavesdropping
software
<a name="DOCF19" href="#FOOT19"><sup>19</sup></a>.
</p>
<a name="sftp"></a> <!-- http://nco.sf.net/nco.html#sftp --><p><acronym>SFTP</acronym>, i.e., secure <acronym>FTP</acronym>, uses <acronym>SSH</acronym>-based
security protocols that solve the security issues associated with
plain <acronym>FTP</acronym>.
<acronym>NCO</acronym> supports <acronym>SFTP</acronym> protocol access to files
specified with a homebrew syntax of the form
</p><div class="example">
<pre class="example">sftp://machine.domain.tld:/path/to/filename
</pre></div>
<p>Note the second colon following the top-level-domain, <code>tld</code>.
This syntax is a hybrid between an <acronym>FTP URL</acronym> and a standard
remote file syntax.
</p>
<a name="rcp"></a> <!-- http://nco.sf.net/nco.html#rcp -->
<a name="scp"></a> <!-- http://nco.sf.net/nco.html#scp --><p>To access a file using <code>rcp</code> or <code>scp</code>, specify the
Internet address of the remote file.
Of course in this case you must have <code>rcp</code> or <code>scp</code>
privileges which allow transparent (no password entry required) access
to the remote machine.
This means that <samp>~/.rhosts</samp> or <samp>~/ssh/authorized_keys</samp> must
be set accordingly on both local and remote machines.
</p>
<a name="index-HPSS"></a>
<a name="index-hsi"></a>
<a name="index-msrcp"></a>
<a name="index-msread"></a>
<a name="index-nrnet"></a>
<a name="hpss"></a> <!-- http://nco.sf.net/nco.html#hpss -->
<a name="HPSS"></a> <!-- http://nco.sf.net/nco.html#HPSS -->
<a name="hsi"></a> <!-- http://nco.sf.net/nco.html#hsi -->
<a name="HSI"></a> <!-- http://nco.sf.net/nco.html#HSI -->
<a name="msrcp"></a> <!-- http://nco.sf.net/nco.html#msrcp -->
<a name="msread"></a> <!-- http://nco.sf.net/nco.html#msread -->
<a name="nrnet"></a> <!-- http://nco.sf.net/nco.html#nrnet --><p>To access a file on a High Performance Storage System (<acronym>HPSS</acronym>)
(such as that at <acronym>NCAR</acronym>, <acronym>ECMWF</acronym>, <acronym>LANL</acronym>,
<acronym>DKRZ</acronym>, <acronym>LLNL</acronym>) specify the full <acronym>HPSS</acronym> pathname
of the remote file.
<acronym>NCO</acronym> will attempt to detect whether the local machine has direct
(synchronous) <acronym>HPSS</acronym> access.
In this case, <acronym>NCO</acronym> attempts to use the Hierarchical Storage
Interface (<acronym>HSI</acronym>) command <code>hsi get</code>
<a name="DOCF20" href="#FOOT20"><sup>20</sup></a>.
</p>
<p>The following examples show how one might analyze files stored on
remote systems.
</p><div class="example">
<pre class="example">ncks -l . ftp://dust.ess.uci.edu/pub/zender/nco/in.nc
ncks -l . sftp://dust.ess.uci.edu:/home/ftp/pub/zender/nco/in.nc
ncks -l . dust.ess.uci.edu:/home/zender/nco/data/in.nc
ncks -l . /ZENDER/nco/in.nc
ncks -l . /home/zender/nco/in.nc
ncks -l . http://thredds-test.ucar.edu/thredds/dodsC/testdods/in.nc
</pre></div>
<p>The first example works verbatim if your system is connected to the
Internet and is not behind a firewall.
The second example works if you have <code>sftp</code> access to the
machine <code>dust.ess.uci.edu</code>.
The third example works if you have <code>rcp</code> or <code>scp</code>
access to the machine <code>dust.ess.uci.edu</code>.
The fourth and fifth examples work on <acronym>NCAR</acronym> computers with
local access to the <acronym>HPSS</acronym> <code>hsi get</code> command
<a name="DOCF21" href="#FOOT21"><sup>21</sup></a>.
The sixth command works if your local version of <acronym>NCO</acronym> is
<acronym>OPeNDAP</acronym>-enabled (this is fully described in <a href="#OPeNDAP">OPeNDAP</a>),
or if the remote file is accessible via <code>wget</code>.
The above commands can be rewritten using the ‘<samp>-p <var>input-path</var></samp>’
option as follows:
<a name="index-_002dp-input_002dpath-1"></a>
<a name="index-input_002dpath-1"></a>
<a name="index-_002dl-output_002dpath-1"></a>
<a name="index-output_002dpath"></a>
</p><div class="example">
<pre class="example">ncks -p ftp://dust.ess.uci.edu/pub/zender/nco -l . in.nc
ncks -p sftp://dust.ess.uci.edu:/home/ftp/pub/zender/nco -l . in.nc
ncks -p dust.ess.uci.edu:/home/zender/nco -l . in.nc
ncks -p /ZENDER/nco -l . in.nc
ncks -p /home/zender/nco -l . in.nc # HPSS
ncks -p http://thredds-test.ucar.edu/thredds/dodsC/testdods \
-l . in.nc
</pre></div>
<p>Using ‘<samp>-p</samp>’ is recommended because it clearly separates the
<var>input-path</var> from the filename itself, sometimes called the
<em>stub</em>.
<a name="index-stub"></a>
When <var>input-path</var> is not explicitly specified using ‘<samp>-p</samp>’,
<acronym>NCO</acronym> internally generates an <var>input-path</var> from the first
input filename.
The automatically generated <var>input-path</var> is constructed by stripping
the input filename of everything following the final ‘<samp>/</samp>’ character
(i.e., removing the stub).
The ‘<samp>-l <var>output-path</var></samp>’ option tells <acronym>NCO</acronym> where to
store the remotely retrieved file.
It has no effect on locally-retrieved files, or on the output file.
Often the path to a remotely retrieved file is quite different than the
path on the local machine where you would like to store the file.
If ‘<samp>-l</samp>’ is not specified then <acronym>NCO</acronym> internally generates an
<var>output-path</var> by simply setting <var>output-path</var> equal to
<var>input-path</var> stripped of any machine names.
If ‘<samp>-l</samp>’ is not specified and the remote file resides on the
<acronym>NCAR</acronym> <acronym>HPSS</acronym> system, then the leading character of
<var>input-path</var>, ‘<samp>/</samp>’, is also stripped from <var>output-path</var>.
Specifying <var>output-path</var> as ‘<samp>-l ./</samp>’ tells <acronym>NCO</acronym> to
store the remotely retrieved file and the output file in the current
directory.
Note that ‘<samp>-l .</samp>’ is equivalent to ‘<samp>-l ./</samp>’ though the latter is
syntactically more clear.
</p>
<table class="menu" border="0" cellspacing="0">
<tr><td align="left" valign="top">• <a href="#OPeNDAP" accesskey="1">OPeNDAP</a>:</td><td> </td><td align="left" valign="top">
</td></tr>
</table>
<a name="dap"></a> <!-- http://nco.sf.net/nco.html#dap -->
<a name="DAP"></a> <!-- http://nco.sf.net/nco.html#DAP -->
<a name="DODS"></a> <!-- http://nco.sf.net/nco.html#DODS -->
<a name="OPeNDAP"></a> <!-- http://nco.sf.net/nco.html#OPeNDAP -->
<a name="dods"></a> <!-- http://nco.sf.net/nco.html#dods -->
<a name="opendap"></a> <!-- http://nco.sf.net/nco.html#opendap --><hr>
<a name="OPeNDAP"></a>
<div class="header">
<p>
Previous: <a href="#Remote-storage" accesskey="p" rel="previous">Remote storage</a>, Up: <a href="#Remote-storage" accesskey="u" rel="up">Remote storage</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#General-Index" title="Index" rel="index">Index</a>]</p>
</div>
<a name="OPeNDAP-1"></a>
<h4 class="subsection">3.7.1 <acronym>OPeNDAP</acronym></h4>
<a name="index-DAP"></a>
<a name="index-DODS"></a>
<a name="index-HTTP-protocol"></a>
<a name="index-DODS_005fROOT"></a>
<a name="index-Distributed-Oceanographic-Data-System"></a>
<a name="index-oceanography"></a>
<a name="index-data-access-protocol"></a>
<a name="index-Open_002dsource-Project-for-a-Network-Data-Access-Protocol"></a>
<a name="index-OPeNDAP_002e"></a>
<a name="index-server-1"></a>
<a name="index-client_002dserver"></a>
<p>The Distributed Oceanographic Data System (<acronym>DODS</acronym>) provides
useful replacements for common data interface libraries like netCDF.
The <acronym>DODS</acronym> versions of these libraries implement network
transparent access to data via a client-server data access protocol
that uses the <acronym>HTTP</acronym> protocol for communication.
Although <acronym>DODS</acronym>-technology originated with oceanography data,
it applyies to virtually all scientific data.
In recognition of this, the data access protocol underlying
<acronym>DODS</acronym> (which is what <acronym>NCO</acronym> cares about) has been
renamed the Open-source Project for a Network Data Access Protocol,
<acronym>OPeNDAP</acronym>.
We use the terms <acronym>DODS</acronym> and <acronym>OPeNDAP</acronym> interchangeably,
and often write <acronym>OPeNDAP</acronym>/<acronym>DODS</acronym> for now.
In the future we will deprecate <acronym>DODS</acronym> in favor of
<acronym>DAP</acronym> or <acronym>OPeNDAP</acronym>, as appropriate
<a name="DOCF22" href="#FOOT22"><sup>22</sup></a>.
</p>
<p><acronym>NCO</acronym> may be <acronym>DAP</acronym>-enabled by linking
<acronym>NCO</acronym> to the <acronym>OPeNDAP</acronym> libraries.
<a name="index-Makefile-2"></a>
This is described in the <acronym>OPeNDAP</acronym> documentation and
automagically implemented in <acronym>NCO</acronym> build mechanisms
<a name="DOCF23" href="#FOOT23"><sup>23</sup></a>.
The <samp>./configure</samp> mechanism automatically enables <acronym>NCO</acronym> as
<acronym>OPeNDAP</acronym> clients if it can find the required
<acronym>OPeNDAP</acronym> libraries
<a name="DOCF24" href="#FOOT24"><sup>24</sup></a>.
in the usual locations.
The <code>$DODS_ROOT</code> environment variable may be used to override the
default <acronym>OPeNDAP</acronym> library location at <acronym>NCO</acronym>
compile-time.
Building <acronym>NCO</acronym> with <samp>bld/Makefile</samp> and the command
<code>make DODS=Y</code> adds the (non-intuitive) commands to link to the
<acronym>OPeNDAP</acronym> libraries installed in the <code>$DODS_ROOT</code>
directory.
The file <samp>doc/opendap.sh</samp> contains a generic script intended to help
users install <acronym>OPeNDAP</acronym> before building <acronym>NCO</acronym>.
The documentation at the
<a href="http://www.opendap.org">OPeNDAP Homepage</a>
is voluminous.
Check there and on the
<a href="http://www.unidata.ucar.edu/packages/dods/home/mailLists/">DODS mail lists</a>.
to learn more about the extensive capabilities of <acronym>OPeNDAP</acronym>
<a name="DOCF25" href="#FOOT25"><sup>25</sup></a>.
</p>
<p>Once <acronym>NCO</acronym> is <acronym>DAP</acronym>-enabled the operators are
<acronym>OPeNDAP</acronym> clients.
All <acronym>OPeNDAP</acronym> clients have network transparent access to
any files controlled by a <acronym>OPeNDAP</acronym> server.
Simply specify the input file path(s) in <acronym>URL</acronym> notation and all
<acronym>NCO</acronym> operations may be performed on remote files made
accessible by a <acronym>OPeNDAP</acronym> server.
This command tests the basic functionality of <acronym>OPeNDAP</acronym>-enabled
<acronym>NCO</acronym> clients:
</p><div class="example">
<pre class="example">% ncks -O -o ~/foo.nc -C -H -v one -l /tmp \
-p http://thredds-test.ucar.edu/thredds/dodsC/testdods in.nc
% ncks -H -v one ~/foo.nc
one = 1
</pre></div>
<p>The <code>one = 1</code> outputs confirm (first) that <code>ncks</code> correctly
retrieved data via the <acronym>OPeNDAP</acronym> protocol and (second) that
<code>ncks</code> created a valid local copy of the subsetted remote file.
With minor changes to the above command, netCDF4 can be used as both the
input and output file format:
</p><div class="example">
<pre class="example">% ncks -4 -O -o ~/foo.nc -C -H -v one -l /tmp \
-p http://thredds-test.ucar.edu/thredds/dodsC/testdods in_4.nc
% ncks -H -v one ~/foo.nc
one = 1
</pre></div>
<p>And, of course, <acronym>OPeNDAP</acronym>-enabled <acronym>NCO</acronym> clients continue
to support other, orthogonal features such as UDUnits
(see <a href="#UDUnits-Support">UDUnits Support</a>):
</p><div class="example">
<pre class="example">% ncks -u -C -H -v wvl -d wvl,'0.4 micron','0.7 micron' \
-p http://thredds-test.ucar.edu/thredds/dodsC/testdods in_4.nc
% wvl[0]=5e-07 meter
</pre></div>
<p>The next command is a more advanced example which demonstrates the real
power of <acronym>OPeNDAP</acronym>-enabled <acronym>NCO</acronym> clients.
The <code>ncwa</code> client requests an equatorial hyperslab from remotely
stored <acronym>NCEP reanalyses data</acronym> of the year 1969<!-- /@w -->.
The <acronym>NOAA</acronym> <acronym>OPeNDAP</acronym> server (hopefully!) serves these data.
The local <code>ncwa</code> client then computes and stores (locally) the
regional mean surface pressure (in Pa)<!-- /@w -->.
</p><div class="example">
<pre class="example">ncwa -C -a lat,lon,time -d lon,-10.,10. -d lat,-10.,10. -l /tmp -p \
http://www.esrl.noaa.gov/psd/thredds/dodsC/Datasets/ncep.reanalysis.dailyavgs/surface \
pres.sfc.1969.nc ~/foo.nc
</pre></div>
<a name="index-packing"></a>
<a name="index-unpacking"></a>
<p>All with one command!
The data in this particular input file also happen to be packed
(see <a href="#Methods-and-functions">Methods and functions</a>), although this is completely transparent
to the user since <acronym>NCO</acronym> automatically unpacks data before
attempting arithmetic.
</p>
<p><acronym>NCO</acronym> obtains remote files from the <acronym>OPeNDAP</acronym> server
(e.g., <samp>www.cdc.noaa.gov</samp>) rather than the local machine.
Input files are first copied to the local machine, then processed.
The <acronym>OPeNDAP</acronym> server performs data access, hyperslabbing,
and transfer to the local machine.
<a name="index-I_002fO"></a>
This allows the I/O to appear to <acronym>NCO</acronym> as if the input files
were local.
The local machine performs all arithmetic operations.
Only the hyperslabbed output data are transferred over the network (to
the local machine) for the number-crunching to begin.
The advantages of this are obvious if you are examining small parts of
large files stored at remote locations.
</p>
<a name="rtn"></a> <!-- http://nco.sf.net/nco.html#rtn --><hr>
<a name="Retaining-Retrieved-Files"></a>
<div class="header">
<p>
Next: <a href="#File-Formats-and-Conversion" accesskey="n" rel="next">File Formats and Conversion</a>, Previous: <a href="#Remote-storage" accesskey="p" rel="previous">Remote storage</a>, Up: <a href="#Common-features" accesskey="u" rel="up">Common features</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#General-Index" title="Index" rel="index">Index</a>]</p>
</div>
<a name="Retaining-Retrieved-Files-1"></a>
<h3 class="section">3.8 Retaining Retrieved Files</h3>
<a name="index-file-deletion"></a>
<a name="index-file-removal"></a>
<a name="index-file-retention"></a>
<a name="index-_002dR"></a>
<a name="index-_002d_002drtn"></a>
<a name="index-_002d_002dretain"></a>
<table class="cartouche" border="1"><tr><td>
<p>Availability: All operators<br>
Short options: ‘<samp>-R</samp>’<br>
Long options: ‘<samp>--rtn</samp>’, ‘<samp>--retain</samp>’<br>
</p></td></tr></table>
<p>In order to conserve local file system space, files retrieved from
remote locations are automatically deleted from the local file system
once they have been processed.
Many <acronym>NCO</acronym> operators were constructed to work with numerous
large (e.g., 200 MB<!-- /@w -->) files.
Retrieval of multiple files from remote locations is done serially.
Each file is retrieved, processed, then deleted before the cycle
repeats.
In cases where it is useful to keep the remotely-retrieved files on the
local file system after processing, the automatic removal feature may be
disabled by specifying ‘<samp>-R</samp>’ on the command line.
</p>
<p>Invoking <code>-R</code> disables the default printing behavior of
<code>ncks</code>.
This allows <code>ncks</code> to retrieve remote files without
automatically trying to print them.
See <a href="#ncks-netCDF-Kitchen-Sink">ncks netCDF Kitchen Sink</a>, for more details.
</p>
<a name="index-FTP"></a>
<a name="index-SSH-1"></a>
<a name="index-msrcp-1"></a>
<p>Note that the remote retrieval features of <acronym>NCO</acronym> can always be
used to retrieve <em>any</em> file, including non-netCDF files, via
<code>SSH</code>, anonymous <acronym>FTP</acronym>, or <code>msrcp</code>.
Often this method is quicker than using a browser, or running an
<acronym>FTP</acronym> session from a shell window yourself.
<a name="index-server-2"></a>
For example, say you want to obtain a <acronym>JPEG</acronym> file from a weather
server.
</p><div class="example">
<pre class="example">ncks -R -p ftp://weather.edu/pub/pix/jpeg -l . storm.jpg
</pre></div>
<p>In this example, <code>ncks</code> automatically performs an anonymous
<acronym>FTP</acronym> login to the remote machine and retrieves the specified
file.
When <code>ncks</code> attempts to read the local copy of <samp>storm.jpg</samp>
as a netCDF file, it fails and exits, leaving <samp>storm.jpg</samp> in
the current directory.
</p>
<a name="index-DODS-1"></a>
<a name="index-server-3"></a>
<p>If your <acronym>NCO</acronym> is <acronym>DAP</acronym>-enabled (see <a href="#OPeNDAP">OPeNDAP</a>),
then you may use <acronym>NCO</acronym> to retrieve any files (including netCDF,
<acronym>HDF</acronym>, etc.) served by an <acronym>OPeNDAP</acronym> server to your local
machine.
For example,
</p><div class="example">
<pre class="example">ncks -R -l . -p \
http://www.esrl.noaa.gov/psd/thredds/dodsC/Datasets/ncep.reanalysis.dailyavgs/surface \
pres.sfc.1969.nc
</pre></div>
<p>It may occasionally be useful to use <acronym>NCO</acronym> to transfer files
when your other preferred methods are not available locally.
</p>
<a name="fl_fmt"></a> <!-- http://nco.sf.net/nco.html#fl_fmt -->
<a name="hdf"></a> <!-- http://nco.sf.net/nco.html#hdf -->
<a name="64bit"></a> <!-- http://nco.sf.net/nco.html#64bit -->
<a name="netcdf4"></a> <!-- http://nco.sf.net/nco.html#netcdf4 --><hr>
<a name="File-Formats-and-Conversion"></a>
<div class="header">
<p>
Next: <a href="#Large-File-Support" accesskey="n" rel="next">Large File Support</a>, Previous: <a href="#Retaining-Retrieved-Files" accesskey="p" rel="previous">Retaining Retrieved Files</a>, Up: <a href="#Common-features" accesskey="u" rel="up">Common features</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#General-Index" title="Index" rel="index">Index</a>]</p>
</div>
<a name="File-Formats-and-Conversion-1"></a>
<h3 class="section">3.9 File Formats and Conversion</h3>
<a name="index-HDF-1"></a>
<a name="index-netCDF2-1"></a>
<a name="index-netCDF3-1"></a>
<a name="index-netCDF4-1"></a>
<a name="index-NETCDF4_005fCLASSIC-files"></a>
<a name="index-NETCDF4-files"></a>
<a name="index-CLASSIC-files"></a>
<a name="index-64BIT-files"></a>
<a name="index-_002d_002d3"></a>
<a name="index-_002d3-1"></a>
<a name="index-_002d4-1"></a>
<a name="index-_002d6"></a>
<a name="index-_002d7"></a>
<a name="index-_002d_002d4"></a>
<a name="index-_002d_002d7"></a>
<a name="index-_002d_002dnetcdf4"></a>
<a name="index-_002d_002dfl_005ffmt"></a>
<a name="index-_002d_002dfile_005fformat"></a>
<a name="index-_002d_002d64bit"></a>
<table class="cartouche" border="1"><tr><td>
<p>Availability: <code>ncap2</code>, <code>ncbo</code>, <code>nces</code>,
<code>ncecat</code>, <code>ncflint</code>, <code>ncks</code>, <code>ncpdq</code>,
<code>ncra</code>, <code>ncrcat</code>, <code>ncwa</code><br>
Short options: ‘<samp>-3</samp>’, ‘<samp>-4</samp>’, ‘<samp>-6</samp>’, ‘<samp>-7</samp>’<br>
Long options: ‘<samp>--3</samp>’, ‘<samp>--4</samp>’, ‘<samp>--64bit</samp>’, ‘<samp>--7</samp>’, ‘<samp>--fl_fmt</samp>’,
‘<samp>--netcdf4</samp>’<br>
</p></td></tr></table>
<p>All <acronym>NCO</acronym> operators support (read and write) all three (or four,
depending on how one counts) file formats supported by netCDF4.
The default output file format for all operators is the input file
format.
The operators listed under “Availability” above allow the user to
specify the output file format independent of the input file format.
These operators allow the user to convert between the various file
formats.
(The operators <code>ncatted</code> and <code>ncrename</code> do not support
these switches so they always write the output netCDF file in the same
format as the input netCDF file.)
</p>
<table class="menu" border="0" cellspacing="0">
<tr><td align="left" valign="top">• <a href="#File-Formats" accesskey="1">File Formats</a>:</td><td> </td><td align="left" valign="top">
</td></tr>
<tr><td align="left" valign="top">• <a href="#Determining-File-Format" accesskey="2">Determining File Format</a>:</td><td> </td><td align="left" valign="top">
</td></tr>
<tr><td align="left" valign="top">• <a href="#File-Conversion" accesskey="3">File Conversion</a>:</td><td> </td><td align="left" valign="top">
</td></tr>
<tr><td align="left" valign="top">• <a href="#Autoconversion" accesskey="4">Autoconversion</a>:</td><td> </td><td align="left" valign="top">
</td></tr>
</table>
<hr>
<a name="File-Formats"></a>
<div class="header">
<p>
Next: <a href="#Determining-File-Format" accesskey="n" rel="next">Determining File Format</a>, Previous: <a href="#File-Formats-and-Conversion" accesskey="p" rel="previous">File Formats and Conversion</a>, Up: <a href="#File-Formats-and-Conversion" accesskey="u" rel="up">File Formats and Conversion</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#General-Index" title="Index" rel="index">Index</a>]</p>
</div>
<a name="File-Formats-1"></a>
<h4 class="subsection">3.9.1 File Formats</h4>
<p>netCDF supports four types of files: <code>CLASSIC</code>, <code>64BIT</code>,
<code>NETCDF4</code>, and <code>NETCDF4_CLASSIC</code>,
The <code>CLASSIC</code> format is the traditional 32-bit offset written by
netCDF2 and netCDF3.
As of 2005, nearly all netCDF datasets were in <code>CLASSIC</code> format.
The <code>64BIT</code> format was added in Fall, 2004.
As of 2010, many netCDF datasets were in <code>64BIT</code> format.
As of 2013, many netCDF datasets are in <code>NETCDF4_CLASSIC</code> format.
</p>
<p>The <code>NETCDF4</code> format uses <acronym>HDF5</acronym> as the file storage layer.
The files are (usually) created, accessed, and manipulated using the
traditional netCDF3 <acronym>API</acronym> (with numerous extensions).
The <code>NETCDF4_CLASSIC</code> format refers to netCDF4 files created with
the <code>NC_CLASSIC_MODEL</code> mask.
Such files use <acronym>HDF5</acronym> as the back-end storage format (unlike
netCDF3), though they incorporate only netCDF3 features.
Hence <code>NETCDF4_CLASSIC</code> files are entirely readable by applications
that use only the netCDF3 <acronym>API</acronym> (though the applications must be
linked with the netCDF4 library).
<acronym>NCO</acronym> must be built with netCDF4<!-- /@w --> to write files in the new
<code>NETCDF4</code> and <code>NETCDF4_CLASSIC</code> formats, and to read files in
these formats.
Datasets in the default <code>CLASSIC</code> or the newer <code>64BIT</code> formats
have maximum backwards-compatibility with older applications.
<acronym>NCO</acronym> has deep support for <code>NETCDF4</code> formats.
If performance or disk-space as important as backwards compatibility,
then use <code>NETCDF4_CLASSIC</code> instead of <code>CLASSIC</code> format files.
As of 2014, <acronym>NCO</acronym> support for the <code>NETCDF4</code> format is
nearly complete and the most powerful and disk/<acronym>RAM</acronym> efficient
workflows will utilize this format.
</p>
<p>As mentioned above, all operators write use the input file format for
output files unless told otherwise.
Toggling the short option ‘<samp>-6</samp>’ or the long option ‘<samp>--64bit</samp>’
switch (or its <var>key</var>-<var>value</var> equivalent ‘<samp>--fl_fmt=64bit</samp>’)
produces the netCDF3 64-bit offset format named <code>64BIT</code>.
<acronym>NCO</acronym> must be built with netCDF 3.6<!-- /@w --> or higher to produce
a <code>64BIT</code> file.
Using the ‘<samp>-4</samp>’ switch (or its long option equivalents
‘<samp>--4</samp>’ or ‘<samp>--netcdf4</samp>’), or setting its <var>key</var>-<var>value</var>
equivalent ‘<samp>--fl_fmt=netcdf4</samp>’ produces a <code>NETCDF4</code> file
(i.e., with all supported <acronym>HDF5</acronym> features).
Using the ‘<samp>-7</samp>’ switch (or its long option equivalent
‘<samp>--7</samp>’
<a name="DOCF26" href="#FOOT26"><sup>26</sup></a>, or
setting its <var>key</var>-<var>value</var> equivalent
‘<samp>--fl_fmt=netcdf4_classic</samp>’ produces a <code>NETCDF4_CLASSIC</code>
file (i.e., with all supported <acronym>HDF5</acronym> features like compression
and chunking but without groups or new atomic types).
Operators given the ‘<samp>-3</samp>’ (or ‘<samp>--3</samp>’) switch without arguments
will (attempt to) produce netCDF3 <code>CLASSIC</code> output, even from
netCDF4 input files.
</p>
<p>Note that <code>NETCDF4</code> and <code>NETCDF4_CLASSIC</code> are the same
binary format.
The latter simply causes a writing application to fail if it attempts to
write a <code>NETCDF4</code> file that cannot be completely read by the
netCDF3 library.
Conversely, <code>NETCDF4_CLASSIC</code> indicates to a reading application
that all of the file contents are readable with the netCDF3 library.
<acronym>NCO</acronym> has supported reading/writing basic <code>NETCDF4</code> and
<code>NETCDF4_CLASSIC</code> files since October, 2005.
</p>
<a name="fmt_inq"></a> <!-- http://nco.sf.net/nco.html#fmt_inq --><hr>
<a name="Determining-File-Format"></a>
<div class="header">
<p>
Next: <a href="#File-Conversion" accesskey="n" rel="next">File Conversion</a>, Previous: <a href="#File-Formats" accesskey="p" rel="previous">File Formats</a>, Up: <a href="#File-Formats-and-Conversion" accesskey="u" rel="up">File Formats and Conversion</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#General-Index" title="Index" rel="index">Index</a>]</p>
</div>
<a name="Determining-File-Format-1"></a>
<h4 class="subsection">3.9.2 Determining File Format</h4>
<p>Input files often end with the generic <code>.nc</code> suffix that leaves
(perhaps by intention) the internal file format ambiguous.
There are at least three ways to discover the internal format of a
netCDF-supported file.
These methods determine whether it is a classic (32-bit offset) or newer
64-bit offset netCDF3 format, or is a netCDF4 format.
Each method returns the information using slightly different terminology
that becomes easier to understand with practice.
</p>
<p>First, examine the first line of global metadata output by ‘<samp>ncks -M</samp>’:
<a name="index-netCDF3-classic-file-format"></a>
<a name="index-netCDF4-classic-file-format"></a>
<a name="index-netCDF4-file-format"></a>
<a name="index-32_002dbit-offset-file-format"></a>
<a name="index-64_002dbit-offset-file-format"></a>
<a name="index-ncks"></a>
<a name="index-_002dM"></a>
</p><div class="example">
<pre class="example">% ncks -M foo_3c.nc
Summary of foo_3c.nc: filetype = NC_FORMAT_CLASSIC, 0 groups ...
% ncks -M foo_364.nc
Summary of foo_364.nc: filetype = NC_FORMAT_64BIT, 0 groups ...
% ncks -M foo_4c.nc
Summary of foo_4c.nc: filetype = NC_FORMAT_NETCDF4_CLASSIC, 0 groups ...
% ncks -M foo_4.nc
Summary of foo_4.nc: filetype = NC_FORMAT_NETCDF4, 0 groups ...
</pre></div>
<p>This method requires a netCDF4-enabled <acronym>NCO</acronym> version 3.9.0+
(i.e., from 2007 or later).
<a name="index-extended-file-format"></a>
<a name="index-underlying-file-format"></a>
<a name="index-NC_005fFORMAT_005fNC3"></a>
<a name="index-NC_005fFORMAT_005fNC_005fHDF5"></a>
<a name="index-NC_005fFORMAT_005fNC_005fHDF4"></a>
<a name="index-NC_005fFORMAT_005fPNETCDF"></a>
<a name="index-NC_005fFORMAT_005fDAP2"></a>
<a name="index-NC_005fFORMAT_005fDAP4"></a>
As of <acronym>NCO</acronym> version 4.4.0 (January, 2014), <code>ncks</code> will
also print the extended or underlying format of the input file.
The extended filetype will be one of the six underlying formats that
are accessible through the netCDF <acronym>API</acronym>.
These formats are
<code>NC_FORMAT_NC3</code> (classic and 64-bit versions of netCDF3 formats),
<code>NC_FORMAT_NC_HDF5</code> (classic and extended versions of netCDF4, and
“pure” HDF5 format),
<code>NC_FORMAT_NC_HDF4</code> (HDF4 format),
<code>NC_FORMAT_PNETCDF</code> (PnetCDF format),
<code>NC_FORMAT_DAP2</code> (accessed via DAP2 protocol), and
<code>NC_FORMAT_DAP4</code> (accessed via DAP2 protocol).
For example,
</p><div class="example">
<pre class="example">% ncks -D 2 -M hdf.hdf
Summary of hdf.hdf: filetype = NC_FORMAT_NETCDF4 (representation of \
extended/underlying filetype NC_FORMAT_HDF4), 0 groups ...
% ncks -D 2 -M http://thredds-test.ucar.edu/thredds/dodsC/testdods/in.nc
Summary of http://thredds-test.ucar.edu/thredds/dodsC/testdods/in.nc: \
filetype = NC_FORMAT_CLASSIC (representation of extended/underlying \
filetype NC_FORMAT_DAP2), 0 groups
% ncks -D 2 -M foo_4.nc
Summary of foo_4.nc: filetype = NC_FORMAT_NETCDF4 (representation of \
extended/underlying filetype NC_FORMAT_HDF5), 0 groups
</pre></div>
<p>The extended filetype determines some of the capabilities that netCDF
has to alter the file.
</p>
<p>Second, query the file with ‘<samp>ncdump -k</samp>’:
<a name="index-ncdump"></a>
</p><div class="example">
<pre class="example">% ncdump -k foo_3c.nc
classic
% ncdump -k foo_364.nc
64-bit-offset
% ncdump -k foo_4c.nc
netCDF-4 classic model
% ncdump -k foo_4.nc
netCDF-4
</pre></div>
<p>This method requires a netCDF4-enabled <acronym>netCDF</acronym> 3.6.2+
(i.e., from 2007 or later).
</p>
<p>The third option uses the POSIX-standard <code>od</code> (octal dump)
command:
<a name="index-od"></a>
<a name="index-octal-dump"></a>
</p><div class="example">
<pre class="example">% od -An -c -N4 foo_3c.nc
C D F 001
% od -An -c -N4 foo_364.nc
C D F 002
% od -An -c -N4 foo_4c.nc
211 H D F
% od -An -c -N4 foo_4.nc
211 H D F
</pre></div>
<p>This option works without <acronym>NCO</acronym> and <code>ncdump</code>.
Values of ‘<samp>C D F 001</samp>’ and ‘<samp>C D F 002</samp>’ indicate 32-bit
(classic) and 64-bit netCDF3 formats, respectively, while values of
‘<samp>211 H D F</samp>’ indicate either of the newer netCDF4 file formats.
</p>
<a name="hdf2nc"></a> <!-- http://nco.sf.net/nco.html#hdf2nc -->
<a name="3to4"></a> <!-- http://nco.sf.net/nco.html#3to4 -->
<a name="4to3"></a> <!-- http://nco.sf.net/nco.html#4to3 --><hr>
<a name="File-Conversion"></a>
<div class="header">
<p>
Next: <a href="#Autoconversion" accesskey="n" rel="next">Autoconversion</a>, Previous: <a href="#Determining-File-Format" accesskey="p" rel="previous">Determining File Format</a>, Up: <a href="#File-Formats-and-Conversion" accesskey="u" rel="up">File Formats and Conversion</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#General-Index" title="Index" rel="index">Index</a>]</p>
</div>
<a name="File-Conversion-1"></a>
<h4 class="subsection">3.9.3 File Conversion</h4>
<p>Let us demonstrate converting a file from any netCDF-supported
input format into any netCDF output format (subject to limits of the
output format).
Here the input file <samp>in.nc</samp> may be in any of these formats:
netCDF3 (classic and 64bit), netCDF4 (classic and extended), HDF4, HDF5,
HDF-EOS (version 2 or 5), and DAP.
The switch determines the output format written in the comment:
</p><div class="example">
<pre class="example">ncks --fl_fmt=classic in.nc foo_3c.nc # netCDF3 classic
ncks --fl_fmt=64bit in.nc foo_364.nc # netCDF3 64bit
ncks --fl_fmt=netcdf4_classic in.nc foo_4c.nc # netCDF4 classic
ncks --fl_fmt=netcdf4 in.nc foo_4.nc # netCDF4
ncks -3 in.nc foo_3c.nc # netCDF3 classic
ncks --3 in.nc foo_3c.nc # netCDF3 classic
ncks -6 in.nc foo_364.nc # netCDF3 64bit
ncks --64 in.nc foo_364.nc # netCDF3 64bit
ncks -4 in.nc foo_4.nc # netCDF4
ncks --4 in.nc foo_4.nc # netCDF4
ncks -7 in.nc foo_4c.nc # netCDF4 classic
ncks --7 in.nc foo_4c.nc # netCDF4 classic
</pre></div>
<p>Of course since most operators support these switches, the
“conversions” can be done at the output stage of arithmetic
or metadata processing rather than requiring a separate step.
Producing (netCDF3) <code>CLASSIC</code> or <code>64BIT</code> files from
<code>NETCDF4_CLASSIC</code> files will always work.
</p>
<a name="autoconversion"></a> <!-- http://nco.sf.net/nco.html#autoconversion -->
<a name="autocnv"></a> <!-- http://nco.sf.net/nco.html#autocnv --><hr>
<a name="Autoconversion"></a>
<div class="header">
<p>
Previous: <a href="#File-Conversion" accesskey="p" rel="previous">File Conversion</a>, Up: <a href="#File-Formats-and-Conversion" accesskey="u" rel="up">File Formats and Conversion</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#General-Index" title="Index" rel="index">Index</a>]</p>
</div>
<a name="Autoconversion-1"></a>
<h4 class="subsection">3.9.4 Autoconversion</h4>
<p>Because of the dearth of support for netCDF4 amongst tools and user
communities (including the <acronym>CF</acronym> conventions), it is often useful
to convert netCDF4 to netCDF3 for certain applications.
Until <acronym>NCO</acronym> version 4.4.0 (January, 2014), producing netCDF3
files from netCDF4 files only worked if the input files contained no
netCDF4-specific features (e.g., atomic types, multiple record
dimensions, or groups).
As of <acronym>NCO</acronym> version 4.4.0, <code>ncks</code> supports
<em>autoconversion</em> of many netCDF4 features to their closest
netCDF3-compatible representations.
Since converting netCDF4 to netCDF3 results in loss of features,
“automatic down-conversion” may be a more precise description of what
we term autoconversion.
</p>
<p><acronym>NCO</acronym> employs three algorithms to downconvert netCDF4 to netCDF3:
</p><ol>
<li> <a name="index-autoconversion"></a>
Autoconversion of atomic types:
Autoconversion automatically promotes <code>NC_UBYTE</code> to <code>NC_SHORT</code>,
and <code>NC_USHORT</code> to <code>NC_INT</code>.
It automatically demotes the three types <code>NC_UINT</code>,
<code>NC_UINT64</code>, and <code>NC_INT64</code> to <code>NC_INT</code>.
And it converts <code>NC_STRING</code> to <code>NC_CHAR</code>.
All numeric conversions work for attributes and variables of any rank.
Two numeric types (<code>NC_UBYTE</code> and <code>NC_USHORT</code>) are
<em>promoted</em> to types with greater range (and greater storage).
This extra range is often not used so promotion perhaps conveys
the wrong impression.
However, promotion never truncates values or loses data (this perhaps
justifies the extra storage).
Three numeric types (<code>NC_UINT</code>, <code>NC_UINT64</code> and
<code>NC_INT64</code>) are <em>demoted</em>.
Since the input range is larger than the output range, demotion can
result in numeric truncation and thus loss of data.
In such cases, it would possible to convert the data to floating point
values instead.
If this feature interests you, please be the squeaky wheel and let us
know.
<p>String conversions (to <code>NC_CHAR</code>) work for all attributes, but
not for variables.
This is because attributes are at most one-dimensional and may be of any
size whereas variables require gridded dimensions that usually do not
fit the ragged sizes of text strings.
Hence scalar <code>NC_STRING</code> attributes are correctly converted to and
stored as <code>NC_CHAR</code> attributes in the netCDF3 output file, but
<code>NC_STRING</code> variables are not correctly converted.
If this limitation annoys or enrages you, please let us know by being
the squeaky wheel.
</p>
</li><li> <a name="index-_002d_002dfix_005frec_005fdmn-all"></a>
Convert multiple record dimensions to fixed-size dimensions.
Many netCDF4 and <acronym>HDF5</acronym> datasets have multiple unlimited
dimensions.
Since a netCDF3 file may have at most one unlimited dimension, all but
possibly one unlimited dimension from the input file must be converted
to fixed-length dimensions prior to storing netCDF4 input as netCDF3
output.
By invoking <code>--fix_rec_dmn all</code> the user ensures the output file
will adhere to netCDF3 conventions and the user need not know the names
of the specific record dimensions to fix.
See <a href="#ncks-netCDF-Kitchen-Sink">ncks netCDF Kitchen Sink</a> for a description of the
‘<samp>--fix_rec_dmn</samp>’ option.
</li><li> <a name="index-flattening"></a>
Flattening (removal) of groups.
Many netCDF4 and <acronym>HDF5</acronym> datasets have group hierarchies.
Since a netCDF3 file may not have any groups, groups in the input file
must be removed.
This is also called “flattening” the hierarchical file.
See <a href="#Group-Path-Editing">Group Path Editing</a> for a description of the <acronym>GPE</acronym>
option ‘<samp>-G :</samp>’ to flatten files.
</li></ol>
<p>Putting the three algorithms together, one sees that the recipe to
convert netCDF4 to netCDF4 becomes increasingly complex as the netCDF4
features in the input file become more elaborate:
</p><div class="example">
<pre class="example"># Convert file with netCDF4 atomic types
ncks -3 in.nc4 out.nc3
# Convert file with multiple record dimensions + netCDF4 atomic types
ncks -3 --fix_rec_dmn=all in.nc4 out.nc3
# Convert file with groups, multiple record dimensions + netCDF4 atomic types
ncks -3 -G : --fix_rec_dmn=all in.nc4 out.nc3
</pre></div>
<p>Future versions of <acronym>NCO</acronym> may automatically invoke the record
dimension fixation and group flattening when converting to netCDF3
(rather than requiring it be specified manually).
If this feature would interest you, please let us know.
</p>
<a name="lfs"></a> <!-- http://nco.sf.net/nco.html#lfs --><hr>
<a name="Large-File-Support"></a>
<div class="header">
<p>
Next: <a href="#Subsetting-Files" accesskey="n" rel="next">Subsetting Files</a>, Previous: <a href="#File-Formats-and-Conversion" accesskey="p" rel="previous">File Formats and Conversion</a>, Up: <a href="#Common-features" accesskey="u" rel="up">Common features</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#General-Index" title="Index" rel="index">Index</a>]</p>
</div>
<a name="Large-File-Support-1"></a>
<h3 class="section">3.10 Large File Support</h3>
<a name="index-LFS-1"></a>
<a name="index-Large-File-Support-1"></a>
<table class="cartouche" border="1"><tr><td>
<p>Availability: All operators<br>
Short options: none<br>
Long options: none<br>
</p></td></tr></table>
<p><acronym>NCO</acronym> has Large File Support (<acronym>LFS</acronym>), meaning that
<acronym>NCO</acronym> can write files larger than 2 GB<!-- /@w --> on some 32-bit
operating systems with netCDF libraries earlier than version 3.6<!-- /@w -->.
If desired, LFS support must be configured when both netCDF and
<acronym>NCO</acronym> are installed.
netCDF versions 3.6<!-- /@w --> and higher support 64-bit file addresses as part
of the netCDF standard.
We recommend that users ignore LFS support which is difficult to
configure and is implemented in <acronym>NCO</acronym> only to support netCDF
versions prior to 3.6<!-- /@w -->.
This obviates the need for configuring explicit LFS support in
applications (such as <acronym>NCO</acronym>) that now support 64-bit files
directly through the netCDF interface.
See <a href="#File-Formats-and-Conversion">File Formats and Conversion</a> for instructions on accessing
the different file formats, including 64-bit files, supported by the
modern netCDF interface.
</p>
<p>If you are still interested in explicit LFS support for netCDF versions
prior to 3.6<!-- /@w -->, know that LFS support depends on a complex,
interlocking set of operating system
<a name="DOCF27" href="#FOOT27"><sup>27</sup></a>
and netCDF support issues.
The netCDF LFS
<a href="http://my.unidata.ucar.edu/content/software/netcdf/faq-lfs.html">FAQ</a>
describes the various file size limitations imposed by different
versions of the netCDF standard.
<acronym>NCO</acronym> and netCDF automatically attempt to configure LFS at
build time.
</p>
<a name="grp"></a> <!-- http://nco.sf.net/nco.html#grp -->
<a name="var"></a> <!-- http://nco.sf.net/nco.html#var -->
<a name="xcl"></a> <!-- http://nco.sf.net/nco.html#xcl -->
<a name="sbs"></a> <!-- http://nco.sf.net/nco.html#sbs -->
<a name="subset"></a> <!-- http://nco.sf.net/nco.html#subset --><hr>
<a name="Subsetting-Files"></a>
<div class="header">
<p>
Next: <a href="#Subsetting-Coordinate-Variables" accesskey="n" rel="next">Subsetting Coordinate Variables</a>, Previous: <a href="#Large-File-Support" accesskey="p" rel="previous">Large File Support</a>, Up: <a href="#Common-features" accesskey="u" rel="up">Common features</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#General-Index" title="Index" rel="index">Index</a>]</p>
</div>
<a name="Subsetting-Files-1"></a>
<h3 class="section">3.11 Subsetting Files</h3>
<a name="index-subsetting"></a>
<a name="index-union"></a>
<a name="index-intersection"></a>
<a name="index-exclusion"></a>
<a name="index-extraction"></a>
<a name="index-_002dv-var"></a>
<a name="index-_002d_002dvariable-var"></a>
<a name="index-_002dg-grp"></a>
<a name="index-_002d_002dgrp-grp"></a>
<a name="index-_002d_002dgroup-grp"></a>
<a name="index-_002dx"></a>
<a name="index-_002d_002dexclude"></a>
<a name="index-_002d_002dxcl"></a>
<a name="index-_002d_002dunn"></a>
<a name="index-_002d_002dunion"></a>
<table class="cartouche" border="1"><tr><td>
<p>Options <code>--unn</code><br>
Availability: <code>ncbo</code>, <code>nces</code>,
<code>ncecat</code>, <code>ncflint</code>, <code>ncks</code>, <code>ncpdq</code>,
<code>ncra</code>, <code>ncrcat</code>, <code>ncwa</code><br>
Short options: <br>
Long options: ‘<samp>--unn</samp>’ and ‘<samp>--union</samp>’<br>
Options <code>-g <var>grp</var></code><br>
Availability: <code>ncbo</code>, <code>nces</code>,
<code>ncecat</code>, <code>ncflint</code>, <code>ncks</code>, <code>ncpdq</code>,
<code>ncra</code>, <code>ncrcat</code>, <code>ncwa</code><br>
Short options: ‘<samp>-g</samp>’<br>
Long options: ‘<samp>--grp</samp>’ and ‘<samp>--group</samp>’<br>
Options <code>-v <var>var</var></code> and <code>-x</code><br>
Availability: (<code>ncap2</code>), <code>ncbo</code>, <code>nces</code>,
<code>ncecat</code>, <code>ncflint</code>, <code>ncks</code>, <code>ncpdq</code>,
<code>ncra</code>, <code>ncrcat</code>, <code>ncwa</code><br>
Short options: ‘<samp>-v</samp>’, ‘<samp>-x</samp>’<br>
Long options: ‘<samp>--variable</samp>’, ‘<samp>--exclude</samp>’ or ‘<samp>--xcl</samp>’<br>
</p></td></tr></table>
<p>Subsetting variables refers to explicitly specifying variables and
groups to be included or excluded from operator actions.
Subsetting is controlled by the ‘<samp>-v <var>var</var>[,…]</samp>’ and
‘<samp>-x</samp>’ options for directly specifying variables.
Specifying groups, whether in addition to or instead of variables,
is quite similar and is controlled by the ‘<samp>-g <var>grp</var>[,…]</samp>’
and ‘<samp>-x</samp>’ options.
A list<!-- /@w --> of variables or groups to extract is specified following the
‘<samp>-v</samp>’ and ‘<samp>-g</samp>’ options, e.g., ‘<samp>-v time,lat,lon</samp>’ or
‘<samp>-g grp1,grp2</samp>’.
Both options may be specified simultaneously and <acronym>NCO</acronym> will
extract the intersection of the lists, i.e., only variables of the
specified names found in groups of the specified names.
The ‘<samp>--unn</samp>’ option causes <acronym>NCO</acronym> to extract the
union, rather than the intersection, of the specified groups and
variables.
Not using the ‘<samp>-v</samp>’ or ‘<samp>-g</samp>’ option is equivalent to specifying
all variables or groupp, respectively.
The ‘<samp>-x</samp>’ option causes the list of variables specified with
‘<samp>-v</samp>’ to be <em>excluded</em> rather than <em>extracted</em>.
Thus ‘<samp>-x</samp>’ saves typing when you only want to extract fewer than
half of the variables in a file.
</p>
<p>Variables or groups explicitly specified for extraction with
‘<samp>-v <var>var</var>[,…]</samp>’ or ‘<samp>-g <var>grp</var>[,…]</samp>’
<em>must</em> be present in the input file or an error will result.
Variables explicitly specified for <em>exclusion</em> with
‘<samp>-x -v <var>var</var>[,…]</samp>’ need not be present in the input
file.
To accord with the sophistication of the underlying hierarchy,
group subsetting is controlled by a few powerful yet subtle syntactical
distinctions.
When learning this syntax it is helpful to keep in mind the similarity
between group hierarchies and directory structures.
</p>
<a name="index-mv"></a>
<a name="index-cp"></a>
<a name="index-recursion"></a>
<a name="index-recursive"></a>
<a name="index-anchor"></a>
<a name="index-anchoring"></a>
<a name="rcr"></a> <!-- http://nco.sf.net/nco.html#rcr -->
<a name="recursion"></a> <!-- http://nco.sf.net/nco.html#recursion -->
<a name="recursive"></a> <!-- http://nco.sf.net/nco.html#recursive -->
<a name="ncr"></a> <!-- http://nco.sf.net/nco.html#ncr -->
<a name="anchor"></a> <!-- http://nco.sf.net/nco.html#anchor -->
<a name="anchoring"></a> <!-- http://nco.sf.net/nco.html#anchoring --><p>Two properties of subsetting, recursion and anchoring, are best
illustrated by reminding the user of their <acronym>UNIX</acronym> equivalents.
The <acronym>UNIX</acronym> command <code>mv src dst</code> moves <samp>src</samp>
<em>and all its subdirectories</em> (and all their subdirectories etc.)
to <samp>dst</samp>.
In other words <code>mv</code> is, by default, <em>recursive</em>.
In contrast, the <acronym>UNIX</acronym> command <code>cp src dst</code> moves
<samp>src</samp>, and only <samp>src</samp>, to <samp>dst</samp>,
If <samp>src</samp> is a directory, not a file, then that command fails.
One must explicitly request to copy directories recursively, i.e.,
with <code>cp -r src dst</code>.
In <acronym>NCO</acronym> recursive extraction (and copying) of groups is the
default (like with <code>mv</code>, not with <code>cp</code>).
Recursion is turned off by appending a trailing slash to the path.
</p>
<p>These <acronym>UNIX</acronym> commands also illustrate a property we call
<em>anchoring</em>.
The command <code>mv src dst</code> moves (recursively) the source
directory <samp>src</samp> to the destination directory <samp>dst</samp>.
If <samp>src</samp> begins with the slash character then the specified path is
relative to the root directory, otherwise the path is relative to the
current working directory.
In other words, an initial slash character anchors the subsequent path
to the root directory.
In <acronym>NCO</acronym> an initial slash anchors the path at the root group.
Paths that begin and end with slash characters (e.g., <samp>//</samp>,
<samp>/g1/</samp>, and <samp>/g1/g2/</samp>) are both anchored and non-recursive.
</p>
<p>Consider the following commands, all of which may be assumed to end with
‘<samp>in.nc out.nc</samp>’:
</p><div class="example">
<pre class="example">ncks -g g1 # Extract, recursively, all groups with a g1 component
ncks -g g1/ # Extract, non-recursively, all groups terminating in g1
ncks -g /g1 # Extract, recursively, root group g1
ncks -g /g1/ # Extract, non-recursively root group g1
ncks -g // # Extract, non-recursively the root group
</pre></div>
<p>The first command is probably the most useful and common.
It would extract these groups, if present, and all their direct
ancestors and children:
<samp>/g1</samp>, <samp>/g2/g1</samp>, and <samp>/g3/g1/g2</samp>.
In other words, the simplest form of ‘<samp>-g grp</samp>’ grabs all groups that
(and their direct ancestors and children, recursively) that have
<samp>grp</samp> as a complete component of their path.
A simple string match is insufficient, <var>grp</var> must be a complete
component (i.e., group name) in the path.
The option ‘<samp>-g g1</samp>’ would not extract these groups because <samp>g1</samp>
is not a complete component of the path: <samp>/g12</samp>, <samp>/fg1</samp>, and
<samp>/g1g1</samp>.
The second command above shows how a terminating slash character
<kbd>/</kbd> cancels the recursive copying of groups.
An argument to ‘<samp>-g</samp>’ which terminates with a slash character
extracts the group and its direct ancestors, but none of its children.
The third command above shows how an initial slash character <kbd>/</kbd>
anchors the argument to the root group.
The third command would not extract the group <samp>/g2/g1</samp> because
the <samp>g1</samp> group is not at the root level, but it would extract,
any group <samp>/g1</samp> at the root level and all its children,
recursively.
The fourth command is the non-recursive version of the third command.
The fifth command is a special case of the fourth command.
</p>
<a name="unn"></a> <!-- http://nco.sf.net/nco.html#unn -->
<a name="nsx"></a> <!-- http://nco.sf.net/nco.html#nsx -->
<a name="union"></a> <!-- http://nco.sf.net/nco.html#union -->
<a name="intersection"></a> <!-- http://nco.sf.net/nco.html#intersection --><a name="index-union-1"></a>
<a name="index-intersection-1"></a>
<a name="index-_002d_002dunn-1"></a>
<a name="index-_002d_002dunion-1"></a>
<a name="index-_002d_002dnsx"></a>
<a name="index-_002d_002dintersection"></a>
<p>As mentioned above, both ‘<samp>-v</samp>’ and ‘<samp>-g</samp>’ options may be
specified simultaneously and <acronym>NCO</acronym> will, by default, extract the
intersection of the lists, i.e., the specified variables found in the
specified groups
<a name="DOCF28" href="#FOOT28"><sup>28</sup></a>.
The ‘<samp>--unn</samp>’ option causes <acronym>NCO</acronym> to extract the
union, rather than the intersection, of the specified groups and
variables.
Consider the following commands (which may be assumed to end with
‘<samp>in.nc out.nc</samp>’):
</p><div class="example">
<pre class="example"># Intersection-mode subsetting (default)
ncks -g g1 -v v1 # Yes: /g1/v1, /g2/g1/v1. No: /v1, /g2/v1
ncks -g /g1 -v v1 # Yes: /g1/v1, /g1/g2/v1. No: /v1, /g2/v1, /g2/g1/v1
ncks -g g1/ -v v1 # Yes: /g1/v1, /g2/g1/v1. No: /v1, /g2/v1, /g1/g2/v1
ncks -v g1/v1 # Yes: /g1/v1, /g2/g1/v1. No: /v1, /g2/v1, /g1/g2/v1
ncks -g /g1/ -v v1 # Yes: /g1/v1. No: /g2/g1/v1, /v1, /g2/v1 ...
ncks -v /g1/v1 # Yes: /g1/v1. No: /g2/g1/v1, /v1, /g2/v1 ...
# Union-mode subsetting (invoke with --unn or --union)
ncks -g g1 -v v1 --unn # All variables in g1 or progeny, or named v1
ncks -g /g1 -v v1 --unn # All variables in /g1 or progeny, or named v1
ncks -g g1/ -v v1 --unn # All variables in g1 or named v1
ncks -g /g1/ -v v1 --unn # All variables in /g1 or named v1
</pre></div>
<p>The first command (‘<samp>-g g1 -v v1</samp>’) extracts the variable <samp>v1</samp>
from any group named <samp>g1</samp> or descendent <samp>g1</samp>.
The second command extracts <samp>v1</samp> from any root group
named <samp>g1</samp> and any descendent groups as well.
The third and fourth commands are equivalent ways of extracting
<samp>v1</samp> only from the root group named <samp>g1</samp> (not its
descendents).
The fifth and sixth commands are equivalent ways of extracting the
variable <samp>v1</samp> only from the root group named <samp>g1</samp>.
Subsetting in union-mode (with ‘<samp>--unn</samp>’) causes all variables to be
extracted which meet either one or both of the specifications of the
variable and group specifications.
Union-mode subsetting is simply the logical “OR” of intersection-mode
subsetting.
As discussed below, the group and variable specifications may be comma
separated lists of regular expressions for added control over
subsetting.
</p>
<a name="index-memory-requirements-1"></a>
<p>Remember, if averaging or concatenating large files stresses your
systems memory or disk resources, then the easiest solution is often to
subset (with ‘<samp>-g</samp>’ and/or ‘<samp>-v</samp>’) to retain only the most
important variables (see <a href="#Memory-Requirements">Memory Requirements</a>).
</p><div class="example">
<pre class="example">ncks in.nc out.nc # Extract all groups and variables
ncks -v scl # Extract variable scl from all groups
ncks -g g1 # Extract group g1 and descendents
ncks -x -g g1 # Extract all groups except g1 and descendents
ncks -g g2,g3 -v scl # Extract scl from groups g2 and g3
</pre></div>
<p>Overwriting and appending work as expected:
</p><div class="example">
<pre class="example"># Replace scl in group g2 in out.nc with scl from group g2 from in.nc
ncks -A -g g2 -v scl in.nc out.nc
</pre></div>
<p>Due to its special capabilities, <code>ncap2</code> interprets the
‘<samp>-v</samp>’ switch differently
(see <a href="#ncap2-netCDF-Arithmetic-Processor">ncap2 netCDF Arithmetic Processor</a>).
For <code>ncap2</code>, the ‘<samp>-v</samp>’ switch takes no arguments and
indicates that <em>only</em> user-defined variables should be output.
<code>ncap2</code> neither accepts nor understands the <var>-x</var> and
<var>-g</var> switches.
</p>
<a name="rx"></a> <!-- http://nco.sf.net/nco.html#rx -->
<a name="wildcarding"></a> <!-- http://nco.sf.net/nco.html#wildcarding --><a name="index-extended-regular-expressions-1"></a>
<a name="index-regular-expressions-2"></a>
<a name="index-pattern-matching-1"></a>
<a name="index-wildcards-1"></a>
<a name="index-grep-_002dE"></a>
<a name="index-egrep"></a>
<a name="index-ncatted"></a>
<a name="index-GNU-1"></a>
<p>Regular expressions the syntax that <acronym>NCO</acronym> use pattern-match
object names in netCDF file against user requests.
The user can select all variables beginning with the string ‘<samp>DST</samp>’
from an input file by supplying the regular expression ‘<samp>^DST</samp>’ to
the ‘<samp>-v</samp>’ switch, i.e., ‘<samp>-v '^DST'</samp>’.
The meta-characters used to express pattern matching operations are
‘<samp>^$+?.*[]{}|</samp>’.
If the regular expression pattern matches <em>any</em> part of a variable
name then that variable is selected.
This capability is also called <em>wildcarding</em>, and is very useful for
sub-setting large data files.
</p>
<p>Extended regular expressions are defined by the <acronym>POSIX</acronym>
<code>grep -E</code> (aka <code>egrep</code>) command.
As of <acronym>NCO</acronym> 2.8.1 (August, 2003), variable name arguments
to the ‘<samp>-v</samp>’ switch may contain <em>extended regular expressions</em>.
As of <acronym>NCO</acronym> 3.9.6 (January, 2009), variable names arguments
to <code>ncatted</code> may contain <em>extended regular expressions</em>.
As of <acronym>NCO</acronym> 4.2.4 (November, 2012), group name arguments
to the ‘<samp>-g</samp>’ switch may contain <em>extended regular expressions</em>.
</p>
<a name="index-POSIX-1"></a>
<a name="index-regex"></a>
<p>Because of its wide availability, <acronym>NCO</acronym> uses the <acronym>POSIX</acronym>
regular expression library <code>regex</code>.
Regular expressions of arbitary complexity may be used.
Since netCDF variable names are relatively simple constructs, only a
few varieties of variable wildcards are likely to be useful.
For convenience, we define the most useful pattern matching operators
here:
<a name="index-_002e-_0028wildcard-character_0029"></a>
<a name="index-_0024-_0028wildcard-character_0029"></a>
<a name="index-_005e-_0028wildcard-character_0029"></a>
<a name="index-_003f-_0028filename-expansion_0029"></a>
<a name="index-_002a-_0028filename-expansion_0029"></a>
</p><dl compact="compact">
<dt>‘<samp>^</samp>’</dt>
<dd><p>Matches the beginning of a string
</p></dd>
<dt>‘<samp>$</samp>’</dt>
<dd><p>Matches the end of a string
</p></dd>
<dt>‘<samp>.</samp>’</dt>
<dd><p>Matches any single character
</p></dd>
</dl>
<p>The most useful repetition and combination operators are
<a name="index-_003f-_0028wildcard-character_0029"></a>
<a name="index-_002a-_0028wildcard-character_0029"></a>
<a name="index-_002b-_0028wildcard-character_0029"></a>
<a name="index-_007c-_0028wildcard-character_0029"></a>
</p><dl compact="compact">
<dt>‘<samp>?</samp>’</dt>
<dd><p>The preceding regular expression is optional and matched at most once
</p></dd>
<dt>‘<samp>*</samp>’</dt>
<dd><p>The preceding regular expression will be matched zero or more times
</p></dd>
<dt>‘<samp>+</samp>’</dt>
<dd><p>The preceding regular expression will be matched one or more times
</p></dd>
<dt>‘<samp>|</samp>’</dt>
<dd><p>The preceding regular expression will be joined to the following regular
expression.
The resulting regular expression matches any string matching either
subexpression.
</p></dd>
</dl>
<p>To illustrate the use of these operators in extracting variables
and groups, consider file <samp>in_grp.nc</samp> with groups
<code>g0</code>–<code>g9</code>, and subgroups <code>s0</code>–<code>s9</code>, in each of
those groups, and file <samp>in.nc</samp> with variables <code>Q</code>,
<code>Q01</code>–<code>Q99</code>, <code>Q100</code>, <code>QAA</code>–<code>QZZ</code>,
<code>Q_H2O</code>, <code>X_H2O</code>, <code>Q_CO2</code>, <code>X_CO2</code>.
</p><div class="example">
<pre class="example">ncks -v '.+' in.nc # All variables (default)
ncks -v 'Q.?' in.nc # Variables that contain Q
ncks -v '^Q.?' in.nc # Variables that start with Q
ncks -v '^Q+.?.' in.nc # Q, Q0--Q9, Q01--Q99, QAA--QZZ, etc.
ncks -v '^Q..' in.nc # Q01--Q99, QAA--QZZ, etc.
ncks -v '^Q[0-9][0-9]' in.nc # Q01--Q99, Q100
ncks -v '^Q[[:digit:]]{2}' in.nc # Q01--Q99
ncks -v 'H2O$' in.nc # Q_H2O, X_H2O
ncks -v 'H2O$|CO2$' in.nc # Q_H2O, X_H2O, Q_CO2, X_CO2
ncks -v '^Q[0-9][0-9]$' in.nc # Q01--Q99
ncks -v '^Q[0-6][0-9]|7[0-3]' in.nc # Q01--Q73, Q100
ncks -v '(Q[0-6][0-9]|7[0-3])$' in.nc # Q01--Q73
ncks -v '^[a-z]_[a-z]{3}$' in.nc # Q_H2O, X_H2O, Q_CO2, X_CO2
ncks -g 'g.' in_grp.nc # 10 Groups g0-g9
ncks -g 's.' in_grp.nc # 100 sub-groups g0/s0, g0/s1, ... g9/s9
ncks -g 'g.' -v 'v.' in_grp.nc # All variables 'v.' in groups 'g.'
</pre></div>
<p>Beware—two of the most frequently used repetition pattern matching
operators, ‘<samp>*</samp>’ and ‘<samp>?</samp>’, are also valid pattern matching
operators for filename expansion (globbing) at the shell-level.
Confusingly, their meanings in extended regular expressions and in
shell-level filename expansion are significantly different.
In an extended regular expression, ‘<samp>*</samp>’ matches zero or more
occurences of the preceding regular expression.
Thus ‘<samp>Q*</samp>’ selects all variables, and ‘<samp>Q+.*</samp>’ selects all
variables containing ‘<samp>Q</samp>’ (the ‘<samp>+</samp>’ ensures the preceding item
matches at least once).
To match zero or one occurence of the preceding regular expression,
use ‘<samp>?</samp>’.
Documentation for the <acronym>UNIX</acronym> <code>egrep</code> command details the
extended regular expressions which <acronym>NCO</acronym> supports.
</p>
<a name="globbing"></a> <!-- http://nco.sf.net/nco.html#globbing -->
<a name="glb"></a> <!-- http://nco.sf.net/nco.html#glb --><a name="index-globbing-2"></a>
<a name="index-shell-1"></a>
<a name="index-bash"></a>
<a name="index-csh"></a>
<a name="index-quotes"></a>
<p>One must be careful to protect any special characters in the regular
expression specification from being interpreted (globbed) by the shell.
This is accomplish by enclosing special characters within single or
double quotes
</p><div class="example">
<pre class="example">ncra -v Q?? in.nc out.nc # Error: Shell attempts to glob wildcards
ncra -v '^Q+..' in.nc out.nc # Correct: NCO interprets wildcards
ncra -v '^Q+..' in*.nc out.nc # Correct: NCO interprets, Shell globs
</pre></div>
<p>The final example shows that commands may use a combination of variable
wildcarding and shell filename expansion (globbing).
For globbing, ‘<samp>*</samp>’ and ‘<samp>?</samp>’ <em>have nothing to do</em> with the
preceding regular expression!
In shell-level filename expansion, ‘<samp>*</samp>’ matches any string,
including the null string and ‘<samp>?</samp>’ matches any single character.
Documentation for <code>bash</code> and <code>csh</code> describe the rules of
filename expansion (globbing).
</p>
<a name="crd"></a> <!-- http://nco.sf.net/nco.html#crd -->
<a name="-C"></a> <!-- http://nco.sf.net/nco.html#-C -->
<a name="-c"></a> <!-- http://nco.sf.net/nco.html#-c --><hr>
<a name="Subsetting-Coordinate-Variables"></a>
<div class="header">
<p>
Next: <a href="#Group-Path-Editing" accesskey="n" rel="next">Group Path Editing</a>, Previous: <a href="#Subsetting-Files" accesskey="p" rel="previous">Subsetting Files</a>, Up: <a href="#Common-features" accesskey="u" rel="up">Common features</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#General-Index" title="Index" rel="index">Index</a>]</p>
</div>
<a name="Subsetting-Coordinate-Variables-1"></a>
<h3 class="section">3.12 Subsetting Coordinate Variables</h3>
<a name="index-subsetting-1"></a>
<a name="index-_002dC"></a>
<a name="index-_002dc"></a>
<a name="index-_002d_002dno_002dcoords"></a>
<a name="index-_002d_002dno_002dcrd"></a>
<a name="index-_002d_002dcoords"></a>
<a name="index-_002d_002dcrd"></a>
<table class="cartouche" border="1"><tr><td>
<p>Availability: <code>ncap2</code>, <code>ncbo</code>, <code>nces</code>,
<code>ncecat</code>, <code>ncflint</code>, <code>ncks</code>, <code>ncpdq</code>,
<code>ncra</code>, <code>ncrcat</code>, <code>ncwa</code><br>
Short options: ‘<samp>-C</samp>’, ‘<samp>-c</samp>’<br>
Long options: ‘<samp>--no-coords</samp>’, ‘<samp>--no-crd</samp>’, ‘<samp>--crd</samp>’, ‘<samp>--coords</samp>’<br>
</p></td></tr></table>
<p>By default, coordinates variables associated with any variable appearing
in the <var>input-file</var> will be placed in the <var>output-file</var>, even
if they are not explicitly specified, e.g., with the ‘<samp>-v</samp>’ switch.
Thus variables with a latitude coordinate <code>lat</code> always carry the
values of <code>lat</code> with them into the <var>output-file</var>.
This feature can be disabled with ‘<samp>-C</samp>’, which causes <acronym>NCO</acronym>
to not automatically add coordinates to the variables appearing in the
<var>output-file</var>.
However, using ‘<samp>-C</samp>’ does not preclude the user from including some
coordinates in the output files simply by explicitly selecting the
coordinates with the <var>-v</var> option.
The ‘<samp>-c</samp>’ option, on the other hand, is a shorthand way of
automatically specifying that <em>all</em> coordinate variables in the
<var>input-files</var> should appear in the <var>output-file</var>.
Thus ‘<samp>-c</samp>’ allows the user to select all the coordinate variables
without having to know their names.
<a name="index-CF-conventions"></a>
As of <acronym>NCO</acronym> version 3.9.6 (January, 2009)
both ‘<samp>-c</samp>’ and ‘<samp>-C</samp>’ honor the <acronym>CF</acronym> <code>coordinates</code>
convention described in <a href="#CF-Conventions">CF Conventions</a>.
As of <acronym>NCO</acronym> version 4.0.8 (April, 2011)
both ‘<samp>-c</samp>’ and ‘<samp>-C</samp>’ honor the <acronym>CF</acronym> <code>bounds</code>
convention described in <a href="#CF-Conventions">CF Conventions</a>.
</p>
<a name="gpe"></a> <!-- http://nco.sf.net/nco.html#gpe --><hr>
<a name="Group-Path-Editing"></a>
<div class="header">
<p>
Next: <a href="#C-and-Fortran-Index-Conventions" accesskey="n" rel="next">C and Fortran Index Conventions</a>, Previous: <a href="#Subsetting-Coordinate-Variables" accesskey="p" rel="previous">Subsetting Coordinate Variables</a>, Up: <a href="#Common-features" accesskey="u" rel="up">Common features</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#General-Index" title="Index" rel="index">Index</a>]</p>
</div>
<a name="Group-Path-Editing-1"></a>
<h3 class="section">3.13 Group Path Editing</h3>
<a name="index-_002dG-gpe_005fdsc"></a>
<a name="index-_002d_002dgpe-gpe_005fdsc"></a>
<table class="cartouche" border="1"><tr><td>
<p>Options <code>-G <var>gpe_dsc</var></code><br>
Availability: <code>ncbo</code>, <code>ncecat</code>, <code>nces</code>,
<code>ncflint</code>, <code>ncks</code>, <code>ncpdq</code>, <code>ncra</code>,
<code>ncrcat</code>, <code>ncwa</code><br>
Short options: ‘<samp>-G</samp>’<br>
Long options: ‘<samp>--gpe</samp>’<br>
</p></td></tr></table>
<p><em>Group Path Editing</em>, or <acronym>GPE</acronym>, allows the user to
restructure (i.e., add, remove, and rename groups) in the output file
relative to the input file based on the instructions they provide.
As of <acronym>NCO</acronym> 4.2.3 (November, 2012), all operators that accept
netCDF4 files with groups accept the ‘<samp>-G</samp>’ switch, or its
long-option equivalent ‘<samp>--gpe</samp>’.
To master <acronym>GPE</acronym> one must understand the meaning of the
required <var>gpe_dsc</var> structure/argument that specifies the
transformation of input-to-output group paths.
</p>
<p>Each <var>gpe_dsc</var> contains up to three elements (two are optional) in
the following order:<br>
<var>gpe_dsc</var> = <var>grp_pth</var>:<var>lvl_nbr</var> or <var>grp_pth</var>@<var>lvl_nbr</var>
</p>
<dl compact="compact">
<dt><var>grp_pth</var></dt>
<dd><p>Group Path.
<a name="index-group-path"></a>
This (optional) component specifies the output group path that should be
appended after any editing (i.e., deletion or truncation) of the input
path is performed.
</p></dd>
<dt><var>lvl_nbr</var></dt>
<dd><p>The number of levels to delete (from the head) or truncate (from the
tail) of the input path.
</p></dd>
</dl>
<p>If both components of the argument are present, then a single character,
either the colon or at-sign (<code>:</code> or <code>@</code>), must separate them.
If only <var>grp_pth</var> is specifed, the separator character may be
omitted, e.g., ‘<samp>-G g1</samp>’.
If only <var>lvl_nbr</var> is specifed, the separator character is still
required to indicate it is a <var>lvl_nbr</var> arugment and not a
<var>grp_pth</var>, e.g., ‘<samp>-G :-1</samp>’ or ‘<samp>-G @1</samp>’.
</p>
<p>If the at-sign separator character <code>@</code> is used instead of the colon
separator character <code>:</code>, then the following <var>lvl_nbr</var> arugment
must be positive and it will be assumed to refer to Truncation-Mode.
Hence, ‘<samp>-G :-1</samp>’ is the same as ‘<samp>-G @1</samp>’.
This is simply a way of making the <var>lvl_nbr</var> argument
positive-definite.
</p>
<a name="flatten"></a> <!-- http://nco.sf.net/nco.html#flatten -->
<a name="delete"></a> <!-- http://nco.sf.net/nco.html#delete -->
<a name="truncate"></a> <!-- http://nco.sf.net/nco.html#truncate --><a name="index-_0040-_0028separator-character_0029"></a>
<a name="index-_003a-_0028separator-character_0029"></a>
<a name="index-delete-_0028groups_0029"></a>
<a name="index-truncate-_0028groups_0029"></a>
<a name="index-flatten-_0028groups_0029"></a>
<p><acronym>GPE</acronym> has three editing modes: Delete, Truncate, and
Flatten.
Select one of <acronym>GPE</acronym>’s three editing modes by supplying a
<var>lvl_nbr</var> that is positive, negative, or zero for Delete-,
Truncate- and Flatten-mode, respectively.
</p>
<p>In Delete-mode, <var>lvl_nbr</var> is a positive integer which specifies
the maximum number of group path components (i.e., groups) that
<acronym>GPE</acronym> will try to delete from the head of <var>grp_pth</var>.
For example <em><var>lvl_nbr</var> = 3</em> changes the input path
<samp>/g1/g2/g3/g4/g5</samp> to the output path <samp>/g4/g5</samp>.
Input paths with <var>lvl_nbr</var> or fewer components (groups)
are completely erased and the output path commences from the root
level.
</p>
<p>In other words, <acronym>GPE</acronym> is tolerant of specifying too many group
components to delete.
It deletes as many as possible, without complaint, and then begins to
flatten the file (which will fail if namespace conflicts arise).
</p>
<p>In Truncate-mode, <var>lvl_nbr</var> is a negative integer which specifies
the maximum number of group path components (i.e., groups) that
<acronym>GPE</acronym> will try to truncate from the tail of <var>grp_pth</var>.
For example <em><var>lvl_nbr</var> = -3</em> changes the input path
<samp>/g1/g2/g3/g4/g5</samp> to the output path <samp>/g1/g2</samp>.
Input paths with <var>lvl_nbr</var> or fewer components (groups)
are completely erased and the output path commences from the root
level.
</p>
<p>In Flatten-mode, indicated by the separator character alone
or with <em><var>lvl_nbr</var> = 0</em>, <acronym>GPE</acronym> removes the entire group
path from the input file and constructs the output path beginning at the
root level.
For example <code>-G :0</code> and <code>-G :</code> are identical and change the
input path <samp>/g1/g2/g3/g4/g5</samp> to the output path <samp>/</samp> whereas
<code>-G g1:0</code> and <code>-G g1:</code> are identical and result in the output
path <samp>/g1</samp> for all variables.
</p>
<p>Subsequent to the alteration of the input path by the specified
editing mode, if any, <acronym>GPE</acronym> prepends (in Delete Mode)
or Appends (in Truncate-mode) any specifed <var>grp_pth</var> to the output
path.
For example <code>-G g2</code> changes the input paths <samp>/</samp> and <samp>/g1</samp>
to <samp>/g2</samp> and <samp>/g1/g2</samp>, respectively.
Likewise, <code>-G g2/g3</code> changes the input paths <samp>/</samp> and <samp>/g1</samp>
to <samp>/g2/g3</samp> and <samp>/g1/g2/g3</samp>, respectively.
When <var>grp_pth</var> and <var>lvl_nbr</var> are both specified, the editing
actions are taken in sequence so that, e.g., <code>-G g1/g2:2</code>
changes the input paths <samp>/</samp> and <samp>/h1/h2/h3/h4</samp>
to <samp>/g1/g2</samp> and <samp>/g1/g2/h3/h4</samp>, respectively.
Likewise, <code>-G g1/g2:-2</code> changes the input paths <samp>/</samp> and
<samp>/h1/h2/h3/h4</samp> to <samp>/g1/g2</samp> and <samp>/h1/h2/g1/g2</samp>,
respectively.
</p>
<p>Combining <acronym>GPE</acronym> with subsetting (see <a href="#Subsetting-Files">Subsetting Files</a>)
yields powerful control over the extracted (or excluded) variables and
groups and their placement in the output file as shown by the following
commands.
All commands below may be assumed to end with ‘<samp>in.nc out.nc</samp>’.
</p><div class="example">
<pre class="example"># Prepending paths without editing:
ncks # /g?/v? -> /g?/v?
ncks -v v1 # /g?/v1 -> /g?/v1
ncks -g g1 # /g1/v? -> /g1/v?
ncks -G o1 # /g?/v? -> /o1/g?/v?
ncks -G o1 -g g1 # /g1/v? -> /o1/g1/v?
ncks -g g1 -v v1 # /g1/v1 -> /g1/v1
ncks -G o1 -v v1 # /g?/v1 -> /o1/g?/v1
ncks -G o1 -g g1 -v v1 # /g1/v1 -> /o1/g1/v1
ncks -G g1 -g / -v v1 # /v1 -> /g1/v1
ncks -G g1/g2 -v v1 # /g?/v1 -> /g1/g2/g?/v1
# Delete-mode: Delete from and Prepend to path head
# Syntax: -G [ppn]:lvl_nbr = # of levels to delete
ncks -G :1 -g g1 -v v1 # /g1/v1 -> /v1
ncks -G :1 -g g1/g1 -v v1 # /g1/g1/v1 -> /g1/v1
ncks -G :2 -g g1/g1 -v v1 # /g1/g1/v1 -> /v1
ncks -G :2 -g g1 -v v1 # /g1/v1 -> /v1
ncks -G g2:1 -g g1 -v v1 # /g1/v1 -> /g2/v1
ncks -G g2:2 -g g1/g1 -v v1 # /g1/g1/v1 -> /g2/v1
ncks -G g2:1 -g / -v v1 # /v1 -> /g2/v1
ncks -G g2:1 -v v1 # /v1 -> /g2/v1
ncks -G g2:1 -g g1/g1 -v v1 # /g1/g1/v1 -> /g2/g1/v1
# Flatten-mode: Remove all input path components
# Syntax: -G [apn]: colon without numerical argument
ncks -G : -v v1 # /g?/v1 -> /v1
ncks -G : -g g1 -v v1 # /g1/v1 -> /v1
ncks -G : -g g1/g1 -v v1 # /g1/g1/v1 -> /v1
ncks -G g2: -v v1 # /g?/v1 -> /g2/v1
ncks -G g2: # /g?/v? -> /g2/v?
ncks -G g2: -g g1/g1 -v v1 # /g1/g1/v1 -> /g2/v1
# Truncate-mode: Truncate from and Append to path tail
# Syntax: -G [apn]:-lvl_nbr = # of levels to truncate
# NB: -G [apn]:-lvl_nbr is equivalent to -G [apn]@lvl_nbr
ncks -G :-1 -g g1 -v v1 # /g1/v1 -> /v1
ncks -G :-1 -g g1/g2 -v v1 # /g1/g2/v1 -> /g1/v1
ncks -G :-2 -g g1/g2 -v v1 # /g1/g2/v1 -> /v1
ncks -G :-2 -g g1 -v v1 # /g1/v1 -> /v1
ncks -G g2:-1 -v v1 # /g?/v1 -> /g2/v1
ncks -G g2:-1 -g g1 -v v1 # /g1/v1 -> /g2/v1
ncks -G g1:-1 -g g1/g2 -v v1 # /g1/g2/v1 -> /g1/g1/v1
</pre></div>
<a name="mv"></a> <!-- http://nco.sf.net/nco.html#mv -->
<a name="move"></a> <!-- http://nco.sf.net/nco.html#move --><a name="index-move-groups"></a>
<a name="index-groups_002c-moving"></a>
<a name="index-rename-groups"></a>
<a name="index-groups_002c-renaming"></a>
<p>Until fall 2013 (netCDF version 4.3.1-pre1), netCDF contained no library
function for renaming groups, and therefore <code>ncrename</code> cannot
rename groups.
However, <acronym>NCO</acronym> built on earlier versions of netCDF than 4.3.1
can use a <acronym>GPE</acronym>-based workaround mechanism to “rename”
groups.
The <acronym>GPE</acronym> mechanism actually <em>moves</em> (i.e., copies to a new
location) groups, a more arduous procedure than simply renaming them.
<acronym>GPE</acronym> applies to all selected groups, so, in the general case,
one must move only the desired group to a new file, and then merge that
new file with the original to obtain a file where the desired group has
been “renamed” and all else is unchanged.
Here is how to “rename” group <samp>/g4</samp> to group <samp>/f4</samp> with
<acronym>GPE</acronym> instead of <code>ncrename</code>
</p><div class="example">
<pre class="example">ncks -O -G f4:1 -g g4 ~/nco/data/in_grp.nc ~/tmp.nc # Move /g4 to /f4
ncks -O -x -g g4 ~/nco/data/in_grp.nc ~/out.nc # Excise /g4
ncks -A ~/tmp.nc ~/out.nc # Add /f4 to new file
</pre></div>
<p>If the original group <samp>g4</samp> is not excised from <samp>out.nc</samp> (step
two above), then the final output file would contain both <samp>g4</samp> and
a copy named <samp>f4</samp>.
Thus GPE can be used to both “rename” and copy groups.
The recommended way to rename groups when when netCDF version 4.3.1 is
availale is to use <code>ncrename</code> (see <a href="#ncrename-netCDF-Renamer">ncrename netCDF Renamer</a>).
</p>
<a name="xmp_flt"></a> <!-- http://nco.sf.net/nco.html#xmp_flt --><p>One may wish to flatten hierarchical group files for many reasons.
These include 1. Obtaining<!-- /@w --> flat netCDF3 files for use with tools
that do not work with netCDF4 files, 2. Splitting<!-- /@w --> apart
hierarchies to re-assemble into different hierarchies, and
3. Providing<!-- /@w --> a subset of a hierarchical file with the simplest
possible storage structure.
</p><div class="example">
<pre class="example">ncks -O -G : -g cesm -3 ~/nco/data/cmip5.nc ~/cesm.nc # Extract /cesm to /
</pre></div>
<p>The <samp>-3</samp> switch
<a name="DOCF29" href="#FOOT29"><sup>29</sup></a>
specifies the output dataset should be in netCDF3
format, the <samp>-G :</samp> option flattens all extracted groups, and the
<samp>-g cesm</samp> option extracts only the <code>cesm</code> group and leaves
all other groups (e.g., <code>ecmwf</code>, <code>giss</code>).
</p>
<a name="dismember"></a> <!-- http://nco.sf.net/nco.html#dismember -->
<a name="disaggregate"></a> <!-- http://nco.sf.net/nco.html#disaggregate -->
<a name="ncdismember"></a> <!-- http://nco.sf.net/nco.html#ncdismember --><a name="index-disaggregate"></a>
<a name="index-dismember"></a>
<a name="index-ncdismember"></a>
<p>Let us show how to completely disaggregate (or, more memorably)
<em>dismember</em> a hierarchical dataset.
For now we take this to mean: store each group as a standalone flat
dataset in netCDF3 format.
This can be accomplished by looping the previous example over all
groups.
This script <samp>ncdismember</samp> dismembers the input file <var>fl_in</var>
specified in the first argument and places the resulting files in the
directory <var>drc_out</var> specified by the second argument:
</p><div class="example">
<pre class="verbatim">cat > ~/ncdismember << 'EOF'
# Purpose: Dismember netCDF4/HDF5 hierarchical files. CF-check them.
# Place each input file group in separate netCDF3 output file
# Described in NCO User Guide at http://nco.sf.net/nco.html#dismember
# Requirements: NCO 4.3.x+, UNIX shell utilities awk, grep, sed
# Optional: CFchecker command https://bitbucket.org/mde_/cfchecker
# Usage:
# ncdismember <fl_in> <drc_out> [flg_cf] [cf_vrs] [opt]
# where fl_in is input file/URL to dismember, drc_out is output directory,
# CF-compliance check is performed when optional third argument is 'cf',
# Optional fourth argument cf_vrs is CF version to check
# Optional fifth argument opt passes straight through to ncks
# chmod a+x ~/sh/ncdismember
# ncdismember ~/nco/data/mdl.nc /data/zender/nco/tmp
# ncdismember ~/nco/data/mdl.nc /data/zender/nco/tmp
# ncdismember http://dust.ess.uci.edu/nco/mdl.nc /data/zender/nco/tmp
# ncdismember http://thredds-test.ucar.edu/thredds/dodsC/testdods/foo.nc /data/zender/nco/tmp
# ncdismember ~/nco/data/mdl.nc /data/zender/nco/tmp cf
# ncdismember ~/nco/data/mdl.nc /data/zender/nco/tmp cf 1.3
# ncdismember ~/nco/data/mdl.nc /data/zender/nco/tmp cf 1.5 --fix_rec_dmn=all
# Command line argument defaults
fl_in="${HOME}/nco/data/mdl.nc" # [sng] Input file to dismember/check
drc_out="${DATA}/nco/tmp" # [sng] Output directory
flg_cf='0' # [flg] Perform CF-compliance check
cf_vrs='1.5' # [sng] Compliance-check this CF version (e.g., '1.5')
opt='' # [flg] Additional ncks options (e.g., '--fix_rec_dmn=all')
# Command line argument option parsing
if [ -n "${1}" ]; then fl_in=${1}; fi
if [ -n "${2}" ]; then drc_out=${2}; fi
if [ -n "${3}" ]; then flg_cf=${3}; fi
if [ -n "${4}" ]; then cf_vrs=${4}; fi
if [ -n "${5}" ]; then opt=${5}; fi
# Prepare output directory
echo "NCO dismembering file ${fl_in}"
fl_stb=$(basename ${fl_in})
drc_out=${drc_out}/${fl_stb}
mkdir -p ${drc_out}
cd ${drc_out}
# Obtain group list
grp_lst=`ncks --cdl -m ${fl_in} | grep '// group' | awk '{$1=$2=$3="";sub(/^ */,"",$0);print}'`
IFS=$'\n' # Change Internal-Field-Separator from <Space><Tab><Newline> to <Newline>
for grp_in in ${grp_lst} ; do
# Replace slashes by dots for output group filenames
grp_out=`echo ${grp_in} | sed 's/\///' | sed 's/\//./g'`
if [ "${grp_out}" = '' ]; then grp_out='root' ; fi
# Tell older NCO/netCDF if HDF4 with --hdf4 switch (signified by .hdf/.HDF suffix)
hdf4=`echo ${fl_in} | awk '{if(match(tolower($1),".hdf$")) hdf4="--hdf4"; print hdf4}'`
# Flatten to netCDF3, anchor, no history, no temporary file, padding, HDF4 flag, options
ncks -O -3 -G : -g ${grp_in}/ -h --no_tmp_fl --hdr_pad=40 ${hdf4} ${opt} ${fl_in} ${drc_out}/${grp_out}.nc
if [ ${flg_cf} = 'cf' ]; then
# cfchecker needs Conventions <= 1.5
ncatted -h -a Conventions,global,o,c,"CF-${cf_vrs}" ${drc_out}/${grp_out}.nc
else # !flg_cf
echo ${drc_out}/${grp_out}.nc
fi # !flg_cf
done
if [ ${flg_cf} = 'cf' ]; then
echo "CFchecker reports CF-compliance of each group in flat netCDF3 format"
cfchecker -c ${cf_vrs} *.nc
fi # !flg_cf
EOF
chmod 755 ~/ncdismember # Make command executable
/bin/mv -f ~/ncdismember ~/sh # Store in location on $PATH, e.g., /usr/local/bin
zender@roulee:~$ ncdismember ~/nco/data/mdl.nc ${DATA}/nco/tmp
NCO dismembering file /home/zender/nco/data/mdl.nc
/data/zender/nco/tmp/mdl.nc/cesm.cesm_01.nc
/data/zender/nco/tmp/mdl.nc/cesm.cesm_02.nc
/data/zender/nco/tmp/mdl.nc/cesm.nc
/data/zender/nco/tmp/mdl.nc/ecmwf.ecmwf_01.nc
/data/zender/nco/tmp/mdl.nc/ecmwf.ecmwf_02.nc
/data/zender/nco/tmp/mdl.nc/ecmwf.nc
/data/zender/nco/tmp/mdl.nc/root.nc
</pre></div>
<p>A (potentially more portable) binary executable could be written to
dismember all groups with a single invocation, yet dismembering without
loss of information is possible now with this simple script on all
platforms with UNIXy utilities.
Note that all dimensions inherited by groups in the input file are
correctly placed by <code>ncdismember</code> into the flat files.
Moreover, each output file preserves the group metadata of all ancestor
groups, including the global metadata from the input file.
As written, the script could fail on groups that contain advanced
netCDF4 features because the user requests (with the ‘<samp>-3</samp>’ switch)
that output be netCDF3 classic format.
However, <code>ncks</code> detects many format incompatibilities in advance
and works around them.
For example, <code>ncks</code> autoconverts netCDF4-only atomic-types (such
as <code>NC_STRING</code> and <code>NC_UBYTE</code>) to corresponding netCDF3
atomic types (<code>NC_CHAR</code> and <code>NC_SHORT</code>) when the output format
is netCDF3.
</p>
<a name="index-CF-compliance-checker"></a>
<a name="index-cfchecker"></a>
<a name="index-ncdismember-1"></a>
<a name="index-compliance-checker"></a>
<a name="index-Martin-Schultz"></a>
<a name="index-Michael-Decker"></a>
<p>One application of dismembering is to check the <acronym>CF</acronym>-compliance of each
group in a file.
When invoked with the optional third argumnt ‘<samp>cf</samp>’,
<code>ncdismember</code> passes each file it generates to the freely
available
<a name="DOCF30" href="#FOOT30"><sup>30</sup></a>
<code>cfchecker</code> command.
</p><div class="example">
<pre class="verbatim">zender@roulee:~$ ncdismember ~/nco/data/mdl.nc /data/zender/nco/tmp cf
NCO dismembering file /home/zender/nco/data/mdl.nc
CFchecker reports CF-compliance of each group in flat netCDF3 format
WARNING: Using the default (non-CF) Udunits database
cesm.cesm_01.nc:
INFO: INIT: running CFchecker version 1.5.15
INFO: INIT: checking compliance with convention CF-1.5
INFO: INIT: using standard name table version: 25, last modified: 2013-07-05T05:40:30Z
INFO: INIT: using area type table version: 2, date: 10 July 2013
INFO: 2.4: no axis information found in dimension variables, not checking dimension order
WARNING: 3: variable "tas1" contains neither long_name nor standard_name attribute
WARNING: 3: variable "tas2" contains neither long_name nor standard_name attribute
INFO: 3.1: variable "tas1" does not contain units attribute
INFO: 3.1: variable "tas2" does not contain units attribute
--------------------------------------------------
cesm.cesm_02.nc:
...
</pre></div>
<p>By default the <acronym>CF</acronym> version checked is determined automatically by
<code>cfchecker</code>.
The user can override this default by supplying a supported <acronym>CF</acronym> version,
e.g., ‘<samp>1.3</samp>’, as an optional fourth argument to
<code>ncdismember</code>.
Current valid <acronym>CF</acronym> options are ‘<samp>1.0</samp>’, ‘<samp>1.1</samp>’,
‘<samp>1.2</samp>’, ‘<samp>1.3</samp>’, ‘<samp>1.4</samp>’, and ‘<samp>1.5</samp>’.
</p>
<a name="diwg"></a> <!-- http://nco.sf.net/nco.html#diwg --><p>Our development and testing of <code>ncdismember</code> is funded by our
involvement in <acronym>NASA</acronym>’s Dataset Interoperability Working Group
(<a href="https://wiki.earthdata.nasa.gov/display/ESDSWG/Dataset+Interoperability+Working+Group">DIWG</a>), though our interest extends beyond <acronym>NASA</acronym> datasets.
Taken together, <acronym>NCO</acronym>’s features (autoconversion to netCDF3
atomic types, fixing multiple record dimensions, autosensing
<acronym>HDF4</acronym> input, scoping rules for CF conventions) make
<code>ncdismember</code> reliable and friendly for both dismembering
hierarchical files and for <acronym>CF</acronym>-compliance checks.
Most <acronym>HDF4</acronym> and <acronym>HDF5</acronym> datasets can be checked for
<acronym>CF</acronym>-compliance with a one-line command.
Example compliance checks of common <acronym>NASA</acronym> datasets are at
<a href="http://dust.ess.uci.edu/diwg">http://dust.ess.uci.edu/diwg</a>.
Our long-term goal is to enrich the hierarchical data model with the
expressivity and syntactic power of <acronym>CF</acronym> conventions.
</p>
<p><acronym>NASA</acronym> asked the <acronym>DIWG</acronym> to prepare a one-page summary
of the procedure necessary to check <acronym>HDF</acronym> files for
<acronym>CF</acronym>-compliance:
</p><div class="example">
<pre class="verbatim">cat > ~/ncdismember.txt << 'EOF'
Preparing an RPM-based OS to Test Hierarchical Files for CF-Compliance
By Charlie Zender, UCI & NASA Dataset Interoperability Working Group (DIWG)
Installation Summary:
1. HDF4 [with netCDF support _disabled_]
2. HDF5
3. netCDF version 4.3.1 (or later) [with HDF4 support _enabled_]
4. NCO version 4.4.0 (or later)
5. numpy
6. netcdf4-python
7. python-lxml
8. CFunits-python
9. CFChecker
10. ncdismember
All 10 packages can use default installs _except_ HDF4 and netCDF.
Following instructions for Fedora Core 20 (FC20), an RPM-based Linux OS
Feedback and changes for other Linux-based OS's welcome to zender at uci.edu
${H4DIR}, ${H5DIR}, ${NETCDFDIR}, ${NCODIR}, may all be different
For simplicity CZ sets them all to /usr/local
# 1. HDF4. Build in non-default manner. Turn-off its own netCDF support.
# Per http://www.unidata.ucar.edu/software/netcdf/docs/build_hdf4.html
# HDF4 support not necessary though it makes ncdismember more comprehensive
wget -c http://www.hdfgroup.org/ftp/HDF/HDF_Current/src/hdf-4.2.9.tar.gz
tar xvzf hdf-4.2.9.tar.gz
cd hdf-4.2.9
./configure --enable-shared --disable-netcdf --disable-fortran --prefix=${H4DIR}
make && make check && make install
# 2. HDF5. Build normally. RPM may work too. Please let me know if so.
# HDF5 is a necessary pre-requisite for netCDF4
wget -c ftp://ftp.unidata.ucar.edu/pub/netcdf/netcdf-4/hdf5-1.8.11.tar.gz
tar xvzf hdf5-1.8.11.tar.gz
cd hdf5-1.8.11
./configure --enable-shared --prefix=${H5DIR}
make && make check && make install
# 3. netCDF version 4.3.1. Build in non-default manner with HDF4. No RPM.
# Per http://www.unidata.ucar.edu/software/netcdf/docs/build_hdf4.html
# Earlier versions of netCDF may fail checking some HDF4 files
wget -c ftp://ftp.unidata.ucar.edu/pub/netcdf/netcdf-4.3.1.tar.gz
tar xvzf netcdf-4.3.1.tar.gz
cd netcdf-4.3.1
CPPFLAGS="-I${H5DIR}/include -I${H4DIR}/include" \
LDFLAGS="-L${H5DIR}/lib -L${H4DIR}/lib" \
./configure --enable-hdf4 --enable-hdf4-file-tests
make && make check && make installas
# 4. NCO version 4.4.2. No RPM for this version. Must install by hand.
# Earlier versions of NCO are relatively useless for ncdismember
cd ${DATA}/tmp
wget http://nco.sourceforge.net/src/nco-4.4.2.tar.gz .
tar xvzf nco-4.4.2.tar.gz
cd nco-4.4.2
./configure --prefix=${NCODIR}
make && make install
# 5. numpy
sudo yum install numpy -y
# 6. netcdf4-python
sudo yum install netcdf4-python -y
# 7. python-lxml
sudo yum install python-lxml -y
# 8. CFunits-python. No RPM available. Must install by hand.
# http://code.google.com/p/cfunits-python/
cd ${DATA}/tmp
wget http://cfunits-python.googlecode.com/files/cfunits-0.9.6.tar.gz .
cd cfunits-0.9.6
sudo python setup.py install
# 9. CFChecker. No RPM available. Must install by hand.
# https://bitbucket.org/mde_/cfchecker
cd ${DATA}/tmp
wget https://bitbucket.org/mde_/cfchecker/downloads/CFchecker-1.5.15.tar.bz2 .
tar xvjf CFchecker-1.5.15.tar.bz2
cd CFchecker
sudo python setup.py install
# 10. ncdismember. Copy script from http://nco.sf.net/nco.html#ncdismember
# Store dismembered files somewhere, e.g., ${DATA}/nco/tmp/hdf
mkdir -p ${DATA}/nco/tmp/hdf
# Many datasets work with a simpler command...
ncdismember ~/nco/data/in.nc ${DATA}/nco/tmp/hdf cf 1.5
ncdismember ~/nco/data/mdl.nc ${DATA}/nco/tmp/hdf cf 1.5
ncdismember ${DATA}/hdf/AMSR_E_L2_Rain_V10_200905312326_A.hdf \
${DATA}/nco/tmp/hdf cf 1.5
ncdismember ${DATA}/hdf/BUV-Nimbus04_L3zm_v01-00-2012m0203t144121.h5 \
${DATA}/nco/tmp/hdf cf 1.5
ncdismember ${DATA}/hdf/HIRDLS-Aura_L3ZAD_v06-00-00-c02_2005d022-2008d077.he5 ${DATA}/nco/tmp/hdf cf 1.5
# Some datasets, typically .h5, require the --fix_rec_dmn=all argument
ncdismember_${DATA}/hdf/GATMO_npp_d20100906_t1935191_e1935505_b00012_c20110707155932065809_noaa_ops.h5 ${DATA}/nco/tmp/hdf cf 1.5 --fix_rec_dmn=all
ncdismember ${DATA}/hdf/mabel_l2_20130927t201800_008_1.h5 \
${DATA}/nco/tmp/hdf cf 1.5 --fix_rec_dmn=all
EOF
</pre></div>
<p>A <acronym>PDF</acronym> version of these instructions is available
<a href="http://dust.ess.uci.edu/diwg/ncdismember.pdf">here</a>.
</p>
<a name="ftn"></a> <!-- http://nco.sf.net/nco.html#ftn -->
<a name="-F"></a> <!-- http://nco.sf.net/nco.html#-F --><hr>
<a name="C-and-Fortran-Index-Conventions"></a>
<div class="header">
<p>
Next: <a href="#Hyperslabs" accesskey="n" rel="next">Hyperslabs</a>, Previous: <a href="#Group-Path-Editing" accesskey="p" rel="previous">Group Path Editing</a>, Up: <a href="#Common-features" accesskey="u" rel="up">Common features</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#General-Index" title="Index" rel="index">Index</a>]</p>
</div>
<a name="C-and-Fortran-Index-conventions"></a>
<h3 class="section">3.14 C and Fortran Index conventions</h3>
<a name="index-index-convention"></a>
<a name="index-Fortran-index-convention"></a>
<a name="index-C-index-convention"></a>
<a name="index-_002dF"></a>
<a name="index-_002d_002dfortran"></a>
<table class="cartouche" border="1"><tr><td>
<p>Availability: <code>ncbo</code>, <code>nces</code>, <code>ncecat</code>,
<code>ncflint</code>, <code>ncks</code>, <code>ncpdq</code>, <code>ncra</code>,
<code>ncrcat</code>, <code>ncwa</code><br>
Short options: ‘<samp>-F</samp>’<br>
Long options: ‘<samp>--fortran</samp>’<br>
</p></td></tr></table>
<a name="index-I_002fO-1"></a>
<p>The ‘<samp>-F</samp>’ switch changes <acronym>NCO</acronym> to read and write with
the Fortran index convention.
By default, <acronym>NCO</acronym> uses C-style (0-based) indices for all I/O.
In C<!-- /@w -->, indices count from 0<!-- /@w --> (rather than 1<!-- /@w -->), and
dimensions are ordered from slowest (inner-most) to fastest
(outer-most) varying.
In Fortran, indices count from 1<!-- /@w --> (rather than 0<!-- /@w -->), and
dimensions are ordered from fastest (inner-most) to slowest
(outer-most) varying.
<a name="index-transpose"></a>
Hence C and<!-- /@w --> Fortran data storage conventions represent mathematical
transposes of eachother.
<a name="index-record-variable"></a>
Note that record variables contain the record dimension as the most
slowly varying dimension.
See <a href="#ncpdq-netCDF-Permute-Dimensions-Quickly">ncpdq netCDF Permute Dimensions Quickly</a> for techniques
to re-order (including transpose) dimensions and to reverse data
storage order.
</p>
<a name="index-record-dimension-1"></a>
<p>Consider a file <samp>85.nc</samp> containing 12 months<!-- /@w --> of data in the
record dimension <code>time</code>.
The following hyperslab operations produce identical results, a
June-July-August average of the data:
</p><div class="example">
<pre class="example">ncra -d time,5,7 85.nc 85_JJA.nc
ncra -F -d time,6,8 85.nc 85_JJA.nc
</pre></div>
<p>Printing variable <var>three_dmn_var</var> in file <samp>in.nc</samp> first with
the C indexing<!-- /@w --> convention, then with Fortran indexing convention
results in the following output formats:
</p><div class="example">
<pre class="example">% ncks -v three_dmn_var in.nc
lat[0]=-90 lev[0]=1000 lon[0]=-180 three_dmn_var[0]=0
...
% ncks -F -v three_dmn_var in.nc
lon(1)=0 lev(1)=100 lat(1)=-90 three_dmn_var(1)=0
...
</pre></div>
<a name="-d"></a> <!-- http://nco.sf.net/nco.html#-d -->
<a name="dmn"></a> <!-- http://nco.sf.net/nco.html#dmn -->
<a name="hyp"></a> <!-- http://nco.sf.net/nco.html#hyp -->
<a name="hyperslab"></a> <!-- http://nco.sf.net/nco.html#hyperslab --><hr>
<a name="Hyperslabs"></a>
<div class="header">
<p>
Next: <a href="#Stride" accesskey="n" rel="next">Stride</a>, Previous: <a href="#C-and-Fortran-Index-Conventions" accesskey="p" rel="previous">C and Fortran Index Conventions</a>, Up: <a href="#Common-features" accesskey="u" rel="up">Common features</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#General-Index" title="Index" rel="index">Index</a>]</p>
</div>
<a name="Hyperslabs-1"></a>
<h3 class="section">3.15 Hyperslabs</h3>
<a name="index-hyperslab"></a>
<a name="index-dimension-limits"></a>
<a name="index-coordinate-limits"></a>
<a name="index-_002dd-dim_002c_005bmin_005d_005b_002c_005bmax_005d_005b_002c_005bstride_005d_005d_005d"></a>
<a name="index-_002d_002ddimension-dim_002c_005bmin_005d_005b_002c_005bmax_005d_005b_002c_005bstride_005d_005d_005d"></a>
<a name="index-_002d_002ddmn-dim_002c_005bmin_005d_005b_002c_005bmax_005d_005b_002c_005bstride_005d_005d_005d"></a>
<table class="cartouche" border="1"><tr><td>
<p>Availability: <code>ncbo</code>, <code>nces</code>, <code>ncecat</code>,
<code>ncflint</code>, <code>ncks</code>, <code>ncpdq</code>, <code>ncra</code>,
<code>ncrcat</code>, <code>ncwa</code><br>
Short options: ‘<samp>-d <var>dim</var>,[<var>min</var>][,[<var>max</var>][,[<var>stride</var>]]]</samp>’<br>
Long options:
‘<samp>--dimension <var>dim</var>,[<var>min</var>][,[<var>max</var>][,[<var>stride</var>]]]</samp>’,<br>
‘<samp>--dmn <var>dim</var>,[<var>min</var>][,[<var>max</var>][,[<var>stride</var>]]]</samp>’<br>
</p></td></tr></table>
<p>A <em>hyperslab</em><!-- /@w --> is a subset of a variable’s data.
The coordinates of a hyperslab are specified with the
<code>-d <var>dim</var>,[<var>min</var>][,[<var>max</var>][,[<var>stride</var>]]]</code> short
option (or with the same arguments to the ‘<samp>--dimension</samp>’ or
‘<samp>--dmn</samp>’ long options).
At least one hyperslab argument (<var>min</var>, <var>max</var>, or <var>stride</var>)
must be present.
The bounds of the hyperslab to be extracted are specified by the
associated <var>min</var> and <var>max</var> values.
A half<!-- /@w -->-open range is specified by omitting either the <var>min</var> or
<var>max</var> parameter.
The separating comma must be present to indicate the omission of one of
these arguments.
The unspecified limit is interpreted as the maximum or minimum value in
the unspecified direction.
A cross<!-- /@w -->-section at a specific coordinate is extracted by specifying only
the <var>min</var> limit and omitting a trailing comma.
Dimensions not mentioned are passed with no reduction in range.
The dimensionality of variables is not reduced (in the case of a
cross-section, the size of the constant dimension will be one).
</p><div class="example">
<pre class="example"># First and second indices of lon dimension
ncks -F -d lon,1,2 in.nc out.nc
# Second and third indices of lon dimension
ncks -d lon,1,2 in.nc out.nc
</pre></div>
<a name="index-stride"></a>
<p>Coordinate values should be specified using real notation with a decimal
point required in the value, whereas dimension indices are specified
using integer notation without a decimal point.
This convention serves only to differentiate coordinate values from
dimension indices.
It is independent of the type of any netCDF coordinate variables.
For a given dimension, the specified limits must both be coordinate
values (with decimal points) or dimension indices (no decimal points).
</p>
<p>If values of a coordinate-variable are used to specify a range or
cross-section, then the coordinate variable must be monotonic (values
either increasing or decreasing).
In this case, command-line values need not exactly match coordinate
values for the specified dimension.
Ranges are determined by seeking the first coordinate value to occur in
the closed range [<var>min</var>,<var>max</var>] and including all subsequent
values until one falls outside the range.
The coordinate value for a cross-section is the coordinate-variable
value closest to the specified value and must lie within the range or
coordinate-variable values.
The <var>stride</var> argument, if any, must be a dimension index, not a
coordinate value.
See <a href="#Stride">Stride</a>, for more information on the <var>stride</var> option.
</p><div class="example">
<pre class="example"># All longitude values between 1 and 2 degrees
ncks -d lon,1.0,2.0 in.nc out.nc
# All longitude values between 1 and 2 degrees
ncks -F -d lon,1.0,2.0 in.nc out.nc
# Every other longitude value between 0 and 90 degrees
ncks -F -d lon,0.0,90.0,2 in.nc out.nc
</pre></div>
<p>As of version 4.2.1 (August, 2012), <acronym>NCO</acronym> allows one to extract
the last <var>N</var> elements of a hyperslab.
Negative integers as <var>min</var> or <var>max</var> elements of a hyperslab
specification indicate offsets from the end (Python also uses this
convention).
Previously, for example, ‘<samp>-d time,-2,-1</samp>’ caused a domain error.
Now it means select the second-to-last and penultimate timesteps.
Negative integers work for <var>min</var> and <var>max</var> indices, though not
for <var>stride</var>.
</p><div class="example">
<pre class="example"># Last two indices of lon dimension
ncks -F -d lon,1,-2 in.nc out.nc
# First to penultimate indices of lon dimension
ncks -F -d lon,1,-2 in.nc out.nc
# Third-to-last to last index of lon dimension
ncks -F -d lon,-3,-1 in.nc out.nc
# Third-to-last to last index of lon dimension
ncks -F -d lon,-3, in.nc out.nc
</pre></div>
<p>As shown, we recommend using a full floating point suffix of <code>.0</code>
instead of simply <code>.</code> in order to make obvious the selection of
hyperslab elements based on coordinate value rather than index.
</p>
<a name="index-NC_005fCHAR"></a>
<p>User-specified coordinate limits are promoted to double-precision values
while searching for the indices which bracket the range.
Thus, hyperslabs on coordinates of type <code>NC_CHAR</code> are computed
numerically rather than lexically, so the results are unpredictable.
</p>
<a name="index-wrapped-coordinates"></a>
<p>The relative magnitude of <var>min</var> and <var>max</var> indicate to the
operator whether to expect a <em>wrapped coordinate</em>
(see <a href="#Wrapped-Coordinates">Wrapped Coordinates</a>), such as longitude.
If <em><var>min</var> > <var>max</var></em>, the <acronym>NCO</acronym> expects the
coordinate to be wrapped, and a warning message will be printed.
When this occurs, <acronym>NCO</acronym> selects all values outside the domain
[<em><var>max</var> < <var>min</var></em>], i.e., all the values exclusive of the
values which would have been selected if <var>min</var> and <var>max</var> were
swapped.
If this seems confusing, test your command on just the coordinate
variables with <code>ncks</code>, and then examine the output to ensure
<acronym>NCO</acronym> selected the hyperslab you expected (coordinate wrapping
is currently only supported by <code>ncks</code>).
</p>
<p>Because of the way wrapped coordinates are interpreted, it is very
important to make sure you always specify hyperslabs in the
monotonically increasing sense, i.e., <em><var>min</var> < <var>max</var></em>
(even if the underlying coordinate variable is monotonically
decreasing).
The only exception to this is when you are indeed specifying a wrapped
coordinate.
The distinction is crucial to understand because the points selected by,
e.g., <code>-d longitude,50.,340.</code>, are exactly the complement of the
points selected by <code>-d longitude,340.,50.</code>.
</p>
<p>Not specifying any hyperslab option is equivalent to specifying full
ranges of all dimensions.
This option may be specified more than once in a single command
(each hyperslabbed dimension requires its own <code>-d</code> option).
</p>
<a name="srd"></a> <!-- http://nco.sf.net/nco.html#srd -->
<a name="stride"></a> <!-- http://nco.sf.net/nco.html#stride --><hr>
<a name="Stride"></a>
<div class="header">
<p>
Next: <a href="#Record-Appending" accesskey="n" rel="next">Record Appending</a>, Previous: <a href="#Hyperslabs" accesskey="p" rel="previous">Hyperslabs</a>, Up: <a href="#Common-features" accesskey="u" rel="up">Common features</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#General-Index" title="Index" rel="index">Index</a>]</p>
</div>
<a name="Stride-1"></a>
<h3 class="section">3.16 Stride</h3>
<a name="index-stride-1"></a>
<a name="index-_002dd-dim_002c_005bmin_005d_002c_005bmax_005d_002cstride"></a>
<a name="index-_002d_002ddimension-dim_002c_005bmin_005d_002c_005bmax_005d_002cstride"></a>
<a name="index-_002d_002ddmn-dim_002c_005bmin_005d_002c_005bmax_005d_002cstride"></a>
<table class="cartouche" border="1"><tr><td>
<p>Availability: <code>ncbo</code>, <code>nces</code>, <code>ncecat</code>,
<code>ncflint</code>, <code>ncks</code>, <code>ncpdq</code>, <code>ncra</code>,
<code>ncrcat</code>, <code>ncwa</code><br>
Short options: ‘<samp>-d <var>dim</var>,[<var>min</var>][,[<var>max</var>][,[<var>stride</var>]]]</samp>’<br>
Long options:
‘<samp>--dimension <var>dim</var>,[<var>min</var>][,[<var>max</var>][,[<var>stride</var>]]]</samp>’,<br>
‘<samp>--dmn <var>dim</var>,[<var>min</var>][,[<var>max</var>][,[<var>stride</var>]]]</samp>’<br>
</p></td></tr></table>
<p>All data operators support specifying a <em>stride</em> for any and all
dimensions at the same time.
The <var>stride</var> is the spacing between consecutive points in a
hyperslab.
A <var>stride</var><!-- /@w --> of 1<!-- /@w --> picks all the elements of the hyperslab, and
a <var>stride</var> of 2<!-- /@w --> skips every other element, etc..
<code>ncks</code> multislabs support strides, and are more powerful than
the regular hyperslabs supported by the other operators
(see <a href="#Multislabs">Multislabs</a>).
Using the <var>stride</var> option for the record dimension with
<code>ncra</code> and <code>ncrcat</code> makes it possible, for instance, to
average or concatenate regular intervals across multi-file input data sets.
</p>
<p>The <var>stride</var> is specified as the optional fourth argument to the
‘<samp>-d</samp>’ hyperslab specification:
<code>-d <var>dim</var>,[<var>min</var>][,[<var>max</var>][,[<var>stride</var>]]]</code>.
Specify <var>stride</var> as an integer (i.e., no decimal point) following
the third comma in the ‘<samp>-d</samp>’ argument.
There is no default value for <var>stride</var>.
Thus using ‘<samp>-d time,,,2</samp>’ is valid but ‘<samp>-d time,,,2.0</samp>’ and
‘<samp>-d time,,,</samp>’ are not.
When <var>stride</var> is specified but <var>min</var> is not, there is an
ambiguity as to whether the extracted hyperslab should begin with (using
C-style, 0-based indexes) element 0<!-- /@w --> or element ‘<samp>stride-1</samp>’.
<acronym>NCO</acronym> must resolve this ambiguity and it chooses element 0<!-- /@w -->
as the first element of the hyperslab when <var>min</var> is not specified.
Thus ‘<samp>-d time,,,<var>stride</var></samp>’ is syntactically equivalent to
‘<samp>-d time,0,,<var>stride</var></samp>’.
This means, for example, that specifying the operation
‘<samp>-d time,,,2</samp>’ on the array ‘<samp>1,2,3,4,5</samp>’ selects the hyperslab
‘<samp>1,3,5</samp>’.
To obtain the hyperslab ‘<samp>2,4</samp>’ instead, simply explicitly specify
the starting index as 1,<!-- /@w --> i.e., ‘<samp>-d time,1,,2</samp>’.
</p>
<p>For example, consider a file <samp>8501_8912.nc</samp> which contains 60
consecutive months of data.
Say you wish to obtain just the March data from this file.
Using 0-based subscripts (see <a href="#C-and-Fortran-Index-Conventions">C and Fortran Index Conventions</a>) these
data are stored in records 2, 14, … 50<!-- /@w --> so the desired
<var>stride</var> is 12.<!-- /@w -->
Without the <var>stride</var> option, the procedure is very awkward.
One could use <code>ncks</code> five times and then use <code>ncrcat</code> to
concatenate the resulting files together:
<a name="index-Bourne-Shell"></a>
<a name="index-C-Shell"></a>
</p><div class="example">
<pre class="example">for idx in 02 14 26 38 50; do # Bourne Shell
ncks -d time,${idx} 8501_8912.nc foo.${idx}
done
foreach idx (02 14 26 38 50) # C Shell
ncks -d time,${idx} 8501_8912.nc foo.${idx}
end
ncrcat foo.?? 8589_03.nc
rm foo.??
</pre></div>
<p>With the <var>stride</var> option, <code>ncks</code> performs this hyperslab
extraction in one operation:
</p><div class="example">
<pre class="example">ncks -d time,2,,12 8501_8912.nc 8589_03.nc
</pre></div>
<p>See <a href="#ncks-netCDF-Kitchen-Sink">ncks netCDF Kitchen Sink</a>, for more information on <code>ncks</code>.
</p>
<p>Applying the <var>stride</var> option to the record dimension in
<code>ncra</code> and <code>ncrcat</code> makes it possible, for instance, to
average or concatenate regular intervals across multi-file input data
sets.
</p><div class="example">
<pre class="example">ncra -F -d time,3,,12 85.nc 86.nc 87.nc 88.nc 89.nc 8589_03.nc
ncrcat -F -d time,3,,12 85.nc 86.nc 87.nc 88.nc 89.nc 8503_8903.nc
</pre></div>
<a name="rec_apn"></a> <!-- http://nco.sf.net/nco.html#rec_apn -->
<a name="record_append"></a> <!-- http://nco.sf.net/nco.html#record_append --><hr>
<a name="Record-Appending"></a>
<div class="header">
<p>
Next: <a href="#Subcycle" accesskey="n" rel="next">Subcycle</a>, Previous: <a href="#Stride" accesskey="p" rel="previous">Stride</a>, Up: <a href="#Common-features" accesskey="u" rel="up">Common features</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#General-Index" title="Index" rel="index">Index</a>]</p>
</div>
<a name="Record-Appending-1"></a>
<h3 class="section">3.17 Record Appending</h3>
<a name="index-record-append"></a>
<a name="index-_002d_002drec_005fapn"></a>
<a name="index-_002d_002drecord_005fappend"></a>
<table class="cartouche" border="1"><tr><td>
<p>Availability: <code>ncra</code>, <code>ncrcat</code><br>
Short options: None<br>
Long options:
‘<samp>--rec_apn</samp>’, ‘<samp>--record_append</samp>’<br>
</p></td></tr></table>
<p>As of version 4.2.6 (March, 2013), <acronym>NCO</acronym> allows both
Multi-File, Multi-Record operators (<code>ncra</code> and <code>ncrcat</code>)
to append their output directly to the end of an existing file.
This feature may be used to augment a target file, rather than construct
it from scratch.
This helps, for example, when a timeseries is concatenated from input
data that becomes available in stages rather than all at once.
In such cases this switch significantly speeds writing.
</p>
<p>Consider the use case where one wishes to preserve the contents of
<samp>fl_1.nc</samp>, and add to them new records contained in
<samp>fl_2.nc</samp>.
Previously the output had to be placed in a third file, <samp>fl_3.nc</samp>
(which could also safely be named <samp>fl_2.nc</samp>), via
</p><div class="example">
<pre class="example">ncrcat -O fl_1.nc fl_2.nc fl_3.nc
</pre></div>
<p>Under the hood this operation copies all information in
<samp>fl_1.nc</samp> and <samp>fl_2.nc</samp> not once but twice.
The first copy is performed through the netCDF interface, as all
data from <samp>fl_1.nc</samp> and <samp>fl_2.nc</samp> are extracted and placed in
the output file.
The second copy occurs (usually much) more quickly as the (by default)
temporary output file is copied (sometimes a quick re-link suffices) to
the final output file (see <a href="#Temporary-Output-Files">Temporary Output Files</a>).
All this copying is expensive for large files.
</p>
<p>The new ‘<samp>--record_append</samp>’ switch causes all records in
<samp>fl_2.nc</samp> to be appended to the end of the corresponding records in
<samp>fl_1.nc</samp>:
</p><div class="example">
<pre class="example">ncrcat --rec_apn fl_2.nc fl_1.nc
</pre></div>
<p>The ordering of the filename arguments may seem non-intuitive.
If the record variable represents time in these files, then the
values in <samp>fl_1.nc</samp> precede those in <samp>fl_2.nc</samp>, so why
do the files appear in the reverse order on the command line?
<samp>fl_1.nc</samp> is the last file named because it is the pre-existing
output file to which we are appending all of the other input files
(in this case only <samp>fl_2.nc</samp>).
The contents of <samp>fl_1.nc</samp> are completely preserved, and only
values in <samp>fl_2.nc</samp> (and any other input files) are copied.
This switch avoids the necessity of copying all of <samp>fl_1.nc</samp>
through the netCDF interface to a new output file.
The ‘<samp>--rec_apn</samp>’ switch automatically puts <acronym>NCO</acronym> into
append mode (see <a href="#Appending-Variables">Appending Variables</a>), so specifying ‘<samp>-A</samp>’ is
redundant, and simultaneously specifying overwrite mode with ‘<samp>-O</samp>’
causes an error.
By default, NCO works in an intermediate temporary file.
Power users may combine ‘<samp>--rec_apn</samp>’ with the ‘<samp>--no_tmp_fl</samp>’
switch (see <a href="#Temporary-Output-Files">Temporary Output Files</a>):
</p><div class="example">
<pre class="example">ncrcat --rec_apn --no_tmp_fl fl_2.nc fl_1.nc
</pre></div>
<p>This avoids creating an intermediate file, and copies only the
minimal amount of data (i.e., all of <samp>fl_2.nc</samp>).
Hence, it is fast.
We recommend users try to understand the safety trade-offs involved.
</p>
<a name="subcycle"></a> <!-- http://nco.sf.net/nco.html#subcycle -->
<a name="ssc"></a> <!-- http://nco.sf.net/nco.html#ssc -->
<a name="duration"></a> <!-- http://nco.sf.net/nco.html#duration -->
<a name="drn"></a> <!-- http://nco.sf.net/nco.html#drn -->
<a name="mro"></a> <!-- http://nco.sf.net/nco.html#mro --><hr>
<a name="Subcycle"></a>
<div class="header">
<p>
Next: <a href="#Multislabs" accesskey="n" rel="next">Multislabs</a>, Previous: <a href="#Record-Appending" accesskey="p" rel="previous">Record Appending</a>, Up: <a href="#Common-features" accesskey="u" rel="up">Common features</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#General-Index" title="Index" rel="index">Index</a>]</p>
</div>
<a name="Subcycle-1"></a>
<h3 class="section">3.18 Subcycle</h3>
<a name="index-duration"></a>
<a name="index-sub_002dcycle"></a>
<a name="index-subcycle"></a>
<a name="index-MRO"></a>
<a name="index-Multi_002dRecord-Operator"></a>
<a name="index-_002d_002dmro"></a>
<a name="index-_002dd-dim_002c_005bmin_005d_002c_005bmax_005d_002c_005bstride_005d_002c_005bsubcycle_005d"></a>
<a name="index-_002d_002ddimension-dim_002c_005bmin_005d_002c_005bmax_005d_002c_005bstride_005d_002c_005bsubcycle_005d"></a>
<a name="index-_002d_002ddmn-dim_002c_005bmin_005d_002c_005bmax_005d_002c_005bstride_005d_002csubcycle_005d"></a>
<table class="cartouche" border="1"><tr><td>
<p>Availability: <code>ncra</code>, <code>ncrcat</code><br>
Short options: ‘<samp>-d <var>dim</var>,[<var>min</var>][,[<var>max</var>][,[<var>stride</var>][,[<var>subcycle</var>]]]]</samp>’<br>
Long options:
‘<samp>--mro</samp>’
‘<samp>--dimension <var>dim</var>,[<var>min</var>][,[<var>max</var>][,[<var>stride</var>][,[<var>subcycle</var>]]]]</samp>’<br>
‘<samp>--dmn <var>dim</var>,[<var>min</var>][,[<var>max</var>][,[<var>stride</var>][,[<var>subcycle</var>]]]]</samp>’<br>
</p></td></tr></table>
<p>As of version 4.2.1 (August, 2012), <acronym>NCO</acronym> allows both Multi-File,
Multi-Record operators, <code>ncra</code> and <code>ncrcat</code>, to extract
and operate on multiple groups of records.
These groups may be connected to physical <em>sub-cycles</em> of a
periodic nature, e.g., months of a year, or hours of a day.
Or they may be thought of as groups of a specifed duration.
The feature and the terminology to describe it are new.
For now, we call this the <em>subcycle feature</em>, sometimes abbreviated
<acronym>SSC</acronym>
<a name="DOCF31" href="#FOOT31"><sup>31</sup></a>.
</p>
<p>The subcycle feature allows processing of groups of records
separated by regular intervals of records.
It is perhaps best illustrated by an extended example which describes
how to solve the same problem both with and without the <acronym>SSC</acronym> feature.
</p>
<p>The first task in climate data processing is often creating seasonal
cycles.
Suppose a 150-year climate simulation produces 150 output files, each
comprising 12 records, each record a monthly mean:
<samp>1850.nc</samp>, <samp>1851.nc</samp>, ... <samp>1999.nc</samp>.
Our goal is to create a single file containing the summertime (June,
July, and August, aka JJA) mean.
Traditionally, we would first compute the climatological monthly
mean for each month of summer.
Each of these is a 150-year mean, i.e.,
</p><div class="example">
<pre class="example"># Step 1: Create climatological monthly files clm06.nc..clm08.nc
for mth in {6..8}; do
mm=`printf "%02d" $mth`
ncra -O -F -d time,${mm},,12 -n 150,4,1 1850.nc clm${mm}.nc
done
# Step 2: Average climatological monthly files into summertime mean
ncra -O clm06 clm07.nc clm08.nc clm_JJA.nc
</pre></div>
<p>So far, nothing is unusual and this task can be performed by any
<acronym>NCO</acronym> version.
The <acronym>SSC</acronym> feature makes obsolete the need for the shell loop
used in Step 1<!-- /@w --> above.
</p>
<p>The new <acronym>SSC</acronym> option aggregates more than one input record at a time
before performing arithmetic operations, and, with an additional
switch, allows us to archive those results in multiple record output
(MRO) files.
This reduces the task of producing the climatological summertime
mean to one step:
</p><div class="example">
<pre class="example"># Step 1: Compute climatological summertime mean
ncra -O -F -d time,6,,12,3 -n 150,4,1 1850.nc clm_JJA.nc
</pre></div>
<p>The <acronym>SSC</acronym> option instructs <code>ncra</code> (or <code>ncrcat</code>)
to process files in groups of three records.
To better understand the meaning of each argument to the ‘<samp>-d</samp>’
hyperslab option, read it this way: “for the time dimension start with
the sixth record, continue without end, repeat the process every twelfth
record, and define a sub-cycle as three consecutive records”.
</p>
<p>A separate option, ‘<samp>--mro</samp>’, instructs <code>ncra</code> to output
its results from each sub-group, and to produce a <em>Multi-Record Output</em>
(MRO) file rather than a <em>Single-Record Output</em> (SRO) file.
Unless ‘<samp>--mro</samp>’ is specified, <code>ncra</code> collects together all
the sub-groups, operates on their ensemble, and produces a single
output record.
The addition of ‘<samp>--mro</samp>’ to the above example causes <code>ncra</code>
to archive all (150) annual summertime means to one file:
</p><div class="example">
<pre class="example"># Step 1: Archive all 150 summertime means in one file
ncra --mro -O -F -d time,6,,12,3 -n 150,4,1 1850.nc 1850_2009_JJA.nc
# ...or all (150) annual means...
ncra --mro -O -d time,,,12,12 -n 150,4,1 1850.nc 1850_2009.nc
</pre></div>
<p>These operations generate and require no intermediate files.
This contrasts to previous <acronym>NCO</acronym> methods, which require
generating, averaging, then catenating 150 files.
The ‘<samp>--mro</samp>’ option has no effect on, or rather is redundant for,
<code>ncrcat</code> since <code>ncrcat</code> always outputs all selected
records.
</p>
<a name="msa"></a> <!-- http://nco.sf.net/nco.html#msa -->
<a name="mlt"></a> <!-- http://nco.sf.net/nco.html#mlt --><hr>
<a name="Multislabs"></a>
<div class="header">
<p>
Next: <a href="#Wrapped-Coordinates" accesskey="n" rel="next">Wrapped Coordinates</a>, Previous: <a href="#Subcycle" accesskey="p" rel="previous">Subcycle</a>, Up: <a href="#Common-features" accesskey="u" rel="up">Common features</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#General-Index" title="Index" rel="index">Index</a>]</p>
</div>
<a name="Multislabs-1"></a>
<h3 class="section">3.19 Multislabs</h3>
<a name="index-multislab"></a>
<a name="index-multi_002dhyperslab"></a>
<a name="index-MSA"></a>
<a name="index-_002dd-dim_002c_005bmin_005d_005b_002c_005bmax_005d_005b_002c_005bstride_005d_005d_005d-1"></a>
<a name="index-_002d_002ddimension-dim_002c_005bmin_005d_005b_002c_005bmax_005d_005b_002c_005bstride_005d_005d_005d-1"></a>
<a name="index-_002d_002ddmn-dim_002c_005bmin_005d_005b_002c_005bmax_005d_005b_002c_005bstride_005d_005d_005d-1"></a>
<a name="index-_002d_002dmsa"></a>
<a name="index-_002d_002dmsa_005fusr_005frdr"></a>
<a name="index-_002d_002dmsa_005fuser_005forder"></a>
<table class="cartouche" border="1"><tr><td>
<p>Availability: <code>ncbo</code>, <code>nces</code>, <code>ncecat</code>,
<code>ncflint</code>, <code>ncks</code>, <code>ncpdq</code>, <code>ncra</code>,
<code>ncrcat</code><br>
Short options: ‘<samp>-d <var>dim</var>,[<var>min</var>][,[<var>max</var>][,[<var>stride</var>]]]</samp>’<br>
Long options:
‘<samp>--dimension <var>dim</var>,[<var>min</var>][,[<var>max</var>][,[<var>stride</var>]]]</samp>’,<br>
‘<samp>--dmn <var>dim</var>,[<var>min</var>][,[<var>max</var>][,[<var>stride</var>]]]</samp>’<br>
‘<samp>--msa_usr_rdr</samp>’, ‘<samp>--msa_user_order</samp>’<br>
</p></td></tr></table>
<p>A multislab<!-- /@w --> is a union of one or more hyperslabs.
One defines multislabs by chaining together hyperslab commands, i.e.,
<kbd>-d</kbd> options (see <a href="#Hyperslabs">Hyperslabs</a>).
Support for specifying a <em>multi-hyperslab</em> or <em>multislab</em> for
any variable was first added to <code>ncks</code> in late 2002.
The other operators received these capabilities in April 2008.
Multi-slabbing is often referred to by the acronym <acronym>MSA</acronym>,
which stands for “Multi-Slabbing Algorithm”.
As explained below, the user may additionally request that the
multislabs be returned in the user-specified order, rather than the
on-disk storage order.
Although <acronym>MSA</acronym> user-ordering has been available in all operators
since 2008, most users were unaware of it since the documentation
(below, and in the man pages) was not written until July 2013.
</p>
<p>Multislabs overcome many restraints that limit simple hyperslabs.
A single<!-- /@w --> <kbd>-d</kbd> option can only specify a contiguous and/or
a regularly spaced multi-dimensional data array.
Multislabs are constructed from multiple <kbd>-d</kbd> options and may
therefore have non-regularly spaced arrays.
For example, suppose it is desired to operate on all longitudes
from 10.0 to 20.0 and from 80.0 to 90.0 degrees<!-- /@w -->.
The combined range of longitudes is not selectable in a single
hyperslab specfication of the form
‘<samp>-d <var>dimension</var>,<var>min</var>,<var>max</var></samp>’ or
‘<samp>-d <var>dimension</var>,<var>min</var>,<var>max</var>,<var>stride</var></samp>’ because its
elements are irregularly spaced in coordinate space (and presumably
in index space too).
The multislab specification for obtaining these values is simply
the union of the hyperslabs specifications that comprise the multislab,
i.e.,
</p><div class="example">
<pre class="example">ncks -d lon,10.,20. -d lon,80.,90. in.nc out.nc
ncks -d lon,10.,15. -d lon,15.,20. -d lon,80.,90. in.nc out.nc
</pre></div>
<p>Any number of hyperslabs specifications may be chained together
to specify the multislab.
<acronym>MSA</acronym> creates an output dimension equal in size to the sum of
the sizes of the multislabs.
This can be used to extend and or pad coordinate grids.
</p>
<a name="index-stride-2"></a>
<p>Users may specify redundant ranges of indices in a multislab, e.g.,
</p><div class="example">
<pre class="example">ncks -d lon,0,4 -d lon,2,9,2 in.nc out.nc
</pre></div>
<p>This command retrieves the first five longitudes, and then every other
longitude value up to the tenth.
Elements 0, 2, and 4<!-- /@w --> are specified by both hyperslab arguments (hence
this is redundant) but will count only once if an arithmetic operation
is being performed.
This example uses index-based (not coordinate-based) multislabs because
the <var>stride</var> option only supports index-based hyper-slabbing.
See <a href="#Stride">Stride</a>, for more information on the <var>stride</var> option.
</p>
<p>Multislabs are more efficient than the alternative of sequentially
performing hyperslab operations and concatenating the results.
<a name="index-I_002fO-2"></a>
This is because <acronym>NCO</acronym> employs a novel multislab algorithm to
minimize the number of I/O operations when retrieving irregularly spaced
data from disk.
The <acronym>NCO</acronym> multislab algorithm retrieves each element from disk
once and only once.
Thus users may take some shortcuts in specifying multislabs and the
algorithm will obtain the intended values.
Specifying redundant ranges is not encouraged, but may be useful on
occasion and will not result in unintended consequences.
</p>
<p>Suppose the <var>Q</var> variable contains three dimensional arrays of
distinct chemical constituents in no particular order.
We are interested in the NOy species in a certain geographic range.
Say that NO, NO2, and N2O5 are elements 0<!-- /@w -->, 1, and 5<!-- /@w --> of the
<var>species</var> dimension of <var>Q</var>.
The multislab specification might look something like
</p><div class="example">
<pre class="example">ncks -d species,0,1 -d species,5 -d lon,0,4 -d lon,2,9,2 in.nc out.nc
</pre></div>
<p>Multislabs are powerful because they may be specified for every
dimension at the same time.
Thus multislabs obsolete the need to execute multiple <code>ncks</code>
commands to gather the desired range of data.
</p>
<a name="msa_usr_rdr"></a> <!-- http://nco.sf.net/nco.html#msa_usr_rdr --><p>The <acronym>MSA</acronym> user-order switch ‘<samp>--msa_usr_rdr</samp>’ (or
‘<samp>--msa_user_order</samp>’, both of which shorten to ‘<samp>--msa</samp>’)
requests that the multislabs be output in the user-specified
order from the command-line, rather than in the input-file on-disk
storage order.
This allows the user to perform complex data re-ordering in one
operation that would otherwise require cumbersome steps of
hyperslabbing, concatenating, and permuting.
Consider the recent example of a user who needed to convert datasets
stored with the longitude coordinate <code>Lon</code> ranging from
[-180,180) to datasets that follow the [0,360) convention.
</p><div class="example">
<pre class="example">% ncks -H -v Lon in.nc
Lon[0]=-180
Lon[1]=-90
Lon[2]=0
Lon[3]=90
</pre></div>
<p>Although simple in theory, this task requires both mathematics to
change the numerical value of the longitude coordinate, data
hyperslabbing to split the input on-disk arrays at Greenwich, and data
re-ordering within to stitch the western hemisphere onto the eastern
hemisphere at the date-line.
The ‘<samp>--msa</samp>’ user-order switch overrides the default that data are
output in the same order in which they are stored on-disk in the input
file, and instead stores them in the same order as the multi-slabs are
given to the command line.
This default is intuitive and is not important in most uses.
However, the <acronym>MSA</acronym> user-order switch allows users to meet
their output order needs by specifying multi-slabs in a certain order.
Compare the results of default ordering to user-ordering for longitude:
</p><div class="example">
<pre class="example">% ncks -O -H -v Lon -d Lon,0.,180. -d Lon,-180.,-1.0 in.nc
Lon[0]=-180
Lon[1]=-90
Lon[2]=0
Lon[3]=90
% ncks -O -H --msa -v Lon -d Lon,0.,180. -d Lon,-180.,-1.0 in.nc
Lon[0]=0
Lon[1]=90
Lon[2]=-180
Lon[3]=-90
</pre></div>
<p>The two multi-slabs are the same but they can be presented to screen,
or to an output file, in either order.
The second example shows how to place the western hemisphere after the
eastern hemisphere, although they are stored in the opposite order in
the input file.
</p>
<p>With this background, one sees that the following commands suffice to
rotate the input file by 180 degrees longitude:
</p><div class="example">
<pre class="example">% ncks -O -v LatLon --msa -d Lon,0.,180. -d Lon,-180.,-1.0 in.nc out.nc
% ncap2 -O -s 'where(Lon < 0) Lon=Lon+360' out.nc out.nc
% ncks -C -H -v LatLon ~/nco/data/in.nc
Lat[0]=-45 Lon[0]=-180 LatLon[0]=0
Lat[0]=-45 Lon[1]=-90 LatLon[1]=1
Lat[0]=-45 Lon[2]=0 LatLon[2]=2
Lat[0]=-45 Lon[3]=90 LatLon[3]=3
Lat[1]=45 Lon[0]=-180 LatLon[4]=4
Lat[1]=45 Lon[1]=-90 LatLon[5]=5
Lat[1]=45 Lon[2]=0 LatLon[6]=6
Lat[1]=45 Lon[3]=90 LatLon[7]=7
% ncks -C -H -v LatLon ~/out.nc
Lat[0]=-45 Lon[0]=0 LatLon[0]=2
Lat[0]=-45 Lon[1]=90 LatLon[1]=3
Lat[0]=-45 Lon[2]=180 LatLon[2]=0
Lat[0]=-45 Lon[3]=270 LatLon[3]=1
Lat[1]=45 Lon[0]=0 LatLon[4]=6
Lat[1]=45 Lon[1]=90 LatLon[5]=7
Lat[1]=45 Lon[2]=180 LatLon[6]=4
Lat[1]=45 Lon[3]=270 LatLon[7]=5
</pre></div>
<p>There are other workable, valid methods to accomplish this rotation, yet
none are simpler nor more efficient than utilizing <acronym>MSA</acronym>
user-ordering.
Some final comments on applying this algorithm:
Be careful to specify hemispheres that do not overlap, e.g., by
inadvertently specifying coordinate ranges that both include Greenwich.
Some users will find using index-based rather than coordinate-based
hyperslabs makes this clearer.
</p>
<a name="wrp"></a> <!-- http://nco.sf.net/nco.html#wrp --><hr>
<a name="Wrapped-Coordinates"></a>
<div class="header">
<p>
Next: <a href="#Auxiliary-Coordinates" accesskey="n" rel="next">Auxiliary Coordinates</a>, Previous: <a href="#Multislabs" accesskey="p" rel="previous">Multislabs</a>, Up: <a href="#Common-features" accesskey="u" rel="up">Common features</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#General-Index" title="Index" rel="index">Index</a>]</p>
</div>
<a name="Wrapped-Coordinates-1"></a>
<h3 class="section">3.20 Wrapped Coordinates</h3>
<a name="index-wrapped-coordinates-1"></a>
<a name="index-longitude"></a>
<a name="index-_002dd-dim_002c_005bmin_005d_005b_002c_005bmax_005d_005b_002c_005bstride_005d_005d_005d-2"></a>
<a name="index-_002d_002ddimension-dim_002c_005bmin_005d_005b_002c_005bmax_005d_005b_002c_005bstride_005d_005d_005d-2"></a>
<a name="index-_002d_002ddmn-dim_002c_005bmin_005d_005b_002c_005bmax_005d_005b_002c_005bstride_005d_005d_005d-2"></a>
<table class="cartouche" border="1"><tr><td>
<p>Availability: <code>ncks</code><br>
Short options: ‘<samp>-d <var>dim</var>,[<var>min</var>][,[<var>max</var>][,[<var>stride</var>]]]</samp>’<br>
Long options:
‘<samp>--dimension <var>dim</var>,[<var>min</var>][,[<var>max</var>][,[<var>stride</var>]]]</samp>’,<br>
‘<samp>--dmn <var>dim</var>,[<var>min</var>][,[<var>max</var>][,[<var>stride</var>]]]</samp>’<br>
</p></td></tr></table>
<p>A <em>wrapped coordinate</em><!-- /@w --> is a coordinate whose values increase or
decrease monotonically (nothing unusual so far), but which represents a
dimension that ends where it begins (i.e., wraps around on itself).
Longitude (i.e., degrees on a circle) is a familiar example of a wrapped
coordinate.
Longitude increases to the East of Greenwich, England, where it is
defined to be zero.
Halfway around the globe, the longitude is 180 degrees<!-- /@w --> East (or West).
Continuing eastward, longitude increases to 360 degrees<!-- /@w --> East at
Greenwich.
The longitude values of most geophysical data are either in the range
[0,360), or [-180,180).
In either case, the Westernmost and Easternmost longitudes are
numerically separated by 360 degrees<!-- /@w -->, but represent contiguous
regions on the globe.
For example, the Saharan desert stretches from roughly 340 to
50 degrees<!-- /@w --> East.
Extracting the hyperslab of data representing the Sahara from a global
dataset presents special problems when the global dataset is stored
consecutively in longitude from 0 to 360 degrees<!-- /@w -->.
This is because the data for the Sahara will not be contiguous in the
<var>input-file</var> but is expected by the user to be contiguous in the
<var>output-file</var>.
In this case, <code>ncks</code> must invoke special software routines to
assemble the desired output hyperslab from multiple reads of the
<var>input-file</var>.
</p>
<p>Assume the domain of the monotonically increasing longitude coordinate
<code>lon</code> is <em>0 < <var>lon</var> < 360</em>.
<code>ncks</code> will extract a hyperslab which crosses the Greenwich
meridian simply by specifying the westernmost longitude as <var>min</var> and
the easternmost longitude as <var>max</var>.
The following commands extract a hyperslab containing the Saharan desert:
</p><div class="example">
<pre class="example">ncks -d lon,340.,50. in.nc out.nc
ncks -d lon,340.,50. -d lat,10.,35. in.nc out.nc
</pre></div>
<p>The first example selects data in the same longitude range as the Sahara.
The second example further constrains the data to having the same
latitude as the Sahara.
The coordinate <code>lon</code> in the <var>output-file</var>, <samp>out.nc</samp>, will
no longer be monotonic!
The values of <code>lon</code> will be, e.g., ‘<samp>340, 350, 0, 10, 20, 30,
40, 50</samp>’.
This can have serious implications should you run <samp>out.nc</samp> through
another operation which expects the <code>lon</code> coordinate to be
monotonically increasing.
Fortunately, the chances of this happening are slim, since <code>lon</code>
has already been hyperslabbed, there should be no reason to hyperslab
<code>lon</code> again.
Should you need to hyperslab <code>lon</code> again, be sure to give
dimensional indices as the hyperslab arguments, rather than coordinate
values (see <a href="#Hyperslabs">Hyperslabs</a>).
</p>
<a name="aux"></a> <!-- http://nco.sf.net/nco.html#aux -->
<a name="auxiliary"></a> <!-- http://nco.sf.net/nco.html#auxiliary -->
<a name="-X"></a> <!-- http://nco.sf.net/nco.html#-X -->
<a name="std_nm"></a> <!-- http://nco.sf.net/nco.html#std_nm -->
<a name="standard_name"></a> <!-- http://nco.sf.net/nco.html#standard_name --><hr>
<a name="Auxiliary-Coordinates"></a>
<div class="header">
<p>
Next: <a href="#UDUnits-Support" accesskey="n" rel="next">UDUnits Support</a>, Previous: <a href="#Wrapped-Coordinates" accesskey="p" rel="previous">Wrapped Coordinates</a>, Up: <a href="#Common-features" accesskey="u" rel="up">Common features</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#General-Index" title="Index" rel="index">Index</a>]</p>
</div>
<a name="Auxiliary-Coordinates-1"></a>
<h3 class="section">3.21 Auxiliary Coordinates</h3>
<a name="index-_002dX"></a>
<a name="index-_002d_002dauxiliary"></a>
<a name="index-standard_005fname"></a>
<a name="index-coordinates"></a>
<a name="index-CF-conventions-1"></a>
<a name="index-_002dX-lon_005fmin_002clon_005fmax_002clat_005fmin_002clat_005fmax"></a>
<a name="index-_002d_002dauxiliary-lon_005fmin_002clon_005fmax_002clat_005fmin_002clat_005fmax"></a>
<table class="cartouche" border="1"><tr><td>
<p>Availability: <code>ncbo</code>, <code>nces</code>, <code>ncecat</code>,
<code>ncflint</code>, <code>ncks</code>, <code>ncpdq</code>, <code>ncra</code>,
<code>ncrcat</code><br>
Short options: ‘<samp>-X <var>lon_min</var>,<var>lon_max</var>,<var>lat_min</var>,<var>lat_max</var></samp>’<br>
Long options:
‘<samp>--auxiliary <var>lon_min</var>,<var>lon_max</var>,<var>lat_min</var>,<var>lat_max</var></samp>’<br>
</p></td></tr></table>
<p>Utilize auxiliary coordinates specified in values of the coordinate
variable’s <code>standard_name</code> attributes, if any, when interpreting
hyperslab and multi-slab options.
Also ‘<samp>--auxiliary</samp>’.
This switch supports hyperslabbing cell-based grids over coordinate
ranges.
This works on datasets that associate coordinate variables to
grid-mappings using the <acronym>CF</acronym>-convention (see <a href="#CF-Conventions">CF Conventions</a>)
<code>coordinates</code> and <code>standard_name</code> attributes described
<a href="http://cf-pcmdi.llnl.gov/documents/cf-conventions/1.6/cf-conventions.html#coordinate-system">here</a>.
Currently, <acronym>NCO</acronym> understands auxiliary coordinate variables
pointed to by the <code>standard_name</code> attributes for <var>latitude</var> and
<var>longitude</var>.
Cells that contain a value within the user-specified range
[<var>lon_min</var>,<var>lon_max</var>,<var>lat_min</var>,<var>lat_max</var>] are
included in the output hyperslab.
</p>
<a name="index-cell_002dbased-grids"></a>
<p>A cell-based grid collapses the horizontal spatial information
(latitude and longitude) and stores it along a one-dimensional
coordinate that has a one-to-one mapping to both latitude and longitude
coordinates.
Rectangular (in longitude and latitude) horizontal hyperslabs cannot
be selected using the typical procedure (see <a href="#Hyperslabs">Hyperslabs</a>) of
separately specifying ‘<samp>-d</samp>’ arguments for longitude and latitude.
Instead, when the ‘<samp>-X</samp>’ is used, <acronym>NCO</acronym> learns the names of
the latitude and longitude coordinates by searching the
<code>standard_name</code> attribute of all variables until it finds
the two variables whose <code>standard_name</code>’s are “latitude” and
“longitude”, respectively.
This <code>standard_name</code> attribute for latitude and longitude
coordinates follows the <acronym>CF</acronym>-convention
(see <a href="#CF-Conventions">CF Conventions</a>).
</p>
<p>Putting it all together, consider a variable <var>gds_3dvar</var> output from
simulations on a cell-based geodesic grid.
Although the variable contains three dimensions of data (time, latitude,
and longitude), it is stored in the netCDF file with only two dimensions,
<code>time</code> and <code>gds_crd</code>.
</p><div class="example">
<pre class="example">% ncks -m -C -v gds_3dvar ~/nco/data/in.nc
gds_3dvar: type NC_FLOAT, 2 dimensions, 4 attributes, chunked? no, \
compressed? no, packed? no, ID = 41
gds_3dvar RAM size is 10*8*sizeof(NC_FLOAT) = 80*4 = 320 bytes
gds_3dvar dimension 0: time, size = 10 NC_DOUBLE, dim. ID = 20 \
(CRD)(REC)
gds_3dvar dimension 1: gds_crd, size = 8 NC_FLOAT, dim. ID = 17 (CRD)
gds_3dvar attribute 0: long_name, size = 17 NC_CHAR, value = \
Geodesic variable
gds_3dvar attribute 1: units, size = 5 NC_CHAR, value = meter
gds_3dvar attribute 2: coordinates, size = 15 NC_CHAR, value = \
lat_gds lon_gds
gds_3dvar attribute 3: purpose, size = 64 NC_CHAR, value = \
Test auxiliary coordinates like those that define geodesic grids
</pre></div>
<p>The <code>coordinates</code> attribute lists the names of the latitude and
longitude coordinates, <code>lat_gds</code> and <code>lon_gds</code>, respectively.
The <code>coordinates</code> attribute is recommended though optional.
With it, the user can immediately identify which variables contain
the latitude and longitude coordinates.
Without a <code>coordinates</code> attribute it would be unclear at first
glance whether a variable resides on a cell-based grid.
In this example, <code>time</code> is a normal record dimension and
<code>gds_crd</code> is the cell-based dimension.
</p>
<p>The cell-based grid file must contain two variables whose
<code>standard_name</code> attributes are “latitude”, and “longitude”:
</p><div class="example">
<pre class="example">% ncks -m -C -v lat_gds,lon_gds ~/nco/data/in.nc
lat_gds: type NC_DOUBLE, 1 dimensions, 4 attributes, \
chunked? no, compressed? no, packed? no, ID = 37
lat_gds RAM size is 8*sizeof(NC_DOUBLE) = 8*8 = 64 bytes
lat_gds dimension 0: gds_crd, size = 8 NC_FLOAT, dim. ID = 17 (CRD)
lat_gds attribute 0: long_name, size = 8 NC_CHAR, value = Latitude
lat_gds attribute 1: standard_name, size = 8 NC_CHAR, value = latitude
lat_gds attribute 2: units, size = 6 NC_CHAR, value = degree
lat_gds attribute 3: purpose, size = 62 NC_CHAR, value = \
1-D latitude coordinate referred to by geodesic grid variables
lon_gds: type NC_DOUBLE, 1 dimensions, 4 attributes, \
chunked? no, compressed? no, packed? no, ID = 38
lon_gds RAM size is 8*sizeof(NC_DOUBLE) = 8*8 = 64 bytes
lon_gds dimension 0: gds_crd, size = 8 NC_FLOAT, dim. ID = 17 (CRD)
lon_gds attribute 0: long_name, size = 9 NC_CHAR, value = Longitude
lon_gds attribute 1: standard_name, size = 9 NC_CHAR, value = longitude
lon_gds attribute 2: units, size = 6 NC_CHAR, value = degree
lon_gds attribute 3: purpose, size = 63 NC_CHAR, value = \
1-D longitude coordinate referred to by geodesic grid variables
</pre></div>
<p>In this example <code>lat_gds</code> and <code>lon_gds</code> represent the
latitude or longitude, respectively, of cell-based variables.
These coordinates (must) have the same single dimension (<code>gds_crd</code>,
in this case) as the cell-based variables.
And the coordinates must be one-dimensional—multidimensional
coordinates will not work.
</p>
<p>This infrastructure allows <acronym>NCO</acronym> to identify, interpret, and
process (e.g., hyperslab) the variables on cell-based grids as easily
as it works with regular grids.
To time-average all the values between zero and 180 degrees<!-- /@w -->
longitude and between plus and minus 30 degress<!-- /@w --> latitude, we use
</p><div class="example">
<pre class="example">ncra -O -X 0.,180.,-30.,30. -v gds_3dvar in.nc out.nc
</pre></div>
<p><acronym>NCO</acronym> accepts multiple ‘<samp>-X</samp>’ arguments for cell-based grid
multi-slabs, just as it accepts multiple ‘<samp>-d</samp>’ arguments for
multi-slabs of regular coordinates.
</p><div class="example">
<pre class="example">ncra -O -X 0.,180.,-30.,30. -X 270.,315.,45.,90. in.nc out.nc
</pre></div>
<p>The arguments to ‘<samp>-X</samp>’ are always interpreted as floating point
numbers, i.e., as coordinate values rather than dimension indices
so that these two commands produce identical results
</p><div class="example">
<pre class="example">ncra -X 0.,180.,-30.,30. in.nc out.nc
ncra -X 0,180,-30,30 in.nc out.nc
</pre></div>
<p>In contrast, arguments to ‘<samp>-d</samp>’ require decimal places to be
recognized as coordinates not indices (see <a href="#Hyperslabs">Hyperslabs</a>).
We recommend always using decimal points with ‘<samp>-X</samp>’ arguments
to avoid confusion.
</p>
<a name="UDUnits"></a> <!-- http://nco.sf.net/nco.html#UDUnits -->
<a name="UDUnits2"></a> <!-- http://nco.sf.net/nco.html#UDUnits2 --><hr>
<a name="UDUnits-Support"></a>
<div class="header">
<p>
Next: <a href="#Rebasing-Time-Coordinate" accesskey="n" rel="next">Rebasing Time Coordinate</a>, Previous: <a href="#Auxiliary-Coordinates" accesskey="p" rel="previous">Auxiliary Coordinates</a>, Up: <a href="#Common-features" accesskey="u" rel="up">Common features</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#General-Index" title="Index" rel="index">Index</a>]</p>
</div>
<a name="UDUnits-Support-1"></a>
<h3 class="section">3.22 UDUnits Support</h3>
<a name="index-UDUnits-1"></a>
<a name="index-Unidata-2"></a>
<a name="index-units"></a>
<a name="index-attribute_002c-units"></a>
<a name="index-_002dd-dim_002c_005bmin_005d_005b_002c_005bmax_005d_005b_002c_005bstride_005d_005d_005d-3"></a>
<a name="index-_002d_002ddimension-dim_002c_005bmin_005d_005b_002c_005bmax_005d_005b_002c_005bstride_005d_005d_005d-3"></a>
<a name="index-_002d_002ddmn-dim_002c_005bmin_005d_005b_002c_005bmax_005d_005b_002c_005bstride_005d_005d_005d-3"></a>
<table class="cartouche" border="1"><tr><td>
<p>Availability: <code>ncbo</code>, <code>nces</code>, <code>ncecat</code>,
<code>ncflint</code>, <code>ncks</code>, <code>ncpdq</code>, <code>ncra</code>,
<code>ncrcat</code>, <code>ncwa</code><br>
Short options: ‘<samp>-d <var>dim</var>,[<var>min</var>][,[<var>max</var>][,[<var>stride</var>]]]</samp>’<br>
Long options:
‘<samp>--dimension <var>dim</var>,[<var>min</var>][,[<var>max</var>][,[<var>stride</var>]]]</samp>’,<br>
‘<samp>--dmn <var>dim</var>,[<var>min</var>][,[<var>max</var>][,[<var>stride</var>]]]</samp>’<br>
</p></td></tr></table>
<p>There is more than one way to hyperskin a cat.
The <a href="http://www.unidata.ucar.edu/packages/udunits">UDUnits</a> package
provides a library which, if present, <acronym>NCO</acronym> uses to translate
user-specified physical dimensions into the physical dimensions of data
stored in netCDF files.
Unidata provides UDUnits under the same terms as netCDF, so sites should
install both.
Compiling <acronym>NCO</acronym> with UDUnits support is currently optional but
may become required in a future version of <acronym>NCO</acronym>.
</p>
<p>Two examples suffice to demonstrate the power and convenience of UDUnits
support.
<a name="index-MKS-units"></a>
First, consider extraction of a variable containing non-record
coordinates with physical dimensions stored in MKS units.
In the following example, the user extracts all wavelengths
in the visible portion of the spectrum in terms of the units
very frequently used in visible spectroscopy, microns:
</p><div class="example">
<pre class="example">% ncks -C -H -v wvl -d wvl,"0.4 micron","0.7 micron" in.nc
wvl[0]=5e-07 meter
</pre></div>
<a name="index-units-1"></a>
<p>The hyperslab returns the correct values because the <var>wvl</var> variable
is stored on disk with a length dimension that UDUnits recognizes in the
<code>units</code> attribute.
The automagical algorithm that implements this functionality is worth
describing since understanding it helps one avoid some potential
pitfalls.
First, the user includes the physical units of the hyperslab dimensions
she supplies, separated by a simple space from the numerical values of
the hyperslab limits.
She encloses each coordinate specifications in quotes so that the shell
does not break the <em>value-space-unit</em> string into separate
arguments before passing them to <acronym>NCO</acronym>.
Double quotes (<kbd>"foo"</kbd>) or single quotes (<kbd>'foo'</kbd>) are equally
valid for this purpose.
Second, <acronym>NCO</acronym> recognizes that units translation is requested
because each hyperslab argument contains text characters and non-initial
spaces.
Third, <acronym>NCO</acronym> determines whether the <var>wvl</var> is dimensioned
with a coordinate variable that has a <code>units</code> attribute.
<a name="index-coordinate-variable"></a>
In this case, <var>wvl</var> itself is a coordinate variable.
The value of its <code>units</code> attribute is <code>meter</code>.
Thus <var>wvl</var> passes this test so UDUnits conversion is attempted.
If the coordinate associated with the variable does not contain a
<code>units</code> attribute, then <acronym>NCO</acronym> aborts.
Fourth, <acronym>NCO</acronym> passes the specified and desired dimension strings
(microns are specified by the user, meters are required by
<acronym>NCO</acronym>) to the UDUnits library.
Fifth, the UDUnits library that these dimension are commensurate
and it returns the appropriate linear scaling factors to convert from
microns to meters to <acronym>NCO</acronym>.
If the units are incommensurate (i.e., not expressible in the same
fundamental MKS units), or are not listed in the UDUnits database, then
NCO aborts since it cannot determine the user’s intent.
Finally, <acronym>NCO</acronym> uses the scaling information to convert the
user-specified hyperslab limits into the same physical dimensions as
those of the corresponding cooridinate variable on disk.
At this point, <acronym>NCO</acronym> can perform a coordinate hyperslab using
the same algorithm as if the user had specified the hyperslab without
requesting units conversion.
</p>
<a name="index-units-2"></a>
<a name="index-time"></a>
<p>The translation and dimensional innterpretation of time coordinates
shows a more powerful, and probably more common, UDUnits application.
In this example, the user prints all data between 4 PM<!-- /@w --> and 7 PM<!-- /@w -->
on December 8<!-- /@w -->, 1999, from a variable whose time dimension is hours
since the year 1900:
</p><div class="example">
<pre class="example">% ncks -u -H -C -v time_udunits -d time_udunits,"1999-12-08 \
16:00:0.0","1999-12-08 19:00:0.0" in.nc
time_udunits[1]=876018 hours since 1900-01-01 00:00:0.0
</pre></div>
<a name="index-stride-3"></a>
<a name="index-whitespace"></a>
<p>Here, the user invokes the stride (see <a href="#Stride">Stride</a>) capability to obtain
every other timeslice.
This is possible because the UDUnits feature is additive, not
exclusive—it works in conjunction with all other hyperslabbing
(see <a href="#Hyperslabs">Hyperslabs</a>) options and in all operators which support
hyperslabbing.
The following example shows how one might average data in a
time period spread across multiple input files
</p><div class="example">
<pre class="example">ncra -d time,"1939-09-09 12:00:0.0","1945-05-08 00:00:0.0" \
in1.nc in2.nc in3.nc out.nc
</pre></div>
<p>Note that there is no excess whitespace before or after the individual
elements of the ‘<samp>-d</samp>’ argument.
<a name="index-shell-2"></a>
This is important since, as far as the shell knows, ‘<samp>-d</samp>’ takes
only <em>one</em> command-line argument.
Parsing this argument into its component
<code><var>dim</var>,[<var>min</var>][,[<var>max</var>][,[<var>stride</var>]]]</code> elements
(see <a href="#Hyperslabs">Hyperslabs</a>) is the job of <acronym>NCO</acronym>.
When unquoted whitespace is present between these elements, the shell
passes <acronym>NCO</acronym> arugment fragments which will not parse as
intended.
</p>
<p><acronym>NCO</acronym> implemented support for the UDUnits2 library with version
3.9.2 (August, 2007).
The
<a href="http://www.unidata.ucar.edu/software/udunits/udunits-2/udunits2.html">UDUnits2</a> package supports non-ASCII characters and logarithmic units.
We are interested in user-feedback on these features.
</p>
<p>One aspect that deserves mention is that UDUnits, and thus
<acronym>NCO</acronym>, supports run-time definition of the location of the
relevant UDUnits databases.
With UDUnits version 1<!-- /@w -->, users may specify the directory which
contains the UDUnits database, <samp>udunits.dat</samp>, via the
<code>UDUNITS_PATH</code> environment variable.
With UDUnits version 2<!-- /@w -->, users may specify the UDUnits database file
itself, <samp>udunits2.xml</samp>, via the <code>UDUNITS2_XML_PATH</code>
environment variable.
</p><div class="example">
<pre class="example"># UDUnits1
export UDUNITS_PATH='/unusual/location/share/udunits'
# UDUnits2
export UDUNITS2_XML_PATH='/unusual/location/share/udunits/udunits2.xml'
</pre></div>
<p>This run-time flexibility can enable the full functionality of
pre-built binaries on machines with libraries in different locations.
</p>
<a name="index-Climate-and-Forecast-Metadata-Convention"></a>
<a name="index-CF-conventions-2"></a>
<p>The <a href="http://www.unidata.ucar.edu/packages/udunits">UDUnits</a>
package documentation describes the supported formats of time
dimensions.
Among the metadata conventions that adhere to these formats are the
<a href="http://cf-pcmdi.llnl.gov">Climate and Forecast (CF) Conventions</a> and the
<a href="http://ferret.wrc.noaa.gov/noaa_coop/coop_cdf_profile.html">Cooperative Ocean/Atmosphere Research Data Service (COARDS) Conventions</a>.
The following ‘<samp>-d arguments</samp>’ extract the same data using
commonly encountered time dimension formats:
</p><div class="example">
<pre class="example">-d time,'1918-11-11 00:00:0.0','1939-09-09 00:00:0.0'
-d time,'1918-11-11 00:00:0.0','1939-09-09 00:00:0.0'
-d time,'1918-11-11T00:00:0.0Z','1939-09-09T00:00:0.0Z'
-d time,'1918-11-11','1939-09-09'
-d time,'1918-11-11','1939-9-9'
</pre></div>
<p>All of these formats include at least one dash <kbd>-</kbd> in a
non-leading character position (a dash in a leading character position
is a negative sign).
<acronym>NCO</acronym> assumes that a space, colon, or non-leading dash in a
limit string indicates that a UDUnits units conversion is requested.
Some date formats like YYYYMMDD that are valid in UDUnits are ambiguous
to <acronym>NCO</acronym> because it cannot distinguish a purely numerical date
(i.e., no dashes or text characters in it) from a coordinate or index
value:
</p><div class="example">
<pre class="example">-d time,1918-11-11 # Interpreted as the date November 11, 1918
-d time,19181111 # Interpreted as time-dimension index 19181111
-d time,19181111. # Interpreted as time-coordinate value 19181111.0
</pre></div>
<p>Hence, use the YYYY-MM-DD format rather than YYYYMMDD for dates.
</p>
<p>As of version 4.0.0 (January, 2010), <acronym>NCO</acronym> supports some
calendar attributes specified by the <acronym>CF</acronym> conventions.
</p><dl compact="compact">
<dt><strong>Supported types:</strong></dt>
<dd><p>"365_day"/"noleap", "360_day", "gregorian", "standard"
</p></dd>
<dt><strong>Unsupported types:</strong></dt>
<dd><p>"366_day"/"all_leap","proleptic_gregorian","julian","none"
</p></dd>
</dl>
<p>Unsupported types default to mixed Gregorian/Julian as defined by
UDUnits.
</p>
<p>An Example: Consider the following netCDF variable
</p>
<div class="example">
<pre class="example">variables:
double lon_cal(lon_cal) ;
lon_cal:long_name = "lon_cal" ;
lon_cal:units = "days since 1964-2-28 0:0:0" ;
lon_cal:calendar = "365_day" ;
data:
lon_cal = 1,2,3,4,5,6,7,8,9,10;
</pre></div>
<p>‘<samp>ncks -v lon_cal -d lon_cal,'1964-3-1 0:00:0.0','1964-3-4 00:00:0.0'</samp>’
results in <code>lon_cal=1,2,3,4</code>.
</p>
<a name="index-MKS-units-1"></a>
<a name="index-God"></a>
<p>netCDF variables should always be stored with MKS (i.e., God’s) units,
so that application programs may assume MKS dimensions apply to all
input variables.
The UDUnits feature is intended to alleviate some of the <acronym>NCO</acronym>
user’s pain when handling MKS units.
It connects users who think in human-friendly units (e.g.,
miles, millibars, days) to extract data which are always stored in God’s
units, MKS (e.g., meters, Pascals, seconds).
The feature is not intended to encourage writers to store data in
esoteric units (e.g., furlongs, pounds per square inch, fortnights).
</p>
<a name="time_rebase"></a> <!-- http://nco.sf.net/nco.html#time_rebase -->
<a name="rbs"></a> <!-- http://nco.sf.net/nco.html#rbs --><hr>
<a name="Rebasing-Time-Coordinate"></a>
<div class="header">
<p>
Next: <a href="#Multiple-Record-Dimensions" accesskey="n" rel="next">Multiple Record Dimensions</a>, Previous: <a href="#UDUnits-Support" accesskey="p" rel="previous">UDUnits Support</a>, Up: <a href="#Common-features" accesskey="u" rel="up">Common features</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#General-Index" title="Index" rel="index">Index</a>]</p>
</div>
<a name="Rebasing-Time-Coordinate-1"></a>
<h3 class="section">3.23 Rebasing Time Coordinate</h3>
<table class="cartouche" border="1"><tr><td>
<p>Availability:
<code>ncra</code>, <code>ncrcat</code>
Short options: None<br>
</p></td></tr></table>
<p>Time rebasing is invoked when numerous files share a common record
coordinate, and the record coordinate units change among input files.
The rebasing is performed automatically if and only if UDUnits is
installed.
Usually rebasing occurs when the recoordinate is a time-based variable,
and times are recorded in units of a time-since-basetime, and the
basetime changes from file to file.
Since the output file can have only one unit (i.e., one basetime) for
the record coordinate, <acronym>NCO</acronym>, in such cases, chooses the units
of the first input file to be the units of the output file.
It is necessary to “rebase” all the input record variables to this
output time unit in order for the output file to have the correct
values.
</p>
<p>For example suppose the time coordinate is in hours and each day in
January is stored in its own daily file.
Each daily file records the temperature variable <code>tpt(time)</code>
with an (unadjusted) <code>time</code> coordinate value between 0–23 hours,
and uses the <code>units</code> attribute to advance the base time:
</p><div class="example">
<pre class="example">file01.nc time:units="hours since 1990-1-1"
file02.nc time:units="hours since 1990-1-2"
...
file31.nc time:units="hours since 1990-1-31"
</pre></div>
<div class="example">
<pre class="example">// Mean noontime temperature in January
ncra -v tpt -d time,"1990-1-1 12:00:00","1990-1-31 23:59:59",24 \
file??.nc noon.nc
// Concatenate day2 noon through day3 noon records
ncrcat -v tpt -d time,"1990-1-2 12:00:00","1990-1-3 11:59:59" \
file01.nc file02.nc file03.nc noon.nc
// Results: time is "re-based" to the time units in "file01.nc"
time=36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, \
51, 52, 53, 54, 55, 56, 57, 58, 59 ;
// If we repeat the above command but with only two input files...
ncrcat -v tpt -d time,"1990-1-2 12:00:00","1990-1-3 11:59:59" \
file02.nc file03 noon.nc
// ...then output time coordinate is based on time units in "file02.nc"
time = 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, \
26, 27, 28, 29, 30, 31, 32, 33, 34, 35 ;
</pre></div>
<p>As of <acronym>NCO</acronym> version 4.2.1 (August, 2012), <acronym>NCO</acronym>
automatically rebases not only the record coordinate (<code>time</code>, here)
but also any bounds associated with the record coordinate (e.g.,
<code>time_bnds</code>) (see <a href="#CF-Conventions">CF Conventions</a>).
</p>
<a name="mrd"></a> <!-- http://nco.sf.net/nco.html#mrd --><hr>
<a name="Multiple-Record-Dimensions"></a>
<div class="header">
<p>
Next: <a href="#Missing-Values" accesskey="n" rel="next">Missing Values</a>, Previous: <a href="#Rebasing-Time-Coordinate" accesskey="p" rel="previous">Rebasing Time Coordinate</a>, Up: <a href="#Common-features" accesskey="u" rel="up">Common features</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#General-Index" title="Index" rel="index">Index</a>]</p>
</div>
<a name="Multiple-Record-Dimensions-1"></a>
<h3 class="section">3.24 Multiple Record Dimensions</h3>
<a name="index-netCDF4-2"></a>
<a name="index-_002d_002dmrd"></a>
<a name="index-_002d_002dmultiple_005frecord_005fdimensions"></a>
<table class="cartouche" border="1"><tr><td>
<p>Availability:
<code>ncecat</code>, <code>ncpdq</code>
Short options: None<br>
Long options: ‘<samp>--mrd</samp>’<br>
</p></td></tr></table>
<p>The netCDF3 file format allows only one record dimension, and that
dimension must be the first dimension (i.e., the least rapidly varying
dimension) of any variable in which it appears.
This imposes certain rules on how operators must perform operations
that alter the ordering of dimensions or the number of record variables.
The netCDF4 file format has no such restrictions.
Files and variables may have any number of record dimensions in any
order.
This additional flexibility of netCDF4 can only be realized by
selectively abandoning the constraints that would make operations
behave completely consistently between netCDF3 and netCDF4 files.
</p>
<p><acronym>NCO</acronym> chooses, by default, to impose netCDF3-based constraints
on netCDF4 files.
This reduces the number of unanticipated consequences and keeps the
operators functioning in a familiar way.
Put another way, <acronym>NCO</acronym> limits production of additional record
dimensions so processing netCDF4 files leads to the same results as
processing netCDF4 files.
Users can override this default with the ‘<samp>--mrd</samp>’ (or
‘<samp>--multiple_record_dimension</samp>’) switch, which enables netCDF4
variables to accumulate additional record dimensions.
</p>
<p>How can additional record dimensions be produced?
Most commonly <code>ncecat</code> (in record-aggregate mode) defines a new
leading record dimension.
In netCDF4 files this becomes an additional record dimension unless the
original record dimension is changed to a fixed dimension (as must be
done in netCDF3 files).
Also when <code>ncpdq</code> reorders dimensions it can preserve the
“record” property of record variables.
<code>ncpdq</code> tries to define as a record dimension whichever
dimension ends up first in a record variable, and, in netCDF4 files,
this becomes an additional record dimension unless the original record
dimension is changed to a fixed dimension (as must be done in netCDF3
files).
It it easier if <code>ncpdq</code> and <code>ncecat</code> do not increase
the number of record dimensions in a variable so that is the default.
Use ‘<samp>--mrd</samp>’ to override this.
</p>
<a name="missing_value"></a> <!-- http://nco.sf.net/nco.html#missing_value -->
<a name="_FillValue"></a> <!-- http://nco.sf.net/nco.html#_FillValue -->
<a name="fll_val"></a> <!-- http://nco.sf.net/nco.html#fll_val -->
<a name="mss_val"></a> <!-- http://nco.sf.net/nco.html#mss_val -->
<a name="mss"></a> <!-- http://nco.sf.net/nco.html#mss --><hr>
<a name="Missing-Values"></a>
<div class="header">
<p>
Next: <a href="#Chunking" accesskey="n" rel="next">Chunking</a>, Previous: <a href="#Multiple-Record-Dimensions" accesskey="p" rel="previous">Multiple Record Dimensions</a>, Up: <a href="#Common-features" accesskey="u" rel="up">Common features</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#General-Index" title="Index" rel="index">Index</a>]</p>
</div>
<a name="Missing-values"></a>
<h3 class="section">3.25 Missing values</h3>
<a name="index-missing-values"></a>
<a name="index-data_002c-missing"></a>
<a name="index-averaging-data"></a>
<a name="index-missing_005fvalue"></a>
<a name="index-_005fFillValue"></a>
<table class="cartouche" border="1"><tr><td>
<p>Availability: <code>ncap2</code>, <code>ncbo</code>, <code>nces</code>,
<code>ncflint</code>, <code>ncpdq</code>, <code>ncra</code>, <code>ncwa</code><br>
Short options: None<br>
</p></td></tr></table>
<p>The phrase <em>missing data</em> refers to data points that are missing,
invalid, or for any reason not intended to be arithmetically processed
in the same fashion as valid data.
<a name="index-arithmetic-operators"></a>
The <acronym>NCO</acronym> arithmetic operators attempt to handle missing data in
an intelligent fashion.
There are four steps in the <acronym>NCO</acronym> treatment of missing data:
</p><ol>
<li> Identifying variables that may contain missing data.
<p><acronym>NCO</acronym> follows the convention that missing data should be stored
with the <var>_FillValue</var> specified in the variable’s <code>_FillValue</code>
attributes.
The <em>only</em> way <acronym>NCO</acronym> recognizes that a variable <em>may</em>
contain missing data is if the variable has a <code>_FillValue</code>
attribute.
In this case, any elements of the variable which are numerically equal
to the <var>_FillValue</var> are treated as missing data.
</p>
<p><acronym>NCO</acronym> adopted the behavior that the default attribute name, if
any, assumed to specify the value of data to ignore is <code>_FillValue</code>
with version 3.9.2 (August, 2007).
Prior to that, the <code>missing_value</code> attribute, if any, was assumed to
specify the value of data to ignore.
Supporting both of these attributes simultaneously is not practical.
Hence the behavior <acronym>NCO</acronym> once applied to <var>missing_value</var> it
now applies to any <var>_FillValue</var>.
<acronym>NCO</acronym> now treats any <var>missing_value</var> as normal data
<a name="DOCF32" href="#FOOT32"><sup>32</sup></a>.
</p>
<a name="index-ncrename"></a>
<a name="index-ncatted-3"></a>
<p>It has been and remains most advisable to create both <code>_FillValue</code>
and <code>missing_value</code> attributes with identical values in datasets.
Many legacy datasets contain only <code>missing_value</code> attributes.
<acronym>NCO</acronym> can help migrating datasets between these conventions.
One may use <code>ncrename</code> (see <a href="#ncrename-netCDF-Renamer">ncrename netCDF Renamer</a>) to
rename all <code>missing_value</code> attributes to <code>_FillValue</code>:
</p><div class="example">
<pre class="example">ncrename -a .missing_value,_FillValue inout.nc
</pre></div>
<p>Alternatively, one may use
<code>ncatted</code> (see <a href="#ncatted-netCDF-Attribute-Editor">ncatted netCDF Attribute Editor</a>) to
add a <code>_FillValue</code> attribute to all variables
</p><div class="example">
<pre class="example">ncatted -O -a _FillValue,,o,f,1.0e36 inout.nc
</pre></div>
</li><li> Converting the <var>_FillValue</var> to the type of the variable, if
neccessary.
<p>Consider a variable <var>var</var> of type <var>var_type</var> with a
<code>_FillValue</code> attribute of type <var>att_type</var> containing the
value <var>_FillValue</var>.
As a guideline, the type of the <code>_FillValue</code> attribute should be
the same as the type of the variable it is attached to.
If <var>var_type</var> equals <var>att_type</var> then <acronym>NCO</acronym>
straightforwardly compares each value of <var>var</var> to
<var>_FillValue</var> to determine which elements of <var>var</var> are to be
treated as missing data.
<a name="index-C-language-1"></a>
If not, then <acronym>NCO</acronym> converts <var>_FillValue</var> from
<var>att_type</var> to <var>var_type</var> by using the implicit conversion rules
of C<!-- /@w -->, or, if <var>att_type</var> is <code>NC_CHAR</code>
<a name="DOCF33" href="#FOOT33"><sup>33</sup></a>, by typecasting the results of the C function<!-- /@w -->
<code>strtod(<var>_FillValue</var>)</code>.
<a name="index-ncatted-1"></a>
You may use the <acronym>NCO</acronym> operator <code>ncatted</code> to change the
<code>_FillValue</code> attribute and all data whose data is
<var>_FillValue</var> to a new value
(see <a href="#ncatted-netCDF-Attribute-Editor">ncatted netCDF Attribute Editor</a>).
</p>
</li><li> Identifying missing data during arithmetic operations.
<a name="index-performance-5"></a>
<a name="index-operator-speed-4"></a>
<a name="index-speed-5"></a>
<a name="index-execution-time-4"></a>
<a name="index-arithmetic-operators-1"></a>
<p>When an <acronym>NCO</acronym> arithmetic operator processes a variable <var>var</var>
with a <code>_FillValue</code> attribute, it compares each value of
<var>var</var> to <var>_FillValue</var> before performing an operation.
Note the <var>_FillValue</var> comparison imposes a performance penalty
on the operator.
Arithmetic processing of variables which contain the
<code>_FillValue</code> attribute always incurs this penalty, even when
none of the data are missing.
Conversely, arithmetic processing of variables which do not contain the
<code>_FillValue</code> attribute never incurs this penalty.
In other words, do not attach a <code>_FillValue</code> attribute to a
variable which does not contain missing data.
This exhortation can usually be obeyed for model generated data, but it
may be harder to know in advance whether all observational data will be
valid or not.
</p>
</li><li> Treatment of any data identified as missing in arithmetic operators.
<a name="index-nces-1"></a>
<a name="index-ncra-1"></a>
<a name="index-ncwa-2"></a>
<a name="index-ncbo"></a>
<a name="index-ncflint-1"></a>
<p><acronym>NCO</acronym> averagers (<code>ncra</code>, <code>nces</code>, <code>ncwa</code>)
do not count any element with the value <var>_FillValue</var> towards the
average.
<code>ncbo</code> and <code>ncflint</code> define a <var>_FillValue</var> result
when either of the input values is a <var>_FillValue</var>.
Sometimes the <var>_FillValue</var> may change from file to file in a
multi-file operator, e.g., <code>ncra</code>.
<acronym>NCO</acronym> is written to account for this (it always compares a
variable to the <var>_FillValue</var> assigned to that variable in the
current file).
Suffice it to say that, in all known cases, <acronym>NCO</acronym> does “the
right thing”.
</p>
<p>It is impossible to determine and store the correct result of a binary
operation in a single variable.
One such corner case occurs when both operands have differing
<var>_FillValue</var> attributes, i.e., attributes with different
numerical values.
Since the output (result) of the operation can only have one
<var>_FillValue</var>, some information may be lost.
In this case, <acronym>NCO</acronym> always defines the output variable to have
the same <var>_FillValue</var> as the first input variable.
Prior to performing the arithmetic operation, all values of the second
operand equal to the second <var>_FillValue</var> are replaced with the
first <var>_FillValue</var>.
Then the arithmetic operation proceeds as normal, comparing each element
of each operand to a single <var>_FillValue</var>.
Comparing each element to two distinct <var>_FillValue</var>’s would be
much slower and would be no likelier to yield a more satisfactory
answer.
In practice, judicious choice of <var>_FillValue</var> values prevents any
important information from being lost.
</p></li></ol>
<a name="chunking"></a> <!-- http://nco.sf.net/nco.html#chunking -->
<a name="cnk"></a> <!-- http://nco.sf.net/nco.html#cnk -->
<a name="cnk_sz"></a> <!-- http://nco.sf.net/nco.html#cnk_sz -->
<a name="chunk_size"></a> <!-- http://nco.sf.net/nco.html#chunk_size --><hr>
<a name="Chunking"></a>
<div class="header">
<p>
Next: <a href="#Deflation" accesskey="n" rel="next">Deflation</a>, Previous: <a href="#Missing-Values" accesskey="p" rel="previous">Missing Values</a>, Up: <a href="#Common-features" accesskey="u" rel="up">Common features</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#General-Index" title="Index" rel="index">Index</a>]</p>
</div>
<a name="Chunking-1"></a>
<h3 class="section">3.26 Chunking</h3>
<a name="index-_002d_002dcnk_005fbyt"></a>
<a name="index-_002d_002dcnk_005fdmn"></a>
<a name="index-_002d_002dcnk_005fmap"></a>
<a name="index-_002d_002dcnk_005fplc"></a>
<a name="index-_002d_002dcnk_005fscl"></a>
<a name="index-_002d_002dchunk_005fbyte"></a>
<a name="index-_002d_002dchunk_005fdimension"></a>
<a name="index-_002d_002dchunk_005fmap"></a>
<a name="index-_002d_002dchunk_005fpolicy"></a>
<a name="index-_002d_002dchunk_005fscalar"></a>
<a name="index-chunking-1"></a>
<table class="cartouche" border="1"><tr><td>
<p>Availability: <code>ncap2</code>, <code>ncbo</code>, <code>nces</code>,
<code>ncecat</code>, <code>ncflint</code>, <code>ncks</code>, <code>ncpdq</code>,
<code>ncra</code>, <code>ncrcat</code>, <code>ncwa</code><br>
Short options: none<br>
Long options:
‘<samp>--cnk_byt <var>cnk_sz</var></samp>’, ‘<samp>--chunk_byte <var>cnk_sz</var></samp>’<br>
‘<samp>--cnk_dmn <var>dmn_nm</var>,<var>cnk_sz</var></samp>’,
‘<samp>--chunk_dimension <var>dmn_nm</var>,<var>cnk_sz</var></samp>’<br>,
‘<samp>--cnk_map <var>cnk_map</var></samp>’, ‘<samp>--chunk_map <var>cnk_map</var></samp>’,<br>
‘<samp>--cnk_plc <var>cnk_plc</var></samp>’, ‘<samp>--chunk_policy <var>cnk_plc</var></samp>’,<br>
‘<samp>--cnk_scl <var>cnk_sz</var></samp>’, ‘<samp>--chunk_scalar <var>cnk_sz</var></samp>’<br>
</p></td></tr></table>
<p>All netCDF4-enabled <acronym>NCO</acronym> operators that define variables
support a plethora of chunksize options.
Chunking can significantly accelerate or degrade read/write access
to large datasets.
Dataset chunking issues are described in detail
<a href="http://www.hdfgroup.org/HDF5/doc/H5.user/Chunking.html">here</a>,
<a href="http://www.unidata.ucar.edu/blogs/developer/en/entry/chunking_data_why_it_matters">here</a>,
and
<a href="http://www.unidata.ucar.edu/blogs/developer/en/entry/chunking_data_choosing_shapes">here</a>.
</p>
<a name="index-chunking-policy"></a>
<a name="index-chunking-map"></a>
<a name="index-chunksize"></a>
<p>The <acronym>NCO</acronym> chunking implementation is designed to be flexible.
Users control three aspects of the chunking implementation.
These are known as the <em>chunking policy</em>, <em>chunking map</em>,
and <em>chunksize</em>.
The first two are high-level mechanisms that apply to an entire file
and all variables and dimensions, while the third allows per-dimension
specification of parameters.
<a name="index-hyperslab-1"></a>
<a name="index-ncpdq-2"></a>
<a name="index-packing-1"></a>
The implementation is a hybrid of the <code>ncpdq</code> packing policies
(see <a href="#ncpdq-netCDF-Permute-Dimensions-Quickly">ncpdq netCDF Permute Dimensions Quickly</a>), and the hyperslab
specifications (see <a href="#Hyperslabs">Hyperslabs</a>).
Each aspect is intended to have a sensible default, so that most users
will only need to set one switch to obtain sensible chunking.
Power users can tune the three switches in tandem to obtain optimal
performance.
</p>
<p>The user specifies the desired chunking policy with the ‘<samp>-P</samp>’ switch
(or its long option equivalents, ‘<samp>--cnk_plc</samp>’ and
‘<samp>--chunk_policy</samp>’) and its <var>cnk_plc</var> argument.
Five chunking policies are currently implemented:<br>
<a name="index-all"></a>
<a name="index-g2d"></a>
<a name="index-g3d"></a>
<a name="index-xpl"></a>
<a name="index-xst"></a>
<a name="index-cnk_005fall"></a>
<a name="index-cnk_005fg2d"></a>
<a name="index-cnk_005fg3d"></a>
<a name="index-cnk_005fxpl"></a>
<a name="index-cnk_005fxst"></a>
<a name="index-plc_005fall"></a>
<a name="index-plc_005fg2d"></a>
<a name="index-plc_005fg3d"></a>
<a name="index-plc_005fxpl"></a>
<a name="index-plc_005fxst"></a>
</p><dl compact="compact">
<dt><em>Chunk All Variables [<em>default</em>]</em></dt>
<dd><p>Definition: Chunk all variables possible.
For obvious reasons, scalar variables cannot be chunked.<br>
Alternate invocation: <code>ncchunk</code><br>
<var>cnk_plc</var> key values: ‘<samp>all</samp>’, ‘<samp>cnk_all</samp>’, ‘<samp>plc_all</samp>’<br>
Mnemonic: All<br>
</p></dd>
<dt><em>Chunk Variables with at least Two Dimensions</em></dt>
<dd><p>Definition: Chunk all variables possible with at least two dimensions<br>
Alternate invocation: none<br>
<var>cnk_plc</var> key values: ‘<samp>g2d</samp>’, ‘<samp>cnk_g2d</samp>’, ‘<samp>plc_g2d</samp>’<br>
Mnemonic: <em>G</em>reater than or equal to <em>2</em> <em>D</em>imensions<br>
</p></dd>
<dt><em>Chunk Variables with at least Three Dimensions</em></dt>
<dd><p>Definition: Chunk all variables possible with at least three dimensions<br>
Alternate invocation: none<br>
<var>cnk_plc</var> key values: ‘<samp>g3d</samp>’, ‘<samp>cnk_g3d</samp>’, ‘<samp>plc_g3d</samp>’<br>
Mnemonic: <em>G</em>reater than or equal to <em>3</em> <em>D</em>imensions<br>
</p></dd>
<dt><em>Chunk Variables Containing Explicitly Chunked Dimensions</em></dt>
<dd><p>Definition: Chunk all variables possible that contain at least one
dimension whose chunksize was explicitly set with the ‘<samp>--cnk_dmn</samp>’ option.
Alternate invocation: none<br>
<var>cnk_plc</var> key values: ‘<samp>xpl</samp>’, ‘<samp>cnk_xpl</samp>’, ‘<samp>plc_xpl</samp>’<br>
Mnemonic: E<em>XPL</em>icitly specified dimensions<br>
</p></dd>
<dt><em>Chunk Variables with Existing Chunk Sizes</em></dt>
<dd><p>Definition: Chunk all variables possible that are already chunked in the
input file.
When used in conjunction with ‘<samp>cnk_map=xst</samp>’ this option preserves
and copies the chunking parameters from the input to the output file.
Alternate invocation: none<br>
<var>cnk_plc</var> key values: ‘<samp>xst</samp>’, ‘<samp>cnk_xst</samp>’, ‘<samp>plc_xst</samp>’<br>
Mnemonic: E<em>X</em>i<em>ST</em>ing chunk sizes<br>
</p></dd>
<dt><em>Unchunking</em></dt>
<dd><p>Definition: Unchunk all variables possible.
The <acronym>HDF5</acronym> storge layer requires that record variables (i.e.,
variables that contain at least one record dimension) must be chunked.
Also variables that are compressed or use checksums must be chunked.
Such variables cannot be unchunked.<br>
Alternate invocation: <code>ncunchunk</code><br>
<var>cnk_plc</var> key values: ‘<samp>uck</samp>’, ‘<samp>cnk_uck</samp>’, ‘<samp>plc_uck</samp>’, ‘<samp>unchunk</samp>’<br>
Mnemonic: <em>U</em>n<em>C</em>hun<em>K</em><br>
</p></dd>
</dl>
<p>Equivalent key values are fully interchangeable.
Multiple equivalent options are provided to satisfy disparate needs
and tastes of <acronym>NCO</acronym> users working with scripts and from the
command line.
</p>
<a name="index-chunking-map-1"></a>
<a name="index-degenerate-dimension"></a>
<a name="index-cnk_005fmap"></a>
<a name="index-_002dM-cnk_005fmap"></a>
<a name="index-_002d_002dcnk_005fmap-cnk_005fmap"></a>
<a name="index-_002d_002dmap-cnk_005fmap"></a>
<p>The chunking algorithms must know the chunksizes of each dimension of
each variable to be chunked.
The correspondence between the input variable shape and the chunksizes
is called the <em>chunking map</em>.
The user specifies the desired chunking map with the ‘<samp>-M</samp>’ switch
(or its long option equivalents, ‘<samp>--cnk_map</samp>’ and
‘<samp>--chunk_map</samp>’) and its <var>cnk_map</var> argument.
Four chunking maps are currently implemented:<br>
<a name="index-dmn"></a>
<a name="index-scl"></a>
<a name="index-prd"></a>
<a name="index-lfp"></a>
<a name="index-rd1"></a>
<a name="index-xst-1"></a>
<a name="index-rew"></a>
<a name="index-cnk_005fdmn"></a>
<a name="index-cnk_005fscl"></a>
<a name="index-cnk_005fprd"></a>
<a name="index-cnk_005flfp"></a>
<a name="index-cnk_005frd1"></a>
<a name="index-cnk_005fxst-1"></a>
<a name="index-map_005fdmn"></a>
<a name="index-map_005fscl"></a>
<a name="index-map_005fprd"></a>
<a name="index-map_005flfp"></a>
<a name="index-map_005frd1"></a>
<a name="index-map_005fxst"></a>
<a name="index-Chris-Barker"></a>
</p><dl compact="compact">
<dt><em>Chunksize Equals Dimension Size [<em>default</em>]</em></dt>
<dd><p>Definition: Chunksize defaults to dimension size.
Explicitly specify chunksizes for particular dimensions with
‘<samp>--cnk_dmn</samp>’ option.<br>
<var>cnk_map</var> key values: ‘<samp>dmn</samp>’, ‘<samp>cnk_dmn</samp>’, ‘<samp>map_dmn</samp>’<br>
Mnemonic: <em>D</em>i<em>M</em>e<em>N</em>sion<br>
</p></dd>
<dt><em>Chunksize Equals Dimension Size except Record Dimension</em></dt>
<dd><p>Definition: Chunksize equals dimension size except record dimension has size one.
Explicitly specify chunksizes for particular dimensions with
‘<samp>--cnk_dmn</samp>’ option.<br>
<var>cnk_map</var> key values: ‘<samp>rd1</samp>’, ‘<samp>cnk_rd1</samp>’, ‘<samp>map_rd1</samp>’<br>
Mnemonic: <em>R</em>ecord <em>D</em>imension size <em>1</em><br>
</p></dd>
<dt><em>Chunksize Equals Scalar Size Specified</em></dt>
<dd><p>Definition: Chunksize for all dimensions is set with the
‘<samp>--cnk_scl</samp>’ option.<br>
<var>cnk_map</var> key values: ‘<samp>xpl</samp>’, ‘<samp>cnk_xpl</samp>’, ‘<samp>map_xpl</samp>’<br>
Mnemonic: E<em>XPL</em>icitly specified dimensions<br>
</p></dd>
<dt><em>Chunksize Product Matches Scalar Size Specified</em></dt>
<dd><p>Definition: The product of the chunksizes for each variable
matches (approximately equals) the size specified with the
‘<samp>--cnk_scl</samp>’ option.
A dimension of size one is said to be <em>degenerate</em>.
For a variable of rank <var>R</var> (i.e., with <var>R</var> non-degenerate
dimensions), the chunksize in each non-degenerate dimension is the
<var>R</var>th root of <var>cnk_scl</var>.<br>
<var>cnk_map</var> key values: ‘<samp>prd</samp>’, ‘<samp>cnk_prd</samp>’, ‘<samp>map_prd</samp>’<br>
Mnemonic: <em>PR</em>o<em>D</em>uct<br>
</p></dd>
<dt><em>Chunksize Lefter Product Matches Scalar Size Specified</em></dt>
<dd><p>Definition: The product of the chunksizes for each variable
(approximately) equals the size specified with the ‘<samp>--cnk_scl</samp>’
option.
This is accomplished by using dimension sizes as chunksizes for the
rightmost (most rapidly varying) dimensions, and then “flexing” the
chunksize of the leftmost (least rapidly varying) dimensions such that
the product of all chunksizes matches the specified size.
All dimensions to the left of and including the first record dimension
define the left-hand side.
This map was first proposed by Chris Barker.<br>
<var>cnk_map</var> key values: ‘<samp>lfp</samp>’, ‘<samp>cnk_lfp</samp>’, ‘<samp>map_lfp</samp>’<br>
Mnemonic: <em>L</em>e<em>F</em>ter <em>P</em>roduct<br>
</p></dd>
<dt><em>Chunksize Equals Existing Chunksize</em></dt>
<dd><p>Definition: Chunksizes are copied from the input to the output
file for every variable that is chunked in the input file.
Variables not chunked in the input file will be chunked with
default mappings.<br>
<var>cnk_map</var> key values: ‘<samp>xst</samp>’, ‘<samp>cnk_xst</samp>’, ‘<samp>map_xst</samp>’<br>
Mnemonic: E<em>X</em>i<em>ST</em><br>
</p></dd>
<dt><em>Chunksize Balances 1D and (N-1)-D Access to N-D Variable</em></dt>
<dd><p>Definition: Chunksizes are chosen so that 1-D and (<var>(N-1)</var>)-D
hyperslabs of <var>3</var>-D variables (e.g., point-timeseries orn
latitude/longitude surfaces of 3-D fields) both require approximately
the number of chunks.
Hence their access time should be balanced.
Russ Rew explains the motivation and derivation for this strategy
<a href="http://www.unidata.ucar.edu/blogs/developer/en/entry/chunking_data_choosing_shapes">here</a>.<br>
<var>cnk_map</var> key values: ‘<samp>rew</samp>’, ‘<samp>cnk_rew</samp>’, ‘<samp>map_rew</samp>’<br>
Mnemonic: Russ <em>REW</em><br>
</p></dd>
</dl>
<p>It is possible to combine the above chunking map algorithms with
user-specified per-dimension (though not per-variable) chunksizes that
override specific chunksizes determined by the maps above.
The user specifies the per-dimension chunksizes with the (equivalent)
long options ‘<samp>--cnk_dmn</samp>’ or ‘<samp>--chunk_dimension</samp>’).
The option takes two comma-separated arguments,
<var>dmn_nm</var>,<var>cnk_sz</var>, which are the dimension name and its
chunksize, respectively.
The ‘<samp>--cnk_dmn</samp>’ option may be used as many times as necessary.
</p>
<a name="xmp_cnk"></a> <!-- http://nco.sf.net/nco.html#xmp_cnk -->
<a name="xmp_chunk"></a> <!-- http://nco.sf.net/nco.html#xmp_chunk --><div class="example">
<pre class="example"># Simple chunking and unchunking
ncks -O -4 --cnk_plc=all in.nc out.nc # Chunk in.nc
ncks -O -4 --cnk_plc=unchunk in.nc out.nc # Unchunk in.nc
# Chunk data then unchunk it, printing informative metadata
ncks -O -4 -D 4 --cnk_plc=all ~/nco/data/in.nc ~/foo.nc
ncks -O -4 -D 4 --cnk_plc=uck ~/foo.nc ~/foo.nc
# Set total chunksize to 8192 B
ncks -O -4 -D 4 --cnk_plc=all --cnk_byt=8192 ~/nco/data/in.nc ~/foo.nc
# More complex chunking procedures, with informative metadata
ncks -O -4 -D 4 --cnk_scl=8 ~/nco/data/in.nc ~/foo.nc
ncks -O -4 -D 4 --cnk_scl=8 dstmch90_clm.nc ~/foo.nc
ncks -O -4 -D 4 --cnk_dmn lat,64 --cnk_dmn lon,128 dstmch90_clm.nc \
~/foo.nc
ncks -O -4 -D 4 --cnk_plc=uck ~/foo.nc ~/foo.nc
ncks -O -4 -D 4 --cnk_plc=g2d --cnk_map=rd1 --cnk_dmn lat,32 \
--cnk_dmn lon,128 dstmch90_clm_0112.nc ~/foo.nc
# Chunking works with all operators...
ncap2 -O -4 -D 4 --cnk_scl=8 -S ~/nco/data/ncap2_tst.nco \
~/nco/data/in.nc ~/foo.nc
ncbo -O -4 -D 4 --cnk_scl=8 -p ~/nco/data in.nc in.nc ~/foo.nc
ncecat -O -4 -D 4 -n 12,2,1 --cnk_dmn lat,32 \
-p /data/zender/dstmch90 dstmch90_clm01.nc ~/foo.nc
ncflint -O -4 -D 4 --cnk_scl=8 ~/nco/data/in.nc ~/foo.nc
ncpdq -O -4 -D 4 -P all_new --cnk_scl=8 -L 5 ~/nco/data/in.nc ~/foo.nc
ncrcat -O -4 -D 4 -n 12,2,1 --cnk_dmn lat,32 \
-p /data/zender/dstmch90 dstmch90_clm01.nc ~/foo.nc
ncwa -O -4 -D 4 -a time --cnk_plc=g2d --cnk_map=rd1 --cnk_dmn lat,32 \
--cnk_dmn lon,128 dstmch90_clm_0112.nc ~/foo.nc
</pre></div>
<a name="index-record-dimension-2"></a>
<p>It is appropriate to conclude by informing users about an aspect of
chunking that may not be expected.
Three types of variables are <em>always</em> chunked: Record variables,
Deflated (compressed) variables, and Checksummed variables.
Hence all variables that contain a record dimension are also chunked
(since data must be chunked in all dimensions, not just one).
Unless otherwise specified by the user, the other (fixed, non-record)
dimensions of record variables are assigned default chunk sizes.
The <acronym>HDF5</acronym> layer does all this automatically to optimize the
on-disk variable/file storage geometry of record variables.
Do not be surprised to learn that files created without any explicit
instructions to activate chunking nevertheless contain chunked
variables.
</p>
<a name="dfl_lvl"></a> <!-- http://nco.sf.net/nco.html#dfl_lvl -->
<a name="dfl"></a> <!-- http://nco.sf.net/nco.html#dfl -->
<a name="lz"></a> <!-- http://nco.sf.net/nco.html#lz -->
<a name="lz77"></a> <!-- http://nco.sf.net/nco.html#lz77 -->
<a name="deflate"></a> <!-- http://nco.sf.net/nco.html#deflate -->
<a name="deflation"></a> <!-- http://nco.sf.net/nco.html#deflation --><hr>
<a name="Deflation"></a>
<div class="header">
<p>
Next: <a href="#MD5-digests" accesskey="n" rel="next">MD5 digests</a>, Previous: <a href="#Chunking" accesskey="p" rel="previous">Chunking</a>, Up: <a href="#Common-features" accesskey="u" rel="up">Common features</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#General-Index" title="Index" rel="index">Index</a>]</p>
</div>
<a name="Deflation-1"></a>
<h3 class="section">3.27 Deflation</h3>
<a name="index-_002dL"></a>
<a name="index-_002d_002ddeflate"></a>
<a name="index-_002d_002ddfl_005flvl"></a>
<a name="index-Lempel_002dZiv-deflation"></a>
<a name="index-compression"></a>
<a name="index-deflation-1"></a>
<table class="cartouche" border="1"><tr><td>
<p>Availability: <code>ncap2</code>, <code>ncbo</code>, <code>nces</code>,
<code>ncecat</code>, <code>ncflint</code>, <code>ncks</code>, <code>ncpdq</code>,
<code>ncra</code>, <code>ncrcat</code>, <code>ncwa</code><br>
Short options: ‘<samp>-L</samp>’<br>
Long options: ‘<samp>--dfl_lvl</samp>’, ‘<samp>--deflate</samp>’<br>
</p></td></tr></table>
<p>All <acronym>NCO</acronym> operators that define variables support
the netCDF4 feature of storing variables compressed with Lempel-Ziv
deflation.
The Lempel-Ziv algorithm is a lossless data compression technique.
Activate this deflation with the <code>-L <var>dfl_lvl</var></code> short option
(or with the same argument to the ‘<samp>--dfl_lvl</samp>’ or ‘<samp>--deflate</samp>’
long options).
Specify the deflation level <var>dfl_lvl</var> on a scale from
no deflation (<var>dfl_lvl = 0</var>) to maximum deflation
(<var>dfl_lvl = 9</var>).
Minimal deflation (<var>dfl_lvl = 1</var>) achieves considerable storage
compression with little time penalty.
Higher deflation levels require more time for compression.
File sizes resulting from minimal (<var>dfl_lvl = 1</var>) and maximal
(<var>dfl_lvl = 9</var>) deflation levels typically differ by a few
percent in size.
</p>
<p>To compress an entire file using deflation, use
</p><div class="example">
<pre class="example">ncks -4 -L 0 in.nc out.nc # No deflation (fast, no time penalty)
ncks -4 -L 1 in.nc out.nc # Minimal deflation (little time penalty)
ncks -4 -L 9 in.nc out.nc # Maximal deflation (much slower)
</pre></div>
<p>Unscientific testing shows that deflation compresses typical climate
datasets by 30-60%.
Packing, a lossy compression technique available for all netCDF files
(see <a href="#Packed-data">Packed data</a>), can easily compress files by 50%.
Packed data may be deflated to squeeze datasets by about 80%:
</p><div class="example">
<pre class="example">ncks -4 -L 1 in.nc out.nc # Minimal deflation (~30-60% compression)
ncks -4 -L 9 in.nc out.nc # Maximal deflation (~31-63% compression)
ncpdq in.nc out.nc # Standard packing (~50% compression)
ncpdq -4 -L 9 in.nc out.nc # Deflated packing (~80% compression)
</pre></div>
<a name="index-ncks-1"></a>
<p><code>ncks</code> prints deflation parameters, if any, to screen
(see <a href="#ncks-netCDF-Kitchen-Sink">ncks netCDF Kitchen Sink</a>).
</p>
<a name="md5"></a> <!-- http://nco.sf.net/nco.html#md5 -->
<a name="digest"></a> <!-- http://nco.sf.net/nco.html#digest -->
<a name="hash"></a> <!-- http://nco.sf.net/nco.html#hash -->
<a name="integrity"></a> <!-- http://nco.sf.net/nco.html#integrity -->
<a name="security"></a> <!-- http://nco.sf.net/nco.html#security --><hr>
<a name="MD5-digests"></a>
<div class="header">
<p>
Next: <a href="#Buffer-sizes" accesskey="n" rel="next">Buffer sizes</a>, Previous: <a href="#Deflation" accesskey="p" rel="previous">Deflation</a>, Up: <a href="#Common-features" accesskey="u" rel="up">Common features</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#General-Index" title="Index" rel="index">Index</a>]</p>
</div>
<a name="MD5-digests-1"></a>
<h3 class="section">3.28 MD5 digests</h3>
<a name="index-_002d_002dmd5_005fdigest"></a>
<a name="index-_002d_002dmd5_005fdgs"></a>
<a name="index-_002d_002dmd5_005fwrt_005fatt"></a>
<a name="index-_002d_002dmd5_005fwrite_005fattribute"></a>
<a name="index-integrity"></a>
<a name="index-security"></a>
<a name="index-digest"></a>
<a name="index-hash"></a>
<a name="index-MD5-digest"></a>
<table class="cartouche" border="1"><tr><td>
<p>Availability:
<code>ncecat</code>, <code>ncks</code>, <code>ncrcat</code><br>
Short options: <br>
Long options: ‘<samp>--md5_dgs</samp>’, ‘<samp>--md5_digest</samp>’, ‘<samp>--md5_wrt_att</samp>’, ‘<samp>--md5_write_attribute</samp>’<br>
</p></td></tr></table>
<p>As of <acronym>NCO</acronym> version 4.1.0 (April, 2012), <acronym>NCO</acronym>
supports data integrity verification using the <acronym>MD5</acronym> digest
algorithm.
This support is currently implemented in <code>ncks</code> and in the
multifile concantenators <code>ncecat</code> and <code>ncrcat</code>.
Activate it with the ‘<samp>--md5_dgs</samp>’ or ‘<samp>--md5_digest</samp>’ long
options.
As of <acronym>NCO</acronym> version 4.3.3 (July, 2013), <acronym>NCO</acronym>
will write the <acronym>MD5</acronym> digest of each variable as an
<code>NC_CHAR</code> attribute named <code>MD5</code>.
This support is currently implemented in <code>ncks</code> and in the
multifile concantenators <code>ncecat</code> and <code>ncrcat</code>.
Activate it with the ‘<samp>--md5_wrt_att</samp>’ or
‘<samp>--md5_write_attribute</samp>’ long options.
</p>
<p>The behavior and verbosity of the <acronym>MD5</acronym> digest is
operator-dependent.
When activating <acronym>MD5</acronym> digests with <code>ncks</code> it is assumed
that the user simply wishes to see the digest of every variable and this
is done when the debugging level exceeds one.
This incurs only the minor overhead of performing the hash algorithm for
each variable read.
<acronym>MD5</acronym> digests may be activated in both the one- and two-filename
argument forms of <code>ncks</code>, which are used for printing and for
sub-setting, respectively.
The <acronym>MD5</acronym> digests are shown as a 32-character hexadecimal string
in which each two characters represent one byte of the 16-byte digest:
</p><div class="example">
<pre class="example">> ncks -O -D 2 -C --md5 -v md5_a,md5_abc ~/nco/data/in.nc
...
ncks: INFO MD5(md5_a) = 0cc175b9c0f1b6a831c399e269772661
md5_a = 'a'
ncks: INFO MD5(md5_abc) = 900150983cd24fb0d6963f7d28e17f72
lev[0]=100 md5_abc[0--2]='abc'
> ncks -O -D 2 -C -d lev,0 --md5 -v md5_a,md5_abc ~/nco/data/in.nc
...
ncks: INFO MD5(md5_a) = 0cc175b9c0f1b6a831c399e269772661
md5_a = 'a'
ncks: INFO MD5(md5_abc) = 0cc175b9c0f1b6a831c399e269772661
lev[0]=100 md5_abc[0--0]='a'
</pre></div>
<p>In fact these examples demonstrate the validity of the hash algorithm
since the <acronym>MD5</acronym> hashes of the strings “a” and “abc” are
widely known.
The second example shows that the hyperslab of variable <code>md5_abc</code>
(= “abc”) consisting of only its first letter (= “a”) has the same
hash as the variable <code>md5_a</code> (“a”).
This illustrates that <acronym>MD5</acronym> digests act only on variable data,
not on metadata.
</p>
<p>When activating <acronym>MD5</acronym> digests with <code>ncecat</code> or
<code>ncrcat</code> it is assumed that the user wishes to verify
that every variable written to disk has the same <acronym>MD5</acronym> digest
as when it is subsequently read from disk.
This incurs the major additional overhead of reading in each variable
after it is written and performing the hash algorithm again on that to
compare to the original hash.
Moreover, it is assumed that such operations are generally done
“production mode” where the user is not interested in actually
examining the digests herself.
The digests proceed silently unless the debugging level exceeds three:
</p><div class="example">
<pre class="example">> ncecat -O -D 4 --md5 -p ~/nco/data in.nc in.nc ~/foo.nc | grep MD5
...
ncecat: INFO MD5(wnd_spd) = bec190dd944f2ce2794a7a4abf224b28
ncecat: INFO MD5 digests of RAM and disk contents for wnd_spd agree
> ncrcat -O -D 4 --md5 -p ~/nco/data in.nc in.nc ~/foo.nc | grep MD5
...
ncrcat: INFO MD5(wnd_spd) = 74699bb0a72b7f16456badb2c995f1a1
ncrcat: INFO MD5 digests of RAM and disk contents for wnd_spd agree
</pre></div>
<p>Regardless of the debugging level, an error is returned when the digests
of the variable read from the source file and from the output file
disagree.
</p>
<p>These rules are evolving and as <acronym>NCO</acronym> pays more attention to
data integrity.
We welcome feedback and suggestions from users.
</p>
<a name="bfr_sz_hnt"></a> <!-- http://nco.sf.net/nco.html#bfr_sz_hnt -->
<a name="bfr"></a> <!-- http://nco.sf.net/nco.html#bfr -->
<a name="buffer"></a> <!-- http://nco.sf.net/nco.html#buffer --><hr>
<a name="Buffer-sizes"></a>
<div class="header">
<p>
Next: <a href="#RAM-disks" accesskey="n" rel="next">RAM disks</a>, Previous: <a href="#MD5-digests" accesskey="p" rel="previous">MD5 digests</a>, Up: <a href="#Common-features" accesskey="u" rel="up">Common features</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#General-Index" title="Index" rel="index">Index</a>]</p>
</div>
<a name="Buffer-sizes-1"></a>
<h3 class="section">3.29 Buffer sizes</h3>
<a name="index-_002d_002dbfr_005fsz_005fhnt"></a>
<a name="index-Buffer-sizes"></a>
<a name="index-File-buffers"></a>
<a name="index-stat_0028_0029-system-call"></a>
<a name="index-I_002fO-block-size"></a>
<a name="index-System-calls"></a>
<table class="cartouche" border="1"><tr><td>
<p>Availability: All operators<br>
Short options: <br>
Long options: ‘<samp>--bfr_sz_hnt</samp>’, ‘<samp>--buffer_size_hint</samp>’<br>
</p></td></tr></table>
<p>As of <acronym>NCO</acronym> version 4.2.0 (May, 2012), <acronym>NCO</acronym>
allows the user to request specific buffer sizes to allocate for reading
and writing files.
This buffer size determines how many system calls the netCDF layer must
invoke to read and write files.
By default, netCDF uses the preferred I/O block size returned as the
‘<samp>st_blksize</samp>’ member of the ‘<samp>stat</samp>’ structure returned by the
<code>stat()</code> system call
<a name="DOCF34" href="#FOOT34"><sup>34</sup></a>.
Otherwise, netCDF uses twice the system pagesize.
Larger sizes can increase access speed by reducing the number of
system calls netCDF makes to read/write data from/to disk.
Because netCDF cannot guarantee the buffer size request will be met, the
actual buffer size granted by the system is printed as an INFO
statement.
</p><div class="example">
<pre class="example"># Request 2 MB file buffer instead of default 8 kB buffer
> ncks -O -D 3 --bfr_sz=2097152 ~/nco/data/in.nc ~/foo.nc
...
ncks: INFO nc__open() will request file buffer size = 2097152 bytes
ncks: INFO nc__open() opened file with buffer size = 2097152 bytes
...
</pre></div>
<a name="ram_all"></a> <!-- http://nco.sf.net/nco.html#ram_all -->
<a name="ram"></a> <!-- http://nco.sf.net/nco.html#ram -->
<a name="diskless"></a> <!-- http://nco.sf.net/nco.html#diskless --><hr>
<a name="RAM-disks"></a>
<div class="header">
<p>
Next: <a href="#Packed-data" accesskey="n" rel="next">Packed data</a>, Previous: <a href="#Buffer-sizes" accesskey="p" rel="previous">Buffer sizes</a>, Up: <a href="#Common-features" accesskey="u" rel="up">Common features</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#General-Index" title="Index" rel="index">Index</a>]</p>
</div>
<a name="RAM-disks-1"></a>
<h3 class="section">3.30 RAM disks</h3>
<a name="index-_002d_002dram_005fall-1"></a>
<a name="index-_002d_002dcreate_005fram-1"></a>
<a name="index-_002d_002dopen_005fram-2"></a>
<a name="index-_002d_002ddiskless_005fall-1"></a>
<a name="index-RAM-disks-1"></a>
<a name="index-RAM-files-1"></a>
<a name="index-NC_005fDISKLESS"></a>
<a name="index-diskless-files"></a>
<a name="index-memory-requirements-2"></a>
<a name="index-memory-available-1"></a>
<a name="index-RAM-1"></a>
<a name="index-swap-space-2"></a>
<a name="index-peak-memory-usage-1"></a>
<table class="cartouche" border="1"><tr><td>
<p>Availability: All operators<br>
Short options: <br>
Long options: ‘<samp>--ram_all</samp>’, ‘<samp>--create_ram</samp>’, ‘<samp>--open_ram</samp>’,
‘<samp>--diskless_all</samp>’<br>
</p></td></tr></table>
<p>As of <acronym>NCO</acronym> version 4.2.1 (August, 2012), <acronym>NCO</acronym> supports
the use of diskless files, aka <acronym>RAM</acronym> disks, for file access and creation.
Two independent switches, ‘<samp>--open_ram</samp>’ and ‘<samp>--create_ram</samp>’,
control this feature.
Before describing the specifics of these switches, we describe why many
<acronym>NCO</acronym> operations will not benefit from them.
Essentially, reading/writing from/to <acronym>RAM</acronym> rather than disk only hastens
the task when reads/writes to disk are avoided.
Most <acronym>NCO</acronym> operations are simple enough that they require a
single read-from/write-to disk for every block of input/output.
Diskless access does not change this, but it does add an extra
read-from/write-to RAM.
However this extra <acronym>RAM</acronym> write/read does avoid contention for limited
system resources like disk-head access.
Operators which may benefit from <acronym>RAM</acronym> disks include <code>ncwa</code>, which
may need to read weighting variables multiple times, the multi-file
operators <code>ncra</code>, <code>ncrcat</code>, and <code>ncecat</code>,
which may try to write output at least once per input file, and
<code>ncap2</code> scripts which may be arbitrarily long and convoluted.
</p>
<p>The ‘<samp>--open_ram</samp>’ switch causes input files to copied to <acronym>RAM</acronym> when
opened.
All further metadata and data access occurs in <acronym>RAM</acronym> and thus avoids
access time delays caused by disk-head movement.
Usually input data is read at most once so it is unlikely that
requesting input files be stored in <acronym>RAM</acronym> will save much time.
The likeliest exceptions are files that are accessed numerous times,
such as those analyzed extensively analyzed by <code>ncap2</code>.
</p>
<p>Invoking ‘<samp>--open_ram</samp>’, ‘<samp>--ram_all</samp>’, or ‘<samp>--diskless_all</samp>’
uses much more system memory.
To copy the input file to <acronym>RAM</acronym> increases the sustained
memory use by exactly the on-disk filesize of the input file, i.e.,
<em>MS += FT</em>.
For large input files this can be a huge memory burden that starves
the rest of the <acronym>NCO</acronym> analysis of sufficient <acronym>RAM</acronym>.
To be safe, use ‘<samp>--open_ram</samp>’, ‘<samp>--ram_all</samp>’, or
‘<samp>--diskless_all</samp>’ only on files that are much (say at least a factor
of four) smaller than your available system <acronym>RAM</acronym>.
See <a href="#Memory-Requirements">Memory Requirements</a> for further details.
</p>
<a name="index-RAM-variables"></a>
<p>The ‘<samp>--create_ram</samp>’ switch causes output files to be created in RAM,
rather than on disk.
These files are copied to disk only when closed, i.e., when the
operator completes.
Creating files in <acronym>RAM</acronym> may save time, especially with <code>ncap2</code>
computations that are iterative, e.g., loops, and for multi-file
operators that write output every record (timestep) or file.
RAM files provide many of the same benefits as <acronym>RAM</acronym> variables in such
cases (see <a href="#RAM-variables">RAM variables</a>).
</p>
<p>Two switches, ‘<samp>--ram_all</samp>’ and ‘<samp>--diskless_all</samp>’, are convenient
shortcuts for specifying both ‘<samp>--create_ram</samp>’ and
‘<samp>--diskless_ram</samp>’.
Thus
</p><div class="example">
<pre class="example">ncks in.nc out.nc # Default: Open in.nc on disk, write out.nc to disk
ncks --open_ram in.nc out.nc # Open in.nc in RAM, write out.nc to disk
ncks --create_ram in.nc out.nc # Create out.nc in RAM, write to disk
# Open in.nc in RAM, create out.nc in RAM, then write out.nc to disk
ncks --open_ram --create_ram in.nc out.nc
ncks --ram_all in.nc out.nc # Same as above
ncks --diskless_all in.nc out.nc # Same as above
</pre></div>
<p>It is straightforward to demonstrate the efficacy of <acronym>RAM</acronym> disks.
For <acronym>NASA</acronym> we constructed a test that employs <code>ncecat</code>
an arbitrary number (set to one hundred thousand) of files are all
symbolically linked to the same file.
Everything is on the local filesystem (not <acronym>DAP</acronym>).
</p><div class="example">
<pre class="example"># Create symbolic links for benchmark
cd ${DATA}/nco # Do all work here
for idx in {1..99999}; do
idx_fmt=`printf "%05d" ${idx}`
/bin/ln -s ${DATA}/nco/LPRM-AMSR_E_L3_D_SOILM3_V002-20120512T111931Z_20020619.nc \
${DATA}/nco/${idx_fmt}.nc
done
# Benchmark time to ncecat one hundred thousand files
time ncecat --create_ram -O -u time -v ts -d Latitude,40.0 \
-d Longitude,-105.0 -p ${DATA}/nco -n 99999,5,1 00001.nc ~/foo.nc
</pre></div>
<p>Run normally on a laptop in 201303, this completes in 21 seconds<!-- /@w -->.
The ‘<samp>--create_ram</samp>’ reduces the elapsed time to 9 seconds<!-- /@w -->.
Some of this speed may be due to using symlinks and caching.
However, the efficacy of ‘<samp>--create_ram</samp>’ is clear.
Placing the output file in <acronym>RAM</acronym> avoids thousands of disk writes.
It is not unreasonable to for <acronym>NCO</acronym> to process a million files
like this in a few minutes.
However, there is no substitute for benchmarking with real files.
</p>
<a name="index-temporary-output-files-1"></a>
<a name="index-temporary-files-1"></a>
<a name="index-_002d_002dno_005ftmp_005ffl-1"></a>
<p>A completely independent way to reduce time spent writing files is
to refrain from writing temporary output files.
This is accomplished with the ‘<samp>--no_tmp_fl</samp>’ switch
(see <a href="#Temporary-Output-Files">Temporary Output Files</a>).
</p>
<a name="pck"></a> <!-- http://nco.sf.net/nco.html#pck -->
<a name="pack"></a> <!-- http://nco.sf.net/nco.html#pack --><hr>
<a name="Packed-data"></a>
<div class="header">
<p>
Next: <a href="#Operation-Types" accesskey="n" rel="next">Operation Types</a>, Previous: <a href="#RAM-disks" accesskey="p" rel="previous">RAM disks</a>, Up: <a href="#Common-features" accesskey="u" rel="up">Common features</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#General-Index" title="Index" rel="index">Index</a>]</p>
</div>
<a name="Packed-data-1"></a>
<h3 class="section">3.31 Packed data</h3>
<a name="index-packing-2"></a>
<a name="index-unpacking-1"></a>
<a name="index-add_005foffset-1"></a>
<a name="index-scale_005ffactor"></a>
<a name="index-missing_005fvalue-1"></a>
<a name="index-_005fFillValue-1"></a>
<a name="index-pack_0028x_0029"></a>
<a name="index-unpack_0028x_0029"></a>
<a name="index-_002d_002dhdf_005fupk"></a>
<a name="index-_002d_002dhdf_005funpack"></a>
<table class="cartouche" border="1"><tr><td>
<p>Availability: <code>ncap2</code>, <code>ncbo</code>, <code>nces</code>,
<code>ncflint</code>, <code>ncpdq</code>, <code>ncra</code>, <code>ncwa</code><br>
Short options: None<br>
Long options: ‘<samp>--hdf_upk</samp>’, ‘<samp>--hdf_unpack</samp>’<br>
</p></td></tr></table>
<p>The phrase <em>packed data</em> refers to data which are stored in the
standard netCDF3 packing format which employs a lossy algorithm.
See <a href="#ncks-netCDF-Kitchen-Sink">ncks netCDF Kitchen Sink</a> for a description of deflation, a
lossless compression technique available with netCDF4 only.
Packed data may be deflated to save additional space.
</p>
<a name="Packing-Algorithm"></a>
<h4 class="unnumberedsubsec">Packing Algorithm</h4>
<p><em>Packing</em>
The standard netCDF packing algorithm (described
<a href="http://www.unidata.ucar.edu/software/netcdf/docs/netcdf/Attribute-Conventions.html">here</a>)
produces data with
the same dynamic range as the original but which requires no more than
half the space to store.
Like all packing algorithms, it is <em>lossy</em>.
The packed variable is stored (usually) as type <code>NC_SHORT</code>
with the two attributes required to unpack the variable,
<code>scale_factor</code> and <code>add_offset</code>, stored at the original
(unpacked) precision of the variable
<a name="DOCF35" href="#FOOT35"><sup>35</sup></a>.
Let <var>min</var> and <var>max</var> be the minimum and maximum values
of <var>x</var>.<!-- /@w -->
</p><br>
<p><var>scale_factor</var> = (<var>max</var>-<var>min</var>)/<var>ndrv</var><br>
<var>add_offset</var> = 0.5*(<var>min</var>+<var>max</var>)<br>
<var>pck</var> = (<var>upk</var>-<var>add_offset</var>)/<var>scale_factor</var> = (<var>upk</var>-0.5*(<var>min</var>+<var>max</var>))*<var>ndrv</var>/(<var>max</var>-<var>min</var>)<br>
</p><br>
<p>where <var>ndrv</var> is the number of discrete representable values for
given type of packed variable.
The theoretical maximum value for <var>ndrv</var> is two raised to the
number of bits used to store the packed variable.
Thus if the variable is packed into type <code>NC_SHORT</code>, a two-byte
datatype, then there are at most <em>2^{16} = 65536</em> distinct values
representable.
In practice, the number of discretely representible values is taken
to be two less than the theoretical maximum.
This leaves space for a missing value and solves potential problems with
rounding that may occur during the unpacking of the variable.
Thus for <code>NC_SHORT</code>, <em>ndrv = 65536 - 2 = 65534</em>.
Less often, the variable may be packed into type <code>NC_CHAR</code>,
where <em>ndrv = 2^{8} - 2 = 256 - 2 = 254</em>, or type <code>NC_INT</code> where
where <em>ndrv = 2^{32} - 2 = 4294967295 - 2 = 4294967293</em>.
One useful feature of (lossy) netCDF packing algorithm is that
additional, loss-less packing algorithms perform well on top of it.
</p>
<a name="upk"></a> <!-- http://nco.sf.net/nco.html#upk -->
<a name="unpack"></a> <!-- http://nco.sf.net/nco.html#unpack --><a name="Unpacking-Algorithm"></a>
<h4 class="unnumberedsubsec">Unpacking Algorithm</h4>
<p><em>Unpacking</em>
The unpacking algorithm depends on the presence of two attributes,
<code>scale_factor</code> and <code>add_offset</code>.
If <code>scale_factor</code> is present for a variable, the data are
multiplied by the value <var>scale_factor</var> after the data are read.
If <code>add_offset</code> is present for a variable, then the
<var>add_offset</var> value is added to the data after the data are read.
If both <code>scale_factor</code> and <code>add_offset</code> attributes are
present, the data are first scaled by <var>scale_factor</var> before the
offset <var>add_offset</var> is added.
</p><br>
<p><var>upk</var> = <var>scale_factor</var>*<var>pck</var> + <var>add_offset</var> = (<var>max</var>-<var>min</var>)*<var>pck</var>/<var>ndrv</var> + 0.5*(<var>min</var>+<var>max</var>)<br>
</p><br>
<p>When <code>scale_factor</code> and <code>add_offset</code> are used for packing, the
associated variable (containing the packed data) is typically of type
<code>byte</code> or <code>short</code>, whereas the unpacked values are intended to
be of type <code>int</code>, <code>float</code>, or <code>double</code>.
An attribute’s <code>scale_factor</code> and <code>add_offset</code> and
<code>_FillValue</code>, if any, should all be of the type intended for the
unpacked data, i.e., <code>int</code>, <code>float</code> or <code>double</code>.
</p>
<a name="Default-Handling-of-Packed-Data"></a>
<h4 class="unnumberedsubsec">Default Handling of Packed Data</h4>
<a name="hdf_upk"></a> <!-- http://nco.sf.net/nco.html#hdf_upk -->
<a name="hdf_unpack"></a> <!-- http://nco.sf.net/nco.html#hdf_unpack --><a name="index-interoperability"></a>
<a name="index-HDF-unpacking"></a>
<p>Most files originally written in <acronym>HDF</acronym> format use the
<acronym>HDF</acronym> packing/unpacking algorithm.
This algorithm is incompatible with the netCDF packing algorithm
described above.
The unpacking component of the <acronym>HDF</acronym> algorithm (described
<a href="http://www.hdfgroup.org/HDF5/doc/UG/UG_frame10Datasets.html">here</a>) is
</p><br>
<p><var>upk</var> = <var>scale_factor</var>*(<var>pck</var> - <var>add_offset</var>)<br>
</p><br>
<p>Confusingly, the (incompatible) netCDF and <acronym>HDF</acronym> algorithms both
store their parameters in attributes with the same names
(<code>scale_factor</code> and <code>add_offset</code>).
Data packed with one algorithm should never be unpacked with the other;
doing so will result in incorrect answers.
Unfortunately, few users are aware that their datasets may be packed,
and fewer know the details of the packing algorithm employed.
This is what we in the “bizness” call an <em>interoperability</em> issue
because it hampers data analysis performed on heterogeneous systems.
</p>
<p>As described below, <acronym>NCO</acronym> automatically unpacks data before
performing arithmetic.
This automatic unpacking occurs silently since there is usually no
reason to bother users with these details.
There is as yet no generic way for <acronym>NCO</acronym> to know which
packing convention was used, so <acronym>NCO</acronym> <em>assumes</em> the netCDF
convention was used.
<acronym>NCO</acronym> uses the same convention for unpacking unless explicitly
told otherwise with the ‘<samp>--hdf_upk</samp>’ (also ‘<samp>--hdf_unpack</samp>’)
switch.
Until and unless a method of automatically detecting the packing method
is devised, it must remain the user’s responsibility to tell
<acronym>NCO</acronym> when to use the <acronym>HDF</acronym> convention instead of the
netCDF convention to unpack.
</p>
<p>If your data originally came from an <acronym>HDF</acronym> file (e.g.,
<acronym>NASA</acronym> <acronym>EOS</acronym>) then it was likely packed with the
<acronym>HDF</acronym> convention and must be unpacked with the same convention.
Our recommendation is to only request <acronym>HDF</acronym> unpacking when you
are certain.
Most packed datasets encountered by <acronym>NCO</acronym> will have used the
netCDF convention.
Those that were not will hopefully produce noticeably weird values when
unpacked by the wrong algorithm.
Before or after panicking, treat this as a clue to re-try your commands
with the ‘<samp>--hdf_upk</samp>’ switch.
See <a href="#ncpdq-netCDF-Permute-Dimensions-Quickly">ncpdq netCDF Permute Dimensions Quickly</a> for an easy technique
to unpack data packed with the <acronym>HDF</acronym> convention, and then
re-pack it with the netCDF convention.
</p>
<a name="Default-Handling-of-Packed-Data-1"></a>
<h4 class="unnumberedsubsec">Default Handling of Packed Data</h4>
<p>All <acronym>NCO</acronym> arithmetic operators understand packed data.
The operators automatically unpack any packed variable in the input
file which will be arithmetically processed.
For example, <code>ncra</code> unpacks all record variables,
and <code>ncwa</code> unpacks all variable which contain a dimension to
be averaged.
These variables are stored unpacked in the output file.
</p>
<p>On the other hand, arithmetic operators do not unpack non-processed
variables.
For example, <code>ncra</code> leaves all non-record variables packed,
and <code>ncwa</code> leaves packed all variables lacking an averaged
dimension.
These variables (called fixed variables) are passed unaltered from the
input to the output file.
Hence fixed variables which are packed in input files remain packed in
output files.
Completely packing and unpacking files is easily accomplished with
<code>ncpdq</code> (see <a href="#ncpdq-netCDF-Permute-Dimensions-Quickly">ncpdq netCDF Permute Dimensions Quickly</a>).
Pack and unpack individual variables with <code>ncpdq</code> and the
<code>ncap2</code> <code>pack()</code> and <code>unpack()</code> functions
(see <a href="#Methods-and-functions">Methods and functions</a>).
</p>
<a name="op_typ"></a> <!-- http://nco.sf.net/nco.html#op_typ --><hr>
<a name="Operation-Types"></a>
<div class="header">
<p>
Next: <a href="#Type-Conversion" accesskey="n" rel="next">Type Conversion</a>, Previous: <a href="#Packed-data" accesskey="p" rel="previous">Packed data</a>, Up: <a href="#Common-features" accesskey="u" rel="up">Common features</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#General-Index" title="Index" rel="index">Index</a>]</p>
</div>
<a name="Operation-Types-1"></a>
<h3 class="section">3.32 Operation Types</h3>
<a name="index-operation-types"></a>
<a name="index-avg"></a>
<a name="index-sqravg"></a>
<a name="index-avgsqr"></a>
<a name="index-min"></a>
<a name="index-max"></a>
<a name="index-rmssdn"></a>
<a name="index-rms"></a>
<a name="index-ttl"></a>
<a name="index-sqrt"></a>
<a name="index-average"></a>
<a name="index-mean"></a>
<a name="index-total"></a>
<a name="index-minimum"></a>
<a name="index-maximum"></a>
<a name="index-root_002dmean_002dsquare"></a>
<a name="index-standard-deviation"></a>
<a name="index-variance"></a>
<a name="index-_002dy-op_005ftyp"></a>
<a name="index-_002d_002doperation-op_005ftyp"></a>
<a name="index-_002d_002dop_005ftyp-op_005ftyp"></a>
<table class="cartouche" border="1"><tr><td>
<p>Availability: <code>ncap2</code>, <code>ncra</code>, <code>nces</code>, <code>ncwa</code><br>
Short options: ‘<samp>-y</samp>’<br>
Long options: ‘<samp>--operation</samp>’, ‘<samp>--op_typ</samp>’<br>
</p></td></tr></table>
<p>The ‘<samp>-y <var>op_typ</var></samp>’ switch allows specification of many different
types of operations
Set <var>op_typ</var> to the abbreviated key for the corresponding operation:
</p><dl compact="compact">
<dt><code>avg</code></dt>
<dd><p>Mean value
</p></dd>
<dt><code>sqravg</code></dt>
<dd><p>Square of the mean
</p></dd>
<dt><code>avgsqr</code></dt>
<dd><p>Mean of sum of squares
</p></dd>
<dt><code>max</code></dt>
<dd><p>Maximium value
</p></dd>
<dt><code>min</code></dt>
<dd><p>Minimium value
</p></dd>
<dt><code>rms</code></dt>
<dd><p>Root-mean-square (normalized by <var>N</var>)
</p></dd>
<dt><code>rmssdn</code></dt>
<dd><p>Root-mean square (normalized by <var>N-1</var>)
</p></dd>
<dt><code>sqrt</code></dt>
<dd><p>Square root of the mean
</p></dd>
<dt><code>ttl</code></dt>
<dd><p>Sum of values
</p></dd>
</dl>
<a name="index-coordinate-variable-1"></a>
<p><acronym>NCO</acronym> assumes coordinate variables represent grid axes, e.g.,
longitude.
The only rank-reduction which makes sense for coordinate variables
is averaging.
Hence <acronym>NCO</acronym> implements the operation type requested with
‘<samp>-y</samp>’ on all non-coordinate variables, not on coordinate variables.
When an operation requires a coordinate variable to be reduced in
rank, i.e., from one dimension to a scalar or from one dimension to
a degenerate (single value) array, then <acronym>NCO</acronym>
<em>always averages</em> the coordinate variable regardless of the
arithmetic operation type performed on the non-coordinate variables.
</p>
<p>The mathematical definition of each arithmetic operation is given below.
See <a href="#ncwa-netCDF-Weighted-Averager">ncwa netCDF Weighted Averager</a>, for additional information on
masks and normalization.
If an operation type is not specified with ‘<samp>-y</samp>’ then the operator
performs an arithmetic average by default.
Averaging is described first so the terminology for the other operations
is familiar.
</p>
<table class="cartouche" border="1"><tr><td>
<p><b>Note for HTML users</b>:
<br>The definition of mathematical operations involving rank reduction
(e.g., averaging) relies heavily on mathematical expressions which
cannot easily be represented in HTML.
<b>See the <a href="./nco.pdf">printed manual</a> for much more detailed
and complete documentation of this subject.</b></td></tr></table>
<p>The definitions of some of these operations are not universally useful.
Mostly they were chosen to facilitate standard statistical
computations within the <acronym>NCO</acronym> framework.
We are open to redefining and or adding to the above.
If you are interested in having other statistical quantities
defined in <acronym>NCO</acronym> please contact the <acronym>NCO</acronym> project
(see <a href="#Help-Requests-and-Bug-Reports">Help Requests and Bug Reports</a>).
</p>
<p>EXAMPLES
</p>
<a name="min"></a> <!-- http://nco.sf.net/nco.html#min -->
<a name="max"></a> <!-- http://nco.sf.net/nco.html#max -->
<a name="rms"></a> <!-- http://nco.sf.net/nco.html#rms --><p>Suppose you wish to examine the variable <code>prs_sfc(time,lat,lon)</code>
which contains a time series of the surface pressure as a function of
latitude and longitude.
Find the minimium value of <code>prs_sfc</code> over all dimensions:
</p><div class="example">
<pre class="example">ncwa -y min -v prs_sfc in.nc foo.nc
</pre></div>
<p>Find the maximum value of <code>prs_sfc</code> at each time interval for each
latitude:
</p><div class="example">
<pre class="example">ncwa -y max -v prs_sfc -a lon in.nc foo.nc
</pre></div>
<p>Find the root-mean-square value of the time-series of <code>prs_sfc</code> at
every gridpoint:
</p><div class="example">
<pre class="example">ncra -y rms -v prs_sfc in.nc foo.nc
ncwa -y rms -v prs_sfc -a time in.nc foo.nc
</pre></div>
<p>The previous two commands give the same answer but <code>ncra</code> is
preferred because it has a smaller memory footprint.
<a name="index-degenerate-dimension-1"></a>
A dimension of size one is said to be <em>degenerate</em>.
By default, <code>ncra</code> leaves the (degenerate) <code>time</code>
dimension in the output file (which is usually useful) whereas
<code>ncwa</code> removes the <code>time</code> dimension (unless ‘<samp>-b</samp>’ is
given).
</p>
<p>These operations work as expected in multi-file operators.
Suppose that <code>prs_sfc</code> is stored in multiple timesteps per file
across multiple files, say <samp>jan.nc</samp>, <samp>feb.nc</samp>,
<samp>march.nc</samp>.
We can now find the three month maximium surface pressure at every point.
</p><div class="example">
<pre class="example">nces -y max -v prs_sfc jan.nc feb.nc march.nc out.nc
</pre></div>
<a name="standard_deviation"></a> <!-- http://nco.sf.net/nco.html#standard_deviation -->
<a name="stddvn"></a> <!-- http://nco.sf.net/nco.html#stddvn -->
<a name="sdn"></a> <!-- http://nco.sf.net/nco.html#sdn -->
<a name="sdv"></a> <!-- http://nco.sf.net/nco.html#sdv -->
<a name="xmp_sdn"></a> <!-- http://nco.sf.net/nco.html#xmp_sdn --><a name="index-standard-deviation-1"></a>
<p>It is possible to use a combination of these operations to compute
the variance and standard deviation of a field stored in a single file
or across multiple files.
The procedure to compute the temporal standard deviation of the surface
pressure at all points in a single file <samp>in.nc</samp> involves three
steps.
</p><div class="example">
<pre class="example">ncwa -O -v prs_sfc -a time in.nc out.nc
ncbo -O -v prs_sfc in.nc out.nc out.nc
ncra -O -y rmssdn out.nc out.nc
</pre></div>
<p>First construct the temporal mean of <code>prs_sfc</code> in the file
<samp>out.nc</samp>.
Next overwrite <samp>out.nc</samp> with the anomaly (deviation from the mean).
Finally overwrite <samp>out.nc</samp> with the root-mean-square of itself.
Note the use of ‘<samp>-y rmssdn</samp>’ (rather than ‘<samp>-y rms</samp>’) in the
final step.
This ensures the standard deviation is correctly normalized by one fewer
than the number of time samples.
The procedure to compute the variance is identical except for the use of
‘<samp>-y var</samp>’ instead of ‘<samp>-y rmssdn</samp>’ in the final step.
</p>
<p><code>ncap2</code> can also compute statistics like standard deviations.
Brute-force implementation of formulae is one option, e.g.,
</p><div class="example">
<pre class="example">ncap2 -s 'prs_sfc_sdn=sqrt((prs_sfc-prs_sfc.avg($time)^2).total($time)/($time.size-1))'
in.nc out.nc
</pre></div>
<p>The operation may, of course, be broken into multiple steps in order
to archive intermediate quantities, such as the time-anomalies
</p><div class="example">
<pre class="example">ncap2 -s 'prs_sfc_anm=prs_sfc-prs_sfc.avg($time)' \
-s 'prs_sfc_sdn=sqrt((prs_sfc_anm^2).total($time)/($time.size-1))' \
in.nc out.nc
</pre></div>
<p><code>ncap2</code> supports intrinsic standard deviation functions
(see <a href="#Operation-Types">Operation Types</a>) which simplify the above expression to
</p><div class="example">
<pre class="example">ncap2 -s 'prs_sfc_sdn=(prs_sfc-prs_sfc.avg($time)).rmssdn($time)' in.nc out.nc
</pre></div>
<p>These instrinsic functions compute the answer quickly and concisely.
</p>
<p>The procedure to compute the spatial standard deviation of a field
in a single file <samp>in.nc</samp> involves three steps.
</p><div class="example">
<pre class="example">ncwa -O -v prs_sfc,gw -a lat,lon -w gw in.nc out.nc
ncbo -O -v prs_sfc,gw in.nc out.nc out.nc
ncwa -O -y rmssdn -v prs_sfc -a lat,lon -w gw out.nc out.nc
</pre></div>
<p>First the appropriately weighted (with ‘<samp>-w gw</samp>’) spatial mean values
are written to the output file.
This example includes the use of a weighted variable specified with
‘<samp>-w gw</samp>’.
When using weights to compute standard deviations one must remember to
include the weights in the initial output files so that they may be used
again in the final step.
The initial output file is then overwritten with the gridpoint
deviations from the spatial mean.
Finally the root-mean-square of the appropriately weighted spatial
deviations is taken.
</p>
<p>The <code>ncap2</code> solution to the spatially-weighted standard
deviation problem is
</p><div class="example">
<pre class="example">ncap2 -s 'prs_sfc_sdn=(prs_sfc*gw-prs_sfc*gw.avg($lat,$lon)).rmssdn($lat,$lon)' \
in.nc out.nc
</pre></div>
<p>Be sure to multiply the variable by the weight prior to computing the
the anomalies and the standard deviation.
</p>
<p>The procedure to compute the standard deviation of a time-series across
multiple files involves one extra step since all the input must first be
collected into one file.
</p><div class="example">
<pre class="example">ncrcat -O -v tpt in.nc in.nc foo1.nc
ncwa -O -a time foo1.nc foo2.nc
ncbo -O -v tpt foo1.nc foo2.nc foo3.nc
ncra -O -y rmssdn foo3.nc out.nc
</pre></div>
<p>The first step assembles all the data into a single file.
Though this may consume a lot of temporary disk space, it is more or
less required by the <code>ncbo</code> operation in the third step.
</p>
<a name="typ_cnv"></a> <!-- http://nco.sf.net/nco.html#typ_cnv --><hr>
<a name="Type-Conversion"></a>
<div class="header">
<p>
Next: <a href="#Batch-Mode" accesskey="n" rel="next">Batch Mode</a>, Previous: <a href="#Operation-Types" accesskey="p" rel="previous">Operation Types</a>, Up: <a href="#Common-features" accesskey="u" rel="up">Common features</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#General-Index" title="Index" rel="index">Index</a>]</p>
</div>
<a name="Type-Conversion-1"></a>
<h3 class="section">3.33 Type Conversion</h3>
<a name="index-type-conversion"></a>
<table class="cartouche" border="1"><tr><td>
<p>Availability (automatic type conversion): <code>ncap2</code>, <code>ncbo</code>, <code>nces</code>,
<code>ncflint</code>, <code>ncra</code>, <code>ncwa</code><br>
Short options: None (it’s <em>automatic</em>)<br>
Availability (manual type conversion): <code>nces</code>, <code>ncra</code>, <code>ncwa</code><br>
Short options: None<br>
Long options: ‘<samp>--dbl</samp>’, ‘<samp>--flt</samp>’, ‘<samp>--rth_dbl</samp>’, ‘<samp>--rth_flt</samp>’<br>
</p></td></tr></table>
<a name="index-promotion"></a>
<a name="index-demotion"></a>
<a name="index-automatic-type-conversion"></a>
<a name="index-manual-type-conversion"></a>
<p>Type conversion refers to the casting or coercion of one fundamental or
atomic data type to another, e.g., converting <code>NC_SHORT</code> (two
bytes) to <code>NC_DOUBLE</code> (eight bytes).
Type conversion always <em>promotes</em> or <em>demotes</em> the range and/or
precision of the values a variable can hold.
Type conversion is automatic when the language carries out this
promotion according to an internal set of rules without explicit user
intervention.
In contrast, manual type conversion refers to explicit user commands to
change the type of a variable or attribute.
Most type conversion happens automatically, yet there are situations in
which manual type conversion is advantageous.
</p>
<table class="menu" border="0" cellspacing="0">
<tr><td align="left" valign="top">• <a href="#Automatic-type-conversion" accesskey="1">Automatic type conversion</a>:</td><td> </td><td align="left" valign="top">
</td></tr>
<tr><td align="left" valign="top">• <a href="#Promoting-Single_002dprecision-to-Double" accesskey="2">Promoting Single-precision to Double</a>:</td><td> </td><td align="left" valign="top">
</td></tr>
<tr><td align="left" valign="top">• <a href="#Manual-type-conversion" accesskey="3">Manual type conversion</a>:</td><td> </td><td align="left" valign="top">
</td></tr>
</table>
<hr>
<a name="Automatic-type-conversion"></a>
<div class="header">
<p>
Next: <a href="#Promoting-Single_002dprecision-to-Double" accesskey="n" rel="next">Promoting Single-precision to Double</a>, Previous: <a href="#Type-Conversion" accesskey="p" rel="previous">Type Conversion</a>, Up: <a href="#Type-Conversion" accesskey="u" rel="up">Type Conversion</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#General-Index" title="Index" rel="index">Index</a>]</p>
</div>
<a name="Automatic-type-conversion-1"></a>
<h4 class="subsection">3.33.1 Automatic type conversion</h4>
<p>There are at least two reasons to avoid type conversions.
First, type conversions are expensive since they require creating
(temporary) buffers and casting each element of a variable from its
storage type to some other type and then, often, converting it back.
Second, a dataset’s creator perhaps had a good reason for storing
data as, say, <code>NC_FLOAT</code> rather than <code>NC_DOUBLE</code>.
In a scientific framework there is no reason to store data with more
precision than the observations merit.
Normally this is single-precision, which guarantees 6–9 digits of
precision.
Reasons to engage in type conversion include avoiding rounding
errors and out-of-range limitations of less-precise types.
This is the case with most integers.
Thus <acronym>NCO</acronym> defaults to automatically promote integer types to
floating point when performing lengthy arithmetic, yet <acronym>NCO</acronym>
defaults to not promoting single to double-precision floats.
</p>
<p>Before discussing the more subtle floating point issues, we first
examine integer promotion.
We will show how following parsimonious conversion rules dogmatically
can cause problems, and what <acronym>NCO</acronym> does about that.
That said, there are situations in which implicit conversion of
single- to double-precision is also warranted.
Understanding the narrowness of these situations takes time, and we
hope the reader appreciates the following detailed discussion.
</p>
<p>Consider the average of the two <code>NC_SHORT</code>s <code>17000s</code> and
<code>17000s</code>.
A straightforward average without promotion results in garbage since the
intermediate value which holds their sum is also of type <code>NC_SHORT</code>
and thus overflows on (i.e., cannot represent) values greater than
32,767
<a name="DOCF36" href="#FOOT36"><sup>36</sup></a>.
There are valid reasons for expecting this operation to succeed and
the <acronym>NCO</acronym> philosophy is to make operators do what you want, not
what is purest.
Thus, unlike C and Fortran, but like many other higher level interpreted
languages, <acronym>NCO</acronym> arithmetic operators will perform automatic type
conversion on integers when all the following conditions are met
<a name="DOCF37" href="#FOOT37"><sup>37</sup></a>:
</p><ol>
<li> The requested operation is arithmetic.
This is why type conversion is limited to the operators <code>ncap2</code>,
<code>ncbo</code>, <code>nces</code>, <code>ncflint</code>, <code>ncra</code>, and
<code>ncwa</code>.
</li><li> The arithmetic operation could benefit from type conversion.
Operations that could benefit include averaging, summation, or any
"hard" arithmetic that could overflow or underflow.
Larger representable sums help avoid overflow, and more precision
helps to avoid underflow.
Type conversion does not benefit searching for minima and maxima
(‘<samp>-y min</samp>’, or ‘<samp>-y max</samp>’).
</li><li> The variable on disk is of type <code>NC_BYTE</code>, <code>NC_CHAR</code>,
<code>NC_SHORT</code>, or <code>NC_INT</code>.
Type <code>NC_DOUBLE</code> is not promoted because there is no type of
higher precision.
Conversion of type <code>NC_FLOAT</code> is discussed in detail below.
When it occurs, it follows the same procedure (promotion then
arithmetic then demotion) as conversion of integer types.
</li></ol>
<p>When these criteria are all met, the operator promotes the variable in
question to type <code>NC_DOUBLE</code>, performs all the arithmetic
operations, casts the <code>NC_DOUBLE</code> type back to the original type,
and finally writes the result to disk.
The result written to disk may not be what you expect, because of
incommensurate ranges represented by different types, and because of
(lack of) rounding.
First, continuing the above example, the average (e.g., ‘<samp>-y avg</samp>’)
of <code>17000s</code> and <code>17000s</code> is written to disk as <code>17000s</code>.
The type conversion feature of <acronym>NCO</acronym> makes this possible since
the arithmetic and intermediate values are stored as <code>NC_DOUBLE</code>s,
i.e., <code>34000.0d</code> and only the final result must be represented
as an <code>NC_SHORT</code>.
Without the type conversion feature of <acronym>NCO</acronym>, the average would
have been garbage (albeit predictable garbage near <code>-15768s</code>).
Similarly, the total (e.g., ‘<samp>-y ttl</samp>’) of <code>17000s</code> and
<code>17000s</code> written to disk is garbage (actually <code>-31536s</code>) since
the final result (the true total) of <em>34000</em> is outside the range
of type <code>NC_SHORT</code>.
</p>
<a name="index-trunc_0028_0029"></a>
<p>After arithmetic is computed in double-precision for promoted variables,
the intermediate double-precision values must be demoted to the
variables’ original storage type (e.g., from <code>NC_DOUBLE</code> to
<code>NC_SHORT</code>).
<acronym>NCO</acronym> has handled this demotion in three ways in its history.
Prior to October, 2011 (version 4.0.8), <acronym>NCO</acronym> employed the
C library<!-- /@w --> truncate function, <code>trunc()</code>
<a name="DOCF38" href="#FOOT38"><sup>38</sup></a>.
Truncation rounds <var>x</var> to the nearest integer not larger in absolute
value.
For example, truncation rounds <code>1.0d</code>, <code>1.5d</code>, and
<code>1.8d</code> to the same value, <code>1s</code>.
Clearly, truncation does not round floating point numbers to the nearest
integer!
Yet truncation is how the C language<!-- /@w --> performs implicit conversion of
real numbers to integers.
</p>
<a name="index-Neil-Davis"></a>
<p><acronym>NCO</acronym> stopped using truncation for demotion when an alert user
(Neil Davis) informed us that this caused a small bias in the packing
algorithm employed by <code>ncpdq</code>.
This led to <acronym>NCO</acronym> adopting rounding functions for demotion.
Rounding functions eliminated the small bias in the packing algorithm.
</p>
<a name="index-lround_0028_0029_002e"></a>
<p>From February, 2012 through March, 2013 (versions 4.0.9–4.2.6),
<acronym>NCO</acronym> employed the C library<!-- /@w --> family of rounding functions,
<code>lround()</code>.
These functions round <var>x</var> to the nearest integer, halfway cases away
from zero.
The problem with <code>lround()</code> is that it always rounds real values
ending in <code>.5</code> away from zero.
This rounds, for example, <code>1.5d</code> and <code>2.5d</code> to <code>1s</code>
and <code>2s</code>, respectively.
</p>
<a name="index-lrint_0028_0029_002e"></a>
<a name="index-IEEE"></a>
<p>Since April, 2013 (version 4.3.0), <acronym>NCO</acronym> has employed the
other C library<!-- /@w --> family of rounding functions, <code>lrint()</code>.
This algorithm rounds <var>x</var> to the nearest integer, using the current
rounding direction.
Halfway cases are rounded to the nearest even integer.
This rounds, for example, both <code>1.5d</code> and <code>2.5d</code> to the same
value, <code>2s</code>, as recommended by the <acronym>IEEE</acronym>.
This rounding is symmetric: up half the time, down half the time.
This is the current and hopefully final demotion algorithm employed by
<acronym>NCO</acronym>.
</p>
<p>Hence because of automatic conversion, <acronym>NCO</acronym> will compute the
average of <code>2s</code> and <code>3s</code> in double-precision arithmetic as
<em>(<code>2.0d</code> + <code>3.0d</code>)/<code>2.0d</code>) = <code>2.5d</code></em>.
It then demotes this intermediate result back to <code>NC_SHORT</code> and
stores it on disk as
<em><code>trunc(2.5d)</code> = <code>2s</code></em> (versions up to 4.0.8),
<em><code>lround(2.5d)</code> = <code>3s</code></em> (versions 4.0.9–4.2.6), and
<em><code>lrint(2.5d)</code> = <code>2s</code></em> (versions 4.3.0 and later).
</p>
<a name="sp_dp"></a> <!-- http://nco.sf.net/nco.html#sp_dp -->
<a name="dbl"></a> <!-- http://nco.sf.net/nco.html#dbl --><hr>
<a name="Promoting-Single_002dprecision-to-Double"></a>
<div class="header">
<p>
Next: <a href="#Manual-type-conversion" accesskey="n" rel="next">Manual type conversion</a>, Previous: <a href="#Automatic-type-conversion" accesskey="p" rel="previous">Automatic type conversion</a>, Up: <a href="#Type-Conversion" accesskey="u" rel="up">Type Conversion</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#General-Index" title="Index" rel="index">Index</a>]</p>
</div>
<a name="Promoting-Single_002dprecision-to-Double-1"></a>
<h4 class="subsection">3.33.2 Promoting Single-precision to Double</h4>
<a name="index-promotion-1"></a>
<a name="index-implicit-conversion"></a>
<a name="index-_002d_002ddbl"></a>
<a name="index-_002d_002drth_005fdbl"></a>
<a name="index-_002d_002dflt"></a>
<a name="index-_002d_002drth_005fflt"></a>
<p>Promotion of real numbers from single- to double-precision is
fundamental to scientific computing.
When it should occur depends on the precision of the inputs and the
number of operations.
Single-precision (four-byte) numbers contain about seven significant
figures, while double-precision contain about sixteen.
More, err, precisely, the <acronym>IEEE</acronym> single-precision representation
gives from 6 to 9<!-- /@w --> significant decimal digits precision
<a name="DOCF39" href="#FOOT39"><sup>39</sup></a>.
And the <acronym>IEEE</acronym> double-precision representation
gives from 15 to 17<!-- /@w --> significant decimal digits precision
<a name="DOCF40" href="#FOOT40"><sup>40</sup></a>.
Hence double-precision numbers represent about nine digits more
precision than single-precision numbers.
</p>
<p>Given these properties, there are at least two possible arithmetic
conventions for the treatment of real numbers:
<a name="index-C-language-3"></a>
<a name="index-Fortran"></a>
</p><ol>
<li> Conservative, aka Fortran Convention
Automatic type conversion during arithmetic in the Fortran language is,
by default, performed only when necessary.
All operands in an operation are converted to the most precise type
involved the operation before the arithmetic operation.
Expressions which involve only single-precision numbers are computed
entirely in single-precision.
Expressions involving mixed precision types are computed in the type
of higher precision.
<acronym>NCO</acronym> by default employs the Fortan Convention for promotion.
</li><li> Aggressive, aka C Convention
The C language<!-- /@w --> is by default much more aggressive (and thus
wasteful) than Fortran, and will always implicitly convert single-
to double-precision numbers for no good reason.
All real-number standard C library<!-- /@w --> functions are double-precision,
and C programmers<!-- /@w --> must take extra steps to only utilize single
precision arithmetic.
The high level interpreted data analysis languages <acronym>IDL</acronym>,
Matlab, and <acronym>NCL</acronym> all adopt the C Convention<!-- /@w -->.
</li></ol>
<p><acronym>NCO</acronym> does not automatically promote <code>NC_FLOAT</code> because, in
our judgement, the performance penalty of always doing so would outweigh
the potential benefits.
The now-classic text “Numerical Recipes in C<!-- /@w -->” discusses this point
under the section “Implicit Conversion of Float to Double”
<a name="DOCF41" href="#FOOT41"><sup>41</sup></a>.
That said, such promotion is warranted in some circumstances.
</p>
<p>For example, rounding errors can accumulate to worrisome levels during
arithmetic performed on large arrays of single-precision floats.
This use-case occurs often in geoscientific studies of climate where
thousands-to-millions of gridpoints may contribute to a single average.
If the inputs are all single-precision, then so should be the output.
However the intermediate results where running sums are accumulated may
suffer from too much rounding or from underflow unless computed in
double-precision.
</p>
<p>The order of operations matters to floating point math even when the
analytic expressions are equal.
Cautious users feel disquieted when results from equally valid analyses
differ in the final bits instead of agreeing bit-for-bit.
For example, averaging arrays in multiple stages produces different
answers than averaging them in one step.
This is easily seen in the computation of ensemble averages by two
different methods.
The <acronym>NCO</acronym> test file <samp>in.nc</samp> contains single- and
double-precision representations of the same temperature timeseries as
<code>tpt_flt</code> and <code>tpt_dbl</code>.
Pretend each datapoint in this timeseries represents a monthly-mean
temperature.
We will mimic the derivation of a fifteen-year ensemble-mean January
temperature by concatenating the input file five times, and then
averaging the datapoints representing January two different ways.
In Method 1<!-- /@w --> we derive the 15-year ensemble January average in two
steps, as the average of three five-year averages.
This method is naturally used when each input file contains multiple
years and multiple input files are needed
<a name="DOCF42" href="#FOOT42"><sup>42</sup></a>.
In Method 2<!-- /@w --> we obtain 15-year ensemble January average in a single
step, by averaging all 15 Januaries at one time:
</p><div class="example">
<pre class="example"># tpt_flt and tpt_dbl are identical except for precision
ncks --cdl -C -v tpt_flt,tpt_dbl ~/nco/data/in.nc
# tpt_dbl = 273.1, 273.2, 273.3, 273.4, 273.5, 273.6, 273.7, 273.8, 273.9, 274
# tpt_flt = 273.1, 273.2, 273.3, 273.4, 273.5, 273.6, 273.7, 273.8, 273.9, 274
# Create file with five "ten-month years" (i.e., 50 timesteps) of temperature data
ncrcat -O -v tpt_flt,tpt_dbl -p ~/nco/data in.nc in.nc in.nc in.nc in.nc ~/foo.nc
# Average 1st five "Januaries" (elements 1, 11, 21, 31, 41)
ncra --flt -O -F -d time,1,,10 ~/foo.nc ~/foo_avg1.nc
# Average 2nd five "Januaries" (elements 2, 12, 22, 32, 42)
ncra --flt -O -F -d time,2,,10 ~/foo.nc ~/foo_avg2.nc
# Average 3rd five "Januaries" (elements 3, 13, 23, 33, 43)
ncra --flt -O -F -d time,3,,10 ~/foo.nc ~/foo_avg3.nc
# Method 1: Obtain ensemble January average by averaging the averages
ncra --flt -O ~/foo_avg1.nc ~/foo_avg2.nc ~/foo_avg3.nc ~/foo_avg_mth1.nc
# Method 2: Obtain ensemble January average by averaging the raw data
# Employ ncra's "subcycle" feature (http://nco.sf.net/nco.html#ssc)
ncra --flt -O -F -d time,1,,10,3 ~/foo.nc ~/foo_avg_mth2.nc
# Difference the two methods
ncbo -O ~/foo_avg_mth1.nc ~/foo_avg_mth2.nc ~/foo_avg_dff.nc
ncks --cdl ~/foo_avg_dff.nc
# tpt_dbl = 5.6843418860808e-14 ;
# tpt_flt = -3.051758e-05 ;
</pre></div>
<p>Although the two methods are arithmetically equivalent, they produce
slightly different answers due to the different order of operations.
Moreover, it appears at first glance that the single-precision
answers suffer from greater error than the double-precision answers.
In fact both precisions suffer from non-zero rounding errors.
The answers differ negligibly to machine precision, which is about
seven significant figures for single precision floats (<code>tpt_flt</code>),
and sixteen significant figures for double precision (<code>tpt_dbl</code>).
The input precision determines the answer precision.
</p>
<p>IEEE arithmetic guarantees that two methods will produce bit-for-bit
identical answers only if they compute the same operations in the same
order.
Bit-for-bit identical answers may also occur by happenstance when
rounding errors exactly compensate one another.
This is demonstrated by repeating the example above with the
‘<samp>--dbl</samp>’ (or ‘<samp>--rth_dbl</samp>’ for clarity) option which forces
conversion of single-precision numbers to double-precision prior to
arithmetic.
Now <code>ncra</code> will treat the first value of <code>tpt_flt</code>,
<code>273.1000f</code>, as <code>273.1000000000000d</code>.
Arithmetic on <code>tpt_flt</code> then proceeds in double-precision until the
final answer, which is converted back to single-precision for final
storage.
</p><div class="example">
<pre class="example"># Average 1st five "Januaries" (elements 1, 11, 21, 31, 41)
ncra --dbl -O -F -d time,1,,10 ~/foo.nc ~/foo_avg1.nc
# Average 2nd five "Januaries" (elements 2, 12, 22, 32, 42)
ncra --dbl -O -F -d time,2,,10 ~/foo.nc ~/foo_avg2.nc
# Average 3rd five "Januaries" (elements 3, 13, 23, 33, 43)
ncra --dbl -O -F -d time,3,,10 ~/foo.nc ~/foo_avg3.nc
# Method 1: Obtain ensemble January average by averaging the averages
ncra --dbl -O ~/foo_avg1.nc ~/foo_avg2.nc ~/foo_avg3.nc ~/foo_avg_mth1.nc
# Method 2: Obtain ensemble January average by averaging the raw data
# Employ ncra's "subcycle" feature (http://nco.sf.net/nco.html#ssc)
ncra --dbl -O -F -d time,1,,10,3 ~/foo.nc ~/foo_avg_mth2.nc
# Difference the two methods
ncbo -O ~/foo_avg_mth1.nc ~/foo_avg_mth2.nc ~/foo_avg_dff.nc
# Show differences
ncks --cdl ~/foo_avg_dff.nc
# tpt_dbl = 5.6843418860808e-14 ;
# tpt_flt = 0 ;
</pre></div>
<p>The ‘<samp>--dbl</samp>’ switch has no effect on the results computed from
double-precision inputs.
But now the two methods produce bit-for-bit identical results from the
single-precision inputs!
This is due to the happenstance of rounding along with the effects of
the ‘<samp>--dbl</samp>’ switch.
The ‘<samp>--flt</samp>’ and ‘<samp>--rth_flt</samp>’ switches are provided for
symmetry.
They enforce the traditional <acronym>NCO</acronym> and Fortran convention of
keeping single-precision arithmetic in single-precision unless a
double-precision number is explicitly involved.
</p>
<p>As has been seen, forced promotion of single- to double-precision
prior to arithmetic has advantages and disadvantages.
The primary disadvantages are speed and size.
Double-precision arithmetic is 10–60% slower than, and requires
twice the memory of single-precision arithmetic.
The primary advantage is that rounding errors in double-precision are
much less likely to accumulate to values near the precision of the
underlying geophysical variable.
</p>
<p>For example, if we know temperature to five significant digits, then a
rounding error of 1-bit could affect the least precise digit of
temperature after 1,000–10,000 consecutive one-sided rounding
errors under the worst possible scenario.
Many geophysical grids have tens-of-thousands to millions of points
that must be summed prior to normalization to compute an average.
It is possible for single-precision rouding errors to accumulate and
degrade the precision in such situtations.
Double-precision arithmetic mititgates this problem, so ‘<samp>--dbl</samp>’
would be warranted.
</p>
<a name="index-TREFHT"></a>
<a name="index-CAM3"></a>
<a name="index-GCM-1"></a>
<p>This can be seen with another example, averaging a global surface
temperature field with <code>ncwa</code>.
The input contains a single-precision global temperature field
(stored in <code>TREFHT</code>) produced by the <acronym>CAM3</acronym> general
circulation model (<acronym>GCM</acronym>) run and stored at 1.9 by 2.5<!-- /@w -->
degrees resolution.
This requires 94 latitudes<!-- /@w --> and 144 longitudes<!-- /@w -->, or <em>13,824</em>
total surface gridpoints, a typical GCM resolution these days.
These input characteristics are provided only to show the context
to the interested reader, equivalent results would be found in
statistics of any dataset of comparable size.
Models often represent Earth on a spherical grid where global averages
must be created by weighting each gridcell by its latitude-dependent
weight (i.e., the Gaussian weight stored in <code>gw</code>), or by the
surface area of each contributing gridpoint (stored in <code>area</code>).
</p>
<p>Like many geophysical models and most <acronym>GCM</acronym>s, <acronym>CAM3</acronym>
runs completely in double-precision yet stores its archival output in
single-precision to save space.
In practice such models usually save multi-dimensional prognostic and
diagnostic fields (like <code>TREFHT(lat,lon)</code> and <code>area(lat,lon)</code>)
as single-precision, while saving all one-dimensional coordinates and
weights (here <code>lat</code>, <code>lon</code>, and <code>gw(lon)</code>) as
double-precision.
To obtain pure double-precision arithmetic <em>and</em> storage of the
globla mean temperature, we first create and store double-precision
versions of the single-precision fields:
</p><div class="example">
<pre class="example">ncap2 -O -s 'TREFHT_dbl=double(TREFHT);area_dbl=double(area)' in.nc in.nc
</pre></div>
<p>The single- and double-precision temperatures may each be averaged
globally using four permutations for the precision of the weight
and of the intermediate arithmetic representation:
</p><ol>
<li> Single-precision weight (<code>area</code>), single-precision arithmetic
</li><li> Double-precision weight (<code>gw</code>), single-precision arithmetic
</li><li> Single-precision weight (<code>area</code>), double-precision arithmetic
</li><li> Double-precision weight (<code>gw</code>), double-precision arithmetic
</li></ol>
<div class="example">
<pre class="example"># NB: Values below are printed with C-format %5.6f using
# ncks -H -C -s '%5.6f' -v TREFHT,TREFHT_dbl out.nc
# Single-precision weight (area), single-precision arithmetic
ncwa --flt -O -a lat,lon -w area in.nc out.nc
# TREFHT = 289.246735
# TREFHT_dbl = 289.239964
# Double-precision weight (gw), single-precision arithmetic
ncwa --flt -O -a lat,lon -w gw in.nc out.nc
# TREFHT = 289.226135
# TREFHT_dbl = 289.239964
# Single-precision weight (area), double-precision arithmetic
ncwa --dbl -O -a lat,lon -w area in.nc out.nc
# TREFHT = 289.239960
# TREFHT_dbl = 289.239964
# Double-precision weight (gw), double-precision arithmetic
ncwa --dbl -O -a lat,lon -w gw in.nc out.nc
# TREFHT = 289.239960
# TREFHT_dbl = 289.239964
</pre></div>
<p>First note that the <code>TREFHT_dbl</code> average never changes because
<code>TREFHT_dbl(lat,lon)</code> is double-precision in the input file.
As described above, <acronym>NCO</acronym> automatically converts all operands
involving to the highest precision involved in the operation.
So specifying ‘<samp>--dbl</samp>’ is redundant for double-precision inputs.
</p>
<p>Second, the single-precision arithmetic averages of the single-precision
input <code>TREFHT</code> differ by <em>289.246735 - 289.226135 = 0.0206</em>
from eachother, and, more importantly, by as much as
<em>289.239964 - 289.226135 = 0.013829</em> from the correct
(double-precision) answer.
These averages differ in the fifth digit, i.e., they agree only to four
significant figures!
Given that climate scientists are concerned about global temperature
variations of a tenth of a degree or less, this difference is large.
It means that the global mean temperature changes scientists are looking
for are comparable in size to the numerical artifacts produced by the
averaging procedure.
</p>
<a name="index-rounding"></a>
<a name="index-random-walk"></a>
<p>Why are the single-precision numerical artifacts so large?
Each global average is the result of multiplying almost 15,000 elements
each by its weight, summing those, and then dividing by the summed
weights.
Thus about 50,000 single-precision floating point operations caused
the loss of two to three significant digits of precision.
The net error of a series of independent rounding errors is a random
walk phenomena
<a name="DOCF43" href="#FOOT43"><sup>43</sup></a>.
Successive rounding errors displace the answer further from the truth.
An ensemble of such averages will, on average, have no net bias.
In other words, the expectation value of a series of <acronym>IEEE</acronym>
rounding errors is zero.
And the error of any given sequence of rounding errors obeys, for large
series, a Gaussian distribution centered on zero.
</p>
<a name="index-mantissa"></a>
<a name="index-exponent"></a>
<p>Single-precision numbers use three of their four eight-bit bytes to
represent the mantissa so the smallest representable single-precision
mantissa is <em>\epsilon \equiv 2^{-23} = 1.19209 \times 10^{-7}</em>.
This <em>\epsilon</em> is the smallest <var>x</var> such that
<em>1.0 + x \ne 1.0</em>.
This is the rounding error for non-exact precision-numbers.
Applying random walk theory to rounding, it can be shown that the
expected rounding error after <var>n</var> inexact operations is
<em>\sqrt{2n/\pi}</em> for large <var>n</var><!-- /@w -->.
The expected (i.e., mean absolute) rounding error in our example with
<em>13,824</em> additions is about
<em>\sqrt{2 \times 13824 / \pi} = 91.96</em>.
Hence, addition alone of about fifteen thousand single-precision floats
is expected to consume about two significant digits of precision.
This neglects the error due to the inner product (weights times values)
and normalization (division by tally) aspects of a weighted average.
the ratio of two numbers each containing a numerical bias can magnify
the size of the bias.
In summary, a global mean number computed from about 15,000 gridpoints
each with weights can be expected to lose up to three significant digits.
Since single-precision starts with about seven significant digits, we
should not expect to retain more than four significant digits after
computing weighted averages in single-precision.
The above example with <code>TREFHT</code> shows the expected four digits of
agreement.
</p>
<a name="index-beer"></a>
<p>The <acronym>NCO</acronym> results have been independently validated to the
extent possible in three other languages:
C<!-- /@w -->, Matlab, and <acronym>NCL</acronym>.
C and <acronym>NCO</acronym> are the only languages that permit single-precision
numbers to be treated with single precision arithmetic:
</p><div class="example">
<pre class="example"># Double-precision weight (gw), single-precision arithmetic (C)
ncwa_3528514.exe
# TREFHT = 289.240112
# Double-precision weight (gw), double-precision arithmetic (C)
# TREFHT = 289.239964
# Single-precision weight (area), double-precision arithmetic (Matlab)
# TREFHT = 289.239964
# Double-precision weight (gw), double-precision arithmetic (Matlab)
# TREFHT = 289.239964
# Single-precision weight (area), double-precision arithmetic (NCL)
ncl < ncwa_3528514.ncl
# TREFHT = 289.239960
# TREFHT_dbl = 289.239964
# Double-precision weight (gw), double-precision arithmetic (NCL)
# TREFHT = 289.239960
# TREFHT_dbl = 289.239964
</pre></div>
<p>All languages tested (C, Matlab, <acronym>NCL</acronym>, and <acronym>NCO</acronym>) agree
to machine precision with double-precision arithmetic.
Users are fortunate to have a variety of high quality software that
liberates them from the drudgery of coding their own.
Many packages are free (as in beer)!
As shown above <acronym>NCO</acronym> permits one to shift to their
float-promotion preferences as desired.
No other language allows this with a simple switch.
</p>
<p>To summarize, until version 4.3.6 (September, 2013), the default
arithmetic convention of <acronym>NCO</acronym> followed the behavior of Fortran,
and automatically promoted single-precision to double-precision in all
mixed-precision expressions, and left-alone pure single-precision
expressions.
This is faster and more memory efficient than other conventions.
However, pure single-precision arithmetic can lose too much precision
when used to condense (e.g., average) large arrays.
Statistics involving about <em>n = 10,000</em> single-precision inputs
will lose about 2–3<!-- /@w --> digits if not promoted to double-precision
prior to arithmetic.
The loss scales with the squareroot of <var>n</var><!-- /@w -->.
For larger <var>n</var>, users should promote floats with the ‘<samp>--dbl</samp>’
option if they want to preserve more than four significant digits in
their results.
</p>
<p>The ‘<samp>--dbl</samp>’ and ‘<samp>--flt</samp>’ switches are only available with the
<acronym>NCO</acronym> arithmetic operators that could potentially perform more
than a few single-precision floating point operations per result.
These are <code>nces</code>, <code>ncra</code>, and <code>ncwa</code>.
Each is capable of thousands to millions or more operations per result.
By contrast, the arithmetic operators <code>ncbo</code> and
<code>ncflint</code> perform at most one floating point operation per
result.
Providing the ‘<samp>--dbl</samp>’ option for such trivial operations makes
little sense, so the option is not currently made available.
</p>
<p>At the time of this writing (September 2013), we are interested in
users’ opinions on these matters.
Currently the default behavior is ‘<samp>--flt</samp>’.
We are willing to change the default to ‘<samp>--dbl</samp>’ if users prefer.
Or we could set a threshold (e.g., <em>n \ge 10000</em>) after which
single- to double-precision promotion is automatically invoked.
Or we could make the default promotion convention settable via an
environment variable (<acronym>GSL</acronym> does this a lot).
Please let us know what you think of the selected defaults and options.
</p>
<hr>
<a name="Manual-type-conversion"></a>
<div class="header">
<p>
Previous: <a href="#Promoting-Single_002dprecision-to-Double" accesskey="p" rel="previous">Promoting Single-precision to Double</a>, Up: <a href="#Type-Conversion" accesskey="u" rel="up">Type Conversion</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#General-Index" title="Index" rel="index">Index</a>]</p>
</div>
<a name="Manual-type-conversion-1"></a>
<h4 class="subsection">3.33.3 Manual type conversion</h4>
<a name="index-ncap2-2"></a>
<p><code>ncap2</code> provides intrinsic functions for performing manual type
conversions.
This, for example, converts variable <code>tpt</code> to external type
<code>NC_SHORT</code> (a C-type <code>short</code>), and variable <code>prs</code> to
external type <code>NC_DOUBLE</code> (a C-type <code>double</code>).
</p><div class="example">
<pre class="example">ncap2 -s 'tpt=short(tpt);prs=double(prs)' in.nc out.nc
</pre></div>
<p>See <a href="#ncap2-netCDF-Arithmetic-Processor">ncap2 netCDF Arithmetic Processor</a>, for more details.
</p>
<a name="ovr"></a> <!-- http://nco.sf.net/nco.html#ovr -->
<a name="-O"></a> <!-- http://nco.sf.net/nco.html#-O --><hr>
<a name="Batch-Mode"></a>
<div class="header">
<p>
Next: <a href="#History-Attribute" accesskey="n" rel="next">History Attribute</a>, Previous: <a href="#Type-Conversion" accesskey="p" rel="previous">Type Conversion</a>, Up: <a href="#Common-features" accesskey="u" rel="up">Common features</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#General-Index" title="Index" rel="index">Index</a>]</p>
</div>
<a name="Batch-Mode-1"></a>
<h3 class="section">3.34 Batch Mode</h3>
<a name="index-batch-mode"></a>
<a name="index-overwriting-files-1"></a>
<a name="index-appending-to-files-1"></a>
<a name="index-force-overwrite"></a>
<a name="index-force-append"></a>
<a name="index-_002dO-1"></a>
<a name="index-_002dA-1"></a>
<a name="index-_002d_002doverwrite-1"></a>
<a name="index-_002d_002dovr-1"></a>
<a name="index-_002d_002dapn-1"></a>
<a name="index-_002d_002dappend-1"></a>
<table class="cartouche" border="1"><tr><td>
<p>Availability: All operators<br>
Short options: ‘<samp>-O</samp>’, ‘<samp>-A</samp>’<br>
Long options: ‘<samp>--ovr</samp>’, ‘<samp>--overwrite</samp>’, ‘<samp>--apn</samp>’, ‘<samp>--append</samp>’<br>
</p></td></tr></table>
<p>If the <var>output-file</var> specified for a command is a pre-existing file,
then the operator will prompt the user whether to overwrite (erase) the
existing <var>output-file</var>, attempt to append to it, or abort the
operation.
However, interactive questions reduce productivity when processing large
amounts of data.
Therefore <acronym>NCO</acronym> also implements two ways to override its own safety
features, the ‘<samp>-O</samp>’ and ‘<samp>-A</samp>’ switches.
Specifying ‘<samp>-O</samp>’ tells the operator to overwrite any existing
<var>output-file</var> without prompting the user interactively.
Specifying ‘<samp>-A</samp>’ tells the operator to attempt to append to any
existing <var>output-file</var> without prompting the user interactively.
These switches are useful in batch environments because they suppress
interactive keyboard input.
NB: As of 20120515, <code>ncap2</code> is unable to append to files that
already contain the appended dimensions.
</p>
<a name="hst"></a> <!-- http://nco.sf.net/nco.html#hst -->
<a name="history"></a> <!-- http://nco.sf.net/nco.html#history -->
<a name="-h"></a> <!-- http://nco.sf.net/nco.html#-h --><hr>
<a name="History-Attribute"></a>
<div class="header">
<p>
Next: <a href="#File-List-Attributes" accesskey="n" rel="next">File List Attributes</a>, Previous: <a href="#Batch-Mode" accesskey="p" rel="previous">Batch Mode</a>, Up: <a href="#Common-features" accesskey="u" rel="up">Common features</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#General-Index" title="Index" rel="index">Index</a>]</p>
</div>
<a name="History-Attribute-1"></a>
<h3 class="section">3.35 History Attribute</h3>
<a name="index-history-2"></a>
<a name="index-timestamp"></a>
<a name="index-global-attributes-1"></a>
<a name="index-attributes_002c-global-1"></a>
<a name="index-_002dh"></a>
<a name="index-_002d_002dhst"></a>
<a name="index-_002d_002dhistory"></a>
<table class="cartouche" border="1"><tr><td>
<p>Availability: All operators<br>
Short options: ‘<samp>-h</samp>’<br>
Long options: ‘<samp>--hst</samp>’, ‘<samp>--history</samp>’<br>
</p></td></tr></table>
<p>All operators automatically append a <code>history</code> global attribute to
any file they create or modify.
The <code>history</code> attribute consists of a timestamp and the full string
of the invocation command to the operator, e.g., ‘<samp>Mon May 26 20:10:24
1997: ncks in.nc foo.nc</samp>’.
The full contents of an existing <code>history</code> attribute are copied
from the first <var>input-file</var> to the <var>output-file</var>.
The timestamps appear in reverse chronological order, with the most
recent timestamp appearing first in the <code>history</code> attribute.
Since <acronym>NCO</acronym> and many other netCDF operators adhere to the
<code>history</code> convention, the entire data processing path of a given
netCDF file may often be deduced from examination of its <code>history</code>
attribute.
As of May, 2002, <acronym>NCO</acronym> is case-insensitive to the spelling
of the <code>history</code> attribute name.
Thus attributes named <code>History</code> or <code>HISTORY</code> (which are
non-standard and not recommended) will be treated as valid history
attributes.
When more than one global attribute fits the case-insensitive search
for "history", the first one found will be used.
<code>history</code> attribute
<a name="index-ncatted-2"></a>
To avoid information overkill, all operators have an optional switch
(‘<samp>-h</samp>’, ‘<samp>--hst</samp>’, or ‘<samp>--history</samp>’) to override
automatically appending the <code>history</code> attribute
(see <a href="#ncatted-netCDF-Attribute-Editor">ncatted netCDF Attribute Editor</a>).
Note that the ‘<samp>-h</samp>’ switch also turns off writing the
<code>nco_input_file_list</code> attribute for multi-file operators
(see <a href="#File-List-Attributes">File List Attributes</a>).
</p>
<a name="fl_lst_in_att"></a> <!-- http://nco.sf.net/nco.html#fl_lst_in_att --><hr>
<a name="File-List-Attributes"></a>
<div class="header">
<p>
Next: <a href="#CF-Conventions" accesskey="n" rel="next">CF Conventions</a>, Previous: <a href="#History-Attribute" accesskey="p" rel="previous">History Attribute</a>, Up: <a href="#Common-features" accesskey="u" rel="up">Common features</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#General-Index" title="Index" rel="index">Index</a>]</p>
</div>
<a name="File-List-Attributes-1"></a>
<h3 class="section">3.36 File List Attributes</h3>
<a name="index-nco_005finput_005ffile_005flist-1"></a>
<a name="index-nco_005finput_005ffile_005fnumber-1"></a>
<a name="index-stdin-1"></a>
<a name="index-global-attributes-2"></a>
<a name="index-attributes_002c-global-2"></a>
<a name="index-_002dH"></a>
<a name="index-_002d_002dfl_005flst_005fin"></a>
<a name="index-_002d_002dfile_005flist"></a>
<table class="cartouche" border="1"><tr><td>
<p>Availability: <code>nces</code>, <code>ncecat</code>, <code>ncra</code>, <code>ncrcat</code><br>
Short options: ‘<samp>-H</samp>’<br>
Long options: ‘<samp>--fl_lst_in</samp>’, ‘<samp>--file_list</samp>’<br>
</p></td></tr></table>
<p>Many methods of specifying large numbers of input file names pass
these names via pipes, encodings, or argument transfer programs
(see <a href="#Large-Numbers-of-Files">Large Numbers of Files</a>).
When these methods are used, the input file list is not explicitly
passed on the command line.
This results in a loss of information since the <code>history</code>
attribute no longer contains the exact command by which the file
was created.
</p>
<p><acronym>NCO</acronym> solves this dilemma by archiving input file list
attributes.
When the input file list to a multi-file operator is specified
via <code>stdin</code>, the operator, by default, attaches two global
attributes to any file they create or modify.
The <code>nco_input_file_number</code> global attribute contains the number of
input files, and <code>nco_input_file_list</code> contains the file names,
specified as standard input to the multi-file operator.
This information helps to verify that all input files the user thinks
were piped through <code>stdin</code> actually arrived.
Without the <code>nco_input_file_list</code> attribute, the information is lost
forever and the “chain of evidence” would be broken.
</p>
<p>The ‘<samp>-H</samp>’ switch overrides (turns off) the default behavior of
writing the input file list global attributes when input is from
<code>stdin</code>.
The ‘<samp>-h</samp>’ switch does this too, and turns off the <code>history</code>
attribute as well (see <a href="#History-Attribute">History Attribute</a>).
Hence both switches allows space-conscious users to avoid storing what
may amount to many thousands of filenames in a metadata attribute.
</p>
<a name="CF"></a> <!-- http://nco.sf.net/nco.html#CF -->
<a name="cnv"></a> <!-- http://nco.sf.net/nco.html#cnv -->
<a name="cnv_CF"></a> <!-- http://nco.sf.net/nco.html#cnv_CF -->
<a name="cnv_CCSM"></a> <!-- http://nco.sf.net/nco.html#cnv_CCSM --><hr>
<a name="CF-Conventions"></a>
<div class="header">
<p>
Next: <a href="#ARM-Conventions" accesskey="n" rel="next">ARM Conventions</a>, Previous: <a href="#File-List-Attributes" accesskey="p" rel="previous">File List Attributes</a>, Up: <a href="#Common-features" accesskey="u" rel="up">Common features</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#General-Index" title="Index" rel="index">Index</a>]</p>
</div>
<a name="CF-Conventions-1"></a>
<h3 class="section">3.37 <acronym>CF</acronym> Conventions</h3>
<a name="index-CF-conventions-3"></a>
<a name="index-CCSM-conventions"></a>
<a name="index-UDUnits-2"></a>
<a name="index-ORO"></a>
<a name="index-area"></a>
<a name="index-datesec"></a>
<a name="index-date"></a>
<a name="index-gw"></a>
<a name="index-hyai"></a>
<a name="index-hyam"></a>
<a name="index-hybi"></a>
<a name="index-hybm"></a>
<a name="index-lat_005fbnds"></a>
<a name="index-lon_005fbnds"></a>
<a name="index-msk_005f_002a"></a>
<table class="cartouche" border="1"><tr><td>
<p>Availability: <code>ncbo</code>, <code>nces</code>, <code>ncecat</code>,
<code>ncflint</code>, <code>ncpdq</code>, <code>ncra</code>, <code>ncwa</code><br>
Short options: None<br>
</p></td></tr></table>
<p><acronym>NCO</acronym> recognizes some Climate and Forecast (<acronym>CF</acronym>)
metadata conventions, and applies special rules to such data.
<acronym>NCO</acronym> was contemporaneous with <acronym>COARDS</acronym> and still
contains some rules to handle older <acronym>NCAR</acronym> model datasets, such as
<acronym>CCM</acronym> and early <acronym>CCSM</acronym> datasets, that pre-date
<acronym>CF</acronym>.
Such datasets may not contain an explicit <code>Conventions</code> attribute
(e.g., ‘<samp>CF-1.0</samp>’).
Nevertheless, we refer to all such metadata collectively as <acronym>CF</acronym>
metadata.
Skip this section if you never work with <acronym>CF</acronym> metadata.
</p>
<p>The <acronym>CF</acronym> netCDF conventions are described
<a href="http://cf-pcmdi.llnl.gov/documents/cf-conventions/1.6/cf-conventions.html#coordinate-system">here</a>.
Most <acronym>CF</acronym> netCDF conventions are transparent to <acronym>NCO</acronym>
<a name="DOCF44" href="#FOOT44"><sup>44</sup></a>.
There are no known pitfalls associated with using any <acronym>NCO</acronym>
operator on files adhering to these conventions
<a name="DOCF45" href="#FOOT45"><sup>45</sup></a>.
However, to facilitate maximum user friendliness, <acronym>NCO</acronym> applies
special rules to certain variables in <acronym>CF</acronym> files.
The special functions are not required by the <acronym>CF</acronym> netCDF
conventions, yet experience shows that they simplify data analysis.
</p>
<a name="prc_xcp"></a> <!-- http://nco.sf.net/nco.html#prc_xcp --><p>Currently, <acronym>NCO</acronym> determines whether a datafile is a
<acronym>CF</acronym> output datafile simply by checking (case-insensitively)
whether the value of the global attribute <code>Conventions</code> (if any)
equals ‘<samp>CF-1.0</samp>’ or ‘<samp>NCAR-CSM</samp>’
Should <code>Conventions</code> equal either of these in the (first)
<var>input-file</var>, <acronym>NCO</acronym> will apply special rules to certain
variables because of their usual meaning in <acronym>CF</acronym> files.
<acronym>NCO</acronym> will not average the following variables often found in
<acronym>CF</acronym> files:
<code>ntrm</code>, <code>ntrn</code>, <code>ntrk</code>, <code>ndbase</code>, <code>nsbase</code>,
<code>nbdate</code>, <code>nbsec</code>, <code>mdt</code>, <code>mhisf</code>.
These variables contain scalar metadata such as the resolution of the
host geophysical model and it makes no sense to change their values.
</p>
<a name="index-non_002dcoordinate-grid-properties"></a>
<p>Furthermore, the <em>size and rank-preserving arithmetic operators</em> try
not to operate on certain grid properties.
These operators are <code>ncap2</code>, <code>ncbo</code>, <code>nces</code>,
<code>ncflint</code>, and <code>ncpdq</code> (when used for packing, not for
permutation).
These operators do not operate, by default, on (i.e., add, subtract,
pack, etc.) the following variables:
<code>ORO</code>,
<code>area</code>,
<code>datesec</code>,
<code>date</code>,
<code>gw</code>,
<code>hyai</code>,
<code>hyam</code>,
<code>hybi</code>.
<code>hybm</code>,
<code>lat_bnds</code>,
<code>lon_bnds</code>,
<code>msk_*</code>.
These variables represent the Gaussian weights, the orography field,
time fields, hybrid pressure coefficients, and latititude/longitude
boundaries.
We call these fields non-coordinate <em>grid properties</em>.
Coordinate grid properties are easy to identify because they are
coordinate variables such as <code>latitude</code> and <code>longitude</code>.
</p>
<p>Users usually want <em>all</em> grid properties to remain unaltered in the
output file.
To be treated as a grid property, the variable name must <em>exactly</em>
match a name in the above list, or be a coordinate variable.
The handling of <code>msk_*</code> is exceptional in that <em>any</em> variable
name beginning with the string <code>msk_</code> is considered to be a
“mask” and is thus preserved (not operated on arithmetically).
</p>
<p>You must spoof <acronym>NCO</acronym> if you would like any grid properties
or other special <acronym>CF</acronym> fields processed normally.
For example rename the variables first with <code>ncrename</code>,
or alter the <code>Conventions</code> attribute.
</p>
<a name="cnv_CF_bnd"></a> <!-- http://nco.sf.net/nco.html#cnv_CF_bnd -->
<a name="bnd"></a> <!-- http://nco.sf.net/nco.html#bnd --><a name="index-bounds"></a>
<a name="index-bounds-convention"></a>
<p>As of <acronym>NCO</acronym> version 4.0.8 (April, 2011), <acronym>NCO</acronym>
supports the <acronym>CF</acronym> <code>bounds</code> convention for cell boundaries
described
<a href="http://cf-pcmdi.llnl.gov/documents/cf-conventions/1.6/cf-conventions.html#cell-boundaries">here</a>.
This convention allows coordinate variables (including multidimensional
coordinates) to describe the boundaries of their cells.
This is done by naming the variable which contains the bounds in
in the <code>bounds</code> attribute.
Note that coordinates of rank <em>N</em> have bounds of rank <em>N+1</em>.
NCO-generated subsets of <acronym>CF</acronym>-compliant files with <code>bounds</code>
attributes will include the coordinates specified by the <code>bounds</code>
attribute, if any.
Hence the subsets will themselves be <acronym>CF</acronym>-compliant.
</p>
<a name="cnv_CF_crd"></a> <!-- http://nco.sf.net/nco.html#cnv_CF_crd --><a name="index-coordinates-1"></a>
<a name="index-coordinates-convention"></a>
<a name="index-coordinate-variable-2"></a>
<a name="index-auxiliary-coordinates"></a>
<a name="index-subsetting-2"></a>
<a name="index-_002dC-1"></a>
<a name="index-_002dc-1"></a>
<a name="index-_002d_002dno_002dcoords-1"></a>
<a name="index-_002d_002dno_002dcrd-1"></a>
<a name="index-_002d_002dcoords-1"></a>
<a name="index-_002d_002dcrd-1"></a>
<p>As of <acronym>NCO</acronym> version 3.9.6 (January, 2009), <acronym>NCO</acronym>
supports the <acronym>CF</acronym> <code>coordinates</code> convention described
<a href="http://cf-pcmdi.llnl.gov/documents/cf-conventions/1.6/cf-conventions.html#coordinate-system">here</a>.
This convention allows variables to specify additional coordinates
(including multidimensional coordinates) in a space-separated string
attribute named <code>coordinates</code>.
NCO attaches any such coordinates to the extraction list along with
variable and its usual (one-dimensional) coordinates, if any.
These auxiliary coordinates are subject to the user-specified overrides
described in <a href="#Subsetting-Coordinate-Variables">Subsetting Coordinate Variables</a>.
</p>
<a name="cnv_CF_cll_mth"></a> <!-- http://nco.sf.net/nco.html#cnv_CF_cll_mth -->
<a name="cll_mth"></a> <!-- http://nco.sf.net/nco.html#cll_mth -->
<a name="no_cll_mth"></a> <!-- http://nco.sf.net/nco.html#no_cll_mth -->
<a name="cell_methods"></a> <!-- http://nco.sf.net/nco.html#cell_methods --><a name="index-cell_005fmethods"></a>
<a name="index-_002d_002dcll_005fmth"></a>
<a name="index-_002d_002dno_005fcll_005fmth"></a>
<a name="index-_002d_002dcell_005fmethods"></a>
<a name="index-_002d_002dno_005fcell_005fmethods"></a>
<a name="index-cell-methods-convention"></a>
<p>As of <acronym>NCO</acronym> version 4.4.2 (February, 2014), <acronym>NCO</acronym>
supports some of the <acronym>CF</acronym> <code>cell_methods</code>
<a href="http://cf-pcmdi.llnl.gov/documents/cf-conventions/1.7-draft1/cf-conventions.html#cell-methods">convention</a>
to describe the analysis procedures that have been applied to data.
The convention creates (or appends to an existing) <code>cell_methods</code>
attribute a space-separated list of couplets of the form <var>dmn: op</var>
where <var>dmn</var> is a comma-separated list of dimensions previously
contained in the variable that have been reduced by the arithmetic
operation <var>op</var>.
For example, the <code>cell_methods</code> value <code>time: mean</code> says that
the variable in question was averaged over the <code>time</code> dimension.
In such cases <code>time</code> will either be a scalar variable or a
degenerate dimension or coordinate.
This simply means that it has been averaged-over.
The value <code>time, lon: mean lat: max</code> says that the variable in
question is the maximum zonal mean of the time averaged original
variable.
Which is to say that the variable was first averaged over time and
longitude, and then the residual latitudinal array was reduced by
choosing the maximum value.
Since the <code>cell methods</code> convention may alter metadata in an
undesirable (or possibly incorrect) fashion, we provide switches
to ensure it is always or never used.
Use long-options ‘<samp>--cll_mth</samp>’ or ‘<samp>--cell_methods</samp>’ to invoke the
algorithm (true by default), and options ‘<samp>--no_cll_mth</samp>’ or
‘<samp>--no_cell_methods</samp>’ to turn it off.
These options are only available in the operators <code>ncwa</code> and
<code>ncra</code>.
</p>
<a name="cnv_ARM"></a> <!-- http://nco.sf.net/nco.html#cnv_ARM --><hr>
<a name="ARM-Conventions"></a>
<div class="header">
<p>
Next: <a href="#Operator-Version" accesskey="n" rel="next">Operator Version</a>, Previous: <a href="#CF-Conventions" accesskey="p" rel="previous">CF Conventions</a>, Up: <a href="#Common-features" accesskey="u" rel="up">Common features</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#General-Index" title="Index" rel="index">Index</a>]</p>
</div>
<a name="ARM-Conventions-1"></a>
<h3 class="section">3.38 <acronym>ARM</acronym> Conventions</h3>
<a name="index-ARM-conventions"></a>
<a name="index-time_005foffset"></a>
<a name="index-base_005ftime"></a>
<a name="index-time-1"></a>
<table class="cartouche" border="1"><tr><td>
<p>Availability: <code>ncrcat</code><br>
Short options: None<br>
</p></td></tr></table>
<p><code>ncrcat</code> has been programmed to correctly handle data files
which utilize the Atmospheric Radiation Measurement (<acronym>ARM</acronym>)
Program <a href="http://www.arm.gov/data/time.stm">convention</a> for
time and time offsets.
If you do not work with <acronym>ARM</acronym> data then you may skip this
section.
<acronym>ARM</acronym> data files store time information in two variables, a
scalar, <code>base_time</code>, and a record variable, <code>time_offset</code>.
Subtle but serious problems can arise when these type of files are
just blindly concatenated.
Therefore <code>ncrcat</code> has been specially programmed to be able to
chain together consecutive <acronym>ARM</acronym> <var>input-files</var> and produce
and an <var>output-file</var> which contains the correct time information.
Currently, <code>ncrcat</code> determines whether a datafile is an
<acronym>ARM</acronym> datafile simply by testing for the existence of the
variables <code>base_time</code>, <code>time_offset</code>, and the dimension
<code>time</code>.
If these are found in the <var>input-file</var> then <code>ncrcat</code> will
automatically perform two non-standard, but hopefully useful,
procedures.
First, <code>ncrcat</code> will ensure that values of <code>time_offset</code>
appearing in the <var>output-file</var> are relative to the <code>base_time</code>
appearing in the first <var>input-file</var> (and presumably, though not
necessarily, also appearing in the <var>output-file</var>).
Second, if a coordinate variable named <code>time</code> is not found in the
<var>input-files</var>, then <code>ncrcat</code> automatically creates the
<code>time</code> coordinate in the <var>output-file</var>.
The values of <code>time</code> are defined by the <acronym>ARM</acronym> conventions
<em><var>time</var> = <var>base_time</var> + <var>time_offset</var></em>.
Thus, if <var>output-file</var> contains the <code>time_offset</code>
variable, it will also contain the <code>time</code> coordinate.
<a name="index-history-3"></a>
<a name="index-global-attributes-3"></a>
<a name="index-attributes_002c-global-3"></a>
A short<!-- /@w --> message is added to the <code>history</code> global attribute
whenever these <acronym>ARM</acronym>-specific procedures are executed.
</p>
<a name="vrs"></a> <!-- http://nco.sf.net/nco.html#vrs -->
<a name="version"></a> <!-- http://nco.sf.net/nco.html#version --><hr>
<a name="Operator-Version"></a>
<div class="header">
<p>
Previous: <a href="#ARM-Conventions" accesskey="p" rel="previous">ARM Conventions</a>, Up: <a href="#Common-features" accesskey="u" rel="up">Common features</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#General-Index" title="Index" rel="index">Index</a>]</p>
</div>
<a name="Operator-Version-1"></a>
<h3 class="section">3.39 Operator Version</h3>
<a name="index-version"></a>
<a name="index-RCS"></a>
<a name="index-_002dr-2"></a>
<a name="index-_002d_002drevision-1"></a>
<a name="index-_002d_002dversion-1"></a>
<a name="index-_002d_002dvrs-1"></a>
<table class="cartouche" border="1"><tr><td>
<p>Availability: All operators<br>
Short options: ‘<samp>-r</samp>’<br>
Long options: ‘<samp>--revision</samp>’, ‘<samp>--version</samp>’, or ‘<samp>--vrs</samp>’<br>
</p></td></tr></table>
<p>All operators can be told to print their version information,
library version, copyright notice, and compile-time configuration
with the ‘<samp>-r</samp>’ switch, or its long-option equivalent
‘<samp>revision</samp>’.
The ‘<samp>--version</samp>’ or ‘<samp>--vrs</samp>’ switches print the operator
version information only.
The internal version number varies between operators, and indicates the
most recent change to a particular operator’s source code.
This is useful in making sure you are working with the most recent
operators.
The version of <acronym>NCO</acronym> you are using might be, e.g., <code>3.9.5</code>.
Using ‘<samp>-r</samp>’ on, say, <code>ncks</code>, produces something like
‘<samp>NCO netCDF Operators version "3.9.5" last modified 2008/05/11 built May 12 2008 on neige by zender
Copyright (C) 1995--2008 Charlie Zender
ncks version 20090918</samp>’.
This tells you that <code>ncks</code> contains all patches up to version
<code>3.9.5</code>, which dates from May 11<!-- /@w -->, 2008.
<a name="rfr"></a> <!-- http://nco.sf.net/nco.html#rfr --></p><hr>
<a name="Operator-Reference-Manual"></a>
<div class="header">
<p>
Next: <a href="#Contributing" accesskey="n" rel="next">Contributing</a>, Previous: <a href="#Common-features" accesskey="p" rel="previous">Common features</a>, Up: <a href="#Top" accesskey="u" rel="up">Top</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#General-Index" title="Index" rel="index">Index</a>]</p>
</div>
<a name="Operator-Reference-Manual-1"></a>
<h2 class="chapter">4 Operator Reference Manual</h2>
<p>This chapter presents reference pages for each of the operators
individually.
The operators are presented in alphabetical order.
<a name="index-command-line-switches-3"></a>
All valid command line switches are included in the syntax statement.
Recall that descriptions of many of these command line switches are
provided only in <a href="#Common-features">Common features</a>, to avoid redundancy.
Only options specific to, or most useful with, a particular operator are
described in any detail in the sections below.
</p>
<table class="menu" border="0" cellspacing="0">
<tr><td align="left" valign="top">• <a href="#ncap2-netCDF-Arithmetic-Processor" accesskey="1">ncap2 netCDF Arithmetic Processor</a>:</td><td> </td><td align="left" valign="top">
</td></tr>
<tr><td align="left" valign="top">• <a href="#ncatted-netCDF-Attribute-Editor" accesskey="2">ncatted netCDF Attribute Editor</a>:</td><td> </td><td align="left" valign="top">
</td></tr>
<tr><td align="left" valign="top">• <a href="#ncbo-netCDF-Binary-Operator" accesskey="3">ncbo netCDF Binary Operator</a>:</td><td> </td><td align="left" valign="top">
</td></tr>
<tr><td align="left" valign="top">• <a href="#nces-netCDF-Ensemble-Statistics" accesskey="4">nces netCDF Ensemble Statistics</a>:</td><td> </td><td align="left" valign="top">
</td></tr>
<tr><td align="left" valign="top">• <a href="#ncecat-netCDF-Ensemble-Concatenator" accesskey="5">ncecat netCDF Ensemble Concatenator</a>:</td><td> </td><td align="left" valign="top">
</td></tr>
<tr><td align="left" valign="top">• <a href="#ncflint-netCDF-File-Interpolator" accesskey="6">ncflint netCDF File Interpolator</a>:</td><td> </td><td align="left" valign="top">
</td></tr>
<tr><td align="left" valign="top">• <a href="#ncks-netCDF-Kitchen-Sink" accesskey="7">ncks netCDF Kitchen Sink</a>:</td><td> </td><td align="left" valign="top">
</td></tr>
<tr><td align="left" valign="top">• <a href="#ncpdq-netCDF-Permute-Dimensions-Quickly" accesskey="8">ncpdq netCDF Permute Dimensions Quickly</a>:</td><td> </td><td align="left" valign="top">
</td></tr>
<tr><td align="left" valign="top">• <a href="#ncra-netCDF-Record-Averager" accesskey="9">ncra netCDF Record Averager</a>:</td><td> </td><td align="left" valign="top">
</td></tr>
<tr><td align="left" valign="top">• <a href="#ncrcat-netCDF-Record-Concatenator">ncrcat netCDF Record Concatenator</a>:</td><td> </td><td align="left" valign="top">
</td></tr>
<tr><td align="left" valign="top">• <a href="#ncrename-netCDF-Renamer">ncrename netCDF Renamer</a>:</td><td> </td><td align="left" valign="top">
</td></tr>
<tr><td align="left" valign="top">• <a href="#ncwa-netCDF-Weighted-Averager">ncwa netCDF Weighted Averager</a>:</td><td> </td><td align="left" valign="top">
</td></tr>
</table>
<a name="ncap"></a> <!-- http://nco.sf.net/nco.html#ncap -->
<a name="ncap2"></a> <!-- http://nco.sf.net/nco.html#ncap2 --><hr>
<a name="ncap2-netCDF-Arithmetic-Processor"></a>
<div class="header">
<p>
Next: <a href="#ncatted-netCDF-Attribute-Editor" accesskey="n" rel="next">ncatted netCDF Attribute Editor</a>, Previous: <a href="#Operator-Reference-Manual" accesskey="p" rel="previous">Operator Reference Manual</a>, Up: <a href="#Operator-Reference-Manual" accesskey="u" rel="up">Operator Reference Manual</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#General-Index" title="Index" rel="index">Index</a>]</p>
</div>
<a name="ncap2-netCDF-Arithmetic-Processor-1"></a>
<h3 class="section">4.1 <code>ncap2</code> netCDF Arithmetic Processor</h3>
<a name="index-parser"></a>
<a name="index-lexer"></a>
<a name="index-arithmetic-processor"></a>
<a name="index-ncap"></a>
<a name="index-ncap2-5"></a>
<table class="cartouche" border="1"><tr><td>
<p><code>ncap2</code> understands a relatively full-featured
language of operations, including loops, conditionals, arrays,
and math functions.
<code>ncap2</code> is the most rapidly changing <acronym>NCO</acronym> operator and
its documentation is incomplete.
The distribution file <samp>data/ncap2_tst.nco</samp> contains an up-to-date
overview of its syntax and capabilities.
The <samp>data/*.nco</samp> distribution files (especially
<samp>bin_cnt.nco</samp>, <samp>psd_wrf.nco</samp>, and <samp>rgr.nco</samp>) contain
in-depth examples of <code>ncap2</code> solutions to complex problems.
</p></td></tr></table>
<p>SYNTAX
</p><div class="example">
<pre class="example">ncap2 [-3] [-4] [-6] [-7] [<a href="http://nco.sf.net/nco.html#-A">-A</a>] [-C] [-c]
[-D <var>dbg</var>] [-F] [-f] [-h] [--hdf] [--hdr_pad <var>nbr</var>] [-L <var>dfl_lvl</var>] [-l <var>path</var>]
[--no_tmp_fl] [-O] [-o <var>output-file</var>] [-p <var>path</var>] [-R] [-r] [--ram_all]
[-s <var>algebra</var>] [-S <var>fl.nco</var>] [-t <var>thr_nbr</var>] [-v]
<var>input-file</var> [<var>output-file</var>]
</pre></div>
<p>DESCRIPTION
</p>
<p><code>ncap2</code> arithmetically processes netCDF files
<a name="DOCF46" href="#FOOT46"><sup>46</sup></a>.
<a name="index-script-file"></a>
<a name="index-_002d_002dscript_002dfile"></a>
<a name="index-_002d_002dfl_005fspt"></a>
<a name="index-_002d_002dscript"></a>
<a name="index-_002d_002dspt"></a>
The processing instructions are contained either in the <acronym>NCO</acronym>
script file <samp>fl.nco</samp> or in a sequence of command line arguments.
The options ‘<samp>-s</samp>’ (or long options ‘<samp>--spt</samp>’ or ‘<samp>--script</samp>’)
are used for in-line scripts and ‘<samp>-S</samp>’ (or long options
‘<samp>--fl_spt</samp>’ or ‘<samp>--script-file</samp>’) are used to provide the
filename where (usually multiple) scripting commands are pre-stored.
<code>ncap2</code> was written to perform arbitrary algebraic
transformations of data and archive the results as easily as possible.
<a name="index-derived-fields"></a>
See <a href="#Missing-Values">Missing Values</a>, for treatment of missing values.
The results of the algebraic manipulations are called
<em>derived fields</em>.
</p>
<p>Unlike the other operators, <code>ncap2</code> does not accept a list of
variables to be operated on as an argument to ‘<samp>-v</samp>’
(see <a href="#Subsetting-Files">Subsetting Files</a>).
Rather, the ‘<samp>-v</samp>’ switch takes no arguments and indicates
that <code>ncap2</code> should output <em>only</em> user-defined variables.
<code>ncap2</code> neither accepts nor understands the <var>-x</var> switch.
<a name="index-appending-variables-2"></a>
NB: As of 20120515, <code>ncap2</code> is unable to append to files that
already contain the appended dimensions.
</p>
<table class="menu" border="0" cellspacing="0">
<tr><td align="left" valign="top">• <a href="#Syntax-of-ncap2-statements" accesskey="1">Syntax of ncap2 statements</a>:</td><td> </td><td align="left" valign="top">
</td></tr>
<tr><td align="left" valign="top">• <a href="#Expressions" accesskey="2">Expressions</a>:</td><td> </td><td align="left" valign="top">
</td></tr>
<tr><td align="left" valign="top">• <a href="#Dimensions" accesskey="3">Dimensions</a>:</td><td> </td><td align="left" valign="top">
</td></tr>
<tr><td align="left" valign="top">• <a href="#Left-hand-casting" accesskey="4">Left hand casting</a>:</td><td> </td><td align="left" valign="top">
</td></tr>
<tr><td align="left" valign="top">• <a href="#Arrays-and-hyperslabs" accesskey="5">Arrays and hyperslabs</a>:</td><td> </td><td align="left" valign="top">
</td></tr>
<tr><td align="left" valign="top">• <a href="#Attributes" accesskey="6">Attributes</a>:</td><td> </td><td align="left" valign="top">
</td></tr>
<tr><td align="left" valign="top">• <a href="#Number-literals" accesskey="7">Number literals</a>:</td><td> </td><td align="left" valign="top">
</td></tr>
<tr><td align="left" valign="top">• <a href="#if-statement" accesskey="8">if statement</a>:</td><td> </td><td align="left" valign="top">
</td></tr>
<tr><td align="left" valign="top">• <a href="#print-statement" accesskey="9">print statement</a>:</td><td> </td><td align="left" valign="top">
</td></tr>
<tr><td align="left" valign="top">• <a href="#Missing-values-ncap2">Missing values ncap2</a>:</td><td> </td><td align="left" valign="top">
</td></tr>
<tr><td align="left" valign="top">• <a href="#Methods-and-functions">Methods and functions</a>:</td><td> </td><td align="left" valign="top">
</td></tr>
<tr><td align="left" valign="top">• <a href="#RAM-variables">RAM variables</a>:</td><td> </td><td align="left" valign="top">
</td></tr>
<tr><td align="left" valign="top">• <a href="#Where-statement">Where statement</a>:</td><td> </td><td align="left" valign="top">
</td></tr>
<tr><td align="left" valign="top">• <a href="#Loops">Loops</a>:</td><td> </td><td align="left" valign="top">
</td></tr>
<tr><td align="left" valign="top">• <a href="#Include-files">Include files</a>:</td><td> </td><td align="left" valign="top">
</td></tr>
<tr><td align="left" valign="top">• <a href="#Sort-methods">Sort methods</a>:</td><td> </td><td align="left" valign="top">
</td></tr>
<tr><td align="left" valign="top">• <a href="#Irregular-grids">Irregular grids</a>:</td><td> </td><td align="left" valign="top">
</td></tr>
<tr><td align="left" valign="top">• <a href="#Bilinear-interpolation">Bilinear interpolation</a>:</td><td> </td><td align="left" valign="top">
</td></tr>
<tr><td align="left" valign="top">• <a href="#GSL-special-functions">GSL special functions</a>:</td><td> </td><td align="left" valign="top">
</td></tr>
<tr><td align="left" valign="top">• <a href="#GSL-interpolation">GSL interpolation</a>:</td><td> </td><td align="left" valign="top">
</td></tr>
<tr><td align="left" valign="top">• <a href="#GSL-least_002dsquares-fitting">GSL least-squares fitting</a>:</td><td> </td><td align="left" valign="top">
</td></tr>
<tr><td align="left" valign="top">• <a href="#GSL-statistics">GSL statistics</a>:</td><td> </td><td align="left" valign="top">
</td></tr>
<tr><td align="left" valign="top">• <a href="#GSL-random-number-generation">GSL random number generation</a>:</td><td> </td><td align="left" valign="top">
</td></tr>
<tr><td align="left" valign="top">• <a href="#Examples-ncap2">Examples ncap2</a>:</td><td> </td><td align="left" valign="top">
</td></tr>
<tr><td align="left" valign="top">• <a href="#Intrinsic-mathematical-methods">Intrinsic mathematical methods</a>:</td><td> </td><td align="left" valign="top">
</td></tr>
<tr><td align="left" valign="top">• <a href="#Operator-precedence-and-associativity">Operator precedence and associativity </a>:</td><td> </td><td align="left" valign="top">
</td></tr>
<tr><td align="left" valign="top">• <a href="#ID-Quoting">ID Quoting</a>:</td><td> </td><td align="left" valign="top">
</td></tr>
</table>
<a name="att_prp"></a> <!-- http://nco.sf.net/nco.html#att_prp --><p>Defining new variables in terms of existing variables is a powerful
feature of <code>ncap2</code>.
<a name="index-derived-fields-1"></a>
Derived fields inherit the metadata (i.e., attributes) of their
ancestors, if any, in the script or input file.
When the derived field is completely new (no identically-named ancestors
exist), then it inherits the metadata (if any) of the left-most variable
on the right hand side of the defining expression.
This metadata inheritance is called <em>attribute propagation</em>.
Attribute propagation is intended to facilitate well-documented
data analysis, and we welcome suggestions to improve this feature.
</p>
<p>The only exception to this rule of attribute propagation is in cases of
left hand casting (see <a href="#Left-hand-casting">Left hand casting</a>).
The user must manually define the proper metadata for variables defined
using left hand casting.
</p>
<a name="syn"></a> <!-- http://nco.sf.net/nco.html#syn --><hr>
<a name="Syntax-of-ncap2-statements"></a>
<div class="header">
<p>
Next: <a href="#Expressions" accesskey="n" rel="next">Expressions</a>, Previous: <a href="#ncap2-netCDF-Arithmetic-Processor" accesskey="p" rel="previous">ncap2 netCDF Arithmetic Processor</a>, Up: <a href="#ncap2-netCDF-Arithmetic-Processor" accesskey="u" rel="up">ncap2 netCDF Arithmetic Processor</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#General-Index" title="Index" rel="index">Index</a>]</p>
</div>
<a name="Syntax-of-ncap2-statements-1"></a>
<h4 class="subsection">4.1.1 Syntax of <code>ncap2</code> statements</h4>
<a name="index-statement"></a>
<a name="index-syntax"></a>
<p>Mastering <code>ncap2</code> is relatively simple.
Each valid statement <var>statement</var> consists of standard forward
algebraic expression.
The <samp>fl.nco</samp>, if present, is simply a list of such statements,
whitespace, and comments.
<a name="index-C-language-4"></a>
The syntax of statements is most like the computer language C<!-- /@w -->.
The following characteristics of C<!-- /@w --> are preserved:
</p><dl compact="compact">
<dt>Array syntax</dt>
<dd><a name="index-array-syntax"></a>
<a name="index-_005b_005d-_0028array-delimiters_0029"></a>
<p>Arrays elements are placed within <code>[]</code> characters;
</p></dd>
<dt>Array indexing</dt>
<dd><a name="index-array-indexing"></a>
<p>Arrays are 0-based;
</p></dd>
<dt>Array storage</dt>
<dd><a name="index-array-storage"></a>
<p>Last dimension is most rapidly varying;
</p></dd>
<dt>Assignment statements</dt>
<dd><a name="index-assignment-statement"></a>
<a name="index-semi_002dcolon"></a>
<a name="index-_003b-_0028end-of-statement_0029"></a>
<p>A semi<!-- /@w -->-colon ‘<samp>;</samp>’ indicates the end of an assignment statement.
</p></dd>
<dt>Comments</dt>
<dd><a name="index-comments"></a>
<a name="index-_002f_002a_002e_002e_002e_002a_002f-_0028comment_0029"></a>
<a name="index-_002f_002f-_0028comment_0029"></a>
<p>Multi-line comments are enclosed within <code>/* */</code> characters.
Single line comments are preceded by <code>//</code> characters.
</p></dd>
<dt>Nesting</dt>
<dd><a name="index-including-files"></a>
<a name="index-nesting"></a>
<a name="index-_0023include"></a>
<p>Files may be nested in scripts using <code>#include <var>script</var></code>.
Note that the <code>#include</code> command is not followed by a semi-colon
because it is a pre-processor directive, not an assignment statement.
The filename <samp>script</samp> is interpreted relative to the run directory.
</p></dd>
<dt>Attribute syntax</dt>
<dd><a name="index-attribute-syntax"></a>
<a name="index-_0040-_0028attribute_0029"></a>
<p>The at-sign <code>@</code> is used to delineate an attribute name from a
variable name.
</p></dd>
</dl>
<a name="ncap_xpr"></a> <!-- http://nco.sf.net/nco.html#ncap_xpr --><hr>
<a name="Expressions"></a>
<div class="header">
<p>
Next: <a href="#Dimensions" accesskey="n" rel="next">Dimensions</a>, Previous: <a href="#Syntax-of-ncap2-statements" accesskey="p" rel="previous">Syntax of ncap2 statements</a>, Up: <a href="#ncap2-netCDF-Arithmetic-Processor" accesskey="u" rel="up">ncap2 netCDF Arithmetic Processor</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#General-Index" title="Index" rel="index">Index</a>]</p>
</div>
<a name="index-expressions"></a>
<a name="Expressions-1"></a>
<h4 class="subsection">4.1.2 Expressions</h4>
<p>Expressions are the fundamental building block of <code>ncap2</code>.
Expressions are composed of variables, numbers, literals, and
attributes.
<a name="index-C-language-5"></a>
The following C operators<!-- /@w --> are “overloaded” and work with scalars
and multi-dimensional arrays:
</p><div class="example">
<pre class="example">Arithmetic Operators: * / % + - ^
Binary Operators: > >= < <= == != == || && >> <<
Unary Operators: + - ++ -- !
Conditional Operator: exp1 ? exp2 : exp3
Assign Operators: = += -= /= *=
</pre></div>
<p>In the following section a <em>variable</em> also refers to a
number literal which is read in as a scalar variable:
</p>
<p><strong>Arithmetic and Binary Operators </strong>
</p>
<p>Consider <em>var1 ’op’ var2</em>
</p>
<p><strong>Precision</strong>
</p><ul>
<li> When both operands are variables, the result has the precision of the higher precision operand.
</li><li> When one operand is a variable and the other an attribute, the result has the precision of the variable.
</li><li> When both operands are attributes, the result has the precision of the more precise attribute.
</li><li> The exponentiation operator “^” is an exception to the above rules.
When both operands have type less than <code>NC_FLOAT</code>, the result is <code>NC_FLOAT</code>.
When either type is <code>NC_DOUBLE</code>, the result is also <code>NC_DOUBLE</code>.
</li></ul>
<a name="index-broadcasting-variables"></a>
<a name="index-rank"></a>
<p><strong>Rank</strong>
</p><ul>
<li> The Rank of the result is generally equal to Rank of the operand
that has the greatest number of dimensions.
</li><li> If the dimensions in var2 are a subset of the dimensions in var1
then its possible to make var2 conform to var1 through broadcasting and
or dimension reordering.
</li><li> Broadcasting a variable means creating data in non-existing
dimensions by copying data in existing dimensions.
</li><li> More specifically: If the numbers of dimensions in var1 is greater
than or equal to the number of dimensions in var2 then an attempt is
made to make var2 conform to var1 ,else var1 is made to conform to
var2. If conformance is not possible then an error message will be
emitted and script execution will cease.<br>
</li></ul>
<p>Even though the logical operators return True(1) or False(0)
they are treated in the same way as the arithmetic operators with regard
to precision and rank.<br>
Examples:
</p>
<div class="example">
<pre class="example">dimensions: time=10, lat=2, lon=4
Suppose we have the two variables:
double P(time,lat,lon);
float PZ0(lon,lat); // PZ0=1,2,3,4,5,6,7,8;
Consider now the expression:
PZ=P-PZ0
PZ0 is made to conform to P and the result is
PZ0 =
1,3,5,7,2,4,6,8,
1,3,5,7,2,4,6,8,
1,3,5,7,2,4,6,8,
1,3,5,7,2,4,6,8,
1,3,5,7,2,4,6,8,
1,3,5,7,2,4,6,8,
1,3,5,7,2,4,6,8,
1,3,5,7,2,4,6,8,
1,3,5,7,2,4,6,8,
1,3,5,7,2,4,6,8,
Once the expression is evaluated then PZ will be of type double;
Consider now
start=four-att_var@double_att; // start =-69 and is of type intger;
four_pow=four^3.0f // four_pow=64 and is of type float
three_nw=three_dmn_var_sht*1.0f; // type is now float
start@n1=att_var@short_att*att_var@int_att;
// start@n1=5329 and is type int
</pre></div>
<p><strong>Binary Operators</strong> <br>
<a name="index-binary-Operators"></a>
Unlike C the binary operators return an array of values.
There is no such thing as short circuiting with the AND/OR operators.
Missing values are carried into the result in the same way they are with
the arithmetic operators.
When an expression is evaluated in an if() the missing values are
treated as true.<br>
The binary operators are, in order of precedence:
</p><div class="example">
<pre class="example">
! Logical Not
----------------------------
<< Less Than Selection
>> Greater Than Selection
----------------------------
> Greater than
>= Greater than or equal to
< Less than
<= Less than or equal to
----------------------------
== Equal to
!= Not equal to
----------------------------
&& Logical AND
----------------------------
|| Logical OR
----------------------------
</pre></div>
<p>To see all operators: see <a href="#Operator-precedence-and-associativity">Operator precedence and associativity</a>
Examples:
</p><div class="example">
<pre class="example">tm1=time>2 && time <7; // tm1=0, 0, 1, 1, 1, 1, 0, 0, 0, 0 double
tm2=time==3 || time>=6; // tm2=0, 0, 1, 0, 0, 1, 1, 1, 1, 1 double
tm3=int(!tm1); // tm3=1, 1, 0, 0, 0, 0, 1, 1, 1, 1 int
tm4=tm1 && tm2; // tm4=0, 0, 1, 0, 0, 1, 0, 0, 0, 0 double
tm5=!tm4; // tm5=1, 1, 0, 1, 1, 0, 1, 1, 1, 1 double
</pre></div>
<p><strong>Regular Assign Operator</strong><br>
<em>var1 ’=’ exp1</em> <br>
If var1 does not already exist in Output then var1 is written to Output with the values and dimensions from expr1. If var1 already exists in Output, then the only requirement on expr1 is that the number of elements must match the number already on disk. The type of expr1 is converted if necessary to the disk type.
</p>
<p><strong> Other Assign Operators +=,-=,*=./= </strong><br>
<em>var1 ’ass_op’ exp1 </em><br>
if exp1 is a variable and it doesn’t conform to var1 then an attempt is made to make it conform to var1. If exp1 is an attribute it must have unity size or else have the same number of elements as var1. If expr1 has a different type to var1 the it is converted to the var1 type.
</p><div class="example">
<pre class="example">z1=four+=one*=10 // z1=14 four=14 one=10;
time-=2 // time= -1,0,1,2,3,4,5,6,7,8
</pre></div>
<p><strong>Increment/ Decrement Operators <br> </strong>
These work in a similar fashion to their regular C counterparts. If say the variable "four" is input only then the statement "++four" effectively means -read four from input increment each element by one , then write the new values to Output;
</p>
<p>Example:
</p><div class="example">
<pre class="example">n2=++four; n2=5, four=5
n3=one--+20; n3=21 one=0;
n4=--time; n4=time=0.,1.,2.,3.,4.,5.,6.,7.,8.,9.;
</pre></div>
<p><strong>Conditional Operator ?: </strong> <br>
<a name="index-conditional-Operator"></a>
<em>exp1 ? exp2 : exp3 </em> <br>
The conditional operator (or ternary Operator) is a succinct way
of writing an if/then/else. If exp1 evaluates to true then exp2 is
returned else exp3 is returned.
</p>
<p>Example:
</p><div class="example">
<pre class="example">weight_avg=weight.avg();
weight_avg@units= (weight_avg == 1 ? "kilo" : "kilos");
PS_nw=PS-(PS.min() > 100000 ? 100000 : 0);
</pre></div>
<a name="clp"></a> <!-- http://nco.sf.net/nco.html#clp -->
<a name="clipping"></a> <!-- http://nco.sf.net/nco.html#clipping --><p><strong>Clipping Operators</strong>
<a name="index-clipping-operators"></a>
</p><dl compact="compact">
<dt><< Less-than Clipping<br></dt>
<dd><p>For arrays, the less-than selection operator selects all values in the
left operand that are less than the corresponding value in the right
operand.
If the value of the left side is greater than or equal to the
corresponding value of the right side, then the right side value is
placed in the result
</p></dd>
<dt>>> Greater-than Clipping<br></dt>
<dd><p>For arrays, the greater-than selection operator selects all values in
the left operand that are greater than the corresponding value in the
right operand.
If the value of the left side is less than or equal to the corresponding
value of the right side, then the right side value is placed in the
result.
</p></dd>
</dl>
<p>Example:
</p><div class="example">
<pre class="example">RDM2=RDM >> 100.0 // 100,100,100,100,126,126,100,100,100,100 double
RDM2=RDM << 90s // 1, 9, 36, 84, 90, 90, 84, 36, 9, 1 int
</pre></div>
<a name="ncap_dims"></a> <!-- http://nco.sf.net/nco.html#ncap_dims -->
<a name="defdim"></a> <!-- http://nco.sf.net/nco.html#defdim --><hr>
<a name="Dimensions"></a>
<div class="header">
<p>
Next: <a href="#Left-hand-casting" accesskey="n" rel="next">Left hand casting</a>, Previous: <a href="#Expressions" accesskey="p" rel="previous">Expressions</a>, Up: <a href="#ncap2-netCDF-Arithmetic-Processor" accesskey="u" rel="up">ncap2 netCDF Arithmetic Processor</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#General-Index" title="Index" rel="index">Index</a>]</p>
</div>
<a name="Dimensions-1"></a>
<h4 class="subsection">4.1.3 Dimensions</h4>
<a name="index-defining-dimensions-in-ncap2"></a>
<a name="index-defdim_0028_0029"></a>
<p>Dimensions are defined in Output using the <code>defdim()</code> function.
</p><div class="example">
<pre class="example">defdim("cnt",10);
</pre></div>
<p>This dimension name must then be prefixed with a dollar-sign ‘<samp>$</samp>’
when referred to in method arguments or left-hand-casting, e.g.,
</p><div class="example">
<pre class="example">new_var[$cnt]=time;
temperature[$time,$lat,$lon]=35.5;
temp_avg=temperature.avg($time);
</pre></div>
<p>The <code>size</code> method allows the dimension size to be used in an
arithmetic expression:
</p><div class="example">
<pre class="example">time_avg=time.total() / $time.size;
</pre></div>
<p>Increase the size of a new variable by one and set new member to zero:
</p><div class="example">
<pre class="example">defdim("cnt_new",$cnt.size+1);
new_var[$cnt_new]=0.0;
new_var(0:($cnt_new.size-2))=old_var;
</pre></div>
<p><strong>Dimension Abbreviations <br></strong>
It is possible to use dimension abbreviations as method arguments:<br>
<code>$0</code> is the first dimension of a variable<br>
<code>$1</code> is the second dimension of a variable<br>
<code>$n</code> is the n+1 dimension of a variable<br>
</p>
<div class="example">
<pre class="example">float four_dmn_rec_var(time,lat,lev,lon);
double three_dmn_var_dbl(time,lat,lon);
four_nw=four_dmn_rev_var.reverse($time,$lon)
four_nw=four_dmn_rec_var.reverse($0,$3);
four_avg=four_dmn_rec_var.avg($lat,$lev);
four_avg=four_dmn_rec_var.avg($1,$2);
three_mw=three_dmn_var_dbl.permute($time,$lon,$lat);
three_mw=three_dmn_var_dbl.permute($0,$2,$1);
</pre></div>
<p><strong>ID Quoting <br></strong>
If the dimension name contains non-regular characters use ID quoting.
See see <a href="#ID-Quoting">ID Quoting</a>
</p><div class="example">
<pre class="example">defdim("a--list.A",10);
A1['$a--list.A']=30.0;
</pre></div>
<p><strong>GOTCHA <br></strong>
It is not possible to manually define in Output any dimensions that exist in Input. When a variable from Input appears in an expression or statement its dimensions in Input are automagically copied to Output (if they are not already present)
</p>
<a name="lhc"></a> <!-- http://nco.sf.net/nco.html#lhc -->
<a name="lhs"></a> <!-- http://nco.sf.net/nco.html#lhs --><hr>
<a name="Left-hand-casting"></a>
<div class="header">
<p>
Next: <a href="#Arrays-and-hyperslabs" accesskey="n" rel="next">Arrays and hyperslabs</a>, Previous: <a href="#Dimensions" accesskey="p" rel="previous">Dimensions</a>, Up: <a href="#ncap2-netCDF-Arithmetic-Processor" accesskey="u" rel="up">ncap2 netCDF Arithmetic Processor</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#General-Index" title="Index" rel="index">Index</a>]</p>
</div>
<a name="Left-hand-casting-1"></a>
<h4 class="subsection">4.1.4 Left hand casting</h4>
<a name="index-hybrid-coordinate-system"></a>
<a name="index-left-hand-casting-1"></a>
<a name="index-LHS"></a>
<p>The following examples demonstrate the utility of the
<em>left hand casting</em> ability of <code>ncap2</code>.
Consider first this simple, artificial, example.
If <var>lat</var> and <var>lon</var> are one dimensional coordinates of
dimensions <var>lat</var> and <var>lon</var>, respectively, then addition
of these two one-dimensional arrays is intrinsically ill-defined because
whether <var>lat_lon</var> should be dimensioned <var>lat</var> by <var>lon</var>
or <var>lon</var> by <var>lat</var> is ambiguous (assuming that addition is to
remain a <em>commutative</em> procedure, i.e., one that does not depend on
the order of its arguments).
Differing dimensions are said to be <em>orthogonal</em> to one another,
and sets of dimensions which are mutually exclusive are orthogonal
as a set and any arithmetic operation between variables in orthogonal
dimensional spaces is ambiguous without further information.
</p>
<p>The ambiguity may be resolved by enumerating the desired dimension
ordering of the output expression inside square brackets on the
left hand side (<acronym>LHS</acronym>) of the equals sign.
This is called <em>left hand casting</em> because the user resolves the
dimensional ordering of the <acronym>RHS</acronym> of the expression by
specifying the desired ordering on the <acronym>LHS</acronym>.
</p><div class="example">
<pre class="example">ncap2 -s 'lat_lon[lat,lon]=lat+lon' in.nc out.nc
ncap2 -s 'lon_lat[lon,lat]=lat+lon' in.nc out.nc
</pre></div>
<p>The explicit list of dimensions on the <acronym>LHS</acronym>, <code>[lat,lon]</code>
resolves the otherwise ambiguous ordering of dimensions in
<var>lat_lon</var>.
In effect, the <acronym>LHS</acronym> <em>casts</em> its rank properties onto the
<acronym>RHS</acronym>.
Without <acronym>LHS</acronym> casting, the dimensional ordering of <var>lat_lon</var>
would be undefined and, hopefully, <code>ncap2</code> would print an error
message.
</p>
<p>Consider now a slightly more complex example.
In geophysical models, a coordinate system based on
a blend of terrain-following and density-following surfaces is
called a <em>hybrid coordinate system</em>.
In this coordinate system, four variables must be manipulated to
obtain the pressure of the vertical coordinate:
<var>PO</var> is the domain-mean surface pressure offset (a scalar),
<var>PS</var> is the local (time-varying) surface pressure (usually two
horizontal spatial dimensions, i.e. latitude by longitude), <var>hyam</var>
is the weight given to surfaces of constant density (one spatial
dimension, pressure, which is orthogonal to the horizontal
dimensions), and <var>hybm</var> is the weight given to surfaces of
constant elevation (also one spatial dimension).
This command constructs a four-dimensional pressure <code>prs_mdp</code>
from the four input variables of mixed rank and orthogonality:
</p><div class="example">
<pre class="example">ncap2 -s 'prs_mdp[time,lat,lon,lev]=P0*hyam+PS*hybm' in.nc out.nc
</pre></div>
<p>Manipulating the four fields which define the pressure in a hybrid
coordinate system is easy with left hand casting.
</p>
<a name="ncap_arr"></a> <!-- http://nco.sf.net/nco.html#ncap_arr --><hr>
<a name="Arrays-and-hyperslabs"></a>
<div class="header">
<p>
Next: <a href="#Attributes" accesskey="n" rel="next">Attributes</a>, Previous: <a href="#Left-hand-casting" accesskey="p" rel="previous">Left hand casting</a>, Up: <a href="#ncap2-netCDF-Arithmetic-Processor" accesskey="u" rel="up">ncap2 netCDF Arithmetic Processor</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#General-Index" title="Index" rel="index">Index</a>]</p>
</div>
<a name="Arrays-and-hyperslabs-1"></a>
<h4 class="subsection">4.1.5 Arrays and hyperslabs</h4>
<a name="index-array"></a>
<a name="index-array-function"></a>
<a name="index-arrays"></a>
<a name="index-findgen_002dequivalent"></a>
<a name="index-indgen_002dequivalent"></a>
<p>Generating a regularly spaced one-dimensional array with <code>ncap2</code>
is simple with the <code>array()</code> function.
The syntax is
</p><div class="example">
<pre class="example">var_out=array(val_srt,val_ncr,$dmn_nm); // One-dimensional output
var_out=array(val_srt,val_ncr,var_tpl); // Multi-dimensional output
</pre></div>
<p>where the arguments are the starting value <var>val_srt</var>,
incremental value <var>val_ncr</var>, and, for one-dimensional output, the
single dimension <code>$dmn_nm</code>, or, for multi-dimensional output, a
template variable <code>var_tpl</code>, i.e., a variable with the same shape
as the desired output.
The type of <code>var_out</code> will be the same as <code>val_srt</code>.
Be sure to encode this type with the appropriate decimal point
and floating point suffix when <code>val_srt</code> is a “naked constant”
rather than a variable.
For example, to produce an array of shorts (signed two-byte integers),
integers (signed four-byte integers), unsigned 64-bit integers,
floats, or doubles use
</p><div class="example">
<pre class="example">var_out=array(1s,val_ncr,$dmn_nm); // NC_SHORT array
var_out=array(1,val_ncr,$dmn_nm); // NC_INT array
var_out=array(1ull,val_ncr,$dmn_nm); // NC_UINT64 array
var_out=array(1f,val_ncr,$dmn_nm); // NC_FLOAT array
var_out=array(1.,val_ncr,$dmn_nm); // NC_DOUBLE array
</pre></div>
<p>Once the associated dimensions have been defined, the start and
increment arguments may be supplied as values, mathmatical expressions,
or variables:
</p><div class="example">
<pre class="example">var_out=array(1,1,$time); // 1,2,3,4,5,6,7,8,9,10
var_out=array(1+2-2,one,$time); // 1,2,3,4,5,6,7,8,9,10
var_out=array(1,2,three_dmn_rec_var); // 1,3,5,...155,157,159
</pre></div>
<a name="index-hyperslabs"></a>
<p>Hyperslabs in <code>ncap2</code> are more limited than hyperslabs with the
other <acronym>NCO</acronym> operators.
<code>ncap2</code> does not understand the shell command-line syntax
used to specify multi-slabs, wrapped co-ordinates, negative stride or
coordinate value limits.
However with a bit of syntactic magic they are all are possible.
<code>ncap2</code> accepts (in fact, it requires) <var>N</var>-hyperslab
arguments for a variable of rank <var>N</var>:
</p><div class="example">
<pre class="example">var1(arg1,arg2 ... argN);
</pre></div>
<p>where each hyperslab argument is of the form
</p><div class="example">
<pre class="example">start:end:stride
</pre></div>
<p>and the arguments for different dimensions are separated by commas.
If "start" is omitted, it defaults to 0.
If "end" is omitted, it defaults to dimension size minus one.
If "stride" is omitted, it defaults to 1.
</p><br>
<p>If a single value is present then it is assumed that that
dimension collapses to a single value (i.e., a cross-section).
The number of hyperslab arguments MUST equal the variable’s rank.
</p><br>
<p><strong>Hyperslabs on the Right Hand Side of an assign<br></strong>
</p>
<p>A simple 1D example:
</p><div class="example">
<pre class="example">($time.size=10)
od[$time]={20,22,24,26,28,30,32,34,36,38};
od(7); // 34
od(7:); // 34,36,38
od(:7); // 20,22,24,26,28,30,32,34
od(::4); // 20,28,36
od(1:6:2) // 22,26,30
od(:) // 20,22,24,26,28,30,32,34,36,38
</pre></div>
<p>A more complex three dimensional example:
</p><div class="example">
<pre class="example">($lat.size=2,$lon.size=4)
th[$time,$lat,$lon]=
{1, 2, 3, 4, 5, 6, 7, 8,
9,10,11,12,13,14,15,16,
17,18,19,20,21,22,23,24,
-99,-99,-99,-99,-99,-99,-99,-99,
33,34,35,36,37,38,39,40,
41,42,43,44,45,46,47,48,
49,50,51,52,53,54,55,56,
-99,58,59,60,61,62,63,64,
65,66,67,68,69,70,71,72,
-99,74,75,76,77,78,79,-99 };
th(1,1,3); // 16
th(2,0,:); // 17, 18, 19, 20
th(:,1,3); // 8, 16, 24, -99, 40, 48, 56, 64, 72, -99
th(::5,:,0:3:2); // 1, 3, 5, 7, 41, 43, 45, 47
</pre></div>
<p>If hyperslab arguments collapse to a single value (a cross-section has
been specified), then that dimension is removed from the returned
variable.
If all the values collapse then a scalar variable is returned.
So, for example, the following is valid:
</p><div class="example">
<pre class="example">th_nw=th(0,:,:)+th(9,:,:);
// th_nw has dimensions $lon,$lat
// NB: the time dimension has become degenerate
</pre></div>
<p>The following is invalid:
</p><div class="example">
<pre class="example">th_nw=th(0,:,0:1)+th(9,:,0:1);
</pre></div>
<p>because the <code>$lon</code> dimension now only has two elements.
The above can be calculated by using a LHS cast with
<code>$lon_nw</code> as replacement dim for <code>$lon</code>:
</p><div class="example">
<pre class="example">defdim("lon_nw",2);
th_nw[$lat,$lon_nw]=th(0,:,0:1) +th(9,:,0:1);
</pre></div>
<p><strong>Hyperslabs on the Left Hand Side of an assign<br></strong>
When hyperslabing on the LHS, the expression on the RHS must
evaluate to a scalar or a variable/attribute with the same number of
elements as the LHS hyperslab.
Set all elements of the last record to zero:
</p><div class="example">
<pre class="example">th(9,:,:)=0.0;
</pre></div>
<p>Set first element of each lon element to 1.0:
</p><div class="example">
<pre class="example">th(:,:,0)=1.0;
</pre></div>
<p>One may hyperslab on both sides of an assign.
For example, this sets the last record to the first record:
</p><div class="example">
<pre class="example">th(9,:,:)=th(0,:,:);
</pre></div>
<p>Say <var>th0</var> represents pressure at height=0 and
<var>th1</var> represents pressure at height=1.
Then it is possible to insert these hyperslabs into the records
</p><div class="example">
<pre class="example">prs[$time,$height,$lat,$lon]=0.0;
prs(:,0,:,:)=th0;
prs(:,1,:,:)=th1
</pre></div>
<p><strong>Reverse method</strong><br>
<a name="index-reverse_0028_0029"></a>
Use the <code>reverse()</code> method to reverse a dimension’s elements in a
variable with at least one dimension.
This is equivalent to a negative stride, e.g.,
</p><div class="example">
<pre class="example">th_rv=th(1 ,:,:).reverse($lon); // {12,11,10,9 }, {16,15,14,13}
od_rv=od.reverse($time); // {38,36,34,32,30,28,26,24,22,20}
</pre></div>
<p><strong>Permute method</strong>p<br>
<a name="index-permute_0028_0029"></a>
Use the <code>permute()</code> method to swap the dimensions of a variable.
The number and names of dimension arguments must match the dimensions in
the variable.
If the first dimension in the variable is of record type then this must
remain the first dimension.
If you want to change the record dimension then consider using
<code>ncpdq</code>.
</p>
<p>Consider the variable:
</p><div class="example">
<pre class="example">float three_dmn_var(lat,lev,lon);
three_dmn_var_prm=three_dmn_var.permute($lon,$lat,$lev);
// The permuted values are
three_dmn_var_prm=
0,4,8,
12,16,20,
1,5,9,
13,17,21,
2,6,10,
14,18,22,
3,7,11,
15,19,23;
</pre></div>
<a name="ncap_att"></a> <!-- http://nco.sf.net/nco.html#ncap_att --><hr>
<a name="Attributes"></a>
<div class="header">
<p>
Next: <a href="#Number-literals" accesskey="n" rel="next">Number literals</a>, Previous: <a href="#Arrays-and-hyperslabs" accesskey="p" rel="previous">Arrays and hyperslabs</a>, Up: <a href="#ncap2-netCDF-Arithmetic-Processor" accesskey="u" rel="up">ncap2 netCDF Arithmetic Processor</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#General-Index" title="Index" rel="index">Index</a>]</p>
</div>
<a name="Attributes-1"></a>
<h4 class="subsection">4.1.6 Attributes</h4>
<a name="index-attributesncap2"></a>
<p>Attributes are referred to by <em>var_nm@att_nm</em> <br>
All the following are valid statements:
</p><div class="example">
<pre class="example">global@text="Test Attributes"; /* Assign a global variable attribute */
a1[$time]=time*20;
a1@long_name="Kelvin";
a1@min=a1.min();
a1@max=a1.max();
a1@min++;
--a1@max; q
a1(0)=a1@min;
a1($time.size-1)=a1@max;
</pre></div>
<p>A <em>value list</em> can be used on the RHS of an assign...
<a name="index-value-list"></a>
</p><div class="example">
<pre class="example">a1@trip1={1,2,3} ;
a1@triplet={a1@min,(a1@min+a1@max)/2,a1@max};
</pre></div>
<p>The netCDF specification allows all attribute types to have a size
greater than one.
The maximum is defined by <code>NC_MAX_ATTRS</code>.
The following is an <code>ncdump</code> of the metadata for variable <var>a1</var>
</p><div class="example">
<pre class="example">double a1(time) ;
a1:long_name = "Kelvin" ;
a1:max = 199. ;
a1:min = 21. ;
a1:trip1 = 1, 2, 3 ;
a1:triplet = 21., 110., 199. ;
</pre></div>
<p>The <code>size()</code> method can be used with attributes.
For example, to save an attribute text string in a variable,
</p><div class="example">
<pre class="example">defdim("sng_len", a1@long_name.size());
sng_arr[$sng_len]=a1@long_name; // sng_arr now contains "Kelvin"
</pre></div>
<p>Attributes defined in a script are stored in memory and are written to Output after script completion.
To stop the attribute being written use the ram_delete() method or use a bogus variable name.
</p>
<p><strong>Attribute Propagation and Inheritance</strong>
<a name="index-attribute-propagation"></a>
<a name="index-attribute-inheritance"></a>
</p><ul>
<li> Attribute propagation occurs in a regular assign statement. The variable being defined on the LHS gets copies of the attributes from the leftermost variable on the RHS
</li><li> Attribute Inheritance: The LHS variable "inherits" attributes from an Input variable with the same name
</li><li> It is possible to have a regular assign statement for which both propagation and inheritance occur.
</li></ul>
<div class="example">
<pre class="example">// prs_mdp inherits attributes from P0:
prs_mdp[time,lat,lon,lev]=P0*hyam+hybm*PS;
// th_min inherits attributes from three_dmn_var_dbl:
th_min=1.0 + 2*three_dmn_var_dbl.min($time);
</pre></div>
<p>If the attribute name contains non-regular characters use ID quoting. See see <a href="#ID-Quoting">ID Quoting</a>
</p><div class="example">
<pre class="example">'b..m1@c--lost'=23;
</pre></div>
<a name="ncap_num"></a> <!-- http://nco.sf.net/nco.html#ncap_num --><hr>
<a name="Number-literals"></a>
<div class="header">
<p>
Next: <a href="#if-statement" accesskey="n" rel="next">if statement</a>, Previous: <a href="#Attributes" accesskey="p" rel="previous">Attributes</a>, Up: <a href="#ncap2-netCDF-Arithmetic-Processor" accesskey="u" rel="up">ncap2 netCDF Arithmetic Processor</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#General-Index" title="Index" rel="index">Index</a>]</p>
</div>
<a name="Number-literals-1"></a>
<h4 class="subsection">4.1.7 Number literals</h4>
<a name="index-number-literals-ncap2"></a>
<p>The table below lists the postfix character(s) to add to a number
literal for type cohesion.
To use the new netCDF4 types <acronym>NCO</acronym> must be compiled/linked to
the netCDF4 library and the output file must be <acronym>HDF5</acronym>.
</p>
<div class="example">
<pre class="example">n1[$time]=1UL; // n1 will now by type <code>NC_UINT</code>
n2[$lon]=4b; // n2 will be of type <code>NC_BYTE</code>
n3[$lat]=5ull; // n3 will be of type <code>NC_UINT64</code>
n3@a1=6.0d; // attribute will be type <code>NC_DOUBLE</code>
n3@a2=-666L; // attribute will be type <code>NC_INT</code>
</pre></div>
<p>A floating point number without a postfix will default to
<code>NC_DOUBLE</code>.
An integer without a postfix will default to type <code>NC_INT</code>.
There is no postfix for characters, use a quoted string instead.
</p><div class="example">
<pre class="example">n4[$rlev]=0.1 // n4 will be of type <code>NC_DOUBLE</code>
n5[$lon_grd]=2.0 // n5 will be of type <code>NC_DOUBLE</code>
n6[$gds_crd]=2e3; // n6 will be of type <code>NC_DOUBLE</code>
n7[$gds_crd]=2e3f; // n7 will be of type <code>NC_FLOAT</code>
n6@a1=41; // attribute will be type <code>NC_INT</code>
n6@a2=-21; // attribute will be type <code>NC_INT</code>
n6@units="kelvin" // attribute will be type <code>NC_CHAR</code>
</pre></div>
<dl compact="compact">
<dt><strong>netCDF3/4 Types</strong></dt>
<dt>b|B</dt>
<dd><p><code>NC_BYTE</code>, a signed 1-byte integer
</p></dd>
<dt>none</dt>
<dd><p><code>NC_CHAR</code>, an ISO/ASCII character
</p></dd>
<dt>s|S</dt>
<dd><p><code>NC_SHORT</code>, a signed 2-byte integer
</p></dd>
<dt>l|L</dt>
<dd><p><code>NC_INT</code>, a signed 4-byte integer
</p></dd>
<dt>f|F</dt>
<dd><p><code>NC_FLOAT</code>, a single-precision (4-byte) floating point number
</p></dd>
<dt>d|D</dt>
<dd><p><code>NC_DOUBLE</code>, a double-precision (8-byte) floating point number
</p></dd>
<dt><strong>netCDF4 Types</strong></dt>
<dt>ub|UB</dt>
<dd><p><code>NC_UBYTE</code>, an unsigned 1-byte integer
</p></dd>
<dt>us|US</dt>
<dd><p><code>NC_USHORT</code>, an unsigned 2-byte integer
</p></dd>
<dt>u|U|ul|UL</dt>
<dd><p><code>NC_UINT</code>, an unsigned 4-byte integer
</p></dd>
<dt>ll|LL</dt>
<dd><p><code>NC_INT64</code>, a signed 8-byte integer
</p></dd>
<dt>ull|ULL</dt>
<dd><p><code>NC_UINT64</code>, an unsigned 8-byte integer
</p></dd>
</dl>
<a name="ncap_if"></a> <!-- http://nco.sf.net/nco.html#ncap_if --><hr>
<a name="if-statement"></a>
<div class="header">
<p>
Next: <a href="#print-statement" accesskey="n" rel="next">print statement</a>, Previous: <a href="#Number-literals" accesskey="p" rel="previous">Number literals</a>, Up: <a href="#ncap2-netCDF-Arithmetic-Processor" accesskey="u" rel="up">ncap2 netCDF Arithmetic Processor</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#General-Index" title="Index" rel="index">Index</a>]</p>
</div>
<a name="if-statement-1"></a>
<h4 class="subsection">4.1.8 if statement</h4>
<a name="index-if_0028_0029"></a>
<p>The syntax of the if statement is similar to its C counterpart.
The <em>Conditional Operator (ternary operator)</em> has also been
implemented.
</p><div class="example">
<pre class="example">if(exp1)
stmt1;
else if(exp2)
stmt2;
else
stmt3;
# Can use code blocks as well:
if(exp1){
stmt1;
stmt1a;
stmt1b;
} else if(exp2)
stmt2;
else {
stmt3;
stmt3a;
stmt3b;
}
</pre></div>
<p>For a variable or attribute expression to be logically true
all its non-missing value elements must be logically true, i.e.,
non-zero.
The expression can be of any type.
Unlike C<!-- /@w --> there is no short-circuiting of an expression with the
OR (<code>||</code>) and AND (<code>&&</code>) operators.
The whole expression is evaluated regardless if one of the AND/OR
operands are True/False.
</p><div class="example">
<pre class="example"># Simple example
if(time>0)
print("All values of time are greater than zero\n");
else if( time<0)
print("All values of time are less than zero\n");
else {
time_max=time.max();
time_min=time.min();
print("min value of time=");print(time_min,"%f");
print("max value of time=");print(time_max,"%f");
}
# Example from ddra.nco
if(fl_typ==fl_typ_gcm){
var_nbr_apx=32;
lmn_nbr=1.0*var_nbr_apx*varsz_gcm_4D; /* [nbr] Variable size */
if(nco_op_typ==nco_op_typ_avg){
lmn_nbr_avg=1.0*var_nbr_apx*varsz_gcm_4D; // Block size
lmn_nbr_wgt=dmnsz_gcm_lat; /* [nbr] Weight size */
} // !nco_op_typ_avg
}else if(fl_typ==fl_typ_stl){
var_nbr_apx=8;
lmn_nbr=1.0*var_nbr_apx*varsz_stl_2D; /* [nbr] Variable size */
if(nco_op_typ==nco_op_typ_avg){
lmn_nbr_avg=1.0*var_nbr_apx*varsz_stl_2D; // Block size
lmn_nbr_wgt=dmnsz_stl_lat; /* [nbr] Weight size */
} // !nco_op_typ_avg
} // !fl_typ
</pre></div>
<p><strong>Conditional Operator <br></strong>
</p><div class="example">
<pre class="example">// netCDF4 needed for this example
th_nw=(three_dmn_var_sht >= 0 ? three_dmn_var_sht.uint() : \
three_dmn_var_sht.int());
</pre></div>
<a name="ncap_prn"></a> <!-- http://nco.sf.net/nco.html#ncap_prn --><hr>
<a name="print-statement"></a>
<div class="header">
<p>
Next: <a href="#Missing-values-ncap2" accesskey="n" rel="next">Missing values ncap2</a>, Previous: <a href="#if-statement" accesskey="p" rel="previous">if statement</a>, Up: <a href="#ncap2-netCDF-Arithmetic-Processor" accesskey="u" rel="up">ncap2 netCDF Arithmetic Processor</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#General-Index" title="Index" rel="index">Index</a>]</p>
</div>
<a name="print-statement-1"></a>
<h4 class="subsection">4.1.9 print statement</h4>
<a name="index-print_0028_0029-ncap2"></a>
<div class="example">
<pre class="example">print(variable_name/attribute name/string, format string);
</pre></div>
<p>The print function takes a variable name or attribute name or
a quoted string and prints the contents in a in a similar fashion to
<code>ncks -H</code>.
There is also an optional C-language style format string argument.
Currently the print function cannot print <acronym>RAM</acronym> variables or expressions
such as <code>'print(var_msk*3+4)'</code>.
To print an expression, first evaluate it as a non-<acronym>RAM</acronym> variable (so it
will be saved and can be printed), and then print the variable.
</p>
<p>examples
</p><div class="example">
<pre class="example">print(lon);
lon[0]=0
lon[1]=90
lon[2]=180
lon[3]=270
print(lon_2D_rrg,"%3.2f,");
0.00,0.00,180.00,0.00,180.00,0.00,180.00,0.00,
print(mss_val_fst@_FillValue);
mss_val_fst@_FillValue, size = 1 NC_FLOAT, value = -999
print("This function \t is monotonic\n");
This function is monotonic
</pre></div>
<a name="ncap_miss"></a> <!-- http://nco.sf.net/nco.html#ncap_miss --><hr>
<a name="Missing-values-ncap2"></a>
<div class="header">
<p>
Next: <a href="#Methods-and-functions" accesskey="n" rel="next">Methods and functions</a>, Previous: <a href="#print-statement" accesskey="p" rel="previous">print statement</a>, Up: <a href="#ncap2-netCDF-Arithmetic-Processor" accesskey="u" rel="up">ncap2 netCDF Arithmetic Processor</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#General-Index" title="Index" rel="index">Index</a>]</p>
</div>
<a name="Missing-values-ncap2-1"></a>
<h4 class="subsection">4.1.10 Missing values ncap2</h4>
<a name="index-missing-values-ncap2"></a>
<p>Missing values operate slightly differently in <code>ncap2</code>
Consider the expression where op is any of the following operators (excluding ’=’)
</p><div class="example">
<pre class="example">Arithmetic operators ( * / % + - ^ )
Binary Operators ( >, >= <, <= ==, !=,==,||,&&, >>,<< )
Assign Operators ( +=,-=,/=, *= )
var1 'op' var2
</pre></div>
<p>If var1 has a missing value then this is the value used in the
operation, otherwise the missing value for var2 is used.
If during the element-by-element operation an element from either
operand is equal to the missing value then the missing value is carried
through.
In this way missing values ’percolate’ or propagate through an
expression.<br>
Missing values associated with Output variables are stored in memory and
are written to disk after the script finishes.
During script execution its possible (and legal) for the missing value
of a variable to take on several different values.
</p><div class="example">
<pre class="example"># Consider the variable:
int rec_var_int_mss_val_int(time); =-999,2,3,4,5,6,7,8,-999,-999;
rec_var_int_mss_val_int:_FillValue = -999;
n2=rec_var_int_mss_val_int + rec_var_int_mss_val_int.reverse($time);
n2=-999,-999,11,11,11,11,11,11,999,-999;
</pre></div>
<a name="set_miss"></a> <!-- http://nco.sf.net/nco.html#set_miss -->
<a name="get_miss"></a> <!-- http://nco.sf.net/nco.html#get_miss -->
<a name="change_miss"></a> <!-- http://nco.sf.net/nco.html#change_miss -->
<a name="number_miss"></a> <!-- http://nco.sf.net/nco.html#number_miss --><p>The following methods manipulate missing value information associated
with a variable.
They only work on variables in Output.
</p><dl compact="compact">
<dt><code>set_miss(expr)</code></dt>
<dd><a name="index-set_005fmiss_0028_0029"></a>
<p>The numeric argument <var>expr</var> becomes the new missing value,
overwriting the old missing value, if any.
The argument given is converted if necessary to the variable type.
NB: This only changes the missing value attribute.
Missing values in the original variable remain unchanged, and thus
are no long considered missing values.
They are “orphaned”.
Thus <code>set_miss()</code> is normally used only when creating new
variables.
The intrinsic function <code>change_miss()</code> (see below) is typically
used to edit values of existing variables.
</p></dd>
<dt><code>change_miss(expr)</code></dt>
<dd><a name="index-change_005fmiss_0028_0029"></a>
<p>Sets or changes (any pre-existing) missing value attribute and missing
data values to <var>expr</var>.
NB: This is an expensive function since all values must be examined.
Use this function when changing missing values for pre-existing
variables.
</p></dd>
<dt><code>get_miss()</code></dt>
<dd><a name="index-get_005fmiss_0028_0029"></a>
<p>Returns the missing value of a variable.
If the variable exists in Input and Output then the missing value of
the variable in Output is returned.
If the variable has no missing value then an error is returned.
</p></dd>
<dt><code>delete_miss()</code></dt>
<dd><a name="index-delete_005fmiss_0028_0029"></a>
<p>Deletes the missing value associated with a variable.
</p></dd>
<dt><code>number_miss()</code></dt>
<dd><a name="index-number_005fmiss_0028_0029"></a>
<p>Counts the number of missing values a variable contains.
</p></dd>
</dl>
<div class="example">
<pre class="example">th=three_dmn_var_dbl;
th.change_miss(-1e10d);
/* Set values less than 0 or greater than 50 to missing value */
where(th < 0.0 || th > 50.0) th=th.get_miss();
# Another example:
new[$time,$lat,$lon]=1.0;
new.set_miss(-997.0);
// Extract only elements divisible by 3
where (three_dmn_var_dbl%3 == 0)
new=three_dmn_var_dbl;
elsewhere
new=new.get_miss();
// Print missing value and variable summary
mss_val_nbr=three_dmn_var_dbl.number_miss();
print(three_dmn_var_dbl@_FillValue);
print("Number of missing values in three_dmn_var_dbl: ");
print(mss_val_nbr,"%d");
print(three_dmn_var_dbl);
</pre></div>
<a name="ncap_mtd"></a> <!-- http://nco.sf.net/nco.html#ncap_mtd --><hr>
<a name="Methods-and-functions"></a>
<div class="header">
<p>
Next: <a href="#RAM-variables" accesskey="n" rel="next">RAM variables</a>, Previous: <a href="#Missing-values-ncap2" accesskey="p" rel="previous">Missing values ncap2</a>, Up: <a href="#ncap2-netCDF-Arithmetic-Processor" accesskey="u" rel="up">ncap2 netCDF Arithmetic Processor</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#General-Index" title="Index" rel="index">Index</a>]</p>
</div>
<a name="Methods-and-functions-1"></a>
<h4 class="subsection">4.1.11 Methods and functions</h4>
<p>The convention within this document is that methods can be used as
functions.
However, functions are not and cannot be used as methods.
Methods can be daisy-chained d and their syntax is cleaner than functions.
Method names are reserved words and CANNOT be used as variable names.
The command <code>ncap2 -f</code> shows the complete list of methods available
on your build.
</p><div class="example">
<pre class="example">n2=sin(theta)
n2=theta.sin()
n2=sin(theta)^2 + cos(theta)^2
n2=theta.sin().pow(2) + theta.cos()^2
</pre></div>
<p>This statement chains together methods to convert three_dmn_var_sht to
type double, average it, then convert this back to type short:
</p><div class="example">
<pre class="example">three_avg=three_dmn_var_sht.double().avg().short();
</pre></div>
<br>
<p><strong>Aggregate Methods <br></strong>
These methods mirror the averaging types available in <code>ncwa</code>. The arguments to the methods are the dimensions to average over. Specifying no dimensions is equivalent to specifying all dimensions i.e., averaging over all dimensions. A masking variable and a weighting variable can be manually created and applied as needed.
</p>
<dl compact="compact">
<dt><code>avg()</code></dt>
<dd><a name="index-avg_0028_0029"></a>
<p>Mean value
</p></dd>
<dt><code>sqravg()</code></dt>
<dd><a name="index-sqravg_0028_0029"></a>
<p>Square of the mean
</p></dd>
<dt><code>avgsqr()</code></dt>
<dd><p>Mean of sum of squares
</p></dd>
<dt><code>max()</code></dt>
<dd><a name="index-max_0028_0029"></a>
<p>Maximum value
</p></dd>
<dt><code>min()</code></dt>
<dd><a name="index-min_0028_0029"></a>
<p>Minimum value
</p></dd>
<dt><code>rms()</code></dt>
<dd><p>Root-mean-square (normalize by <var>N</var>)
</p></dd>
<dt><code>rmssdn()</code></dt>
<dd><a name="index-rmssdn_0028_0029"></a>
<p>Root-mean square (normalize by <var>N-1</var>)
</p></dd>
<dt><code>ttl() or total()</code></dt>
<dd><a name="index-ttl_0028_0029"></a>
<p>Sum of values
</p></dd>
</dl>
<div class="example">
<pre class="example">// Average a variable over time
four_time_avg=four_dmn_rec_var($time);
</pre></div>
<br>
<p><strong> Packing Methods <br> </strong>
For more information see see <a href="#Packed-data">Packed data</a> and see <a href="#ncpdq-netCDF-Permute-Dimensions-Quickly">ncpdq netCDF Permute Dimensions Quickly</a><br>
</p><dl compact="compact">
<dt><code>pack() & pack_short()</code></dt>
<dd><a name="index-pack_0028_0029"></a>
<p>The default packing algorithm is applied and variable is packed to <code>NC_SHORT</code>
</p></dd>
<dt><code>pack_byte()</code></dt>
<dd><a name="index-pack_005fbyte_0028_0029"></a>
<p>Variable is packed to <code>NC_BYTE</code>
</p></dd>
<dt><code>pack_short()</code></dt>
<dd><a name="index-pack_005fshort_0028_0029"></a>
<p>Variable is packed to <code>NC_SHORT</code>
</p></dd>
<dt><code>pack_int()</code></dt>
<dd><a name="index-pack_005fint_0028_0029"></a>
<p>Variable is packed to <code>NC_INT</code>
</p></dd>
<dt><code>unpack()</code></dt>
<dd><a name="index-unpack_0028_0029"></a>
<p>The standard unpacking algorithm is applied.
</p></dd>
</dl>
<p><strong>Basic Methods <br></strong>
These methods work with variables and attributes. They have no arguments
</p>
<dl compact="compact">
<dt><code>size()</code></dt>
<dd><a name="index-size_0028_0029"></a>
<p>Total number of elements
</p></dd>
<dt><code>ndims()</code></dt>
<dd><a name="index-ndims_0028_0029"></a>
<p>Number of dimensions in variable
</p></dd>
<dt><code>type()</code></dt>
<dd><a name="index-type_0028_0029"></a>
<p>Returns the netcdf type (see previous section)
</p></dd>
</dl>
<br>
<p><strong>Utility Methods <br></strong>
These functions are used to manipulate missing values and <acronym>RAM</acronym> variables.
see <a href="#Missing-values-ncap2">Missing values ncap2</a>
</p>
<dl compact="compact">
<dt><code>set_miss(expr)</code></dt>
<dd><p>Takes one argument the missing value. Sets or overwrites the existing missing value. The argument given is converted if necessary to the variable type
</p></dd>
<dt><code>change_miss(expr)</code></dt>
<dd><p>Changes the missing value elements of the variable to the new missing value (n.b. an expensive function).
</p></dd>
<dt><code>get_miss()</code></dt>
<dd><p>Returns the missing value of a variable in Input or Output
</p></dd>
<dt><code>delete_miss()</code></dt>
<dd><p>Deletes the missing value associated with a variable.
</p></dd>
<dt><code>ram_write()</code></dt>
<dd><p>Writes a <acronym>RAM</acronym> variable to disk i.e., converts it to a regular disk type variable
</p></dd>
<dt><code>ram_delete()</code></dt>
<dd><p>Deletes a <acronym>RAM</acronym> variable or an attribute
</p></dd>
</dl>
<br>
<p><strong>PDQ Methods <br></strong>
See see <a href="#ncpdq-netCDF-Permute-Dimensions-Quickly">ncpdq netCDF Permute Dimensions Quickly</a>
</p><dl compact="compact">
<dt><code>reverse(dim args)</code></dt>
<dd><p>Reverses the dimension ordering of elements in a variable.
</p></dd>
<dt><code>permute(dim args)</code></dt>
<dd><p>Re-shapes variables by re-ordering the dimensions. All the dims of the variable must be specified in the arguments. A limitation of this permute (unlike ncpdq) is that the record dimension cannot be re-assigned.
</p></dd>
</dl>
<p>// Swap dimensions about and reorder along lon
</p><div class="example">
<pre class="example">lat_2D_rrg_new=lat_2D_rrg.permute($lon,$lat).reverse($lon);
lat_2D_rrg_new=0,90,-30,30,-30,30,-90,0
</pre></div>
<br>
<p><strong>Type Conversion Methods <br></strong>
These methods allow <code>ncap2</code> to convert variables and attributes to the different netcdf types. For more details on automatic and manual type conversion see (see <a href="#Type-Conversion">Type Conversion</a>). You can only use the new netCDF4 types if you have compiled/links <acronym>NCO</acronym> with the netCDF4 library and the Output file is HDF5.
</p>
<dl compact="compact">
<dt><code><strong>netCDF3/4 Types</strong></code></dt>
<dt><code>byte()</code></dt>
<dd><a name="index-byte_0028_0029"></a>
<p>convert to <code>NC_BYTE</code>, a signed 1-byte integer
</p></dd>
<dt><code>char()</code></dt>
<dd><a name="index-char_0028_0029"></a>
<p>convert to <code>NC_CHAR</code>, an ISO/ASCII character
</p></dd>
<dt><code>short()</code></dt>
<dd><a name="index-sshort_0028_0029"></a>
<p>convert to <code>NC_SHORT</code>, a signed 2-byte integer
</p></dd>
<dt><code>int()</code></dt>
<dd><a name="index-int_0028_0029"></a>
<p>convert to <code>NC_INT</code>, a signed 4-byte integer
</p></dd>
<dt><code>float()</code></dt>
<dd><a name="index-float_0028_0029"></a>
<p>convert to <code>NC_FLOAT</code>, a single-precision (4-byte) floating point number
</p></dd>
<dt><code>double()</code></dt>
<dd><a name="index-double_0028_0029"></a>
<p>convert to <code>NC_DOUBLE</code>, a double-precision (8-byte) floating point number
</p></dd>
<dt><code><strong>netCDF4 Types</strong></code></dt>
<dt><code>ubyte()</code></dt>
<dd><a name="index-ubyte_0028_0029"></a>
<p>convert to <code>NC_UBYTE</code>, an unsigned 1-byte integer
</p></dd>
<dt><code>ushort()</code></dt>
<dd><a name="index-ushort_0028_0029"></a>
<p>convert to <code>NC_USHORT</code>, an unsigned 2-byte integer
</p></dd>
<dt><code>uint()</code></dt>
<dd><a name="index-uint_0028_0029"></a>
<p>convert to <code>NC_UINT</code>, an unsigned 4-byte integer
</p></dd>
<dt><code>int64()</code></dt>
<dd><a name="index-int64_0028_0029"></a>
<p>convert to <code>NC_INT64</code>, a signed 8-byte integer
</p></dd>
<dt><code>uint64()</code></dt>
<dd><a name="index-unit64_0028_0029"></a>
<p>convert to <code>NC_UINT64</code>, an unsigned 8-byte integer
</p></dd>
</dl>
<p><strong>Intrinsic Mathematical Methods <br></strong>
The list of mathematical methods is system dependant.
For the full list see <a href="#Intrinsic-mathematical-methods">Intrinsic mathematical methods</a>
</p>
<p>All the mathematical methods take a single argument except <code>atan2()</code>
and <code>pow()</code> which take two.
If the operand type is less than <em>float</em> then the result will be of
type <em>float</em>.
Arguments of type <em>double</em> yield results of type <em>double</em>.
Like the other methods, you are free to use the mathematical methods as functions.
</p>
<div class="example">
<pre class="example">n1=pow(2,3.0f) // n1 type float
n2=atan2(2,3.0) // n2 type double
n3=1/(three_dmn_var_dbl.cos().pow(2))-tan(three_dmn_var_dbl)^2; // n3 type double
</pre></div>
<a name="ncap_ram"></a> <!-- http://nco.sf.net/nco.html#ncap_ram --><a name="index-RAM-variables-1"></a>
<hr>
<a name="RAM-variables"></a>
<div class="header">
<p>
Next: <a href="#Where-statement" accesskey="n" rel="next">Where statement</a>, Previous: <a href="#Methods-and-functions" accesskey="p" rel="previous">Methods and functions</a>, Up: <a href="#ncap2-netCDF-Arithmetic-Processor" accesskey="u" rel="up">ncap2 netCDF Arithmetic Processor</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#General-Index" title="Index" rel="index">Index</a>]</p>
</div>
<a name="RAM-variables-1"></a>
<h4 class="subsection">4.1.12 <acronym>RAM</acronym> variables</h4>
<p>Unlike regular variables, <acronym>RAM</acronym> variables are never written to disk.
Hence using <acronym>RAM</acronym> variables in place of regular variables (especially
within loops) significantly increases execution speed.
Variables that are frequently accessed within <code>for</code> or <code>where</code>
clauses provide the greatest opportunities for optimization.
To declare and define a <acronym>RAM</acronym> variable simply prefix the variable name
with an asterisk (<code>*</code>) when the variable is declared/initialized.
To delete a <acronym>RAM</acronym> variables (and recover their memory) use the
<code>ram_delete()</code> method.
To write a <acronym>RAM</acronym> variable to disk (like a regular variable) use
<code>ram_write()</code>.
<a name="index-ram_005fwrite_0028_0029"></a>
<a name="index-ram_005fdelete_0028_0029"></a>
</p><div class="example">
<pre class="example">*temp[$time,$lat,$lon]=10.0; // Cast
*temp_avg=temp.avg($time); // Regular assign
temp.ram_delete(); // Delete RAM variable
temp_avg.ram_write(); // Write Variable to output
// Create and increment a RAM variable from "one" in Input
*one++;
// Create RAM variables from the variables three and four in Input.
// Multiply three by 10 and add it to four.
*four+=*three*=10; // three=30, four=34
</pre></div>
<a name="where"></a> <!-- http://nco.sf.net/nco.html#where -->
<a name="ncap_whr"></a> <!-- http://nco.sf.net/nco.html#ncap_whr -->
<a name="ncap_where"></a> <!-- http://nco.sf.net/nco.html#ncap_where --><hr>
<a name="Where-statement"></a>
<div class="header">
<p>
Next: <a href="#Loops" accesskey="n" rel="next">Loops</a>, Previous: <a href="#RAM-variables" accesskey="p" rel="previous">RAM variables</a>, Up: <a href="#ncap2-netCDF-Arithmetic-Processor" accesskey="u" rel="up">ncap2 netCDF Arithmetic Processor</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#General-Index" title="Index" rel="index">Index</a>]</p>
</div>
<a name="Where-statement-1"></a>
<h4 class="subsection">4.1.13 Where statement</h4>
<a name="index-where_0028_0029"></a>
<p>A <code>where()</code> combines the definition and application of a mask all in one go and can lead to succinct code.
The full syntax of a <code>where()</code> statement is as follows:
</p>
<div class="example">
<pre class="example">// Single assign (the 'elsewhere' block is optional)
where(mask)
var1=expr1;
elsewhere
var1=expr2;
// Multiple assigns
where(mask){
var1=expr1;
var2=expr2;
...
}elsewhere{
var1=expr3
var2=expr4
var3=expr5;
...
}
</pre></div>
<ul>
<li> The only expression allowed in the predicate of a where is assign,
i.e., ’var=expr’.
This assign differs from a regular <code>ncap2</code> assign.
The LHS var must already exist in Input or Output.
The RHS expression must evaluate to a scalar or a variable/attribute of
the same size as the LHS variable.
</li><li> Consider when both the LHS and RHS are variables:
For every element where mask condition is True, the corresponding LHS
variable element is re-assigned to its partner element on the RHS.
In the elsewhere part the mask is logically inverted and the assign
process proceeds as before.
</li><li> If the mask dimensions are a subset of the LHS variable’s
dimensions, then it is made to conform; if it cannot be made to conform
then script execution halts.
</li><li> Missing values in the mask evaluate to False in the where
code/block statement and to True in the elsewhere block/statement.
LHS variable elements set to missing value are not re-assigned.
For these reasons, do not explicitly reference missing values in the
masking condition, e.g., <code>where(foo=foo.get_missing()) foo=1;</code>
will not work as expected.
</li></ul>
<p>Example:
Consider the variables <code>float lon_2D_rct(lat,lon);</code> and
<code>float var_msk(lat,lon);</code>.
Suppose we wish to multiply by two the elements for which <code>var_msk</code>
equals 1<!-- /@w -->:
</p><div class="example">
<pre class="example">where(var_msk==1) lon_2D_rct=2*lon_2D_rct;
</pre></div>
<p>Suppose that we have the variable <code>int RDM(time)</code> and that we want
to set its values less than 8 or greater than 80 to 0<!-- /@w -->:
</p><div class="example">
<pre class="example">where(RDM < 8 || RDM > 80) RDM=0;
</pre></div>
<p>Consider irregularly gridded data, described using rank 2<!-- /@w --> coordinates:
<code>double lat(south_north,east_west)</code>,
<code>double lon(south_north,east_west)</code>,
<code>double temperature(south_north,east_west)</code>.
To find the average temperature in a region bounded by
[<var>lat_min</var>,<var>lat_max</var>] and [<var>lon_min</var>,<var>lon_max</var>]:
</p><div class="example">
<pre class="example">temperature_msk[$south_north,$east_west]=0.0;
where(lat >= lat_min && lat <= lat_max) && (lon >= lon_min && lon <= lon_max)
temperature_msk=temperature;
elsewhere
temperature_msk=temperature@_FillValue;
temp_avg=temperature_msk.avg();
temp_max=temperature.max();
</pre></div>
<a name="ncap_lop"></a> <!-- http://nco.sf.net/nco.html#ncap_lop --><hr>
<a name="Loops"></a>
<div class="header">
<p>
Next: <a href="#Include-files" accesskey="n" rel="next">Include files</a>, Previous: <a href="#Where-statement" accesskey="p" rel="previous">Where statement</a>, Up: <a href="#ncap2-netCDF-Arithmetic-Processor" accesskey="u" rel="up">ncap2 netCDF Arithmetic Processor</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#General-Index" title="Index" rel="index">Index</a>]</p>
</div>
<a name="Loops-1"></a>
<h4 class="subsection">4.1.14 Loops</h4>
<a name="index-while_0028_0029"></a>
<a name="index-for_0028_0029"></a>
<p><code>ncap2</code> supplies <code>for()</code> loops and <code>while()</code> loops.
They are completely unoptimized so use them only with <acronym>RAM</acronym>
variables unless you want thrash your disk to death.
To break out of a loop use the <code>break</code> command.
To iterate to the next cycle use the <code>continue</code> command.
</p>
<div class="example">
<pre class="example">// Set elements in variable double temp(time,lat)
// If element < 0 set to 0, if element > 100 set to 100
*sz_idx=$time.size;
*sz_jdx=$lat.size;
for(*idx=0;idx<sz_idx;idx++)
for(*jdx=0;jdx<sz_jdx;jdx++)
if(temp(idx,jdx) > 100) temp(idx,jdx)=100.0;
else if(temp(idx,jdx) < 0) temp(idx,jdx)=0.0;
// Are values of co-ordinate variable double lat(lat) monotonic?
*sz=$lat.size;
for(*idx=1;idx<sz;idx++)
if(lat(idx)-lat(idx-1) < 0.0) break;
if(idx == sz) print("lat co-ordinate is monotonic\n");
else print("lat co-ordinate is NOT monotonic\n");
// Sum odd elements
*idx=0;
*sz=$lat_nw.size;
*sum=0.0;
while(idx<sz){
if(lat(idx)%2) sum+=lat(idx);
idx++;
}
ram_write(sum);
print("Total of odd elements ");print(sum);print("\n");
</pre></div>
<a name="ncap_inc"></a> <!-- http://nco.sf.net/nco.html#ncap_inc --><hr>
<a name="Include-files"></a>
<div class="header">
<p>
Next: <a href="#Sort-methods" accesskey="n" rel="next">Sort methods</a>, Previous: <a href="#Loops" accesskey="p" rel="previous">Loops</a>, Up: <a href="#ncap2-netCDF-Arithmetic-Processor" accesskey="u" rel="up">ncap2 netCDF Arithmetic Processor</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#General-Index" title="Index" rel="index">Index</a>]</p>
</div>
<a name="Include-files-1"></a>
<h4 class="subsection">4.1.15 Include files</h4>
<a name="index-include"></a>
<p>The syntax of an <var>include-file</var> is:
</p><div class="example">
<pre class="example">#include "script.nco"
</pre></div>
<p>The script filename is searched relative to the run directory.
It is possible to nest include files to an arbitrary depth.
A handy use of inlcude files is to store often used constants.
Use <acronym>RAM</acronym> variables if you do not want these constants written to
<var>output-file</var>.
</p><div class="example">
<pre class="example">// script.nco
// Sample file to #include in ncap2 script
*pi=3.1415926535; // RAM variable, not written to output
*h=6.62607095e-34; // RAM variable, not written to output
e=2.71828; // Regular (disk) variable, written to output
</pre></div>
<a name="srt"></a> <!-- http://nco.sf.net/nco.html#srt -->
<a name="sort"></a> <!-- http://nco.sf.net/nco.html#sort -->
<a name="remap"></a> <!-- http://nco.sf.net/nco.html#remap --><hr>
<a name="Sort-methods"></a>
<div class="header">
<p>
Next: <a href="#Irregular-grids" accesskey="n" rel="next">Irregular grids</a>, Previous: <a href="#Include-files" accesskey="p" rel="previous">Include files</a>, Up: <a href="#ncap2-netCDF-Arithmetic-Processor" accesskey="u" rel="up">ncap2 netCDF Arithmetic Processor</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#General-Index" title="Index" rel="index">Index</a>]</p>
</div>
<a name="sort-methods"></a>
<h4 class="subsection">4.1.16 <code>sort</code> methods</h4>
<a name="index-sort"></a>
<a name="index-asort"></a>
<a name="index-dsort"></a>
<a name="index-remap"></a>
<a name="index-unmap"></a>
<a name="index-invert_005fmap"></a>
<p>In <acronym>ncap2</acronym> there are multiple ways to sort data.
Beginning with <acronym>NCO</acronym> 4.1.0 (March, 2012), <acronym>ncap2</acronym>
support six sorting functions:
</p><div class="example">
<pre class="example">var_out=sort(var_in,&srt_map); // Ascending sort
var_out=asort(var_in,&srt_map); // Accending sort
var_out=dsort(var_in,&srt_map); // Desending sort
var_out=remap(var_in,srt_map); // Apply srt_map to var_in
var_out=unmap(var_in,srt_map); // Reverse what srt_map did to var_in
dsr_map=invert_map(srt_map); // Produce "de-sort" map that inverts srt_map
</pre></div>
<p>The first two functions, <code>sort()</code> and <code>asort()</code>
sort, in ascending order, all the elements of <var>var_in</var> (which can be
a variable or attribute) without regard to any dimensions.
The third function, <code>dsort()</code> does the same but sorts in
descending order.
Remember that ascending and descending sorts are specified by
<code>asort()</code> and <code>dsort()</code>, respectively.
</p>
<p>These three functions are overloaded to take a second, optional argument
called the sort map <var>srt_map</var>, which should be supplied as a
call-by-reference variable, i.e., preceded with an ampersand.
If the sort map does not yet exist, then it will be created and
returned as an integer type the same shape as the input variable.
</p>
<p>The output <var>var_out</var> of each sort function is a sorted version of
the input, <var>var_in</var>.
The output <var>var_out</var> of the two mapping functions the result of
applying (with <code>remap()</code> or un-applying (with <code>unmap()</code>)
the sort map <var>srt_map</var> to the input <var>var_in</var>.
To apply the sort map with <code>remap()</code> the size of the variable
must be exactly divisible by the size of the sort map.
</p>
<p>The final function <code>invert_map()</code> returns the so-called
de-sorting map <var>dsr_map</var> which is inverse map of the input map
<var>srt_map</var>.
This gives the user access to both the forward and inverse sorting maps
which can be useful in special situations.
</p><div class="example">
<pre class="example">a1[$time]={10,2,3,4,6,5,7,3,4,1};
a1_sort=sort(a1);
print(a1_sort);
// 1, 2, 3, 3, 4, 4, 5, 6, 7, 10;
a2[$lon]={2,1,4,3};
a2_sort=sort(a2,&a2_map);
print(a2);
// 1, 2, 3, 4
print(a2_map);
// 1, 0, 3, 2;
</pre></div>
<p>If the map variable does not exist prior to the <code>sort()</code> call,
then it will be created with the same shape as the input variable and be
of type <code>NC_INT</code>.
If the map variable already exists, then the only restriction is that it
be of at least the same size as the input variable.
To apply a map use <code>remap(var_in,srt_map)</code>.
</p><div class="example">
<pre class="example">defdim("nlat",5);
a3[$lon]={2,5,3,7};
a4[$nlat,$lon]={
1, 2, 3, 4,
5, 6, 7, 8,
9,10,11,12,
13,14,15,16,
17,18,19,20};
a3_sort=sort(a3,&a3_map);
print(a3_map);
// 0, 2, 1, 3;
a4_sort=remap(a4,a3_map);
print(a4_sort);
// 1, 3, 2, 4,
// 5, 7, 6, 8,
// 9,11,10,12,
// 13,15,14,16,
// 17,19,18,20;
a3_map2[$nlat]={4,3,0,2,1};
a4_sort2=remap(a4,a3_map2);
print(a4_sort2);
// 3, 5, 4, 2, 1
// 8, 10, 9,7, 6,
// 13,15,14,12,11,
// 18,20,19,17,16
</pre></div>
<p>As in the above example you may create your own sort map.
To sort in descending order, apply the <code>reverse()</code> method after the
<code>sort()</code>.
</p>
<p>Here is an extended example of how to use <code>ncap2</code> features to
hyperslab an irregular region based on the values of a variable not a
coordinate.
The distinction is crucial: hyperslabbing based on dimensional indices
or coordinate values is straightforward.
Using the values of single or multi-dimensional variable to define a
hyperslab is quite different.
</p><div class="example">
<pre class="example">cat > ~/ncap2_foo.nco << 'EOF'
// Purpose: Save irregular 1-D regions based on variable values
// Included in NCO User Guide at http://nco.sf.net/nco.html#sort
/* NB: Single quotes around EOF above turn off shell parameter
expansion in "here documents". This in turn prevents the
need for protecting dollarsign characters in NCO scripts with
backslashes when the script is cut-and-pasted (aka "moused")
from an editor or e-mail into a shell console window */
/* Copy coordinates and variable(s) of interest into RAM variable(s)
Benefits:
1. ncap2 defines writes all variables on LHS of expression to disk
Only exception is RAM variables, which are stored in RAM only
Repeated operations on regular variables takes more time,
because changes are written to disk copy after every change.
RAM variables are only changed in RAM so script works faster
RAM variables can be written to disk at end with ram_write()
2. Script permutes variables of interest during processing
Safer to work with copies that have different names
This discourages accidental, mistaken use of permuted versions
3. Makes this script a more generic template:
var_in instead of specific variable names everywhere */
*var_in=one_dmn_rec_var;
*crd_in=time;
*dmn_in_sz=$time.size; // [nbr] Size of input arrays
/* Create all other "intermediate" variables as RAM variables
to prevent them from cluttering the output file.
Mask flag and sort map are same size as variable of interest */
*msk_flg=var_in;
*srt_map=var_in;
/* In this example we mask for all values evenly divisible by 3
This is the key, problem-specific portion of the template
Replace this where() condition by that for your problem
Mask variable is Boolean: 1=Meets condition, 0=Fails condition */
where(var_in % 3 == 0) msk_flg=1; elsewhere msk_flg=0;
// print("msk_flg = ");print(msk_flg); // For debugging...
/* The sort() routine is overloaded, and takes one or two arguments
The second argument (optional) is the "sort map" (srt_map below)
Pass the sort map by reference, i.e., prefix with an ampersand
If the sort map does not yet exist, then it will be created and
returned as an integer type the same shape as the input variable.
The output of sort(), on the LHS, is a sorted version of the input
msk_flg is not needed in its original order after sort()
Hence we use msk_flg as both input to and output from sort()
Doing this prevents the need to define a new, unneeded variable */
msk_flg=sort(msk_flg,&srt_map);
// Count number of valid points in mask by summing the one's
*msk_nbr=msk_flg.total();
// Define output dimension equal in size to number of valid points
defdim("crd_out",msk_nbr);
/* Now sort the variable of interest using the sort map and remap()
The output, on the LHS, is the input re-arranged so that all points
meeting the mask condition are contiguous at the end of the array
Use same srt_map to hyperslab multiple variables of the same shape
Remember to apply srt_map to the coordinate variables */
crd_in=remap(crd_in,srt_map);
var_in=remap(var_in,srt_map);
/* Hyperslab last msk_nbr values of variable(s) of interest */
crd_out[crd_out]=crd_in((dmn_in_sz-msk_nbr):(dmn_in_sz-1));
var_out[crd_out]=var_in((dmn_in_sz-msk_nbr):(dmn_in_sz-1));
/* NB: Even though we created all variables possible as RAM variables,
the original coordinate of interest, time, is written to the ouput.
I'm not exactly sure why. For now, delete it from the output with:
ncks -O -x -v time ~/foo.nc ~/foo.nc
*/
EOF
ncap2 -O -v -S ~/ncap2_foo.nco ~/nco/data/in.nc ~/foo.nc
ncks -O -x -v time ~/foo.nc ~/foo.nc
ncks ~/foo.nc
</pre></div>
<p>Here is an extended example of how to use <code>ncap2</code> features to
sort multi-dimensional arrays based on the coordinate values along a
single dimension.
</p><div class="example">
<pre class="example">cat > ~/ncap2_foo.nco << 'EOF'
/* Purpose: Sort multi-dimensional array based on coordinate values
This example sorts the variable three_dmn_rec_var(time,lat,lon)
based on the values of the time coordinate. */
// Included in NCO User Guide at http://nco.sf.net/nco.html#sort
// Randomize the time coordinate
time=10.0*gsl_rng_uniform(time);
//print("original randomized time =\n");print(time);
/* The sort() routine is overloaded, and takes one or two arguments
The first argument is a one dimensional array
The second argument (optional) is the "sort map" (srt_map below)
Pass the sort map by reference, i.e., prefix with an ampersand
If the sort map does not yet exist, then it will be created and
returned as an integer type the same shape as the input variable.
The output of sort(), on the LHS, is a sorted version of the input */
time=sort(time,&srt_map);
//print("sorted time (ascending order) and associated sort map =\n");print(time);print(srt_map);
/* sort() always sorts in ascending order
The associated sort map therefore re-arranges the original,
randomized time array into ascending order.
There are two methods to obtain the descending order the user wants
1) We could solve the problem in ascending order (the default)
and then apply the reverse() method to re-arrange the results.
2) We could change the sort map to return things in descending
order of time and solve the problem directly in descending order. */
// Following shows how to do method one:
/* Expand the sort map to srt_map_3d, the size of the data array
1. Use data array to provide right shape for the expanded sort map
2. Coerce data array into an integer so srt_map_3d is an integer
3. Multiply data array by zero so 3-d map elements are all zero
4. Add the 1-d sort map to the 3-d sort map (NCO automatically resizes)
5. Add the spatial (lat,lon) offsets to each time index
6. de-sort using the srt_map_3d
7. Use reverse to obtain descending in time order
Loops could accomplish the same thing (exercise left for reader)
However, loops are slow for large datasets */
/* Following index manipulation requires understanding correspondence
between 1-d (unrolled, memory order of storage) and access into that
memory as a multidimensional (3-d, in this case) rectangular array.
Key idea to understand is how dimensionality affects offsets */
// Copy 1-d sort map into 3-d sort map
srt_map_3d=(0*int(three_dmn_rec_var))+srt_map;
// Multiply base offset by factorial of lesser dimensions
srt_map_3d*=$lat.size*$lon.size;
lon_idx=array(0,1,$lon);
lat_idx=array(0,1,$lat)*$lon.size;
lat_lon_idx[$lat,$lon]=lat_idx+lon_idx;
srt_map_3d+=lat_lon_idx;
print("sort map 3d =\n");print(srt_map_3d);
// Use remap() to re-map the data
three_dmn_rec_var=remap(three_dmn_rec_var,srt_map_3d);
// Finally, reverse data so time coordinate is descending
time=time.reverse($time);
//print("sorted time (descending order) =\n");print(time);
three_dmn_rec_var=three_dmn_rec_var.reverse($time);
// Method two: Key difference is srt_map=$time.size-srt_map-1;
EOF
ncap2 -O -v -S ~/ncap2_foo.nco ~/nco/data/in.nc ~/foo.nc
</pre></div>
<a name="grd"></a> <!-- http://nco.sf.net/nco.html#grd -->
<a name="rrg"></a> <!-- http://nco.sf.net/nco.html#rrg -->
<a name="rct"></a> <!-- http://nco.sf.net/nco.html#rct -->
<hr>
<a name="Irregular-grids"></a>
<div class="header">
<p>
Next: <a href="#Bilinear-interpolation" accesskey="n" rel="next">Bilinear interpolation</a>, Previous: <a href="#Sort-methods" accesskey="p" rel="previous">Sort methods</a>, Up: <a href="#ncap2-netCDF-Arithmetic-Processor" accesskey="u" rel="up">ncap2 netCDF Arithmetic Processor</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#General-Index" title="Index" rel="index">Index</a>]</p>
</div>
<a name="Irregular-Grids"></a>
<h4 class="subsection">4.1.17 Irregular Grids</h4>
<a name="index-irregular-grids"></a>
<a name="index-rectangular-grids"></a>
<a name="index-non_002drectangular-grids"></a>
<a name="index-non_002dstandard-grids"></a>
<a name="index-mask"></a>
<p><acronym>NCO</acronym> is capable of analyzing datasets for many different
underlying coordinate grid types.
netCDF was developed for and initially used with grids comprised of
orthogonal dimensions forming a rectangular coordinate system.
We call such grids <em>standard</em> grids.
It is increasingly common for datasets to use metadata to describe
much more complex grids.
Let us first define three important coordinate grid properties:
rectangularity, regularity, and fxm.
</p>
<p>Grids are <em>regular</em> if the spacing between adjacent is constant.
For example, a 4-by-5 degree latitude-longitude grid is regular
because the spacings between adjacent latitudes (4 degrees<!-- /@w -->) are
constant as are the (5 degrees<!-- /@w -->) spacings between adjacent
longitudes.
Spacing in <em>irregular</em> grids depends on the location along the
coordinate.
Grids such as Gaussian grids have uneven spacing in latitude (points
cluster near the equator) and so are irregular.
</p>
<p>Grids are <em>rectangular</em> if the number of elements in any
dimension is not a function of any other dimension.
For example, a T42 Gaussian latitude-longitude grid is rectangular
because there are the same number of longitudes (128) for each of the
(64) latitudes.
Grids are <em>non-rectangular</em> if the elements in any dimension
depend on another dimension.
Non-rectangular grids present many special challenges to
analysis software like <acronym>NCO</acronym>.
</p>
<p>Wrapped coordinates (see <a href="#Wrapped-Coordinates">Wrapped Coordinates</a>), such as longitude,
are independent of these grid properties (regularity,
rectangularity).
</p>
<a name="index-wrapped-coordinates-2"></a>
<p>The preferred <acronym>NCO</acronym> technique to analyze data on non-standard
coordinate grids is to create a region mask with <code>ncap2</code>, and
then to use the mask within <code>ncap2</code> for variable-specific
processing, and/or with other operators (e.g., <code>ncwa</code>,
<code>ncdiff</code>) for entire file processing.
</p>
<p>Before describing the construction of masks, let us review how
irregularly gridded geoscience data are described.
Say that latitude and longitude are stored as <var>R</var>-dimensional
arrays and the product of the dimension sizes is the total number of
elements N in the other variables.
Geoscience applications tend to use <em><var>R</var>=1</em>,
<em><var>R</var>=2</em>, and <em><var>R</var>=3</em>.
</p>
<p>If the grid is has no simple representation (e.g., discontinuous) then
it makes sense to store all coordinates as 1D arrays with the same
size as the number of grid points.
These gridpoints can be completely independent of all the other (own
weight, area, etc.).
</p>
<p><var>R</var>=1: lat(number_of_gridpoints) and lon(number_of_gridpoints)
</p>
<p>If the horizontal grid is time-invariant then <var>R</var>=2 is common:
</p>
<p><var>R</var>=2: lat(south_north,east_west) and lon(south_north,east_west)
</p>
<p>The Weather and Research Forecast (<acronym>WRF</acronym>) model uses <var>R</var>=3:
</p>
<p><var>R</var>=3: lat(time,south_north,east_west), lon(time,south_north,east_west)
</p>
<p>and so supports grids that change with time.
</p>
<p>Grids with <var>R</var> > 1 often use missing values to indicated empty points.
For example, so-called "staggered grids" will use fewer east_west
points near the poles and more near the equator. netCDF only accepts
rectangular arrays so space must be allocated for the maximum number
of east_west points at all latitudes. Then the application writes
missing values into the unused points near the poles.
</p>
<p>We demonstrate the <code>ncap2</code> analysis technique for irregular
regions by constructing a mask for an <var>R</var>=2 grid.
We wish to find, say, the mean temperature within
[<var>lat_min</var>,<var>lat_max</var>] and [<var>lon_min</var>,<var>lon_max</var>]:
</p><div class="example">
<pre class="example">ncap2 -s 'mask_var= (lat >= lat_min && lat <= lat_max) && \
(lon >= lon_min && lon <= lon_max);' in.nc out.nc
</pre></div>
<p>Arbitrarily shaped regions can be defined by more complex conditional
statements.
Once defined, masks can be applied to specific variables,
and to entire files:
</p><div class="example">
<pre class="example">ncap2 -s 'temperature_avg=(temperature*mask_var).avg()' in.nc out.nc
ncwa -a lat,lon -m mask_var -w area in.nc out.nc
</pre></div>
<p>Crafting such commands on the command line is possible though unwieldy.
In such cases, a script is often cleaner and allows you to document the
procedure:
</p><div class="example">
<pre class="verbatim">cat > ncap2.in << 'EOF'
mask_var = (lat >= lat_min && lat <= lat_max) && (lon >= lon_min && > lon <= lon_max);
if(mask_var.total() > 0){ // Check that mask contains some valid values
temperature_avg=(temperature*mask_var).avg(); // Average temperature
temperature_max=(temperature*mask_var).max(); // Maximum temperature
}
EOF
ncap2 -S ncap2.in in.nc out.nc
</pre></div>
<a name="wrf"></a> <!-- http://nco.sf.net/nco.html#wrf -->
<a name="WRF"></a> <!-- http://nco.sf.net/nco.html#WRF --><a name="index-WRF"></a>
<p>Grids like those produced by the <acronym>WRF</acronym> model are complex because
one must use global metadata to determine the grid staggering and
offsets to translate <code>XLAT</code> and <code>XLONG</code> into real latitudes,
longitudes, and missing points.
The <acronym>WRF</acronym> grid documentation should describe this.
For <acronym>WRF</acronym> files creating regional masks looks like
</p><div class="example">
<pre class="example">mask_var = (XLAT >= lat_min && XLAT <= lat_max) && (XLONG >= lon_min && XLONG <= lon_max);
</pre></div>
<p>A few notes:
Irregular regions are the union of arrays lat/lon_min/max’s.
The mask procedure is identical for all <var>R</var>.
</p>
<a name="bln_ntp"></a> <!-- http://nco.sf.net/nco.html#bln_ntp -->
<a name="bil_int"></a> <!-- http://nco.sf.net/nco.html#bil_int --><hr>
<a name="Bilinear-interpolation"></a>
<div class="header">
<p>
Next: <a href="#GSL-special-functions" accesskey="n" rel="next">GSL special functions</a>, Previous: <a href="#Irregular-grids" accesskey="p" rel="previous">Irregular grids</a>, Up: <a href="#ncap2-netCDF-Arithmetic-Processor" accesskey="u" rel="up">ncap2 netCDF Arithmetic Processor</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#General-Index" title="Index" rel="index">Index</a>]</p>
</div>
<a name="Bilinear-interpolation-1"></a>
<h4 class="subsection">4.1.18 Bilinear interpolation</h4>
<p>As of version 4.0.0 <acronym>NCO</acronym> has internal routines to
perform bilinear interpolation on gridded data sets.
In mathematics, bilinear interpolation is an extension of linear
interpolation for interpolating functions of two variables on a regular
grid.
The idea is to perform linear interpolation first in one direction, and
then again in the other direction.
</p>
<p>Suppose we have an irregular grid of data <code>temperature[lat,lon]</code>,
with co-ordinate vars <code>lat[lat], lon[lon]</code>.
We wish to find the temperature at an arbitary point [<var>X</var>,<var>Y</var>]
within the grid.
If we can locate lat_min,lat_max and lon_min,lon_max such that
<code>lat_min <= X <= lat_max</code> and <code>lon_min <= Y <= lon_max</code>
then we can interpolate in two dimensions the temperature at
[<var>X</var>,<var>Y</var>].
</p>
<p>The general form of the <code>ncap2</code> interpolation function is
</p><div class="example">
<pre class="example">var_out=bilinear_interp(grid_in,grid_out,grid_out_x,grid_out_y,grid_in_x,grid_in_y)
</pre></div>
<p>where
</p><dl compact="compact">
<dt><code>grid_in</code></dt>
<dd><p>Input function data.
Usually a two dimensional variable.
It must be of size <code>grid_in_x.size()*grid_in_y.size()</code>
</p></dd>
<dt><code>grid_out</code></dt>
<dd><p>This variable is the shape of <code>var_out</code>.
Usually a two dimensional variable.
It must be of size <code>grid_out_x.size()*grid_out_y.size()</code>
</p></dd>
<dt><code>grid_out_x</code></dt>
<dd><p><var>X</var> output values
</p></dd>
<dt><code>grid_out_y</code></dt>
<dd><p><var>Y</var> output values
</p></dd>
<dt><code>grid_in_x</code></dt>
<dd><p><var>X</var> input values values. Must be monotonic (increasing or decreasing).
</p></dd>
<dt><code>grid_in_y</code></dt>
<dd><p><var>Y</var> input values values. Must be monotonic (increasing or decreasing).
</p></dd>
</dl>
<p>Prior to calculations all arguments are converted to type
<code>NC_DOUBLE</code>.
After calculations <code>var_out</code> is converted to the input type of
<code>grid_in</code>.
</p>
<p>Suppose the first part of an <code>ncap2</code> script is
</p><div class="example">
<pre class="example">defdim("X",4);
defdim("Y",5);
// Temperature
T_in[$X,$Y]=
{100, 200, 300, 400, 500,
101, 202, 303, 404, 505,
102, 204, 306, 408, 510,
103, 206, 309, 412, 515.0 };
// Coordinate variables
x_in[$X]={0.0,1.0,2.0,3.01};
y_in[$Y]={1.0,2.0,3.0,4.0,5};
</pre></div>
<p>Now we interpolate with the following variables:
</p><div class="example">
<pre class="example">defdim("Xn",3);
defdim("Yn",4);
T_out[$Xn,$Yn]=0.0;
x_out[$Xn]={0.0,0.02,3.01};
y_out[$Yn]={1.1,2.0,3,4};
var_out=bilinear_interp(T_in,T_out,x_out,y_out,x_in,y_in);
print(var_out);
// 110, 200, 300, 400,
// 110.022, 200.04, 300.06, 400.08,
// 113.3, 206, 309, 412 ;
</pre></div>
<p>It is possible to interpolate a single point:
</p><div class="example">
<pre class="example">var_out=bilinear_interp(T_in,0.0,3.0,4.99,x_in,y_in);
print(var_out);
// 513.920594059406
</pre></div>
<p><strong>Wrapping and Extrapolation</strong> <br>
The function <code>bilinear_interp_wrap()</code> takes the same
arguments as <code>bilinear_interp()</code> but performs wrapping (<var>Y</var>)
and extrapolation (<var>X</var>) for points off the edge of the grid.
If the given range of longitude is say (25-335) and we have a point at
20 degrees, then the endpoints of the range are used for the
interpolation.
This is what wrapping means.
For wrapping to occur <var>Y</var> must be longitude and must be in the range
(0,360) or (-180,180).
There are no restrictions on the longitude (<var>X</var>) values, though
typically these are in the range (-90,90).
This <code>ncap2</code> script illustrates both wrapping and extrapolation
of end points:
</p><div class="example">
<pre class="example">defdim("lat_in",6);
defdim("lon_in",5);
// Coordinate input vars
lat_in[$lat_in]={-80,-40,0,30,60.0,85.0};
lon_in[$lon_in]={30, 110, 190, 270, 350.0};
T_in[$lat_in,$lon_in]=
{10,40,50,30,15,
12,43,52,31,16,
14,46,54,32,17,
16,49,56,33,18,
18,52,58,34,19,
20,55,60,35,20.0 };
defdim("lat_out",4);
defdim("lon_out",3);
// Coordinate variables
lat_out[$lat_out]={-90,0,70,88.0};
lon_out[$lon_out]={0,190,355.0};
T_out[$lat_out,$lon_out]=0.0;
T_out=bilinear_interp_wrap(T_in,T_out,lat_out,lon_out,lat_in,lon_in);
print(T_out);
// 13.4375, 49.5, 14.09375,
// 16.25, 54, 16.625,
// 19.25, 58.8, 19.325,
// 20.15, 60.24, 20.135 ;
</pre></div>
<a name="gsl"></a> <!-- http://nco.sf.net/nco.html#gsl --><hr>
<a name="GSL-special-functions"></a>
<div class="header">
<p>
Next: <a href="#GSL-interpolation" accesskey="n" rel="next">GSL interpolation</a>, Previous: <a href="#Bilinear-interpolation" accesskey="p" rel="previous">Bilinear interpolation</a>, Up: <a href="#ncap2-netCDF-Arithmetic-Processor" accesskey="u" rel="up">ncap2 netCDF Arithmetic Processor</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#General-Index" title="Index" rel="index">Index</a>]</p>
</div>
<a name="GSL-special-functions-1"></a>
<h4 class="subsection">4.1.19 GSL special functions</h4>
<a name="index-GSL-1"></a>
<p>As of version 3.9.6 (released January, 2009), <acronym>NCO</acronym>
can link to the GNU Scientific Library (<acronym>GSL</acronym>).
<code>ncap2</code> can access most <acronym>GSL</acronym> special functions including
Airy, Bessel, error, gamma, beta, hypergeometric, and Legendre functions
and elliptical integrals.
<acronym>GSL</acronym> must be version 1.4<!-- /@w --> or later.
To list the <acronym>GSL</acronym> functions available with your <acronym>NCO</acronym>
build, use <code>ncap2 -f | grep ^gsl</code>.
</p>
<p>The function names used by <acronym>ncap2</acronym> mirror their
<acronym>GSL</acronym> names.
The <acronym>NCO</acronym> wrappers for <acronym>GSL</acronym> functions automatically
call the error-handling version of the <acronym>GSL</acronym> function when
available
<a name="DOCF47" href="#FOOT47"><sup>47</sup></a>.
This allows <acronym>NCO</acronym> to return a missing value when the
<acronym>GSL</acronym> library encounters a domain error or a floating point
exception.
The slow-down due to calling the error-handling version of the
<acronym>GSL</acronym> numerical functions was found to be negligible (please let
us know if you find otherwise).
</p>
<a name="index-gamma-function"></a>
<a name="index-gsl_005fsf_005fgamma"></a>
<p>Consider the gamma function.<br>
The <acronym>GSL</acronym> function prototype is <br>
<code>int gsl_sf_gamma_e(const double x, gsl_sf_result * result)</code>
The <code>ncap2</code> script would be:
</p><div class="example">
<pre class="example">lon_in[lon]={-1,0.1,0,2,0.3};
lon_out=gsl_sf_gamma(lon_in);
lon_out= _, 9.5135, 4.5908, 2.9915
</pre></div>
<p>The first value is set to <code>_FillValue</code> since the gamma
function is undefined for negative integers.
If the input variable has a missing value then this value is used.
Otherwise, the default double fill value is used
(defined in the netCDF header <samp>netcdf.h</samp> as
<code>NC_FILL_DOUBLE = 9.969e+36</code>).
</p>
<a name="index-Bessel-function"></a>
<a name="index-gsl_005fsf_005fbessel_005fJn"></a>
<p>Consider a call to a Bessel function with <acronym>GSL</acronym>
prototype<br>
<code>int gsl_sf_bessel_Jn_e(int n, double x, gsl_sf_result * result)</code>
</p>
<p>An <code>ncap2</code> script would be
</p><div class="example">
<pre class="example">lon_out=gsl_sf_bessel_Jn(2,lon_in);
lon_out=0.11490, 0.0012, 0.00498, 0.011165
</pre></div>
<p>This computes the Bessel function of order <var>n=2</var> for every value in
<code>lon_in</code>.
The Bessel order argument, an integer, can also be a non-scalar
variable, i.e., an array.
</p><div class="example">
<pre class="example">n_in[lon]={0,1,2,3};
lon_out=gsl_sf_bessel_Jn(n_in,0.5);
lon_out= 0.93846, 0.24226, 0.03060, 0.00256
</pre></div>
<p>Arguments to <acronym>GSL</acronym> wrapper functions in <code>ncap2</code>
must conform to one another, i.e., they must share the same sub-set of
dimensions.
For example: <code>three_out=gsl_sf_bessel_Jn(n_in,three_dmn_var_dbl)</code>
is valid because the variable <code>three_dmn_var_dbl</code> has a <var>lon</var>
dimension, so <code>n_in</code> in can be broadcast to conform to
<code>three_dmn_var_dbl</code>.
However <code>time_out=gsl_sf_bessel_Jn(n_in,time)</code> is invalid.
</p>
<a name="index-Elliptic-integrals"></a>
<p>Consider the elliptical integral with prototype
<code>int gsl_sf_ellint_RD_e(double x, double y, double z, gsl_mode_t mode, gsl_sf_result * result)</code>
</p><div class="example">
<pre class="example">three_out=gsl_sf_ellint_RD(0.5,time,three_dmn_var_dbl);
</pre></div>
<p>The three arguments are all conformable so the above <code>ncap2</code> call is valid. The mode argument in the function prototype controls the convergence of the algorithm. It also appears in the Airy Function prototypes. It can be set by defining the environment variable <code>GSL_PREC_MODE</code>. If unset it defaults to the value <code>GSL_PREC_DOUBLE</code>. See the <acronym>GSL</acronym> manual for more details.
</p><div class="example">
<pre class="example">export GSL_PREC_MODE=0 // GSL_PREC_DOUBLE
export GSL_PREC_MODE=1 // GSL_PREC_SINGLE
export GSL_PREC_MODE=2 // GSL_PREC_APPROX
</pre></div>
<p>The <code>ncap2</code> wrappers to the array functions are
slightly different.
Consider the following <acronym>GSL</acronym> prototype <br>
<code>int gsl_sf_bessel_Jn_array(int nmin, int nmax, double x, double *result_array)</code>
</p><div class="example">
<pre class="example">b1=lon.double();
x=0.5;
status=gsl_sf_bessel_Jn_array(1,4,x,&b1);
print(status);
b1=0.24226,0.0306,0.00256,0.00016;
</pre></div>
<p>This calculates the Bessel function of <var>x</var>=0.5 for
<var>n</var>=1 to 4.
The first three arguments are scalar values.
If a non-scalar variable is supplied as an argument then only the first
value is used.
The final argument is the variable where the results are stored (NB: the
<code>&</code> indicates this is a call by reference).
This final argument must be of type <code>double</code> and must be of least
size <var>nmax-nmin+1</var>.
If either of these conditions is not met then then the function
returns an error message.
The function/wrapper returns a status flag.
Zero indicates success.
</p>
<p>Consider another array function <br>
<code>int gsl_sf_legendre_Pl_array( int lmax, double x, double *result_array);</code>
<a name="index-Legendre-polynomial"></a>
<a name="index-gsl_005fsf_005flegendre_005fPl"></a>
</p><div class="example">
<pre class="example">a1=time.double();
x=0.3;
status=gsl_sf_legendre_Pl_array(a1.size()-1, x,&a1);
print(status);
</pre></div>
<p>This call calculates <var>P_l</var>(0.3) for <var>l</var>=0..9.
Note that <var>|x|<=1</var>, otherwise there will be a domain error.
See the <acronym>GSL</acronym>
documentation for more details.
</p>
<p>The <acronym>GSL</acronym> functions implemented in <acronym>NCO</acronym> are
listed in the table below.
This table is correct for <acronym>GSL</acronym> version 1.10.
To see what functions are available on your build run the command
<code>ncap2 -f |grep ^gsl</code> .
To see this table along with the <acronym>GSL</acronym> <span class="nolinebreak">C-function</span><!-- /@w -->
prototypes look at the spreadsheet <strong>doc/nco_gsl.ods</strong>. <br> <br>
</p>
<table>
<tr><td width="35%"><strong>GSL NAME</strong></td><td width="5%"><strong>I</strong></td><td width="60%"><strong>NCAP FUNCTION CALL</strong></td></tr>
<tr><td width="35%">gsl_sf_airy_Ai_e</td><td width="5%">Y</td><td width="60%">gsl_sf_airy_Ai(dbl_expr)</td></tr>
<tr><td width="35%">gsl_sf_airy_Bi_e</td><td width="5%">Y</td><td width="60%">gsl_sf_airy_Bi(dbl_expr)</td></tr>
<tr><td width="35%">gsl_sf_airy_Ai_scaled_e</td><td width="5%">Y</td><td width="60%">gsl_sf_airy_Ai_scaled(dbl_expr)</td></tr>
<tr><td width="35%">gsl_sf_airy_Bi_scaled_e</td><td width="5%">Y</td><td width="60%">gsl_sf_airy_Bi_scaled(dbl_expr)</td></tr>
<tr><td width="35%">gsl_sf_airy_Ai_deriv_e</td><td width="5%">Y</td><td width="60%">gsl_sf_airy_Ai_deriv(dbl_expr)</td></tr>
<tr><td width="35%">gsl_sf_airy_Bi_deriv_e</td><td width="5%">Y</td><td width="60%">gsl_sf_airy_Bi_deriv(dbl_expr)</td></tr>
<tr><td width="35%">gsl_sf_airy_Ai_deriv_scaled_e</td><td width="5%">Y</td><td width="60%">gsl_sf_airy_Ai_deriv_scaled(dbl_expr)</td></tr>
<tr><td width="35%">gsl_sf_airy_Bi_deriv_scaled_e</td><td width="5%">Y</td><td width="60%">gsl_sf_airy_Bi_deriv_scaled(dbl_expr)</td></tr>
<tr><td width="35%">gsl_sf_airy_zero_Ai_e</td><td width="5%">Y</td><td width="60%">gsl_sf_airy_zero_Ai(uint_expr)</td></tr>
<tr><td width="35%">gsl_sf_airy_zero_Bi_e</td><td width="5%">Y</td><td width="60%">gsl_sf_airy_zero_Bi(uint_expr)</td></tr>
<tr><td width="35%">gsl_sf_airy_zero_Ai_deriv_e</td><td width="5%">Y</td><td width="60%">gsl_sf_airy_zero_Ai_deriv(uint_expr)</td></tr>
<tr><td width="35%">gsl_sf_airy_zero_Bi_deriv_e</td><td width="5%">Y</td><td width="60%">gsl_sf_airy_zero_Bi_deriv(uint_expr)</td></tr>
<tr><td width="35%">gsl_sf_bessel_J0_e</td><td width="5%">Y</td><td width="60%">gsl_sf_bessel_J0(dbl_expr)</td></tr>
<tr><td width="35%">gsl_sf_bessel_J1_e</td><td width="5%">Y</td><td width="60%">gsl_sf_bessel_J1(dbl_expr)</td></tr>
<tr><td width="35%">gsl_sf_bessel_Jn_e</td><td width="5%">Y</td><td width="60%">gsl_sf_bessel_Jn(int_expr,dbl_expr)</td></tr>
<tr><td width="35%">gsl_sf_bessel_Jn_array</td><td width="5%">Y</td><td width="60%">status=gsl_sf_bessel_Jn_array(int,int,double,&var_out)</td></tr>
<tr><td width="35%">gsl_sf_bessel_Y0_e</td><td width="5%">Y</td><td width="60%">gsl_sf_bessel_Y0(dbl_expr)</td></tr>
<tr><td width="35%">gsl_sf_bessel_Y1_e</td><td width="5%">Y</td><td width="60%">gsl_sf_bessel_Y1(dbl_expr)</td></tr>
<tr><td width="35%">gsl_sf_bessel_Yn_e</td><td width="5%">Y</td><td width="60%">gsl_sf_bessel_Yn(int_expr,dbl_expr)</td></tr>
<tr><td width="35%">gsl_sf_bessel_Yn_array</td><td width="5%">Y</td><td width="60%">gsl_sf_bessel_Yn_array</td></tr>
<tr><td width="35%">gsl_sf_bessel_I0_e</td><td width="5%">Y</td><td width="60%">gsl_sf_bessel_I0(dbl_expr)</td></tr>
<tr><td width="35%">gsl_sf_bessel_I1_e</td><td width="5%">Y</td><td width="60%">gsl_sf_bessel_I1(dbl_expr)</td></tr>
<tr><td width="35%">gsl_sf_bessel_In_e</td><td width="5%">Y</td><td width="60%">gsl_sf_bessel_In(int_expr,dbl_expr)</td></tr>
<tr><td width="35%">gsl_sf_bessel_In_array</td><td width="5%">Y</td><td width="60%">status=gsl_sf_bessel_In_array(int,int,double,&var_out)</td></tr>
<tr><td width="35%">gsl_sf_bessel_I0_scaled_e</td><td width="5%">Y</td><td width="60%">gsl_sf_bessel_I0_scaled(dbl_expr)</td></tr>
<tr><td width="35%">gsl_sf_bessel_I1_scaled_e</td><td width="5%">Y</td><td width="60%">gsl_sf_bessel_I1_scaled(dbl_expr)</td></tr>
<tr><td width="35%">gsl_sf_bessel_In_scaled_e</td><td width="5%">Y</td><td width="60%">gsl_sf_bessel_In_scaled(int_expr,dbl_expr)</td></tr>
<tr><td width="35%">gsl_sf_bessel_In_scaled_array</td><td width="5%">Y</td><td width="60%">staus=gsl_sf_bessel_In_scaled_array(int,int,double,&var_out)</td></tr>
<tr><td width="35%">gsl_sf_bessel_K0_e</td><td width="5%">Y</td><td width="60%">gsl_sf_bessel_K0(dbl_expr)</td></tr>
<tr><td width="35%">gsl_sf_bessel_K1_e</td><td width="5%">Y</td><td width="60%">gsl_sf_bessel_K1(dbl_expr)</td></tr>
<tr><td width="35%">gsl_sf_bessel_Kn_e</td><td width="5%">Y</td><td width="60%">gsl_sf_bessel_Kn(int_expr,dbl_expr)</td></tr>
<tr><td width="35%">gsl_sf_bessel_Kn_array</td><td width="5%">Y</td><td width="60%">status=gsl_sf_bessel_Kn_array(int,int,double,&var_out)</td></tr>
<tr><td width="35%">gsl_sf_bessel_K0_scaled_e</td><td width="5%">Y</td><td width="60%">gsl_sf_bessel_K0_scaled(dbl_expr)</td></tr>
<tr><td width="35%">gsl_sf_bessel_K1_scaled_e</td><td width="5%">Y</td><td width="60%">gsl_sf_bessel_K1_scaled(dbl_expr)</td></tr>
<tr><td width="35%">gsl_sf_bessel_Kn_scaled_e</td><td width="5%">Y</td><td width="60%">gsl_sf_bessel_Kn_scaled(int_expr,dbl_expr)</td></tr>
<tr><td width="35%">gsl_sf_bessel_Kn_scaled_array</td><td width="5%">Y</td><td width="60%">status=gsl_sf_bessel_Kn_scaled_array(int,int,double,&var_out)</td></tr>
<tr><td width="35%">gsl_sf_bessel_j0_e</td><td width="5%">Y</td><td width="60%">gsl_sf_bessel_J0(dbl_expr)</td></tr>
<tr><td width="35%">gsl_sf_bessel_j1_e</td><td width="5%">Y</td><td width="60%">gsl_sf_bessel_J1(dbl_expr)</td></tr>
<tr><td width="35%">gsl_sf_bessel_j2_e</td><td width="5%">Y</td><td width="60%">gsl_sf_bessel_j2(dbl_expr)</td></tr>
<tr><td width="35%">gsl_sf_bessel_jl_e</td><td width="5%">Y</td><td width="60%">gsl_sf_bessel_jl(int_expr,dbl_expr)</td></tr>
<tr><td width="35%">gsl_sf_bessel_jl_array</td><td width="5%">Y</td><td width="60%">status=gsl_sf_bessel_jl_array(int,double,&var_out)</td></tr>
<tr><td width="35%">gsl_sf_bessel_jl_steed_array</td><td width="5%">Y</td><td width="60%">gsl_sf_bessel_jl_steed_array</td></tr>
<tr><td width="35%">gsl_sf_bessel_y0_e</td><td width="5%">Y</td><td width="60%">gsl_sf_bessel_Y0(dbl_expr)</td></tr>
<tr><td width="35%">gsl_sf_bessel_y1_e</td><td width="5%">Y</td><td width="60%">gsl_sf_bessel_Y1(dbl_expr)</td></tr>
<tr><td width="35%">gsl_sf_bessel_y2_e</td><td width="5%">Y</td><td width="60%">gsl_sf_bessel_y2(dbl_expr)</td></tr>
<tr><td width="35%">gsl_sf_bessel_yl_e</td><td width="5%">Y</td><td width="60%">gsl_sf_bessel_yl(int_expr,dbl_expr)</td></tr>
<tr><td width="35%">gsl_sf_bessel_yl_array</td><td width="5%">Y</td><td width="60%">status=gsl_sf_bessel_yl_array(int,double,&var_out)</td></tr>
<tr><td width="35%">gsl_sf_bessel_i0_scaled_e</td><td width="5%">Y</td><td width="60%">gsl_sf_bessel_I0_scaled(dbl_expr)</td></tr>
<tr><td width="35%">gsl_sf_bessel_i1_scaled_e</td><td width="5%">Y</td><td width="60%">gsl_sf_bessel_I1_scaled(dbl_expr)</td></tr>
<tr><td width="35%">gsl_sf_bessel_i2_scaled_e</td><td width="5%">Y</td><td width="60%">gsl_sf_bessel_i2_scaled(dbl_expr)</td></tr>
<tr><td width="35%">gsl_sf_bessel_il_scaled_e</td><td width="5%">Y</td><td width="60%">gsl_sf_bessel_il_scaled(int_expr,dbl_expr)</td></tr>
<tr><td width="35%">gsl_sf_bessel_il_scaled_array</td><td width="5%">Y</td><td width="60%">status=gsl_sf_bessel_il_scaled_array(int,double,&var_out)</td></tr>
<tr><td width="35%">gsl_sf_bessel_k0_scaled_e</td><td width="5%">Y</td><td width="60%">gsl_sf_bessel_K0_scaled(dbl_expr)</td></tr>
<tr><td width="35%">gsl_sf_bessel_k1_scaled_e</td><td width="5%">Y</td><td width="60%">gsl_sf_bessel_K1_scaled(dbl_expr)</td></tr>
<tr><td width="35%">gsl_sf_bessel_k2_scaled_e</td><td width="5%">Y</td><td width="60%">gsl_sf_bessel_k2_scaled(dbl_expr)</td></tr>
<tr><td width="35%">gsl_sf_bessel_kl_scaled_e</td><td width="5%">Y</td><td width="60%">gsl_sf_bessel_kl_scaled(int_expr,dbl_expr)</td></tr>
<tr><td width="35%">gsl_sf_bessel_kl_scaled_array</td><td width="5%">Y</td><td width="60%">status=gsl_sf_bessel_kl_scaled_array(int,double,&var_out)</td></tr>
<tr><td width="35%">gsl_sf_bessel_Jnu_e</td><td width="5%">Y</td><td width="60%">gsl_sf_bessel_Jnu(dbl_expr,dbl_expr)</td></tr>
<tr><td width="35%">gsl_sf_bessel_Ynu_e</td><td width="5%">Y</td><td width="60%">gsl_sf_bessel_Ynu(dbl_expr,dbl_expr)</td></tr>
<tr><td width="35%">gsl_sf_bessel_sequence_Jnu_e</td><td width="5%">N</td><td width="60%">gsl_sf_bessel_sequence_Jnu</td></tr>
<tr><td width="35%">gsl_sf_bessel_Inu_scaled_e</td><td width="5%">Y</td><td width="60%">gsl_sf_bessel_Inu_scaled(dbl_expr,dbl_expr)</td></tr>
<tr><td width="35%">gsl_sf_bessel_Inu_e</td><td width="5%">Y</td><td width="60%">gsl_sf_bessel_Inu(dbl_expr,dbl_expr)</td></tr>
<tr><td width="35%">gsl_sf_bessel_Knu_scaled_e</td><td width="5%">Y</td><td width="60%">gsl_sf_bessel_Knu_scaled(dbl_expr,dbl_expr)</td></tr>
<tr><td width="35%">gsl_sf_bessel_Knu_e</td><td width="5%">Y</td><td width="60%">gsl_sf_bessel_Knu(dbl_expr,dbl_expr)</td></tr>
<tr><td width="35%">gsl_sf_bessel_lnKnu_e</td><td width="5%">Y</td><td width="60%">gsl_sf_bessel_lnKnu(dbl_expr,dbl_expr)</td></tr>
<tr><td width="35%">gsl_sf_bessel_zero_J0_e</td><td width="5%">Y</td><td width="60%">gsl_sf_bessel_zero_J0(uint_expr)</td></tr>
<tr><td width="35%">gsl_sf_bessel_zero_J1_e</td><td width="5%">Y</td><td width="60%">gsl_sf_bessel_zero_J1(uint_expr)</td></tr>
<tr><td width="35%">gsl_sf_bessel_zero_Jnu_e</td><td width="5%">N</td><td width="60%">gsl_sf_bessel_zero_Jnu</td></tr>
<tr><td width="35%">gsl_sf_clausen_e</td><td width="5%">Y</td><td width="60%">gsl_sf_clausen(dbl_expr)</td></tr>
<tr><td width="35%">gsl_sf_hydrogenicR_1_e</td><td width="5%">N</td><td width="60%">gsl_sf_hydrogenicR_1</td></tr>
<tr><td width="35%">gsl_sf_hydrogenicR_e</td><td width="5%">N</td><td width="60%">gsl_sf_hydrogenicR</td></tr>
<tr><td width="35%">gsl_sf_coulomb_wave_FG_e</td><td width="5%">N</td><td width="60%">gsl_sf_coulomb_wave_FG</td></tr>
<tr><td width="35%">gsl_sf_coulomb_wave_F_array</td><td width="5%">N</td><td width="60%">gsl_sf_coulomb_wave_F_array</td></tr>
<tr><td width="35%">gsl_sf_coulomb_wave_FG_array</td><td width="5%">N</td><td width="60%">gsl_sf_coulomb_wave_FG_array</td></tr>
<tr><td width="35%">gsl_sf_coulomb_wave_FGp_array</td><td width="5%">N</td><td width="60%">gsl_sf_coulomb_wave_FGp_array</td></tr>
<tr><td width="35%">gsl_sf_coulomb_wave_sphF_array</td><td width="5%">N</td><td width="60%">gsl_sf_coulomb_wave_sphF_array</td></tr>
<tr><td width="35%">gsl_sf_coulomb_CL_e</td><td width="5%">N</td><td width="60%">gsl_sf_coulomb_CL</td></tr>
<tr><td width="35%">gsl_sf_coulomb_CL_array</td><td width="5%">N</td><td width="60%">gsl_sf_coulomb_CL_array</td></tr>
<tr><td width="35%">gsl_sf_coupling_3j_e</td><td width="5%">N</td><td width="60%">gsl_sf_coupling_3j</td></tr>
<tr><td width="35%">gsl_sf_coupling_6j_e</td><td width="5%">N</td><td width="60%">gsl_sf_coupling_6j</td></tr>
<tr><td width="35%">gsl_sf_coupling_RacahW_e</td><td width="5%">N</td><td width="60%">gsl_sf_coupling_RacahW</td></tr>
<tr><td width="35%">gsl_sf_coupling_9j_e</td><td width="5%">N</td><td width="60%">gsl_sf_coupling_9j</td></tr>
<tr><td width="35%">gsl_sf_coupling_6j_INCORRECT_e</td><td width="5%">N</td><td width="60%">gsl_sf_coupling_6j_INCORRECT</td></tr>
<tr><td width="35%">gsl_sf_dawson_e</td><td width="5%">Y</td><td width="60%">gsl_sf_dawson(dbl_expr)</td></tr>
<tr><td width="35%">gsl_sf_debye_1_e</td><td width="5%">Y</td><td width="60%">gsl_sf_debye_1(dbl_expr)</td></tr>
<tr><td width="35%">gsl_sf_debye_2_e</td><td width="5%">Y</td><td width="60%">gsl_sf_debye_2(dbl_expr)</td></tr>
<tr><td width="35%">gsl_sf_debye_3_e</td><td width="5%">Y</td><td width="60%">gsl_sf_debye_3(dbl_expr)</td></tr>
<tr><td width="35%">gsl_sf_debye_4_e</td><td width="5%">Y</td><td width="60%">gsl_sf_debye_4(dbl_expr)</td></tr>
<tr><td width="35%">gsl_sf_debye_5_e</td><td width="5%">Y</td><td width="60%">gsl_sf_debye_5(dbl_expr)</td></tr>
<tr><td width="35%">gsl_sf_debye_6_e</td><td width="5%">Y</td><td width="60%">gsl_sf_debye_6(dbl_expr)</td></tr>
<tr><td width="35%">gsl_sf_dilog_e</td><td width="5%">N</td><td width="60%">gsl_sf_dilog</td></tr>
<tr><td width="35%">gsl_sf_complex_dilog_xy_e</td><td width="5%">N</td><td width="60%">gsl_sf_complex_dilog_xy_e</td></tr>
<tr><td width="35%">gsl_sf_complex_dilog_e</td><td width="5%">N</td><td width="60%">gsl_sf_complex_dilog</td></tr>
<tr><td width="35%">gsl_sf_complex_spence_xy_e</td><td width="5%">N</td><td width="60%">gsl_sf_complex_spence_xy_e</td></tr>
<tr><td width="35%">gsl_sf_multiply_e</td><td width="5%">N</td><td width="60%">gsl_sf_multiply</td></tr>
<tr><td width="35%">gsl_sf_multiply_err_e</td><td width="5%">N</td><td width="60%">gsl_sf_multiply_err</td></tr>
<tr><td width="35%">gsl_sf_ellint_Kcomp_e</td><td width="5%">Y</td><td width="60%">gsl_sf_ellint_Kcomp(dbl_expr)</td></tr>
<tr><td width="35%">gsl_sf_ellint_Ecomp_e</td><td width="5%">Y</td><td width="60%">gsl_sf_ellint_Ecomp(dbl_expr)</td></tr>
<tr><td width="35%">gsl_sf_ellint_Pcomp_e</td><td width="5%">Y</td><td width="60%">gsl_sf_ellint_Pcomp(dbl_expr,dbl_expr)</td></tr>
<tr><td width="35%">gsl_sf_ellint_Dcomp_e</td><td width="5%">Y</td><td width="60%">gsl_sf_ellint_Dcomp(dbl_expr)</td></tr>
<tr><td width="35%">gsl_sf_ellint_F_e</td><td width="5%">Y</td><td width="60%">gsl_sf_ellint_F(dbl_expr,dbl_expr)</td></tr>
<tr><td width="35%">gsl_sf_ellint_E_e</td><td width="5%">Y</td><td width="60%">gsl_sf_ellint_E(dbl_expr,dbl_expr)</td></tr>
<tr><td width="35%">gsl_sf_ellint_P_e</td><td width="5%">Y</td><td width="60%">gsl_sf_ellint_P(dbl_expr,dbl_expr,dbl_expr)</td></tr>
<tr><td width="35%">gsl_sf_ellint_D_e</td><td width="5%">Y</td><td width="60%">gsl_sf_ellint_D(dbl_expr,dbl_expr,dbl_expr)</td></tr>
<tr><td width="35%">gsl_sf_ellint_RC_e</td><td width="5%">Y</td><td width="60%">gsl_sf_ellint_RC(dbl_expr,dbl_expr)</td></tr>
<tr><td width="35%">gsl_sf_ellint_RD_e</td><td width="5%">Y</td><td width="60%">gsl_sf_ellint_RD(dbl_expr,dbl_expr,dbl_expr)</td></tr>
<tr><td width="35%">gsl_sf_ellint_RF_e</td><td width="5%">Y</td><td width="60%">gsl_sf_ellint_RF(dbl_expr,dbl_expr,dbl_expr)</td></tr>
<tr><td width="35%">gsl_sf_ellint_RJ_e</td><td width="5%">Y</td><td width="60%">gsl_sf_ellint_RJ(dbl_expr,dbl_expr,dbl_expr,dbl_expr)</td></tr>
<tr><td width="35%">gsl_sf_elljac_e</td><td width="5%">N</td><td width="60%">gsl_sf_elljac</td></tr>
<tr><td width="35%">gsl_sf_erfc_e</td><td width="5%">Y</td><td width="60%">gsl_sf_erfc(dbl_expr)</td></tr>
<tr><td width="35%">gsl_sf_log_erfc_e</td><td width="5%">Y</td><td width="60%">gsl_sf_log_erfc(dbl_expr)</td></tr>
<tr><td width="35%">gsl_sf_erf_e</td><td width="5%">Y</td><td width="60%">gsl_sf_erf(dbl_expr)</td></tr>
<tr><td width="35%">gsl_sf_erf_Z_e</td><td width="5%">Y</td><td width="60%">gsl_sf_erf_Z(dbl_expr)</td></tr>
<tr><td width="35%">gsl_sf_erf_Q_e</td><td width="5%">Y</td><td width="60%">gsl_sf_erf_Q(dbl_expr)</td></tr>
<tr><td width="35%">gsl_sf_hazard_e</td><td width="5%">Y</td><td width="60%">gsl_sf_hazard(dbl_expr)</td></tr>
<tr><td width="35%">gsl_sf_exp_e</td><td width="5%">Y</td><td width="60%">gsl_sf_exp(dbl_expr)</td></tr>
<tr><td width="35%">gsl_sf_exp_e10_e</td><td width="5%">N</td><td width="60%">gsl_sf_exp_e10</td></tr>
<tr><td width="35%">gsl_sf_exp_mult_e</td><td width="5%">Y</td><td width="60%">gsl_sf_exp_mult(dbl_expr,dbl_expr)</td></tr>
<tr><td width="35%">gsl_sf_exp_mult_e10_e</td><td width="5%">N</td><td width="60%">gsl_sf_exp_mult_e10</td></tr>
<tr><td width="35%">gsl_sf_expm1_e</td><td width="5%">Y</td><td width="60%">gsl_sf_expm1(dbl_expr)</td></tr>
<tr><td width="35%">gsl_sf_exprel_e</td><td width="5%">Y</td><td width="60%">gsl_sf_exprel(dbl_expr)</td></tr>
<tr><td width="35%">gsl_sf_exprel_2_e</td><td width="5%">Y</td><td width="60%">gsl_sf_exprel_2(dbl_expr)</td></tr>
<tr><td width="35%">gsl_sf_exprel_n_e</td><td width="5%">Y</td><td width="60%">gsl_sf_exprel_n(int_expr,dbl_expr)</td></tr>
<tr><td width="35%">gsl_sf_exp_err_e</td><td width="5%">Y</td><td width="60%">gsl_sf_exp_err(dbl_expr,dbl_expr)</td></tr>
<tr><td width="35%">gsl_sf_exp_err_e10_e</td><td width="5%">N</td><td width="60%">gsl_sf_exp_err_e10</td></tr>
<tr><td width="35%">gsl_sf_exp_mult_err_e</td><td width="5%">N</td><td width="60%">gsl_sf_exp_mult_err</td></tr>
<tr><td width="35%">gsl_sf_exp_mult_err_e10_e</td><td width="5%">N</td><td width="60%">gsl_sf_exp_mult_err_e10</td></tr>
<tr><td width="35%">gsl_sf_expint_E1_e</td><td width="5%">Y</td><td width="60%">gsl_sf_expint_E1(dbl_expr)</td></tr>
<tr><td width="35%">gsl_sf_expint_E2_e</td><td width="5%">Y</td><td width="60%">gsl_sf_expint_E2(dbl_expr)</td></tr>
<tr><td width="35%">gsl_sf_expint_En_e</td><td width="5%">Y</td><td width="60%">gsl_sf_expint_En(int_expr,dbl_expr)</td></tr>
<tr><td width="35%">gsl_sf_expint_E1_scaled_e</td><td width="5%">Y</td><td width="60%">gsl_sf_expint_E1_scaled(dbl_expr)</td></tr>
<tr><td width="35%">gsl_sf_expint_E2_scaled_e</td><td width="5%">Y</td><td width="60%">gsl_sf_expint_E2_scaled(dbl_expr)</td></tr>
<tr><td width="35%">gsl_sf_expint_En_scaled_e</td><td width="5%">Y</td><td width="60%">gsl_sf_expint_En_scaled(int_expr,dbl_expr)</td></tr>
<tr><td width="35%">gsl_sf_expint_Ei_e</td><td width="5%">Y</td><td width="60%">gsl_sf_expint_Ei(dbl_expr)</td></tr>
<tr><td width="35%">gsl_sf_expint_Ei_scaled_e</td><td width="5%">Y</td><td width="60%">gsl_sf_expint_Ei_scaled(dbl_expr)</td></tr>
<tr><td width="35%">gsl_sf_Shi_e</td><td width="5%">Y</td><td width="60%">gsl_sf_Shi(dbl_expr)</td></tr>
<tr><td width="35%">gsl_sf_Chi_e</td><td width="5%">Y</td><td width="60%">gsl_sf_Chi(dbl_expr)</td></tr>
<tr><td width="35%">gsl_sf_expint_3_e</td><td width="5%">Y</td><td width="60%">gsl_sf_expint_3(dbl_expr)</td></tr>
<tr><td width="35%">gsl_sf_Si_e</td><td width="5%">Y</td><td width="60%">gsl_sf_Si(dbl_expr)</td></tr>
<tr><td width="35%">gsl_sf_Ci_e</td><td width="5%">Y</td><td width="60%">gsl_sf_Ci(dbl_expr)</td></tr>
<tr><td width="35%">gsl_sf_atanint_e</td><td width="5%">Y</td><td width="60%">gsl_sf_atanint(dbl_expr)</td></tr>
<tr><td width="35%">gsl_sf_fermi_dirac_m1_e</td><td width="5%">Y</td><td width="60%">gsl_sf_fermi_dirac_m1(dbl_expr)</td></tr>
<tr><td width="35%">gsl_sf_fermi_dirac_0_e</td><td width="5%">Y</td><td width="60%">gsl_sf_fermi_dirac_0(dbl_expr)</td></tr>
<tr><td width="35%">gsl_sf_fermi_dirac_1_e</td><td width="5%">Y</td><td width="60%">gsl_sf_fermi_dirac_1(dbl_expr)</td></tr>
<tr><td width="35%">gsl_sf_fermi_dirac_2_e</td><td width="5%">Y</td><td width="60%">gsl_sf_fermi_dirac_2(dbl_expr)</td></tr>
<tr><td width="35%">gsl_sf_fermi_dirac_int_e</td><td width="5%">Y</td><td width="60%">gsl_sf_fermi_dirac_int(int_expr,dbl_expr)</td></tr>
<tr><td width="35%">gsl_sf_fermi_dirac_mhalf_e</td><td width="5%">Y</td><td width="60%">gsl_sf_fermi_dirac_mhalf(dbl_expr)</td></tr>
<tr><td width="35%">gsl_sf_fermi_dirac_half_e</td><td width="5%">Y</td><td width="60%">gsl_sf_fermi_dirac_half(dbl_expr)</td></tr>
<tr><td width="35%">gsl_sf_fermi_dirac_3half_e</td><td width="5%">Y</td><td width="60%">gsl_sf_fermi_dirac_3half(dbl_expr)</td></tr>
<tr><td width="35%">gsl_sf_fermi_dirac_inc_0_e</td><td width="5%">Y</td><td width="60%">gsl_sf_fermi_dirac_inc_0(dbl_expr,dbl_expr)</td></tr>
<tr><td width="35%">gsl_sf_lngamma_e</td><td width="5%">Y</td><td width="60%">gsl_sf_lngamma(dbl_expr)</td></tr>
<tr><td width="35%">gsl_sf_lngamma_sgn_e</td><td width="5%">N</td><td width="60%">gsl_sf_lngamma_sgn</td></tr>
<tr><td width="35%">gsl_sf_gamma_e</td><td width="5%">Y</td><td width="60%">gsl_sf_gamma(dbl_expr)</td></tr>
<tr><td width="35%">gsl_sf_gammastar_e</td><td width="5%">Y</td><td width="60%">gsl_sf_gammastar(dbl_expr)</td></tr>
<tr><td width="35%">gsl_sf_gammainv_e</td><td width="5%">Y</td><td width="60%">gsl_sf_gammainv(dbl_expr)</td></tr>
<tr><td width="35%">gsl_sf_lngamma_complex_e</td><td width="5%">N</td><td width="60%">gsl_sf_lngamma_complex</td></tr>
<tr><td width="35%">gsl_sf_taylorcoeff_e</td><td width="5%">Y</td><td width="60%">gsl_sf_taylorcoeff(int_expr,dbl_expr)</td></tr>
<tr><td width="35%">gsl_sf_fact_e</td><td width="5%">Y</td><td width="60%">gsl_sf_fact(uint_expr)</td></tr>
<tr><td width="35%">gsl_sf_doublefact_e</td><td width="5%">Y</td><td width="60%">gsl_sf_doublefact(uint_expr)</td></tr>
<tr><td width="35%">gsl_sf_lnfact_e</td><td width="5%">Y</td><td width="60%">gsl_sf_lnfact(uint_expr)</td></tr>
<tr><td width="35%">gsl_sf_lndoublefact_e</td><td width="5%">Y</td><td width="60%">gsl_sf_lndoublefact(uint_expr)</td></tr>
<tr><td width="35%">gsl_sf_lnchoose_e</td><td width="5%">N</td><td width="60%">gsl_sf_lnchoose</td></tr>
<tr><td width="35%">gsl_sf_choose_e</td><td width="5%">N</td><td width="60%">gsl_sf_choose</td></tr>
<tr><td width="35%">gsl_sf_lnpoch_e</td><td width="5%">Y</td><td width="60%">gsl_sf_lnpoch(dbl_expr,dbl_expr)</td></tr>
<tr><td width="35%">gsl_sf_lnpoch_sgn_e</td><td width="5%">N</td><td width="60%">gsl_sf_lnpoch_sgn</td></tr>
<tr><td width="35%">gsl_sf_poch_e</td><td width="5%">Y</td><td width="60%">gsl_sf_poch(dbl_expr,dbl_expr)</td></tr>
<tr><td width="35%">gsl_sf_pochrel_e</td><td width="5%">Y</td><td width="60%">gsl_sf_pochrel(dbl_expr,dbl_expr)</td></tr>
<tr><td width="35%">gsl_sf_gamma_inc_Q_e</td><td width="5%">Y</td><td width="60%">gsl_sf_gamma_inc_Q(dbl_expr,dbl_expr)</td></tr>
<tr><td width="35%">gsl_sf_gamma_inc_P_e</td><td width="5%">Y</td><td width="60%">gsl_sf_gamma_inc_P(dbl_expr,dbl_expr)</td></tr>
<tr><td width="35%">gsl_sf_gamma_inc_e</td><td width="5%">Y</td><td width="60%">gsl_sf_gamma_inc(dbl_expr,dbl_expr)</td></tr>
<tr><td width="35%">gsl_sf_lnbeta_e</td><td width="5%">Y</td><td width="60%">gsl_sf_lnbeta(dbl_expr,dbl_expr)</td></tr>
<tr><td width="35%">gsl_sf_lnbeta_sgn_e</td><td width="5%">N</td><td width="60%">gsl_sf_lnbeta_sgn</td></tr>
<tr><td width="35%">gsl_sf_beta_e</td><td width="5%">Y</td><td width="60%">gsl_sf_beta(dbl_expr,dbl_expr)</td></tr>
<tr><td width="35%">gsl_sf_beta_inc_e</td><td width="5%">N</td><td width="60%">gsl_sf_beta_inc</td></tr>
<tr><td width="35%">gsl_sf_gegenpoly_1_e</td><td width="5%">Y</td><td width="60%">gsl_sf_gegenpoly_1(dbl_expr,dbl_expr)</td></tr>
<tr><td width="35%">gsl_sf_gegenpoly_2_e</td><td width="5%">Y</td><td width="60%">gsl_sf_gegenpoly_2(dbl_expr,dbl_expr)</td></tr>
<tr><td width="35%">gsl_sf_gegenpoly_3_e</td><td width="5%">Y</td><td width="60%">gsl_sf_gegenpoly_3(dbl_expr,dbl_expr)</td></tr>
<tr><td width="35%">gsl_sf_gegenpoly_n_e</td><td width="5%">N</td><td width="60%">gsl_sf_gegenpoly_n</td></tr>
<tr><td width="35%">gsl_sf_gegenpoly_array</td><td width="5%">Y</td><td width="60%">gsl_sf_gegenpoly_array</td></tr>
<tr><td width="35%">gsl_sf_hyperg_0F1_e</td><td width="5%">Y</td><td width="60%">gsl_sf_hyperg_0F1(dbl_expr,dbl_expr)</td></tr>
<tr><td width="35%">gsl_sf_hyperg_1F1_int_e</td><td width="5%">Y</td><td width="60%">gsl_sf_hyperg_1F1_int(int_expr,int_expr,dbl_expr)</td></tr>
<tr><td width="35%">gsl_sf_hyperg_1F1_e</td><td width="5%">Y</td><td width="60%">gsl_sf_hyperg_1F1(dbl_expr,dbl_expr,dbl_expr)</td></tr>
<tr><td width="35%">gsl_sf_hyperg_U_int_e</td><td width="5%">Y</td><td width="60%">gsl_sf_hyperg_U_int(int_expr,int_expr,dbl_expr)</td></tr>
<tr><td width="35%">gsl_sf_hyperg_U_int_e10_e</td><td width="5%">N</td><td width="60%">gsl_sf_hyperg_U_int_e10</td></tr>
<tr><td width="35%">gsl_sf_hyperg_U_e</td><td width="5%">Y</td><td width="60%">gsl_sf_hyperg_U(dbl_expr,dbl_expr,dbl_expr)</td></tr>
<tr><td width="35%">gsl_sf_hyperg_U_e10_e</td><td width="5%">N</td><td width="60%">gsl_sf_hyperg_U_e10</td></tr>
<tr><td width="35%">gsl_sf_hyperg_2F1_e</td><td width="5%">Y</td><td width="60%">gsl_sf_hyperg_2F1(dbl_expr,dbl_expr,dbl_expr,dbl_expr)</td></tr>
<tr><td width="35%">gsl_sf_hyperg_2F1_conj_e</td><td width="5%">Y</td><td width="60%">gsl_sf_hyperg_2F1_conj(dbl_expr,dbl_expr,dbl_expr,dbl_expr)</td></tr>
<tr><td width="35%">gsl_sf_hyperg_2F1_renorm_e</td><td width="5%">Y</td><td width="60%">gsl_sf_hyperg_2F1_renorm(dbl_expr,dbl_expr,dbl_expr,dbl_expr)</td></tr>
<tr><td width="35%">gsl_sf_hyperg_2F1_conj_renorm_e</td><td width="5%">Y</td><td width="60%">gsl_sf_hyperg_2F1_conj_renorm(dbl_expr,dbl_expr,dbl_expr,dbl_expr)</td></tr>
<tr><td width="35%">gsl_sf_hyperg_2F0_e</td><td width="5%">Y</td><td width="60%">gsl_sf_hyperg_2F0(dbl_expr,dbl_expr,dbl_expr)</td></tr>
<tr><td width="35%">gsl_sf_laguerre_1_e</td><td width="5%">Y</td><td width="60%">gsl_sf_laguerre_1(dbl_expr,dbl_expr)</td></tr>
<tr><td width="35%">gsl_sf_laguerre_2_e</td><td width="5%">Y</td><td width="60%">gsl_sf_laguerre_2(dbl_expr,dbl_expr)</td></tr>
<tr><td width="35%">gsl_sf_laguerre_3_e</td><td width="5%">Y</td><td width="60%">gsl_sf_laguerre_3(dbl_expr,dbl_expr)</td></tr>
<tr><td width="35%">gsl_sf_laguerre_n_e</td><td width="5%">Y</td><td width="60%">gsl_sf_laguerre_n(int_expr,dbl_expr,dbl_expr)</td></tr>
<tr><td width="35%">gsl_sf_lambert_W0_e</td><td width="5%">Y</td><td width="60%">gsl_sf_lambert_W0(dbl_expr)</td></tr>
<tr><td width="35%">gsl_sf_lambert_Wm1_e</td><td width="5%">Y</td><td width="60%">gsl_sf_lambert_Wm1(dbl_expr)</td></tr>
<tr><td width="35%">gsl_sf_legendre_Pl_e</td><td width="5%">Y</td><td width="60%">gsl_sf_legendre_Pl(int_expr,dbl_expr)</td></tr>
<tr><td width="35%">gsl_sf_legendre_Pl_array</td><td width="5%">Y</td><td width="60%">status=gsl_sf_legendre_Pl_array(int,double,&var_out)</td></tr>
<tr><td width="35%">gsl_sf_legendre_Pl_deriv_array</td><td width="5%">N</td><td width="60%">gsl_sf_legendre_Pl_deriv_array</td></tr>
<tr><td width="35%">gsl_sf_legendre_P1_e</td><td width="5%">Y</td><td width="60%">gsl_sf_legendre_P1(dbl_expr)</td></tr>
<tr><td width="35%">gsl_sf_legendre_P2_e</td><td width="5%">Y</td><td width="60%">gsl_sf_legendre_P2(dbl_expr)</td></tr>
<tr><td width="35%">gsl_sf_legendre_P3_e</td><td width="5%">Y</td><td width="60%">gsl_sf_legendre_P3(dbl_expr)</td></tr>
<tr><td width="35%">gsl_sf_legendre_Q0_e</td><td width="5%">Y</td><td width="60%">gsl_sf_legendre_Q0(dbl_expr)</td></tr>
<tr><td width="35%">gsl_sf_legendre_Q1_e</td><td width="5%">Y</td><td width="60%">gsl_sf_legendre_Q1(dbl_expr)</td></tr>
<tr><td width="35%">gsl_sf_legendre_Ql_e</td><td width="5%">Y</td><td width="60%">gsl_sf_legendre_Ql(int_expr,dbl_expr)</td></tr>
<tr><td width="35%">gsl_sf_legendre_Plm_e</td><td width="5%">Y</td><td width="60%">gsl_sf_legendre_Plm(int_expr,int_expr,dbl_expr)</td></tr>
<tr><td width="35%">gsl_sf_legendre_Plm_array</td><td width="5%">Y</td><td width="60%">status=gsl_sf_legendre_Plm_array(int,int,double,&var_out)</td></tr>
<tr><td width="35%">gsl_sf_legendre_Plm_deriv_array</td><td width="5%">N</td><td width="60%">gsl_sf_legendre_Plm_deriv_array</td></tr>
<tr><td width="35%">gsl_sf_legendre_sphPlm_e</td><td width="5%">Y</td><td width="60%">gsl_sf_legendre_sphPlm(int_expr,int_expr,dbl_expr)</td></tr>
<tr><td width="35%">gsl_sf_legendre_sphPlm_array</td><td width="5%">Y</td><td width="60%">status=gsl_sf_legendre_sphPlm_array(int,int,double,&var_out)</td></tr>
<tr><td width="35%">gsl_sf_legendre_sphPlm_deriv_array</td><td width="5%">N</td><td width="60%">gsl_sf_legendre_sphPlm_deriv_array</td></tr>
<tr><td width="35%">gsl_sf_legendre_array_size</td><td width="5%">N</td><td width="60%">gsl_sf_legendre_array_size</td></tr>
<tr><td width="35%">gsl_sf_conicalP_half_e</td><td width="5%">Y</td><td width="60%">gsl_sf_conicalP_half(dbl_expr,dbl_expr)</td></tr>
<tr><td width="35%">gsl_sf_conicalP_mhalf_e</td><td width="5%">Y</td><td width="60%">gsl_sf_conicalP_mhalf(dbl_expr,dbl_expr)</td></tr>
<tr><td width="35%">gsl_sf_conicalP_0_e</td><td width="5%">Y</td><td width="60%">gsl_sf_conicalP_0(dbl_expr,dbl_expr)</td></tr>
<tr><td width="35%">gsl_sf_conicalP_1_e</td><td width="5%">Y</td><td width="60%">gsl_sf_conicalP_1(dbl_expr,dbl_expr)</td></tr>
<tr><td width="35%">gsl_sf_conicalP_sph_reg_e</td><td width="5%">Y</td><td width="60%">gsl_sf_conicalP_sph_reg(int_expr,dbl_expr,dbl_expr)</td></tr>
<tr><td width="35%">gsl_sf_conicalP_cyl_reg_e</td><td width="5%">Y</td><td width="60%">gsl_sf_conicalP_cyl_reg(int_expr,dbl_expr,dbl_expr)</td></tr>
<tr><td width="35%">gsl_sf_legendre_H3d_0_e</td><td width="5%">Y</td><td width="60%">gsl_sf_legendre_H3d_0(dbl_expr,dbl_expr)</td></tr>
<tr><td width="35%">gsl_sf_legendre_H3d_1_e</td><td width="5%">Y</td><td width="60%">gsl_sf_legendre_H3d_1(dbl_expr,dbl_expr)</td></tr>
<tr><td width="35%">gsl_sf_legendre_H3d_e</td><td width="5%">Y</td><td width="60%">gsl_sf_legendre_H3d(int_expr,dbl_expr,dbl_expr)</td></tr>
<tr><td width="35%">gsl_sf_legendre_H3d_array</td><td width="5%">N</td><td width="60%">gsl_sf_legendre_H3d_array</td></tr>
<tr><td width="35%">gsl_sf_legendre_array_size</td><td width="5%">N</td><td width="60%">gsl_sf_legendre_array_size</td></tr>
<tr><td width="35%">gsl_sf_log_e</td><td width="5%">Y</td><td width="60%">gsl_sf_log(dbl_expr)</td></tr>
<tr><td width="35%">gsl_sf_log_abs_e</td><td width="5%">Y</td><td width="60%">gsl_sf_log_abs(dbl_expr)</td></tr>
<tr><td width="35%">gsl_sf_complex_log_e</td><td width="5%">N</td><td width="60%">gsl_sf_complex_log</td></tr>
<tr><td width="35%">gsl_sf_log_1plusx_e</td><td width="5%">Y</td><td width="60%">gsl_sf_log_1plusx(dbl_expr)</td></tr>
<tr><td width="35%">gsl_sf_log_1plusx_mx_e</td><td width="5%">Y</td><td width="60%">gsl_sf_log_1plusx_mx(dbl_expr)</td></tr>
<tr><td width="35%">gsl_sf_mathieu_a_array</td><td width="5%">N</td><td width="60%">gsl_sf_mathieu_a_array</td></tr>
<tr><td width="35%">gsl_sf_mathieu_b_array</td><td width="5%">N</td><td width="60%">gsl_sf_mathieu_b_array</td></tr>
<tr><td width="35%">gsl_sf_mathieu_a</td><td width="5%">N</td><td width="60%">gsl_sf_mathieu_a</td></tr>
<tr><td width="35%">gsl_sf_mathieu_b</td><td width="5%">N</td><td width="60%">gsl_sf_mathieu_b</td></tr>
<tr><td width="35%">gsl_sf_mathieu_a_coeff</td><td width="5%">N</td><td width="60%">gsl_sf_mathieu_a_coeff</td></tr>
<tr><td width="35%">gsl_sf_mathieu_b_coeff</td><td width="5%">N</td><td width="60%">gsl_sf_mathieu_b_coeff</td></tr>
<tr><td width="35%">gsl_sf_mathieu_ce</td><td width="5%">N</td><td width="60%">gsl_sf_mathieu_ce</td></tr>
<tr><td width="35%">gsl_sf_mathieu_se</td><td width="5%">N</td><td width="60%">gsl_sf_mathieu_se</td></tr>
<tr><td width="35%">gsl_sf_mathieu_ce_array</td><td width="5%">N</td><td width="60%">gsl_sf_mathieu_ce_array</td></tr>
<tr><td width="35%">gsl_sf_mathieu_se_array</td><td width="5%">N</td><td width="60%">gsl_sf_mathieu_se_array</td></tr>
<tr><td width="35%">gsl_sf_mathieu_Mc</td><td width="5%">N</td><td width="60%">gsl_sf_mathieu_Mc</td></tr>
<tr><td width="35%">gsl_sf_mathieu_Ms</td><td width="5%">N</td><td width="60%">gsl_sf_mathieu_Ms</td></tr>
<tr><td width="35%">gsl_sf_mathieu_Mc_array</td><td width="5%">N</td><td width="60%">gsl_sf_mathieu_Mc_array</td></tr>
<tr><td width="35%">gsl_sf_mathieu_Ms_array</td><td width="5%">N</td><td width="60%">gsl_sf_mathieu_Ms_array</td></tr>
<tr><td width="35%">gsl_sf_pow_int_e</td><td width="5%">N</td><td width="60%">gsl_sf_pow_int</td></tr>
<tr><td width="35%">gsl_sf_psi_int_e</td><td width="5%">Y</td><td width="60%">gsl_sf_psi_int(int_expr)</td></tr>
<tr><td width="35%">gsl_sf_psi_e</td><td width="5%">Y</td><td width="60%">gsl_sf_psi(dbl_expr)</td></tr>
<tr><td width="35%">gsl_sf_psi_1piy_e</td><td width="5%">Y</td><td width="60%">gsl_sf_psi_1piy(dbl_expr)</td></tr>
<tr><td width="35%">gsl_sf_complex_psi_e</td><td width="5%">N</td><td width="60%">gsl_sf_complex_psi</td></tr>
<tr><td width="35%">gsl_sf_psi_1_int_e</td><td width="5%">Y</td><td width="60%">gsl_sf_psi_1_int(int_expr)</td></tr>
<tr><td width="35%">gsl_sf_psi_1_e</td><td width="5%">Y</td><td width="60%">gsl_sf_psi_1(dbl_expr)</td></tr>
<tr><td width="35%">gsl_sf_psi_n_e</td><td width="5%">Y</td><td width="60%">gsl_sf_psi_n(int_expr,dbl_expr)</td></tr>
<tr><td width="35%">gsl_sf_synchrotron_1_e</td><td width="5%">Y</td><td width="60%">gsl_sf_synchrotron_1(dbl_expr)</td></tr>
<tr><td width="35%">gsl_sf_synchrotron_2_e</td><td width="5%">Y</td><td width="60%">gsl_sf_synchrotron_2(dbl_expr)</td></tr>
<tr><td width="35%">gsl_sf_transport_2_e</td><td width="5%">Y</td><td width="60%">gsl_sf_transport_2(dbl_expr)</td></tr>
<tr><td width="35%">gsl_sf_transport_3_e</td><td width="5%">Y</td><td width="60%">gsl_sf_transport_3(dbl_expr)</td></tr>
<tr><td width="35%">gsl_sf_transport_4_e</td><td width="5%">Y</td><td width="60%">gsl_sf_transport_4(dbl_expr)</td></tr>
<tr><td width="35%">gsl_sf_transport_5_e</td><td width="5%">Y</td><td width="60%">gsl_sf_transport_5(dbl_expr)</td></tr>
<tr><td width="35%">gsl_sf_sin_e</td><td width="5%">N</td><td width="60%">gsl_sf_sin</td></tr>
<tr><td width="35%">gsl_sf_cos_e</td><td width="5%">N</td><td width="60%">gsl_sf_cos</td></tr>
<tr><td width="35%">gsl_sf_hypot_e</td><td width="5%">N</td><td width="60%">gsl_sf_hypot</td></tr>
<tr><td width="35%">gsl_sf_complex_sin_e</td><td width="5%">N</td><td width="60%">gsl_sf_complex_sin</td></tr>
<tr><td width="35%">gsl_sf_complex_cos_e</td><td width="5%">N</td><td width="60%">gsl_sf_complex_cos</td></tr>
<tr><td width="35%">gsl_sf_complex_logsin_e</td><td width="5%">N</td><td width="60%">gsl_sf_complex_logsin</td></tr>
<tr><td width="35%">gsl_sf_sinc_e</td><td width="5%">N</td><td width="60%">gsl_sf_sinc</td></tr>
<tr><td width="35%">gsl_sf_lnsinh_e</td><td width="5%">N</td><td width="60%">gsl_sf_lnsinh</td></tr>
<tr><td width="35%">gsl_sf_lncosh_e</td><td width="5%">N</td><td width="60%">gsl_sf_lncosh</td></tr>
<tr><td width="35%">gsl_sf_polar_to_rect</td><td width="5%">N</td><td width="60%">gsl_sf_polar_to_rect</td></tr>
<tr><td width="35%">gsl_sf_rect_to_polar</td><td width="5%">N</td><td width="60%">gsl_sf_rect_to_polar</td></tr>
<tr><td width="35%">gsl_sf_sin_err_e</td><td width="5%">N</td><td width="60%">gsl_sf_sin_err</td></tr>
<tr><td width="35%">gsl_sf_cos_err_e</td><td width="5%">N</td><td width="60%">gsl_sf_cos_err</td></tr>
<tr><td width="35%">gsl_sf_angle_restrict_symm_e</td><td width="5%">N</td><td width="60%">gsl_sf_angle_restrict_symm</td></tr>
<tr><td width="35%">gsl_sf_angle_restrict_pos_e</td><td width="5%">N</td><td width="60%">gsl_sf_angle_restrict_pos</td></tr>
<tr><td width="35%">gsl_sf_angle_restrict_symm_err_e</td><td width="5%">N</td><td width="60%">gsl_sf_angle_restrict_symm_err</td></tr>
<tr><td width="35%">gsl_sf_angle_restrict_pos_err_e</td><td width="5%">N</td><td width="60%">gsl_sf_angle_restrict_pos_err</td></tr>
<tr><td width="35%">gsl_sf_zeta_int_e</td><td width="5%">Y</td><td width="60%">gsl_sf_zeta_int(int_expr)</td></tr>
<tr><td width="35%">gsl_sf_zeta_e</td><td width="5%">Y</td><td width="60%">gsl_sf_zeta(dbl_expr)</td></tr>
<tr><td width="35%">gsl_sf_zetam1_e</td><td width="5%">Y</td><td width="60%">gsl_sf_zetam1(dbl_expr)</td></tr>
<tr><td width="35%">gsl_sf_zetam1_int_e</td><td width="5%">Y</td><td width="60%">gsl_sf_zetam1_int(int_expr)</td></tr>
<tr><td width="35%">gsl_sf_hzeta_e</td><td width="5%">Y</td><td width="60%">gsl_sf_hzeta(dbl_expr,dbl_expr)</td></tr>
<tr><td width="35%">gsl_sf_eta_int_e</td><td width="5%">Y</td><td width="60%">gsl_sf_eta_int(int_expr)</td></tr>
<tr><td width="35%">gsl_sf_eta_e</td><td width="5%">Y</td><td width="60%">gsl_sf_eta(dbl_expr)</td></tr>
</table>
<a name="gsl_int"></a> <!-- http://nco.sf.net/nco.html#gsl_int --><hr>
<a name="GSL-interpolation"></a>
<div class="header">
<p>
Next: <a href="#GSL-least_002dsquares-fitting" accesskey="n" rel="next">GSL least-squares fitting</a>, Previous: <a href="#GSL-special-functions" accesskey="p" rel="previous">GSL special functions</a>, Up: <a href="#ncap2-netCDF-Arithmetic-Processor" accesskey="u" rel="up">ncap2 netCDF Arithmetic Processor</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#General-Index" title="Index" rel="index">Index</a>]</p>
</div>
<a name="GSL-interpolation-1"></a>
<h4 class="subsection">4.1.20 GSL interpolation</h4>
<a name="index-GSL-2"></a>
<p>As of version 3.9.9 (released July, 2009), <acronym>NCO</acronym> has wrappers to the <acronym>GSL</acronym> interpolation functions.
</p>
<p>Given a set of data points (x1,y1)...(xn, yn) the <acronym>GSL</acronym> functions computes a continuous interpolating function <acronym>Y(x)</acronym> such that <acronym>Y(xi) = yi</acronym>. The interpolation is piecewise smooth, and its behavior at the end-points is determined by the type of interpolation used. For more information consult the <acronym>GSL</acronym> manual.
</p>
<p>Interpolation with <code>ncap2</code> is a two stage process. In the first stage, a <acronym>RAM</acronym> variable is created from the chosen interpolating function and the data set. This <acronym>RAM</acronym> variable holds in memory a <acronym>GSL</acronym> interpolation object. In the second stage, points along the interpolating function are calculated. If you have a very large data set or are interpolating many sets then consider deleting the <acronym>RAM</acronym> variable when it is redundant. Use the command <code>ram_delete(var_nm)</code>.
</p>
<p>A simple example
</p>
<div class="example">
<pre class="example">x_in[$lon]={1.0,2.0,3.0,4.0};
y_in[$lon]={1.1,1.2,1.5,1.8};
// Ram variable is declared and defined here
gsl_interp_cspline(&ram_sp,x_in,y_in);
x_out[$lon_grd]={1.1,2.0,3.0,3.1,3.99};
y_out=gsl_spline_eval(ram_sp,x_out);
y2=gsl_spline_eval(ram_sp,1.3);
y3=gsl_spline_eval(ram_sp,0.0);
ram_delete(ram_sp);
print(y_out); // 1.10472, 1.2, 1.4, 1.42658, 1.69680002
print(y2); // 1.12454
print(y3); // '_'
</pre></div>
<p>Note in the above example y3 is set to ’missing value’ because 0.0 isn’t within the input X range.
</p>
<p><strong><acronym>GSL</acronym> Interpolation Types</strong><br>
All the interpolation functions have been implemented. These are:<br>
gsl_interp_linear() <br> gsl_interp_polynomial() <br> gsl_interp_cspline()<br>
gsl_interp_cspline_periodic()<br> gsl_interp_akima() <br> gsl_interp_akima_periodic() <br>
</p>
<br> <br>
<p><strong> Evaluation of Interpolating Types </strong> <br>
<strong>Implemented</strong> <br>
gsl_spline_eval() <br>
<strong>Unimplemented</strong> <br>
gsl_spline_deriv()<br>
gsl_spline_deriv2()<br>
gsl_spline_integ()<br>
</p>
<a name="ncap_lsqf"></a> <!-- http://nco.sf.net/nco.html#ncap_lsqf --><hr>
<a name="GSL-least_002dsquares-fitting"></a>
<div class="header">
<p>
Next: <a href="#GSL-statistics" accesskey="n" rel="next">GSL statistics</a>, Previous: <a href="#GSL-interpolation" accesskey="p" rel="previous">GSL interpolation</a>, Up: <a href="#ncap2-netCDF-Arithmetic-Processor" accesskey="u" rel="up">ncap2 netCDF Arithmetic Processor</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#General-Index" title="Index" rel="index">Index</a>]</p>
</div>
<a name="GSL-least_002dsquares-fitting-1"></a>
<h4 class="subsection">4.1.21 GSL least-squares fitting</h4>
<p>Least Squares fitting is a method of calculating a straight line through a set of experimental data points in the XY plane. The data maybe weighted or unweighted. For more information please refer to the <acronym>GSL</acronym> manual.
</p>
<p>These <acronym>GSL</acronym> functions fall into three categories:<br>
<strong>A)</strong> Fitting data to Y=c0+c1*X<br>
<strong>B)</strong> Fitting data (through the origin) Y=c1*X<br>
<strong>C)</strong> Multi-parameter fitting (not yet implemented)<br>
</p>
<p><strong>Section A</strong> <br> <br>
<code>status=<strong>gsl_fit_linear</strong> (data_x,stride_x,data_y,stride_y,n,&co,&c1,&cov00,&cov01,&cov11,&sumsq) </code>
</p>
<p><strong>Input variables</strong>: data_x, stride_x, data_y, stride_y, n <br>
From the above variables an X and Y vector both of length ’n’ are derived.
If data_x or data_y is less than type double then it is converted to type <code>double</code>.
It is up to you to do bounds checking on the input data.
For example if stride_x=3 and n=8 then the size of data_x must be at least 24
</p>
<p><strong>Output variables</strong>: c0, c1, cov00, cov01, cov11,sumsq <br>
The ’&’ prefix indicates that these are call-by-reference variables.
If any of the output variables don’t exist prior to the call then they are created on the fly as scalar variables of type <code>double</code>. If they already exist then their existing value is overwritten. If the function call is successful then <code>status=0</code>.
</p>
<p><code>status= <strong>gsl_fit_wlinear</strong>(data_x,stride_x,data_w,stride_w,data_y,stride_y,n,&co,&c1,&cov00,&cov01,&cov11,&chisq) </code>
</p>
<p>Similar to the above call except it creates an additional weighting vector from the variables data_w, stride_w, n
</p>
<p><code> data_y_out=<strong>gsl_fit_linear_est</strong>(data_x,c0,c1,cov00,cov01,cov11) </code>
</p>
<p>This function calculates y values along the line Y=c0+c1*X <br> <br>
</p>
<p><strong>Section B</strong> <br> <br>
<code>status=<strong>gsl_fit_mul</strong>(data_x,stride_x,data_y,stride_y,n,&c1,&cov11,&sumsq) </code>
</p>
<p><strong>Input variables</strong>: data_x, stride_x, data_y, stride_y, n <br>
From the above variables an X and Y vector both of length ’n’ are derived.
If data_x or data_y is less than type <code>double</code> then it is converted to type <code>double</code>. <br>
</p>
<p><strong>Output variables</strong>: c1,cov11,sumsq <br>
</p>
<p><code>status= <strong>gsl_fit_wmul</strong>(data_x,stride_x,data_w,stride_w,data_y,stride_y,n,&c1,&cov11,&sumsq) </code>
</p>
<p>Similar to the above call except it creates an additional weighting vector from the variables data_w, stride_w, n
</p>
<p><code> data_y_out=<strong>gsl_fit_mul_est</strong>(data_x,c0,c1,cov11) </code>
</p>
<p>This function calculates y values along the line Y=c1*X <br> <br>
</p>
<p>The below example shows <strong>gsl_fit_linear()</strong> in action
</p>
<div class="example">
<pre class="example">defdim("d1",10);
xin[d1]={1,2,3,4,5,6,7,8,9,10.0};
yin[d1]={3.1,6.2,9.1,12.2,15.1,18.2,21.3,24.0,27.0,30.0};
gsl_fit_linear(xin,1,yin,1,$d1.size,&c0,&c1,&cov00,&cov01,&cov11,&sumsq);
print(c0); // 0.2
print(c1); // 2.98545454545
defdim("e1",4);
xout[e1]={1.0,3.0,4.0,11};
yout[e1]=0.0;
yout=gsl_fit_linear_est(xout, c0,c1, cov00,cov01, cov11, sumsq);
print(yout); // 3.18545454545 ,9.15636363636, ,12.1418181818 ,33.04
</pre></div>
<br> <br>
<a name="ncap_stat"></a> <!-- http://nco.sf.net/nco.html#ncap_stat -->
<hr>
<a name="GSL-statistics"></a>
<div class="header">
<p>
Next: <a href="#GSL-random-number-generation" accesskey="n" rel="next">GSL random number generation</a>, Previous: <a href="#GSL-least_002dsquares-fitting" accesskey="p" rel="previous">GSL least-squares fitting</a>, Up: <a href="#ncap2-netCDF-Arithmetic-Processor" accesskey="u" rel="up">ncap2 netCDF Arithmetic Processor</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#General-Index" title="Index" rel="index">Index</a>]</p>
</div>
<a name="GSL-statistics-1"></a>
<h4 class="subsection">4.1.22 GSL statistics</h4>
<p>Wrappers for most of the <acronym>GSL</acronym> Statistical functions have been implemented. The <acronym>GSL</acronym> function names include a type specifier (except for type double functions). To obtain the equivalent <acronym>NCO</acronym> name simply remove the type specifier; then depending on the data type the appropriate <acronym>GSL</acronym> function is called. The weighed statistical functions e.g., <code> gsl_stats_wvariance()</code> are only defined in <acronym>GSL</acronym> for floating point types; so your data must of type <code>float</code> or <code>double</code> otherwise ncap2 will emit an error message. To view the implemented functions use the shell command <code>ncap2 -f|grep _stats</code>
</p>
<p><acronym>GSL</acronym> Functions
</p><div class="example">
<pre class="example">short gsl_stats_max (short data[], size_t stride, size_t n);
double gsl_stats_int_mean (int data[], size_t stride, size_t n);
double gsl_stats_short_sd_with_fixed_mean (short data[], size_t stride, size_t n, double mean);
double gsl_stats_wmean (double w[], size_t wstride, double data[], size_t stride, size_t n);
double gsl_stats_quantile_from_sorted_data (double sorted_data[], size_t stride, size_t n, double f) ;
</pre></div>
<p>Equivalent ncap2 wrapper functions
</p><div class="example">
<pre class="example">short gsl_stats_max (var_data, data_stride, n);
double gsl_stats_mean (var_data, data_stride, n);
double gsl_stats_sd_with_fixed_mean (var_data, data_stride, n, var_mean);
double gsl_stats_wmean (var_weight, weight_stride, var_data, data_stride, n, var_mean);
double gsl_stats_quantile_from_sorted_data (var_sorted_data, data_stride, n, var_f) ;
</pre></div>
<p><acronym>GSL</acronym> has no notion of missing values or dimensionality beyond one. If your data has missing values which you want ignored in the calculations then use the <code>ncap2</code> built in aggregate functions( <a href="#Methods-and-functions">Methods and functions</a> ). The <acronym>GSL</acronym> functions operate on a vector of values created from the var_data/stride/n arguments. The ncap wrappers check that there is no bounding error with regard to the size of the data and the final value in the vector.
</p>
<p>Some examples
</p>
<div class="example">
<pre class="example">a1[time]={1,2,3,4,5,6,7,8,9,10 };
a1_avg=gsl_stats_mean(a1,1,10);
print(a1_avg); // 5.5
a1_var=gsl_stats_variance(a1,4,3);
print(a1_var); // 16.0
// bounding error, vector attempts to access element a1(10)
a1_sd=gsl_stats_sd(a1,5,3);
</pre></div>
<p>For functions with the signature
<strong>func_nm(var_data,data_stride,n)</strong>,
one may omit the second or third arguments.
The default value for <var>stride</var> is <code>1</code>.
The default value for <var>n</var> is <code>1+(data.size()-1)/stride</code>.
</p>
<div class="example">
<pre class="example">// Following statements are equvalent
n2=gsl_stats_max(a1,1,10)
n2=gsl_stats_max(a1,1);
n2=gsl_stats_max(a1);
// Following statements are equvalent
n3=gsl_stats_median_from_sorted_data(a1,2,5);
n3=gsl_stats_median_from_sorted_data(a1,2);
// Following statements are NOT equvalent
n4=gsl_stats_kurtosis(a1,3,2);
n4=gsl_stats_kurtosis(a1,3); //default n=4
</pre></div>
<p>The following example illustrates some of the weighted functions.
The data are randomly generated.
In this case the value of the weight for each datum is either 0.0 or 1.0
</p><div class="example">
<pre class="example">defdim("r1",2000);
data[r1]=1.0;
// Fill with random numbers [0.0,10.0)
data=10.0*gsl_rng_uniform(data);
// Create a weighting variable
weight=(data>4.0);
wmean=gsl_stats_wmean(weight,1,data,1,$r1.size);
print(wmean);
wsd=gsl_stats_wsd(weight,1,data,1,$r1.size);
print(wsd);
// number of values in data that are greater than 4
weight_size=weight.total();
print(weight_size);
// print min/max of data
dmin=data.gsl_stats_min();
dmax=data.gsl_stats_max();
print(dmin);print(dmax);
</pre></div>
<a name="ncap_rng"></a> <!-- http://nco.sf.net/nco.html#ncap_rng -->
<hr>
<a name="GSL-random-number-generation"></a>
<div class="header">
<p>
Next: <a href="#Examples-ncap2" accesskey="n" rel="next">Examples ncap2</a>, Previous: <a href="#GSL-statistics" accesskey="p" rel="previous">GSL statistics</a>, Up: <a href="#ncap2-netCDF-Arithmetic-Processor" accesskey="u" rel="up">ncap2 netCDF Arithmetic Processor</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#General-Index" title="Index" rel="index">Index</a>]</p>
</div>
<a name="GSL-random-number-generation-1"></a>
<h4 class="subsection">4.1.23 GSL random number generation</h4>
<p>The <acronym>GSL</acronym> library has a large number of random number generators. In addition there are a large set of functions for turning uniform random numbers into discrete or continuous probabilty distributions. The random number generator algorithms vary in terms of quality numbers output, speed of execution and maximium number output. For more information see the <acronym>GSL</acronym> documentation. The algorithm and seed are set via environment variables, these are picked up by the <code>ncap2</code> code.
</p>
<p><strong>Setup</strong> <br>
The number algorithm is set by the environment variable <code>GSL_RNG_TYPE</code>. If this variable isn’t set then the default rng algorithm is gsl_rng_19937. The seed is set with the environment variable <code>GSL_RNG_SEED</code>. The following wrapper functions in ncap2 provide information about the chosen algorithm. <br>
</p>
<dl compact="compact">
<dt><code>gsl_rng_min()</code></dt>
<dd><p>the minimium value returned by the rng algorithm.
</p></dd>
<dt><code>gsl_rng_max()</code></dt>
<dd><p>the maximium value returned by the rng algorithm.
</p></dd>
</dl>
<p><strong>Uniformly Distributed Random Numbers</strong>
</p><dl compact="compact">
<dt><code>gsl_rng_get(var_in)</code></dt>
<dd><p>This function returns var_in with integers from the chosen rng algorithm. The min and max values depend uoon the chosen rng algorthm.
</p></dd>
<dt><code>gsl_rng_uniform_int(var_in)</code></dt>
<dd><p>This function returns var_in with random integers from 0 to n-1. The value n must be less than or equal to the maximium value of the chosen rng algorithm.
</p></dd>
<dt><code>gsl_rng_uniform(var_in)</code></dt>
<dd><p>This function returns var_in with double-precision numbers in the range [0.0,1). The range includes 0.0 and excludes 1.0.
</p></dd>
<dt><code>gsl_rng_uniform_pos(var_in)</code></dt>
<dd><p>This function returns var_in with double-precision numbers in the range (0.0,1), excluding both 0.0 and 1.0.
</p></dd>
</dl>
<p>Below are examples of <code>gsl_rng_get()</code> and <code>gsl_rng_uniform_int()</code> in action.
</p>
<div class="example">
<pre class="example">export GSL_RNG_TYPE=ranlux
export GSL_RNG_SEED=10
ncap2 -v -O -s 'a1[time]=0;a2=gsl_rng_get(a1);' in.nc foo.nc
// 10 random numbers from the range 0 - 16777215
// a2=9056646, 12776696, 1011656, 13354708, 5139066, 1388751, 11163902, 7730127, 15531355, 10387694 ;
ncap2 -v -O -s 'a1[time]=21;a2=gsl_rng_uniform_int(a1).sort();' in.nc foo.nc
// 10 random numbers from the range 0 - 20
a2 = 1, 1, 6, 9, 11, 13, 13, 15, 16, 19 ;
</pre></div>
<p>The following example produces an <code>ncap2</code> runtime error. This is because the chose rng algorithm has a maximium value greater than <code> NC_MAX_INT=2147483647 </code>; the wrapper functions to <code>gsl_rng_get()</code> and <code>gsl_rng_uniform_int()</code> return variable of type <code>NC_INT</code>. Please be aware of this when using random number distribution functions functions from the <acronym>GSL</acronym> library which return <code>unsigned int</code>. Examples of these are <code>gsl_ran_geometric()</code> and <code>gsl_ran_pascal()</code>.
</p>
<div class="example">
<pre class="example">export GSL_RNG_TYPE=mt19937
ncap2 -v -O -s 'a1[time]=0;a2=gsl_rng_get(a1);' in.nc foo.nc
</pre></div>
<p>To find the maximium value of the chosen rng algorithm use the following code snippet.
</p><div class="example">
<pre class="example">ncap2 -v -O -s 'rng_max=gsl_rng_max();print(rng_max)' in.nc foo.nc
</pre></div>
<p><strong>Random Number Distributions</strong> <br>
The <acronym>GSL</acronym> library has a rich set of random number disribution functions. The library also provides cumulative distribution functions and inverse cumulative distribution functions sometimes referred to a quantile functions. To see whats available on your build use the shell command <code>ncap2 -f|grep -e _ran -e _cdf</code>.
</p>
<p>The following examples all return variables of type <code>NC_INT</code> <br>
</p><div class="example">
<pre class="example">defdim("out",15);
a1[$out]=0.5;
a2=gsl_ran_binomial(a1,30).sort();
//a2 = 10, 11, 12, 12, 13, 14, 14, 15, 15, 16, 16, 16, 16, 17, 22 ;
a3=gsl_ran_geometric(a2).sort();
//a2 = 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 3, 4, 5 ;
a4=gsl_ran_pascal(a2,50);
//a5 = 37, 40, 40, 42, 43, 45, 46, 49, 52, 58, 60, 62, 62, 65, 67 ;
</pre></div>
<p>The following all return variables of type <code>NC_DOUBLE</code>;
</p><div class="example">
<pre class="example">defdim("b1",1000);
b1[$b1]=0.8;
b2=gsl_ran_exponential(b1);
b2_avg=b2.avg();
print(b2_avg);
// b2_avg = 0.756047976787
b3=gsl_ran_gaussian(b1);
b3_avg=b3.avg();
b3_rms=b3.rms();
print(b3_avg);
// b3_avg = -0.00903446534258;
print(b3_rms);
// b3_rms = 0.81162979889;
b4[$b1]=10.0;
b5[$b1]=20.0;
b6=gsl_ran_flat(b4,b5);
b6_avg=b6.avg();
print(b6_avg);
// b6_avg=15.0588129413
</pre></div>
<a name="ncap_emp"></a> <!-- http://nco.sf.net/nco.html#ncap_emp --><hr>
<a name="Examples-ncap2"></a>
<div class="header">
<p>
Next: <a href="#Intrinsic-mathematical-methods" accesskey="n" rel="next">Intrinsic mathematical methods</a>, Previous: <a href="#GSL-random-number-generation" accesskey="p" rel="previous">GSL random number generation</a>, Up: <a href="#ncap2-netCDF-Arithmetic-Processor" accesskey="u" rel="up">ncap2 netCDF Arithmetic Processor</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#General-Index" title="Index" rel="index">Index</a>]</p>
</div>
<a name="Examples-ncap2-1"></a>
<h4 class="subsection">4.1.24 Examples ncap2</h4>
<p>See the <samp>ncap.in</samp> and <samp>ncap2.in</samp> scripts released with <acronym>NCO</acronym>
for more complete demonstrations of <code>ncap2</code> functionality
(script available on-line at <a href="http://nco.sf.net/ncap2.in">http://nco.sf.net/ncap2.in</a>).
</p>
<p>Define new attribute <var>new</var> for existing variable <var>one</var>
as twice the existing attribute <var>double_att</var> of variable
<var>att_var</var>:
</p><div class="example">
<pre class="example">ncap2 -s 'one@new=2*att_var@double_att' in.nc out.nc
</pre></div>
<p>Average variables of mixed types (result is of type <code>double</code>):
</p><div class="example">
<pre class="example">ncap2 -s 'average=(var_float+var_double+var_int)/3' in.nc out.nc
</pre></div>
<p>Multiple commands may be given to <code>ncap2</code> in three ways.
First, the commands may be placed in a script which is executed, e.g.,
<samp>tst.nco</samp>.
Second, the commands may be individually specified with multiple
‘<samp>-s</samp>’ arguments to the same <code>ncap2</code> invocation.
Third, the commands may be chained into a single ‘<samp>-s</samp>’
argument to <code>ncap2</code>.
Assuming the file <samp>tst.nco</samp> contains the commands
<code>a=3;b=4;c=sqrt(a^2+b^2);</code>, then the following <code>ncap2</code>
invocations produce identical results:
</p><div class="example">
<pre class="example">ncap2 -v -S tst.nco in.nc out.nc
ncap2 -v -s 'a=3' -s 'b=4' -s 'c=sqrt(a^2+b^2)' in.nc out.nc
ncap2 -v -s 'a=3;b=4;c=sqrt(a^2+b^2)' in.nc out.nc
</pre></div>
<p>The second and third examples show that <code>ncap2</code> does not require
that a trailing semi-colon ‘<samp>;</samp>’ be placed at the end of a ‘<samp>-s</samp>’
argument, although a trailing semi-colon ‘<samp>;</samp>’ is always allowed.
However, semi-colons are required to separate individual assignment
statements chained together as a single ‘<samp>-s</samp>’ argument.
</p>
<a name="xmp_grw"></a> <!-- http://nco.sf.net/nco.html#xmp_grw --><a name="index-growing-dimensions"></a>
<a name="index-dimensions_002c-growing"></a>
<p><code>ncap2</code> may be used to “grow” dimensions, i.e., to increase
dimension sizes without altering existing data.
Say <samp>in.nc</samp> has <code>ORO(lat,lon)</code> and the user wishes a new
file with <code>new_ORO(new_lat,new_lon)</code> that contains zeros in the
undefined portions of the new grid.
</p><div class="example">
<pre class="example">defdim("new_lat",$lat.size+1); // Define new dimension sizes
defdim("new_lon",$lon.size+1);
new_ORO[$new_lat,$new_lon]=0.0f; // Initialize to zero
new_ORO(0:$lat.size-1,0:$lon.size-1)=ORO; // Fill valid data
</pre></div>
<p>The commands to define new coordinate variables <code>new_lat</code>
and <code>new_lon</code> in the output file follow a similar pattern.
One would might store these commands in a script <samp>grow.nco</samp>
and then execute the script with
</p><div class="example">
<pre class="example">ncap2 -v -S grow.nco in.nc out.nc
</pre></div>
<a name="flg"></a> <!-- http://nco.sf.net/nco.html#flg --><a name="index-flags"></a>
<p>Imagine you wish to create a binary flag based on the value of
an array.
The flag should have value 1.0<!-- /@w --> where the array exceeds 1.0<!-- /@w -->,
and value 0.0<!-- /@w --> elsewhere.
This example creates the binary flag <code>ORO_flg</code> in <samp>out.nc</samp>
from the continuous array named <code>ORO</code> in <samp>in.nc</samp>.
</p><div class="example">
<pre class="example">ncap2 -s 'ORO_flg=(ORO > 1.0)' in.nc out.nc
</pre></div>
<p>Suppose your task is to change all values of <code>ORO</code> which
equal 2.0<!-- /@w --> to the new value 3.0<!-- /@w -->:
</p><div class="example">
<pre class="example">ncap2 -s 'ORO_msk=(ORO==2.0);ORO=ORO_msk*3.0+!ORO_msk*ORO' in.nc out.nc
</pre></div>
<a name="index-mask-1"></a>
<p>This creates and uses <code>ORO_msk</code> to mask the subsequent arithmetic
operation.
Values of <code>ORO</code> are only changed where <code>ORO_msk</code> is true,
i.e., where <code>ORO</code> equals 2.0<!-- /@w --> <br>
Using the <code>where</code> statement the above code simplifies to :
</p><div class="example">
<pre class="example">ncap2 -s 'where(ORO==2.0) ORO=3.0;' in.nc foo.nc
</pre></div>
<a name="cvr"></a> <!-- http://nco.sf.net/nco.html#cvr --><p>This example uses <code>ncap2</code> to compute the covariance of two
variables.
Let the variables <var>u</var> and <var>v</var> be the horizontal
wind components.
<a name="index-covariance"></a>
The <em>covariance</em> of <var>u</var> and <var>v</var> is defined
as the time mean product of the deviations of <var>u</var> and
<var>v</var> from their respective time means.
Symbolically, the covariance
<em>[<var>u'v'</var>] =
[<var>uv</var>]-[<var>u</var>][<var>v</var>]</em>
where <em>[<var>x</var>]</em> denotes the time-average of
<em><var>x</var></em> and <em><var>x'</var></em>
denotes the deviation from the time-mean.
The covariance tells us how much of the correlation of two signals
arises from the signal fluctuations versus the mean signals.
<a name="index-eddy-covariance"></a>
Sometimes this is called the <em>eddy covariance</em>.
We will store the covariance in the variable <code>uprmvprm</code>.
</p><div class="example">
<pre class="example">ncwa -O -a time -v u,v in.nc foo.nc # Compute time mean of u,v
ncrename -O -v u,uavg -v v,vavg foo.nc # Rename to avoid conflict
ncks -A -v uavg,vavg foo.nc in.nc # Place time means with originals
ncap2 -O -s 'uprmvprm=u*v-uavg*vavg' in.nc in.nc # Covariance
ncra -O -v uprmvprm in.nc foo.nc # Time-mean covariance
</pre></div>
<p>The mathematically inclined will note that the same covariance would be
obtained by replacing the step involving <code>ncap2</code> with
</p><div class="example">
<pre class="example">ncap2 -O -s 'uprmvprm=(u-uavg)*(v-vavg)' foo.nc foo.nc # Covariance
</pre></div>
<p>As of <acronym>NCO</acronym> version 3.1.8 (December, 2006), <code>ncap2</code>
can compute averages, and thus covariances, by itself:
</p><div class="example">
<pre class="example">ncap2 -s 'uavg=u.avg($time);vavg=v.avg($time);uprmvprm=u*v-uavg*vavg' \
-s 'uprmvrpmavg=uprmvprm.avg($time)' in.nc foo.nc
</pre></div>
<p>We have not seen a simpler method to script and execute powerful
arithmetic than <code>ncap2</code>.
</p>
<a name="index-globbing-3"></a>
<a name="index-shell-3"></a>
<a name="index-quotes-1"></a>
<a name="index-extended-regular-expressions-2"></a>
<a name="index-regular-expressions-3"></a>
<p><code>ncap2</code> utilizes many meta-characters
(e.g., ‘<samp>$</samp>’, ‘<samp>?</samp>’, ‘<samp>;</samp>’, ‘<samp>()</samp>’, ‘<samp>[]</samp>’)
that can confuse the command-line shell if not quoted properly.
The issues are the same as those which arise in utilizing extended
regular expressions to subset variables (see <a href="#Subsetting-Files">Subsetting Files</a>).
The example above will fail with no quotes and with double quotes.
This is because shell globbing tries to <em>interpolate</em> the value of
<code>$time</code> from the shell environment unless it is quoted:
</p><div class="example">
<pre class="example">ncap2 -s 'uavg=u.avg($time)' in.nc foo.nc # Correct (recommended)
ncap2 -s uavg=u.avg('$time') in.nc foo.nc # Correct (and dangerous)
ncap2 -s uavg=u.avg($time) in.nc foo.nc # Fails ($time = '')
ncap2 -s "uavg=u.avg($time)" in.nc foo.nc # Fails ($time = '')
</pre></div>
<p>Without the single quotes, the shell replaces <code>$time</code> with an
empty string.
The command <code>ncap2</code> receives from the shell is
<code>uavg=u.avg()</code>.
This causes <code>ncap2</code> to average over all dimensions rather than
just the <var>time</var> dimension, and unintended consequence.
</p>
<p>We recommend using single quotes to protect <code>ncap2</code>
command-line scripts from the shell, even when such protection is not
strictly necessary.
Expert users may violate this rule to exploit the ability to use shell
variables in <code>ncap2</code> command-line scripts
(see <a href="#CCSM-Example">CCSM Example</a>).
In such cases it may be necessary to use the shell backslash character
‘<samp>\</samp>’ to protect the <code>ncap2</code> meta-character.
</p>
<a name="index-appending-data"></a>
<a name="index-time_002daveraging"></a>
<a name="index-ncks-2"></a>
<a name="index-ncwa-3"></a>
<a name="index-ncra-2"></a>
<a name="index-degenerate-dimension-2"></a>
<a name="index-_002db"></a>
<p>A dimension of size one is said to be <em>degenerate</em>.
Whether a degenerate record dimension is desirable or not
depends on the application.
Often a degenerate <var>time</var> dimension is useful, e.g., for
concatentating, but it may cause problems with arithmetic.
Such is the case in the above example, where the first step employs
<code>ncwa</code> rather than <code>ncra</code> for the time-averaging.
Of course the numerical results are the same with both operators.
The difference is that, unless ‘<samp>-b</samp>’ is specified, <code>ncwa</code>
writes no <var>time</var> dimension to the output file, while <code>ncra</code>
defaults to keeping <var>time</var> as a degenerate (size 1<!-- /@w -->) dimension.
Appending <code>u</code> and <code>v</code> to the output file would cause
<code>ncks</code> to try to expand the degenerate time axis of <code>uavg</code>
and <code>vavg</code> to the size of the non-degenerate <var>time</var> dimension
in the input file.
Thus the append (<code>ncks -A</code>) command would be undefined (and
should fail) in this case.
<a name="index-_002dC-2"></a>
Equally important is the ‘<samp>-C</samp>’ argument
(see <a href="#Subsetting-Coordinate-Variables">Subsetting Coordinate Variables</a>) to <code>ncwa</code> to prevent
any scalar <var>time</var> variable from being written to the output file.
Knowing when to use <code>ncwa -a time</code> rather than the default
<code>ncra</code> for time-averaging takes, well, time.
</p>
<a name="mth"></a> <!-- http://nco.sf.net/nco.html#mth --><hr>
<a name="Intrinsic-mathematical-methods"></a>
<div class="header">
<p>
Next: <a href="#Operator-precedence-and-associativity" accesskey="n" rel="next">Operator precedence and associativity</a>, Previous: <a href="#Examples-ncap2" accesskey="p" rel="previous">Examples ncap2</a>, Up: <a href="#ncap2-netCDF-Arithmetic-Processor" accesskey="u" rel="up">ncap2 netCDF Arithmetic Processor</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#General-Index" title="Index" rel="index">Index</a>]</p>
</div>
<a name="Intrinsic-mathematical-methods-1"></a>
<h4 class="subsection">4.1.25 Intrinsic mathematical methods</h4>
<p><code>ncap2</code> supports the standard mathematical functions supplied with
most operating systems.
<a name="index-addition"></a>
<a name="index-subtraction"></a>
<a name="index-multiplication"></a>
<a name="index-division"></a>
<a name="index-exponentiation"></a>
<a name="index-power"></a>
<a name="index-modulus"></a>
<a name="index-_002b-_0028addition_0029"></a>
<a name="index-_002d-_0028subtraction_0029"></a>
<a name="index-_002a-_0028multiplication_0029"></a>
<a name="index-_002f-_0028division_0029"></a>
<a name="index-_005e-_0028power_0029"></a>
<a name="index-_0025-_0028modulus_0029"></a>
Standard calculator notation is used for addition <kbd>+</kbd>, subtraction
<kbd>-</kbd>, multiplication <kbd>*</kbd>, division <kbd>/</kbd>, exponentiation
<kbd>^</kbd>, and modulus <kbd>%</kbd>.
The available elementary mathematical functions are:
<a name="index-abs"></a>
<a name="index-acosh"></a>
<a name="index-acos"></a>
<a name="index-asinh"></a>
<a name="index-asin"></a>
<a name="index-atanh"></a>
<a name="index-atan"></a>
<a name="index-ceil"></a>
<a name="index-cosh"></a>
<a name="index-cos"></a>
<a name="index-erfc"></a>
<a name="index-erf"></a>
<a name="index-exp"></a>
<a name="index-floor"></a>
<a name="index-gamma-1"></a>
<a name="index-ln"></a>
<a name="index-log10"></a>
<a name="index-log"></a>
<a name="index-nearbyint"></a>
<a name="index-pow"></a>
<a name="index-rint"></a>
<a name="index-round"></a>
<a name="index-sinh"></a>
<a name="index-sin"></a>
<a name="index-sqrt-1"></a>
<a name="index-tanh"></a>
<a name="index-tan"></a>
<a name="index-trunc"></a>
<a name="index-mathematical-functions"></a>
<a name="index-nearest-integer-function-_0028inexact_0029"></a>
<a name="index-nearest-integer-function-_0028exact_0029"></a>
<a name="index-rounding-functions"></a>
<a name="index-truncation-function"></a>
<a name="index-absolute-value"></a>
<a name="index-arccosine-function"></a>
<a name="index-arcsine-function"></a>
<a name="index-arctangent-function"></a>
<a name="index-ceiling-function"></a>
<a name="index-complementary-error-function"></a>
<a name="index-cosine-function"></a>
<a name="index-error-function"></a>
<a name="index-exponentiation-function"></a>
<a name="index-floor-function"></a>
<a name="index-gamma-function-1"></a>
<a name="index-hyperbolic-arccosine-function"></a>
<a name="index-hyperbolic-arcsine-function"></a>
<a name="index-hyperbolic-arctangent-function"></a>
<a name="index-hyperbolic-cosine-function"></a>
<a name="index-hyperbolic-sine-function"></a>
<a name="index-hyperbolic-tangent"></a>
<a name="index-logarithm_002c-base-10"></a>
<a name="index-logarithm_002c-natural"></a>
<a name="index-power-function"></a>
<a name="index-sine-function"></a>
<a name="index-square-root-function"></a>
</p><dl compact="compact">
<dt><code>abs(x)</code></dt>
<dd><p><em>Absolute value</em>
Absolute value of <var>x</var>.
Example:
<em>abs(-1) = 1</em>
</p></dd>
<dt><code>acos(x)</code></dt>
<dd><p><em>Arc-cosine</em>
Arc-cosine of <var>x</var> where <var>x</var> is specified in radians.
Example:
<em>acos(1.0) = 0.0</em>
</p></dd>
<dt><code>acosh(x)</code></dt>
<dd><p><em>Hyperbolic arc-cosine</em>
Hyperbolic arc-cosine of <var>x</var> where <var>x</var> is specified in radians.
Example:
<em>acosh(1.0) = 0.0</em>
</p></dd>
<dt><code>asin(x)</code></dt>
<dd><p><em>Arc-sine</em>
Arc-sine of <var>x</var> where <var>x</var> is specified in radians.
Example:
<em>asin(1.0) = 1.57079632679489661922</em>
</p></dd>
<dt><code>asinh(x)</code></dt>
<dd><p><em>Hyperbolic arc-sine</em>
Hyperbolic arc-sine of <var>x</var> where <var>x</var> is specified in radians.
Example:
<em>asinh(1.0) = 0.88137358702</em>
</p></dd>
<dt><code>atan(x)</code></dt>
<dd><p><em>Arc-tangent</em>
Arc-tangent of <var>x</var> where <var>x</var> is specified in radians between
<em>-pi/2</em> and <em>pi/2</em>.
Example:
<em>atan(1.0) = 0.78539816339744830961</em>
</p>
</dd>
<dt><code>atan2(y,x)</code></dt>
<dd><p><em>Arc-tangent2</em>
Arc-tangent of <var>y/x</var>
<em>:Example atan2(1,3) = 0.321689857</em>
</p>
</dd>
<dt><code>atanh(x)</code></dt>
<dd><p><em>Hyperbolic arc-tangent</em>
Hyperbolic arc-tangent of <var>x</var> where <var>x</var> is specified in radians between
<em>-pi/2</em> and <em>pi/2</em>.
Example:
<em>atanh(3.14159265358979323844) = 1.0</em>
</p></dd>
<dt><code>ceil(x)</code></dt>
<dd><p><em>Ceil</em>
Ceiling of <var>x</var>. Smallest integral value not less than argument.
Example:
<em>ceil(0.1) = 1.0</em>
</p></dd>
<dt><code>cos(x)</code></dt>
<dd><p><em>Cosine</em>
Cosine of <var>x</var> where <var>x</var> is specified in radians.
Example:
<em>cos(0.0) = 1.0</em>
</p></dd>
<dt><code>cosh(x)</code></dt>
<dd><p><em>Hyperbolic cosine</em>
Hyperbolic cosine of <var>x</var> where <var>x</var> is specified in radians.
Example:
<em>cosh(0.0) = 1.0</em>
</p></dd>
<dt><code>erf(x)</code></dt>
<dd><p><em>Error function</em>
Error function of <var>x</var> where <var>x</var> is specified between
<em>-1</em> and <em>1</em>.
Example:
<em>erf(1.0) = 0.842701</em>
</p></dd>
<dt><code>erfc(x)</code></dt>
<dd><p><em>Complementary error function</em>
Complementary error function of <var>x</var> where <var>x</var> is specified between
<em>-1</em> and <em>1</em>.
Example:
<em>erfc(1.0) = 0.15729920705</em>
</p></dd>
<dt><code>exp(x)</code></dt>
<dd><p><em>Exponential</em>
Exponential of <var>x</var>,
<em>e^x</em>.
Example:
<em>exp(1.0) = 2.71828182845904523536</em>
</p></dd>
<dt><code>floor(x)</code></dt>
<dd><p><em>Floor</em>
Floor of <var>x</var>. Largest integral value not greater than argument.
Example:
<em>floor(1.9) = 1</em>
</p></dd>
<dt><code>gamma(x)</code></dt>
<dd><p><em>Gamma function</em>
Gamma function of <var>x</var>,
<em>Gamma(x)</em>.
The well-known and loved continuous factorial function.
Example:
<em>gamma(0.5) = sqrt(pi)</em>
</p></dd>
<dt><code>gamma_inc_P(x)</code></dt>
<dd><p><em>Incomplete Gamma function</em>
Incomplete Gamma function of parameter <var>a</var> and variable <var>x</var>,
<em>gamma_inc_P(a,x)</em>.
One of the four incomplete gamma functions.
Example:
<em>gamma_inc_P(1,1) = 1-1/e</em>
</p></dd>
<dt><code>ln(x)</code></dt>
<dd><p><em>Natural Logarithm</em>
Natural logarithm of <var>x</var>,
<em>ln(x)</em>.
Example:
<em>ln(2.71828182845904523536) = 1.0</em>
</p></dd>
<dt><code>log(x)</code></dt>
<dd><p><em>Natural Logarithm</em>
Exact synonym for <code>ln(x)</code>.
</p></dd>
<dt><code>log10(x)</code></dt>
<dd><p><em>Base 10 Logarithm</em>
Base 10<!-- /@w --> logarithm of <var>x</var>,
<em>log10(x)</em>.
Example:
<em>log(10.0) = 1.0</em>
</p></dd>
<dt><code>nearbyint(x)</code></dt>
<dd><p><em>Round inexactly</em>
Nearest integer to <var>x</var> is returned in floating point format.
<a name="index-inexact-conversion"></a>
No exceptions are raised for <em>inexact conversions</em>.
Example:
<em>nearbyint(0.1) = 0.0</em>
</p></dd>
<dt><code>pow(x,y)</code></dt>
<dd><p><em>Power</em>
<a name="index-promotion-2"></a>
<a name="index-automatic-type-conversion-1"></a>
Value of <var>x</var> is raised to the power of <var>y</var>.
Exceptions are raised for <em>domain errors</em>.
Due to type-limitations in the C language<!-- /@w --> <code>pow</code> function,
integer arguments are promoted (see <a href="#Type-Conversion">Type Conversion</a>) to type
<code>NC_FLOAT</code> before evaluation.
Example:
<em>pow(2,3) = 8</em>
</p></dd>
<dt><code>rint(x)</code></dt>
<dd><p><em>Round exactly</em>
Nearest integer to <var>x</var> is returned in floating point format.
Exceptions are raised for <em>inexact conversions</em>.
Example:
<em>rint(0.1) = 0</em>
</p></dd>
<dt><code>round(x)</code></dt>
<dd><p><em>Round</em>
Nearest integer to <var>x</var> is returned in floating point format.
Round halfway cases away from zero, regardless of current IEEE rounding direction.
Example:
<em>round(0.5) = 1.0</em>
</p></dd>
<dt><code>sin(x)</code></dt>
<dd><p><em>Sine</em>
Sine of <var>x</var> where <var>x</var> is specified in radians.
Example:
<em>sin(1.57079632679489661922) = 1.0</em>
</p></dd>
<dt><code>sinh(x)</code></dt>
<dd><p><em>Hyperbolic sine</em>
Hyperbolic sine of <var>x</var> where <var>x</var> is specified in radians.
Example:
<em>sinh(1.0) = 1.1752</em>
</p></dd>
<dt><code>sqrt(x)</code></dt>
<dd><p><em>Square Root</em>
Square Root of <var>x</var>,
<em>sqrt(x)</em>.
Example:
<em>sqrt(4.0) = 2.0</em>
</p></dd>
<dt><code>tan(x)</code></dt>
<dd><p><em>Tangent</em>
Tangent of <var>x</var> where <var>x</var> is specified in radians.
Example:
<em>tan(0.78539816339744830961) = 1.0</em>
</p></dd>
<dt><code>tanh(x)</code></dt>
<dd><p><em>Hyperbolic tangent</em>
Hyperbolic tangent of <var>x</var> where <var>x</var> is specified in radians.
Example:
<em>tanh(1.0) = 0.761594155956</em>
</p></dd>
<dt><code>trunc(x)</code></dt>
<dd><p><em>Truncate</em>
Nearest integer to <var>x</var> is returned in floating point format.
Round halfway cases toward zero, regardless of current IEEE rounding direction.
Example:
<em>trunc(0.5) = 0.0</em>
</p></dd>
</dl>
<p>The complete list of mathematical functions supported is
platform-specific.
Functions mandated by ANSI C<!-- /@w --> are <em>guaranteed</em> to be present
and are indicated with an asterisk
<a name="index-ANSI-C"></a>
<a name="index-float"></a>
<a name="index-precision"></a>
<a name="index-quadruple_002dprecision"></a>
<a name="index-single_002dprecision"></a>
<a name="index-double_002dprecision"></a>
<a name="index-long-double"></a>
<a name="index-NC_005fDOUBLE"></a>
<a name="DOCF48" href="#FOOT48"><sup>48</sup></a>.
and are indicated with an asterisk.
<a name="index-_002df"></a>
<a name="index-_002d_002dprn_005ffnc_005ftbl"></a>
<a name="index-_002d_002dfnc_005ftbl"></a>
Use the ‘<samp>-f</samp>’ (or ‘<samp>fnc_tbl</samp>’ or ‘<samp>prn_fnc_tbl</samp>’) switch
to print a complete list of functions supported on your platform.
<a name="index-Linux"></a>
<a name="DOCF49" href="#FOOT49"><sup>49</sup></a>
</p>
<a name="xmp_ncap"></a> <!-- http://nco.sf.net/nco.html#xmp_ncap -->
<a name="xmp_ncap2"></a> <!-- http://nco.sf.net/nco.html#xmp_ncap2 -->
<a name="ncap_opts"></a> <!-- http://nco.sf.net/nco.html#ncap_opts --><hr>
<a name="Operator-precedence-and-associativity"></a>
<div class="header">
<p>
Next: <a href="#ID-Quoting" accesskey="n" rel="next">ID Quoting</a>, Previous: <a href="#Intrinsic-mathematical-methods" accesskey="p" rel="previous">Intrinsic mathematical methods</a>, Up: <a href="#ncap2-netCDF-Arithmetic-Processor" accesskey="u" rel="up">ncap2 netCDF Arithmetic Processor</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#General-Index" title="Index" rel="index">Index</a>]</p>
</div>
<a name="Operator-precedence-and-associativity-1"></a>
<h4 class="subsection">4.1.26 Operator precedence and associativity</h4>
<p>This page lists the <code>ncap2</code> operators in order of precedence (highest to lowest). Their associativity indicates in what order operators of equal precedence in an expression are applied.
</p>
<table>
<thead><tr><th width="18%">Operator</th><th width="62%">Description</th><th width="20%">Associativity</th></tr></thead>
<tr><td width="18%"><code>++ --</code></td><td width="62%">Postfix Increment/Decrement</td><td width="20%">Right to Left</td></tr>
<tr><td width="18%"><code>()</code></td><td width="62%">Parentheses (function call)</td></tr>
<tr><td width="18%"><code>.</code></td><td width="62%">Method call</td></tr>
<tr><td width="18%"></td></tr>
<tr><td width="18%"><code>++ --</code></td><td width="62%">Prefix Increment/Decrement</td><td width="20%">Right to Left</td></tr>
<tr><td width="18%"><code>+ -</code></td><td width="62%">Unary Plus/Minus</td></tr>
<tr><td width="18%"><code>!</code></td><td width="62%">Logical Not</td></tr>
<tr><td width="18%"></td></tr>
<tr><td width="18%"><code>^</code></td><td width="62%">Power of Operator</td><td width="20%">Right to Left</td></tr>
<tr><td width="18%"></td></tr>
<tr><td width="18%"><code>* / %</code></td><td width="62%">Multiply/Divide/Modulus</td><td width="20%">Left To Right</td></tr>
<tr><td width="18%"></td></tr>
<tr><td width="18%"><code>+ -</code></td><td width="62%">Addition/Subtraction</td><td width="20%">Left To Right</td></tr>
<tr><td width="18%"></td></tr>
<tr><td width="18%"><code>>> <<</code></td><td width="62%">Fortran style array clipping</td><td width="20%">Left to Right</td></tr>
<tr><td width="18%"></td></tr>
<tr><td width="18%"></td></tr>
<tr><td width="18%"><code>< <=</code></td><td width="62%">Less than/Less than or equal to</td><td width="20%">Left to Right</td></tr>
<tr><td width="18%"><code>> >=</code></td><td width="62%">Greater than/Greater than or equal to</td></tr>
<tr><td width="18%"></td></tr>
<tr><td width="18%"><code>== !=</code></td><td width="62%">Equal to/Not equal to</td><td width="20%">Left to Right</td></tr>
<tr><td width="18%"></td></tr>
<tr><td width="18%"><code>&&</code></td><td width="62%">Logical AND</td><td width="20%">Left to Right</td></tr>
<tr><td width="18%"></td></tr>
<tr><td width="18%"><code>||</code></td><td width="62%">Logical OR</td><td width="20%">Left to Right</td></tr>
<tr><td width="18%"></td></tr>
<tr><td width="18%"><code>?:</code></td><td width="62%">Ternary Operator</td><td width="20%">Right to Left</td></tr>
<tr><td width="18%"></td></tr>
<tr><td width="18%"><code>=</code></td><td width="62%">Assignment</td><td width="20%">Right to Left</td></tr>
<tr><td width="18%"><code>+= -=</code></td><td width="62%">Addition/subtraction assignment</td></tr>
<tr><td width="18%"><code>*= /=</code></td><td width="62%">Multiplication/division assignment</td></tr>
</table>
<a name="ncap_nmc"></a> <!-- http://nco.sf.net/nco.html#ncap_nmc --><hr>
<a name="ID-Quoting"></a>
<div class="header">
<p>
Previous: <a href="#Operator-precedence-and-associativity" accesskey="p" rel="previous">Operator precedence and associativity</a>, Up: <a href="#ncap2-netCDF-Arithmetic-Processor" accesskey="u" rel="up">ncap2 netCDF Arithmetic Processor</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#General-Index" title="Index" rel="index">Index</a>]</p>
</div>
<a name="ID-Quoting-1"></a>
<h4 class="subsection">4.1.27 ID Quoting</h4>
<a name="index-ID-Quoting"></a>
<p>In this section when I refer to a name I mean a variable name, attribute name or a dimension name
The allowed characters in a valid netCDF name vary from release to release. (See end section). If you want to use metacharacters in a name or use a method name as a variable name then the name has to be quoted wherever it occurs.
</p>
<p>The default <acronym>NCO</acronym> name is specified by the regular expressions:
</p>
<div class="example">
<pre class="example">DGT: ('0'..'9');
LPH: ( 'a'..'z' | 'A'..'Z' | '_' );
name: (LPH)(LPH|DGT)+
</pre></div>
<p>The first character of a valid name must be alphabetic or the underscore. Any subsequent characters must be alphanumeric or underscore. ( e.g., a1,_23, hell_is_666 )
</p>
<p>The valid characters in a quoted name are specified by the regular expressions:
</p><div class="example">
<pre class="example">LPHDGT: ( 'a'..'z' | 'A'..'Z' | '_' | '0'..'9');
name: (LPHDGT|'-'|'+'|'.'|'('|')'|':' )+ ;
</pre></div>
<p>Quote a variable:<br>
’avg’ , ’10_+10’,’set_miss’ ’+-90field’ , ’–test’=10.0d<br> <br>
Quote a attribute: <br>
’three@10’, ’set_mss@+10’, ’666@hell’, ’t1@+units’="kelvin" <br> <br>
Quote a dimension: <br>
’$10’, ’$t1–’, ’$–odd’, c1[’$10’,’$t1–’]=23.0d <br>
</p>
<br>
<p>The following comments are from the netCDF library definitions and
detail the naming conventions for each release.
netcdf-3.5.1 <br>
netcdf-3.6.0-p1 <br>
netcdf-3.6.1 <br>
netcdf-3.6.2 <br>
</p><div class="example">
<pre class="example">/*
* ( [a-zA-Z]|[0-9]|'_'|'-'|'+'|'.'|'|':'|'@'|'('|')' )+
* Verify that name string is valid CDL syntax, i.e., all characters are
* alphanumeric, '-', '_', '+', or '.'.
* Also permit ':', '@', '(', or ')' in names for chemists currently making
* use of these characters, but don't document until ncgen and ncdump can
* also handle these characters in names.
*/
</pre></div>
<p>netcdf-3.6.3<br>
netcdf-4.0 Final 2008/08/28<br>
</p><div class="example">
<pre class="example">/*
* Verify that a name string is valid syntax. The allowed name
* syntax (in RE form) is:
*
* ([a-zA-Z_]|{UTF8})([^\x00-\x1F\x7F/]|{UTF8})*
*
* where UTF8 represents a multibyte UTF-8 encoding. Also, no
* trailing spaces are permitted in names. This definition
* must be consistent with the one in ncgen.l. We do not allow '/'
* because HDF5 does not permit slashes in names as slash is used as a
* group separator. If UTF-8 is supported, then a multi-byte UTF-8
* character can occur anywhere within an identifier. We later
* normalize UTF-8 strings to NFC to facilitate matching and queries.
*/
</pre></div>
<a name="ncatted"></a> <!-- http://nco.sf.net/nco.html#ncatted --><hr>
<a name="ncatted-netCDF-Attribute-Editor"></a>
<div class="header">
<p>
Next: <a href="#ncbo-netCDF-Binary-Operator" accesskey="n" rel="next">ncbo netCDF Binary Operator</a>, Previous: <a href="#ncap2-netCDF-Arithmetic-Processor" accesskey="p" rel="previous">ncap2 netCDF Arithmetic Processor</a>, Up: <a href="#Operator-Reference-Manual" accesskey="u" rel="up">Operator Reference Manual</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#General-Index" title="Index" rel="index">Index</a>]</p>
</div>
<a name="ncatted-netCDF-Attribute-Editor-1"></a>
<h3 class="section">4.2 <code>ncatted</code> netCDF Attribute Editor</h3>
<a name="index-attributes"></a>
<a name="index-attribute-names"></a>
<a name="index-editing-attributes"></a>
<a name="index-ncatted-4"></a>
<p>SYNTAX
</p><div class="example">
<pre class="example">ncatted [-a <var>att_dsc</var>] [-a …] [-D <var>dbg</var>] [-h] [--hdr_pad <var>nbr</var>]
[-l <var>path</var>] [-O] [-o <var>output-file</var>] [-p <var>path</var>] [-R] [-r] [--ram_all]
<var>input-file</var> [[<var>output-file</var>]]
</pre></div>
<p>DESCRIPTION
</p>
<a name="index-ncattget"></a>
<p><code>ncatted</code> edits attributes in a netCDF file.
If you are editing attributes then you are spending too much time in the
world of metadata, and <code>ncatted</code> was written to get you back out as
quickly and painlessly as possible.
<code>ncatted</code> can <em>append</em>, <em>create</em>, <em>delete</em>,
<em>modify</em>, and <em>overwrite</em> attributes (all explained below).
<code>ncatted</code> allows each editing operation to be applied
to every variable in a file.
This saves time when changing attribute conventions throughout a file.
<code>ncatted</code> is for <em>writing</em> attributes.
To <em>read</em> attribute values in plain text, use <code>ncks -m -M</code>,
or define something like <code>ncattget</code> as a shell command
(see <a href="#Filters-for-ncks">Filters for <code>ncks</code></a>).
</p>
<a name="index-history-4"></a>
<a name="index-_002dh-1"></a>
<p>Because repeated use of <code>ncatted</code> can considerably increase the size
of the <code>history</code> global attribute (see <a href="#History-Attribute">History Attribute</a>), the
‘<samp>-h</samp>’ switch is provided to override automatically appending the
command to the <code>history</code> global attribute in the <var>output-file</var>.
</p>
<a name="index-missing-values-1"></a>
<a name="index-data_002c-missing-1"></a>
<a name="index-_005fFillValue-2"></a>
<p>When <code>ncatted</code> is used to change the <code>_FillValue</code> attribute,
it changes the associated missing data self-consistently.
If the internal floating point representation of a missing value,
e.g., 1.0e36, differs between two machines then netCDF files produced
on those machines will have incompatible missing values.
This allows <code>ncatted</code> to change the missing values in files from
different machines to a single value so that the files may then be
concatenated, e.g., by <code>ncrcat</code>, without losing information.
See <a href="#Missing-Values">Missing Values</a>, for more information.
</p>
<p>To master <code>ncatted</code> one must understand the meaning of the
structure that describes the attribute modification, <var>att_dsc</var>
specified by the required option ‘<samp>-a</samp>’ or ‘<samp>--attribute</samp>’.
Each <var>att_dsc</var> contains five elements, which makes using
<code>ncatted</code> somewhat complicated, yet powerful.
The <var>att_dsc</var> fields are in the following order:<br>
</p>
<p><var>att_dsc</var> = <var>att_nm</var>, <var>var_nm</var>, <var>mode</var>, <var>att_type</var>,
<var>att_val</var><br>
</p>
<dl compact="compact">
<dt><var>att_nm</var></dt>
<dd><p>Attribute name.
Example: <code>units</code>
</p></dd>
<dt><var>var_nm</var></dt>
<dd><p>Variable name.
Example: <code>pressure</code>, <code>'^H2O'</code>.
<a name="index-extended-regular-expressions-3"></a>
<a name="index-regular-expressions-4"></a>
<a name="index-pattern-matching-2"></a>
<a name="index-wildcards-2"></a>
Regular expressions (see <a href="#Subsetting-Files">Subsetting Files</a>) are accepted and will
select any matching variable names.
The names <code>global</code> and <code>group</code> have special meaning.
</p></dd>
<dt><var>mode</var></dt>
<dd><p>Edit mode abbreviation.
Example: <code>a</code>.
See below for complete listing of valid values of <var>mode</var>.
</p></dd>
<dt><var>att_type</var></dt>
<dd><p>Attribute type abbreviation.
Example: <code>c</code>.
See below for complete listing of valid values of <var>att_type</var>.
</p></dd>
<dt><var>att_val</var></dt>
<dd><p>Attribute value.
Example: <code>pascal</code>.
</p></dd>
</dl>
<p>There should be no empty space between these five consecutive
arguments.
The description of these arguments follows in their order of
appearance.
</p>
<p>The value of <var>att_nm</var> is the name of the attribute you want to
edit.
This meaning of this should be clear to all <code>ncatted</code> users.
Recall, as mentioned above, that <var>var_nm</var> may be specified as a
regular expression.
If <var>att_nm</var> is omitted (i.e., left blank) and <em>Delete</em> mode is
selected, then all attributes associated with the specified variable
will be deleted.
</p>
<a name="index-global-attributes-4"></a>
<a name="index-attributes_002c-global-4"></a>
<p>The value of <var>var_nm</var> is the name of the variable containing the
attribute (named <var>att_nm</var>) that you want to edit.
There are three very important and useful exceptions to this rule.
The value of <var>var_nm</var> can also be used to direct <code>ncatted</code>
to edit global attributes, or to repeat the editing operation for every
group or variable in a file.
A value<!-- /@w --> of <var>var_nm</var> of <code>global</code> indicates that <var>att_nm</var>
refers to a global (i.e., root-level) attribute, rather than to a
particular variable’s attribute.
This is the method <code>ncatted</code> supports for editing global
attributes.
A value<!-- /@w --> of <var>var_nm</var> of <code>group</code> indicates that <var>att_nm</var>
refers to all groups, rather than to a particular variable’s or group’s
attribute.
The operation will proceed to edit group metadata for every group.
Finally, if <var>var_nm</var> is left blank, then <code>ncatted</code>
attempts to perform the editing operation on every variable in the file.
This option may be convenient to use if you decide to change the
conventions you use for describing the data.
</p>
<a name="mode"></a> <!-- http://nco.sf.net/nco.html#mode -->
<a name="att_mode"></a> <!-- http://nco.sf.net/nco.html#att_mode --><p>The value of <var>mode</var> is a single character abbreviation (<code>a</code>,
<code>c</code>, <code>d</code>, <code>m</code>, or <code>o</code>) standing for one of
five editing modes:<br>
<a name="index-attributes_002c-appending"></a>
<a name="index-attributes_002c-creating"></a>
<a name="index-attributes_002c-deleting"></a>
<a name="index-attributes_002c-modifying"></a>
<a name="index-attributes_002c-editing"></a>
<a name="index-attributes_002c-overwriting"></a>
</p><dl compact="compact">
<dt><code>a</code></dt>
<dd><p><em>Append</em>.
Append value <var>att_val</var> to current <var>var_nm</var> attribute
<var>att_nm</var> value <var>att_val</var>, if any.
If <var>var_nm</var> does not have an attribute <var>att_nm</var>, there is no
effect.
</p></dd>
<dt><code>c</code></dt>
<dd><p><em>Create</em>.
Create variable <var>var_nm</var> attribute <var>att_nm</var> with <var>att_val</var>
if <var>att_nm</var> does not yet exist.
If <var>var_nm</var> already has an attribute <var>att_nm</var>, there is no
effect.
</p></dd>
<dt><code>d</code></dt>
<dd><p><em>Delete</em>.
Delete current <var>var_nm</var> attribute <var>att_nm</var>.
If <var>var_nm</var> does not have an attribute <var>att_nm</var>, there is no
effect.
If <var>att_nm</var> is omitted (left blank), then all attributes associated
with the specified variable are automatically deleted.
When <em>Delete</em> mode is selected, the <var>att_type</var> and <var>att_val</var>
arguments are superfluous and may be left blank.
</p></dd>
<dt><code>m</code></dt>
<dd><p><em>Modify</em>.
Change value of current <var>var_nm</var> attribute <var>att_nm</var> to value
<var>att_val</var>.
If <var>var_nm</var> does not have an attribute <var>att_nm</var>, there is no
effect.
</p></dd>
<dt><code>o</code></dt>
<dd><p><em>Overwrite</em>.
Write attribute <var>att_nm</var> with value <var>att_val</var> to variable
<var>var_nm</var>, overwriting existing attribute <var>att_nm</var>, if any.
This is the default mode.
</p></dd>
</dl>
<a name="att_typ"></a> <!-- http://nco.sf.net/nco.html#att_typ --><p>The value of <var>att_type</var> is a single character abbreviation
(<code>f</code>, <code>d</code>, <code>l</code>, <code>i</code>, <code>s</code>, <code>c</code>,
<code>b</code>, <code>u</code>) or a short string standing for one of the twelve
primitive netCDF data types:<br>
</p><dl compact="compact">
<dt><code>f</code></dt>
<dd><p><em>Float</em>.
Value(s) specified in <var>att_val</var> will be stored as netCDF intrinsic
type <code>NC_FLOAT</code>.
</p></dd>
<dt><code>d</code></dt>
<dd><p><em>Double</em>.
Value(s) specified in <var>att_val</var> will be stored as netCDF intrinsic
type <code>NC_DOUBLE</code>.
</p></dd>
<dt><code>i, l</code></dt>
<dd><p><em>Integer</em> or <em>Long</em>.
Value(s) specified in <var>att_val</var> will be stored as netCDF intrinsic
type <code>NC_INT</code>.
</p></dd>
<dt><code>s</code></dt>
<dd><p><em>Short</em>.
Value(s) specified in <var>att_val</var> will be stored as netCDF intrinsic
type <code>NC_SHORT</code>.
</p></dd>
<dt><code>c</code></dt>
<dd><p><em>Char</em>.
Value(s) specified in <var>att_val</var> will be stored as netCDF intrinsic
type <code>NC_CHAR</code>.
</p></dd>
<dt><code>b</code></dt>
<dd><p><em>Byte</em>.
Value(s) specified in <var>att_val</var> will be stored as netCDF intrinsic
type <code>NC_BYTE</code>.
</p></dd>
<dt><code>ub</code></dt>
<dd><p><em>Unsigned Byte</em>.
Value(s) specified in <var>att_val</var> will be stored as netCDF intrinsic
type <code>NC_UBYTE</code>.
</p></dd>
<dt><code>us</code></dt>
<dd><p><em>Unsigned Short</em>.
Value(s) specified in <var>att_val</var> will be stored as netCDF intrinsic
type <code>NC_USHORT</code>.
</p></dd>
<dt><code>u, ui, ul</code></dt>
<dd><p><em>Unsigned Int</em>.
Value(s) specified in <var>att_val</var> will be stored as netCDF intrinsic
type <code>NC_UINT</code>.
</p></dd>
<dt><code>ll, int64</code></dt>
<dd><p><em>Int64</em>.
Value(s) specified in <var>att_val</var> will be stored as netCDF intrinsic
type <code>NC_INT64</code>.
</p></dd>
<dt><code>ull, uint64</code></dt>
<dd><p><em>Uint64</em>.
Value(s) specified in <var>att_val</var> will be stored as netCDF intrinsic
type <code>NC_UINT64</code>.
</p></dd>
<dt><code>sng, string</code></dt>
<dd><p><em>String</em>.
Value(s) specified in <var>att_val</var> will be stored as netCDF intrinsic
type <code>NC_STRING</code>.
Note that <code>ncatted</code> handles type <code>NC_STRING</code> attributes
correctly beginning with version 4.3.3 released in July, 2013.
Earlier versions fail when asked to handle <code>NC_STRING</code> attributes.
</p></dd>
</dl>
<p>In <em>Delete</em> mode the specification of <var>att_type</var> is optional
(and is ignored if supplied).
</p>
<p>The value of <var>att_val</var> is what you want to change attribute
<var>att_nm</var> to contain.
The specification of <var>att_val</var> is optional in <em>Delete</em> (and is
ignored) mode.
Attribute values for all types besides <code>NC_CHAR</code> must have an
attribute length of at least one.
Thus <var>att_val</var> may be a single value or one-dimensional array of
elements of type <code>att_type</code>.
If the <var>att_val</var> is not set or is set to empty space,
and the <var>att_type</var> is <code>NC_CHAR</code>, e.g., <code>-a units,T,o,c,""</code>
or <code>-a units,T,o,c,</code>, then the corresponding attribute is set to
have zero length.
When specifying an array of values, it is safest to enclose
<var>att_val</var> in single or double quotes, e.g.,
<code>-a levels,T,o,s,"1,2,3,4"</code> or
<code>-a levels,T,o,s,'1,2,3,4'</code>.
The quotes are strictly unnecessary around <var>att_val</var> except
when <var>att_val</var> contains characters which would confuse the calling
shell, such as spaces, commas, and wildcard characters.
</p>
<a name="index-Perl-2"></a>
<a name="index-ASCII"></a>
<p><acronym>NCO</acronym> processing of <code>NC_CHAR</code> attributes is a bit like Perl in
that it attempts to do what you want by default (but this sometimes
causes unexpected results if you want unusual data storage).
<a name="index-printf_0028_0029"></a>
<a name="index-_005cn-_0028ASCII-LF_002c-linefeed_0029"></a>
<a name="index-characters_002c-special"></a>
<a name="index-_005ct-_0028ASCII-HT_002c-horizontal-tab_0029"></a>
If the <var>att_type</var> is <code>NC_CHAR</code> then the argument is interpreted as a
string and it may contain C-language escape sequences, e.g., <code>\n</code>,
which <acronym>NCO</acronym> will interpret before writing anything to disk.
<acronym>NCO</acronym> translates valid escape sequences and stores the
appropriate <acronym>ASCII</acronym> code instead.
Since two byte escape sequences, e.g., <code>\n</code>, represent one-byte
<acronym>ASCII</acronym> codes, e.g., <acronym>ASCII</acronym> 10 (decimal), the stored
string attribute is one byte shorter than the input string length for
each embedded escape sequence.
The most frequently used C-language escape sequences are <code>\n</code> (for
linefeed) and <code>\t</code> (for horizontal tab).
These sequences in particular allow convenient editing of formatted text
attributes.
<a name="index-_005ca-_0028ASCII-BEL_002c-bell_0029"></a>
<a name="index-_005cb-_0028ASCII-BS_002c-backspace_0029"></a>
<a name="index-_005cf-_0028ASCII-FF_002c-formfeed_0029"></a>
<a name="index-_005cr-_0028ASCII-CR_002c-carriage-return_0029"></a>
<a name="index-_005cv-_0028ASCII-VT_002c-vertical-tab_0029"></a>
<a name="index-_005c_005c-_0028ASCII-_005c_002c-backslash_0029"></a>
The other valid <acronym>ASCII</acronym> codes are <code>\a</code>, <code>\b</code>, <code>\f</code>,
<code>\r</code>, <code>\v</code>, and <code>\\</code>.
See <a href="#ncks-netCDF-Kitchen-Sink">ncks netCDF Kitchen Sink</a>, for more examples of string formatting
(with the <code>ncks</code> ‘<samp>-s</samp>’ option) with special characters.
</p>
<a name="index-_005c_0027-_0028protected-end-quote_0029"></a>
<a name="index-_005c_0022-_0028protected-double-quote_0029"></a>
<a name="index-_005c_003f-_0028protected-question-mark_0029"></a>
<a name="index-_005c_005c-_0028protected-backslash_0029"></a>
<a name="index-_0027-_0028end-quote_0029"></a>
<a name="index-_0022-_0028double-quote_0029"></a>
<a name="index-_003f-_0028question-mark_0029"></a>
<a name="index-_005c-_0028backslash_0029"></a>
<a name="index-special-characters"></a>
<a name="index-ASCII-1"></a>
<p>Analogous to <code>printf</code>, other special characters are also allowed by
<code>ncatted</code> if they are "protected" by a backslash.
The characters <code>"</code>, <code>'</code>, <code>?</code>, and <code>\</code> may be
input to the shell as <code>\"</code>, <code>\'</code>, <code>\?</code>, and <code>\\</code>.
<acronym>NCO</acronym> simply strips away the leading backslash from these
characters before editing the attribute.
No other characters require protection by a backslash.
Backslashes which precede any other character (e.g., <code>3</code>, <code>m</code>,
<code>$</code>, <code>|</code>, <code>&</code>, <code>@</code>, <code>%</code>, <code>{</code>, and
<code>}</code>) will not be filtered and will be included in the attribute.
</p>
<a name="index-strings"></a>
<a name="index-NUL_002dtermination"></a>
<a name="index-NUL"></a>
<a name="index-C-language-6"></a>
<a name="index-0-_0028NUL_0029"></a>
<p>Note that the NUL character <code>\0</code> which terminates C language<!-- /@w -->
strings is assumed and need not be explicitly specified.
If <code>\0</code> is input, it is translated to the NUL character.
However, this will make the subsequent portion of the string, if any,
invisible to C standard<!-- /@w --> library string functions.
And that may cause unintended consequences.
Because of these context-sensitive rules, one must use <code>ncatted</code>
with care in order to store data, rather than text strings, in an
attribute of type <code>NC_CHAR</code>.
</p>
<p>Note that <code>ncatted</code> interprets character attributes
(i.e., attributes of type <code>NC_CHAR</code>) as strings.
<a name="xmp_ncatted"></a> <!-- http://nco.sf.net/nco.html#xmp_ncatted -->EXAMPLES
</p>
<p>Append the string "Data version 2.0.\n" to the global attribute
<code>history</code>:
</p><div class="example">
<pre class="example">ncatted -a history,global,a,c,"Data version 2.0\n" in.nc
</pre></div>
<p>Note the use of embedded C language<!-- /@w --> <code>printf()</code>-style escape
sequences.
</p>
<p>Change the value of the <code>long_name</code> attribute for variable <code>T</code>
from whatever it currently is to "temperature":
</p><div class="example">
<pre class="example">ncatted -a long_name,T,o,c,temperature in.nc
</pre></div>
<a name="NaN"></a> <!-- http://nco.sf.net/nco.html#NaN --><a name="index-NaN"></a>
<a name="index-IEEE-NaN"></a>
<a name="index-Not_002da_002dNumber"></a>
<p><acronym>NCO</acronym> arithmetic operators will not work as expected on IEEE
NaN (short for Not-a-Number) and NaN-like numbers such as positive
infinity and negative infinity.
One way to work-around this problem is to change IEEE NaNs to normal
missing values.
As of <acronym>NCO</acronym> 4.1.0 (March, 2012), <code>ncatted</code> works with
NaNs.
First set the missing value (i.e., the value of the <code>_FillValue</code>
attribute) for the variable(s) in question to the IEEE NaN value.
</p><div class="example">
<pre class="example">ncatted -a _FillValue,,o,f,NaN in.nc
</pre></div>
<p>Then change the missing value from the IEEE NaN value to a normal IEEE
number, like 1.0e36 (or to whatever the original missing value was).
</p><div class="example">
<pre class="example">ncatted -a _FillValue,,m,f,1.0e36 in.nc
</pre></div>
<p>Delete all existing <code>units</code> attributes:
</p><div class="example">
<pre class="example">ncatted -a units,,d,, in.nc
</pre></div>
<p>The value of <var>var_nm</var> was left blank in order to select all
variables in the file.
The values of <var>att_type</var> and <var>att_val</var> were left blank because
they are superfluous in <em>Delete</em> mode.
</p>
<a name="index-global-attribute"></a>
<a name="index-global-attributes-5"></a>
<a name="index-attributes_002c-global-5"></a>
<p>Delete all attributes associated with the <code>tpt</code> variable, and
delete all global attributes
</p><div class="example">
<pre class="example">ncatted -a ,tpt,d,, -a ,global,d,, in.nc
</pre></div>
<p>The value of <var>att_nm</var> was left blank in order to select all
attributes associated with the variable.
To delete all global attributes, simply replace <code>tpt</code> with
<code>global</code> in the above.
</p>
<a name="index-units-3"></a>
<p>Modify all existing <code>units</code> attributes to "meter second-1":
</p><div class="example">
<pre class="example">ncatted -a units,,m,c,"meter second-1" in.nc
</pre></div>
<a name="index-units-4"></a>
<p>Add a <code>units</code> attribute of "kilogram kilogram-1" to all variables
whose first three characters are ‘<samp>H2O</samp>’:
</p><div class="example">
<pre class="example">ncatted -a units,'^H2O',c,c,"kilogram kilogram-1" in.nc
</pre></div>
<p>Overwrite the <code>quanta</code> attribute of variable
<code>energy</code> to an array of four integers.
</p><div class="example">
<pre class="example">ncatted -O -a quanta,energy,o,s,"010,101,111,121" in.nc
</pre></div>
<a name="index-extended-regular-expressions-4"></a>
<a name="index-regular-expressions-5"></a>
<a name="index-pattern-matching-3"></a>
<a name="index-wildcards-3"></a>
<p>As of <acronym>NCO</acronym> 3.9.6 (January, 2009), <code>ncatted</code> accepts
<em>extended regular expressions</em> as arguments for variable names.
Create <code>isotope</code> attributes for all variables containing ‘<samp>H2O</samp>’
in their names.
</p><div class="example">
<pre class="example">ncatted -O -a isotope,'^H2O*',c,s,"18" in.nc
</pre></div>
<p>See <a href="#Subsetting-Files">Subsetting Files</a> for more details.
</p>
<a name="index-groups-1"></a>
<p>As of <acronym>NCO</acronym> 4.3.8 (November, 2013), <code>ncatted</code>
accepts full and partial group paths in names of attributes,
variables, dimensions, and groups.
</p><div class="example">
<pre class="example"># Overwrite units attribute of specific 'lon' variable
ncatted -O -a units,/g1/lon,o,c,"degrees_west" in_grp.nc
# Overwrite units attribute of all 'lon' variables
ncatted -O -a units,lon,o,c,"degrees_west" in_grp.nc
# Delete units attribute of all 'lon' variables
ncatted -O -a units,lon,d,, in_grp.nc
# Overwrite units attribute with new type for specific 'lon' variable
ncatted -O -a units,/g1/lon,o,sng,"degrees_west" in_grp.nc
# Add new_att attribute to all variables
ncatted -O -a new_att,,c,sng,"new variable attribute" in_grp.nc
# Add new_grp_att group attribute to all groups
ncatted -O -a new_grp_att,group,c,sng,"new group attribute" in_grp.nc
# Add new_grp_att group attribute to single group
ncatted -O -a g1_grp_att,g1,c,sng,"new group attribute" in_grp.nc
# Add new_glb_att global attribute to root group
ncatted -O -a new_glb_att,global,c,sng,"new global attribute" in_grp.nc
</pre></div>
<p>Demonstrate input of C-language escape sequences (e.g., <code>\n</code>) and
other special characters (e.g., <code>\"</code>)
</p><div class="example">
<pre class="example">ncatted -h -a special,global,o,c,
'\nDouble quote: \"\nTwo consecutive double quotes: \"\"\n
Single quote: Beyond my shell abilities!\nBackslash: \\\n
Two consecutive backslashes: \\\\\nQuestion mark: \?\n' in.nc
</pre></div>
<p>Note that the entire attribute is protected from the shell by single
quotes.
These outer single quotes are necessary for interactive use, but may be
omitted in batch scripts.
</p>
<a name="ncbo"></a> <!-- http://nco.sf.net/nco.html#ncbo -->
<a name="ncdiff"></a> <!-- http://nco.sf.net/nco.html#ncdiff -->
<a name="ncadd"></a> <!-- http://nco.sf.net/nco.html#ncadd -->
<a name="ncsub"></a> <!-- http://nco.sf.net/nco.html#ncsub -->
<a name="ncsubtract"></a> <!-- http://nco.sf.net/nco.html#ncsubtract -->
<a name="ncmult"></a> <!-- http://nco.sf.net/nco.html#ncmult -->
<a name="ncmultiply"></a> <!-- http://nco.sf.net/nco.html#ncmultiply -->
<a name="ncdivide"></a> <!-- http://nco.sf.net/nco.html#ncdivide --><hr>
<a name="ncbo-netCDF-Binary-Operator"></a>
<div class="header">
<p>
Next: <a href="#nces-netCDF-Ensemble-Statistics" accesskey="n" rel="next">nces netCDF Ensemble Statistics</a>, Previous: <a href="#ncatted-netCDF-Attribute-Editor" accesskey="p" rel="previous">ncatted netCDF Attribute Editor</a>, Up: <a href="#Operator-Reference-Manual" accesskey="u" rel="up">Operator Reference Manual</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#General-Index" title="Index" rel="index">Index</a>]</p>
</div>
<a name="ncbo-netCDF-Binary-Operator-1"></a>
<h3 class="section">4.3 <code>ncbo</code> netCDF Binary Operator</h3>
<a name="index-ncbo-1"></a>
<a name="index-ncdiff"></a>
<a name="index-ncadd"></a>
<a name="index-ncsub"></a>
<a name="index-ncsubtract"></a>
<a name="index-ncmult"></a>
<a name="index-ncmultiply"></a>
<a name="index-ncdivide"></a>
<a name="index-binary-operations-1"></a>
<a name="index-addition-1"></a>
<a name="index-subtraction-1"></a>
<a name="index-multiplication-1"></a>
<a name="index-adding-data"></a>
<a name="index-subtracting-data"></a>
<a name="index-multiplying-data"></a>
<a name="index-dividing-data"></a>
<p>SYNTAX
</p><div class="example">
<pre class="example">ncbo [-3] [-4] [-6] [-7] [-A] [-C] [-c]
[--cnk_dmn nm,sz] [--cnk_map map] [--cnk_plc plc] [--cnk_scl sz]
[-D <var>dbg</var>] [-d <var>dim</var>,[<var>min</var>][,[<var>max</var>][,[<var>stride</var>]]] [-F]
[-G <var>gpe_dsc</var>] [-g <var>grp</var>[,…]] [-h] [--hdr_pad <var>nbr</var>]
[-L <var>dfl_lvl</var>] [-l <var>path</var>] [--no_tmp_fl]
[-O] [-o <var>file_3</var>] [-p <var>path</var>] [-R] [-r] [--ram_all]
[-t <var>thr_nbr</var>] [--unn] [-v <var>var</var>[,…]] [-X ...] [-x] [-y <var>op_typ</var>]
<var>file_1</var> <var>file_2</var> [<var>file_3</var>]
</pre></div>
<p>DESCRIPTION
</p>
<p><code>ncbo</code> performs binary operations on variables in <var>file_1</var>
and the corresponding variables (those with the same name) in
<var>file_2</var> and stores the results in <var>file_3</var>.
The binary operation operates on the entire files (modulo any excluded
variables).
See <a href="#Missing-Values">Missing Values</a>, for treatment of missing values.
One of the four standard arithmetic binary operations currently
supported must be selected with the ‘<samp>-y <var>op_typ</var></samp>’ switch (or
long options ‘<samp>--op_typ</samp>’ or ‘<samp>--operation</samp>’).
<a name="index-add"></a>
<a name="index-subtract"></a>
<a name="index-multiply"></a>
<a name="index-divide"></a>
<a name="index-_002b"></a>
<a name="index-_002d"></a>
<a name="index-_002a"></a>
<a name="index-_002f"></a>
<a name="index-_002dy-op_005ftyp-1"></a>
<a name="index-_002d_002doperation-op_005ftyp-1"></a>
<a name="index-_002d_002dop_005ftyp-op_005ftyp-1"></a>
<a name="index-alternate-invocations"></a>
The valid binary operations for <code>ncbo</code>, their definitions,
corresponding values of the <var>op_typ</var> key, and alternate invocations
are:
</p><dl compact="compact">
<dt><em>Addition</em></dt>
<dd><p>Definition: <var>file_3</var> = <var>file_1</var> + <var>file_2</var><br>
Alternate invocation: <code>ncadd</code><br>
<var>op_typ</var> key values: ‘<samp>add</samp>’, ‘<samp>+</samp>’, ‘<samp>addition</samp>’<br>
Examples: ‘<samp>ncbo --op_typ=add 1.nc 2.nc 3.nc</samp>’, ‘<samp>ncadd 1.nc 2.nc 3.nc</samp>’<br>
</p></dd>
<dt><em>Subtraction</em></dt>
<dd><p>Definition: <var>file_3</var> = <var>file_1</var> - <var>file_2</var><br>
Alternate invocations: <code>ncdiff</code>, <code>ncsub</code>, <code>ncsubtract</code><br>
<var>op_typ</var> key values: ‘<samp>sbt</samp>’, ‘<samp>-</samp>’, ‘<samp>dff</samp>’, ‘<samp>diff</samp>’, ‘<samp>sub</samp>’, ‘<samp>subtract</samp>’, ‘<samp>subtraction</samp>’<br>
Examples: ‘<samp>ncbo --op_typ=- 1.nc 2.nc 3.nc</samp>’, ‘<samp>ncdiff 1.nc 2.nc 3.nc</samp>’<br>
</p></dd>
<dt><em>Multiplication</em></dt>
<dd><p>Definition: <var>file_3</var> = <var>file_1</var> * <var>file_2</var><br>
Alternate invocations: <code>ncmult</code>, <code>ncmultiply</code><br>
<var>op_typ</var> key values: ‘<samp>mlt</samp>’, ‘<samp>*</samp>’, ‘<samp>mult</samp>’, ‘<samp>multiply</samp>’, ‘<samp>multiplication</samp>’<br>
Examples: ‘<samp>ncbo --op_typ=mlt 1.nc 2.nc 3.nc</samp>’, ‘<samp>ncmult 1.nc 2.nc 3.nc</samp>’<br>
</p></dd>
<dt><em>Division</em></dt>
<dd><p>Definition: <var>file_3</var> = <var>file_1</var> / <var>file_2</var><br>
Alternate invocation: <code>ncdivide</code><br>
<var>op_typ</var> key values: ‘<samp>dvd</samp>’, ‘<samp>/</samp>’, ‘<samp>divide</samp>’, ‘<samp>division</samp>’<br>
Examples: ‘<samp>ncbo --op_typ=/ 1.nc 2.nc 3.nc</samp>’, ‘<samp>ncdivide 1.nc 2.nc 3.nc</samp>’<br>
</p></dd>
</dl>
<p>Care should be taken when using the shortest form of key values,
i.e., ‘<samp>+</samp>’, ‘<samp>-</samp>’, ‘<samp>*</samp>’, and ‘<samp>/</samp>’<!-- /@w -->.
Some of these single characters may have special meanings to the shell
<a name="index-naked-characters"></a>
<a name="DOCF50" href="#FOOT50"><sup>50</sup></a>.
<a name="index-Bash-shell"></a>
Place these characters inside quotes to keep them from being interpreted
(globbed) by the shell
<a name="DOCF51" href="#FOOT51"><sup>51</sup></a>.
<a name="index-globbing-4"></a>
<a name="index-shell-4"></a>
<a name="index-quotes-2"></a>
For example, the following commands are equivalent
</p><div class="example">
<pre class="example">ncbo --op_typ=* 1.nc 2.nc 3.nc # Dangerous (shell may try to glob)
ncbo --op_typ='*' 1.nc 2.nc 3.nc # Safe ('*' protected from shell)
ncbo --op_typ="*" 1.nc 2.nc 3.nc # Safe ('*' protected from shell)
ncbo --op_typ=mlt 1.nc 2.nc 3.nc
ncbo --op_typ=mult 1.nc 2.nc 3.nc
ncbo --op_typ=multiply 1.nc 2.nc 3.nc
ncbo --op_typ=multiplication 1.nc 2.nc 3.nc
ncmult 1.nc 2.nc 3.nc # First do 'ln -s ncbo ncmult'
ncmultiply 1.nc 2.nc 3.nc # First do 'ln -s ncbo ncmultiply'
</pre></div>
<p>No particular argument or invocation form is preferred.
Users are encouraged to use the forms which are most intuitive to them.
</p>
<a name="index-alias"></a>
<a name="index-ln-_002ds"></a>
<a name="index-symbolic-links-3"></a>
<p>Normally, <code>ncbo</code> will fail unless an operation type is specified
with ‘<samp>-y</samp>’ (equivalent to ‘<samp>--op_typ</samp>’).
You may create exceptions to this rule to suit your particular tastes,
in conformance with your site’s policy on <em>symbolic links</em> to
executables (files of a different name point to the actual executable).
For many years, <code>ncdiff</code> was the main binary file operator.
As a result, many users prefer to continue invoking <code>ncdiff</code>
rather than memorizing a new command (‘<samp>ncbo -y <var>sbt</var></samp>’) which
behaves identically to the original <code>ncdiff</code> command.
However, from a software maintenance standpoint, maintaining a distinct
executable for each binary operation (e.g., <code>ncadd</code>) is untenable,
and a single executable, <code>ncbo</code>, is desirable.
To maintain backward compatibility, therefore, <acronym>NCO</acronym>
automatically creates a symbolic link from <code>ncbo</code> to
<code>ncdiff</code>.
Thus <code>ncdiff</code> is called an <em>alternate invocation</em> of
<code>ncbo</code>.
<code>ncbo</code> supports many additional alternate invocations which must
be manually activated.
Should users or system adminitrators decide to activate them, the
procedure is simple.
For example, to use ‘<samp>ncadd</samp>’ instead of ‘<samp>ncbo --op_typ=add</samp>’,
simply create a symbolic link from <code>ncbo</code> to <code>ncadd</code>
<a name="DOCF52" href="#FOOT52"><sup>52</sup></a>.
The alternatate invocations supported for each operation type are listed
above.
Alternatively, users may always define ‘<samp>ncadd</samp>’ as an <em>alias</em> to
‘<samp>ncbo --op_typ=add</samp>’
<a name="DOCF53" href="#FOOT53"><sup>53</sup></a>.
</p>
<p>It is important to maintain portability in <acronym>NCO</acronym> scripts.
Therefore we recommend that site-specfic invocations (e.g.,
‘<samp>ncadd</samp>’) be used only in interactive sessions from the
command-line.
For scripts, we recommend using the full invocation (e.g.,
‘<samp>ncbo --op_typ=add</samp>’).
This ensures portability of scripts between users and sites.
</p>
<a name="brd_var"></a> <!-- http://nco.sf.net/nco.html#brd_var --><a name="index-broadcasting-variables-1"></a>
<a name="index-rank-1"></a>
<p><code>ncbo</code> operates (e.g., adds) variables in <var>file_2</var> with the
corresponding variables (those with the same name) in <var>file_1</var> and
stores the results in <var>file_3</var>.
<a name="index-broadcasting-variables-2"></a>
Variables in <var>file_1</var> or <var>file_2</var> are <em>broadcast</em> to conform
to the corresponding variable in the other input file if
necessary<a name="DOCF54" href="#FOOT54"><sup>54</sup></a>.
Now <code>ncbo</code> is completely symmetric with respect to <var>file_1</var>
and <var>file_2</var>, i.e.,
<em><var>file_1</var> - <var>file_2</var> = - (<var>file_2</var> - <var>file_1</var></em>.
</p>
<p>Broadcasting a variable means creating data in non-existing dimensions
by copying data in existing dimensions.
For example, a two dimensional variable in <var>file_2</var> can be
subtracted from a four, three, or two (not one or zero)
dimensional variable (of the same name) in <code>file_1</code>.
<a name="index-anomalies"></a>
This functionality allows the user to compute anomalies from the mean.
In the future, we will broadcast variables in <var>file_1</var>, if necessary
to conform to their counterparts in <var>file_2</var>.
<a name="index-rank-2"></a>
Thus, presently, the number of dimensions, or <em>rank</em>, of any
processed variable in <var>file_1</var> must be greater than or equal to the
rank of the same variable in <var>file_2</var>.
Of course, the size of all dimensions common to both <var>file_1</var> and
<var>file_2</var> must be equal.
</p>
<p>When computing anomalies from the mean it is often the case that
<var>file_2</var> was created by applying an averaging operator to a file
with initially the same dimensions as <var>file_1</var> (often <var>file_1</var>
itself).
In these cases, creating <var>file_2</var> with <code>ncra</code> rather than
<code>ncwa</code> will cause the <code>ncbo</code> operation to fail.
For concreteness say the record dimension in <code>file_1</code> is
<code>time</code>.
If <var>file_2</var> were created by averaging <var>file_1</var> over the
<code>time</code> dimension with the <code>ncra</code> operator rather than with
the <code>ncwa</code> operator, then <var>file_2</var> will have a <code>time</code>
dimension of size 1<!-- /@w --> rather than having no <code>time</code> dimension at
all
<a name="index-degenerate-dimension-3"></a>
<a name="index-_002db-1"></a>
<a name="DOCF55" href="#FOOT55"><sup>55</sup></a>.
In this case the input files to <code>ncbo</code>, <var>file_1</var> and
<var>file_2</var>, will have unequally sized <code>time</code> dimensions which
causes <code>ncbo</code> to fail.
To prevent this from occuring, use <code>ncwa</code> to remove the
<code>time</code> dimension from <var>file_2</var>.
See the example below.
</p>
<a name="index-coordinate-variable-3"></a>
<a name="index-NC_005fCHAR-1"></a>
<p><code>ncbo</code> never operates on coordinate variables or variables
of type <code>NC_CHAR</code> or <code>NC_STRING</code>.
This ensures that coordinates like (e.g., latitude and longitude) are
physically meaningful in the output file, <var>file_3</var>.
This behavior is hardcoded.
<a name="index-CF-conventions-4"></a>
<code>ncbo</code> applies special rules to some
<acronym>CF</acronym>-defined (and/or <acronym>NCAR CCSM</acronym> or <acronym>NCAR CCM</acronym>
fields) such as <code>ORO</code>.
See <a href="#CF-Conventions">CF Conventions</a> for a complete description.
Finally, we note that <code>ncflint</code> (see <a href="#ncflint-netCDF-File-Interpolator">ncflint netCDF File Interpolator</a>) is designed for file interpolation.
As such, it also performs file subtraction, addition, multiplication,
albeit in a more convoluted way than <code>ncbo</code>.
</p>
<a name="brd_grp"></a> <!-- http://nco.sf.net/nco.html#brd_grp -->
<a name="gb"></a> <!-- http://nco.sf.net/nco.html#gb -->
<a name="GB"></a> <!-- http://nco.sf.net/nco.html#GB --><a name="index-broadcasting-groups-1"></a>
<p>Beginning with <acronym>NCO</acronym> version 4.3.1 (May, 2013), <code>ncbo</code>
supports <em>group broadcasting</em>.
Group broadcasting means processing data based on group patterns in the
input file(s) and automatically transferring or transforming groups to
the output file.
Consider the case where <var>file_1</var> contains multiple groups each with
the variable <var>v1</var>, while <var>file_2</var> contains <var>v1</var> only in its
top-level (i.e., root) group.
Then <code>ncbo</code> will replicate the group structure of <var>file_1</var>
in the output file, <var>file_3</var>.
Each group in <var>file_3</var> contains the output of the corresponding
group in <var>file_1</var> operating on the data in the single group in
<var>file_2</var>.
An example is provided below.
</p>
<a name="xmp_ncbo"></a> <!-- http://nco.sf.net/nco.html#xmp_ncbo -->
<a name="xmp_ncdiff"></a> <!-- http://nco.sf.net/nco.html#xmp_ncdiff --><p>EXAMPLES
</p>
<p>Say files <samp>85_0112.nc</samp> and <samp>86_0112.nc</samp> each contain 12 months
of data.
Compute the change in the monthly averages from 1985 to 1986:
</p><div class="example">
<pre class="example">ncbo 86_0112.nc 85_0112.nc 86m85_0112.nc
ncdiff 86_0112.nc 85_0112.nc 86m85_0112.nc
ncbo --op_typ=sub 86_0112.nc 85_0112.nc 86m85_0112.nc
ncbo --op_typ='-' 86_0112.nc 85_0112.nc 86m85_0112.nc
</pre></div>
<p>These commands are all different ways of expressing the same thing.
</p>
<a name="index-broadcasting"></a>
<a name="index-rank-3"></a>
<p>The following examples demonstrate the broadcasting feature of
<code>ncbo</code>.
Say we wish to compute the monthly anomalies of <code>T</code> from the yearly
average of <code>T</code> for the year 1985.
First we create the 1985 average from the monthly data, which is stored
with the record dimension <code>time</code>.
</p><div class="example">
<pre class="example">ncra 85_0112.nc 85.nc
ncwa -O -a time 85.nc 85.nc
</pre></div>
<p>The second command, <code>ncwa</code>, gets rid of the <code>time</code> dimension
of size 1<!-- /@w --> that <code>ncra</code> left in <samp>85.nc</samp>.
Now none of the variables in <samp>85.nc</samp> has a <code>time</code> dimension.
A quicker<!-- /@w --> way to accomplish this is to use <code>ncwa</code> from the
beginning:
</p><div class="example">
<pre class="example">ncwa -a time 85_0112.nc 85.nc
</pre></div>
<p>We are now ready to use <code>ncbo</code> to compute the anomalies for 1985:
</p><div class="example">
<pre class="example">ncdiff -v T 85_0112.nc 85.nc t_anm_85_0112.nc
</pre></div>
<p>Each of the 12 records in <samp>t_anm_85_0112.nc</samp> now contains the
monthly deviation of <code>T</code> from the annual mean of <code>T</code> for each
gridpoint.
</p>
<p>Say we wish to compute the monthly gridpoint anomalies from the zonal
annual mean.
A <em>zonal mean</em><!-- /@w --> is a quantity that has been averaged over the
longitudinal (or <var>x</var>) direction.
First we use <code>ncwa</code> to average over longitudinal direction
<code>lon</code>, creating <samp>85_x.nc</samp>, the zonal mean of <samp>85.nc</samp>.
Then we use <code>ncbo</code> to subtract the zonal annual means from the
monthly gridpoint data:
</p><div class="example">
<pre class="example">ncwa -a lon 85.nc 85_x.nc
ncdiff 85_0112.nc 85_x.nc tx_anm_85_0112.nc
</pre></div>
<p>This examples works assuming <samp>85_0112.nc</samp> has dimensions
<code>time</code> and <code>lon</code>, and that <samp>85_x.nc</samp> has no <code>time</code>
or <code>lon</code> dimension.
</p>
<a name="index-broadcasting-groups-2"></a>
<p>Group broadcasting simplifies evaluation of multiple models against
observations.
Consider the input file <samp>cmip5.nc</samp> which contains multiple
top-level groups <code>cesm</code>, <code>ecmwf</code>, and <code>giss</code>, each of
which contains the surface air temperature field <code>tas</code>.
We wish to compare these models to observations stored in <samp>obs.nc</samp>
which contains <code>tas</code> only in its top-level (i.e., root) group.
It is often the case that many models and/or model simulations exist,
whereas only one observational dataset does.
We evaluate the models and obtain the bias (difference) between models
and observations by subtracting <samp>obs.nc</samp> from <samp>cmip5.nc</samp>.
Then <code>ncbo</code> “broadcasts” (i.e., replicates) the observational
data to match the group structure of <samp>cmip5.nc</samp>, subtracts,
and then stores the results in the output file, <samp>bias.nc</samp>
which has the same group structure as <samp>cmip5.nc</samp>.
</p><div class="example">
<pre class="example">% ncbo -O cmip5.nc obs.nc bias.nc
% ncks -H -v tas -d time,3 bias.nc
/cesm/tas
time[3] tas[3]=-1
/ecmwf/tas
time[3] tas[3]=0
/giss/tas
time[3] tas[3]=1
</pre></div>
<a name="csn_anm"></a> <!-- http://nco.sf.net/nco.html#csn_anm --><p>As a final example, say we have five years of monthly data (i.e.,
60 months<!-- /@w -->) stored in <samp>8501_8912.nc</samp> and we wish to create a
file which contains the twelve month seasonal cycle of the average
monthly anomaly from the five-year mean of this data.
The following method is just one permutation of many which will
accomplish the same result.
First use <code>ncwa</code> to create the five-year mean:
</p><div class="example">
<pre class="example">ncwa -a time 8501_8912.nc 8589.nc
</pre></div>
<p>Next use <code>ncbo</code> to create a file containing the difference of
each month’s data from the five-year mean:
</p><div class="example">
<pre class="example">ncbo 8501_8912.nc 8589.nc t_anm_8501_8912.nc
</pre></div>
<p>Now use <code>ncks</code> to group together the five January anomalies in
one file, and use <code>ncra</code> to create the average anomaly for all
five Januarys.
These commands are embedded in a shell loop so they are repeated for all
twelve months:
<a name="index-Bash-Shell"></a>
<a name="index-Bourne-Shell-1"></a>
<a name="index-C-Shell-1"></a>
</p><div class="example">
<pre class="example">for idx in {1..12}; do # Bash Shell (version 3.0+)
idx=`printf "%02d" ${idx}` # Zero-pad to preserve order
ncks -F -d time,${idx},,12 t_anm_8501_8912.nc foo.${idx}
ncra foo.${idx} t_anm_8589_${idx}.nc
done
for idx in 01 02 03 04 05 06 07 08 09 10 11 12; do # Bourne Shell
ncks -F -d time,${idx},,12 t_anm_8501_8912.nc foo.${idx}
ncra foo.${idx} t_anm_8589_${idx}.nc
done
foreach idx (01 02 03 04 05 06 07 08 09 10 11 12) # C Shell
ncks -F -d time,${idx},,12 t_anm_8501_8912.nc foo.${idx}
ncra foo.${idx} t_anm_8589_${idx}.nc
end
</pre></div>
<p>Note that <code>ncra</code> understands the <code>stride</code> argument so the
two commands inside the loop may be combined into the single command
</p><div class="example">
<pre class="example">ncra -F -d time,${idx},,12 t_anm_8501_8912.nc foo.${idx}
</pre></div>
<p>Finally, use <code>ncrcat</code> to concatenate the 12 average<!-- /@w --> monthly
anomaly files into one twelve-record file which contains the entire
seasonal cycle of the monthly anomalies:
</p><div class="example">
<pre class="example">ncrcat t_anm_8589_??.nc t_anm_8589_0112.nc
</pre></div>
<a name="nces"></a> <!-- http://nco.sf.net/nco.html#nces -->
<a name="ncea"></a> <!-- http://nco.sf.net/nco.html#ncea --><hr>
<a name="nces-netCDF-Ensemble-Statistics"></a>
<div class="header">
<p>
Next: <a href="#ncecat-netCDF-Ensemble-Concatenator" accesskey="n" rel="next">ncecat netCDF Ensemble Concatenator</a>, Previous: <a href="#ncbo-netCDF-Binary-Operator" accesskey="p" rel="previous">ncbo netCDF Binary Operator</a>, Up: <a href="#Operator-Reference-Manual" accesskey="u" rel="up">Operator Reference Manual</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#General-Index" title="Index" rel="index">Index</a>]</p>
</div>
<a name="nces-netCDF-Ensemble-Statistics-1"></a>
<h3 class="section">4.4 <code>nces</code> netCDF Ensemble Statistics</h3>
<a name="index-averaging-data-1"></a>
<a name="index-ensemble-average"></a>
<a name="index-nces-2"></a>
<p>SYNTAX
</p><div class="example">
<pre class="example">nces [-3] [-4] [-6] [-7] [-A] [-C] [-c]
[--cnk_dmn nm,sz] [--cnk_map map] [--cnk_plc plc] [--cnk_scl sz]
[-D <var>dbg</var>] [-d <var>dim</var>,[<var>min</var>][,[<var>max</var>][,[<var>stride</var>]]] [-F]
[-G <var>gpe_dsc</var>] [-g <var>grp</var>[,…]] [-h] [--hdf] [--hdr_pad <var>nbr</var>]
[-L <var>dfl_lvl</var>] [-l <var>path</var>] [-n <var>loop</var>] [--no_tmp_fl] [--nsm_fl|grp] [--nsm_sfx sfx]
[-O] [-o <var>output-file</var>] [-p <var>path</var>] [-R] [-r] [--ram_all] [--rth_dbl|flt]
[-t <var>thr_nbr</var>] [--unn] [-v <var>var</var>[,…]] [-X ...] [-x] [-y <var>op_typ</var>]
[<var>input-files</var>] [<var>output-file</var>]
</pre></div>
<p>DESCRIPTION
</p>
<p><code>nces</code> performs gridpoint statistics on variables across an
arbitrary number (an <em>ensemble</em>) of <var>input-files</var> and/or of
input groups within each file.
Each file (or group) receives an equal weight.
<code>nces</code> was formerly (until <acronym>NCO</acronym> version 4.3.9,
released December, 2013) known as <code>ncea</code> (netCDF Ensemble
Averager)<a name="DOCF56" href="#FOOT56"><sup>56</sup></a>.
<a name="index-ensemble-1"></a>
For example, <code>nces</code> will average a set of files or groups,
weighting each file or group evenly.
This is distinct from <code>ncra</code>, which performs statistics only
over the record dimension(s) (e.g., <var>time</var>), and weights each record
in each record dimension evenly.
</p>
<p>The file or group is the logical unit of organization for the results of
many scientific studies.
Often one wishes to generate a file or group which is the statistical
product (e.g., average) of many separate files or groups.
This may be to reduce statistical noise by combining the results of a
large number of experiments, or it may simply be a step in a procedure
whose goal is to compute anomalies from a mean state.
In any case, when one desires to generate a file whose statistical
properties are equally influenced by all the inputs, then <code>nces</code>
is the operator to use.
</p>
<p>Variables in the <var>output-file</var> are the same size as the variable
hyperslab in each input file or group, and each input file or group
must be the same size after hyperslabbing
<a name="DOCF57" href="#FOOT57"><sup>57</sup></a>
<a name="index-record-dimension-3"></a>
<a name="index-hyperslab-2"></a>
<code>nces</code> does allow files to differ in the record dimension size
if the requested record hyperslab (see <a href="#Hyperslabs">Hyperslabs</a>) resolves to the
same size for all files.
<code>nces</code> recomputes the record dimension hyperslab limits for
each input file so that coordinate limits may be used to select equal
length timeseries from unequal length files.
<a name="index-IPCC"></a>
<a name="index-AR4"></a>
<a name="index-CMIP"></a>
This simplifies analysis of unequal length timeseries from simulation
ensembles (e.g., the <acronym>CMIP3</acronym> <acronym>IPCC</acronym> <acronym>AR4</acronym>
archive).
</p>
<a name="nsm_fl"></a> <!-- http://nco.sf.net/nco.html#nsm_fl -->
<a name="nsm_grp"></a> <!-- http://nco.sf.net/nco.html#nsm_grp -->
<a name="nsm_sfx"></a> <!-- http://nco.sf.net/nco.html#nsm_sfx --><a name="index-_002d_002dnsm_005ffl"></a>
<a name="index-_002d_002dnsm_005fgrp"></a>
<a name="index-_002d_002densemble_005ffile"></a>
<a name="index-_002d_002densemble_005fgroup"></a>
<a name="index-_002d_002dnsm_005fsfx"></a>
<a name="index-_002d_002densemble_005fsuffix"></a>
<p><code>nces</code> works in one of two modes, file ensembles
or group ensembles.
File ensembles are the default (equivalent to the old <code>ncea</code>)
and may also be explicitly specified by the ‘<samp>--nsm_fl</samp>’ or
‘<samp>--ensemble_file</samp>’ switches.
To perform statistics on ensembles of groups, a newer feature, use
‘<samp>--nsm_grp</samp>’ or ‘<samp>--ensemble_group</samp>’.
Members of a group ensemble are groups that share the same structure,
parent group, and nesting level.
Members must be <em>leaf groups</em>, i.e., not contain any sub-groups.
Their contents usually have different values because they are
realizations of replicated experiments.
In group ensemble mode <code>nces</code> computes the statistics across
the ensemble, which may span multiple input files.
Files may contain members of multiple, distinct ensembles.
However, all ensembles must have at least one member in the first input
file.
Group ensembles behave as an unlimited dimension of datasets:
they may contain an arbitrary and extensible number of realizations in
each file, and may be composed from multiple files.
</p>
<p>Output statistics in group ensemble mode are stored in the parent group
by default.
If the ensemble members are <samp>/cesm/cesm_01</samp> and
<samp>/cesm/cesm_02</samp>, then the computed statistic will be in
<samp>/cesm</samp> in the output file.
The ‘<samp>--nsm_sfx</samp>’ option instructs nces to instead store output in
a new child group of the parent created by attaching the suffix
to the parent group’s name, e.g., ‘<samp>--nsm_sfx='_avg'</samp>’ would store
results in the output group <samp>/cesm/cesm_avg</samp>:
</p><div class="example">
<pre class="example">nces --nsm_grp mdl1.nc mdl2.nc mdl3.nc out.nc
nces --nsm_grp --nsm_sfx='_avg' mdl1.nc mdl2.nc mdl3.nc out.nc
</pre></div>
<p>See <a href="#Statistics-vs_002e-Concatenation">Statistics vs. Concatenation</a>, for a description of the
distinctions between the statistics tools and concatenators.
<a name="index-multi_002dfile-operators-3"></a>
<a name="index-standard-input-1"></a>
<a name="index-stdin-2"></a>
As a multi-file operator, <code>nces</code> will read the list of
<var>input-files</var> from <code>stdin</code> if they are not specified
as positional arguments on the command line
(see <a href="#Large-Numbers-of-Files">Large Numbers of Files</a>).
</p>
<p>Like <code>ncra</code> and <code>ncwa</code>, <code>nces</code> treats coordinate
variables as a special case.
Coordinate variables are assumed to be the same in all ensemble members,
so <code>nces</code> simply copies the coordinate variables that appear in
ensemble members directly to the output file.
This has the same effect as averaging the coordinate variable across the
ensemble, yet does not incur the time- or precision- penalties of
actually averaging them.
<code>ncra</code> and <code>ncwa</code> allow coordinate variables to be
processed only by the linear average operation, regardless of the
arithmetic operation type performed on the non-coordinate variables
(see <a href="#Operation-Types">Operation Types</a>).
Thus it can be said that the three operators (<code>ncra</code>,
<code>ncwa</code>, and <code>nces</code>) all average coordinate variables
(even though <code>nces</code> simply copies them).
All other requested arithmetic operations (e.g., maximization,
square-root, RMS) are applied only to non-coordinate variables.
In these cases the linear average of the coordinate variable will be
returned.
</p>
<a name="xmp_ncea"></a> <!-- http://nco.sf.net/nco.html#xmp_ncea -->
<a name="xmp_nces"></a> <!-- http://nco.sf.net/nco.html#xmp_nces --><p>EXAMPLES
</p>
<p>Consider a model experiment which generated five realizations of one
year of data, say 1985.
Imagine that the experimenter slightly perturbs the initial conditions
of the problem before generating each new solution.
Assume each file contains all twelve months (a seasonal cycle) of data
and we want to produce a single file containing the ensemble average
(mean) seasonal cycle.
Here the numeric filename suffix denotes the realization number
(<em>not</em> the month):
</p><div class="example">
<pre class="example">nces 85_01.nc 85_02.nc 85_03.nc 85_04.nc 85_05.nc 85.nc
nces 85_0[1-5].nc 85.nc
nces -n 5,2,1 85_01.nc 85.nc
</pre></div>
<p>These three commands produce identical answers.
See <a href="#Specifying-Input-Files">Specifying Input Files</a>, for an explanation of the distinctions
between these methods.
The output file, <samp>85.nc</samp>, is the same size as the inputs files.
It contains 12 months of data (which might or might not be stored in the
record dimension, depending on the input files), but each value in the
output file is the average of the five values in the input files.
</p>
<p>In the previous example, the user could have obtained the ensemble
average values in a particular spatio-temporal region by adding a
hyperslab argument to the command, e.g.,
</p><div class="example">
<pre class="example">nces -d time,0,2 -d lat,-23.5,23.5 85_??.nc 85.nc
</pre></div>
<p>In this case the output file would contain only three slices of data in
the <var>time</var> dimension.
These three slices are the average of the first three slices from the
input files.
Additionally, only data inside the tropics is included.
</p>
<p>As of <acronym>NCO</acronym> version 4.3.9 (released December, 2013)
<code>nces</code> also works with groups (rather than files) as the
fundamental unit of the ensemble.
Consider two ensembles, <code>/ecmwf</code> and <code>/cesm</code> stored across
three input files <samp>mdl1.nc</samp>, <samp>mdl2.nc</samp>, and <samp>mdl3.nc</samp>.
Ensemble members would be leaf groups with names like <code>/ecmwf/01</code>,
<code>/ecmwf/02</code> etc. and <code>/cesm/01</code>, <code>/cesm/02</code>, etc.
These commands average both ensembles:
</p><div class="example">
<pre class="example">nces --nsm_grp mdl1.nc mdl2.nc mdl3.nc out.nc
nces --nsm_grp --nsm_sfx='_min' --op_typ=min -n 3,1,1 mdl1.nc out.nc
nces --nsm_grp -g cesm -v tas -d time,0,3 -n 3,1,1 mdl1.nc out.nc
</pre></div>
<p>The first command stores averages in the output groups <samp>/cesm</samp> and
<samp>/ecmwf</samp>, while the second stores minima in the output groups
<samp>/cesm/cesm_min</samp> and <samp>/ecmwf/ecmwf_min</samp>:
The third command demonstrates that sub-setting and hyperslabbing work
as expected.
Note that each input file may contain different numbers of members
of each ensemble, as long as all distinct ensembles contain at least one
member in the first file.
</p>
<a name="ncecat"></a> <!-- http://nco.sf.net/nco.html#ncecat --><hr>
<a name="ncecat-netCDF-Ensemble-Concatenator"></a>
<div class="header">
<p>
Next: <a href="#ncflint-netCDF-File-Interpolator" accesskey="n" rel="next">ncflint netCDF File Interpolator</a>, Previous: <a href="#nces-netCDF-Ensemble-Statistics" accesskey="p" rel="previous">nces netCDF Ensemble Statistics</a>, Up: <a href="#Operator-Reference-Manual" accesskey="u" rel="up">Operator Reference Manual</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#General-Index" title="Index" rel="index">Index</a>]</p>
</div>
<a name="ncecat-netCDF-Ensemble-Concatenator-1"></a>
<h3 class="section">4.5 <code>ncecat</code> netCDF Ensemble Concatenator</h3>
<a name="index-concatenation-1"></a>
<a name="index-ensemble-concatenation"></a>
<a name="index-ncecat-1"></a>
<p>SYNTAX
</p><div class="example">
<pre class="example">ncecat [-3] [-4] [-6] [-7] [-A] [-C] [-c]
[--cnk_dmn nm,sz] [--cnk_map map] [--cnk_plc plc] [--cnk_scl sz]
[-D <var>dbg</var>] [-d <var>dim</var>,[<var>min</var>][,[<var>max</var>][,[<var>stride</var>]]] [-F]
[-G <var>gpe_dsc</var>] [-g <var>grp</var>[,…]] [--gag] [-h] [--hdf] [--hdr_pad <var>nbr</var>]
[-L <var>dfl_lvl</var>] [-l <var>path</var>] [-M] [--md5_digest] [--mrd] [-n <var>loop</var>] [--no_tmp_fl]
[-O] [-o <var>output-file</var>] [-p <var>path</var>] [-R] [-r] [--ram_all]
[-t <var>thr_nbr</var>] [-u <var>ulm_nm</var>] [--unn] [-v <var>var</var>[,…]] [-X ...] [-x]
[<var>input-files</var>] [<var>output-file</var>]
</pre></div>
<p>DESCRIPTION
</p>
<p><code>ncecat</code> aggregates an arbitrary number of input files into a
single output file using using one of two methods.
<em>Record AGgregation</em> (<acronym>RAG</acronym>), the traditional method employed on
netCDF3 files and still the default method, stores <var>input-files</var> as
consecutive records in the <var>output-file</var>.
<em>Group AGgregation</em> (<acronym>GAG</acronym>) stores <var>input-files</var> as top-level
groups in the netCDF4 <var>output-file</var>.
Record Aggregation (<acronym>RAG</acronym>) makes numerous assumptions about the structure
of input files and Group Aggregation (<acronym>GAG</acronym>) makes none.
Both methods are described in detail below.
Since <code>ncecat</code> aggregates all the contents of the input files,
it can easily produce large output files so it is often helpful to invoke
subsetting simultaneously (see <a href="#Subsetting-Files">Subsetting Files</a>).
</p>
<a name="rag"></a> <!-- http://nco.sf.net/nco.html#rag --><a name="index-record-aggregation"></a>
<a name="index-RAG"></a>
<p><acronym>RAG</acronym> makes each variable (except coordinate variables) in each
input file into a single record of the same variable in the output file.
Coordinate variables are not concatenated, they are instead simply
copied from the first input file to the <var>output-file</var>.
All <var>input-files</var> must contain all extracted variables (or else
there would be "gaps" in the output file).
</p>
<p>A new record dimension is the glue which binds together the input file
data.
The new record dimension is defined in the root group of the output file
so it is visible to all sub-groups.
Its name is, by default, “record”.
<a name="index-unlimited-dimension"></a>
<a name="index-record-dimension-4"></a>
<a name="index-_002du-ulm_005fnm"></a>
<a name="index-_002d_002dulm_005fnm-ulm_005fnm"></a>
<a name="index-_002d_002drcd_005fnm-ulm_005fnm"></a>
This default name can be overridden with the ‘<samp>-u <var>ulm_nm</var></samp>’
short option (or the ‘<samp>--ulm_nm</samp>’ or ‘<samp>rcd_nm</samp>’ long options).
</p>
<p>Each extracted variable must be constant in size and rank across all
<var>input-files</var>.
<a name="index-record-dimension-5"></a>
<a name="index-hyperslab-3"></a>
The only exception is that <code>ncecat</code> allows files to differ in
the record dimension size if the requested record hyperslab
(see <a href="#Hyperslabs">Hyperslabs</a>) resolves to the same size for all files.
<a name="index-CMIP-1"></a>
This allows easier gluing/averaging of unequal length timeseries from
simulation ensembles (e.g., the <acronym>CMIP</acronym> rchive).
</p>
<a name="index-fixed-dimension"></a>
<a name="index-fix-record-dimension"></a>
<p>Classic (i.e., all netCDF3 and <code>NETCDF4_CLASSIC</code>) output files
can contain only one record dimension.
<code>ncecat</code> makes room for the new glue record dimension by
changing the pre-existing record dimension, if any, in the input files
into a fixed dimension in the output file.
netCDF4 output files may contain any number of record dimensions, so
<code>ncecat</code> need not and does not alter the record dimensions,
if any, of the input files as it copies them to the output file.
</p>
<a name="gag"></a> <!-- http://nco.sf.net/nco.html#gag --><a name="index-group-aggregation"></a>
<a name="index-GAG"></a>
<p><em>Group AGgregation</em> (<acronym>GAG</acronym>) stores <var>input-files</var> as
top-level groups in the <var>output-file</var>.
No assumption is made about the size or shape or type of a given
object (variable or dimension or group) in the input file.
The entire contents of the extracted portion of each input file
is placed in its own top-level group in <var>output-file</var>, which
is automatically made as a netCDF4-format file.
</p>
<a name="index-_002d_002dgag"></a>
<p><acronym>GAG</acronym> has two methods to specify group names for the
<var>output-file</var>.
The ‘<samp>-G</samp>’ option, or its long-option equivalent ‘<samp>--gpe</samp>’,
takes as argument a group path editing description <var>gpe_dsc</var> of
where to place the results.
Each input file needs a distinct output group name to avoid namespace
conflicts in the <var>output-file</var>.
Hence <code>ncecat</code> automatically creates unique output group names
based on either the input filenames or the <var>gpe_dsc</var> arguments.
When the user provides <var>gpe_dsc</var> (i.e., with ‘<samp>-G</samp>’), then the
output groups are formed by enumerating sequential two-digit numeric
suffixes starting with zero, and appending them to the specified group
path (see <a href="#Group-Path-Editing">Group Path Editing</a>).
When <var>gpe_dsc</var> is not provided (i.e., user requests <acronym>GAG</acronym> with
‘<samp>--gag</samp>’ instead of ‘<samp>-G</samp>’), then <code>ncecat</code> forms the
output groups by stripping the input file name of any type-suffix
(e.g., <code>.nc</code>), and all but the final component of the full
filename.
</p><div class="example">
<pre class="example">ncecat --gag 85.nc 86.nc 87.nc 8587.nc # Output groups 85, 86, 87
ncecat -G 85_ a.nc b.nc c.nc 8589.nc # Output groups 85_00, 85_01, 85_02
ncecat -G 85/ a.nc b.nc c.nc 8589.nc # Output groups 85/00, 85/01, 85/02
</pre></div>
<p>With both <acronym>RAG</acronym> and <acronym>GAG</acronym> the <var>output-file</var> size is
the sum of the sizes of the extracted variables in the input files.
See <a href="#Statistics-vs_002e-Concatenation">Statistics vs. Concatenation</a>, for a description of the
distinctions between the various statistics tools and concatenators.
<a name="index-multi_002dfile-operators-4"></a>
<a name="index-standard-input-2"></a>
<a name="index-stdin-3"></a>
As a multi-file operator, <code>ncecat</code> will read the list of
<var>input-files</var> from <code>stdin</code> if they are not specified
as positional arguments on the command line
(see <a href="#Large-Numbers-of-Files">Large Numbers of Files</a>).
</p>
<a name="index-_002dM-1"></a>
<a name="index-_002d_002dglb_005fmtd_005fspp"></a>
<a name="index-metadata_002c-global"></a>
<p>Suppress global metadata copying.
By default <acronym>NCO</acronym>’s multi-file operators copy the global metadata
from the first input file into <var>output-file</var>.
This helps to preserve the provenance of the output data.
However, the use of metadata is burgeoning and is not uncommon to
encounter files with excessive amounts of extraneous metadata.
Extracting small bits of data from such files leads to output files
which are much larger than necessary due to the automatically copied
metadata.
<code>ncecat</code> supports turning off the default copying of global
metadata via the ‘<samp>-M</samp>’ switch (or its long option equivalents,
‘<samp>--glb_mtd_spp</samp>’ and ‘<samp>--global_metadata_suppress</samp>’).
</p>
<a name="index-climate-model-4"></a>
<p>Consider five realizations, <samp>85a.nc</samp>, <samp>85b.nc</samp>,
… <samp>85e.nc</samp><!-- /@w --> of 1985 predictions from the same climate
model.
Then <code>ncecat 85?.nc 85_ens.nc</code> glues together the individual
realizations into the single file, <samp>85_ens.nc</samp>.
If an input variable was dimensioned [<code>lat</code>,<code>lon</code>], it will
by default have dimensions [<code>record</code>,<code>lat</code>,<code>lon</code>] in
the output file.
A restriction<!-- /@w --> of <code>ncecat</code> is that the hyperslabs of the
processed variables must be the same from file to file.
Normally this means all the input files are the same size, and contain
data on different realizations of the same variables.
</p>
<a name="index-ncpdq-3"></a>
<a name="index-packing-3"></a>
<a name="index-unpacking-2"></a>
<a name="index-add_005foffset-2"></a>
<a name="index-scale_005ffactor-1"></a>
<p>Concatenating a variable packed with different scales across multiple
datasets is beyond the capabilities of <code>ncecat</code> (and
<code>ncrcat</code>, the other concatenator (<a href="#Concatenation">Concatenation</a>).
<code>ncecat</code> does not unpack data, it simply <em>copies</em> the data
from the <var>input-files</var>, and the metadata from the <em>first</em>
<var>input-file</var>, to the <var>output-file</var>.
This means that data compressed with a packing convention must use
the identical packing parameters (e.g., <code>scale_factor</code> and
<code>add_offset</code>) for a given variable across <em>all</em> input files.
Otherwise the concatenated dataset will not unpack correctly.
The workaround for cases where the packing parameters differ across
<var>input-files</var> requires three steps:
First, unpack the data using <code>ncpdq</code>.
Second, concatenate the unpacked data using <code>ncecat</code>,
Third, re-pack the result with <code>ncpdq</code>.
</p>
<a name="xmp_ncecat"></a> <!-- http://nco.sf.net/nco.html#xmp_ncecat --><p>EXAMPLES
</p>
<p>Consider a model experiment which generated five realizations of one
year of data, say 1985.
You can imagine that the experimenter slightly perturbs the
initial conditions of the problem before generating each new solution.
Assume each file contains all twelve months (a seasonal cycle) of data
and we want to produce a single file containing all the seasonal
cycles.
Here the numeric filename suffix denotes the experiment number
(<em>not</em> the month):
</p><div class="example">
<pre class="example">ncecat 85_01.nc 85_02.nc 85_03.nc 85_04.nc 85_05.nc 85.nc
ncecat 85_0[1-5].nc 85.nc
ncecat -n 5,2,1 85_01.nc 85.nc
</pre></div>
<p>These three commands produce identical answers.
See <a href="#Specifying-Input-Files">Specifying Input Files</a>, for an explanation of the distinctions
between these methods.
The output file, <samp>85.nc</samp>, is five times the size as a single
<var>input-file</var>.
It contains 60 months<!-- /@w --> of data.
</p>
<a name="ncecat_rnm"></a> <!-- http://nco.sf.net/nco.html#ncecat_rnm --><p>One often prefers that the (new) record dimension have a more
descriptive, context-based name than simply “record”.
This is easily accomplished with the ‘<samp>-u <var>ulm_nm</var></samp>’ switch:
</p><div class="example">
<pre class="example">ncecat -u realization 85_0[1-5].nc 85.nc
</pre></div>
<p>Users are more likely to understand the data processing history when
such descriptive coordinates are used.
</p>
<a name="dmn_rcd_rm"></a> <!-- http://nco.sf.net/nco.html#dmn_rcd_rm --><a name="index-record-dimension-6"></a>
<a name="index-fixed-dimension-1"></a>
<a name="index-fix-record-dimension-1"></a>
<a name="index-_002d_002dmk_005frec_005fdmn-dim"></a>
<p>Consider a file with an existing record dimension named <code>time</code>.
and suppose the user wishes to convert <code>time</code> from a record
dimension to a non-record dimension.
This may be useful, for example, when the user has another use for the
record variable.
The simplest method is to use ‘<samp>ncks --fix_rec_dmn</samp>’ but another
possibility is to use <code>ncecat</code> followed by
<code>ncwa</code>:
<a name="index-degenerate-dimension-4"></a>
</p><div class="example">
<pre class="example">ncecat in.nc out.nc # Convert time to non-record dimension
ncwa -a record in.nc out.nc # Remove new degenerate record dimension
</pre></div>
<p>The second step removes the degenerate record dimension.
See <a href="#ncpdq-netCDF-Permute-Dimensions-Quickly">ncpdq netCDF Permute Dimensions Quickly</a> and
<a href="#ncks-netCDF-Kitchen-Sink">ncks netCDF Kitchen Sink</a> for other methods of
of changing variable dimensionality, including the record dimension.
</p>
<a name="ncflint"></a> <!-- http://nco.sf.net/nco.html#ncflint --><hr>
<a name="ncflint-netCDF-File-Interpolator"></a>
<div class="header">
<p>
Next: <a href="#ncks-netCDF-Kitchen-Sink" accesskey="n" rel="next">ncks netCDF Kitchen Sink</a>, Previous: <a href="#ncecat-netCDF-Ensemble-Concatenator" accesskey="p" rel="previous">ncecat netCDF Ensemble Concatenator</a>, Up: <a href="#Operator-Reference-Manual" accesskey="u" rel="up">Operator Reference Manual</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#General-Index" title="Index" rel="index">Index</a>]</p>
</div>
<a name="ncflint-netCDF-File-Interpolator-1"></a>
<h3 class="section">4.6 <code>ncflint</code> netCDF File Interpolator</h3>
<a name="index-interpolation"></a>
<a name="index-adding-data-1"></a>
<a name="index-multiplying-data-1"></a>
<a name="index-addition-2"></a>
<a name="index-ncflint-2"></a>
<p>SYNTAX
</p><div class="example">
<pre class="example">ncflint [-3] [-4] [-6] [-7] [-A] [-C] [-c]
[--cnk_dmn nm,sz] [--cnk_map map] [--cnk_plc plc] [--cnk_scl sz]
[-D <var>dbg</var>] [-d <var>dim</var>,[<var>min</var>][,[<var>max</var>][,[<var>stride</var>]]]
[-F] [--fix_rec_crd] [-G <var>gpe_dsc</var>] [-g <var>grp</var>[,…]] [-h] [--hdr_pad <var>nbr</var>]
[-i <var>var</var>,<var>val3</var>] [-L <var>dfl_lvl</var>] [-l <var>path</var>] [--no_tmp_fl]
[-O] [-o <var>file_3</var>] [-p <var>path</var>] [-R] [-r] [--ram_all]
[-t <var>thr_nbr</var>] [--unn] [-v <var>var</var>[,…]] [-w <var>wgt1</var>[,<var>wgt2</var>]] [-X ...] [-x]
<var>file_1</var> <var>file_2</var> [<var>file_3</var>]
</pre></div>
<p>DESCRIPTION
</p>
<p><code>ncflint</code> creates an output file that is a linear combination of
the input files.
This linear combination is a weighted average, a normalized weighted
average, or an interpolation of the input files.
Coordinate variables are not acted upon in any case, they are simply
copied from <var>file_1</var>.
</p>
<p>There are two conceptually distinct methods of using <code>ncflint</code>.
The first method is to specify the weight each input file contributes to
the output file.
In this method, the value <var>val3</var> of a variable in the output file
<var>file_3</var> is determined from its values <var>val1</var> and <var>val2</var> in
the two input files according to
<em><var>val3</var> = <var>wgt1</var>*<var>val1</var> + <var>wgt2</var>*<var>val2</var></em>
.
Here at least <var>wgt1</var>, and, optionally, <var>wgt2</var>, are specified on
the command line with the ‘<samp>-w</samp>’ (or ‘<samp>--weight</samp>’ or
‘<samp>--wgt_var</samp>’) switch.
<a name="index-_002dw-wgt1_005b_002cwgt2_005d"></a>
<a name="index-_002d_002dweight-wgt1_005b_002cwgt2_005d"></a>
<a name="index-_002d_002dwgt_005fvar-wgt1_005b_002cwgt2_005d"></a>
If only <var>wgt1</var> is specified then <var>wgt2</var> is automatically
computed as <em><var>wgt2</var> = 1 - <var>wgt1</var></em>.
Note that weights larger than 1<!-- /@w --> are allowed.
Thus it is possible to specify <em><var>wgt1</var> = 2</em> and
<em><var>wgt2</var> = -3</em>.
One can use this functionality to multiply all the values in a given
file by a constant.
</p>
<p>The second method of using <code>ncflint</code> is to specify the
interpolation option with ‘<samp><span class="nolinebreak">-i</span></samp>’<!-- /@w --> (or with the ‘<samp>--ntp</samp>’ or
‘<samp>--interpolate</samp>’ long options).
This is the inverse of the first method in the following sense:
When the user specifies the weights directly, <code>ncflint</code> has no
work to do besides multiplying the input values by their respective
weights and adding together the results to produce the output values.
It makes sense to use this when the weights are known
<em>a priori<!-- /@w --></em>.
</p>
<a name="index-arrival-value"></a>
<p>Another class of problems has the <em>arrival value</em> (i.e., <var>val3</var>)
of a particular variable <var>var</var> known <em>a priori<!-- /@w --></em>.
In this case, the implied weights can always be inferred by examining
the values of <var>var</var> in the input files.
This results in one equation in two unknowns, <var>wgt1</var> and <var>wgt2</var>:
<em><var>val3</var> = <var>wgt1</var>*<var>val1</var> + <var>wgt2</var>*<var>val2</var></em>
.
Unique determination of the weights requires imposing the additional
constraint of normalization on the weights:
<em><var>wgt1</var> + <var>wgt2</var> = 1</em>.
Thus, to use the interpolation option, the user specifies <var>var</var>
and <var>val3</var> with the ‘<samp>-i</samp>’ option.
<code>ncflint</code> then computes <var>wgt1</var> and <var>wgt2</var>, and uses these
weights on all variables to generate the output file.
Although <var>var</var> may have any number of dimensions in the input
files, it must represent a single, scalar value.
<a name="index-degenerate-dimension-5"></a>
Thus any dimensions associated with <var>var</var> must be <em>degenerate</em>,
i.e., of size one.
</p>
<p>If neither ‘<samp>-i</samp>’ nor ‘<samp>-w</samp>’ is specified on the command line,
<code>ncflint</code> defaults to weighting each input file equally in the
output file.
This is equivalent to specifying ‘<samp>-w 0.5</samp>’ or ‘<samp>-w 0.5,0.5</samp>’.
Attempting to specify both ‘<samp>-i</samp>’ and ‘<samp>-w</samp>’ methods in the same
command is an error.
</p>
<p><code>ncflint</code> does not interpolate variables of type <code>NC_CHAR</code>
and <code>NC_STRING</code>.
This behavior is hardcoded.
</p>
<p>By default <code>ncflint</code> interpolates or multiplies record
coordinate variables (e.g., time is often stored as a record coordinate)
not other coordinate variables (e.g., latitude and longitude).
This is because <code>ncflint</code> is often used to time-interpolate
between existing files, but is rarely used to spatially interpolate.
Sometimes however, users wish to multiply entire files by a constant
that does not multiply any coordinate variables.
The ‘<samp>--fix_rec_crd</samp>’ switch was implemented for this purpose
in <acronym>NCO</acronym> version 4.2.6 (March, 2013).
It prevents <code>ncflint</code> from multiplying or interpolating any
coordinate variables, including record coordinate variables.
</p>
<a name="index-missing-values-2"></a>
<a name="index-_005fFillValue-3"></a>
<p>Depending on your intuition, <code>ncflint</code> may treat missing values
unexpectedly.
Consider a point where the value in one input file, say <var>val1</var>,
equals the missing value <var>mss_val_1</var> and, at the same point,
the corresponding value in the other input file <var>val2</var> is not
misssing (i.e., does not equal <var>mss_val_2</var>).
There are three plausible answers, and this creates ambiguity.
</p>
<p>Option one<!-- /@w --> is to set <em><var>val3</var> = <var>mss_val_1</var></em>.
The rationale is that <code>ncflint</code> is, at heart, an interpolator
and interpolation involving a missing value is intrinsically undefined.
<code>ncflint</code> currently implements this behavior since it is the
most conservative and least likely to lead to misinterpretation.
</p>
<p>Option two<!-- /@w --> is to output the weighted valid data point, i.e.,
<em><var>val3</var> = <var>wgt2</var>*<var>val2</var></em>
.
The rationale for this behavior is that interpolation is really a
weighted average of known points, so <code>ncflint</code> should weight the
valid point.
</p>
<p>Option three<!-- /@w --> is to return the <em>unweighted</em> valid point, i.e.,
<em><var>val3</var> = <var>val2</var></em>.
This behavior would appeal to those who use <code>ncflint</code> to
estimate data using the closest available data.
When a point is not bracketed by valid data on both sides, it is better
to return the known datum than no datum at all.
</p>
<p>The current implementation uses the first approach, Option one<!-- /@w -->.
If you have strong opinions on this matter, let us know, since we are
willing to implement the other approaches as options if there is enough
interest.
</p>
<a name="xmp_ncflint"></a> <!-- http://nco.sf.net/nco.html#xmp_ncflint --><p>EXAMPLES
</p>
<p>Although it has other uses, the interpolation feature was designed
to interpolate <var>file_3</var> to a time between existing files.
Consider input files <samp>85.nc</samp> and <samp>87.nc</samp> containing variables
describing the state of a physical system at times <em><code>time</code> =
85</em> and <em><code>time</code> = 87</em>.
Assume each file contains its timestamp in the scalar variable
<code>time</code>.
Then, to linearly interpolate to a file <samp>86.nc</samp> which describes
the state of the system at time at <code>time</code> = 86, we would use
</p><div class="example">
<pre class="example">ncflint -i time,86 85.nc 87.nc 86.nc
</pre></div>
<p>Say you have observational data covering January and April 1985 in two
files named <samp>85_01.nc</samp> and <samp>85_04.nc</samp>, respectively.
Then you can estimate the values for February and March by interpolating
the existing data as follows.
Combine <samp>85_01.nc</samp> and <samp>85_04.nc</samp> in a 2:1 ratio to make
<samp>85_02.nc</samp>:
</p><div class="example">
<pre class="example">ncflint -w 0.667 85_01.nc 85_04.nc 85_02.nc
ncflint -w 0.667,0.333 85_01.nc 85_04.nc 85_02.nc
</pre></div>
<p>Multiply <samp>85.nc</samp> by 3<!-- /@w --> and by -2<!-- /@w --> and add them
together to make <samp>tst.nc</samp>:
</p><div class="example">
<pre class="example">ncflint -w 3,-2 85.nc 85.nc tst.nc
</pre></div>
<a name="index-null-operation"></a>
<p>This is an example of a null operation, so <samp>tst.nc</samp> should be
identical (within machine precision) to <samp>85.nc</samp>.
</p>
<a name="index-multiplication-2"></a>
<a name="index-file-multiplication"></a>
<a name="index-scaling-1"></a>
<p>Multiply all the variables except the coordinate variables in the file
<samp>emissions.nc</samp> by by 0.8<!-- /@w -->:
</p><div class="example">
<pre class="example">ncflint --fix_rec_crd -w 0.8,0.0 emissions.nc emissions.nc scaled_emissions.nc
</pre></div>
<p>The use of ‘<samp>--fix_rec_crd</samp>’ ensures, e.g., that the <code>time</code>
coordinate, if any, is not scaled (i.e., multiplied).
</p>
<p>Add <samp>85.nc</samp> to <samp>86.nc</samp> to obtain <samp>85p86.nc</samp>,
then subtract <samp>86.nc</samp> from <samp>85.nc</samp> to obtain <samp>85m86.nc</samp>
</p><div class="example">
<pre class="example">ncflint -w 1,1 85.nc 86.nc 85p86.nc
ncflint -w 1,-1 85.nc 86.nc 85m86.nc
ncdiff 85.nc 86.nc 85m86.nc
</pre></div>
<p>Thus <code>ncflint</code> can be used to mimic some <code>ncbo</code>
operations.
<a name="index-broadcasting-variables-3"></a>
However this is not a good idea in practice because <code>ncflint</code>
does not broadcast (see <a href="#ncbo-netCDF-Binary-Operator">ncbo netCDF Binary Operator</a>) conforming
variables during arithmetic.
Thus the final two commands would produce identical results except that
<code>ncflint</code> would fail if any variables needed to be broadcast.
</p>
<a name="index-units-5"></a>
<p>Rescale the dimensional units of the surface pressure <code>prs_sfc</code>
from Pascals to hectopascals (millibars)
</p><div class="example">
<pre class="example">ncflint -C -v prs_sfc -w 0.01,0.0 in.nc in.nc out.nc
ncatted -a units,prs_sfc,o,c,millibar out.nc
</pre></div>
<a name="ncks"></a> <!-- http://nco.sf.net/nco.html#ncks --><hr>
<a name="ncks-netCDF-Kitchen-Sink"></a>
<div class="header">
<p>
Next: <a href="#ncpdq-netCDF-Permute-Dimensions-Quickly" accesskey="n" rel="next">ncpdq netCDF Permute Dimensions Quickly</a>, Previous: <a href="#ncflint-netCDF-File-Interpolator" accesskey="p" rel="previous">ncflint netCDF File Interpolator</a>, Up: <a href="#Operator-Reference-Manual" accesskey="u" rel="up">Operator Reference Manual</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#General-Index" title="Index" rel="index">Index</a>]</p>
</div>
<a name="ncks-netCDF-Kitchen-Sink-1"></a>
<h3 class="section">4.7 <code>ncks</code> netCDF Kitchen Sink</h3>
<a name="index-kitchen-sink"></a>
<a name="index-printing-files-contents"></a>
<a name="index-printing-variables"></a>
<a name="index-ncks-3"></a>
<p>SYNTAX
</p><div class="example">
<pre class="example">ncks [-3] [-4] [-5] [-6] [-7] [-A] [-a] [-b <var>binary-file</var>] [-C] [-c] [--cdl]
[--cnk_dmn nm,sz] [--cnk_map map] [--cnk_plc plc] [--cnk_scl sz]
[-D <var>dbg</var>] [-d <var>dim</var>,[<var>min</var>][,[<var>max</var>][,[<var>stride</var>]]] [-F] [--fix_rec_dmn <var>dim</var>]
[-G <var>gpe_dsc</var>] [-g <var>grp</var>[,…]] [-H] [-h] [--hdn] [--hdr_pad <var>nbr</var>]
[-L <var>dfl_lvl</var>] [-l <var>path</var>] [-M] [-m] [--mk_rec_dmn <var>dim</var>] [--md5_digest]
[--no_blank] [--no_tmp_fl] [-O] [-o <var>output-file</var>] [-P] [-p <var>path</var>]
[-Q] [-q] [-R] [-r] [--ram_all] [-s <var>format</var>]
[-u] [--unn] [-v <var>var</var>[,…]] [-X ...] [-x] [--xml]
<var>input-file</var> [[<var>output-file</var>]]
</pre></div>
<p>DESCRIPTION
</p>
<a name="index-ncextr"></a>
<p>The nickname “kitchen sink” is a catch-all because <code>ncks</code>
combines most features of <code>ncdump</code> and <code>nccopy</code> with
extra features to extract, hyperslab, multi-slab, sub-set, and translate
into one versatile utility.
<code>ncks</code> extracts (a subset of the) data from <var>input-file</var> and
and writes (or pastes) it in netCDF format to <var>output-file</var>, and
optionally writes it in flat binary format to <samp>binary-file</samp>, and
optionally prints it to screen.
</p>
<p><code>ncks</code> prints netCDF input data in <acronym>ASCII</acronym>,
<acronym>CDL</acronym>, or <acronym>NcML</acronym> text formats <code>stdout</code>, like (an
extended version of) <code>ncdump</code>.
By default <code>ncks</code> prints data in a tabular format intended to be
easy to search for the data you want, one datum per screen line, with
all dimension subscripts and coordinate values (if any) preceding the
datum.
Option ‘<samp>-s</samp>’ (or long options ‘<samp>--sng_fmt</samp>’ and ‘<samp>--string</samp>’)
permits the user to format data using C-style format strings, while
option ‘<samp>--cdl</samp>’ outputs <acronym>CDL</acronym> and option ‘<samp>--xml</samp>’
outputs <acronym>NcML</acronym>.
<code>ncks</code> exposes many flexible controls over printed output,
including <acronym>CDL</acronym> and <acronym>NcML</acronym>.
</p>
<p>Options ‘<samp>-5</samp>’, ‘<samp>-a</samp>’, ‘<samp>--cdl</samp>’, ‘<samp>-F</samp>’ , ‘<samp>-H</samp>’,
‘<samp>--hdn</samp>’, ‘<samp>-M</samp>’, ‘<samp>-m</samp>’, ‘<samp>-P</samp>’, ‘<samp>-Q</samp>’, ‘<samp>-q</samp>’,
‘<samp>-s</samp>’, ‘<samp>-u</samp>’, ‘<samp>--xml</samp>’ (and their long option counterparts)
control the formatted appearance of the data.
</p>
<a name="index-global-attributes-6"></a>
<a name="index-attributes_002c-global-6"></a>
<p><code>ncks</code> extracts (and optionally creates a new netCDF file
comprised of) only selected variables from the input file
(similar to the old <code>ncextr</code> specification).
Only variables and coordinates may be specifically included or
excluded—all global attributes and any attribute associated with an
extracted variable are copied to the screen and/or output netCDF file.
Options ‘<samp>-c</samp>’, ‘<samp>-C</samp>’, ‘<samp>-v</samp>’, and ‘<samp>-x</samp>’ (and their long
option synonyms) control which variables are extracted.
</p>
<p><code>ncks</code> extracts hyperslabs from the specified variables
(<code>ncks</code> implements the original <code>nccut</code> specification).
Option ‘<samp>-d</samp>’ controls the hyperslab specification.
Input dimensions that are not associated with any output variable do
not appear in the output netCDF.
This feature removes superfluous dimensions from netCDF files.
</p>
<a name="index-appending-data-1"></a>
<a name="index-merging-files-1"></a>
<p><code>ncks</code> will append variables and attributes from the
<var>input-file</var> to <var>output-file</var> if <var>output-file</var> is a
pre-existing netCDF file whose relevant dimensions conform to dimension
sizes of <var>input-file</var>.
The append features of <code>ncks</code> are intended to provide a
rudimentary means of adding data from one netCDF file to another,
conforming, netCDF file.
If naming conflicts exist between the two files, data in
<var>output-file</var> is usually overwritten by the corresponding data from
<var>input-file</var>.
Thus, when appending, the user should backup <var>output-file</var> in case
valuable data are inadvertantly overwritten.
</p>
<p>If <var>output-file</var> exists, the user will be queried whether to
<em>overwrite</em>, <em>append</em>, or <em>exit</em> the <code>ncks</code> call
completely.
Choosing <em>overwrite</em> destroys the existing <var>output-file</var> and
create an entirely new one from the output of the <code>ncks</code> call.
Append has differing effects depending on the uniqueness of the
variables and attributes output by <code>ncks</code>: If a variable or
attribute extracted from <var>input-file</var> does not have a name conflict
with the members of <var>output-file</var> then it will be added to
<var>output-file</var> without overwriting any of the existing contents of
<var>output-file</var>.
In this case the relevant dimensions must agree (conform) between the
two files; new dimensions are created in <var>output-file</var> as required.
<a name="index-global-attributes-7"></a>
<a name="index-attributes_002c-global-7"></a>
When a name conflict occurs, a global attribute from <var>input-file</var>
will overwrite the corresponding global attribute from
<var>output-file</var>.
If the name conflict occurs for a non-record variable, then the
dimensions and type of the variable (and of its coordinate dimensions,
if any) must agree (conform) in both files.
Then the variable values (and any coordinate dimension values)
from <var>input-file</var> will overwrite the corresponding variable values
(and coordinate dimension values, if any) in <var>output-file</var>
<a name="DOCF58" href="#FOOT58"><sup>58</sup></a>.
</p>
<p>Since there can only be one record dimension in a file, the record
dimension must have the same name (though not necessarily the same size) in
both files if a record dimension variable is to be appended.
If the record dimensions are of differing sizes, the record dimension of
<var>output-file</var> will become the greater of the two record dimension
sizes, the record variable from <var>input-file</var> will overwrite any
counterpart in <var>output-file</var> and fill values will be written to any
gaps left in the rest of the record variables (I think).
In all cases variable attributes in <var>output-file</var> are superseded by
attributes of the same name from <var>input-file</var>, and left alone if
there is no name conflict.
</p>
<p>Some users may wish to avoid interactive <code>ncks</code> queries about
whether to overwrite existing data.
For example, batch scripts will fail if <code>ncks</code> does not receive
responses to its queries.
Options ‘<samp>-O</samp>’ and ‘<samp>-A</samp>’ are available to force overwriting
existing files and variables, respectively.
</p>
<a name="Options-specific-to-ncks"></a>
<h4 class="unnumberedsubsec">Options specific to <code>ncks</code></h4>
<p>The following list provides a short summary of the features unique to
<code>ncks</code>.
Features common to many operators are described in
<a href="#Common-features">Common features</a>.
</p>
<dl compact="compact">
<dd>
<a name="-5"></a> <!-- http://nco.sf.net/nco.html#-5 --><a name="index-_002d5"></a>
</dd>
<dt>‘<samp>-5</samp>’</dt>
<dd><p>Print data to screen alphabetically by group, and alphabetically by
variable within each group.
This ordering here is used by default in <acronym>CDL</acronym>-mode printing,
and may be selected for traditional mode printing with ‘<samp>-5</samp>’
(The switch for invocation may change to something more descriptive in
the future).
</p>
<a name="index-alphabetization"></a>
<a name="index-sort-alphabetically"></a>
<a name="index-_002da"></a>
<a name="index-_002d_002dabc"></a>
<a name="index-_002d_002dalphabetize"></a>
</dd>
<dt>‘<samp>-a</samp>’</dt>
<dd><p>Do not alphabetize extracted fields.
By default, the specified output variables are extracted, printed, and
written to disk in alphabetical order.
This tends to make long output lists easier to search for particular
variables.
Specifying <code>-a</code> results in the variables being extracted, printed,
and written to disk in the order in which they were saved in the input
file.
Thus <code>-a</code> retains the original ordering of the variables.
Also ‘<samp>--abc</samp>’ and ‘<samp>--alphabetize</samp>’.
</p>
<a name="index-binary-format"></a>
<a name="index-_002db-2"></a>
<a name="index-_002d_002dfl_005fbnr"></a>
<a name="index-_002d_002dbnr"></a>
<a name="index-_002d_002dbinary"></a>
</dd>
<dt>‘<samp>-b <samp>file</samp></samp>’</dt>
<dd><p>Activate native machine binary output writing to binary file
<samp>file</samp>.
Also ‘<samp>--fl_bnr</samp>’ and ‘<samp>--binary-file</samp>’.
Writing packed variables in binary format is not supported.
</p>
<a name="dmn_fix_mk"></a> <!-- http://nco.sf.net/nco.html#dmn_fix_mk -->
<a name="fix_rec_dmn"></a> <!-- http://nco.sf.net/nco.html#fix_rec_dmn --><a name="index-record-dimension-7"></a>
<a name="index-fixed-dimension-2"></a>
<a name="index-_002d_002dfix_005frec_005fdmn-dim"></a>
<a name="index-_002d_002dno_005frec_005fdmn-dim"></a>
</dd>
<dt>‘<samp>--fix_rec_dmn</samp>’</dt>
<dd><p>Change record dimension <var>dim</var> in the input file into a fixed
dimension in the output file.
Also ‘<samp>--no_rec_dmn</samp>’.
Before <acronym>NCO</acronym> version 4.2.5 (January, 2013), the syntax for
<code>--fix_rec_dmn</code> did not permit or require the specification of
the dimension name <var>dim</var>.
This is because the feature only worked on netCDF3 files, which support
only one record dimension, so specifying its name was not necessary.
netCDF4 files allow an arbitrary number of record dimensions, so the
user must specify which record dimension to fix.
The decision was made that starting with <acronym>NCO</acronym> version 4.2.5
(January, 2013), it is always required to specify the dimension name to
fix regardless of the netCDF file type.
This keeps the code simple, and is symmetric with the syntax for
<code>--mk_rec_dmn</code>, described next.
</p>
<p>As of <acronym>NCO</acronym> version 4.4.0 (January, 2014), the argument
<code>all</code> may be given to ‘<samp>--fix_rec_dmn</samp>’ to convert <em>all</em>
record dimensions to fixed dimensions in the output file.
Previously, ‘<samp>--fix_rec_dmn</samp>’ only allowed one option, the name of a
single record dimension to be fixed.
Now it is simple to simultaneously fix all record dimensions.
This is useful (and nearly mandatory) when flattening netCDF4 files that
have multiple record dimensions per group into netCDF3 files (which are
limited to at most one record dimension) (see <a href="#Group-Path-Editing">Group Path Editing</a>).
</p>
<a name="hdn"></a> <!-- http://nco.sf.net/nco.html#hdn -->
<a name="hidden"></a> <!-- http://nco.sf.net/nco.html#hidden --><a name="index-hidden-attributes"></a>
<a name="index-special-attributes"></a>
<a name="index-_002d_002dhdn"></a>
<a name="index-_002d_002dhidden"></a>
<a name="index-_005fFormat"></a>
<a name="index-_005fDeflateLevel"></a>
<a name="index-_005fShuffle"></a>
<a name="index-_005fStorage"></a>
<a name="index-_005fChunkSizes"></a>
<a name="index-_005fEndianness"></a>
<a name="index-_005fFletcher32"></a>
<a name="index-_005fNOFILL"></a>
<p>As of <acronym>NCO</acronym> version 4.4.0 (January, 2014), the ‘<samp>--hdn</samp>’
or ‘<samp>--hidden</samp>’ options print hidden (aka special) attributes.
This is equivalent to ‘<samp>ncdump -s</samp>’.
Hidden attributes include: <code>_Format</code>, <code>_DeflateLevel</code>,
<code>_Shuffle</code>, <code>_Storage</code>, <code>_ChunkSizes</code>,
<code>_Endianness</code>, <code>_Fletcher32</code>, and <code>_NOFILL</code>.
Previously <code>ncks</code> ignored all these attributes in
<acronym>CDL</acronym>/<acronym>XML</acronym> modes.
Now it prints these attributes as appropriate.
Users are referred to the
<a href="http://www.unidata.ucar.edu/software/netcdf/docs">Unidata netCDF Documentation</a>,
or the man pages for <code>ncgen</code> or <code>ncdump</code>, for
detailed descriptions of the meanings of these attributes.
</p>
<a name="cdl"></a> <!-- http://nco.sf.net/nco.html#cdl -->
<a name="hdp"></a> <!-- http://nco.sf.net/nco.html#hdp -->
<a name="hncgen"></a> <!-- http://nco.sf.net/nco.html#hncgen -->
<a name="ncgen-hdf"></a> <!-- http://nco.sf.net/nco.html#ncgen-hdf --><a name="index-hdp"></a>
<a name="index-ncgen"></a>
<a name="index-ncgen_002dhdf"></a>
<a name="index-hncgen"></a>
<a name="index-ncdump-1"></a>
<a name="index-_002d_002dcdl"></a>
<a name="index-CDL"></a>
<a name="index-HDF-2"></a>
<a name="index-HDF4-1"></a>
</dd>
<dt>‘<samp>--cdl</samp>’</dt>
<dd><p>As of <acronym>NCO</acronym> version 4.3.3 (July, 2013), <code>ncks</code> can
print extracted data and metadata to screen (i.e., <code>stdout</code>) as
valid <acronym>CDL</acronym> (network Common data form Description Language).
<acronym>CDL</acronym> is the human-readable “lingua franca” of netCDF ingested by
<code>ncgen</code> and excreted by <code>ncdump</code>.
Compare <code>ncks</code> “traditional” with <acronym>CDL</acronym> printing:
</p><div class="example">
<pre class="example">zender@roulee:~$ ncks -v one ~/nco/data/in.nc
one: type NC_FLOAT, 0 dimensions, 1 attribute, chunked? no, compressed? no, packed? no
one size (RAM) = 1*sizeof(NC_FLOAT) = 1*4 = 4 bytes
one attribute 0: long_name, size = 3 NC_CHAR, value = one
one = 1
zender@roulee:~$ ncks --cdl -v one ~/nco/data/in.nc
netcdf in {
variables:
float one ;
one:long_name = "one" ;
data:
one = 1 ;
} // group /
</pre></div>
<p><code>ncgen</code> converts <acronym>CDL</acronym>-mode output into a netCDF file:
</p><div class="example">
<pre class="example">ncks --cdl -v one ~/nco/data/in.nc > ~/in.cdl
ncgen -k netCDF-4 -b -o ~/in.nc ~/in.cdl
ncks -v one ~/in.nc
</pre></div>
<p>The <acronym>HDF</acronym> version of <code>ncgen</code>, often named
<code>hncgen</code> or <code>ncgen-hdf</code>, converts netCDF3 <acronym>CDL</acronym>
into an <acronym>HDF</acronym> file:
</p><div class="example">
<pre class="example">/usr/hdf4/bin/ncgen -b -o ~/in.hdf ~/in.cdl # HDF ncgen (local builds)
/usr/bin/hncgen -b -o ~/in.hdf ~/in.cdl # Same as HDF ncgen (RPM packages?)
/usr/bin/ncgen-hdf -b -o ~/in.hdf ~/in.cdl # Same as HDF ncgen (Debian packages?)
hdp dumpsds ~/in.hdf # ncdump-equivalent for HDF4 files
</pre></div>
<p>Note that <acronym>HDF4</acronym> does not support netCDF-style groups, so the
above commands fail when the input file contains groups.
Only netCDF4 and <acronym>HDF5</acronym> support groups.
In our experience the <acronym>HDF</acronym> <code>ncgen</code> command, by whatever
name installed, is not robust and can fail on valid netCDF3
<acronym>CDL</acronym>.
</p>
<a name="dmn_rec_mk"></a> <!-- http://nco.sf.net/nco.html#dmn_rec_mk -->
<a name="mk_rec_dmn"></a> <!-- http://nco.sf.net/nco.html#mk_rec_dmn --><a name="index-record-dimension-8"></a>
<a name="index-fixed-dimension-3"></a>
<a name="index-fix-record-dimension-2"></a>
<a name="index-_002d_002dmk_005frec_005fdmn-dim-1"></a>
</dd>
<dt>‘<samp>--mk_rec_dmn <var>dim</var></samp>’</dt>
<dd><p>Change existing dimension <var>dim</var> to a record dimension in the output file.
This is the most straightforward way of changing a dimension to a/the
record dimension, and works fine in most cases.
See <a href="#ncecat-netCDF-Ensemble-Concatenator">ncecat netCDF Ensemble Concatenator</a> and
<a href="#ncpdq-netCDF-Permute-Dimensions-Quickly">ncpdq netCDF Permute Dimensions Quickly</a> for other methods of
changing variable dimensionality, including the record dimension.
</p>
<a name="prn"></a> <!-- http://nco.sf.net/nco.html#prn --><a name="index-_002dH-1"></a>
<a name="index-_002d_002ddata"></a>
<a name="index-_002d_002dhieronymus"></a>
</dd>
<dt>‘<samp>-H</samp>’</dt>
<dd><p>Turn-on printing to screen or turn-off copying data (not metadata).
Also activated using ‘<samp>--print</samp>’ or ‘<samp>--prn</samp>’.
By default <code>ncks</code> prints all metadata and data to screen if
no netCDF output file is specified.
Use ‘<samp>-H</samp>’ to print data to screen if a netCDF output is specified,
or to restrict printing to data (no metadata) when no netCDF output is
specified.
Also use ‘<samp>-H</samp>’ to turn-off copying data (not metadata) to an output
file.
Unless otherwise specified (with <code>-s</code>), each element of the data
hyperslab prints on a separate line containing the names, indices,
and, values, if any, of all of the variables dimensions.
The dimension and variable indices refer to the location of the
corresponding data element with respect to the variable as stored on
disk (i.e., not the hyperslab).
</p><div class="example">
<pre class="example">% ncks -C -v three_dmn_var in.nc
lat[0]=-90 lev[0]=100 lon[0]=0 three_dmn_var[0]=0
lat[0]=-90 lev[0]=100 lon[1]=90 three_dmn_var[1]=1
lat[0]=-90 lev[0]=100 lon[2]=180 three_dmn_var[2]=2
...
lat[1]=90 lev[2]=1000 lon[1]=90 three_dmn_var[21]=21
lat[1]=90 lev[2]=1000 lon[2]=180 three_dmn_var[22]=22
lat[1]=90 lev[2]=1000 lon[3]=270 three_dmn_var[23]=23
</pre></div>
<p>Printing the same variable with the ‘<samp>-F</samp>’ option shows the same
variable indexed with Fortran conventions
</p><div class="example">
<pre class="example">% ncks -F -C -v three_dmn_var in.nc
lon(1)=0 lev(1)=100 lat(1)=-90 three_dmn_var(1)=0
lon(2)=90 lev(1)=100 lat(1)=-90 three_dmn_var(2)=1
lon(3)=180 lev(1)=100 lat(1)=-90 three_dmn_var(3)=2
...
</pre></div>
<p>Printing a hyperslab does not affect the variable or dimension indices
since these indices are relative to the full variable (as stored in the
input file), and the input file has not changed.
However, if the hyperslab is saved to an output file and those values
are printed, the indices will change:
</p><div class="example">
<pre class="example">% ncks -H -d lat,90.0 -d lev,1000.0 -v three_dmn_var in.nc out.nc
...
lat[1]=90 lev[2]=1000 lon[0]=0 three_dmn_var[20]=20
lat[1]=90 lev[2]=1000 lon[1]=90 three_dmn_var[21]=21
lat[1]=90 lev[2]=1000 lon[2]=180 three_dmn_var[22]=22
lat[1]=90 lev[2]=1000 lon[3]=270 three_dmn_var[23]=23
% ncks -C -v three_dmn_var out.nc
lat[0]=90 lev[0]=1000 lon[0]=0 three_dmn_var[0]=20
lat[0]=90 lev[0]=1000 lon[1]=90 three_dmn_var[1]=21
lat[0]=90 lev[0]=1000 lon[2]=180 three_dmn_var[2]=22
lat[0]=90 lev[0]=1000 lon[3]=270 three_dmn_var[3]=23
</pre></div>
<a name="index-_002dM-2"></a>
<a name="index-_002d_002dMtd"></a>
<a name="index-_002d_002dMetadata"></a>
<a name="index-metadata_002c-global-1"></a>
</dd>
<dt>‘<samp>-M</samp>’</dt>
<dd><p>Turn-on printing to screen or turn-off copying global and group metadata.
This includes file summary information and global and group attributes.
Also ‘<samp>--Mtd</samp>’ and ‘<samp>--Metadata</samp>’.
By default <code>ncks</code> prints global metadata to screen if no netCDF
output file and no variable extraction list is specified (with ‘<samp>-v</samp>’).
Use ‘<samp>-M</samp>’ to print global metadata to screen if a netCDF output is
specified, or if a variable extraction list is specified (with ‘<samp>-v</samp>’).
Use ‘<samp>-M</samp>’ to turn-off copying of global and group metadata when
copying, subsetting, or appending to an output file.
</p>
<a name="prn_tbl"></a> <!-- http://nco.sf.net/nco.html#prn_tbl --><p>The various combinations of printing switches can be confusing.
In an attempt to anticipate what most users want to do, <code>ncks</code>
uses context-sensitive defaults for printing.
Our goal is to minimize the use of switches required to accomplish the
common operations.
We assume that users creating a new file or overwriting (e.g., with
‘<samp>-O</samp>’) an existing file usually wish to copy all global and
variable-specific attributes to the new file.
In contrast, we assume that users appending (e.g., with ‘<samp>-A</samp>’ an
explicit variable list from one file to another usually wish to copy
only the variable-specific attributes to the output file.
The switches ‘<samp>-H</samp>’, ‘<samp>-M</samp>’, and ‘<samp>-m</samp>’ switches are
implemented as toggles which reverse the default behavior.
The most confusing aspect of this is that ‘<samp>-M</samp>’ inhibits copying
global metadata in overwrite mode and causes copying of global
metadata in append mode.
</p><div class="example">
<pre class="example">ncks in.nc # Print VAs and GAs
ncks -v one in.nc # Print VAs not GAs
ncks -M -v one in.nc # Print GAs only
ncks -m -v one in.nc # Print VAs only
ncks -M -m -v one in.nc # Print VAs and GAs
ncks -O in.nc out.nc # Copy VAs and GAs
ncks -O -v one in.nc out.nc # Copy VAs and GAs
ncks -O -M -v one in.nc out.nc # Copy VAs not GAs
ncks -O -m -v one in.nc out.nc # Copy GAs not VAs
ncks -O -M -m -v one in.nc out.nc # Copy only data (no atts)
ncks -A in.nc out.nc # Append VAs and GAs
ncks -A -v one in.nc out.nc # Append VAs not GAs
ncks -A -M -v one in.nc out.nc # Append VAs and GAs
ncks -A -m -v one in.nc out.nc # Append only data (no atts)
ncks -A -M -m -v one in.nc out.nc # Append GAs not VAs
</pre></div>
<p>where <code>VAs</code> and <code>GAs</code> denote variable and group/global
attributes, respectively.
</p>
<a name="index-ncdump-2"></a>
<a name="index-_002dm"></a>
<a name="index-_002d_002dmtd"></a>
<a name="index-_002d_002dmetadata"></a>
<a name="index-metadata"></a>
</dd>
<dt>‘<samp>-m</samp>’</dt>
<dd><p>Turn-on printing to screen or turn-off copying variable metadata.
Using ‘<samp>-m</samp>’ will print variable metadata to screen (similar to
<kbd>ncdump -h</kbd>).
This displays all metadata pertaining to each variable, one variable
at a time.
<a name="index-chunking-2"></a>
<a name="index-compression-1"></a>
<a name="index-deflation-2"></a>
This includes information on the storage properties of the variable,
such as whether it employs chunking, compression, or packing.
Also activated using ‘<samp>--mtd</samp>’ and ‘<samp>--metadata</samp>’.
The <code>ncks</code> default behavior is to print variable metadata to
screen if no netCDF output file is specified.
Use ‘<samp>-m</samp>’ to print variable metadata to screen if a netCDF output is
specified.
Also use ‘<samp>-m</samp>’ to turn-off copying of variable metadata to an output
file.
</p>
<a name="index-_002d_002dno_005fblank"></a>
<a name="index-_002d_002dnoblank"></a>
<a name="index-_002d_002dno_002dblank"></a>
<a name="index-blank"></a>
<a name="index-missing-values-3"></a>
</dd>
<dt>‘<samp>--no_blank</samp>’</dt>
<dd><p>Print numeric representation of missing values.
As of <acronym>NCO</acronym>
As of <acronym>NCO</acronym> version 4.2.2 (October, 2012), <acronym>NCO</acronym> prints
missing values as blanks (i.e., the underscore character ‘<samp>_</samp>’) by default.
To enable the old behavior of printing the numeric representation of
missing values (e.g., <code>1.0e36</code>), use the ‘<samp>--no_blank</samp>’ switch.
Also activated using ‘<samp>--noblank</samp>’ or ‘<samp>--no-blank</samp>’.
</p>
<a name="index-_002dP"></a>
<a name="index-_002d_002dprint"></a>
<a name="index-_002d_002dprn"></a>
</dd>
<dt>‘<samp>-P</samp>’</dt>
<dd><p>Print data, metadata, and units to screen.
The ‘<samp>-P</samp>’ switch is a convenience abbreviation for
‘<samp>-C -H -M -m -u</samp>’.
Also activated using ‘<samp>--print</samp>’ or ‘<samp>--prn</samp>’.
This set of switches is useful for exploring file contents.
</p>
<a name="index-_002dQ"></a>
</dd>
<dt>‘<samp>-Q</samp>’</dt>
<dd><p>Toggle printing of dimension indices and coordinate values when printing
arrays.
Each variable’s name appears flush left in the output.
This helps locate specific variables in lists with many variables and
different dimensions.
</p>
<a name="index-_002dq"></a>
<a name="index-_002d_002dquiet"></a>
<a name="index-quiet"></a>
</dd>
<dt>‘<samp>-q</samp>’</dt>
<dd><p>Turn off all printing to screen.
This overrides the setting of all print-related switches, equivalent to
<kbd>-H -M -m</kbd> when in single-file printing mode.
When invoked with <code>-R</code> (see <a href="#Retaining-Retrieved-Files">Retaining Retrieved Files</a>), <code>ncks</code>
automatically sets <code>-q</code>.
This allows <code>ncks</code> to retrieve remote files without
automatically trying to print them.
Also ‘<samp>--quiet</samp>’.
</p>
<a name="index-_002ds"></a>
<a name="index-_002d_002dstring"></a>
<a name="index-_002d_002dsng_005ffmt"></a>
<a name="index-printf_0028_0029-1"></a>
<a name="index-C-language-7"></a>
</dd>
<dt>‘<samp>-s <var>format</var></samp>’</dt>
<dd><p>String format for text output.
Accepts C language<!-- /@w --> escape sequences and <code>printf()</code> formats.
Also ‘<samp>--string</samp>’ and ‘<samp>--sng_fmt</samp>’.
</p>
<a name="index-_002du"></a>
<a name="index-_002d_002dunits"></a>
</dd>
<dt>‘<samp>-u</samp>’</dt>
<dd><p>Toggle the printing of a variable’s <code>units</code> attribute, if any,
with its values.
Also ‘<samp>--units</samp>’.
</p>
<a name="xml"></a> <!-- http://nco.sf.net/nco.html#xml -->
<a name="ncmnl"></a> <!-- http://nco.sf.net/nco.html#ncml --><a name="index-_002d_002dxml"></a>
<a name="index-_002d_002dncml"></a>
<a name="index-ncdump-3"></a>
<a name="index-XML"></a>
<a name="index-NcML"></a>
</dd>
<dt>‘<samp>--xml, --ncml</samp>’</dt>
<dd><p>As of <acronym>NCO</acronym> version 4.3.3 (July, 2013), <code>ncks</code> can
print extracted metadata to screen (i.e., <code>stdout</code>) as
<acronym>XML</acronym> in <acronym>NcML</acronym>, the netCDF Markup Language.
<code>ncks</code> supports for <acronym>XML</acronym> more completely than
of ‘<samp>ncdump -x</samp>’.
With <code>ncks</code> one can translate entire netCDF3 and netCDF4 files
into <acronym>NcML</acronym>, including metadata and data, using all
<acronym>NCO</acronym>’s subsetting and hyperslabbing capabilities.
Compare <code>ncks</code> “traditional” with <acronym>XML</acronym> printing:
</p><div class="example">
<pre class="verbatim">zender@@roulee:~$ ncks -v one ~/nco/data/in.nc
one: type NC_FLOAT, 0 dimensions, 1 attribute, chunked? no, compressed? no, packed? no
one size (RAM) = 1*sizeof(NC_FLOAT) = 1*4 = 4 bytes
one attribute 0: long_name, size = 3 NC_CHAR, value = one
one = 1
zender@roulee:~$ ncks --xml -v one ~/nco/data/in.nc
<?xml version="1.0" encoding="UTF-8"?>
<netcdf xmlns="http://www.unidata.ucar.edu/namespaces/netcdf/ncml-2.2" location="/home/zender/nco/data/in.nc">
<variable name="one" type="float" shape="">
<attribute name="long_name" separator="*" value="one" />
<values>1.</values>
</variable>
</netcdf>
</pre></div>
<p><acronym>XML</acronym>-mode prints variable metadata and, as of
<acronym>NCO</acronym> version 4.3.7 (October, 2013), variable data and, as of
<acronym>NCO</acronym> version 4.4.0 (January, 2014), hidden attributes.
That <acronym>ncks</acronym> produces correct <acronym>NcML</acronym> translations of
<acronym>CDM</acronym> files for all supported datatypes is verified by
comparison to output from Unidata’s <code>toolsUI</code> Java program.
Please let us know how to improve <acronym>XML</acronym>/<acronym>NcML</acronym>
features.
</p>
<a name="index-_002d_002dxml_005fno_005flocation"></a>
<a name="index-_002d_002dxml_005fspr_005fchr"></a>
<a name="index-_002d_002dxml_005fspr_005fnmr"></a>
<a name="index-separator"></a>
<p><code>ncks</code> provides additional options to configure <acronym>NcML</acronym>
output: ‘<samp>--xml_no_location</samp>’, ‘<samp>--xml_spr_chr</samp>’, and
‘<samp>--xml_spr_nmr</samp>’.
Every <acronym>NcML</acronym> configuration option automatically triggers
<acronym>NcML</acronym> printing, so that specifying ‘<samp>--xml</samp>’ in addition
to a configuration option is redundant and unnecessary.
The ‘<samp>--xml_no_location</samp>’ switch prevents output of the
<acronym>NcML</acronym> <code>location</code> element.
By default the location element is printed with a value equal to the
location of the input dataset, e.g.,
<code>location="/home/zender/in.nc"</code>.
The ‘<samp>--xml_spr_chr</samp>’ and ‘<samp>--xml_spr_nmr</samp>’ options customize
the strings used as <acronym>NcML</acronym> separators for attributes and
variables of character-type and numeric-type, respectively.
Their default separators are "*" and " ":
</p><div class="example">
<pre class="verbatim">zender@@roulee:~$ ncks --xml -d time,0,3 -v two_dmn_rec_var_sng in.nc
...
<values separator="*">abc*bcd*cde*def</values>
...
zender@@roulee:~$ ncks --xml_spr_chr=', ' -v two_dmn_rec_var_sng in.nc
...
<values separator=", ">abc, bcd, cde, def, efg, fgh, ghi, hij, jkl, klm</values>
...
zender@@roulee:~$ ncks --xml -v one_dmn_rec_var in.nc
...
<values>1 2 3 4 5 6 7 8 9 10</values>
...
zender@@roulee:~$ ncks --xml_spr_nmr=', ' -v one_dmn_rec_var in.nc
...
<values separator=", ">1, 2, 3, 4, 5, 6, 7, 8, 9, 10</values>
...
</pre></div>
<p>Separator elements for strings are a thorny issue.
One must be sure that the separator element is not mistaken as a portion
of the string.
<acronym>NCO</acronym> attempts to produce valid <acronym>NcML</acronym> and supplies the
‘<samp>--xml_spr_chr</samp>’ option to work around any difficulties.
<acronym>NCO</acronym> performs precautionary checks with
<code>strstr(<var>val</var>,<var>spr</var>)</code> to identify presence of the separator
string (<var>spr</var>) in data (<var>val</var>) and, when it detects a match,
automatically switches to a backup separator string (<code>*|*</code>).
However limitations of <code>strstr()</code> may lead to false negatives
when the separator string occurs in data beyond the first string in
multi-dimensional <code>NC_CHAR</code> arrays.
Hence, results may be ambiguous to NcML parsers.
If problems arise, use ‘<samp>--xml_spr_chr</samp>’ to specify a multi-character
separator that does not appear in the string array and that does not
include an NcML formatting characters (e.g., commas, angles, quotes).
</p></dd>
</dl>
<a name="ncattget"></a> <!-- http://nco.sf.net/nco.html#ncattget -->
<a name="nclist"></a> <!-- http://nco.sf.net/nco.html#nclist -->
<a name="ncdmnsz"></a> <!-- http://nco.sf.net/nco.html#ncdmnsz -->
<a name="ncrecsz"></a> <!-- http://nco.sf.net/nco.html#ncrecsz -->
<a name="ncmax"></a> <!-- http://nco.sf.net/nco.html#ncmax -->
<a name="ncmdn"></a> <!-- http://nco.sf.net/nco.html#ncmdn -->
<a name="ncavg"></a> <!-- http://nco.sf.net/nco.html#ncavg -->
<a name="ncrng"></a> <!-- http://nco.sf.net/nco.html#ncrng -->
<a name="ncunits"></a> <!-- http://nco.sf.net/nco.html#ncunits -->
<a name="alias"></a> <!-- http://nco.sf.net/nco.html#alias -->
<a name="filters"></a> <!-- http://nco.sf.net/nco.html#filters -->
<a name="filter"></a> <!-- http://nco.sf.net/nco.html#filter -->
<a name="flt"></a> <!-- http://nco.sf.net/nco.html#flt --><table class="menu" border="0" cellspacing="0">
<tr><td align="left" valign="top">• <a href="#Filters-for-ncks" accesskey="1">Filters for <code>ncks</code></a>:</td><td> </td><td align="left" valign="top">
</td></tr>
</table>
<hr>
<a name="Filters-for-ncks"></a>
<div class="header">
<p>
Previous: <a href="#ncks-netCDF-Kitchen-Sink" accesskey="p" rel="previous">ncks netCDF Kitchen Sink</a>, Up: <a href="#ncks-netCDF-Kitchen-Sink" accesskey="u" rel="up">ncks netCDF Kitchen Sink</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#General-Index" title="Index" rel="index">Index</a>]</p>
</div>
<a name="Filters-for-ncks-1"></a>
<h4 class="subsection">4.7.1 Filters for <code>ncks</code></h4>
<a name="index-UNIX-5"></a>
<a name="index-ncattget-1"></a>
<a name="index-ncavg"></a>
<a name="index-ncdmnsz"></a>
<a name="index-nclist"></a>
<a name="index-ncmax"></a>
<a name="index-ncmdn"></a>
<a name="index-ncmin"></a>
<a name="index-ncrecsz"></a>
<a name="index-ncrng"></a>
<a name="index-ncunits"></a>
<a name="index-_002ebashrc"></a>
<a name="index-filters"></a>
<a name="index-alias-1"></a>
<a name="index-shell-5"></a>
<a name="index-Bash-shell-1"></a>
<a name="index-Csh-shell"></a>
<a name="index-Sh-shell"></a>
<a name="index-bash-1"></a>
<p>We encourage the use of standard <acronym>UNIX</acronym> pipes and filters to
narrow the verbose output of <code>ncks</code> into more precise targets.
For example, to obtain an uncluttered listing of the variables in a file
try
</p><div class="example">
<pre class="example">ncks -m in.nc | grep -E ': type' | cut -f 1 -d ' ' | sed 's/://' | sort
</pre></div>
<p>A Bash user could alias the previous filter to the shell command
<code>nclist</code> as shown below.
More complex examples could involve command line arguments.
For example, a user may frequently be interested in obtaining the value
of an attribute, e.g., for textual file examination or for passing to
another shell command.
Say the attribute is <code>purpose</code>, the variable is <code>z</code>, and the
file is <code>in.nc</code>.
In this example, <code>ncks -m -v z</code> is too verbose so a robust
<code>grep</code> and <code>cut</code> filter is desirable, such as
</p><div class="example">
<pre class="example">ncks -M -m in.nc | grep -E -i "^z attribute [0-9]+: purpose" | cut -f 11- -d ' ' | sort
</pre></div>
<p>The filters are clearly too complex to remember on-the-fly so the entire
procedure could be implemented as a shell command or function called,
say, <code>ncattget</code>
</p><div class="example">
<pre class="example">function ncattget { ncks -M -m ${3} | grep -E -i "^${2} attribute [0-9]+: ${1}" | cut -f 11- -d ' ' | sort ; }
</pre></div>
<p>The shell <code>ncattget</code> is invoked with three arugments that are,
in order, the names of the attribute, variable, and file to examine.
Global attributes are indicated by using a variable name of <code>global</code>.
This definition yields the following results
</p><div class="example">
<pre class="example">% ncattget purpose z in.nc
Height stored with a monotonically increasing coordinate
% ncattget Purpose Z in.nc
Height stored with a monotonically increasing coordinate
% ncattget history z in.nc
% ncattget history global in.nc
History global attribute.
</pre></div>
<p>Note that case sensitivity has been turned off for the variable and
attribute names (and could be turned on by removing the ‘<samp>-i</samp>’ switch
to <code>grep</code>).
Furthermore, extended regular expressions may be used for both the
variable and attribute names.
The next two commands illustrate this by searching for the values
of attribute <code>purpose</code> in all variables, and then for all
attributes of the variable <code>z</code>:
</p><div class="example">
<pre class="example">% ncattget purpose .+ in.nc
1-D latitude coordinate referred to by geodesic grid variables
1-D longitude coordinate referred to by geodesic grid variables
...
% ncattget .+ Z in.nc
Height
Height stored with a monotonically increasing coordinate
meter
</pre></div>
<p>Extended filters are best stored as shell commands if they are
used frequently.
Shell commands may be re-used when they are defined in shell
configuration files.
These files are usually named <samp>.bashrc</samp>, <samp>.cshrc</samp>, and
<samp>.profile</samp> for the Bash, Csh, and Sh shells, respectively.
</p><div class="example">
<pre class="verbatim"># NB: Untested on Csh, Ksh, Sh, Zsh! Send us feedback!
# Bash shell (/bin/bash) users place these in .bashrc
# ncattget $att_nm $var_nm $fl_nm : What attributes does variable have?
function ncattget { ncks -M -m ${3} | grep -E -i "^${2} attribute [0-9]+: ${1}" | cut -f 11- -d ' ' | sort ; }
# ncunits $att_val $fl_nm : Which variables have given units?
function ncunits { ncks -M -m ${2} | grep -E -i " attribute [0-9]+: units.+ ${1}" | cut -f 1 -d ' ' | sort ; }
# ncavg $var_nm $fl_nm : What is mean of variable?
function ncavg { ncwa -y avg -O -C -v ${1} ${2} ~/foo.nc ; ncks -H -C -v ${1} ~/foo.nc | cut -f 3- -d ' ' ; }
# ncavg $var_nm $fl_nm : What is mean of variable?
function ncavg { ncap2 -O -C -v -s "foo=${1}.avg();print(foo)" ${2} ~/foo.nc | cut -f 3- -d ' ' ; }
# ncdmnsz $dmn_nm $fl_nm : What is dimension size?
function ncdmnsz { ncks -m -M ${2} | grep -E -i ": ${1}, size =" | cut -f 7 -d ' ' | uniq ; }
# nclist $fl_nm : What variables are in file?
function nclist { ncks -m ${1} | grep -E ': type' | cut -f 1 -d ' ' | sed 's/://' | sort ; }
# ncmax $var_nm $fl_nm : What is maximum of variable?
function ncmax { ncwa -y max -O -C -v ${1} ${2} ~/foo.nc ; ncks -H -C -v ${1} ~/foo.nc | cut -f 3- -d ' ' ; }
# ncmax $var_nm $fl_nm : What is maximum of variable?
function ncmax { ncap2 -O -C -v -s "foo=${1}.max();print(foo)" ${2} ~/foo.nc | cut -f 3- -d ' ' ; }
# ncmdn $var_nm $fl_nm : What is median of variable?
function ncmdn { ncap2 -O -C -v -s "foo=gsl_stats_median_from_sorted_data(${1}.sort());print(foo)" ${2} ~/foo.nc | cut -f 3- -d ' ' ; }
# ncrng $var_nm $fl_nm : What is range of variable?
function ncrng { ncap2 -O -C -v -s "foo_min=${1}.min();foo_max=${1}.max();print(foo_min,\"%f\");print(\" to \");print(foo_max,\"%f\")" ${2} ~/foo.nc ; }
# ncmode $var_nm $fl_nm : What is mode of variable?
function ncmode { ncap2 -O -C -v -s "foo=gsl_stats_median_from_sorted_data(${1}.sort());print(foo)" ${2} ~/foo.nc | cut -f 3- -d ' ' ; }
# ncrecsz $fl_nm : What is record dimension size?
function ncrecsz { ncks -M ${1} | grep -E -i "^Record dimension:" | cut -f 8- -d ' ' ; }
# Csh shell (/bin/csh) users place these in .cshrc
ncattget() { ncks -M -m ${3} | grep -E -i "^${2} attribute [0-9]+: ${1}" | cut -f 11- -d ' ' | sort ; }
ncdmnsz() { ncks -m -M ${2} | grep -E -i ": ${1}, size =" | cut -f 7 -d ' ' | uniq ; }
nclist() { ncks -m ${1} | grep -E ': type' | cut -f 1 -d ' ' | sed 's/://' | sort ; }
ncrecsz() { ncks -M ${1} | grep -E -i "^Record dimension:" | cut -f 8- -d ' ' ; }
# Sh shell (/bin/sh) users place these in .profile
ncattget() { ncks -M -m ${3} | grep -E -i "^${2} attribute [0-9]+: ${1}" | cut -f 11- -d ' ' | sort ; }
ncdmnsz() { ncks -m -M ${2} | grep -E -i ": ${1}, size =" | cut -f 7 -d ' ' | uniq ; }
nclist() { ncks -m ${1} | grep -E ': type' | cut -f 1 -d ' ' | sed 's/://' | sort ; }
ncrecsz() { ncks -M ${1} | grep -E -i "^Record dimension:" | cut -f 8- -d ' ' ; }
</pre></div>
<a name="xmp_ncks"></a> <!-- http://nco.sf.net/nco.html#xmp_ncks --><p>EXAMPLES
</p>
<p>View all data in netCDF <samp>in.nc</samp>, printed with Fortran indexing
conventions:
</p><div class="example">
<pre class="example">ncks -F in.nc
</pre></div>
<p>Copy the netCDF file <samp>in.nc</samp> to file <samp>out.nc</samp>.
</p><div class="example">
<pre class="example">ncks in.nc out.nc
</pre></div>
<p>Now the file <samp>out.nc</samp> contains all the data from <samp>in.nc</samp>.
There are, however, two differences between <samp>in.nc</samp> and
<samp>out.nc</samp>.
<a name="index-history-5"></a>
First, the <code>history</code> global attribute (see <a href="#History-Attribute">History Attribute</a>)
will contain the command used to create <samp>out.nc</samp>.
<a name="index-alphabetize-output"></a>
<a name="index-sort-alphabetically-1"></a>
<a name="index-_002da-1"></a>
Second, the variables in <samp>out.nc</samp> will be defined in alphabetical
order.
Of course the internal storage of variable in a netCDF file should be
transparent to the user, but there are cases when alphabetizing a file
is useful (see description of <code>-a</code> switch).
</p>
<a name="xmp_att_glb_cpy"></a> <!-- http://nco.sf.net/nco.html#xmp_att_glb_cpy --><a name="index-global-attributes-8"></a>
<a name="index-attributes_002c-global-8"></a>
<a name="index-subsetting-3"></a>
<a name="index-exclusion-1"></a>
<a name="index-extraction-1"></a>
<a name="index-_002dv-var-1"></a>
<a name="index-_002d_002dvariable-var-1"></a>
<a name="index-_002dx-1"></a>
<a name="index-_002d_002dexclude-1"></a>
<a name="index-_002d_002dxcl-1"></a>
<p>Copy all global attributes (and no variables) from <samp>in.nc</samp> to
<samp>out.nc</samp>:
</p><div class="example">
<pre class="example">ncks -A -x ~/nco/data/in.nc ~/out.nc
</pre></div>
<p>The ‘<samp>-x</samp>’ switch tells <acronym>NCO</acronym> to use the complement of the extraction
list (see <a href="#Subsetting-Files">Subsetting Files</a>).
Since no extraction list is explicitly specified (with ‘<samp>-v</samp>’),
the default is to extract all variables.
The complement of all variables is no variables.
<a name="index-_002dA-2"></a>
<a name="index-_002d_002dapn-2"></a>
<a name="index-_002d_002dappend-2"></a>
<a name="index-appending-to-files-2"></a>
Without any variables to extract, the append (‘<samp>-A</samp>’) command
(see <a href="#Appending-Variables">Appending Variables</a>) has only to extract and copy
(i.e., append) global attributes to the output file.
</p>
<a name="xmp_att_glb_cpy"></a> <!-- http://nco.sf.net/nco.html#xmp_att_var_cpy --><p>Copy/append metadata (not data) from variables in one file to
variables in a second file.
When copying/subsetting/appending files (as opposed to printing them),
the copying of data, variable metadata, and global/group metadata are
now turned OFF by ‘<samp>-H</samp>’, ‘<samp>-m</samp>’, and ‘<samp>-M</samp>’, respectively.
This is the opposite sense in which these switches work when
<em>printing</em> a file.
One can use these switches to easily replace data or metadata in one
file with data or metadata from another:
</p><div class="example">
<pre class="example"># Extract naked (data-only) copies of two variables
ncks -h -M -m -O -C -v one,three_dmn_rec_var ~/nco/data/in.nc ~/out.nc
# Change values to be sure original values are not copied in following step
ncap2 -O -v -s 'one*=2;three_dmn_rec_var*=0' ~/nco/data/in.nc ~/in2.nc
# Append in2.nc metadata (not data!) to out.nc
ncks -A -C -H -v one,three_dmn_rec_var ~/in2.nc ~/out.nc
</pre></div>
<p>Variables in <samp>out.nc</samp> now contain data (not metadata) from
<samp>in.nc</samp> and metadata (not data) from <samp>in2.nc</samp>.
</p>
<a name="index-printf_0028_0029-2"></a>
<a name="index-_005cn-_0028linefeed_0029"></a>
<a name="index-_005ct-_0028horizontal-tab_0029"></a>
<p>Print variable <code>three_dmn_var</code> from file <samp>in.nc</samp> with
default notations.
Next print <code>three_dmn_var</code> as an un-annotated text column.
Then print <code>three_dmn_var</code> signed with very high precision.
Finally, print <code>three_dmn_var</code> as a comma-separated list.
</p><div class="example">
<pre class="example">% ncks -C -v three_dmn_var in.nc
lat[0]=-90 lev[0]=100 lon[0]=0 three_dmn_var[0]=0
lat[0]=-90 lev[0]=100 lon[1]=90 three_dmn_var[1]=1
...
lat[1]=90 lev[2]=1000 lon[3]=270 three_dmn_var[23]=23
% ncks -s '%f\n' -C -v three_dmn_var in.nc
0.000000
1.000000
...
23.000000
% ncks -s '%+16.10f\n' -C -v three_dmn_var in.nc
+0.0000000000
+1.0000000000
...
+23.0000000000
% ncks -s '%f, ' -C -v three_dmn_var in.nc
0.000000, 1.000000, ..., 23.000000,
</pre></div>
<p>Programmers will recognize these as the venerable C language<!-- /@w -->
<code>printf()</code> formatting strings.
The second and third options are useful when pasting data into text
files like reports or papers.
See <a href="#ncatted-netCDF-Attribute-Editor">ncatted netCDF Attribute Editor</a>, for more details on string
formatting and special characters.
</p>
<p>As of <acronym>NCO</acronym> version 4.2.2 (October, 2012), <acronym>NCO</acronym> prints
missing values as blanks (i.e., the underscore character ‘<samp>_</samp>’) by
default:
</p><div class="example">
<pre class="example">% ncks -C -H -v mss_val in.nc
lon[0]=0 mss_val[0]=73
lon[1]=90 mss_val[1]=_
lon[2]=180 mss_val[2]=73
lon[3]=270 mss_val[3]=_
% ncks -s '%+5.1f, ' -H -C -v mss_val in.nc
+73.0, _, +73.0, _,
</pre></div>
<p>One dimensional arrays of characters stored as netCDF variables are
automatically printed as strings, whether or not they are
NUL-terminated, e.g.,
</p><div class="example">
<pre class="example">ncks -v fl_nm in.nc
</pre></div>
<p>The <code>%c</code> formatting code is useful for printing
multidimensional arrays of characters representing fixed length strings
</p><div class="example">
<pre class="example">ncks -s '%c' -v fl_nm_arr in.nc
</pre></div>
<a name="index-core-dump-2"></a>
<p>Using the <code>%s</code> format code on strings which are not NUL-terminated
(and thus not technically strings) is likely to result in a core dump.
</p>
<a name="index-subsetting-4"></a>
<a name="index-exclusion-2"></a>
<a name="index-extraction-2"></a>
<p>Create netCDF <samp>out.nc</samp> containing all variables, and any associated
coordinates, except variable <code>time</code>, from netCDF <samp>in.nc</samp>:
</p><div class="example">
<pre class="example">ncks -x -v time in.nc out.nc
</pre></div>
<p>As a special case of this, consider how to remove a
<acronym>CF</acronym> Convention comliant <code>bounds</code> or <code>coordinates</code>
variable (see <a href="#CF-Conventions">CF Conventions</a>) such as <code>time_bounds</code>.
<acronym>NCO</acronym> subsetting assumes the user wants all coordinates
and bounds and axes associated with all extracted variables
(see <a href="#Subsetting-Coordinate-Variables">Subsetting Coordinate Variables</a>).
Hence to exclude a <code>bounds</code> or <code>coordinates</code> variable while
retaining the “parent” variable (here <code>time</code>), one must use the
‘<samp>-C</samp>’ switch:
</p><div class="example">
<pre class="example">ncks -C -x -v time_bounds in.nc out.nc
</pre></div>
<p>The ‘<samp>-C</samp>’ switch tells the operator <em>NOT</em> to necessarily
include all the <acronym>CF</acronym> coordinates and bounds and axes.
Hence the output file will contain <code>time</code> and not
<code>time_bounds</code>.
</p>
<p>Extract variables <code>time</code> and <code>pressure</code> from netCDF
<samp>in.nc</samp>.
If <samp>out.nc</samp> does not exist it will be created.
Otherwise the you will be prompted whether to append to or to
overwrite <samp>out.nc</samp>:
</p><div class="example">
<pre class="example">ncks -v time,pressure in.nc out.nc
ncks -C -v time,pressure in.nc out.nc
</pre></div>
<p>The first version of the command creates an <samp>out.nc</samp> which contains
<code>time</code>, <code>pressure</code>, and any coordinate variables associated
with <var>pressure</var>.
The <samp>out.nc</samp> from the second version is guaranteed to contain only
two variables <code>time</code> and <code>pressure</code>.
</p>
<p>Create netCDF <samp>out.nc</samp> containing all variables from file
<samp>in.nc</samp>.
Restrict the dimensions of these variables to a hyperslab.
Print (with <code>-H</code>) the hyperslabs to the screen for good measure.
The specified hyperslab is: the fifth value in dimension <code>time</code>;
the
half-open range <em><var>lat</var> > 0.</em> in coordinate <code>lat</code>; the
half-open range <em><var>lon</var> < 330.</em> in coordinate <code>lon</code>; the
closed interval <em>0.3 < <var>band</var> < 0.5</em> in coordinate <code>band</code>;
and cross-section closest to 1000. in coordinate <code>lev</code>.
Note that limits applied to coordinate values are specified with a
decimal point, and limits applied to dimension indices do not have a
decimal point See <a href="#Hyperslabs">Hyperslabs</a>.
</p><div class="example">
<pre class="example">ncks -H -d time,5 -d lat,,0.0 -d lon,330.0, -d band,0.3,0.5
-d lev,1000.0 in.nc out.nc
</pre></div>
<a name="index-wrapped-coordinates-3"></a>
<p>Assume the domain of the monotonically increasing longitude coordinate
<code>lon</code> is <em>0 < <var>lon</var> < 360</em>.
Here, <code>lon</code> is an example of a wrapped coordinate.
<code>ncks</code> will extract a hyperslab which crosses the Greenwich
meridian simply by specifying the westernmost longitude as <var>min</var> and
the easternmost longitude as <var>max</var>, as follows:
</p><div class="example">
<pre class="example">ncks -d lon,260.0,45.0 in.nc out.nc
</pre></div>
<p>For more details See <a href="#Wrapped-Coordinates">Wrapped Coordinates</a>.
</p>
<a name="ncpdq"></a> <!-- http://nco.sf.net/nco.html#ncpdq -->
<a name="ncpack"></a> <!-- http://nco.sf.net/nco.html#ncpack -->
<a name="ncunpack"></a> <!-- http://nco.sf.net/nco.html#ncunpack --><hr>
<a name="ncpdq-netCDF-Permute-Dimensions-Quickly"></a>
<div class="header">
<p>
Next: <a href="#ncra-netCDF-Record-Averager" accesskey="n" rel="next">ncra netCDF Record Averager</a>, Previous: <a href="#ncks-netCDF-Kitchen-Sink" accesskey="p" rel="previous">ncks netCDF Kitchen Sink</a>, Up: <a href="#Operator-Reference-Manual" accesskey="u" rel="up">Operator Reference Manual</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#General-Index" title="Index" rel="index">Index</a>]</p>
</div>
<a name="ncpdq-netCDF-Permute-Dimensions-Quickly-1"></a>
<h3 class="section">4.8 <code>ncpdq</code> netCDF Permute Dimensions Quickly</h3>
<a name="index-ncpdq-4"></a>
<a name="index-ncpack"></a>
<a name="index-ncunpack"></a>
<a name="index-reshape-variables"></a>
<a name="index-permute-dimensions"></a>
<a name="index-reverse-dimensions"></a>
<a name="index-re_002dorder-dimensions"></a>
<a name="index-re_002ddimension"></a>
<a name="index-packing-4"></a>
<a name="index-unpacking-3"></a>
<p>SYNTAX
</p><div class="example">
<pre class="example">ncpdq [-3] [-4] [-6] [-7] [-A] [-a [-]<var>dim</var>[,…]] [-C] [-c]
[--cnk_dmn nm,sz] [--cnk_map map] [--cnk_plc plc] [--cnk_scl sz]
[-D <var>dbg</var>] [-d <var>dim</var>,[<var>min</var>][,[<var>max</var>][,[<var>stride</var>]]]
[-F] [-G <var>gpe_dsc</var>] [-g <var>grp</var>[,…]] [-h] [--hdf] [--hdr_pad <var>nbr</var>]
[-L <var>dfl_lvl</var>] [-l <var>path</var>] [-M <var>pck_map</var>] [--mrd] [--no_tmp_fl]
[-O] [-o <var>output-file</var>] [-P <var>pck_plc</var>] [-p <var>path</var>]
[-R] [-r] [--ram_all] [-t <var>thr_nbr</var>] [-U] [--unn] [-v <var>var</var>[,…]] [-X ...] [-x]
<var>input-file</var> [<var>output-file</var>]
</pre></div>
<p>DESCRIPTION
</p>
<p><code>ncpdq</code> performs one (not both) of two distinct functions:
packing or dimension permutation.
<code>ncpdq</code> is optimized to perform these actions in a parallel
fashion with a minimum of time and memory.
The <em>pdq</em> may stand for “Permute Dimensions Quickly”,
“Pack Data Quietly”, “Pillory Dan Quayle”, or other silly uses.
</p>
<a name="index-add_005foffset-3"></a>
<a name="index-scale_005ffactor-2"></a>
<a name="index-ncap2-3"></a>
<a name="index-packing-policy"></a>
<a name="Packing-and-Unpacking-Functions"></a>
<h4 class="unnumberedsubsec">Packing and Unpacking Functions</h4>
<p>The <code>ncpdq</code> packing (and unpacking) algorithms are described
in <a href="#Methods-and-functions">Methods and functions</a>, and are also implemented in
<code>ncap2</code>.
<code>ncpdq</code> extends the functionality of these algorithms by
providing high level control of the <em>packing policy</em> so that
users can consistently pack (and unpack) entire files with one command.
<a name="index-pck_005fplc"></a>
<a name="index-_002dP-pck_005fplc"></a>
<a name="index-_002d_002dpck_005fplc-pck_005fplc"></a>
<a name="index-_002d_002dpack_005fpolicy-pck_005fplc"></a>
The user specifies the desired packing policy with the ‘<samp>-P</samp>’ switch
(or its long option equivalents, ‘<samp>--pck_plc</samp>’ and
‘<samp>--pack_policy</samp>’) and its <var>pck_plc</var> argument.
Four packing policies are currently implemented:<br>
</p><dl compact="compact">
<dt><em>Packing (and Re-Packing) Variables [<em>default</em>]</em></dt>
<dd><p>Definition: Pack unpacked variables, re-pack packed variables<br>
Alternate invocation: <code>ncpack</code><br>
<var>pck_plc</var> key values: ‘<samp>all_new</samp>’, ‘<samp>pck_all_new_att</samp>’<br>
</p></dd>
<dt><em>Packing (and not Re-Packing) Variables</em></dt>
<dd><p>Definition: Pack unpacked variables, copy packed variables<br>
Alternate invocation: none<br>
<var>pck_plc</var> key values: ‘<samp>all_xst</samp>’, ‘<samp>pck_all_xst_att</samp>’<br>
</p></dd>
<dt><em>Re-Packing Variables</em></dt>
<dd><p>Definition: Re-pack packed variables, copy unpacked variables<br>
Alternate invocation: none<br>
<var>pck_plc</var> key values: ‘<samp>xst_new</samp>’, ‘<samp>pck_xst_new_att</samp>’<br>
</p></dd>
<dt><em>Unpacking</em></dt>
<dd><p>Definition: Unpack packed variables, copy unpacked variables<br>
Alternate invocation: <code>ncunpack</code><br>
<var>pck_plc</var> key values: ‘<samp>upk</samp>’, ‘<samp>unpack</samp>’, ‘<samp>pck_upk</samp>’<br>
</p></dd>
</dl>
<p>Equivalent key values are fully interchangeable.
Multiple equivalent options are provided to satisfy disparate needs
and tastes of <acronym>NCO</acronym> users working with scripts and from the
command line.
</p>
<p>Regardless of the packing policy selected, <code>ncpdq</code>
no longer (as of <acronym>NCO</acronym> version 4.0.4 in October, 2010)
packs coordinate variables, or the special variables, weights,
and other grid properties described in <a href="#CF-Conventions">CF Conventions</a>.
Prior <code>ncpdq</code> versions treated coordinate variables and
grid properties no differently from other variables.
However, coordinate variables are one-dimensional, so packing saves
little space on large files, and the resulting files are difficult for
humans to read.
<code>ncpdq</code> will, of course, <em>unpack</em> coordinate variables and
weights, for example, in case some other, non-<acronym>NCO</acronym> software
packed them in the first place.
</p>
<p>Concurrently, Gaussian and area weights and other grid properties are
often used to derive fields in re-inflated (unpacked) files, so packing
such grid properties causes a considerable loss of precision in
downstream data processing.
If users express strong wishes to pack grid properties, we will
implement new packing policies.
An immediate workaround for those needing to pack grid properties
now, is to use the <code>ncap2</code> packing functions or to rename the
grid properties prior to calling <code>ncpdq</code>.
We welcome your feedback.
</p>
<p>To reduce required memorization of these complex policy switches,
<code>ncpdq</code> may also be invoked via a synonym or with switches
that imply a particular policy.
<code>ncpack</code> is a synonym for <code>ncpdq</code> and behaves the same
in all respects.
Both <code>ncpdq</code> and <code>ncpack</code> assume a default packing
policy request of ‘<samp>all_new</samp>’.
Hence <code>ncpack</code> may be invoked without any ‘<samp>-P</samp>’ switch,
unlike <code>ncpdq</code>.
Similarly, <code>ncunpack</code> is a synonym for <code>ncpdq</code>
except that <code>ncpack</code> implicitly assumes a request to unpack,
i.e., ‘<samp>-P pck_upk</samp>’.
<a name="index-_002dU"></a>
<a name="index-_002d_002dupk"></a>
<a name="index-_002d_002dunpack"></a>
Finally, the <code>ncpdq</code> ‘<samp>-U</samp>’ switch (or its long option
equivalents, ‘<samp>--upk</samp>’ and ‘<samp>--unpack</samp>’) requires no argument.
It simply requests unpacking.
</p>
<p>Given the menagerie of synonyms, equivalent options, and implied
options, a short list of some equivalent commands is appropriate.
The following commands are equivalent for packing:
<code>ncpdq -P all_new</code>, <code>ncpdq --pck_plc=all_new</code>, and
<code>ncpack</code>.
The following commands are equivalent for unpacking:
<code>ncpdq -P upk</code>, <code>ncpdq -U</code>, <code>ncpdq --pck_plc=unpack</code>,
and <code>ncunpack</code>.
Equivalent commands for other packing policies, e.g., ‘<samp>all_xst</samp>’,
follow by analogy.
<a name="index-alias-2"></a>
<a name="index-ln-_002ds-1"></a>
<a name="index-symbolic-links-4"></a>
Note that <code>ncpdq</code> synonyms are subject to the same constraints
and recommendations discussed in the secion on <code>ncbo</code> synonyms
(see <a href="#ncbo-netCDF-Binary-Operator">ncbo netCDF Binary Operator</a>).
That is, symbolic links must exist from the synonym to <code>ncpdq</code>,
or else the user must define an <code>alias</code>.
</p>
<a name="index-packing-map"></a>
<a name="index-pck_005fmap"></a>
<a name="index-_002dM-pck_005fmap"></a>
<a name="index-_002d_002dpck_005fmap-pck_005fmap"></a>
<a name="index-_002d_002dmap-pck_005fmap"></a>
<p>The <code>ncpdq</code> packing algorithms must know to which type
particular types of input variables are to be packed.
The correspondence between the input variable type and the output,
packed type, is called the <em>packing map</em>.
The user specifies the desired packing map with the ‘<samp>-M</samp>’ switch
(or its long option equivalents, ‘<samp>--pck_map</samp>’ and
‘<samp>--map</samp>’) and its <var>pck_map</var> argument.
Five packing maps are currently implemented:<br>
<a name="index-hgh_005fsht"></a>
<a name="index-hgh_005fbyt"></a>
<a name="index-flt_005fsht"></a>
<a name="index-flt_005fbyt"></a>
<a name="index-nxt_005flsr"></a>
<a name="index-NC_005fDOUBLE-1"></a>
<a name="index-NC_005fFLOAT"></a>
<a name="index-NC_005fINT64-1"></a>
<a name="index-NC_005fUINT64-1"></a>
<a name="index-NC_005fINT"></a>
<a name="index-NC_005fUINT-1"></a>
<a name="index-NC_005fSHORT"></a>
<a name="index-NC_005fUSHORT-1"></a>
<a name="index-NC_005fCHAR-2"></a>
<a name="index-NC_005fBYTE"></a>
<a name="index-NC_005fUBYTE-1"></a>
</p><dl compact="compact">
<dt><em>Pack Floating Precisions to <code>NC_SHORT</code> [<em>default</em>]</em></dt>
<dd><p>Definition: Pack floating precision types to <code>NC_SHORT</code><br>
Map: Pack [<code>NC_DOUBLE</code>,<code>NC_FLOAT</code>] to <code>NC_SHORT</code><br>
Types copied instead of packed: [<code>NC_INT64</code>,<code>NC_UINT64</code>,<code>NC_INT</code>,<code>NC_UINT</code>,<code>NC_SHORT</code>,<code>NC_USHORT</code>,<code>NC_CHAR</code>,<code>NC_BYTE</code>,<code>NC_UBYTE</code>]<br>
<var>pck_map</var> key values: ‘<samp>flt_sht</samp>’, ‘<samp>pck_map_flt_sht</samp>’<br>
</p></dd>
<dt><em>Pack Floating Precisions to <code>NC_BYTE</code></em></dt>
<dd><p>Definition: Pack floating precision types to <code>NC_BYTE</code><br>
Map: Pack [<code>NC_DOUBLE</code>,<code>NC_FLOAT</code>] to <code>NC_BYTE</code><br>
Types copied instead of packed: [<code>NC_INT64</code>,<code>NC_UINT64</code>,<code>NC_INT</code>,<code>NC_UINT</code>,<code>NC_SHORT</code>,<code>NC_USHORT</code>,<code>NC_CHAR</code>,<code>NC_BYTE</code>,<code>NC_UBYTE</code>]<br>
<var>pck_map</var> key values: ‘<samp>flt_byt</samp>’, ‘<samp>pck_map_flt_byt</samp>’<br>
</p></dd>
<dt><em>Pack Higher Precisions to <code>NC_SHORT</code></em></dt>
<dd><p>Definition: Pack higher precision types to <code>NC_SHORT</code><br>
Map:
Pack [<code>NC_DOUBLE</code>,<code>NC_FLOAT</code>,<code>NC_INT64</code>,<code>NC_UINT64</code>,<code>NC_INT</code>,<code>NC_UINT</code>] to <code>NC_SHORT</code><br>
Types copied instead of packed: [<code>NC_SHORT</code>,<code>NC_USHORT</code>,<code>NC_CHAR</code>,<code>NC_BYTE</code>,<code>NC_UBYTE</code>]<br>
<var>pck_map</var> key values: ‘<samp>hgh_sht</samp>’, ‘<samp>pck_map_hgh_sht</samp>’<br>
</p></dd>
<dt><em>Pack Higher Precisions to <code>NC_BYTE</code></em></dt>
<dd><p>Definition: Pack higher precision types to <code>NC_BYTE</code><br>
Map:
Pack [<code>NC_DOUBLE</code>,<code>NC_FLOAT</code>,<code>NC_INT64</code>,<code>NC_UINT64</code>,<code>NC_INT</code>,<code>NC_UINT</code>,<code>NC_SHORT</code>,<code>NC_USHORT</code>] to <code>NC_BYTE</code><br>
Types copied instead of packed: [<code>NC_CHAR</code>,<code>NC_BYTE</code>,<code>NC_UBYTE</code>]<br>
<var>pck_map</var> key values: ‘<samp>hgh_byt</samp>’, ‘<samp>pck_map_hgh_byt</samp>’<br>
</p></dd>
<dt><em>Pack to Next Lesser Precision</em></dt>
<dd><p>Definition: Pack each type to type of next lesser size<br>
Map: Pack [<code>NC_DOUBLE</code>,<code>NC_INT64</code>,<code>NC_UINT64</code>], to <code>NC_INT</code>.
Pack [<code>NC_FLOAT</code>,<code>NC_INT</code>,<code>NC_UINT</code>] to <code>NC_SHORT</code>.
Pack [<code>NC_SHORT</code>,<code>NC_USHORT</code>] to <code>NC_BYTE</code>.<br>
Types copied instead of packed: [<code>NC_CHAR</code>,<code>NC_BYTE</code>,<code>NC_UBYTE</code>]<br>
<var>pck_map</var> key values: ‘<samp>nxt_lsr</samp>’, ‘<samp>pck_map_nxt_lsr</samp>’<br>
</p></dd>
</dl>
<p>The default ‘<samp>all_new</samp>’ packing policy with the default
‘<samp>flt_sht</samp>’ packing map reduces the typical <code>NC_FLOAT</code>-dominated
file size by about 50%.<!-- /@w -->
‘<samp>flt_byt</samp>’ packing reduces an <code>NC_DOUBLE</code>-dominated file by
about 87%.<!-- /@w -->
</p>
<a name="index-_005fFillValue-4"></a>
<a name="index-_005fFillValue-5"></a>
<a name="index-NUL-1"></a>
<p>The netCDF packing algorithm (see <a href="#Methods-and-functions">Methods and functions</a>) is
lossy—once packed, the exact original data cannot be recovered without
a full backup.
Hence users should be aware of some packing caveats:
First, the interaction of packing and data equal to the
<var>_FillValue</var> is complex.
Test the <code>_FillValue</code> behavior by performing a pack/unpack cycle
to ensure data that are missing <em>stay</em> missing and data that are
not misssing do not join the Air National Guard and go missing.
This may lead you to elect a new <var>_FillValue</var>.
Second, <code>ncpdq</code> actually allows packing into <code>NC_CHAR</code> (with,
e.g., ‘<samp>flt_chr</samp>’).
However, the intrinsic conversion of <code>signed char</code> to higher
precision types is tricky for values equal to zero, i.e., for
<code>NUL</code>.
Hence packing to <code>NC_CHAR</code> is not documented or advertised.
Pack into <code>NC_BYTE</code> (with, e.g., ‘<samp>flt_byt</samp>’) instead.
</p>
<a name="rvr"></a> <!-- http://nco.sf.net/nco.html#rvr --><a name="Dimension-Permutation"></a>
<h4 class="unnumberedsubsec">Dimension Permutation</h4>
<p><code>ncpdq</code> re-shapes variables in <var>input-file</var> by re-ordering
and/or reversing dimensions specified in the dimension list.
The dimension list is a whitespace-free, comma separated list of
dimension names, optionally prefixed by negative signs, that follows the
‘<samp>-a</samp>’ (or long options ‘<samp>--arrange</samp>’, ‘<samp>--permute</samp>’,
‘<samp>--re-order</samp>’, or ‘<samp>--rdr</samp>’) switch.
To re-order variables by a subset of their dimensions, specify
these dimensions in a comma-separated list following ‘<samp>-a</samp>’, e.g.,
‘<samp>-a lon,lat</samp>’.
To reverse a dimension, prefix its name with a negative sign in the
dimension list, e.g., ‘<samp>-a -lat</samp>’.
Re-ordering and reversal may be performed simultaneously, e.g.,
‘<samp>-a lon,-lat,time,-lev</samp>’.
</p>
<a name="index-record-dimension-9"></a>
<p>Users may specify any permutation of dimensions, including
permutations which change the record dimension identity.
The record dimension is re-ordered like any other dimension.
<a name="index-concatenation-2"></a>
<a name="index-record-dimension-10"></a>
This unique <code>ncpdq</code> capability makes it possible to concatenate
files along any dimension.
See <a href="#Concatenation">Concatenation</a> for a detailed example.
<a name="index-record-variable-1"></a>
The record dimension is always the most slowly varying dimension in a
record variable (see <a href="#C-and-Fortran-Index-Conventions">C and Fortran Index Conventions</a>).
The specified re-ordering fails if it requires creating more than
one record dimension amongst all the output variables
<a name="DOCF59" href="#FOOT59"><sup>59</sup></a>.
</p>
<p>Two special cases of dimension re-ordering and reversal deserve special
mention.
First, it may be desirable to completely reverse the storage order of a
variable.
To do this, include all the variable’s dimensions in the dimension
re-order list in their original order, and prefix each dimension name
with the negative sign.
<a name="index-transpose-1"></a>
Second, it may useful to transpose a variable’s storage order, e.g.,
from C<!-- /@w --> to Fortran data storage order
(see <a href="#C-and-Fortran-Index-Conventions">C and Fortran Index Conventions</a>).
To do this, include all the variable’s dimensions in the dimension
re-order list in reversed order.
Explicit examples of these two techniques appear below.
</p>
<a name="xmp_ncpdq"></a> <!-- http://nco.sf.net/nco.html#xmp_ncpdq --><p>EXAMPLES
</p>
<p>Pack and unpack all variables in file <samp>in.nc</samp> and store the results
in <samp>out.nc</samp>:
</p><div class="example">
<pre class="example">ncpdq in.nc out.nc # Same as ncpack in.nc out.nc
ncpdq -P all_new -M flt_sht in.nc out.nc # Defaults
ncpdq -P all_xst in.nc out.nc
ncpdq -P upk in.nc out.nc # Same as ncunpack in.nc out.nc
ncpdq -U in.nc out.nc # Same as ncunpack in.nc out.nc
</pre></div>
<p>The first two commands pack any unpacked variable in the input file.
They also unpack and then re-pack every packed variable.
The third command only packs unpacked variables in the input file.
If a variable is already packed, the third command copies it unchanged
to the output file.
The fourth and fifth commands unpack any packed variables.
If a variable is not packed, the third command copies it unchanged.
</p>
<p>The previous examples all utilized the default packing map.
Suppose you wish to archive all data that are currently unpacked
into a form which only preserves 256 distinct values.
Then you could specify the packing map <var>pck_map</var> as ‘<samp>hgh_byt</samp>’
and the packing policy <var>pck_plc</var> as ‘<samp>all_xst</samp>’:
</p><div class="example">
<pre class="example">ncpdq -P all_xst -M hgh_byt in.nc out.nc
</pre></div>
<a name="index-appending-variables-3"></a>
<a name="index-_002dA-3"></a>
<a name="index-_002dv"></a>
<p>Many different packing maps may be used to construct a given file
by performing the packing on subsets of variables (e.g., with ‘<samp>-v</samp>’)
and using the append feature with ‘<samp>-A</samp>’ (see <a href="#Appending-Variables">Appending Variables</a>).
</p>
<p>Users may wish to unpack data packed with the <acronym>HDF</acronym> convention,
and then re-pack it with the netCDF convention so that all their
datasets use the same packing convention prior to intercomparison.
<a name="index-ncl_005fconvert2nc"></a>
<a name="index-NCL-1"></a>
</p><div class="example">
<pre class="example"># One-step procedure: For NCO 4.4.0+, netCDF 4.3.1+
# 1. Convert, unpack, and repack HDF file into netCDF file
ncpdq --hdf_upk -P xst_new modis.hdf modis.nc # HDF4 files
ncpdq --hdf_upk -P xst_new modis.h5 modis.nc # HDF5 files
# One-step procedure: For NCO 4.3.7--4.3.9
# 1. Convert, unpack, and repack HDF file into netCDF file
ncpdq --hdf4 --hdf_upk -P xst_new modis.hdf modis.nc # HDF4
ncpdq --hdf_upk -P xst_new modis.h5 modis.nc # HDF5
# Two-step procedure: For NCO 4.3.6 and earlier
# 1. Convert HDF file to netCDF file
ncl_convert2nc modis.hdf
# 2. Unpack using HDF convention and repack using netCDF convention
ncpdq --hdf_upk -P xst_new modis.nc modis.nc
</pre></div>
<p><acronym>NCO</acronym> now
<a name="DOCF60" href="#FOOT60"><sup>60</sup></a>
automatically detects <acronym>HDF4</acronym> files.
In this case it produces an output file <samp>modis.nc</samp> which preserves
the <acronym>HDF</acronym> packing used in the input file.
The <code>ncpdq</code> command first unpacks all packed variables using the
<acronym>HDF</acronym> unpacking algorithm (as specified by ‘<samp>--hdf_upk</samp>’),
and then repacks those same variables using the netCDF algorithm
(because that is the only algorithm <acronym>NCO</acronym> packs with).
As described above the ‘<samp>--P xst_new</samp>’ packing policy only repacks
variables that are already packed.
Not-packed variables are copied directly without loss of precision
<a name="DOCF61" href="#FOOT61"><sup>61</sup></a>.
</p>
<p>Re-order file <samp>in.nc</samp> so that the dimension <code>lon</code> always
precedes the dimension <code>lat</code> and store the results in
<samp>out.nc</samp>:
</p><div class="example">
<pre class="example">ncpdq -a lon,lat in.nc out.nc
ncpdq -v three_dmn_var -a lon,lat in.nc out.nc
</pre></div>
<p>The first command re-orders every variable in the input file.
The second command extracts and re-orders only the variable
<code>three_dmn_var</code>.
</p>
<a name="index-reverse-dimensions-1"></a>
<p>Suppose the dimension <code>lat</code> represents latitude and monotonically
increases increases from south to north.
Reversing the <code>lat</code> dimension means re-ordering the data so that
latitude values decrease monotonically from north to south.
Accomplish this with
</p><div class="example">
<pre class="example">% ncpdq -a -lat in.nc out.nc
% ncks -C -v lat in.nc
lat[0]=-90
lat[1]=90
% ncks -C -v lat out.nc
lat[0]=90
lat[1]=-90
</pre></div>
<p>This operation reversed the latitude dimension of all variables.
Whitespace immediately preceding the negative sign that specifies
dimension reversal may be dangerous.
<a name="index-long-options-1"></a>
<a name="index-quotes-3"></a>
Quotes and long options can help protect negative signs that should
indicate dimension reversal from being interpreted by the shell as
dashes that indicate new command line switches.
</p><div class="example">
<pre class="example">ncpdq -a -lat in.nc out.nc # Dangerous? Whitespace before "-lat"
ncpdq -a '-lat' in.nc out.nc # OK. Quotes protect "-" in "-lat"
ncpdq -a lon,-lat in.nc out.nc # OK. No whitespace before "-"
ncpdq --rdr=-lat in.nc out.nc # Preferred. Uses "=" not whitespace
</pre></div>
<a name="index-reverse-dimensions-2"></a>
<p>To create the mathematical transpose of a variable, place all its
dimensions in the dimension re-order list in reversed order.
This example creates the transpose of <code>three_dmn_var</code>:
</p><div class="example">
<pre class="example">% ncpdq -a lon,lev,lat -v three_dmn_var in.nc out.nc
% ncks -C -v three_dmn_var in.nc
lat[0]=-90 lev[0]=100 lon[0]=0 three_dmn_var[0]=0
lat[0]=-90 lev[0]=100 lon[1]=90 three_dmn_var[1]=1
lat[0]=-90 lev[0]=100 lon[2]=180 three_dmn_var[2]=2
...
lat[1]=90 lev[2]=1000 lon[1]=90 three_dmn_var[21]=21
lat[1]=90 lev[2]=1000 lon[2]=180 three_dmn_var[22]=22
lat[1]=90 lev[2]=1000 lon[3]=270 three_dmn_var[23]=23
% ncks -C -v three_dmn_var out.nc
lon[0]=0 lev[0]=100 lat[0]=-90 three_dmn_var[0]=0
lon[0]=0 lev[0]=100 lat[1]=90 three_dmn_var[1]=12
lon[0]=0 lev[1]=500 lat[0]=-90 three_dmn_var[2]=4
...
lon[3]=270 lev[1]=500 lat[1]=90 three_dmn_var[21]=19
lon[3]=270 lev[2]=1000 lat[0]=-90 three_dmn_var[22]=11
lon[3]=270 lev[2]=1000 lat[1]=90 three_dmn_var[23]=23
</pre></div>
<a name="index-reverse-data"></a>
<p>To completely reverse the storage order of a variable, include
all its dimensions in the re-order list, each prefixed by a negative
sign.
This example reverses the storage order of <code>three_dmn_var</code>:
</p><div class="example">
<pre class="example">% ncpdq -a -lat,-lev,-lon -v three_dmn_var in.nc out.nc
% ncks -C -v three_dmn_var in.nc
lat[0]=-90 lev[0]=100 lon[0]=0 three_dmn_var[0]=0
lat[0]=-90 lev[0]=100 lon[1]=90 three_dmn_var[1]=1
lat[0]=-90 lev[0]=100 lon[2]=180 three_dmn_var[2]=2
...
lat[1]=90 lev[2]=1000 lon[1]=90 three_dmn_var[21]=21
lat[1]=90 lev[2]=1000 lon[2]=180 three_dmn_var[22]=22
lat[1]=90 lev[2]=1000 lon[3]=270 three_dmn_var[23]=23
% ncks -C -v three_dmn_var out.nc
lat[0]=90 lev[0]=1000 lon[0]=270 three_dmn_var[0]=23
lat[0]=90 lev[0]=1000 lon[1]=180 three_dmn_var[1]=22
lat[0]=90 lev[0]=1000 lon[2]=90 three_dmn_var[2]=21
...
lat[1]=-90 lev[2]=100 lon[1]=180 three_dmn_var[21]=2
lat[1]=-90 lev[2]=100 lon[2]=90 three_dmn_var[22]=1
lat[1]=-90 lev[2]=100 lon[3]=0 three_dmn_var[23]=0
</pre></div>
<a name="dmn_rcd_mk"></a> <!-- http://nco.sf.net/nco.html#dmn_rcd_mk -->
<a name="mk_rcd_dmn"></a> <!-- http://nco.sf.net/nco.html#mk_rcd_dmn --><p>Creating a record dimension named, e.g., <code>time</code>, in a file which
has no existing record dimension is simple with <code>ncecat</code>:
</p><div class="example">
<pre class="example">ncecat -O -u time in.nc out.nc # Create degenerate record dimension named "time"
</pre></div>
<a name="index-record-dimension-11"></a>
<p>Now consider a file with all dimensions, including <code>time</code>, fixed
(non-record).
Suppose the user wishes to convert <code>time</code> from a fixed dimension to
a record dimension.
This may be useful, for example, when the user wishes to append
additional time slices to the data.
As of <acronym>NCO</acronym> version 4.0.1 (April, 2010) the preferred method for
doing this is with <code>ncks</code>:
</p><div class="example">
<pre class="example">ncks -O --mk_rec_dmn time in.nc out.nc # Change "time" to record dimension
</pre></div>
<p>Prior to 4.0.1, the procedure to change an existing fixed dimension into
a record dimension required three separate commands,
<code>ncecat</code> followed by <code>ncpdq</code>, and then <code>ncwa</code>.
The recommended method is now to use ‘<samp>ncks --fix_rec_dmn</samp>’, yet it
is still instructive to present the original procedure, as it shows how
multiple operators can achieve the same ends by different means:
<a name="index-degenerate-dimension-6"></a>
</p><div class="example">
<pre class="example">ncecat -O in.nc out.nc # Add degenerate record dimension named "record"
ncpdq -O -a time,record out.nc out.nc # Switch "record" and "time"
ncwa -O -a record out.nc out.nc # Remove (degenerate) "record"
</pre></div>
<p>The first step creates a degenerate (size equals one) record dimension
named (by default) <code>record</code>.
The second step swaps the ordering of the dimensions named <code>time</code>
and <code>record</code>.
Since <code>time</code> now occupies the position of the first (least rapidly
varying) dimension, it becomes the record dimension.
The dimension named <code>record</code> is no longer a record dimension.
The third step averages over this degenerate <code>record</code> dimension.
Averaging over a degenerate dimension does not alter the data.
The ordering of other dimensions in the file (<code>lat</code>, <code>lon</code>,
etc.) is immaterial to this procedure.
See <a href="#ncecat-netCDF-Ensemble-Concatenator">ncecat netCDF Ensemble Concatenator</a> and
<a href="#ncks-netCDF-Kitchen-Sink">ncks netCDF Kitchen Sink</a> for other methods of
changing variable dimensionality, including the record dimension.
</p>
<a name="ncra"></a> <!-- http://nco.sf.net/nco.html#ncra --><hr>
<a name="ncra-netCDF-Record-Averager"></a>
<div class="header">
<p>
Next: <a href="#ncrcat-netCDF-Record-Concatenator" accesskey="n" rel="next">ncrcat netCDF Record Concatenator</a>, Previous: <a href="#ncpdq-netCDF-Permute-Dimensions-Quickly" accesskey="p" rel="previous">ncpdq netCDF Permute Dimensions Quickly</a>, Up: <a href="#Operator-Reference-Manual" accesskey="u" rel="up">Operator Reference Manual</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#General-Index" title="Index" rel="index">Index</a>]</p>
</div>
<a name="ncra-netCDF-Record-Averager-1"></a>
<h3 class="section">4.9 <code>ncra</code> netCDF Record Averager</h3>
<a name="index-averaging-data-2"></a>
<a name="index-record-average"></a>
<a name="index-record-dimension-12"></a>
<a name="index-running-average"></a>
<a name="index-ncra-3"></a>
<p>SYNTAX
</p><div class="example">
<pre class="example">ncra [-3] [-4] [-6] [-7] [-A] [-C] [-c]
[--cnk_dmn nm,sz] [--cnk_map map] [--cnk_plc plc] [--cnk_scl sz]
[-D <var>dbg</var>] [-d <var>dim</var>,[<var>min</var>][,[<var>max</var>][,[<var>stride</var>][,[<var>subcycle</var>]]]] [-F]
[-G <var>gpe_dsc</var>] [-g <var>grp</var>[,…]] [-h] [--hdf] [--hdr_pad <var>nbr</var>]
[-L <var>dfl_lvl</var>] [-l <var>path</var>] [--mro] [-n <var>loop</var>] [--no_tmp_fl]
[-O] [-o <var>output-file</var>] [-p <var>path</var>] [-R] [-r] [--ram_all] [--rec_apn] [--rth_dbl|flt]
[-t <var>thr_nbr</var>] [--unn] [-v <var>var</var>[,…]] [-X ...] [-x] [-y <var>op_typ</var>]
[<var>input-files</var>] [<var>output-file</var>]
</pre></div>
<p>DESCRIPTION
</p>
<p><code>ncra</code> averages record variables across an arbitrary number of
<var>input-files</var>.
<a name="index-degenerate-dimension-7"></a>
<a name="index-record-dimension-13"></a>
The record dimension is, by default, retained as a degenerate
(size 1)<!-- /@w --> dimension in the output variables.
See <a href="#Statistics-vs_002e-Concatenation">Statistics vs. Concatenation</a>, for a description of the
distinctions between the various statistics tools and concatenators.
<a name="index-multi_002dfile-operators-5"></a>
<a name="index-standard-input-3"></a>
<a name="index-stdin-4"></a>
As a multi-file operator, <code>ncra</code> will read the list of
<var>input-files</var> from <code>stdin</code> if they are not specified
as positional arguments on the command line
(see <a href="#Large-Numbers-of-Files">Large Numbers of Files</a>).
</p>
<p>Input files may vary in size, but each must have a record dimension.
The record coordinate, if any, should be monotonic (or else non-fatal
warnings may be generated).
<a name="index-hyperslab-4"></a>
Hyperslabs of the record dimension which include more than one file
work correctly.
<a name="index-stride-4"></a>
<code>ncra</code> supports the <var>stride</var> argument to the ‘<samp>-d</samp>’
hyperslab option (see <a href="#Hyperslabs">Hyperslabs</a>) for the record dimension only,
<var>stride</var> is not supported for non-record dimensions.
</p>
<p><code>ncra</code> weights each record (e.g., time slice) in the
<var>input-files</var> equally.
<code>ncra</code> does not attempt to see if, say, the <code>time</code>
coordinate is irregularly spaced and thus would require a weighted
average in order to be a true time average.
<a name="index-operation-types-1"></a>
<code>ncra</code> <em>always averages</em> coordinate variables regardless of
the arithmetic operation type performed on the non-coordinate variables.
(see <a href="#Operation-Types">Operation Types</a>).
</p>
<a name="xmp_ncra"></a> <!-- http://nco.sf.net/nco.html#xmp_ncra --><p>EXAMPLES
</p>
<p>Average files <samp>85.nc</samp>, <samp>86.nc</samp>, … <samp>89.nc</samp><!-- /@w -->
along the record dimension, and store the results in <samp>8589.nc</samp>:
<a name="index-globbing-5"></a>
<a name="index-NINTAP-1"></a>
<a name="index-Processor"></a>
<a name="index-CCM-Processor-1"></a>
</p><div class="example">
<pre class="example">ncra 85.nc 86.nc 87.nc 88.nc 89.nc 8589.nc
ncra 8[56789].nc 8589.nc
ncra -n 5,2,1 85.nc 8589.nc
</pre></div>
<p>These three methods produce identical answers.
See <a href="#Specifying-Input-Files">Specifying Input Files</a>, for an explanation of the distinctions
between these methods.
</p>
<a name="index-Fortran-1"></a>
<p>Assume the files <samp>85.nc</samp>, <samp>86.nc</samp>, … <samp>89.nc</samp><!-- /@w -->
each contain a record coordinate <var>time</var> of length 12 defined such
that the third record in <samp>86.nc</samp> contains data from March 1986,
etc.
<acronym>NCO</acronym> knows how to hyperslab the record dimension across files.
Thus, to average data from December, 1985 through February, 1986:
</p><div class="example">
<pre class="example">ncra -d time,11,13 85.nc 86.nc 87.nc 8512_8602.nc
ncra -F -d time,12,14 85.nc 86.nc 87.nc 8512_8602.nc
</pre></div>
<p>The file <samp>87.nc</samp> is superfluous, but does not cause an error.
The ‘<samp>-F</samp>’ turns on the Fortran (1-based) indexing convention.
<a name="index-stride-5"></a>
The following uses the <var>stride</var> option to average all the March
temperature data from multiple input files into a single output file
</p><div class="example">
<pre class="example">ncra -F -d time,3,,12 -v temperature 85.nc 86.nc 87.nc 858687_03.nc
</pre></div>
<p>See <a href="#Stride">Stride</a>, for a description of the <var>stride</var> argument.
</p>
<p>Assume the <var>time</var> coordinate is incrementally numbered such that
January, <em>1985 = 1</em><!-- /@w --> and December, <em>1989 = 60</em><!-- /@w -->.
Assuming ‘<samp>??</samp>’ only expands to the five desired files, the following
averages June, 1985–June, 1989:
</p><div class="example">
<pre class="example">ncra -d time,6.,54. ??.nc 8506_8906.nc
</pre></div>
<a name="ncrcat"></a> <!-- http://nco.sf.net/nco.html#ncrcat --><hr>
<a name="ncrcat-netCDF-Record-Concatenator"></a>
<div class="header">
<p>
Next: <a href="#ncrename-netCDF-Renamer" accesskey="n" rel="next">ncrename netCDF Renamer</a>, Previous: <a href="#ncra-netCDF-Record-Averager" accesskey="p" rel="previous">ncra netCDF Record Averager</a>, Up: <a href="#Operator-Reference-Manual" accesskey="u" rel="up">Operator Reference Manual</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#General-Index" title="Index" rel="index">Index</a>]</p>
</div>
<a name="ncrcat-netCDF-Record-Concatenator-1"></a>
<h3 class="section">4.10 <code>ncrcat</code> netCDF Record Concatenator</h3>
<a name="index-concatenation-3"></a>
<a name="index-record-concatenation"></a>
<a name="index-ncrcat-2"></a>
<p>SYNTAX
</p><div class="example">
<pre class="example">ncrcat [-3] [-4] [-6] [-7] [-A] [-C] [-c]
[--cnk_dmn nm,sz] [--cnk_map map] [--cnk_plc plc] [--cnk_scl sz]
[-D <var>dbg</var>] [-d <var>dim</var>,[<var>min</var>][,[<var>max</var>][,[<var>stride</var>][,[<var>subcycle</var>]]]] [-F]
[-G <var>gpe_dsc</var>] [-g <var>grp</var>[,…]] [-h] [--hdr_pad <var>nbr</var>]
[-L <var>dfl_lvl</var>] [-l <var>path</var>] [--md5_digest] [-n <var>loop</var>] [--no_tmp_fl]
[-O] [-o <var>output-file</var>] [-p <var>path</var>] [-R] [-r] [--ram_all] [--rec_apn]
[-t <var>thr_nbr</var>] [--unn] [-v <var>var</var>[,…]] [-X ...] [-x]
[<var>input-files</var>] [<var>output-file</var>]
</pre></div>
<p>DESCRIPTION
</p>
<p><code>ncrcat</code> concatenates record variables across an arbitrary
number of <var>input-files</var>.
<a name="index-record-dimension-14"></a>
The final record dimension is by default the sum of the lengths of the
record dimensions in the input files.
See <a href="#Statistics-vs_002e-Concatenation">Statistics vs. Concatenation</a>, for a description of the
distinctions between the various statistics tools and concatenators.
<a name="index-multi_002dfile-operators-6"></a>
<a name="index-standard-input-4"></a>
<a name="index-stdin-5"></a>
As a multi-file operator, <code>ncrcat</code> will read the list of
<var>input-files</var> from <code>stdin</code> if they are not specified
as positional arguments on the command line
(see <a href="#Large-Numbers-of-Files">Large Numbers of Files</a>).
</p>
<p>Input files may vary in size, but each must have a record dimension.
The record coordinate, if any, should be monotonic (or else non-fatal
warnings may be generated).
<a name="index-hyperslab-5"></a>
Hyperslabs along the record dimension that span more than one file are
handled correctly.
<a name="index-stride-6"></a>
<code>ncra</code> supports the <var>stride</var> argument to the ‘<samp>-d</samp>’
hyperslab option for the record dimension only, <var>stride</var> is not
supported for non-record dimensions.
</p>
<a name="index-ncpdq-5"></a>
<a name="index-packing-5"></a>
<a name="index-unpacking-4"></a>
<a name="index-add_005foffset-4"></a>
<a name="index-scale_005ffactor-3"></a>
<p>Concatenating a variable packed with different scales multiple datasets
is beyond the capabilities of <code>ncrcat</code> (and <code>ncecat</code>,
the other concatenator (<a href="#Concatenation">Concatenation</a>).
<code>ncrcat</code> does not unpack data, it simply <em>copies</em> the data
from the <var>input-files</var>, and the metadata from the <em>first</em>
<var>input-file</var>, to the <var>output-file</var>.
This means that data compressed with a packing convention must use
the identical packing parameters (e.g., <code>scale_factor</code> and
<code>add_offset</code>) for a given variable across <em>all</em> input files.
Otherwise the concatenated dataset will not unpack correctly.
The workaround for cases where the packing parameters differ across
<var>input-files</var> requires three steps:
First, unpack the data using <code>ncpdq</code>.
Second, concatenate the unpacked data using <code>ncrcat</code>,
Third, re-pack the result with <code>ncpdq</code>.
</p>
<a name="index-ARM-conventions-1"></a>
<p><code>ncrcat</code> applies special rules to <acronym>ARM</acronym> convention time
fields (e.g., <code>time_offset</code>).
See <a href="#ARM-Conventions">ARM Conventions</a> for a complete description.
</p>
<a name="xmp_ncrcat"></a> <!-- http://nco.sf.net/nco.html#xmp_ncrcat --><p>EXAMPLES
</p>
<p>Concatenate files <samp>85.nc</samp>, <samp>86.nc</samp>, … <samp>89.nc</samp><!-- /@w -->
along the record dimension, and store the results in <samp>8589.nc</samp>:
<a name="index-globbing-6"></a>
<a name="index-NINTAP-2"></a>
<a name="index-Processor-1"></a>
<a name="index-CCM-Processor-2"></a>
</p><div class="example">
<pre class="example">ncrcat 85.nc 86.nc 87.nc 88.nc 89.nc 8589.nc
ncrcat 8[56789].nc 8589.nc
ncrcat -n 5,2,1 85.nc 8589.nc
</pre></div>
<p>These three methods produce identical answers.
See <a href="#Specifying-Input-Files">Specifying Input Files</a>, for an explanation of the distinctions
between these methods.
</p>
<a name="index-Fortran-2"></a>
<p>Assume the files <samp>85.nc</samp>, <samp>86.nc</samp>, … <samp>89.nc</samp><!-- /@w -->
each contain a record coordinate <var>time</var> of length 12<!-- /@w --> defined
such that the third record in <samp>86.nc</samp> contains data from March
1986, etc.
<acronym>NCO</acronym> knows how to hyperslab the record dimension across files.
Thus, to concatenate data from December, 1985–February, 1986:
</p><div class="example">
<pre class="example">ncrcat -d time,11,13 85.nc 86.nc 87.nc 8512_8602.nc
ncrcat -F -d time,12,14 85.nc 86.nc 87.nc 8512_8602.nc
</pre></div>
<p>The file <samp>87.nc</samp> is superfluous, but does not cause an error.
When <code>ncra</code> and <code>ncrcat</code> encounter a file which does
contain any records that meet the specified hyperslab criteria, they
disregard the file and proceed to the next file without failing.
The ‘<samp>-F</samp>’ turns on the Fortran (1-based) indexing convention.
<a name="index-stride-7"></a>
</p>
<p>The following uses the <var>stride</var> option to concatenate all the March
temperature data from multiple input files into a single output file
</p><div class="example">
<pre class="example">ncrcat -F -d time,3,,12 -v temperature 85.nc 86.nc 87.nc 858687_03.nc
</pre></div>
<p>See <a href="#Stride">Stride</a>, for a description of the <var>stride</var> argument.
</p>
<p>Assume the <var>time</var> coordinate is incrementally numbered such that
January, 1985 = 1<!-- /@w --> and December, 1989 = 60.<!-- /@w -->
Assuming <code>??</code> only expands to the five desired files, the following
concatenates June, 1985–June, 1989:
</p><div class="example">
<pre class="example">ncrcat -d time,6.,54. ??.nc 8506_8906.nc
</pre></div>
<a name="ncrename"></a> <!-- http://nco.sf.net/nco.html#ncrename --><hr>
<a name="ncrename-netCDF-Renamer"></a>
<div class="header">
<p>
Next: <a href="#ncwa-netCDF-Weighted-Averager" accesskey="n" rel="next">ncwa netCDF Weighted Averager</a>, Previous: <a href="#ncrcat-netCDF-Record-Concatenator" accesskey="p" rel="previous">ncrcat netCDF Record Concatenator</a>, Up: <a href="#Operator-Reference-Manual" accesskey="u" rel="up">Operator Reference Manual</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#General-Index" title="Index" rel="index">Index</a>]</p>
</div>
<a name="ncrename-netCDF-Renamer-1"></a>
<h3 class="section">4.11 <code>ncrename</code> netCDF Renamer</h3>
<a name="index-renaming-variables"></a>
<a name="index-renaming-groups"></a>
<a name="index-renaming-dimensions"></a>
<a name="index-renaming-attributes"></a>
<a name="index-variable-names"></a>
<a name="index-dimension-names"></a>
<a name="index-attribute-names-1"></a>
<a name="index-group-names"></a>
<a name="index-ncrename-1"></a>
<p>SYNTAX
</p><div class="example">
<pre class="example">ncrename [-a <var>old_name</var>,<var>new_name</var>] [-a …] [-D <var>dbg</var>]
[-d <var>old_name</var>,<var>new_name</var>] [-d …] [-g <var>old_name</var>,<var>new_name</var>] [-g …]
[-h] [--hdf] [--hdr_pad <var>nbr</var>] [-l <var>path</var>] [-O] [-o <var>output-file</var>] [-p <var>path</var>] [-R] [-r]
[-v <var>old_name</var>,<var>new_name</var>] [-v …]
<var>input-file</var> [[<var>output-file</var>]]
</pre></div>
<p>DESCRIPTION
</p>
<a name="index-_002e"></a>
<p><code>ncrename</code> renames netCDF dimensions, variables, attributes, and
groups.
Each object that has a name in the list of old names is renamed using
the corresponding name in the list of new names.
All the new names must be unique.
Every old name must exist in the input file, unless the old name is
preceded by the period (or “dot”) character ‘<samp>.</samp>’.
The validity of <var>old_name</var> is not checked prior to the renaming.
Thus, if <var>old_name</var> is specified without the the ‘<samp>.</samp>’ prefix and
is not present in <var>input-file</var>, <code>ncrename</code> will abort.
The <var>new_name</var> should never be prefixed by a ‘<samp>.</samp>’ (or else the
period will be included as part of the new name).
The OPTIONS and EXAMPLES show how to select specific variables
whose attributes are to be renamed.
</p>
<p>Although <code>ncrename</code> supports full pathnames for both
<var>old_name</var> and <var>new_name</var>, this is really “window dressing”.
The full-path to <var>new_name</var> must be identical to the full-path to
<var>old_name</var> in all classes of objects (attributes, variables,
dimensions, or groups).
In other words, <code>ncrename</code> can change only the local names
of objects, it cannot change the location of the object in the group
hierarchy within the file.
Hence using a full-path in <var>new_name</var> is redundant.
The object name is the terminal path component of <var>new_name</var> and
this object must already exist in the group specified by the
<var>old_name</var> path.
</p>
<a name="index-data-safety-1"></a>
<a name="index-safeguards-1"></a>
<a name="index-temporary-output-files-2"></a>
<p><code>ncrename</code> is an exception to the normal <acronym>NCO</acronym> rule that
the user will be interactively prompted before an existing file is
changed, and that a temporary copy of an output file is constructed
during the operation.
If only <var>input-file</var> is specified, then <code>ncrename</code> changes
the names of the <var>input-file</var> in place without prompting and without
creating a temporary copy of <code>input-file</code>.
This is because the renaming operation is considered reversible if the
user makes a mistake.
The <var>new_name</var> can easily be changed back to <var>old_name</var> by using
<code>ncrename</code> one more time.
</p>
<p>Note that renaming a dimension to the name of a dependent variable can
be used to invert the relationship between an independent coordinate
variable and a dependent variable.
In this case, the named dependent variable must be one-dimensional and
should have no missing values.
Such a variable will become a coordinate variable.
</p>
<a name="index-performance-6"></a>
<a name="index-operator-speed-5"></a>
<a name="index-speed-6"></a>
<a name="index-execution-time-5"></a>
<p>According to the <cite>netCDF User Guide</cite>, renaming properties in
netCDF files does not incur the penalty of recopying the entire file
when the <var>new_name</var> is shorter than the <var>old_name</var>.
</p>
<p>OPTIONS
</p>
<dl compact="compact">
<dt>‘<samp>-a <var>old_name</var>,<var>new_name</var></samp>’</dt>
<dd><p>Attribute renaming.
The old and new names of the attribute are specified with ‘<samp>-a</samp>’
(or ‘<samp>--attribute</samp>’) by the associated <var>old_name</var> and
<var>new_name</var> values.
<a name="index-global-attribute-1"></a>
<a name="index-global-attributes-9"></a>
<a name="index-attributes_002c-global-9"></a>
Global attributes are treated no differently than variable attributes.
This option may be specified more than once.
As mentioned above, all occurrences of the attribute of a given name
will be renamed unless the ‘<samp>.</samp>’ form is used, with one exception.
To change the attribute name for a particular variable, specify
the <var>old_name</var> in the format <var>old_var_name@old_att_name</var>.
The ‘<samp>@</samp>’ symbol delimits the variable from the attribute name.
If the attribute is uniquely named (no other variables contain the
attribute) then the <var>old_var_name@old_att_name</var> syntax is
redundant.
The <var>var_nm</var> <code>global</code> has special significance—it indicates
that <var>att_nm</var> refers to a global or group attribute, and not to a
variable named <code>global</code>.
In other words, a <var>var_nm</var> of <code>global</code> is syntactically
equivalent to a <var>var_nm</var> that is empty.
The <var>var_name@att_name</var> syntax is accepted, though not required,
for the <var>new_name</var>.
</p>
</dd>
<dt>‘<samp>-d <var>old_name</var>,<var>new_name</var></samp>’</dt>
<dd><p>Dimension renaming.
The old and new names of the dimension are specified with ‘<samp>-d</samp>’
(or ‘<samp>--dmn</samp>’, ‘<samp>--dimension</samp>’) by the associated <var>old_name</var>
and <var>new_name</var> values.
This option may be specified more than once.
</p>
</dd>
<dt>‘<samp>-g <var>old_name</var>,<var>new_name</var></samp>’</dt>
<dd><p>Group renaming.
The old and new names of the group are specified with ‘<samp>-g</samp>’
(or ‘<samp>--grp</samp>’, ‘<samp>--group</samp>’) by the associated <var>old_name</var>
and <var>new_name</var> values.
This option may be specified more than once.
This functionality is only available in <acronym>NCO</acronym> version 4.3.7
(October, 2013) or later, and only when built on netCDF library version
4.3.1-rc1 (August, 2013) or later.
</p>
</dd>
<dt>‘<samp>-v <var>old_name</var>,<var>new_name</var></samp>’</dt>
<dd><p>Variable renaming.
The old and new names of the variable are specified with ‘<samp>-v</samp>’
(or ‘<samp>--variable</samp>’) by the associated <var>old_name</var> and
<var>new_name</var> values.
This option may be specified more than once.
</p></dd>
</dl>
<a name="xmp_ncrename"></a> <!-- http://nco.sf.net/nco.html#xmp_ncrename --><p>EXAMPLES
</p>
<p>Rename the variable <code>p</code> to <code>pressure</code> and <code>t</code> to
<code>temperature</code> in netCDF <samp>in.nc</samp>.
In this case <code>p</code> must exist in the input file (or
<code>ncrename</code> will abort), but the presence of <code>t</code> is optional:
</p><div class="example">
<pre class="example">ncrename -v p,pressure -v .t,temperature in.nc
</pre></div>
<p>Rename the attribute <code>long_name</code> to <code>largo_nombre</code> in the
variable <code>u</code>, and no other variables in netCDF <samp>in.nc</samp>.
</p><div class="example">
<pre class="example">ncrename -a u@long_name,largo_nombre in.nc
</pre></div>
<p>Rename the group <code>g8</code> to <code>g20</code> in netCDF4 file
<samp>in_grp.nc</samp>:
</p><div class="example">
<pre class="example">ncrename -g g8,g20 in_grp.nc
</pre></div>
<p>Rename the variable <code>/g1/lon</code> to <code>longitude</code> in netCDF4
<samp>in_grp.nc</samp>:
</p><div class="example">
<pre class="example">ncrename -v /g1/lon,longitude in_grp.nc
ncrename -v /g1/lon,/g1/longitude in_grp.nc # Alternate
</pre></div>
<a name="ncrename_crd"></a> <!-- http://nco.sf.net/nco.html#ncrename_crd --><a name="index-coordinate-variables"></a>
<p><code>ncrename</code> does not automatically attach dimensions to variables of
the same name.
This is done to make renaming an easy way to change whether a variable
is a coordinate.
If you want to rename a coordinate variable so that it remains a
coordinate variable, you must separately rename both the dimension and
the variable:
</p><div class="example">
<pre class="example">ncrename -d lon,longitude -v lon,longitude in.nc
</pre></div>
<p>Unfortunately, the netCDF4 library has a longstanding bug (all versions
until 4.3.1-rc5 released in December, 2013) that causes <acronym>NCO</acronym> to
crash when performing this operation.
Simultaneously renaming variables and dimensions in netCDF4 files with
earlier versions of netCDF is impossible; it must instead be done in two
separate <code>ncrename</code> invocations (e.g., first rename the
variable, then the dimension) to avoid triggering the libary bug.
</p>
<p>A related bug causes unintended side-effects with <code>ncrename</code>
also built with all versions of the netCDF4 library until 4.3.1-rc5
released in December, 2013):
Renaming <em>either</em> a dimension <em>or</em> its assosiated
coordinate variable (not both, which would fail as above) in a netCDF4
file inadvertently <em>does</em> rename both:
</p><div class="example">
<pre class="example"># Demonstate bug in netCDF4/HDF5 library prior to netCDF-4.3.1-rc5
ncks -O -h -m -M -4 -v lat_T42 ~/nco/data/in.nc ~/foo.nc
ncrename -O -v lat_T42,lat ~/foo.nc ~/foo2.nc # Also renames dimension
ncrename -O -d lat_T42,lat ~/foo.nc ~/foo2.nc # Also renames variable
</pre></div>
<p>To avoid this faulty behavior, either build <acronym>NCO</acronym> with netCDF
version 4.3.1-rc5 or later, or convert the file to netCDF3 first,
then rename as intended, then convert back.
</p>
<a name="index-global-attributes-10"></a>
<a name="index-attributes_002c-global-10"></a>
<a name="index-_005fFillValue-6"></a>
<a name="index-missing_005fvalue-2"></a>
<p>Create netCDF <samp>out.nc</samp> identical to <samp>in.nc</samp> except the
attribute <code>_FillValue</code> is changed to <code>missing_value</code>,
the attribute <code>units</code> is changed to <code>CGS_units</code> (but only in
those variables which possess it), the attribute <code>hieght</code> is
changed to <code>height</code> in the variable <code>tpt</code>, and in the
variable <code>prs_sfc</code>, if it exists.
</p><div class="example">
<pre class="example">ncrename -a _FillValue,missing_value -a .units,CGS_units \
-a tpt@hieght,height -a prs_sfc@.hieght,height in.nc out.nc
</pre></div>
<p>The presence and absence of the ‘<samp>.</samp>’ and ‘<samp>@</samp>’ features
cause this command to execute successfully only if a number of
conditions are met.
All variables <em>must</em> have a <code>_FillValue</code> attribute <em>and</em>
<code>_FillValue</code> must also be a global attribute.
The <code>units</code> attribute, on the other hand, will be renamed to
<code>CGS_units</code> wherever it is found but need not be present in
the file at all (either as a global or a variable attribute).
The variable <code>tpt</code> must contain the <code>hieght</code> attribute.
The variable <code>prs_sfc</code> need not exist, and need not contain the
<code>hieght</code> attribute.
</p>
<p>Rename the global or group attribute <code>Convention</code> to
<code>Conventions</code>
</p><div class="example">
<pre class="example">ncrename -a Convention,Conventions in.nc # Variable and global atts.
ncrename -a .Convention,Conventions in.nc # Variable and global atts.
ncrename -a @Convention,Conventions in.nc # Global atts. only
ncrename -a @.Convention,Conventions in.nc # Global atts. only
ncrename -a global@Convention,Conventions in.nc # Global atts. only
ncrename -a .global@.Convention,Conventions in.nc # Global atts. only
</pre></div>
<p>The examples without the <code>@</code> character attempt to change the
attribute name in both Global or Group and variable attributes.
The examples with the <code>@</code> character attempt to change only
global and group <code>Convention</code> attributes, and leave unchanged any
<code>Convention</code> attributes attached directly to variables.
Attributes prefixed with a period (<code>.Convention</code>) need not be
present.
Attributes not prefixed with a period (<code>Convention</code>) must be
present.
Variables prefixed with a period (<code>.</code> or <code>.global</code>) need not
be present.
Variables not prefixed with a period (<code>global</code>) must be present.
</p>
<a name="ncwa"></a> <!-- http://nco.sf.net/nco.html#ncwa --><hr>
<a name="ncwa-netCDF-Weighted-Averager"></a>
<div class="header">
<p>
Previous: <a href="#ncrename-netCDF-Renamer" accesskey="p" rel="previous">ncrename netCDF Renamer</a>, Up: <a href="#Operator-Reference-Manual" accesskey="u" rel="up">Operator Reference Manual</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#General-Index" title="Index" rel="index">Index</a>]</p>
</div>
<a name="ncwa-netCDF-Weighted-Averager-1"></a>
<h3 class="section">4.12 <code>ncwa</code> netCDF Weighted Averager</h3>
<a name="index-averaging-data-3"></a>
<a name="index-weighted-average"></a>
<a name="index-masked-average"></a>
<a name="index-broadcasting-variables-4"></a>
<a name="index-ncwa-4"></a>
<p>SYNTAX
</p><div class="example">
<pre class="example">ncwa [-3] [-4] [-6] [-7] [-A] [-a <var>dim</var>[,…]] [-B <var>mask_cond</var>] [-b] [-C] [-c]
[--cnk_dmn nm,sz] [--cnk_map map] [--cnk_plc plc] [--cnk_scl sz]
[-D <var>dbg</var>] [-d <var>dim</var>,[<var>min</var>][,[<var>max</var>][,[<var>stride</var>]]] [-F]
[-G <var>gpe_dsc</var>] [-g <var>grp</var>[,…]] [-h] [--hdr_pad <var>nbr</var>] [-I]
[-L <var>dfl_lvl</var>] [-l <var>path</var>] [-M <var>mask_val</var>] [-m <var>mask_var</var>] [-N] [--no_tmp_fl]
[-O] [-o <var>output-file</var>] [-p <var>path</var>] [-R] [-r] [--ram_all] [--rth_dbl|flt]
[-T <var>mask_comp</var>] [-t <var>thr_nbr</var>] [--unn] [-v <var>var</var>[,…]] [-w <var>weight</var>]
[-X ...] [-x] [-y <var>op_typ</var>]
<var>input-file</var> [<var>output-file</var>]
</pre></div>
<p>DESCRIPTION
</p>
<p><code>ncwa</code> averages variables in a single file over arbitrary
dimensions, with options to specify weights, masks, and normalization.
See <a href="#Statistics-vs_002e-Concatenation">Statistics vs. Concatenation</a>, for a description of the
distinctions between the various statistics tools and concatenators.
The default behavior of <code>ncwa</code> is to arithmetically average
every numerical variable over all dimensions and to produce a scalar
result for each.
</p>
<a name="index-degenerate-dimension-8"></a>
<p>Averaged dimensions are, by default, eliminated as dimensions.
Their corresponding coordinates, if any, are output as scalar
variables.
The ‘<samp>-b</samp>’ switch (and its long option equivalents ‘<samp>--rdd</samp>’ and
‘<samp>--retain-degenerate-dimensions</samp>’) causes <code>ncwa</code> to retain
averaged dimensions as degenerate (size 1<!-- /@w -->) dimensions.
This maintains the association between a dimension (or coordinate) and
variables after averaging and simplifies, for instance, later
concatenation along the degenerate dimension.
</p>
<p>To average variables over only a subset of their dimensions, specify
these dimensions in a comma-separated list following ‘<samp>-a</samp>’, e.g.,
‘<samp>-a time,lat,lon</samp>’.
<a name="index-arithmetic-operators-2"></a>
<a name="index-hyperslab-6"></a>
<a name="index-_002dd-dim_002c_005bmin_005d_005b_002c_005bmax_005d_005d"></a>
As with all arithmetic operators, the operation may be restricted to
an arbitrary hypserslab by employing the ‘<samp>-d</samp>’ option
(see <a href="#Hyperslabs">Hyperslabs</a>).
<code>ncwa</code> also handles values matching the variable’s
<code>_FillValue</code> attribute correctly.
Moreover, <code>ncwa</code> understands how to manipulate user-specified
weights, masks, and normalization options.
With these options, <code>ncwa</code> can compute sophisticated averages
(and integrals) from the command line.
</p>
<a name="-w"></a> <!-- http://nco.sf.net/nco.html#-w -->
<a name="wgt"></a> <!-- http://nco.sf.net/nco.html#wgt --><a name="index-_002dw-weight"></a>
<a name="index-_002d_002dweight-weight"></a>
<a name="index-_002d_002dwgt_005fvar-weight"></a>
<a name="index-_002dm-mask_005fvar"></a>
<a name="index-_002d_002dmask_002dvariable-mask_005fvar"></a>
<a name="index-_002d_002dmask_005fvariable-mask_005fvar"></a>
<a name="index-_002d_002dmsk_005fnm-mask_005fvar"></a>
<a name="index-_002d_002dmsk_005fvar-mask_005fvar"></a>
<a name="index-_002dB-mask_005fcond"></a>
<a name="index-_002d_002dmsk_005fcnd-mask_005fcond"></a>
<a name="index-_002d_002dmask_005fcondition-mask_005fcond"></a>
<p><var>mask_var</var> and <var>weight</var>, if specified, are broadcast to conform
to the variables being averaged.
<a name="index-rank-4"></a>
The rank of variables is reduced by the number of dimensions which they
are averaged over.
Thus arrays which are one dimensional in the <var>input-file</var> and are
averaged by <code>ncwa</code> appear in the <var>output-file</var> as scalars.
This allows the user to infer which dimensions may have been averaged.
Note that that it is impossible for <code>ncwa</code> to make make a
<var>weight</var> or <var>mask_var</var> of rank <var>W</var> conform to a <var>var</var> of
rank <var>V</var> if <var>W > V</var>.
This situation often arises when coordinate variables (which, by
definition, are one dimensional) are weighted and averaged.
<code>ncwa</code> assumes you know this is impossible and so <code>ncwa</code>
does not attempt to broadcast <var>weight</var> or <var>mask_var</var> to conform
to <var>var</var> in this case, nor does <code>ncwa</code> print a warning
message telling you this, because it is so common.
Specifying <var>dbg > 2</var> does cause <code>ncwa</code> to emit warnings in
these situations, however.
</p>
<p>Non-coordinate variables are always masked and weighted if specified.
Coordinate variables, however, may be treated specially.
By default, an averaged coordinate variable, e.g., <code>latitude</code>,
appears in <var>output-file</var> averaged the same way as any other variable
containing an averaged dimension.
In other words, by default <code>ncwa</code> weights and masks
coordinate variables like all other variables.
This design decision was intended to be helpful but for some
applications it may be preferable not to weight or mask coordinate
variables just like all other variables.
Consider the following arguments to <code>ncwa</code>:
<code>-a latitude -w lat_wgt -d latitude,0.,90.</code> where <code>lat_wgt</code> is
a weight in the <code>latitude</code> dimension.
Since, by default <code>ncwa</code> weights coordinate variables, the
value of <code>latitude</code> in the <var>output-file</var> depends on the weights
in <var>lat_wgt</var> and is not likely to be 45.0<!-- /@w -->, the midpoint latitude
of the hyperslab.
<a name="index-coordinate-variable-4"></a>
<a name="index-_002dI"></a>
Option ‘<samp>-I</samp>’ overrides this default behavior and causes
<code>ncwa</code> not to weight or mask coordinate variables
<a name="DOCF62" href="#FOOT62"><sup>62</sup></a>.
In the above case, this causes the value of <code>latitude</code> in the
<var>output-file</var> to be 45.0<!-- /@w -->, an appealing result.
Thus, ‘<samp>-I</samp>’ specifies simple arithmetic averages for the coordinate
variables.
In the case of latitude, ‘<samp>-I</samp>’ specifies that you prefer to archive
the arithmetic mean latitude of the averaged hyperslabs rather than the
area-weighted mean latitude.
<a name="DOCF63" href="#FOOT63"><sup>63</sup></a>.
</p>
<a name="index-average-1"></a>
<a name="index-operation-types-2"></a>
<p>As explained in See <a href="#Operation-Types">Operation Types</a>, <code>ncwa</code>
<em>always averages</em> coordinate variables regardless of the arithmetic
operation type performed on the non-coordinate variables.
This is independent of the setting of the ‘<samp>-I</samp>’ option.
The mathematical definition of operations involving rank reduction
is given above (see <a href="#Operation-Types">Operation Types</a>).
</p>
<table class="menu" border="0" cellspacing="0">
<tr><td align="left" valign="top">• <a href="#Mask-condition" accesskey="1">Mask condition</a>:</td><td> </td><td align="left" valign="top">
</td></tr>
<tr><td align="left" valign="top">• <a href="#Normalization-and-Integration" accesskey="2">Normalization and Integration</a>:</td><td> </td><td align="left" valign="top">
</td></tr>
</table>
<a name="mask"></a> <!-- http://nco.sf.net/nco.html#mask -->
<a name="msk"></a> <!-- http://nco.sf.net/nco.html#msk -->
<a name="-m"></a> <!-- http://nco.sf.net/nco.html#-m --><hr>
<a name="Mask-condition"></a>
<div class="header">
<p>
Next: <a href="#Normalization-and-Integration" accesskey="n" rel="next">Normalization and Integration</a>, Previous: <a href="#ncwa-netCDF-Weighted-Averager" accesskey="p" rel="previous">ncwa netCDF Weighted Averager</a>, Up: <a href="#ncwa-netCDF-Weighted-Averager" accesskey="u" rel="up">ncwa netCDF Weighted Averager</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#General-Index" title="Index" rel="index">Index</a>]</p>
</div>
<a name="Mask-condition-1"></a>
<h4 class="subsection">4.12.1 Mask condition</h4>
<a name="index-mask-condition"></a>
<a name="index-truth-condition"></a>
<a name="index-_002d_002dop_005frlt-mask_005fcomp"></a>
<a name="index-_002d_002dmask_005fcomparator-mask_005fcomp"></a>
<a name="index-_002d_002dmsk_005fcmp_005ftyp-mask_005fcomp"></a>
<a name="index-_002d_002dmsk_005fcnd_005fsng-mask_005fcond"></a>
<a name="index-_002d_002dmask_005fcondition-mask_005fcond-1"></a>
<a name="index-_002dB-mask_005fcond-1"></a>
<p>The mask condition has the syntax <em><var>mask_var</var></em>
<em><var>mask_comp</var></em> <em><var>mask_val</var></em>.
The preferred method to specify the mask condition is in one string with
the ‘<samp>-B</samp>’ or ‘<samp>--mask_condition</samp>’ switches.
The older method is to use the three switches ‘<samp>-m</samp>’, ‘<samp>-T</samp>’, and
‘<samp>-M</samp>’ to specify the <var>mask_var</var>, <var>mask_comp</var>, and
<var>mask_val</var>, respectively.
<a name="DOCF64" href="#FOOT64"><sup>64</sup></a>.
The <var>mask_condition</var> string is automatically parsed into its three
constituents <var>mask_var</var>, <var>mask_comp</var>, and <var>mask_val</var>.
</p>
<a name="index-comparator"></a>
<p>Here <var>mask_var</var> is the name of the masking variable (specified with
‘<samp>-m</samp>’, ‘<samp>--mask-variable</samp>’, ‘<samp>--mask_variable</samp>’,
‘<samp>--msk_nm</samp>’, or ‘<samp>--msk_var</samp>’).
The truth <var>mask_comp</var> argument (specified with ‘<samp>-T</samp>’,
‘<samp>--mask_comparator</samp>’, ‘<samp>--msk_cmp_typ</samp>’, or ‘<samp>--op_rlt</samp>’ may
be any one of the six arithmetic comparators: <kbd>eq</kbd>, <kbd>ne</kbd>,
<kbd>gt</kbd>, <kbd>lt</kbd>, <kbd>ge</kbd>, <kbd>le</kbd>.
These are the Fortran-style character abbreviations for the logical
comparisons <em>==</em>, <em>!=</em>, <em>></em>, <em><</em>, <em>>=</em>,
<em><=</em>.
The mask comparator defaults to <kbd>eq</kbd> (equality).
<a name="index-_002d_002dmask_002dvalue-mask_005fval"></a>
<a name="index-_002d_002dmask_005fvalue-mask_005fval"></a>
<a name="index-_002d_002dmsk_005fval-mask_005fval"></a>
The <var>mask_val</var> argument to ‘<samp>-M</samp>’ (or ‘<samp>--mask-value</samp>’, or
‘<samp>--msk_val</samp>’) is the right hand side of the
<em>mask condition</em>.
Thus for the <var>i</var>’th element of the hyperslab to be averaged,
the mask condition is
<em>mask(i)</em> <var>mask_comp</var> <var>mask_val</var>.
</p>
<a name="nrm"></a> <!-- http://nco.sf.net/nco.html#nrm -->
<a name="ntg"></a> <!-- http://nco.sf.net/nco.html#ntg --><hr>
<a name="Normalization-and-Integration"></a>
<div class="header">
<p>
Previous: <a href="#Mask-condition" accesskey="p" rel="previous">Mask condition</a>, Up: <a href="#ncwa-netCDF-Weighted-Averager" accesskey="u" rel="up">ncwa netCDF Weighted Averager</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#General-Index" title="Index" rel="index">Index</a>]</p>
</div>
<a name="Normalization-and-Integration-1"></a>
<h4 class="subsection">4.12.2 Normalization and Integration</h4>
<a name="index-normalization"></a>
<a name="index-_002dN"></a>
<a name="index-numerator"></a>
<a name="index-integration"></a>
<a name="index-dot-product"></a>
<p><code>ncwa</code> has one switch which controls the normalization of the
averages appearing in the <var>output-file</var>.
Short option ‘<samp>-N</samp>’ (or long options ‘<samp>--nmr</samp>’ or
‘<samp>--numerator</samp>’) prevents <code>ncwa</code> from dividing the weighted
sum of the variable (the numerator in the averaging expression) by the
weighted sum of the weights (the denominator in the averaging
expression).
Thus ‘<samp>-N</samp>’ tells <code>ncwa</code> to return just the numerator of the
arithmetic expression defining the operation (see <a href="#Operation-Types">Operation Types</a>).
</p>
<p>With this normalization option, <code>ncwa</code> can integrate variables.
Averages are first computed as sums, and then normalized to obtain the
average.
The original sum (i.e., the numerator of the expression in
<a href="#Operation-Types">Operation Types</a>) is output if default normalization is turned off
(with ‘<samp><span class="nolinebreak">-N</span></samp>’<!-- /@w -->).
This sum is the integral (not the average) over the specified
(with ‘<samp><span class="nolinebreak">-a</span></samp>’<!-- /@w -->, or all, if none are specified) dimensions.
The weighting variable, if specified (with ‘<samp><span class="nolinebreak">-w</span></samp>’<!-- /@w -->), plays the
role of the differential increment and thus permits more sophisticated
integrals (i.e., weighted sums) to be output.
For example, consider the variable
<code>lev</code> where <em><var>lev</var> = [100,500,1000]</em> weighted by
the weight <code>lev_wgt</code> where <em><var>lev_wgt</var> = [10,2,1]</em>.
<a name="index-dot-product-1"></a>
The vertical integral of <code>lev</code>, weighted by <code>lev_wgt</code>,
is the dot product of <var>lev</var> and <var>lev_wgt</var>.
That this is is 3000.0<!-- /@w --> can be seen by inspection and verified with
the integration command
</p><div class="example">
<pre class="example">ncwa -N -a lev -v lev -w lev_wgt in.nc foo.nc;ncks foo.nc
</pre></div>
<a name="xmp_ncwa"></a> <!-- http://nco.sf.net/nco.html#xmp_ncwa --><p>EXAMPLES
</p>
<p>Given file <samp>85_0112.nc</samp>:
</p><div class="example">
<pre class="example">netcdf 85_0112 {
dimensions:
lat = 64 ;
lev = 18 ;
lon = 128 ;
time = UNLIMITED ; // (12 currently)
variables:
float lat(lat) ;
float lev(lev) ;
float lon(lon) ;
float time(time) ;
float scalar_var ;
float three_dmn_var(lat, lev, lon) ;
float two_dmn_var(lat, lev) ;
float mask(lat, lon) ;
float gw(lat) ;
}
</pre></div>
<p>Average all variables in <samp>in.nc</samp> over all dimensions and store
results in <samp>out.nc</samp>:
</p><div class="example">
<pre class="example">ncwa in.nc out.nc
</pre></div>
<p>All variables in <samp>in.nc</samp> are reduced to scalars in <samp>out.nc</samp>
since <code>ncwa</code> averages over all dimensions unless otherwise
specified (with ‘<samp>-a</samp>’).
</p>
<p>Store the zonal (longitudinal) mean of <samp>in.nc</samp> in <samp>out.nc</samp>:
</p><div class="example">
<pre class="example">ncwa -a lon in.nc out1.nc
ncwa -a lon -b in.nc out2.nc
</pre></div>
<a name="index-degenerate-dimension-9"></a>
<p>The first command turns <code>lon</code> into a scalar and the second retains
<code>lon</code> as a degenerate dimension in all variables.
</p><div class="example">
<pre class="example">% ncks -C -H -v lon out1.nc
lon = 135
% ncks -C -H -v lon out2.nc
lon[0] = 135
</pre></div>
<p>In either case the tally is simply the size of <code>lon</code>, i.e., 180
for the <samp>85_0112.nc</samp> file described by the sample header above.
</p>
<a name="index-gw-1"></a>
<a name="index-Gaussian-weights"></a>
<a name="index-climate-model-5"></a>
<p>Compute the meridional (latitudinal) mean, with values weighted by
the corresponding element of <var>gw</var>
<a name="DOCF65" href="#FOOT65"><sup>65</sup></a>:
</p><div class="example">
<pre class="example">ncwa -w gw -a lat in.nc out.nc
</pre></div>
<p>Here the tally is simply the size of <code>lat</code>, or 64.<!-- /@w -->
The sum of the Gaussian weights is 2.0.<!-- /@w -->
</p>
<p>Compute the area mean over the tropical Pacific:
</p><div class="example">
<pre class="example">ncwa -w gw -a lat,lon -d lat,-20.,20. -d lon,120.,270. in.nc out.nc
</pre></div>
<p>Here the tally is
64 times 128 = 8192.
</p>
<a name="index-ORO-1"></a>
<a name="index-climate-model-6"></a>
<p>Compute the area-mean over the globe using only points for which
<var>ORO</var> < 0.5
<a name="DOCF66" href="#FOOT66"><sup>66</sup></a>:
</p><div class="example">
<pre class="example">ncwa -B 'ORO < 0.5' -w gw -a lat,lon in.nc out.nc
ncwa -m ORO -M 0.5 -T lt -w gw -a lat,lon in.nc out.nc
</pre></div>
<p>It is considerably simpler to specify the complete <var>mask_cond</var> with
the single string argument to ‘<samp>-B</samp>’ than with the three separate
switches ‘<samp>-m</samp>’, ‘<samp>-T</samp>’, and ‘<samp>-M</samp>’
<a name="DOCF67" href="#FOOT67"><sup>67</sup></a>.
If in doubt, enclose the <var>mask_cond</var> within quotes since some
of the comparators have special meanings to the shell.
</p>
<p>Assuming 70% of the gridpoints are maritime, then here the tally is
0.70 times 8192 = 5734.
</p>
<p>Compute the global annual mean over the maritime tropical Pacific:
</p><div class="example">
<pre class="example">ncwa -B 'ORO < 0.5' -w gw -a lat,lon,time \
-d lat,-20.0,20.0 -d lon,120.0,270.0 in.nc out.nc
ncwa -m ORO -M 0.5 -T lt -w gw -a lat,lon,time \
-d lat,-20.0,20.0 -d lon,120.0,270.0 in.nc out.nc
</pre></div>
<p>Further examples will use the one-switch specification of
<var>mask_cond</var>.
</p>
<p>Determine the total area of the maritime tropical Pacific, assuming
the variable <var>area</var> contains the area of each gridcell
</p><div class="example">
<pre class="example">ncwa -N -v area -B 'ORO < 0.5' -a lat,lon \
-d lat,-20.0,20.0 -d lon,120.0,270.0 in.nc out.nc
</pre></div>
<p>Weighting <var>area</var> (e.g., by <var>gw</var>) is not appropriate because
<var>area</var> is <em>already</em> area-weighted by definition.
Thus the ‘<samp>-N</samp>’ switch, or, equivalently, the ‘<samp>-y ttl</samp>’ switch,
correctly integrate the cell areas into a total regional area.
</p>
<a name="index-mask-condition-1"></a>
<a name="index-truth-condition-1"></a>
<p>Mask a file to contain <var>_FillValue</var> everywhere except where
<em><var>thr_min</var> <= <var>msk_var</var> <= <var>thr_max</var></em>:
</p><div class="example">
<pre class="example"># Set masking variable and its scalar thresholds
export msk_var='three_dmn_var_dbl' # Masking variable
export thr_max='20' # Maximum allowed value
export thr_min='10' # Minimum allowed value
ncecat -O in.nc out.nc # Wrap out.nc in degenerate "record" dimension
ncwa -O -a record -B "${msk_var} <= ${thr_max}" out.nc out.nc
ncecat -O out.nc out.nc # Wrap out.nc in degenerate "record" dimension
ncwa -O -a record -B "${msk_var} >= ${thr_min}" out.nc out.nc
</pre></div>
<p>After the first use of <code>ncwa</code>, <samp>out.nc</samp> contains
<var>_FillValue</var> where <code>${msk_var} >= ${thr_max}</code>.
The process is then repeated on the remaining data to filter out
points where <code>${msk_var} <= ${thr_min}</code>.
The resulting <samp>out.nc</samp> contains valid data only
where <em><var>thr_min</var> <= <var>msk_var</var> <= <var>thr_max</var></em>.
</p>
<a name="ctr"></a> <!-- http://nco.sf.net/nco.html#ctr --><hr>
<a name="Contributing"></a>
<div class="header">
<p>
Next: <a href="#Quick-Start" accesskey="n" rel="next">Quick Start</a>, Previous: <a href="#Operator-Reference-Manual" accesskey="p" rel="previous">Operator Reference Manual</a>, Up: <a href="#Top" accesskey="u" rel="up">Top</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#General-Index" title="Index" rel="index">Index</a>]</p>
</div>
<a name="Contributing-1"></a>
<h2 class="chapter">5 Contributing</h2>
<a name="index-contributing"></a>
<p>We welcome contributions from anyone.
The project homepage at <a href="https://sf.net/projects/nco">https://sf.net/projects/nco</a>
contains more information on how to contribute.
</p>
<a name="index-PayPal"></a>
<p>Financial contributions to <acronym>NCO</acronym> development may be made through
<a href="https://www.paypal.com/xclick/business=zender%40uci.edu&item_name=NCO+development&item_number=nco_dnt_dvl&no_note=1&tax=0&currency_code=USD">PayPal</a>.
<acronym>NCO</acronym> has been shared for over 10 years<!-- /@w --> yet only two
users have contributed any money to the developers
<a name="DOCF68" href="#FOOT68"><sup>68</sup></a>.
So you could be the third!
</p>
<a name="dvl"></a> <!-- http://nco.sf.net/nco.html#dvl -->
<a name="cnt"></a> <!-- http://nco.sf.net/nco.html#cnt -->
<a name="ppl"></a> <!-- http://nco.sf.net/nco.html#ppl --><table class="menu" border="0" cellspacing="0">
<tr><td align="left" valign="top">• <a href="#Contributors" accesskey="1">Contributors</a>:</td><td> </td><td align="left" valign="top">
</td></tr>
<tr><td align="left" valign="top">• <a href="#Proposals-for-Institutional-Funding" accesskey="2">Proposals for Institutional Funding</a>:</td><td> </td><td align="left" valign="top">
</td></tr>
</table>
<hr>
<a name="Contributors"></a>
<div class="header">
<p>
Next: <a href="#Proposals-for-Institutional-Funding" accesskey="n" rel="next">Proposals for Institutional Funding</a>, Previous: <a href="#Contributing" accesskey="p" rel="previous">Contributing</a>, Up: <a href="#Contributing" accesskey="u" rel="up">Contributing</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#General-Index" title="Index" rel="index">Index</a>]</p>
</div>
<a name="Contributors-1"></a>
<h3 class="section">5.1 Contributors</h3>
<p><acronym>NCO</acronym> would not exist without the dedicated efforts of the
remarkable software engineers who conceive, develop, and
maintain netCDF, UDUnits, and OPeNDAP.
<a name="index-Russ-Rew"></a>
<a name="index-John-Caron"></a>
<a name="index-Glenn-Davis"></a>
<a name="index-Steve-Emmerson"></a>
<a name="index-James-Gallagher"></a>
<a name="index-Ed-Hartnett"></a>
<a name="index-Dennis-Heimbigner"></a>
Since 1995 <acronym>NCO</acronym> has received support from, I believe, the
entire staff of all these projects, including
Russ Rew,
John Caron,
Glenn Davis,
Steve Emmerson,
James Gallagher,
Ed Hartnett,
and Dennis Heimbigner.
In addition to their roles in maintaining the software stack on which
<acronym>NCO</acronym> perches, Yertl-like, some of these gentlemen have advised
or contributed to <acronym>NCO</acronym> specifically. That support is
acknowledged separately below.
</p>
<a name="index-contributors"></a>
<p>The primary contributors to <acronym>NCO</acronym> development have been:
</p><dl compact="compact">
<dd><a name="index-Charlie-Zender-1"></a>
</dd>
<dt>Charlie Zender</dt>
<dd><p>All concept, design and implementation from 1995-2000.
Since then autotools, bug-squashing, <acronym>CDL</acronym>, chunking,
documentation, anchoring, recursion, <acronym>GPE</acronym>, packing,
<acronym>NCO</acronym> library redesign, <code>ncap2</code> features,
<code>ncbo</code>, <code>ncpdq</code>, SMP threading and MPI parallelization,
netCDF4 integration, external funding, project management, science
research, releases.
<a name="index-Henry-Butowsky"></a>
</p></dd>
<dt>Henry Butowsky</dt>
<dd><p>Non-linear operations and <code>min()</code>, <code>max()</code>, <code>total()</code>
support in <code>ncra</code> and <code>ncwa</code>.
Type conversion for arithmetic.
Migration to netCDF3 API.
<code>ncap2</code> parser, lexer, <acronym>GSL</acronym>-support, and I/O<!-- /@w -->.
Multislabbing algorithm.
Variable wildcarding.
Numerous hacks.
<code>ncap2</code> language.
<a name="index-Rorik-Peterson"></a>
</p></dd>
<dt>Rorik Peterson</dt>
<dd><p>Original autotool build support.
Long command-line options.
Original UDUnits support.
Debianization.
Numerous bug-fixes.
<a name="index-Daniel-Wang"></a>
</p></dd>
<dt>Daniel Wang</dt>
<dd><p>Script Workflow Analysis for MultiProcessing (SWAMP).
RPM support.
<a name="index-Harry-Mangalam"></a>
</p></dd>
<dt>Harry Mangalam</dt>
<dd><p>Benchmarking.
OPeNDAP configuration.
<a name="index-Pedro-Vicente"></a>
</p></dd>
<dt>Pedro Vicente</dt>
<dd><p>Windows Visual Studio support.
netCDF4 groups.
<a name="index-Russ-Rew-1"></a>
</p></dd>
<dt>Russ Rew</dt>
<dd><p>Advice on NCO structural algorithms
<a name="index-Brian-Mays"></a>
</p></dd>
<dt>Brian Mays</dt>
<dd><p>Original packaging for Debian <acronym>GNU</acronym>/Linux, <code>nroff</code> man pages.
<a name="index-George-Shapovalov"></a>
</p></dd>
<dt>George Shapovalov</dt>
<dd><p>Packaging for Gentoo <acronym>GNU</acronym>/Linux.
<a name="index-Bill-Kocik"></a>
</p></dd>
<dt>Bill Kocik</dt>
<dd><p>Memory management.
<a name="index-Len-Makin"></a>
</p></dd>
<dt>Len Makin</dt>
<dd><p>NEC SX architecture support.
<a name="index-Jim-Edwards"></a>
</p></dd>
<dt>Jim Edwards</dt>
<dd><p>AIX architecture support.
<a name="index-Juliana-Rew"></a>
</p></dd>
<dt>Juliana Rew</dt>
<dd><p>Compatibility with large <acronym>PID</acronym>s.
<a name="index-Karen-Schuchardt"></a>
</p></dd>
<dt>Karen Schuchardt</dt>
<dd><p>Auxiliary coordinate support.
<a name="index-Gayathri-Venkitachalam"></a>
</p></dd>
<dt>Gayathri Venkitachalam</dt>
<dd><p><acronym>MPI</acronym> implementation.
<a name="index-Scott-Capps"></a>
</p></dd>
<dt>Scott Capps</dt>
<dd><p>Large work-load testing
<a name="index-Peter-Campbell"></a>
<a name="index-Martin-Dix"></a>
<a name="index-Mark-Flanner"></a>
<a name="index-Markus-Liebig"></a>
<a name="index-Keith-Lindsay"></a>
<a name="index-Stu-Muller"></a>
<a name="index-Mike-Page"></a>
<a name="index-Martin-Schmidt"></a>
<a name="index-Lori-Sentman"></a>
<a name="index-Michael-Schulz"></a>
<a name="index-Gary-Strand"></a>
<a name="index-Andrew-Wittenberg"></a>
<a name="index-George-White"></a>
<a name="index-Remik-Ziemlinski"></a>
</p></dd>
<dt>Peter Campbell, Martin Dix, Mark Flanner, Markus Liebig, Keith Lindsay, Mike Page, Martin Schmidt, Michael Schulz, Lori Sentman, Gary Strand, George White Andrew Wittenberg, Remik Ziemlinski</dt>
<dd><p>Excellent bug reports and feature requests.
<a name="index-Daniel-Baumann"></a>
<a name="index-Nick-Bower"></a>
<a name="index-Luk-Claes"></a>
<a name="index-Barry-deFreese"></a>
<a name="index-Aleksandar-Jelenak"></a>
<a name="index-Francesco-Lovergine"></a>
<a name="index-Matej-Vela"></a>
</p></dd>
<dt>Daniel Baumann, Nick Bower, Luk Claebs, Barry deFreese, Aleksandar Jelenak, Francesco Lovergine, Matej Vela</dt>
<dd><p>Debian packaging
<a name="index-Patrice-Dumas"></a>
<a name="index-Ed-Hill"></a>
<a name="index-Orion-Powlawski"></a>
</p></dd>
<dt>Patrice Dumas, Ed Hill, Orion Poplawski</dt>
<dd><p>RedHat packaging
<a name="index-George-Shapavalov"></a>
<a name="index-Patrick-Kursawe"></a>
</p></dd>
<dt>George Shapavalov, Patrick Kursawe</dt>
<dd><p>Gentoo packaging
<a name="index-Filipe-Fernandes"></a>
</p></dd>
<dt>Filipe Fernandes</dt>
<dd><p>OpenSuse packaging
<a name="index-Alexander-Hansen"></a>
<a name="index-Takeshi-Enomoto"></a>
</p></dd>
<dt>Takeshi Enomoto, Alexander Hansen</dt>
<dd><p>Mac OS packaging
<a name="index-Eric-Blake"></a>
</p></dd>
<dt>Eric Blake</dt>
<dd><p>Autoconf/M4 help
<a name="index-Gavin-Burris"></a>
<a name="index-Kyle-Wilcox"></a>
</p></dd>
<dt>Gavin Burris, Kyle Wilcox</dt>
<dd><p>RHEL and CentOS build scripts and bug reports.
<a name="index-Andrea-Cimatoribus"></a>
</p></dd>
<dt>Andrea Cimatoribus</dt>
<dd><p><acronym>NCO</acronym> Spiral Logo
<a name="index-Martin-Otte"></a>
<a name="index-Etienne-Tourigny"></a>
</p></dd>
<dt>Martin Otte, Etienne Tourigny</dt>
<dd><p>Single bug reports and fixes
<a name="index-Wenshan-Wang"></a>
</p></dd>
<dt>Wenshan Wang</dt>
<dd><p><acronym>CMIP5</acronym> and <acronym>MODIS</acronym> processing documentation.
</p></dd>
</dl>
<p>Please let me know if your name was omitted!
</p>
<a name="prp"></a> <!-- http://nco.sf.net/nco.html#prp -->
<a name="prp_sei"></a> <!-- http://nco.sf.net/nco.html#prp_sei -->
<a name="fnd"></a> <!-- http://nco.sf.net/nco.html#fnd --><table class="menu" border="0" cellspacing="0">
<tr><td align="left" valign="top">• <a href="#Proposals-for-Institutional-Funding" accesskey="1">Proposals for Institutional Funding</a>:</td><td> </td><td align="left" valign="top">
</td></tr>
</table>
<hr>
<a name="Proposals-for-Institutional-Funding"></a>
<div class="header">
<p>
Previous: <a href="#Contributors" accesskey="p" rel="previous">Contributors</a>, Up: <a href="#Contributing" accesskey="u" rel="up">Contributing</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#General-Index" title="Index" rel="index">Index</a>]</p>
</div>
<a name="Proposals-for-Institutional-Funding-1"></a>
<h3 class="section">5.2 Proposals for Institutional Funding</h3>
<a name="index-funding"></a>
<a name="index-proposals"></a>
<a name="index-NSF"></a>
<a name="index-server_002dside-processing-1"></a>
<a name="index-Distributed-Data-Reduction-_0026-Analysis"></a>
<a name="index-Scientific-Data-Operators"></a>
<a name="index-DDRA"></a>
<a name="index-Server_002dSide-Distributed-Data-Reduction-_0026-Analysis"></a>
<a name="index-SSDDRA"></a>
<a name="index-CCSM"></a>
<a name="index-IPCC-1"></a>
<a name="index-NSF-1"></a>
<a name="index-SDO"></a>
<a name="index-SEIII"></a>
<a name="index-OptIPuter"></a>
<p><acronym>NSF</acronym> has funded a
<a href="http://nco.sf.net#prp_sei">project</a>
to improve Distributed Data Reduction & Analysis (<acronym>DDRA</acronym>) by
evolving <acronym>NCO</acronym> into a suite of Scientific Data Operators called
<acronym>SDO</acronym>.
<a name="index-parallelism-1"></a>
The two main components of this project are <acronym>NCO</acronym> parallelism
(OpenMP, <acronym>MPI</acronym>) and Server-Side <acronym>DDRA</acronym>
(<acronym>SSDDRA</acronym>) implemented through extensions to <acronym>OPeNDAP</acronym>
and netCDF4.
This project will dramatically reduce bandwidth usage for <acronym>NCO</acronym>
<acronym>DDRA</acronym>.
</p>
<a name="index-NASA"></a>
<a name="index-NRA"></a>
<a name="index-HDF-3"></a>
<p>With this first <acronym>NCO</acronym> proposal funded, the content of the
next <acronym>NCO</acronym> proposal is clear.
We are interested in obtaining <acronym>NASA</acronym> support for
<acronym>HDF</acronym>-specific enhancements to <acronym>NCO</acronym>.
We plan to submit a proposal to the next suitable <acronym>NASA</acronym>
<acronym>NRA</acronym> or <acronym>NSF</acronym> opportunity.
</p>
<p>We are considering other interesting ideas for still more proposals.
Please contact us if you wish to be involved with any future
<acronym>NCO</acronym>-related proposals.
Comments on the proposals and letters of support are also very welcome.
</p>
<a name="quicksrt"></a> <!-- http://nco.sf.net/nco.html#quicksrt --><hr>
<a name="Quick-Start"></a>
<div class="header">
<p>
Next: <a href="#CMIP5-Example" accesskey="n" rel="next">CMIP5 Example</a>, Previous: <a href="#Contributing" accesskey="p" rel="previous">Contributing</a>, Up: <a href="#Top" accesskey="u" rel="up">Top</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#General-Index" title="Index" rel="index">Index</a>]</p>
</div>
<a name="Quick-Start-1"></a>
<h2 class="chapter">6 Quick Start</h2>
<a name="index-Quick-Start"></a>
<p>Simple examples in Bash shell scripts showing how to average data with
different file structures.
Here we include monthly, seasonal and annual average with daily or
monthly data in either one file or multiple files.
</p>
<table class="menu" border="0" cellspacing="0">
<tr><td align="left" valign="top">• <a href="#Daily-data-in-one-file" accesskey="1">Daily data in one file</a>:</td><td> </td><td align="left" valign="top">
</td></tr>
<tr><td align="left" valign="top">• <a href="#Monthly-data-in-one-file" accesskey="2">Monthly data in one file</a>:</td><td> </td><td align="left" valign="top">
</td></tr>
<tr><td align="left" valign="top">• <a href="#One-time-point-one-file" accesskey="3">One time point one file</a>:</td><td> </td><td align="left" valign="top">
</td></tr>
<tr><td align="left" valign="top">• <a href="#Multiple-files-with-multiple-time-points" accesskey="4">Multiple files with multiple time points</a>:</td><td> </td><td align="left" valign="top">
</td></tr>
</table>
<hr>
<a name="Daily-data-in-one-file"></a>
<div class="header">
<p>
Next: <a href="#Monthly-data-in-one-file" accesskey="n" rel="next">Monthly data in one file</a>, Previous: <a href="#Quick-Start" accesskey="p" rel="previous">Quick Start</a>, Up: <a href="#Quick-Start" accesskey="u" rel="up">Quick Start</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#General-Index" title="Index" rel="index">Index</a>]</p>
</div>
<a name="Daily-data-in-one-file-1"></a>
<h3 class="section">6.1 Daily data in one file</h3>
<a name="index-daily-data"></a>
<p>Suppose we have daily data from Jan 1st, 1990 to Dec. 31, 2005 in the
file of <samp>in.nc</samp> with the record dimension as <code>time</code>.
</p>
<p><strong>Monthly average:</strong>
<a name="index-monthly-average"></a>
<a name="index-average-2"></a>
<a name="index-time_002daveraging-1"></a>
</p><div class="example">
<pre class="example">for yyyy in {1990..2005}; do # Loop over years
for moy in {1..12}; do # Loop over months
mm=$( printf "%02d" ${moy} ) # Change to 2-digit format
# Average specific month yyyy-mm
ncra -O -d time,"${yyyy}-${mm}-01","${yyyy}-${mm}-31" \
in.nc in_${yyyy}${mm}.nc
done
done
# Concatenate monthly files together
ncrcat -O in_??????.nc out.nc
</pre></div>
<p><strong>Annual average:</strong>
<a name="index-annual-average-from-daily-data"></a>
<a name="index-average-3"></a>
<a name="index-time_002daveraging-2"></a>
</p><div class="example">
<pre class="example">for yyyy in {1990..2005}; do # Loop over years
ncra -O -d time,"${yyyy}-01-01","${yyyy}-12-31" in.nc in_${yyyy}.nc
done
# Concatenate annual files together
ncrcat -O in_????.nc out.nc
</pre></div>
<p>The <samp>-O</samp> switch means to overwrite the pre-existing files (see <a href="#Batch-Mode">Batch Mode</a>).
The <samp>-d</samp> option is to specify the range of hyperslabs (see <a href="#Hyperslabs">Hyperslabs</a>).
There are detailed instructions on <code>ncra</code> (see <a href="#ncra-netCDF-Record-Averager">ncra netCDF Record Averager</a> and <code>ncrcat</code> (see <a href="#ncrcat-netCDF-Record-Concatenator">ncrcat netCDF Record Concatenator</a>).
<acronym>NCO</acronym> supports UDUnits so that we can use readable dates as time dimension (see <a href="#UDUnits-Support">UDUnits Support</a>).
</p>
<hr>
<a name="Monthly-data-in-one-file"></a>
<div class="header">
<p>
Next: <a href="#One-time-point-one-file" accesskey="n" rel="next">One time point one file</a>, Previous: <a href="#Daily-data-in-one-file" accesskey="p" rel="previous">Daily data in one file</a>, Up: <a href="#Quick-Start" accesskey="u" rel="up">Quick Start</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#General-Index" title="Index" rel="index">Index</a>]</p>
</div>
<a name="Monthly-data-in-one-file-1"></a>
<h3 class="section">6.2 Monthly data in one file</h3>
<a name="index-monthly-data"></a>
<p>Inside the input file <samp>in.nc</samp>, the record dimension <code>time</code> is from Jan 1990 to Dec 2005.
</p>
<p><strong>Seasonal average (e.g., DJF):</strong>
<a name="index-seasonal-average"></a>
<a name="index-average-4"></a>
<a name="index-time_002daveraging-3"></a>
</p><div class="example">
<pre class="example">ncra -O --mro -d time,"1990-12-01",,12,3 in.nc out.nc
</pre></div>
<p><strong>Annual average:</strong>
<a name="index-annual-average-from-monthly-data"></a>
<a name="index-average-5"></a>
<a name="index-time_002daveraging-4"></a>
</p><div class="example">
<pre class="example">ncra -O --mro -d time,,,12,12 in.nc out.nc
</pre></div>
<p>Here we use the subcycle feature (i.e., the number after the fourth comma: ‘<samp>3</samp>’ in the seasonal example and the second ‘<samp>12</samp>’ in the annual example)
to retrieve groups of records separated by regular intervals (see <a href="#Subcycle">Subcycle</a>).
The option <samp>--mro</samp> switches <code>ncra</code> to produce a Multi-Record Output instead of a single-record output.
For example, assume <var>snd</var> is a 3D array with dimensions <code>time</code> * <code>latitude</code> * <code>longitude</code>
and <code>time</code> includes every month from Jan. 1990 to Dec. 2005, 192 months as total, which are 16 years.
Let’s look at the following two command lines.
</p><div class="example">
<pre class="example">ncra --mro -v snd -d time,"1990-12-01",,12,3 in.nc out_mro.nc
ncra -v snd -d time,"1990-12-01",,12,3 in.nc out_sro.nc
</pre></div>
<p>In the first output file, <samp>out_mro.nc</samp>, <var>snd</var> is still a 3D array with dimensions <code>time</code> * <code>latitude</code> * <code>longitude</code>,
but the length of <code>time</code> now is 16, meaning 16 winters.
In the second output file, <samp>out_sro.nc</samp>, the length of <code>time</code> is only 1<!-- /@w -->.
It is now the average of all the 16 winters.
</p>
<p>when using ‘<samp>-d <var>dim</var>,min[,max]</samp>’ to specify the hyperslabs,
you can leave it blank if you want to include the minimum or the maximum of the data, like we did above.
</p>
<hr>
<a name="One-time-point-one-file"></a>
<div class="header">
<p>
Next: <a href="#Multiple-files-with-multiple-time-points" accesskey="n" rel="next">Multiple files with multiple time points</a>, Previous: <a href="#Monthly-data-in-one-file" accesskey="p" rel="previous">Monthly data in one file</a>, Up: <a href="#Quick-Start" accesskey="u" rel="up">Quick Start</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#General-Index" title="Index" rel="index">Index</a>]</p>
</div>
<a name="One-time-point-one-file-1"></a>
<h3 class="section">6.3 One time point one file</h3>
<a name="index-daily-data-1"></a>
<a name="index-monthly-data-1"></a>
<a name="index-average-6"></a>
<a name="index-time_002daveraging-5"></a>
<p>This means if you have daily data of 30 days, there will be 30 data files.
Or if you have monthly data of 12 months, there will be 12 data files.
Dealing with this kind of files, you need to specify the file names in shell scripts and pass them to NCO operators.
For example, your daily data files may look like <samp>snd_19900101.nc</samp>, <samp>snd_19900102.nc</samp>, <samp>snd_19900103.nc</samp> ...
If you want to know the monthly average of Jan 1990, you can write like,
</p><div class="example">
<pre class="example">ncra -O snd_199001??.nc out.nc
</pre></div>
<p>You might want to use loop if you need the average of each month.
</p><div class="example">
<pre class="example">for moy in {1..12}; do # Loop over months
mm=$( printf "%02d" ${moy} ) # Change to 2-digit format
ncra -O snd_????${mm}??.nc out_${mm}.nc
done
</pre></div>
<hr>
<a name="Multiple-files-with-multiple-time-points"></a>
<div class="header">
<p>
Previous: <a href="#One-time-point-one-file" accesskey="p" rel="previous">One time point one file</a>, Up: <a href="#Quick-Start" accesskey="u" rel="up">Quick Start</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#General-Index" title="Index" rel="index">Index</a>]</p>
</div>
<a name="Multiple-files-with-multiple-time-points-1"></a>
<h3 class="section">6.4 Multiple files with multiple time points</h3>
<a name="index-daily-data-2"></a>
<a name="index-monthly-data-2"></a>
<p>Similar as the last one, it’s more about shell scripts.
Suppose you have daily data with one month of them in one data file.
The monthly average is simply to apply <code>ncra</code> on the specific data file.
And for seasonal averages, you can specify the three months by shell scripts.
</p>
<a name="cmip5"></a> <!-- http://nco.sf.net/nco.html#cmip5 --><hr>
<a name="CMIP5-Example"></a>
<div class="header">
<p>
Next: <a href="#Parallel" accesskey="n" rel="next">Parallel</a>, Previous: <a href="#Quick-Start" accesskey="p" rel="previous">Quick Start</a>, Up: <a href="#Top" accesskey="u" rel="up">Top</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#General-Index" title="Index" rel="index">Index</a>]</p>
</div>
<a name="CMIP5-Example-1"></a>
<h2 class="chapter">7 <acronym>CMIP5</acronym> Example</h2>
<a name="index-CMIP5"></a>
<p>The fifth phase of the Coupled Model Intercomparison Project
(<a href="http://cmip-pcmdi.llnl.gov/cmip5/index.html?submenuheader=0"><acronym>CMIP5</acronym></a>)
provides a multi-model framework for comparing the mechanisms and
responses of climate models from around the world.
However, it is a tremendous workload to retrieve a single climate
statistic from all these models, each of which includes several ensemble
members.
Not only that, it is too often a repetitive process which impedes new
research and hypothesis testing.
Our <acronym>NASA</acronym> <acronym>ACCESS</acronym> project is designed to simplify and
accelerate this process.
To begin, we document below a prototypical example of <acronym>CMIP5</acronym>
analysis and evaluation using traditional <acronym>NCO</acronym> commands on
netCDF3-format model and <acronym>HDF-EOS</acronym> format observational
(<acronym>NASA</acronym> <acronym>MODIS</acronym> satellite instrument) datasets.
These examples complement the <acronym>NCO</acronym> User Guide by detailing
in-depth data analysis in a frequently encountered “real world”
context.
Graphical representations of the results (<acronym>NCL</acronym> scripts
available upon request) are provided to illustrate physical meaning of
the analysis.
Since <acronym>NCO</acronym> can process hierarchical datasets, i.e., datasets
stored with netCDF4 groups, we present sample scripts illustrating
group-based processing as well.
</p>
<table class="menu" border="0" cellspacing="0">
<tr><td align="left" valign="top">• <a href="#Combine-Files" accesskey="1">Combine Files</a>:</td><td> </td><td align="left" valign="top">
</td></tr>
<tr><td align="left" valign="top">• <a href="#Global-Distribution-of-Long_002dterm-Average" accesskey="2">Global Distribution of Long-term Average</a>:</td><td> </td><td align="left" valign="top">
</td></tr>
<tr><td align="left" valign="top">• <a href="#Annual-Average-over-Regions" accesskey="3">Annual Average over Regions</a>:</td><td> </td><td align="left" valign="top">
</td></tr>
<tr><td align="left" valign="top">• <a href="#Monthly-Cycle" accesskey="4">Monthly Cycle</a>:</td><td> </td><td align="left" valign="top">
</td></tr>
<tr><td align="left" valign="top">• <a href="#Regrid-MODIS-Data" accesskey="5">Regrid MODIS Data</a>:</td><td> </td><td align="left" valign="top">
</td></tr>
<tr><td align="left" valign="top">• <a href="#Add-Coordinates-to-MODIS-Data" accesskey="6">Add Coordinates to MODIS Data</a>:</td><td> </td><td align="left" valign="top">
</td></tr>
<tr><td align="left" valign="top">• <a href="#Permute-MODIS-Coordinates" accesskey="7">Permute MODIS Coordinates</a>:</td><td> </td><td align="left" valign="top">
</td></tr>
</table>
<hr>
<a name="Combine-Files"></a>
<div class="header">
<p>
Next: <a href="#Global-Distribution-of-Long_002dterm-Average" accesskey="n" rel="next">Global Distribution of Long-term Average</a>, Previous: <a href="#CMIP5-Example" accesskey="p" rel="previous">CMIP5 Example</a>, Up: <a href="#CMIP5-Example" accesskey="u" rel="up">CMIP5 Example</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#General-Index" title="Index" rel="index">Index</a>]</p>
</div>
<a name="Combine-Files-1"></a>
<h3 class="section">7.1 Combine Files</h3>
<a name="index-file-combination"></a>
<p>Sometimes, the data of one ensemble member will be stored in several
files to reduce single file size.
But it is not convenient to process in a batch mode.
The following script illustrates how to concatenate these files into one.
Key steps include:
</p><ol>
<li> Obtain number and names (or partial names) of files in a directory
</li><li> Concatenate files along the record dimension (usually time) using
<code>ncrcat</code> (see <a href="#ncrcat-netCDF-Record-Concatenator">ncrcat netCDF Record Concatenator</a>).
</li></ol>
<div class="example">
<pre class="verbatim">#!/bin/bash # shell type
shopt -s extglob # enable extended globbing
#===========================================================================
# Some of the models cut one ensemble member into several files,
# which include data of different time periods.
# We'd better concatenate them into one at the beginning so that
# we won't have to think about which files we need if we want
# to retrieve a specific time period later.
#
# Method:
# - Make sure 'time' is the record dimension (i.e., left-most)
# - ncrcat
#
# Input files like:
# /data/cmip5/snc_LImon_bcc-csm1-1_historical_r1i1p1_185001-190012.nc
# /data/cmip5/snc_LImon_bcc-csm1-1_historical_r1i1p1_190101-200512.nc
#
# Output files like:
# /data/cmip5/snc_LImon_bcc-csm1-1_historical_r1i1p1_185001-200512.nc
#
# Online: http://nco.sourceforge.net/nco.html#Combine-Files
#
# Execute this script: bash cmb_fl.sh
#===========================================================================
drc_in='/home/wenshanw/data/cmip5/' # Directory of input files
var=( 'snc' 'snd' ) # Variables
rlm='LImon' # Realm
xpt=( 'historical' ) # Experiment ( could be more )
for var_id in {0..1}; do # Loop over two variables
# Names of all the models (ls [get file names];
# cut [get model names];
# sort; uniq [remove duplicates]; awk [print])
mdl_set=$( ls ${drc_in}${var[var_id]}_${rlm}_*_${xpt[0]}_*.nc | \
cut -d '_' -f 3 | sort | uniq -c | awk '{print $2}' )
# Number of models (echo [print contents]; wc [count])
mdl_nbr=$( echo ${mdl_set} | wc -w )
echo "=============================="
echo "There are" ${mdl_nbr} "models for" ${var[var_id]}.
for mdl in ${mdl_set}; do # Loop over models
# Names of all the ensemble members
nsm_set=$( ls ${drc_in}${var[var_id]}_${rlm}_${mdl}_${xpt[0]}_*.nc | \
cut -d '_' -f 5 | sort | uniq -c | awk '{print $2}' )
# Number of ensemble members in each model
nsm_nbr=$( echo ${nsm_set} | wc -w )
echo "------------------------------"
echo "Model" ${mdl} "includes" ${nsm_nbr} "ensemble member(s):"
echo ${nsm_set}"."
for nsm in ${nsm_set}; do # Loop over ensemble members
# Number of files in this ensemble member
fl_nbr=$( ls ${drc_in}${var[var_id]}_${rlm}_${mdl}_${xpt[0]}_${nsm}_*.nc \
| wc -w )
# If there is only 1 file, continue to next loop
if [ ${fl_nbr} -le 1 ]
then
echo "There is only 1 file in" ${nsm}.
continue
fi
echo "There are" ${fl_nbr} "files in" ${nsm}.
# Starting date of data
# (sed [the name of the first file includes the starting date])
yyyymm_str=$( ls ${drc_in}${var[var_id]}_${rlm}_${mdl}_${xpt[0]}_${nsm}_*.nc\
| sed -n '1p' | cut -d '_' -f 6 | cut -d '-' -f 1 )
# Ending date of data
# (sed [the name of the last file includes the ending date])
yyyymm_end=$( ls ${drc_in}${var[var_id]}_${rlm}_${mdl}_${xpt[0]}_${nsm}_*.nc\
| sed -n "${fl_nbr}p" | cut -d '_' -f 6 | cut -d '-' -f 2 )
# Concatenate one ensemble member files
# into one along the record dimension (now is time)
ncrcat -O ${drc_in}${var[var_id]}_${rlm}_${mdl}_${xpt[0]}_${nsm}_*.nc \
${drc_in}${var[var_id]}_${rlm}_${mdl}_${xpt[0]}_\
${nsm}_${yyyymm_str}-${yyyymm_end}
# Remove useless files
rm ${drc_in}${var[var_id]}_${rlm}_${mdl}_${xpt[0]}_${nsm}_\
!(${yyyymm_str}-${yyyymm_end})
done
done
done
</pre></div>
<p>Right now, <acronym>CMIP5</acronym> model data downloaded from Earth System Grid
Federation (<a href="http://pcmdi9.llnl.gov/esgf-web-fe/"><acronym>ESGF</acronym></a>)
will not contain <tt class="key">group</tt> features yet.
Therefore users can aggregate the flat files into groups themselves.
The following script shows how to aggregate models to one file.
Each dataset becomes a group in the output file.
There can be several levels of groups.
In this example, we employ two experiments as the top-level.
The second-level comprises different models.
Some models have more than one ensemble member.
These ensemble members are on the third level.
In each sub-group of ensemble members, we appended two variables,
<var>snc</var> and <var>snd</var> (these stand for snow cover and snow depth, by
the way).
<a name="index-_002d_002dgag-1"></a>
<a name="index-aggregation"></a>
<a name="index-group-aggregation-1"></a>
<a name="index-groups_002c-creating"></a>
</p><div class="example">
<pre class="verbatim">#!/bin/bash
#
#============================================================
# Aggregate models to one group file
#
# Method:
# - Create files with groups by ncecat --gag
# - Append groups level by level using ncks
#
# Input files like:
# snc_LImon_CCSM4_historical_r1i1p1_199001-200512.nc
# snd_LImon_CESM1-BGC_esmHistorical_r1i1p1_199001-200512.nc
#
# Output files like:
# sn_LImon_199001-200512.nc
#
# Online: http://nco.sourceforge.net/nco.html#Combine-Files
#
# Execute this script: bash cmb_fl_grp.sh
#============================================================
# Directories
drc_in='../data/'
drc_out='../data/grp/'
# Constants
rlm='LImon' # Realm: LandIce; Time frequency: monthly
tms='200001-200512' # Timeseris
flt='nc' # File Type
# Geographical weights
# Can be skipped when ncap2 works on group data
# Loop over all snc files
for fn in $( ls ${drc_in}snc_${rlm}_*_${tms}.${flt} ); do
ncap2 -O -s \
'gw = float(cos(lat*3.1416/180.)); gw@long_name="geographical weight";'\
${fn} ${fn}
done
var=( 'snc' 'snd' )
xpt=( 'esmHistorical' 'historical' )
mdl=( 'CCSM4' 'CESM1-BGC' 'CESM1-CAM5' )
for i in {0..1}; do # Loop over variables
for j in {0..1}; do # Loop over experiments
for k in {0..2}; do # Loop over models
ncecat -O --glb_mtd_spp -G ${xpt[j]}/${mdl[k]}/${mdl[k]}_ \
${drc_in}${var[i]}_${rlm}_${mdl[k]}_${xpt[j]}_*_${tms}.${flt} \
${drc_out}${var[i]}_${rlm}_${mdl[k]}_${xpt[j]}_all-nsm_${tms}.${flt}
ncks -A \
${drc_out}${var[i]}_${rlm}_${mdl[k]}_${xpt[j]}_all-nsm_${tms}.${flt} \
${drc_out}${var[i]}_${rlm}_${mdl[0]}_${xpt[j]}_all-nsm_${tms}.${flt}
done # Loop done: models
ncks -A \
${drc_out}${var[i]}_${rlm}_${mdl[0]}_${xpt[j]}_all-nsm_${tms}.${flt} \
${drc_out}${var[i]}_${rlm}_${mdl[0]}_${xpt[0]}_all-nsm_${tms}.${flt}
done # Loop done: experiments
ncks -A \
${drc_out}${var[i]}_${rlm}_${mdl[0]}_${xpt[0]}_all-nsm_${tms}.${flt} \
${drc_out}${var[0]}_${rlm}_${mdl[0]}_${xpt[0]}_all-nsm_${tms}.${flt}
done # Loop done: variables
# Rename output file
mv ${drc_out}${var[0]}_${rlm}_${mdl[0]}_${xpt[0]}_all-nsm_${tms}.${flt} \
${drc_out}sn_${rlm}_all-mdl_all-xpt_all-nsm_${tms}.${flt}
# Remove temporary files
rm ${drc_out}sn?_${rlm}*.nc
#!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
# Coming soon!
#- Group names:
# E.g., file snc_LImon_CESM1-CAM5_historical_r1i1p1_199001-200512.nc
# will be group /historical/CESM1-CAM5/00
#- You can rename groups on the last level to be more meaningful by
#ncrename -g ${xpt}/${mdl}/02,${xpt}/${mdl}/r3i1p1 \
# ${drc_out}${var}_${rlm}_${mdl}_all-nsm_${tms}.${flt}
#!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
#------------------------------------------------------------
# Output file structure
#------------------------------------------------------------
# esmHistorical
# {
# CESM1-BGC
# {
# CESM1-BGC_00
# {
# snc(time, lat, lon)
# snd(time, lat, lon)
# }
# }
# }
# historical
# {
# CCSM4
# {
# CCSM4_00
# {
# snc(time, lat, lon)
# snd(time, lat, lon)
# }
# CCSM4_01
# {
# snc(time, lat, lon)
# snd(time, lat, lon)
# }
# CCSM4_02 { ... }
# CCSM4_03 { ... }
# CCSM4_04 { ... }
# }
# CESM1-BGC
# {
# CESM1-BGC_00 { ... }
# }
# CESM1-CAM5
# {
# CESM1-CAM5_00 { ... }
# CESM1-CAM5_01 { ... }
# CESM1-CAM5_02 { ... }
# }
# }
</pre></div>
<hr>
<a name="Global-Distribution-of-Long_002dterm-Average"></a>
<div class="header">
<p>
Next: <a href="#Annual-Average-over-Regions" accesskey="n" rel="next">Annual Average over Regions</a>, Previous: <a href="#Combine-Files" accesskey="p" rel="previous">Combine Files</a>, Up: <a href="#CMIP5-Example" accesskey="u" rel="up">CMIP5 Example</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#General-Index" title="Index" rel="index">Index</a>]</p>
</div>
<a name="Global-Distribution-of-Long_002dterm-Average-1"></a>
<h3 class="section">7.2 Global Distribution of Long-term Average</h3>
<a name="index-spatial-distribution"></a>
<a name="index-long_002dterm-average"></a>
<a name="index-average-7"></a>
<a name="index-time_002daveraging-6"></a>
<div class="float"><a name="fgr_003aglb"></a>
<img src="xmp/fgr1.png" alt="xmp/fgr1">
<div class="float-caption"><p><strong>Figure 7.1: </strong>Global Distribution of Long-term Average.</p></div></div><p>This section illustrates how to calculate the global distribution of
long-term average (see <a href="#fgr_003aglb">Figure 7.1</a>) with either flat files or
<a href="http://nco.sourceforge.net/nco.html#index-groups">group file</a>.
Key steps include:
</p><ol>
<li> Average ensemble members of each model using <code>nces</code> (see <a href="#nces-netCDF-Ensemble-Statistics">nces netCDF Ensemble Statistics</a>)
</li><li> Average the record dimension using <code>ncra</code> (see <a href="#ncra-netCDF-Record-Averager">ncra netCDF Record Averager</a>)
</li><li> Store results of each model as a distinct group in a single output file using <code>ncecat</code> (see <a href="#ncrcat-netCDF-Record-Concatenator">ncrcat netCDF Record Concatenator</a>) with the <samp>--gag</samp> option
</li></ol>
<p>The first example shows how to process flat files.
</p><div class="example">
<pre class="verbatim">#!/bin/bash
#===========================================================================
# After cmb_fl.sh
# Example: Long-term average of each model globally
#
# Input files like:
# /data/cmip5/snc_LImon_bcc-csm1-1_historical_r1i1p1_185001-200512.nc
#
# Output files like:
# /data/cmip5/output/snc/snc_LImon_all-mdl_historical_all-nsm_clm.nc
#
# Online:
# http://nco.sourceforge.net/nco.html#Global-Distribution-of-Long_002dterm-Average
#
# Execute this script: bash glb_avg.sh
#===========================================================================
#---------------------------------------------------------------------------
# Parameters
drc_in='/home/wenshanw/data/cmip5/' # Directory of input files
drc_out='/home/wenshanw/data/cmip5/output/' # Directory of output files
var=( 'snc' 'snd' ) # Variables
rlm='LImon' # Realm
xpt=( 'historical' ) # Experiment ( could be more )
fld_out=( 'snc/' 'snd/' ) # Folders of output files
#---------------------------------------------------------------------------
for var_id in {0..1}; do # Loop over two variables
# Names of all models
# (ls [get file names]; cut [get the part for model names];
# sort; uniq [remove duplicates]; awk [print])
mdl_set=$( ls ${drc_in}${var[var_id]}_${rlm}_*_${xpt[0]}_*.nc | \
cut -d '_' -f 3 | sort | uniq -c | awk '{print $2}' )
# Number of models (echo [print contents]; wc [count])
mdl_num=$( echo ${mdl_set} | wc -w )
for mdl in ${mdl_set}; do # Loop over models
# Average all the ensemble members of each model
# Use nces file ensembles mode: --nsm_fl
nces --nsm_fl -O -4 -d time,"1956-01-01 00:00:0.0","2005-12-31 23:59:9.9" \
${drc_in}${var[var_id]}_${rlm}_${mdl}_${xpt[0]}_*.nc \
${drc_out}${fld_out[var_id]}${var[var_id]}_${rlm}_${mdl}_${xpt[0]}\
_all-nsm_195601-200512.nc
# Average along time
ncra -O ${drc_out}${fld_out[var_id]}${var[var_id]}_${rlm}_${mdl}_${xpt[0]}\
_all-nsm_195601-200512.nc \
${drc_out}${fld_out[var_id]}${var[var_id]}_${mdl}.nc
echo Model ${mdl} done!
done
# Remove temporary files
rm ${drc_out}${fld_out[var_id]}${var[var_id]}*historical*.nc
# Store models as groups in the output file
ncecat -O --gag ${drc_out}${fld_out[var_id]}${var[var_id]}_*.nc \
${drc_out}${fld_out[var_id]}${var[var_id]}_${rlm}_\
all-mdl_${xpt[0]}_all-nsm_clm.nc
echo Var ${var[var_id]} done!
done
</pre></div>
<p>With the use of <tt class="key">group</tt>, the above script
will be shortened to just TWO LINES<!-- /@w -->.
<a name="index-groups_002c-averaging"></a>
</p><div class="example">
<pre class="example"># Data from cmb_fl_grp.sh
# ensemble averaging
nces -O --nsm_grp --nsm_sfx='_avg' \
sn_LImon_all-mdl_all-xpt_all-nsm_200001-200512.nc \
sn_LImon_all-mdl_all-xpt_nsm-avg.nc
ncra -O -g 'avg$' sn_LImon_all-mdl_all-xpt_nsm-avg.nc \
sn_LImon_all-mdl_all-xpt_nsm-avg_tm-avg.nc
</pre></div>
<p>The input file, <samp>sn_LImon_all-mdl_all-xpt_all-nsm_200001-200512.nc</samp>, produced by <samp>cmb_fl_grp.sh</samp>,
includes all the ensemble members as groups.
The option ‘<samp>--nsm_grp</samp>’ denotes
that we are using <a href="http://nco.sf.net/nco.html#nsm_grp">group ensembles mode</a> of <code>nces</code>,
instead of <a href="http://nco.sf.net/nco.html#nsm_fl">file ensembles mode</a>, ‘<samp>--nsm_fl</samp>’.
The option ‘<samp>--nsm_sfx='_avg'</samp>’ instructs <code>nces</code>
to store the output as a new child group <samp>/[model]/[model name]_avg</samp>,
instead of in the parent group <samp>/[model]</samp>.
In the final output file, <samp>sn_LImon_all-mdl_all-xpt_nsm-avg_tm-avg.nc</samp>,
sub-groups with a suffix of ‘avg’ are the long-term averages of each model.
Here, ‘<samp>-g 'avg$'</samp>’ is used to retrieve groups having ’avg’ at the end of their names,
i.e., the long-term average groups.
</p>
<hr>
<a name="Annual-Average-over-Regions"></a>
<div class="header">
<p>
Next: <a href="#Monthly-Cycle" accesskey="n" rel="next">Monthly Cycle</a>, Previous: <a href="#Global-Distribution-of-Long_002dterm-Average" accesskey="p" rel="previous">Global Distribution of Long-term Average</a>, Up: <a href="#CMIP5-Example" accesskey="u" rel="up">CMIP5 Example</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#General-Index" title="Index" rel="index">Index</a>]</p>
</div>
<a name="Annual-Average-over-Regions-1"></a>
<h3 class="section">7.3 Annual Average over Regions</h3>
<a name="index-annual-average"></a>
<a name="index-average-8"></a>
<a name="index-time_002daveraging-7"></a>
<a name="index-area_002daveraging"></a>
<a name="index-dimension-order"></a>
<a name="index-anomalies-1"></a>
<a name="index-standard-deviation-2"></a>
<a name="index-renaming-variables-1"></a>
<a name="index-attributes_002c-editing-1"></a>
<a name="index-attributes_002c-modifying-1"></a>
<a name="index-attributes_002c-overwriting-1"></a>
<a name="index-regression"></a>
<a name="index-nco-script-file"></a>
<a name="index-variables_002c-appending"></a>
<div class="float"><a name="fgr_003aanl"></a>
<img src="xmp/fgr2.png" alt="xmp/fgr2">
<div class="float-caption"><p><strong>Figure 7.2: </strong>Annual Average over Regions.</p></div></div><p>This section illustrates how to calculate the annual average over
specific regions (see <a href="#fgr_003aanl">Figure 7.2</a>).
Key steps include:
</p><ol>
<li> Spatial average using <code>ncap2</code> (see <a href="#ncap2-netCDF-Arithmetic-Processor">ncap2 netCDF Arithmetic Processor</a>) and <code>ncwa</code> (see <a href="#ncwa-netCDF-Weighted-Averager">ncwa netCDF Weighted Averager</a>);
</li><li> Change dimension order using <code>ncpdq</code> (see <a href="#ncpdq-netCDF-Permute-Dimensions-Quickly">ncpdq netCDF Permute Dimensions Quickly</a>);
</li><li> Annual average using <code>ncra</code> (see <a href="#ncra-netCDF-Record-Averager">ncra netCDF Record Averager</a>);
</li><li> Anomaly from long-term average using <code>ncbo</code> (see <a href="#ncbo-netCDF-Binary-Operator">ncbo netCDF Binary Operator</a>);
</li><li> Standard deviation using <code>ncbo</code> (see <a href="#ncbo-netCDF-Binary-Operator">ncbo netCDF Binary Operator</a>) and <code>nces</code> (see <a href="#nces-netCDF-Ensemble-Statistics">nces netCDF Ensemble Statistics</a>);
</li><li> Rename variables using <code>ncrename</code> (see <a href="#ncrename-netCDF-Renamer">ncrename netCDF Renamer</a>);
</li><li> Edit attributions using <code>ncatted</code> (see <a href="#ncatted-netCDF-Attribute-Editor">ncatted netCDF Attribute Editor</a>);
</li><li> Linear regression using <code>ncap2</code> (see <a href="#ncap2-netCDF-Arithmetic-Processor">ncap2 netCDF Arithmetic Processor</a>);
</li><li> Use <code>ncap2</code> (see <a href="#ncap2-netCDF-Arithmetic-Processor">ncap2 netCDF Arithmetic Processor</a>) with nco script file (i.e., <samp>.nco</samp> file);
</li><li> Move variables around using <code>ncks</code> (see <a href="#ncks-netCDF-Kitchen-Sink">ncks netCDF Kitchen Sink</a>).
</li></ol>
<p><strong>Flat files example</strong>
</p><div class="example">
<pre class="verbatim">#!/bin/bash
# Includes gsl_rgr.nco
#===========================================================================
# After cmb_fl.sh
# Example: Annual trend of each model over Greenland and Tibet
# ( time- and spatial-average, standard deviation,
# anomaly and linear regression)
#
# Input files:
# /data/cmip5/snc_LImon_bcc-csm1-1_historical_r1i1p1_185001-200512.nc
#
# Output files:
# /data/cmip5/outout/snc/snc_LImon_all-mdl_historical_all-nsm_annual.nc
#
# Online: http://nco.sourceforge.net/nco.html#Annual-Average-over-Regions
#
# Execute this script: bash ann_avg.sh
#===========================================================================
#---------------------------------------------------------------------------
# Parameters
drc_in='/home/wenshanw/data/cmip5/' # Directory of input files
drc_out='/home/wenshanw/data/cmip5/output/' # Directory of output files
var=( 'snc' 'snd' ) # Variables
rlm='LImon' # Realm
xpt=( 'historical' ) # Experiment ( could be more )
fld_out=( 'snc/' 'snd/' ) # Folders of output files
# ------------------------------------------------------------
for var_id in {0..1}; do # Loop over two variables
# Names of all models
# (ls [get file names]; cut [get the part for model names];
# sort; uniq [remove duplicates]; awk [print])
mdl_set=$( ls ${drc_in}${var[var_id]}_${rlm}_*_${xpt[0]}_*.nc | \
cut -d '_' -f 3 | sort | uniq -c | awk '{print $2}' )
for mdl in ${mdl_set}; do # Loop over models
# Loop over ensemble members
for fn in $( ls ${drc_in}${var[var_id]}_${rlm}_${mdl}_${xpt[0]}_*.nc ); do
pfx=$( echo ${fn} | cut -d'/' -f6 | cut -d'_' -f1-5 )
# Two regions
# Geographical weight
ncap2 -O -s 'gw = cos(lat*3.1415926/180.); gw@long_name="geographical weight"\
;gw@units="ratio"' ${fn} ${drc_out}${fld_out[var_id]}${pfx}_gw.nc
# Greenland
ncwa -O -w gw -d lat,60.0,75.0 -d lon,300.0,340.0 -a lat,lon \
${drc_out}${fld_out[var_id]}${pfx}_gw.nc \
${drc_out}${fld_out[var_id]}${pfx}_gw_1.nc
# Tibet
ncwa -O -w gw -d lat,30.0,40.0 -d lon,80.0,100.0 -a lat,lon \
${drc_out}${fld_out[var_id]}${pfx}_gw.nc \
${drc_out}${fld_out[var_id]}${pfx}_gw_2.nc
# Aggregate 2 regions together
ncecat -O -u rgn ${drc_out}${fld_out[var_id]}${pfx}_gw_?.nc \
${drc_out}${fld_out[var_id]}${pfx}_gw_rgn4.nc
# Change dimensions order
ncpdq -O -a time,rgn ${drc_out}${fld_out[var_id]}${pfx}_gw_rgn4.nc \
${drc_out}${fld_out[var_id]}${pfx}_gw_rgn4.nc
# Remove temporary files (optional)
rm ${drc_out}${fld_out[var_id]}${pfx}_gw_?.nc \
${drc_out}${fld_out[var_id]}${pfx}_gw.nc
# Annual average (use the feature of 'Duration')
ncra -O --mro -d time,"1956-01-01 00:00:0.0","2005-12-31 23:59:9.9",12,12 \
${drc_out}${fld_out[var_id]}${pfx}_gw_rgn4.nc \
${drc_out}${fld_out[var_id]}${pfx}_yrly.nc
# Anomaly
# Long-term average
ncwa -O -a time ${drc_out}${fld_out[var_id]}${pfx}_yrly.nc \
${drc_out}${fld_out[var_id]}${pfx}_clm.nc
# Subtract long-term average
ncbo -O --op_typ=- ${drc_out}${fld_out[var_id]}${pfx}_yrly.nc \
${drc_out}${fld_out[var_id]}${pfx}_clm.nc \
${drc_out}${fld_out[var_id]}${pfx}_anm.nc
done
rm ${drc_out}${fld_out[var_id]}${var[var_id]}_${rlm}_${mdl}_${xpt[0]}_*_yrly.nc
# Average over all the ensemble members
ncea -O -4 ${drc_out}${fld_out[var_id]}${var[var_id]}_\
${rlm}_${mdl}_${xpt[0]}_*_anm.nc ${drc_out}${fld_out[var_id]}\
${var[var_id]}_${rlm}_${mdl}_${xpt[0]}_all-nsm_anm.nc
# Standard deviation ------------------------------
for fn in $( ls ${drc_out}${fld_out[var_id]}${var[var_id]}_${rlm}_${mdl}_\
${xpt[0]}_*_anm.nc ); do
pfx=$( echo ${fn} | cut -d'/' -f8 | cut -d'_' -f1-5 )
# Difference between each ensemble member and the average of all members
ncbo -O --op_typ=- ${fn} \
${drc_out}${fld_out[var_id]}${var[var_id]}_\
${rlm}_${mdl}_${xpt[0]}_all-nsm_anm.nc \
${drc_out}${fld_out[var_id]}${pfx}_dlt.nc
done
# RMS
ncea -O -y rmssdn ${drc_out}${fld_out[var_id]}${var[var_id]}_${rlm}_\
${mdl}_${xpt[0]}_*_dlt.nc \
${drc_out}${fld_out[var_id]}${var[var_id]}_${rlm}_\
${mdl}_${xpt[0]}_all-nsm_sdv.nc
# Rename variables
ncrename -v ${var[var_id]},sdv \
${drc_out}${fld_out[var_id]}${var[var_id]}_${rlm}_\
${mdl}_${xpt[0]}_all-nsm_sdv.nc
# Edit attributions
ncatted -a standard_name,sdv,a,c,"_standard_deviation_over_ensemble" \
-a long_name,sdv,a,c," Standard Deviation over Ensemble" \
-a original_name,sdv,a,c," sdv" \
${drc_out}${fld_out[var_id]}${var[var_id]}_${rlm}_\
${mdl}_${xpt[0]}_all-nsm_sdv.nc
#------------------------------------------------------------
# Linear regression -----------------------------------------
#!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
# Have to change the name of variable in the commands file
# of gsl_rgr.nco manually (gsl_rgr.nco is listed below)
ncap2 -O -S gsl_rgr.nco \
${drc_out}${fld_out[var_id]}${var[var_id]}_${rlm}_\
${mdl}_${xpt[0]}_all-nsm_anm.nc ${drc_out}${fld_out[var_id]}${var[var_id]}\
_${rlm}_${mdl}_${xpt[0]}_all-nsm_anm_rgr.nc
#!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
# Get rid of temporary variables
ncks -O -v c0,c1,pval,${var[var_id]},gw \
${drc_out}${fld_out[var_id]}${var[var_id]}_${rlm}_${mdl}_\
${xpt[0]}_all-nsm_anm_rgr.nc \
${drc_out}${fld_out[var_id]}${var[var_id]}_${mdl}.nc
#------------------------------------------------------------
# Move the variable 'sdv' into the anomaly files (i.e., *anm.nc files)
ncks -A -v sdv \
${drc_out}${fld_out[var_id]}${var[var_id]}_${rlm}_\
${mdl}_${xpt[0]}_all-nsm_sdv.nc \
${drc_out}${fld_out[var_id]}${var[var_id]}_${mdl}.nc
rm ${drc_out}${fld_out[var_id]}${var[var_id]}_*historical*
echo Model ${mdl} done!
done
# Store models as groups in the output file
ncecat -O --gag ${drc_out}${fld_out[var_id]}${var[var_id]}_*.nc
${drc_out}${fld_out[var_id]}${var[var_id]}_\
${rlm}_all-mdl_${xpt[0]}_all-nsm_annual.nc
echo Var ${var[var_id]} done!
done
</pre></div>
<p><strong>gsl_rgr.nco</strong>
</p><div class="example">
<pre class="verbatim">// Linear Regression
// Called by ann_avg.sh
// Caution: make sure the variable name is
// in agreement with the main script (now is 'snd')
// Online: http://nco.sourceforge.net/nco.html#Annual-Average-over-Regions
// Declare variables
*c0[$rgn]=0.; // Intercept
*c1[$rgn]=0.; // Slope
*sdv[$rgn]=0.; // Standard deviation
*covxy[$rgn]=0.; // Covariance
*x = double(time);
for (*rgn_id=0;rgn_id<$rgn.size;rgn_id++) // Loop over regions
{
gsl_fit_linear(time,1,snd(:,rgn_id),1,$time.size, \
&tc0, &tc1, &cov00, &cov01,&cov11,&sumsq); // Linear regression function
c0(rgn_id) = tc0; // Output results
c1(rgn_id) = tc1;
covxy(rgn_id) = gsl_stats_covariance(time,1,\
$time.size,double(snd(:,rgn_id)),1,$time.size); // Covariance function
sdv(rgn_id) = gsl_stats_sd(snd(:,rgn_id), \
1, $time.size); // Standard deviation function
}
// P value------------------------------------------------------------
*time_sdv = gsl_stats_sd(time, 1, $time.size);
*r_value = covxy/(time_sdv*sdv);
*t_value = r_value/sqrt((1-r_value^2)/($time.size-2));
pval = abs(gsl_cdf_tdist_P(t_value, $time.size-2) - \
gsl_cdf_tdist_P(-t_value, $time.size-2));
//----------------------------------------------------------------
// Write RAM variables to disk
//------------------------------------------------------------
// Usually NCO writes the outputs directly to disk
// Using RAM variables, declared by *, will shorten running time
// Output the final results using ram_write()
//------------------------------------------------------------
ram_write(c0);
ram_write(c1);
</pre></div>
<p>With the <tt class="key">group</tt> feature,
all the loops over experiments, models and ensemble members can be omitted.
As we are working on implementing <tt class="key">group</tt> feature in all <acronym>NCO</acronym> operators,
some functions (e.g., regression and standard deviation over ensemble members)
may have to wait until the new versions.
<a name="index-group_002c-spatial-averaging"></a>
<a name="index-group_002c-temporal-averaging"></a>
<a name="index-group_002c-anomaly"></a>
<a name="index-group_002c-standard-deviation"></a>
<a name="index-group_002c-aggregation"></a>
<a name="index-group_002c-dimension-permutation"></a>
</p><div class="example">
<pre class="verbatim">#!/bin/bash
#
#============================================================
# Group data output by cmb_fl_grp.sh
# Annual trend of each model over Greenland and Tibet
# Time- and spatial-average, standard deviation and anomaly
# No regression yet (needs ncap2)
#
# Input files:
# sn_LImon_all-mdl_all-xpt_all-nsm_200001-200512.nc
#
# Online: http://nco.sourceforge.net/nco.html#Annual-Average-over-Regions
#
# Execute this script: bash ann_avg_grp.sh
#===========================================================================
# Input and output directory
drc='../data/grp/'
# Constants
pfx='sn_LImon_all-mdl_all-xpt_all-nsm'
tms='200001-200512' # Time series
# Greenland
ncwa -O -w gw -d lat,60.0,75.0 -d lon,300.0,340.0 -a lat,lon \
${drc}${pfx}_${tms}.nc \
${drc}${pfx}_${tms}_grl.nc
# Tibet
ncwa -O -w gw -d lat,30.0,40.0 -d lon,80.0,100.0 -a lat,lon \
${drc}${pfx}_${tms}.nc \
${drc}${pfx}_${tms}_tbt.nc
# Aggregate 2 regions together
ncecat -O -u rgn ${drc}${pfx}_${tms}_???.nc \
${drc}${pfx}_${tms}_rgn2.nc
# Change dimensions order
ncpdq -O -a time,rgn ${drc}${pfx}_${tms}_rgn2.nc \
${drc}${pfx}_${tms}_rgn2.nc
# Remove temporary files (optional)
rm ${drc}${pfx}_${tms}_???.nc
#Annual average
ncra -O --mro -d time,,,12,12 ${drc}${pfx}_${tms}_rgn2.nc \
${drc}${pfx}_${tms}_rgn2_ann.nc
# Anomaly
#------------------------------------------------------------
# Long-term average
ncwa -O -a time ${drc}${pfx}_${tms}_rgn2_ann.nc \
${drc}${pfx}_${tms}_rgn2_clm.nc
# Subtract
ncbo -O --op_typ=- ${drc}${pfx}_${tms}_rgn2_ann.nc \
${drc}${pfx}_${tms}_rgn2_clm.nc \
${drc}${pfx}_${tms}_rgn2_anm.nc
#------------------------------------------------------------
# Standard Deviation: inter-annual variability
# RMS of the above anomaly
ncra -O -y rmssdn ${drc}${pfx}_${tms}_rgn2_anm.nc \
${drc}${pfx}_${tms}_rgn2_stddev.nc
</pre></div>
<hr>
<a name="Monthly-Cycle"></a>
<div class="header">
<p>
Next: <a href="#Regrid-MODIS-Data" accesskey="n" rel="next">Regrid MODIS Data</a>, Previous: <a href="#Annual-Average-over-Regions" accesskey="p" rel="previous">Annual Average over Regions</a>, Up: <a href="#CMIP5-Example" accesskey="u" rel="up">CMIP5 Example</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#General-Index" title="Index" rel="index">Index</a>]</p>
</div>
<a name="Monthly-Cycle-1"></a>
<h3 class="section">7.4 Monthly Cycle</h3>
<a name="index-monthly-average-1"></a>
<a name="index-average-9"></a>
<a name="index-time_002daveraging-8"></a>
<a name="index-anomalies-2"></a>
<a name="index-geographical-weight"></a>
<a name="index-weighted-average-1"></a>
<div class="float"><a name="fgr_003amon"></a>
<img src="xmp/fgr3.png" alt="xmp/fgr3">
<div class="float-caption"><p><strong>Figure 7.3: </strong>Monthly Cycle.</p></div></div><p>This script illustrates how to calculate the monthly anomaly from the
annual average (see <a href="#fgr_003amon">Figure 7.3</a>).
In order to keep only the monthly cycle,
we will subtract the annual average of each year from the monthly data,
instead of subtracting the long-term average.
This is a little more complicated in coding since we need to loop over years.
</p>
<p><strong>Flat files example</strong>
</p><div class="example">
<pre class="verbatim">#!/bin/bash
#============================================================
# After cmb_fl.sh
# Example: Monthly cycle of each model in Greenland
#
# Input files:
# /data/cmip5/snc_LImon_bcc-csm1-1_historical_r1i1p1_185001-200512.nc
#
# Output files:
# /data/cmip5/snc/snc_LImon__all-mdl_historical_all-nsm_GN_mthly-anm.nc
#
# Online: http://nco.sourceforge.net/nco.html#Monthly-Cycle
#
# Execute this script: bash mcc.sh
#============================================================
#------------------------------------------------------------
# Parameters
drc_in='/home/wenshanw/data/cmip5/' # Directory of input files
drc_out='/home/wenshanw/data/cmip5/output/' # Directory of output files
var=( 'snc' 'snd' ) # Variables
rlm='LImon' # Realm
xpt=( 'historical' ) # Experiment ( could be more )
fld_out=( 'snc/' 'snd/' ) # Folders of output files
#------------------------------------------------------------
for var_id in {0..1}; do # Loop over two variables
# names of all models
# (ls [get file names]; cut [get the part for model names];
# sort; uniq [remove duplicates]; awk [print])
mdl_set=$( ls ${drc_in}${var[var_id]}_${rlm}_*_${xpt[0]}_*.nc | \
cut -d '_' -f 3 | sort | uniq -c | awk '{print $2}' )
for mdl in ${mdl_set}; do ## Loop over models
# Average all the ensemble members of each model
ncea -O -4 -d time,"1956-01-01 00:00:0.0","2005-12-31 23:59:9.9" \
${drc_in}${var[var_id]}_${rlm}_${mdl}_${xpt[0]}_*.nc \
${drc_out}${fld_out[var_id]}${var[var_id]}_${rlm}_${mdl}_${xpt[0]}_all-nsm.nc
# Greenland
# Geographical weight
ncap2 -O -s \
'gw = cos(lat*3.1415926/180.); \
gw@long_name="geographical weight";gw@units="ratio"' \
${drc_out}${fld_out[var_id]}${var[var_id]}_${rlm}_${mdl}_${xpt[0]}_all-nsm.nc \
${drc_out}${fld_out[var_id]}${var[var_id]}_${rlm}_${mdl}_${xpt[0]}_all-nsm.nc
ncwa -O -w gw -d lat,60.0,75.0 -d lon,300.0,340.0 -a lat,lon \
${drc_out}${fld_out[var_id]}${var[var_id]}_${rlm}_${mdl}_${xpt[0]}_all-nsm.nc \
${drc_out}${fld_out[var_id]}${var[var_id]}_${rlm}_${mdl}_${xpt[0]}_all-nsm_GN.nc
# Anomaly----------------------------------------
for moy in {1..12}; do # Loop over months
mm=$( printf "%02d" ${moy} ) # Change to 2-digit format
for yr in {1956..2005}; do # Loop over years
# If January, calculate the annual average
if [ ${moy} -eq 1 ]; then
ncra -O -d time,"${yr}-01-01 00:00:0.0","${yr}-12-31 23:59:9.9" \
${drc_out}${fld_out[var_id]}${var[var_id]}_${rlm}_${mdl}_\
${xpt[0]}_all-nsm_GN.nc ${drc_out}${fld_out[var_id]}${var[var_id]}_\
${rlm}_${mdl}_${xpt[0]}_all-nsm_GN_${yr}.nc
fi
# The specific month
ncks -O -d time,"${yr}-${mm}-01 00:00:0.0","${yr}-${mm}-31 23:59:9.9" \
${drc_out}${fld_out[var_id]}${var[var_id]}_\
${rlm}_${mdl}_${xpt[0]}_all-nsm_GN.nc \
${drc_out}${fld_out[var_id]}${var[var_id]}_${rlm}_${mdl}_${xpt[0]}_\
all-nsm_GN_${yr}${mm}.nc
# Subtract the annual average from the monthly data
ncbo -O --op_typ=- ${drc_out}${fld_out[var_id]}${var[var_id]}_\
${rlm}_${mdl}_${xpt[0]}_all-nsm_GN_${yr}${mm}.nc \
${drc_out}${fld_out[var_id]}${var[var_id]}_${rlm}_${mdl}_${xpt[0]}_\
all-nsm_GN_${yr}.nc ${drc_out}${fld_out[var_id]}${var[var_id]}_${rlm}_\
${mdl}_${xpt[0]}_all-nsm_GN_${yr}${mm}_anm.nc
done
# Average over years
ncra -O ${drc_out}${fld_out[var_id]}${var[var_id]}_${rlm}_${mdl}_\
${xpt[0]}_all-nsm_GN_????${mm}_anm.nc \
${drc_out}${fld_out[var_id]}${var[var_id]}_${rlm}_${mdl}_\
${xpt[0]}_all-nsm_GN_${mm}_anm.nc
done
#--------------------------------------------------
# Concatenate months together
ncrcat -O ${drc_out}${fld_out[var_id]}${var[var_id]}_${rlm}_${mdl}_\
${xpt[0]}_all-nsm_GN_??_anm.nc \
${drc_out}${fld_out[var_id]}${var[var_id]}_${mdl}.nc
echo Model ${mdl} done!
done
rm -f ${drc_out}${fld_out[var_id]}${var[var_id]}*historical*
# Store models as groups in the output file
ncecat -O --gag -v ${var[var_id]} \
${drc_out}${fld_out[var_id]}${var[var_id]}_*.nc \
${drc_out}${fld_out[var_id]}${var[var_id]}_${rlm}_all-mdl_\
${xpt[0]}_all-nsm_GN_mthly-anm.nc
echo Var ${var[var_id]} done!
done
</pre></div>
<p>Using <tt class="key">group</tt> feature and <a href="http://nco.sourceforge.net/nco.html#Hyperslabs">hyperslabs</a> of <code>ncbo</code>,
the script will be shortened.
</p><div class="example">
<pre class="verbatim">#!/bin/bash
#============================================================
# Monthly cycle of each ensemble member in Greenland
#
# Input file from cmb_fl_grpsh
# sn_LImon_all-mdl_all-xpt_all-nsm_199001-200512.nc
# Online: http://nco.sourceforge.net/nco.html#Monthly-Cycle
#
# Execute this script in command line: bash mcc_grp.sh
#============================================================
# Input and output directory
drc='../data/grp/'
# Constants
pfx='sn_LImon_all-mdl_all-xpt_all-nsm_200001-20051'
# Greenland
ncwa -O -w gw -d lat,60.0,75.0 -d lon,300.0,340.0 -a lat,lon \
${drc}${pfx}.nc ${drc}${pfx}_grl
# Anomaly from annual average of each year
for yyyy in {2000..2005}; do
# Annual average
ncwa -O -d time,"${yyyy}-01-01","${yyyy}-12-31" \
${drc}${pfx}_grl.nc ${drc}${pfx}_grl_${yyyy}.nc
# Anomaly
ncbo -O --op_typ=- -d time,"${yyyy}-01-01","${yyyy}-12-31" \
${drc}${pfx}_grl.nc ${drc}${pfx}_grl_${yyyy}.nc \
${drc}${pfx}_grl_${yyyy}_anm.nc
done
# Monthly cycle
for moy in {1..12}; do
mm=$( printf "%02d" ${moy} ) # Change to 2-digit format
ncra -O -d time,"2000-${mm}-01",,12 \
${drc}${pfx}_grl_????_anm.nc ${drc}${pfx}_grl_${mm}_anm.nc
done
# Concatenate 12 months together
ncrcat -O ${drc}${pfx}_grl_??_anm.nc \
${drc}${pfx}_grl_mth_anm.nc
</pre></div>
<hr>
<a name="Regrid-MODIS-Data"></a>
<div class="header">
<p>
Next: <a href="#Add-Coordinates-to-MODIS-Data" accesskey="n" rel="next">Add Coordinates to MODIS Data</a>, Previous: <a href="#Monthly-Cycle" accesskey="p" rel="previous">Monthly Cycle</a>, Up: <a href="#CMIP5-Example" accesskey="u" rel="up">CMIP5 Example</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#General-Index" title="Index" rel="index">Index</a>]</p>
</div>
<a name="Regrid-MODIS-Data-1"></a>
<h3 class="section">7.5 Regrid <acronym>MODIS</acronym> Data</h3>
<a name="index-regrid"></a>
<a name="index-MODIS"></a>
<a name="index-bilinear-interpolation"></a>
<a name="index-interpolation-1"></a>
<a name="index-renaming-variables-2"></a>
<a name="index-renaming-attributes-1"></a>
<a name="index-renaming-dimensions-1"></a>
<a name="index-attributes_002c-editing-2"></a>
<a name="index-attributes_002c-modifying-2"></a>
<a name="index-attributes_002c-overwriting-2"></a>
<p>In order to compare the results between <acronym>MODIS</acronym> and
<acronym>CMIP5</acronym> models, one usually regrids one or both datasets so
that the spatial resolutions match.
Here, the script illustrates how to regrid <acronym>MODIS</acronym> data.
Key steps include:
</p><ol>
<li> Regrid using bilinear interpolation (see <a href="#Bilinear-interpolation">Bilinear interpolation</a>)
</li><li> Rename variables, dimensions and attributions using <code>ncrename</code> (see <a href="#ncrename-netCDF-Renamer">ncrename netCDF Renamer</a>).
</li></ol>
<p><strong>Main Script</strong>
</p><div class="example">
<pre class="verbatim">#!/bin/bash
# include bi_interp.nco
#===========================================================================
# Example for
# - regrid (using bi_interp.nco): the spatial resolution of MODIS data
# is much finer than those of CMIP5 models. In order to compare
# the two, we can regrid MODIS data to comform to CMIP5.
#
# Input files (Note: the .hdf files downloaded have to be converted to .nc at
# the present):
# /modis/mcd43c3/MCD43C3.A2000049.005.2006271205532.nc
#
# Output files:
# /modis/mcd43c3/cesm-grid/MCD43C3.2000049.regrid.nc
#
# Online: http://nco.sourceforge.net/nco.html#Regrid-MODIS-Data
#
# Execute this script: bash rgr.sh
#===========================================================================
var=( 'MCD43C3' ) # Variable
fld_in=( 'monthly/' ) # Folder of input files
fld_out=( 'cesm-grid/' ) # Folder of output files
drc_in='/media/grele_data/wenshan/modis/mcd43c3/' # Directory of input files
for fn in $( ls ${drc_in}${fld_in}${var}.*.nc ); do # Loop over files
sfx=$( echo $fn | cut -d '/' -f 8 | cut -d '.' -f 2 ) # Part of file names
# Regrid
ncap2 -O -S bi_interp.nco ${fn} ${drc_in}${fld_out}${var}.${sfx}.regrid.nc
# Keep only the new variables
ncks -O -v wsa_sw_less,bsa_sw_less ${drc_in}${fld_out}${var}.${sfx}.regrid.nc \
${drc_in}${fld_out}${var}.${sfx}.regrid.nc
# Rename the new variables, dimensions and attributions
ncrename -O -d latn,lat -d lonn,lon -v latn,lat -v lonn,lon \
-v wsa_sw_less,wsa_sw -v bsa_sw_less,bsa_sw -a missing_value,_FillValue \
${drc_in}${fld_out}${var}.${sfx}.regrid.nc
echo $sfx done.
done
</pre></div>
<p><strong>bi_interp.nco</strong>
</p><div class="example">
<pre class="verbatim">// Bilinear interpolation
// Included by rgr.sh
// Online: http://nco.sourceforge.net/nco.html#Regrid-MODIS-Data
defdim("latn",192); // Define new dimension: latitude
defdim("lonn",288); // Define new dimension: longitude
latn[$latn] = {90,89.0576 ,88.1152 ,87.1728 ,86.2304 ,85.288 ,\
84.3456 ,83.4031 ,82.4607 ,81.5183 ,80.5759 ,79.6335 ,78.6911 ,\
77.7487 ,76.8063 ,75.8639 ,74.9215 ,73.9791 ,73.0367 ,72.0942 ,\
71.1518 ,70.2094 ,69.267 ,68.3246 ,67.3822 ,66.4398 ,65.4974 ,\
64.555 ,63.6126 ,62.6702 ,61.7277 ,60.7853 ,59.8429 ,58.9005 ,\
57.9581 ,57.0157 ,56.0733 ,55.1309 ,54.1885 ,53.2461 ,52.3037 ,\
51.3613 ,50.4188 ,49.4764 ,48.534 ,47.5916 ,46.6492 ,45.7068 ,\
44.7644 ,43.822 ,42.8796 ,41.9372 ,40.9948 ,40.0524 ,39.11 ,\
38.1675 ,37.2251 ,36.2827 ,35.3403 ,34.3979 ,33.4555 ,32.5131 ,\
31.5707 ,30.6283 ,29.6859 ,28.7435 ,27.8011 ,26.8586 ,25.9162 ,\
24.9738 ,24.0314 ,23.089 ,22.1466 ,21.2042 ,20.2618 ,19.3194 ,\
18.377 ,17.4346 ,16.4921 ,15.5497 ,14.6073 ,13.6649 ,12.7225 ,\
11.7801 ,10.8377 ,9.89529 ,8.95288 ,8.01047 ,7.06806 ,6.12565 ,\
5.18325 ,4.24084 ,3.29843 ,2.35602 ,1.41361 ,0.471204,-0.471204,\
-1.41361,-2.35602,-3.29843,-4.24084,-5.18325,-6.12565,-7.06806,\
-8.01047,-8.95288,-9.89529,-10.8377,-11.7801,-12.7225,-13.6649,\
-14.6073,-15.5497,-16.4921,-17.4346,-18.377 ,-19.3194,-20.2618,\
-21.2042,-22.1466,-23.089 ,-24.0314,-24.9738,-25.9162,-26.8586,\
-27.8011,-28.7435,-29.6859,-30.6283,-31.5707,-32.5131,-33.4555,\
-34.3979,-35.3403,-36.2827,-37.2251,-38.1675,-39.11 ,-40.0524,\
-40.9948,-41.9372,-42.8796,-43.822 ,-44.7644,-45.7068,-46.6492,\
-47.5916,-48.534 ,-49.4764,-50.4188,-51.3613,-52.3037,-53.2461,\
-54.1885,-55.1309,-56.0733,-57.0157,-57.9581,-58.9005,-59.8429,\
-60.7853,-61.7277,-62.6702,-63.6126,-64.555 ,-65.4974,-66.4398,\
-67.3822,-68.3246,-69.267 ,-70.2094,-71.1518,-72.0942,-73.0367,\
-73.9791,-74.9215,-75.8639,-76.8063,-77.7487,-78.6911,-79.6335,\
-80.5759,-81.5183,-82.4607,-83.4031,-84.3456,-85.288,-86.2304,\
-87.1728,-88.1152,-89.0576,-90}; // Copy of CCSM4 latitude
lonn[$lonn] = {-178.75,-177.5,-176.25,-175,-173.75,-172.5,-171.25,\
-170,-168.75,-167.5,-166.25,-165,-163.75,-162.5,-161.25,-160,\
-158.75,-157.5,-156.25,-155,-153.75,-152.5,-151.25,-150,-148.75,\
-147.5,-146.25,-145,-143.75,-142.5,-141.25,-140,-138.75,-137.5,\
-136.25,-135,-133.75,-132.5,-131.25,-130,-128.75,-127.5,-126.25,\
-125,-123.75,-122.5,-121.25,-120,-118.75,-117.5,-116.25,-115,\
-113.75,-112.5,-111.25,-110,-108.75,-107.5,-106.25,-105,-103.75,\
-102.5,-101.25,-100,-98.75,-97.5,-96.25,-95,-93.75,-92.5,-91.25,\
-90,-88.75,-87.5,-86.25,-85,-83.75,-82.5,-81.25,-80,-78.75,-77.5,\
-76.25,-75,-73.75,-72.5,-71.25,-70,-68.75,-67.5,-66.25,-65,-63.75,\
-62.5,-61.25,-60,-58.75,-57.5,-56.25,-55,-53.75,-52.5,-51.25,-50,\
-48.75,-47.5,-46.25,-45,-43.75,-42.5,-41.25,-40,-38.75,-37.5,\
-36.25,-35,-33.75,-32.5,-31.25,-30,-28.75,-27.5,-26.25,-25,-23.75,\
-22.5,-21.25,-20,-18.75,-17.5,-16.25,-15,-13.75,-12.5,-11.25,-10,\
-8.75,-7.5,-6.25,-5,-3.75,-2.5,-1.25,0,1.25,2.5,3.75,5,6.25,7.5,\
8.75,10,11.25,12.5,13.75,15,16.25,17.5,18.75,20,21.25,22.5,23.75,\
25,26.25,27.5,28.75,30,31.25,32.5,33.75,35,36.25,37.5,38.75,40,\
41.25,42.5,43.75,45,46.25,47.5,48.75,50,51.25,52.5,53.75,55,56.25,\
57.5,58.75,60,61.25,62.5,63.75,65,66.25,67.5,68.75,70,71.25,72.5,\
73.75,75,76.25,77.5,78.75,80,81.25,82.5,83.75,85,86.25,87.5,88.75,\
90,91.25,92.5,93.75,95,96.25,97.5,98.75,100,101.25,102.5,103.75,\
105,106.25,107.5,108.75,110,111.25,112.5,113.75,115,116.25,117.5,\
118.75,120,121.25,122.5,123.75,125,126.25,127.5,128.75,130,131.25,\
132.5,133.75,135,136.25,137.5,138.75,140,141.25,142.5,143.75,145,\
146.25,147.5,148.75,150,151.25,152.5,153.75,155,156.25,157.5,\
158.75,160,161.25,162.5,163.75,165,166.25,167.5,168.75,170,171.25,\
172.5,173.75,175,176.25,177.5,178.75,180}; // Copy of CCSM4 longitude
*out[$time,$latn,$lonn]=0.0; // Output structure
// Bi-linear interpolation
bsa_sw_less=bilinear_interp_wrap(bsa_sw,out,latn,lonn,lat,lon);
wsa_sw_less=bilinear_interp_wrap(wsa_sw,out,latn,lonn,lat,lon);
// Add attributions
latn@units = "degree_north";
lonn@units = "degree_east";
latn@long_name = "latitude";
lonn@long_name = "longitude";
bsa_sw_less@hdf_name = "Albedo_BSA_shortwave";
bsa_sw_less@calibrated_nt = 5;
bsa_sw_less@missing_value = 32767.0;
bsa_sw_less@units = "albedo, no units";
bsa_sw_less@long_name = "Global_Albedo_BSA_shortwave";
wsa_sw_less@hdf_name = "Albedo_WSA_shortwave";
wsa_sw_less@calibrated_nt = 5;
wsa_sw_less@missing_value = 32767.0;
wsa_sw_less@units = "albedo, no units";
wsa_sw_less@long_name = "Global_Albedo_WSA_shortwave";
</pre></div>
<hr>
<a name="Add-Coordinates-to-MODIS-Data"></a>
<div class="header">
<p>
Next: <a href="#Permute-MODIS-Coordinates" accesskey="n" rel="next">Permute MODIS Coordinates</a>, Previous: <a href="#Regrid-MODIS-Data" accesskey="p" rel="previous">Regrid MODIS Data</a>, Up: <a href="#CMIP5-Example" accesskey="u" rel="up">CMIP5 Example</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#General-Index" title="Index" rel="index">Index</a>]</p>
</div>
<a name="Add-Coordinates-to-MODIS-Data-1"></a>
<h3 class="section">7.6 Add Coordinates to <acronym>MODIS</acronym> Data</h3>
<a name="index-MODIS-1"></a>
<a name="index-coordinates-2"></a>
<p><strong>Main Script</strong>
</p><div class="example">
<pre class="verbatim">#!/bin/bash
#============================================================
# Example for
# - regrid (using bi_interp.nco): the spatial resolution of MODIS data
# is much finer than those of CMIP5 models. In order to compare
# the two, we can regrid MODIS data to comform to CMIP5.
# - add coordinates (using coor.nco): there is no coordinate information
# in MODIS data. We have to add it manually now.
#
# Input files:
# /modis/mcd43c3/cesm-grid/MCD43C3.2000049.regrid.nc
#
# Output files:
# /modis/mcd43c3/cesm-grid/MCD43C3.2000049.regrid.nc
#
# Online: http://nco.sourceforge.net/nco.html#Add-Coordinates-to-MODIS-Data
#
# Execute this script: bash add_crd.sh
#============================================================
var=( 'MOD10CM' ) # Variable
fld_in=( 'snc/nc/' ) # Folder of input files
drc_in='/media/grele_data/wenshan/modis/' # directory of input files
for fn in $( ls ${drc_in}${fld_in}${var}*.nc ); do # Loop over files
sfx=$( echo ${fn} | cut -d '/' -f 8 | cut -d '.' -f 2-4 ) # Part of file names
echo ${sfx}
# Rename dimension names
ncrename -d YDim_MOD_CMG_Snow_5km,lat -d XDim_MOD_CMG_Snow_5km,lon -O \
${drc_in}${fld_in}${var}.${sfx}.nc ${drc_in}${fld_in}${var}.${sfx}.nc
# Add coordinates
ncap2 -O -S crd.nco ${drc_in}${fld_in}${var}.${sfx}.nc \
${drc_in}${fld_in}${var}.${sfx}.nc
done
</pre></div>
<p><strong>crd.nco</strong>
</p><div class="example">
<pre class="verbatim">// Add coordinates to MODIS HDF data
// Included by add_crd.sh
// Online: http://nco.sourceforge.net/nco.html#Add-Coordinates-to-MODIS-Data
lon = array(0.f, 0.05, $lon) - 180;
lat = 90.f- array(0.f, 0.05, $lat);
</pre></div>
<hr>
<a name="Permute-MODIS-Coordinates"></a>
<div class="header">
<p>
Previous: <a href="#Add-Coordinates-to-MODIS-Data" accesskey="p" rel="previous">Add Coordinates to MODIS Data</a>, Up: <a href="#CMIP5-Example" accesskey="u" rel="up">CMIP5 Example</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#General-Index" title="Index" rel="index">Index</a>]</p>
</div>
<a name="Permute-MODIS-Coordinates-1"></a>
<h3 class="section">7.7 Permute <acronym>MODIS</acronym> Coordinates</h3>
<a name="index-coordinates_002c-modifying"></a>
<p><acronym>MODIS</acronym> orders latitude data from 90°N to
-90°N, and longitude from -180°E to
180°E.
However, <acronym>CMIP5</acronym> orders latitude from -90°N to
90°N, and longitude from 0°E to
360°E.
This script changes the <acronym>MODIS</acronym> coordinates to follow the
<acronym>CMIP5</acronym> convention.
</p><div class="example">
<pre class="verbatim">#!/bin/bash
##===========================================================================
## Example for
## - permute coordinates: the grid of MODIS is
## from (-180 degE, 90 degN), the left-up corner, to
## (180 degE, -90 degN), the right-low corner. However, CMIP5 is
## from (0 degE, -90 degN) to (360 degE, 90 degN). The script
## here changes the MODIS grid to CMIP5 grid.
##
## Input files:
## /modis/mcd43c3/cesm-grid/MCD43C3.2000049.regrid.nc
##
## Output files:
## /modis/mcd43c3/cesm-grid/MCD43C3.2000049.regrid.nc
##
## Online: http://nco.sourceforge.net/nco.html#Permute-MODIS-Coordinates
##
## Execute this script: bash pmt_crd.sh
##===========================================================================
##---------------------------------------------------------------------------
## Permute coordinates
## - Inverse lat from (90,-90) to (-90,90)
## - Permute lon from (-180,180) to (0,360)
for fn in $( ls MCD43C3.*.nc ); do # Loop over files
sfx=$( echo ${fn} | cut -d '.' -f 1-3 ) # Part of file names
echo ${sfx}
## Lat
ncpdq -O -a -lat ${fn} ${fn} # Inverse latitude (NB: there is '-' before 'lat')
## Lon
ncks -O --msa -d lon,0.0,180.0 -d lon,-180.0,-1.25 ${fn} ${fn}
## Add new longitude coordinates
ncap2 -O -s 'lon=array(0.0,1.25,$lon)' ${fn} ${fn}
done
</pre></div>
<a name="parallel"></a> <!-- http://nco.sf.net/nco.html#parallel --><hr>
<a name="Parallel"></a>
<div class="header">
<p>
Next: <a href="#CCSM-Example" accesskey="n" rel="next">CCSM Example</a>, Previous: <a href="#CMIP5-Example" accesskey="p" rel="previous">CMIP5 Example</a>, Up: <a href="#Top" accesskey="u" rel="up">Top</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#General-Index" title="Index" rel="index">Index</a>]</p>
</div>
<a name="Parallel-1"></a>
<h2 class="chapter">8 Parallel</h2>
<a name="index-parallel"></a>
<p>This section will describe scripting strategies, including the use of
<acronym>GNU</acronym> Parallel, to <acronym>NCO</acronym>.
</p><div class="example">
<pre class="example">ls *historical*.nc | parallel ncks -O -d time,"1950-01-01","2000-01-01" {} 50y/{}
</pre></div>
<a name="ccsm"></a> <!-- http://nco.sf.net/nco.html#ccsm --><hr>
<a name="CCSM-Example"></a>
<div class="header">
<p>
Next: <a href="#mybibnode" accesskey="n" rel="next">mybibnode</a>, Previous: <a href="#Parallel" accesskey="p" rel="previous">Parallel</a>, Up: <a href="#Top" accesskey="u" rel="up">Top</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#General-Index" title="Index" rel="index">Index</a>]</p>
</div>
<a name="CCSM-Example-1"></a>
<h2 class="chapter">9 CCSM Example</h2>
<a name="index-CCSM-1"></a>
<p>This chapter illustrates how to use <acronym>NCO</acronym> to
process and analyze the results of a <acronym>CCSM</acronym> climate simulation.
</p><div class="example">
<pre class="example">************************************************************************
Task 0: Finding input files
************************************************************************
The CCSM model outputs files to a local directory like:
/ptmp/zender/archive/T42x1_40
Each component model has its own subdirectory, e.g.,
/ptmp/zender/archive/T42x1_40/atm
/ptmp/zender/archive/T42x1_40/cpl
/ptmp/zender/archive/T42x1_40/ice
/ptmp/zender/archive/T42x1_40/lnd
/ptmp/zender/archive/T42x1_40/ocn
within which model output is tagged with the particular model name
/ptmp/zender/archive/T42x1_40/atm/T42x1_40.cam2.h0.0001-01.nc
/ptmp/zender/archive/T42x1_40/atm/T42x1_40.cam2.h0.0001-02.nc
/ptmp/zender/archive/T42x1_40/atm/T42x1_40.cam2.h0.0001-03.nc
...
/ptmp/zender/archive/T42x1_40/atm/T42x1_40.cam2.h0.0001-12.nc
/ptmp/zender/archive/T42x1_40/atm/T42x1_40.cam2.h0.0002-01.nc
/ptmp/zender/archive/T42x1_40/atm/T42x1_40.cam2.h0.0002-02.nc
...
or
/ptmp/zender/archive/T42x1_40/lnd/T42x1_40.clm2.h0.0001-01.nc
/ptmp/zender/archive/T42x1_40/lnd/T42x1_40.clm2.h0.0001-02.nc
/ptmp/zender/archive/T42x1_40/lnd/T42x1_40.clm2.h0.0001-03.nc
...
************************************************************************
Task 1: Regional processing
************************************************************************
The first task in data processing is often creating seasonal cycles.
Imagine a 100-year simulation with its 1200 monthly mean files.
Our goal is to create a single file containing 12 months of data.
Each month in the output file is the mean of 100 input files.
Normally, we store the "reduced" data in a smaller, local directory.
caseid='T42x1_40'
#drc_in="${DATA}/archive/${caseid}/atm"
drc_in="${DATA}/${caseid}"
drc_out="${DATA}/${caseid}"
mkdir -p ${drc_out}
cd ${drc_out}
Method 1: Assume all data in directory applies
for mth in {1..12}; do
mm=`printf "%02d" $mth`
ncra -O -D 1 -o ${drc_out}/${caseid}_clm${mm}.nc \
${drc_in}/${caseid}.cam2.h0.*-${mm}.nc
done # end loop over mth
Method 2: Use shell 'globbing' to construct input filenames
for mth in {1..12}; do
mm=`printf "%02d" $mth`
ncra -O -D 1 -o ${drc_out}/${caseid}_clm${mm}.nc \
${drc_in}/${caseid}.cam2.h0.00??-${mm}.nc \
${drc_in}/${caseid}.cam2.h0.0100-${mm}.nc
done # end loop over mth
Method 3: Construct input filename list explicitly
for mth in {1..12}; do
mm=`printf "%02d" $mth`
fl_lst_in=''
for yr in {1..100}; do
yyyy=`printf "%04d" $yr`
fl_in=${caseid}.cam2.h0.${yyyy}-${mm}.nc
fl_lst_in="${fl_lst_in} ${caseid}.cam2.h0.${yyyy}-${mm}.nc"
done # end loop over yr
ncra -O -D 1 -o ${drc_out}/${caseid}_clm${mm}.nc -p ${drc_in} \
${fl_lst_in}
done # end loop over mth
Make sure the output file averages correct input files!
ncks -M prints global metadata:
ncks -M ${drc_out}/${caseid}_clm01.nc
The input files ncra used to create the climatological monthly mean
will appear in the global attribute named 'history'.
Use ncrcat to aggregate the climatological monthly means
ncrcat -O -D 1 \
${drc_out}/${caseid}_clm??.nc ${drc_out}/${caseid}_clm_0112.nc
Finally, create climatological means for reference.
The climatological time-mean:
ncra -O -D 1 \
${drc_out}/${caseid}_clm_0112.nc ${drc_out}/${caseid}_clm.nc
The climatological zonal-mean:
ncwa -O -D 1 -a lon \
${drc_out}/${caseid}_clm.nc ${drc_out}/${caseid}_clm_x.nc
The climatological time- and spatial-mean:
ncwa -O -D 1 -a lon,lat,time -w gw \
${drc_out}/${caseid}_clm.nc ${drc_out}/${caseid}_clm_xyt.nc
This file contains only scalars, e.g., "global mean temperature",
used for summarizing global results of a climate experiment.
Climatological monthly anomalies = Annual Cycle:
Subtract climatological mean from climatological monthly means.
Result is annual cycle, i.e., climate-mean has been removed.
ncbo -O -D 1 -o ${drc_out}/${caseid}_clm_0112_anm.nc \
${drc_out}/${caseid}_clm_0112.nc ${drc_out}/${caseid}_clm_xyt.nc
************************************************************************
Task 2: Correcting monthly averages
************************************************************************
The previous step appoximates all months as being equal, so, e.g.,
February weighs slightly too much in the climatological mean.
This approximation can be removed by weighting months appropriately.
We must add the number of days per month to the monthly mean files.
First, create a shell variable dpm:
unset dpm # Days per month
declare -a dpm
dpm=(0 31 28.25 31 30 31 30 31 31 30 31 30 31) # Allows 1-based indexing
Method 1: Create dpm directly in climatological monthly means
for mth in {1..12}; do
mm=`printf "%02d" ${mth}`
ncap2 -O -s "dpm=0.0*date+${dpm[${mth}]}" \
${drc_out}/${caseid}_clm${mm}.nc ${drc_out}/${caseid}_clm${mm}.nc
done # end loop over mth
Method 2: Create dpm by aggregating small files
for mth in {1..12}; do
mm=`printf "%02d" ${mth}`
ncap2 -O -v -s "dpm=${dpm[${mth}]}" ~/nco/data/in.nc \
${drc_out}/foo_${mm}.nc
done # end loop over mth
ncecat -O -D 1 -p ${drc_out} -n 12,2,2 foo_${mm}.nc foo.nc
ncrename -O -D 1 -d record,time ${drc_out}/foo.nc
ncatted -O -h \
-a long_name,dpm,o,c,"Days per month" \
-a units,dpm,o,c,"days" \
${drc_out}/${caseid}_clm_0112.nc
ncks -A -v dpm ${drc_out}/foo.nc ${drc_out}/${caseid}_clm_0112.nc
Method 3: Create small netCDF file using ncgen
cat > foo.cdl << 'EOF'
netcdf foo {
dimensions:
time=unlimited;
variables:
float dpm(time);
dpm:long_name="Days per month";
dpm:units="days";
data:
dpm=31,28.25,31,30,31,30,31,31,30,31,30,31;
}
EOF
ncgen -b -o foo.nc foo.cdl
ncks -A -v dpm ${drc_out}/foo.nc ${drc_out}/${caseid}_clm_0112.nc
Another way to get correct monthly weighting is to average daily
output files, if available.
************************************************************************
Task 3: Regional processing
************************************************************************
Let's say you are interested in examining the California region.
Hyperslab your dataset to isolate the appropriate latitude/longitudes.
ncks -O -D 1 -d lat,30.0,37.0 -d lon,240.0,270.0 \
${drc_out}/${caseid}_clm_0112.nc \
${drc_out}/${caseid}_clm_0112_Cal.nc
The dataset is now much smaller!
To examine particular metrics.
************************************************************************
Task 4: Accessing data stored remotely
************************************************************************
OPeNDAP server examples:
UCI DAP servers:
ncks -M -p http://dust.ess.uci.edu/cgi-bin/dods/nph-dods/dodsdata in.nc
ncrcat -O -C -D 3 \
-p http://dust.ess.uci.edu/cgi-bin/dods/nph-dods/dodsdata \
-l /tmp in.nc in.nc ~/foo.nc
Unidata DAP servers:
ncks -M -p http://thredds-test.ucar.edu/thredds/dodsC/testdods in.nc
ncrcat -O -C -D 3 \
-p http://thredds-test.ucar.edu/thredds/dodsC/testdods \
-l /tmp in.nc in.nc ~/foo.nc
NOAA DAP servers:
ncwa -O -C -a lat,lon,time -d lon,-10.,10. -d lat,-10.,10. -l /tmp -p \
http://www.esrl.noaa.gov/psd/thredds/dodsC/Datasets/ncep.reanalysis.dailyavgs/surface \
pres.sfc.1969.nc ~/foo.nc
LLNL PCMDI IPCC OPeNDAP Data Portal:
ncks -M -p http://username:password@esgcet.llnl.gov/cgi-bin/dap-cgi.py/ipcc4/sresa1b/ncar_ccsm3_0 pcmdi.ipcc4.ncar_ccsm3_0.sresa1b.run1.atm.mo.xml
Earth System Grid (ESG): http://www.earthsystemgrid.org
caseid='b30.025.ES01'
CCSM3.0 1% increasing CO2 run, T42_gx1v3, 200 years starting in year 400
Atmospheric post-processed data, monthly averages, e.g.,
/data/zender/tmp/b30.025.ES01.cam2.h0.TREFHT.0400-01_cat_0449-12.nc
/data/zender/tmp/b30.025.ES01.cam2.h0.TREFHT.0400-01_cat_0599-12.nc
ESG supports password-protected FTP access by registered users
NCO uses the .netrc file, if present, for password-protected FTP access
Syntax for accessing single file is, e.g.,
ncks -O -D 3 \
-p ftp://climate.llnl.gov/sresa1b/atm/mo/tas/ncar_ccsm3_0/run1 \
-l /tmp tas_A1.SRESA1B_1.CCSM.atmm.2000-01_cat_2099-12.nc ~/foo.nc
# Average surface air temperature tas for SRESA1B scenario
# This loop is illustrative and will not work until NCO correctly
# translates '*' to FTP 'mget' all remote files
for var in 'tas'; do
for scn in 'sresa1b'; do
for mdl in 'cccma_cgcm3_1 cccma_cgcm3_1_t63 cnrm_cm3 csiro_mk3_0 \
gfdl_cm2_0 gfdl_cm2_1 giss_aom giss_model_e_h giss_model_e_r \
iap_fgoals1_0_g inmcm3_0 ipsl_cm4 miroc3_2_hires miroc3_2_medres \
miub_echo_g mpi_echam5 mri_cgcm2_3_2a ncar_ccsm3_0 ncar_pcm1 \
ukmo_hadcm3 ukmo_hadgem1'; do
for run in '1'; do
ncks -R -O -D 3 -p ftp://climate.llnl.gov/${scn}/atm/mo/${var}/${mdl}/run${run} -l ${DATA}/${scn}/atm/mo/${var}/${mdl}/run${run} '*' ${scn}_${mdl}_${run}_${var}_${yyyymm}_${yyyymm}.nc
done # end loop over run
done # end loop over mdl
done # end loop over scn
done # end loop over var
cd sresa1b/atm/mo/tas/ukmo_hadcm3/run1/
ncks -H -m -v lat,lon,lat_bnds,lon_bnds -M tas_A1.nc | m
bds -x 096 -y 073 -m 33 -o ${DATA}/data/dst_3.75x2.5.nc # ukmo_hadcm3
ncview ${DATA}/data/dst_3.75x2.5.nc
# msk_rgn is California mask on ukmo_hadcm3 grid
# area is correct area weight on ukmo_hadcm3 grid
ncks -A -v area,msk_rgn ${DATA}/data/dst_3.75x2.5.nc \
${DATA}/sresa1b/atm/mo/tas/ukmo_hadcm3/run1/area_msk_ukmo_hadcm3.nc
Template for standardized data:
${scn}_${mdl}_${run}_${var}_${yyyymm}_${yyyymm}.nc
e.g., raw data
${DATA}/sresa1b/atm/mo/tas/ukmo_hadcm3/run1/tas_A1.nc
becomes standardized data
Level 0: raw from IPCC site--no changes except for name
Make symbolic link name match raw data
Template: ${scn}_${mdl}_${run}_${var}_${yyyymm}_${yyyymm}.nc
ln -s -f tas_A1.nc sresa1b_ukmo_hadcm3_run1_tas_200101_209911.nc
area_msk_ukmo_hadcm3.nc
Level I: Add all variables (not standardized in time)
to file containing msk_rgn and area
Template: ${scn}_${mdl}_${run}_${yyyymm}_${yyyymm}.nc
/bin/cp area_msk_ukmo_hadcm3.nc sresa1b_ukmo_hadcm3_run1_200101_209911.nc
ncks -A -v tas sresa1b_ukmo_hadcm3_run1_tas_200101_209911.nc \
sresa1b_ukmo_hadcm3_run1_200101_209911.nc
ncks -A -v pr sresa1b_ukmo_hadcm3_run1_pr_200101_209911.nc \
sresa1b_ukmo_hadcm3_run1_200101_209911.nc
If already have file then:
mv sresa1b_ukmo_hadcm3_run1_200101_209911.nc foo.nc
/bin/cp area_msk_ukmo_hadcm3.nc sresa1b_ukmo_hadcm3_run1_200101_209911.nc
ncks -A -v tas,pr foo.nc sresa1b_ukmo_hadcm3_run1_200101_209911.nc
Level II: Correct # years, months
Template: ${scn}_${mdl}_${run}_${var}_${yyyymm}_${yyyymm}.nc
ncks -d time,....... file1.nc file2.nc
ncrcat file2.nc file3.nc sresa1b_ukmo_hadcm3_run1_200001_209912.nc
Level III: Many derived products from level II, e.g.,
A. Global mean timeseries
ncwa -w area -a lat,lon \
sresa1b_ukmo_hadcm3_run1_200001_209912.nc \
sresa1b_ukmo_hadcm3_run1_200001_209912_xy.nc
B. Califoria average timeseries
ncwa -m msk_rgn -w area -a lat,lon \
sresa1b_ukmo_hadcm3_run1_200001_209912.nc \
sresa1b_ukmo_hadcm3_run1_200001_209912_xy_Cal.nc
</pre></div>
<a name="bibliography"></a> <!-- http://nco.sf.net/nco.html#bibliography -->
<a name="bib"></a> <!-- http://nco.sf.net/nco.html#bib --><hr>
<a name="mybibnode"></a>
<div class="header">
<p>
Next: <a href="#General-Index" accesskey="n" rel="next">General Index</a>, Previous: <a href="#CCSM-Example" accesskey="p" rel="previous">CCSM Example</a>, Up: <a href="#Top" accesskey="u" rel="up">Top</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#General-Index" title="Index" rel="index">Index</a>]</p>
</div>
<a name="References"></a>
<h2 class="chapter">10 References</h2>
<ul>
<li> <a name="ZeM07"></a>[ZeM07]
Zender, C. S., and H. J. Mangalam (2007), Scaling Properties of Common Statistical Operators for Gridded Datasets, Int. J. High Perform. Comput. Appl., 21(4), 485-498, doi:10.1177/1094342007083802.
</li><li> <a name="Zen08"></a>[Zen08]
Zender, C. S. (2008), Analysis of Self-describing Gridded Geoscience Data with netCDF Operators (NCO), Environ. Modell. Softw., 23(10), 1338-1342, doi:10.1016/j.envsoft.2008.03.004.
</li><li> <a name="WZJ07"></a>[WZJ07]
Wang, D. L., C. S. Zender, and S. F. Jenks (2007), DAP-enabled Server-side Data Reduction and Analysis, Proceedings of the 23rd AMS Conference on Interactive Information and Processing Systems (IIPS) for Meteorology, Oceanography, and Hydrology, Paper 3B.2, January 14-18, San Antonio, TX. American Meteorological Society, AMS Press, Boston, MA.
</li><li> <a name="ZMW06"></a>[ZMW06]
Zender, C. S., H. Mangalam, and D. L. Wang (2006), Improving Scaling Properties of Common Statistical Operators for Gridded Geoscience Datasets, Eos Trans. AGU, 87(52), Fall Meet. Suppl., Abstract IN53B-0827.
</li><li> <a name="ZeW07"></a>[ZeW07]
Zender, C. S., and D. L. Wang (2007), High performance distributed data reduction and analysis with the netCDF Operators (NCO), Proceedings of the 23rd AMS Conference on Interactive Information and Processing Systems (IIPS) for Meteorology, Oceanography, and Hydrology, Paper 3B.4, January 14-18, San Antonio, TX. American Meteorological Society, AMS Press, Boston, MA.
</li><li> <a name="WZJ06"></a>[WZJ06]
Wang, D. L., C. S. Zender, and S. F. Jenks (2006), Server-side netCDF Data Reduction and Analysis, Eos Trans. AGU, 87(52), Fall Meet. Suppl., Abstract IN53B-0826.
</li><li> <a name="WZJ073"></a>[WZJ073]
Wang, D. L., C. S. Zender, and S. F. Jenks (2007), Server-side parallel data reduction and analysis, in Advances in Grid and Pervasive Computing, Second International Conference, GPC 2007, Paris, France, May 2-4, 2007, Proceedings. IEEE Lecture Notes in Computer Science, vol. 4459, edited by C. Cerin and K.-C. Li, pp. 744-750, Springer-Verlag, Berlin/Heidelberg, doi:10.1007/978-3-540-72360-8_67.
</li><li> <a name="WZJ074"></a>[WZJ074]
Wang, D. L., C. S. Zender and S. F. Jenks (2007), A System for Scripted Data Analysis at Remote Data Centers, Eos Trans. AGU, 88(52), Fall Meet. Suppl., Abstract IN11B-0469.
</li><li> <a name="WZJ081"></a>[WZJ081]
Wang, D. L., C. S. Zender and S. F. Jenks (2008), Cluster Workflow Execution of Retargeted Data Analysis Scripts, Proceedings of the 8th IEEE Int’l Symposium on Cluster Computing and the Grid (IEEE CCGRID ’08), pp. 449-458, Lyon, France, May 2008.
</li><li> <a name="WZJ091"></a>[WZJ091]
Wang, D. L., C. S. Zender, and S. F. Jenks (2009), Efficient Clustered Server-side Data Analysis Workflows using SWAMP, Earth Sci. Inform., 2(3), 141-155, doi:10.1007/s12145-009-0021-z.
</li><li> <a name="PFT88"></a>[PFT88]
Press, Flannery, Teukolsky, and Vetterling (1988), Numerical Recipes in C, Cambridge Univ. Press, New York, NY.
</li></ul>
<a name="index"></a> <!-- http://nco.sf.net/nco.html#index -->
<a name="idx"></a> <!-- http://nco.sf.net/nco.html#idx --><hr>
<a name="General-Index"></a>
<div class="header">
<p>
Previous: <a href="#mybibnode" accesskey="p" rel="previous">mybibnode</a>, Up: <a href="#Top" accesskey="u" rel="up">Top</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#General-Index" title="Index" rel="index">Index</a>]</p>
</div>
<a name="General-Index-1"></a>
<h2 class="unnumbered">General Index</h2>
<table><tr><th valign="top">Jump to: </th><td><a class="summary-letter" href="#General-Index_cp_symbol-1"><b>"</b></a>
<a class="summary-letter" href="#General-Index_cp_symbol-2"><b>#</b></a>
<a class="summary-letter" href="#General-Index_cp_symbol-3"><b>$</b></a>
<a class="summary-letter" href="#General-Index_cp_symbol-4"><b>%</b></a>
<a class="summary-letter" href="#General-Index_cp_symbol-5"><b>'</b></a>
<a class="summary-letter" href="#General-Index_cp_symbol-6"><b>*</b></a>
<a class="summary-letter" href="#General-Index_cp_symbol-7"><b>+</b></a>
<a class="summary-letter" href="#General-Index_cp_symbol-8"><b>-</b></a>
<a class="summary-letter" href="#General-Index_cp_symbol-9"><b>.</b></a>
<a class="summary-letter" href="#General-Index_cp_symbol-10"><b>/</b></a>
<a class="summary-letter" href="#General-Index_cp_symbol-11"><b>0</b></a>
<a class="summary-letter" href="#General-Index_cp_symbol-12"><b>3</b></a>
<a class="summary-letter" href="#General-Index_cp_symbol-13"><b>6</b></a>
<a class="summary-letter" href="#General-Index_cp_symbol-14"><b>:</b></a>
<a class="summary-letter" href="#General-Index_cp_symbol-15"><b>;</b></a>
<a class="summary-letter" href="#General-Index_cp_symbol-16"><b><</b></a>
<a class="summary-letter" href="#General-Index_cp_symbol-17"><b>?</b></a>
<a class="summary-letter" href="#General-Index_cp_symbol-18"><b>@</b></a>
<a class="summary-letter" href="#General-Index_cp_symbol-19"><b>[</b></a>
<a class="summary-letter" href="#General-Index_cp_symbol-20"><b>\</b></a>
<a class="summary-letter" href="#General-Index_cp_symbol-21"><b>^</b></a>
<a class="summary-letter" href="#General-Index_cp_symbol-22"><b>_</b></a>
<a class="summary-letter" href="#General-Index_cp_symbol-23"><b>|</b></a>
<br>
<a class="summary-letter" href="#General-Index_cp_letter-A"><b>A</b></a>
<a class="summary-letter" href="#General-Index_cp_letter-B"><b>B</b></a>
<a class="summary-letter" href="#General-Index_cp_letter-C"><b>C</b></a>
<a class="summary-letter" href="#General-Index_cp_letter-D"><b>D</b></a>
<a class="summary-letter" href="#General-Index_cp_letter-E"><b>E</b></a>
<a class="summary-letter" href="#General-Index_cp_letter-F"><b>F</b></a>
<a class="summary-letter" href="#General-Index_cp_letter-G"><b>G</b></a>
<a class="summary-letter" href="#General-Index_cp_letter-H"><b>H</b></a>
<a class="summary-letter" href="#General-Index_cp_letter-I"><b>I</b></a>
<a class="summary-letter" href="#General-Index_cp_letter-J"><b>J</b></a>
<a class="summary-letter" href="#General-Index_cp_letter-K"><b>K</b></a>
<a class="summary-letter" href="#General-Index_cp_letter-L"><b>L</b></a>
<a class="summary-letter" href="#General-Index_cp_letter-M"><b>M</b></a>
<a class="summary-letter" href="#General-Index_cp_letter-N"><b>N</b></a>
<a class="summary-letter" href="#General-Index_cp_letter-O"><b>O</b></a>
<a class="summary-letter" href="#General-Index_cp_letter-P"><b>P</b></a>
<a class="summary-letter" href="#General-Index_cp_letter-Q"><b>Q</b></a>
<a class="summary-letter" href="#General-Index_cp_letter-R"><b>R</b></a>
<a class="summary-letter" href="#General-Index_cp_letter-S"><b>S</b></a>
<a class="summary-letter" href="#General-Index_cp_letter-T"><b>T</b></a>
<a class="summary-letter" href="#General-Index_cp_letter-U"><b>U</b></a>
<a class="summary-letter" href="#General-Index_cp_letter-V"><b>V</b></a>
<a class="summary-letter" href="#General-Index_cp_letter-W"><b>W</b></a>
<a class="summary-letter" href="#General-Index_cp_letter-X"><b>X</b></a>
<a class="summary-letter" href="#General-Index_cp_letter-Y"><b>Y</b></a>
</td></tr></table>
<table class="index-cp" border="0">
<tr><td></td><th align="left">Index Entry</th><td> </td><th align="left"> Section</th></tr>
<tr><td colspan="4"> <hr></td></tr>
<tr><th><a name="General-Index_cp_symbol-1">"</a></th><td></td><td></td></tr>
<tr><td></td><td valign="top"><a href="#index-_0022-_0028double-quote_0029"><code>"</code> (double quote)</a>:</td><td> </td><td valign="top"><a href="#ncatted-netCDF-Attribute-Editor">ncatted netCDF Attribute Editor</a></td></tr>
<tr><td colspan="4"> <hr></td></tr>
<tr><th><a name="General-Index_cp_symbol-2">#</a></th><td></td><td></td></tr>
<tr><td></td><td valign="top"><a href="#index-_0023include"><code>#include</code></a>:</td><td> </td><td valign="top"><a href="#Syntax-of-ncap2-statements">Syntax of ncap2 statements</a></td></tr>
<tr><td colspan="4"> <hr></td></tr>
<tr><th><a name="General-Index_cp_symbol-3">$</a></th><td></td><td></td></tr>
<tr><td></td><td valign="top"><a href="#index-_0024-_0028wildcard-character_0029"><code>$</code> (wildcard character)</a>:</td><td> </td><td valign="top"><a href="#Subsetting-Files">Subsetting Files</a></td></tr>
<tr><td colspan="4"> <hr></td></tr>
<tr><th><a name="General-Index_cp_symbol-4">%</a></th><td></td><td></td></tr>
<tr><td></td><td valign="top"><a href="#index-_0025-_0028modulus_0029"><code>%</code> (modulus)</a>:</td><td> </td><td valign="top"><a href="#Intrinsic-mathematical-methods">Intrinsic mathematical methods</a></td></tr>
<tr><td colspan="4"> <hr></td></tr>
<tr><th><a name="General-Index_cp_symbol-5">'</a></th><td></td><td></td></tr>
<tr><td></td><td valign="top"><a href="#index-_0027-_0028end-quote_0029"><code>'</code> (end quote)</a>:</td><td> </td><td valign="top"><a href="#ncatted-netCDF-Attribute-Editor">ncatted netCDF Attribute Editor</a></td></tr>
<tr><td colspan="4"> <hr></td></tr>
<tr><th><a name="General-Index_cp_symbol-6">*</a></th><td></td><td></td></tr>
<tr><td></td><td valign="top"><a href="#index-_002a"><code>*</code></a>:</td><td> </td><td valign="top"><a href="#ncbo-netCDF-Binary-Operator">ncbo netCDF Binary Operator</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-_002a-_0028filename-expansion_0029"><code>*</code> (filename expansion)</a>:</td><td> </td><td valign="top"><a href="#Subsetting-Files">Subsetting Files</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-_002a-_0028multiplication_0029"><code>*</code> (multiplication)</a>:</td><td> </td><td valign="top"><a href="#Intrinsic-mathematical-methods">Intrinsic mathematical methods</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-_002a-_0028wildcard-character_0029"><code>*</code> (wildcard character)</a>:</td><td> </td><td valign="top"><a href="#Subsetting-Files">Subsetting Files</a></td></tr>
<tr><td colspan="4"> <hr></td></tr>
<tr><th><a name="General-Index_cp_symbol-7">+</a></th><td></td><td></td></tr>
<tr><td></td><td valign="top"><a href="#index-_002b"><code>+</code></a>:</td><td> </td><td valign="top"><a href="#ncbo-netCDF-Binary-Operator">ncbo netCDF Binary Operator</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-_002b-_0028addition_0029"><code>+</code> (addition)</a>:</td><td> </td><td valign="top"><a href="#Intrinsic-mathematical-methods">Intrinsic mathematical methods</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-_002b-_0028wildcard-character_0029"><code>+</code> (wildcard character)</a>:</td><td> </td><td valign="top"><a href="#Subsetting-Files">Subsetting Files</a></td></tr>
<tr><td colspan="4"> <hr></td></tr>
<tr><th><a name="General-Index_cp_symbol-8">-</a></th><td></td><td></td></tr>
<tr><td></td><td valign="top"><a href="#index-_002d"><code>-</code></a>:</td><td> </td><td valign="top"><a href="#ncbo-netCDF-Binary-Operator">ncbo netCDF Binary Operator</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-_002d-_0028subtraction_0029"><code>-</code> (subtraction)</a>:</td><td> </td><td valign="top"><a href="#Intrinsic-mathematical-methods">Intrinsic mathematical methods</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-_002d_002d3"><code>--3</code></a>:</td><td> </td><td valign="top"><a href="#File-Formats-and-Conversion">File Formats and Conversion</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-_002d_002d4"><code>--4</code></a>:</td><td> </td><td valign="top"><a href="#File-Formats-and-Conversion">File Formats and Conversion</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-_002d_002d64bit"><code>--64bit</code></a>:</td><td> </td><td valign="top"><a href="#File-Formats-and-Conversion">File Formats and Conversion</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-_002d_002d7"><code>--7</code></a>:</td><td> </td><td valign="top"><a href="#File-Formats-and-Conversion">File Formats and Conversion</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-_002d_002dabc"><code>--abc</code></a>:</td><td> </td><td valign="top"><a href="#ncks-netCDF-Kitchen-Sink">ncks netCDF Kitchen Sink</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-_002d_002dalphabetize"><code>--alphabetize</code></a>:</td><td> </td><td valign="top"><a href="#ncks-netCDF-Kitchen-Sink">ncks netCDF Kitchen Sink</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-_002d_002dapn"><code>--apn</code></a>:</td><td> </td><td valign="top"><a href="#Temporary-Output-Files">Temporary Output Files</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-_002d_002dapn-1"><code>--apn</code></a>:</td><td> </td><td valign="top"><a href="#Batch-Mode">Batch Mode</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-_002d_002dapn-2"><code>--apn</code></a>:</td><td> </td><td valign="top"><a href="#Filters-for-ncks">Filters for <code>ncks</code></a></td></tr>
<tr><td></td><td valign="top"><a href="#index-_002d_002dappend"><code>--append</code></a>:</td><td> </td><td valign="top"><a href="#Temporary-Output-Files">Temporary Output Files</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-_002d_002dappend-1"><code>--append</code></a>:</td><td> </td><td valign="top"><a href="#Batch-Mode">Batch Mode</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-_002d_002dappend-2"><code>--append</code></a>:</td><td> </td><td valign="top"><a href="#Filters-for-ncks">Filters for <code>ncks</code></a></td></tr>
<tr><td></td><td valign="top"><a href="#index-_002d_002dauxiliary"><code>--auxiliary</code></a>:</td><td> </td><td valign="top"><a href="#Auxiliary-Coordinates">Auxiliary Coordinates</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-_002d_002dauxiliary-lon_005fmin_002clon_005fmax_002clat_005fmin_002clat_005fmax"><code>--auxiliary <var>lon_min</var>,<var>lon_max</var>,<var>lat_min</var>,<var>lat_max</var></code></a>:</td><td> </td><td valign="top"><a href="#Auxiliary-Coordinates">Auxiliary Coordinates</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-_002d_002dbfr_005fsz_005fhnt"><code>--bfr_sz_hnt</code></a>:</td><td> </td><td valign="top"><a href="#Buffer-sizes">Buffer sizes</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-_002d_002dbinary"><code>--binary</code></a>:</td><td> </td><td valign="top"><a href="#ncks-netCDF-Kitchen-Sink">ncks netCDF Kitchen Sink</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-_002d_002dbnr"><code>--bnr</code></a>:</td><td> </td><td valign="top"><a href="#ncks-netCDF-Kitchen-Sink">ncks netCDF Kitchen Sink</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-_002d_002dcdl"><code>--cdl</code></a>:</td><td> </td><td valign="top"><a href="#ncks-netCDF-Kitchen-Sink">ncks netCDF Kitchen Sink</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-_002d_002dcell_005fmethods"><code>--cell_methods</code></a>:</td><td> </td><td valign="top"><a href="#CF-Conventions">CF Conventions</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-_002d_002dchunk_005fbyte"><code>--chunk_byte</code></a>:</td><td> </td><td valign="top"><a href="#Chunking">Chunking</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-_002d_002dchunk_005fdimension"><code>--chunk_dimension</code></a>:</td><td> </td><td valign="top"><a href="#Chunking">Chunking</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-_002d_002dchunk_005fmap"><code>--chunk_map</code></a>:</td><td> </td><td valign="top"><a href="#Chunking">Chunking</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-_002d_002dchunk_005fpolicy"><code>--chunk_policy</code></a>:</td><td> </td><td valign="top"><a href="#Chunking">Chunking</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-_002d_002dchunk_005fscalar"><code>--chunk_scalar</code></a>:</td><td> </td><td valign="top"><a href="#Chunking">Chunking</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-_002d_002dcll_005fmth"><code>--cll_mth</code></a>:</td><td> </td><td valign="top"><a href="#CF-Conventions">CF Conventions</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-_002d_002dcnk_005fbyt"><code>--cnk_byt</code></a>:</td><td> </td><td valign="top"><a href="#Chunking">Chunking</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-_002d_002dcnk_005fdmn"><code>--cnk_dmn</code></a>:</td><td> </td><td valign="top"><a href="#Chunking">Chunking</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-_002d_002dcnk_005fmap"><code>--cnk_map</code></a>:</td><td> </td><td valign="top"><a href="#Chunking">Chunking</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-_002d_002dcnk_005fmap-cnk_005fmap"><code>--cnk_map <var>cnk_map</var></code></a>:</td><td> </td><td valign="top"><a href="#Chunking">Chunking</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-_002d_002dcnk_005fplc"><code>--cnk_plc</code></a>:</td><td> </td><td valign="top"><a href="#Chunking">Chunking</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-_002d_002dcnk_005fscl"><code>--cnk_scl</code></a>:</td><td> </td><td valign="top"><a href="#Chunking">Chunking</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-_002d_002dcoords"><code>--coords</code></a>:</td><td> </td><td valign="top"><a href="#Subsetting-Coordinate-Variables">Subsetting Coordinate Variables</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-_002d_002dcoords-1"><code>--coords</code></a>:</td><td> </td><td valign="top"><a href="#CF-Conventions">CF Conventions</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-_002d_002dcrd"><code>--crd</code></a>:</td><td> </td><td valign="top"><a href="#Subsetting-Coordinate-Variables">Subsetting Coordinate Variables</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-_002d_002dcrd-1"><code>--crd</code></a>:</td><td> </td><td valign="top"><a href="#CF-Conventions">CF Conventions</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-_002d_002dcreate_005fram"><code>--create_ram</code></a>:</td><td> </td><td valign="top"><a href="#Temporary-Output-Files">Temporary Output Files</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-_002d_002dcreate_005fram-1"><code>--create_ram</code></a>:</td><td> </td><td valign="top"><a href="#RAM-disks">RAM disks</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-_002d_002ddata"><code>--data</code></a>:</td><td> </td><td valign="top"><a href="#ncks-netCDF-Kitchen-Sink">ncks netCDF Kitchen Sink</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-_002d_002ddbg_005flvl-debug_002dlevel"><code>--dbg_lvl <var>debug-level</var></code></a>:</td><td> </td><td valign="top"><a href="#Help-Requests-and-Bug-Reports">Help Requests and Bug Reports</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-_002d_002ddbg_005flvl-debug_002dlevel-1"><code>--dbg_lvl <var>debug-level</var></code></a>:</td><td> </td><td valign="top"><a href="#Large-Datasets">Large Datasets</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-_002d_002ddbg_005flvl-debug_002dlevel-2"><code>--dbg_lvl <var>debug-level</var></code></a>:</td><td> </td><td valign="top"><a href="#Command-Line-Options">Command Line Options</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-_002d_002ddbl"><code>--dbl</code></a>:</td><td> </td><td valign="top"><a href="#Promoting-Single_002dprecision-to-Double">Promoting Single-precision to Double</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-_002d_002ddebug_002dlevel-debug_002dlevel"><code>--debug-level <var>debug-level</var></code></a>:</td><td> </td><td valign="top"><a href="#Help-Requests-and-Bug-Reports">Help Requests and Bug Reports</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-_002d_002ddebug_002dlevel-debug_002dlevel-1"><code>--debug-level <var>debug-level</var></code></a>:</td><td> </td><td valign="top"><a href="#Large-Datasets">Large Datasets</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-_002d_002ddeflate"><code>--deflate</code></a>:</td><td> </td><td valign="top"><a href="#Deflation">Deflation</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-_002d_002ddfl_005flvl"><code>--dfl_lvl</code></a>:</td><td> </td><td valign="top"><a href="#Deflation">Deflation</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-_002d_002ddimension-dim_002c_005bmin_005d_002c_005bmax_005d_002cstride"><code>--dimension <var>dim</var>,[<var>min</var>],[<var>max</var>],<var>stride</var></code></a>:</td><td> </td><td valign="top"><a href="#Stride">Stride</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-_002d_002ddimension-dim_002c_005bmin_005d_002c_005bmax_005d_002c_005bstride_005d_002c_005bsubcycle_005d"><code>--dimension <var>dim</var>,[<var>min</var>],[<var>max</var>],[<var>stride</var>],[<var>subcycle</var>]</code></a>:</td><td> </td><td valign="top"><a href="#Subcycle">Subcycle</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-_002d_002ddimension-dim_002c_005bmin_005d_005b_002c_005bmax_005d_005b_002c_005bstride_005d_005d_005d"><code>--dimension <var>dim</var>,[<var>min</var>][,[<var>max</var>][,[<var>stride</var>]]]</code></a>:</td><td> </td><td valign="top"><a href="#Hyperslabs">Hyperslabs</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-_002d_002ddimension-dim_002c_005bmin_005d_005b_002c_005bmax_005d_005b_002c_005bstride_005d_005d_005d-1"><code>--dimension <var>dim</var>,[<var>min</var>][,[<var>max</var>][,[<var>stride</var>]]]</code></a>:</td><td> </td><td valign="top"><a href="#Multislabs">Multislabs</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-_002d_002ddimension-dim_002c_005bmin_005d_005b_002c_005bmax_005d_005b_002c_005bstride_005d_005d_005d-2"><code>--dimension <var>dim</var>,[<var>min</var>][,[<var>max</var>][,[<var>stride</var>]]]</code></a>:</td><td> </td><td valign="top"><a href="#Wrapped-Coordinates">Wrapped Coordinates</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-_002d_002ddimension-dim_002c_005bmin_005d_005b_002c_005bmax_005d_005b_002c_005bstride_005d_005d_005d-3"><code>--dimension <var>dim</var>,[<var>min</var>][,[<var>max</var>][,[<var>stride</var>]]]</code></a>:</td><td> </td><td valign="top"><a href="#UDUnits-Support">UDUnits Support</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-_002d_002ddiskless_005fall"><code>--diskless_all</code></a>:</td><td> </td><td valign="top"><a href="#Memory-Requirements">Memory Requirements</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-_002d_002ddiskless_005fall-1"><code>--diskless_all</code></a>:</td><td> </td><td valign="top"><a href="#RAM-disks">RAM disks</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-_002d_002ddmn-dim_002c_005bmin_005d_002c_005bmax_005d_002cstride"><code>--dmn <var>dim</var>,[<var>min</var>],[<var>max</var>],<var>stride</var></code></a>:</td><td> </td><td valign="top"><a href="#Stride">Stride</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-_002d_002ddmn-dim_002c_005bmin_005d_002c_005bmax_005d_002c_005bstride_005d_002csubcycle_005d"><code>--dmn <var>dim</var>,[<var>min</var>],[<var>max</var>],[<var>stride</var>],<var>subcycle</var>]</code></a>:</td><td> </td><td valign="top"><a href="#Subcycle">Subcycle</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-_002d_002ddmn-dim_002c_005bmin_005d_005b_002c_005bmax_005d_005b_002c_005bstride_005d_005d_005d"><code>--dmn <var>dim</var>,[<var>min</var>][,[<var>max</var>][,[<var>stride</var>]]]</code></a>:</td><td> </td><td valign="top"><a href="#Hyperslabs">Hyperslabs</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-_002d_002ddmn-dim_002c_005bmin_005d_005b_002c_005bmax_005d_005b_002c_005bstride_005d_005d_005d-1"><code>--dmn <var>dim</var>,[<var>min</var>][,[<var>max</var>][,[<var>stride</var>]]]</code></a>:</td><td> </td><td valign="top"><a href="#Multislabs">Multislabs</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-_002d_002ddmn-dim_002c_005bmin_005d_005b_002c_005bmax_005d_005b_002c_005bstride_005d_005d_005d-2"><code>--dmn <var>dim</var>,[<var>min</var>][,[<var>max</var>][,[<var>stride</var>]]]</code></a>:</td><td> </td><td valign="top"><a href="#Wrapped-Coordinates">Wrapped Coordinates</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-_002d_002ddmn-dim_002c_005bmin_005d_005b_002c_005bmax_005d_005b_002c_005bstride_005d_005d_005d-3"><code>--dmn <var>dim</var>,[<var>min</var>][,[<var>max</var>][,[<var>stride</var>]]]</code></a>:</td><td> </td><td valign="top"><a href="#UDUnits-Support">UDUnits Support</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-_002d_002densemble_005ffile"><code>--ensemble_file</code></a>:</td><td> </td><td valign="top"><a href="#nces-netCDF-Ensemble-Statistics">nces netCDF Ensemble Statistics</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-_002d_002densemble_005fgroup"><code>--ensemble_group</code></a>:</td><td> </td><td valign="top"><a href="#nces-netCDF-Ensemble-Statistics">nces netCDF Ensemble Statistics</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-_002d_002densemble_005fsuffix"><code>--ensemble_suffix</code></a>:</td><td> </td><td valign="top"><a href="#nces-netCDF-Ensemble-Statistics">nces netCDF Ensemble Statistics</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-_002d_002dexclude"><code>--exclude</code></a>:</td><td> </td><td valign="top"><a href="#Subsetting-Files">Subsetting Files</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-_002d_002dexclude-1"><code>--exclude</code></a>:</td><td> </td><td valign="top"><a href="#Filters-for-ncks">Filters for <code>ncks</code></a></td></tr>
<tr><td></td><td valign="top"><a href="#index-_002d_002dfile_005fformat"><code>--file_format</code></a>:</td><td> </td><td valign="top"><a href="#File-Formats-and-Conversion">File Formats and Conversion</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-_002d_002dfile_005flist"><code>--file_list</code></a>:</td><td> </td><td valign="top"><a href="#File-List-Attributes">File List Attributes</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-_002d_002dfix_005frec_005fdmn-all"><code>--fix_rec_dmn all</code></a>:</td><td> </td><td valign="top"><a href="#Autoconversion">Autoconversion</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-_002d_002dfix_005frec_005fdmn-dim"><code>--fix_rec_dmn <var>dim</var></code></a>:</td><td> </td><td valign="top"><a href="#ncks-netCDF-Kitchen-Sink">ncks netCDF Kitchen Sink</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-_002d_002dflt"><code>--flt</code></a>:</td><td> </td><td valign="top"><a href="#Promoting-Single_002dprecision-to-Double">Promoting Single-precision to Double</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-_002d_002dfl_005fbnr"><code>--fl_bnr</code></a>:</td><td> </td><td valign="top"><a href="#ncks-netCDF-Kitchen-Sink">ncks netCDF Kitchen Sink</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-_002d_002dfl_005ffmt"><code>--fl_fmt</code></a>:</td><td> </td><td valign="top"><a href="#File-Formats-and-Conversion">File Formats and Conversion</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-_002d_002dfl_005flst_005fin"><code>--fl_lst_in</code></a>:</td><td> </td><td valign="top"><a href="#File-List-Attributes">File List Attributes</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-_002d_002dfl_005fout-fl_005fout"><code>--fl_out <var>fl_out</var></code></a>:</td><td> </td><td valign="top"><a href="#Specifying-Output-Files">Specifying Output Files</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-_002d_002dfl_005fspt"><code>--fl_spt</code></a>:</td><td> </td><td valign="top"><a href="#ncap2-netCDF-Arithmetic-Processor">ncap2 netCDF Arithmetic Processor</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-_002d_002dfnc_005ftbl"><code>--fnc_tbl</code></a>:</td><td> </td><td valign="top"><a href="#Intrinsic-mathematical-methods">Intrinsic mathematical methods</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-_002d_002dfortran"><code>--fortran</code></a>:</td><td> </td><td valign="top"><a href="#C-and-Fortran-Index-Conventions">C and Fortran Index Conventions</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-_002d_002dgag"><samp>--gag</samp></a>:</td><td> </td><td valign="top"><a href="#ncecat-netCDF-Ensemble-Concatenator">ncecat netCDF Ensemble Concatenator</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-_002d_002dgag-1"><samp>--gag</samp></a>:</td><td> </td><td valign="top"><a href="#Combine-Files">Combine Files</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-_002d_002dglb_005fmtd_005fspp"><code>--glb_mtd_spp</code></a>:</td><td> </td><td valign="top"><a href="#ncecat-netCDF-Ensemble-Concatenator">ncecat netCDF Ensemble Concatenator</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-_002d_002dgpe-gpe_005fdsc"><code>--gpe <var>gpe_dsc</var></code></a>:</td><td> </td><td valign="top"><a href="#Group-Path-Editing">Group Path Editing</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-_002d_002dgroup-grp"><code>--group <var>grp</var></code></a>:</td><td> </td><td valign="top"><a href="#Subsetting-Files">Subsetting Files</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-_002d_002dgrp-grp"><code>--grp <var>grp</var></code></a>:</td><td> </td><td valign="top"><a href="#Subsetting-Files">Subsetting Files</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-_002d_002dhdf4">‘<samp>--hdf4</samp>’</a>:</td><td> </td><td valign="top"><a href="#netCDF2_002f3_002f4-and-HDF4_002f5-Support">netCDF2/3/4 and HDF4/5 Support</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-_002d_002dhdf_005funpack"><code>--hdf_unpack</code></a>:</td><td> </td><td valign="top"><a href="#Packed-data">Packed data</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-_002d_002dhdf_005fupk"><code>--hdf_upk</code></a>:</td><td> </td><td valign="top"><a href="#Packed-data">Packed data</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-_002d_002dhdn"><code>--hdn</code></a>:</td><td> </td><td valign="top"><a href="#ncks-netCDF-Kitchen-Sink">ncks netCDF Kitchen Sink</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-_002d_002dhdr_005fpad-hdr_005fpad"><code>--hdr_pad <var>hdr_pad</var></code></a>:</td><td> </td><td valign="top"><a href="#Metadata-Optimization">Metadata Optimization</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-_002d_002dheader_005fpad-hdr_005fpad"><code>--header_pad <var>hdr_pad</var></code></a>:</td><td> </td><td valign="top"><a href="#Metadata-Optimization">Metadata Optimization</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-_002d_002dhidden"><code>--hidden</code></a>:</td><td> </td><td valign="top"><a href="#ncks-netCDF-Kitchen-Sink">ncks netCDF Kitchen Sink</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-_002d_002dhieronymus"><code>--hieronymus</code></a>:</td><td> </td><td valign="top"><a href="#ncks-netCDF-Kitchen-Sink">ncks netCDF Kitchen Sink</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-_002d_002dhistory"><code>--history</code></a>:</td><td> </td><td valign="top"><a href="#History-Attribute">History Attribute</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-_002d_002dhst"><code>--hst</code></a>:</td><td> </td><td valign="top"><a href="#History-Attribute">History Attribute</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-_002d_002dintersection"><code>--intersection</code></a>:</td><td> </td><td valign="top"><a href="#Subsetting-Files">Subsetting Files</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-_002d_002dlcl-output_002dpath"><code>--lcl <var>output-path</var></code></a>:</td><td> </td><td valign="top"><a href="#Remote-storage">Remote storage</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-_002d_002dlocal-output_002dpath"><code>--local <var>output-path</var></code></a>:</td><td> </td><td valign="top"><a href="#Remote-storage">Remote storage</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-_002d_002dmap-cnk_005fmap"><code>--map <var>cnk_map</var></code></a>:</td><td> </td><td valign="top"><a href="#Chunking">Chunking</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-_002d_002dmap-pck_005fmap"><code>--map <var>pck_map</var></code></a>:</td><td> </td><td valign="top"><a href="#ncpdq-netCDF-Permute-Dimensions-Quickly">ncpdq netCDF Permute Dimensions Quickly</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-_002d_002dmask_002dvalue-mask_005fval"><code>--mask-value <var>mask_val</var></code></a>:</td><td> </td><td valign="top"><a href="#Mask-condition">Mask condition</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-_002d_002dmask_002dvariable-mask_005fvar"><code>--mask-variable <var>mask_var</var></code></a>:</td><td> </td><td valign="top"><a href="#ncwa-netCDF-Weighted-Averager">ncwa netCDF Weighted Averager</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-_002d_002dmask_005fcomparator-mask_005fcomp"><code>--mask_comparator <var>mask_comp</var></code></a>:</td><td> </td><td valign="top"><a href="#Mask-condition">Mask condition</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-_002d_002dmask_005fcondition-mask_005fcond"><code>--mask_condition <var>mask_cond</var></code></a>:</td><td> </td><td valign="top"><a href="#ncwa-netCDF-Weighted-Averager">ncwa netCDF Weighted Averager</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-_002d_002dmask_005fcondition-mask_005fcond-1"><code>--mask_condition <var>mask_cond</var></code></a>:</td><td> </td><td valign="top"><a href="#Mask-condition">Mask condition</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-_002d_002dmask_005fvalue-mask_005fval"><code>--mask_value <var>mask_val</var></code></a>:</td><td> </td><td valign="top"><a href="#Mask-condition">Mask condition</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-_002d_002dmask_005fvariable-mask_005fvar"><code>--mask_variable <var>mask_var</var></code></a>:</td><td> </td><td valign="top"><a href="#ncwa-netCDF-Weighted-Averager">ncwa netCDF Weighted Averager</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-_002d_002dmd5_005fdgs"><code>--md5_dgs</code></a>:</td><td> </td><td valign="top"><a href="#MD5-digests">MD5 digests</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-_002d_002dmd5_005fdigest"><code>--md5_digest</code></a>:</td><td> </td><td valign="top"><a href="#MD5-digests">MD5 digests</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-_002d_002dmd5_005fwrite_005fattribute"><code>--md5_write_attribute</code></a>:</td><td> </td><td valign="top"><a href="#MD5-digests">MD5 digests</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-_002d_002dmd5_005fwrt_005fatt"><code>--md5_wrt_att</code></a>:</td><td> </td><td valign="top"><a href="#MD5-digests">MD5 digests</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-_002d_002dMetadata"><code>--Metadata</code></a>:</td><td> </td><td valign="top"><a href="#ncks-netCDF-Kitchen-Sink">ncks netCDF Kitchen Sink</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-_002d_002dmetadata"><code>--metadata</code></a>:</td><td> </td><td valign="top"><a href="#ncks-netCDF-Kitchen-Sink">ncks netCDF Kitchen Sink</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-_002d_002dmk_005frec_005fdmn-dim"><code>--mk_rec_dmn <var>dim</var></code></a>:</td><td> </td><td valign="top"><a href="#ncecat-netCDF-Ensemble-Concatenator">ncecat netCDF Ensemble Concatenator</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-_002d_002dmk_005frec_005fdmn-dim-1"><code>--mk_rec_dmn <var>dim</var></code></a>:</td><td> </td><td valign="top"><a href="#ncks-netCDF-Kitchen-Sink">ncks netCDF Kitchen Sink</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-_002d_002dmrd"><code>--mrd</code></a>:</td><td> </td><td valign="top"><a href="#Multiple-Record-Dimensions">Multiple Record Dimensions</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-_002d_002dmro"><code>--mro</code></a>:</td><td> </td><td valign="top"><a href="#Subcycle">Subcycle</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-_002d_002dmsa"><code>--msa</code></a>:</td><td> </td><td valign="top"><a href="#Multislabs">Multislabs</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-_002d_002dmsa_005fuser_005forder"><code>--msa_user_order</code></a>:</td><td> </td><td valign="top"><a href="#Multislabs">Multislabs</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-_002d_002dmsa_005fusr_005frdr"><code>--msa_usr_rdr</code></a>:</td><td> </td><td valign="top"><a href="#Multislabs">Multislabs</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-_002d_002dmsk_005fcmp_005ftyp-mask_005fcomp"><code>--msk_cmp_typ <var>mask_comp</var></code></a>:</td><td> </td><td valign="top"><a href="#Mask-condition">Mask condition</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-_002d_002dmsk_005fcnd-mask_005fcond"><code>--msk_cnd <var>mask_cond</var></code></a>:</td><td> </td><td valign="top"><a href="#ncwa-netCDF-Weighted-Averager">ncwa netCDF Weighted Averager</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-_002d_002dmsk_005fcnd_005fsng-mask_005fcond"><code>--msk_cnd_sng <var>mask_cond</var></code></a>:</td><td> </td><td valign="top"><a href="#Mask-condition">Mask condition</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-_002d_002dmsk_005fnm-mask_005fvar"><code>--msk_nm <var>mask_var</var></code></a>:</td><td> </td><td valign="top"><a href="#ncwa-netCDF-Weighted-Averager">ncwa netCDF Weighted Averager</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-_002d_002dmsk_005fval-mask_005fval"><code>--msk_val <var>mask_val</var></code></a>:</td><td> </td><td valign="top"><a href="#Mask-condition">Mask condition</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-_002d_002dmsk_005fvar-mask_005fvar"><code>--msk_var <var>mask_var</var></code></a>:</td><td> </td><td valign="top"><a href="#ncwa-netCDF-Weighted-Averager">ncwa netCDF Weighted Averager</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-_002d_002dMtd"><code>--Mtd</code></a>:</td><td> </td><td valign="top"><a href="#ncks-netCDF-Kitchen-Sink">ncks netCDF Kitchen Sink</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-_002d_002dmtd"><code>--mtd</code></a>:</td><td> </td><td valign="top"><a href="#ncks-netCDF-Kitchen-Sink">ncks netCDF Kitchen Sink</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-_002d_002dmultiple_005frecord_005fdimensions"><code>--multiple_record_dimensions</code></a>:</td><td> </td><td valign="top"><a href="#Multiple-Record-Dimensions">Multiple Record Dimensions</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-_002d_002dncml"><code>--ncml</code></a>:</td><td> </td><td valign="top"><a href="#ncks-netCDF-Kitchen-Sink">ncks netCDF Kitchen Sink</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-_002d_002dnetcdf4"><code>--netcdf4</code></a>:</td><td> </td><td valign="top"><a href="#File-Formats-and-Conversion">File Formats and Conversion</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-_002d_002dnintap-loop"><code>--nintap <var>loop</var></code></a>:</td><td> </td><td valign="top"><a href="#Specifying-Input-Files">Specifying Input Files</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-_002d_002dno_002dblank"><code>--no-blank</code></a>:</td><td> </td><td valign="top"><a href="#ncks-netCDF-Kitchen-Sink">ncks netCDF Kitchen Sink</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-_002d_002dno_002dcoords"><code>--no-coords</code></a>:</td><td> </td><td valign="top"><a href="#Subsetting-Coordinate-Variables">Subsetting Coordinate Variables</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-_002d_002dno_002dcoords-1"><code>--no-coords</code></a>:</td><td> </td><td valign="top"><a href="#CF-Conventions">CF Conventions</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-_002d_002dno_002dcrd"><code>--no-crd</code></a>:</td><td> </td><td valign="top"><a href="#Subsetting-Coordinate-Variables">Subsetting Coordinate Variables</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-_002d_002dno_002dcrd-1"><code>--no-crd</code></a>:</td><td> </td><td valign="top"><a href="#CF-Conventions">CF Conventions</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-_002d_002dnoblank"><code>--noblank</code></a>:</td><td> </td><td valign="top"><a href="#ncks-netCDF-Kitchen-Sink">ncks netCDF Kitchen Sink</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-_002d_002dno_005fblank"><code>--no_blank</code></a>:</td><td> </td><td valign="top"><a href="#ncks-netCDF-Kitchen-Sink">ncks netCDF Kitchen Sink</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-_002d_002dno_005fcell_005fmethods"><code>--no_cell_methods</code></a>:</td><td> </td><td valign="top"><a href="#CF-Conventions">CF Conventions</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-_002d_002dno_005fcll_005fmth"><code>--no_cll_mth</code></a>:</td><td> </td><td valign="top"><a href="#CF-Conventions">CF Conventions</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-_002d_002dno_005frec_005fdmn-dim"><code>--no_rec_dmn <var>dim</var></code></a>:</td><td> </td><td valign="top"><a href="#ncks-netCDF-Kitchen-Sink">ncks netCDF Kitchen Sink</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-_002d_002dno_005ftmp_005ffl"><code>--no_tmp_fl</code></a>:</td><td> </td><td valign="top"><a href="#Temporary-Output-Files">Temporary Output Files</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-_002d_002dno_005ftmp_005ffl-1"><code>--no_tmp_fl</code></a>:</td><td> </td><td valign="top"><a href="#RAM-disks">RAM disks</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-_002d_002dnsm_005ffl"><code>--nsm_fl</code></a>:</td><td> </td><td valign="top"><a href="#nces-netCDF-Ensemble-Statistics">nces netCDF Ensemble Statistics</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-_002d_002dnsm_005fgrp"><code>--nsm_grp</code></a>:</td><td> </td><td valign="top"><a href="#nces-netCDF-Ensemble-Statistics">nces netCDF Ensemble Statistics</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-_002d_002dnsm_005fsfx"><code>--nsm_sfx</code></a>:</td><td> </td><td valign="top"><a href="#nces-netCDF-Ensemble-Statistics">nces netCDF Ensemble Statistics</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-_002d_002dnsx"><code>--nsx</code></a>:</td><td> </td><td valign="top"><a href="#Subsetting-Files">Subsetting Files</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-_002d_002domp_005fnum_005fthreads-thr_005fnbr"><code>--omp_num_threads <var>thr_nbr</var></code></a>:</td><td> </td><td valign="top"><a href="#OpenMP-Threading">OpenMP Threading</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-_002d_002dopen_005fram"><code>--open_ram</code></a>:</td><td> </td><td valign="top"><a href="#Temporary-Output-Files">Temporary Output Files</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-_002d_002dopen_005fram-1"><code>--open_ram</code></a>:</td><td> </td><td valign="top"><a href="#Memory-Requirements">Memory Requirements</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-_002d_002dopen_005fram-2"><code>--open_ram</code></a>:</td><td> </td><td valign="top"><a href="#RAM-disks">RAM disks</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-_002d_002doperation-op_005ftyp"><code>--operation <var>op_typ</var></code></a>:</td><td> </td><td valign="top"><a href="#Operation-Types">Operation Types</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-_002d_002doperation-op_005ftyp-1"><code>--operation <var>op_typ</var></code></a>:</td><td> </td><td valign="top"><a href="#ncbo-netCDF-Binary-Operator">ncbo netCDF Binary Operator</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-_002d_002dop_005frlt-mask_005fcomp"><code>--op_rlt <var>mask_comp</var></code></a>:</td><td> </td><td valign="top"><a href="#Mask-condition">Mask condition</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-_002d_002dop_005ftyp-op_005ftyp"><code>--op_typ <var>op_typ</var></code></a>:</td><td> </td><td valign="top"><a href="#Operation-Types">Operation Types</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-_002d_002dop_005ftyp-op_005ftyp-1"><code>--op_typ <var>op_typ</var></code></a>:</td><td> </td><td valign="top"><a href="#ncbo-netCDF-Binary-Operator">ncbo netCDF Binary Operator</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-_002d_002doutput-fl_005fout"><code>--output <var>fl_out</var></code></a>:</td><td> </td><td valign="top"><a href="#Specifying-Output-Files">Specifying Output Files</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-_002d_002doverwrite"><code>--overwrite</code></a>:</td><td> </td><td valign="top"><a href="#Temporary-Output-Files">Temporary Output Files</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-_002d_002doverwrite-1"><code>--overwrite</code></a>:</td><td> </td><td valign="top"><a href="#Batch-Mode">Batch Mode</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-_002d_002dovr"><code>--ovr</code></a>:</td><td> </td><td valign="top"><a href="#Temporary-Output-Files">Temporary Output Files</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-_002d_002dovr-1"><code>--ovr</code></a>:</td><td> </td><td valign="top"><a href="#Batch-Mode">Batch Mode</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-_002d_002dpack_005fpolicy-pck_005fplc"><code>--pack_policy <var>pck_plc</var></code></a>:</td><td> </td><td valign="top"><a href="#ncpdq-netCDF-Permute-Dimensions-Quickly">ncpdq netCDF Permute Dimensions Quickly</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-_002d_002dpath-input_002dpath"><code>--path <var>input-path</var></code></a>:</td><td> </td><td valign="top"><a href="#Specifying-Input-Files">Specifying Input Files</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-_002d_002dpath-input_002dpath-1"><code>--path <var>input-path</var></code></a>:</td><td> </td><td valign="top"><a href="#Remote-storage">Remote storage</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-_002d_002dpck_005fmap-pck_005fmap"><code>--pck_map <var>pck_map</var></code></a>:</td><td> </td><td valign="top"><a href="#ncpdq-netCDF-Permute-Dimensions-Quickly">ncpdq netCDF Permute Dimensions Quickly</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-_002d_002dpck_005fplc-pck_005fplc"><code>--pck_plc <var>pck_plc</var></code></a>:</td><td> </td><td valign="top"><a href="#ncpdq-netCDF-Permute-Dimensions-Quickly">ncpdq netCDF Permute Dimensions Quickly</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-_002d_002dprint"><code>--print</code></a>:</td><td> </td><td valign="top"><a href="#ncks-netCDF-Kitchen-Sink">ncks netCDF Kitchen Sink</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-_002d_002dprn"><code>--prn</code></a>:</td><td> </td><td valign="top"><a href="#ncks-netCDF-Kitchen-Sink">ncks netCDF Kitchen Sink</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-_002d_002dprn_005ffnc_005ftbl"><code>--prn_fnc_tbl</code></a>:</td><td> </td><td valign="top"><a href="#Intrinsic-mathematical-methods">Intrinsic mathematical methods</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-_002d_002dpseudonym"><code>--pseudonym</code></a>:</td><td> </td><td valign="top"><a href="#Symbolic-Links">Symbolic Links</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-_002d_002dpth-input_002dpath"><code>--pth <var>input-path</var></code></a>:</td><td> </td><td valign="top"><a href="#Specifying-Input-Files">Specifying Input Files</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-_002d_002dpth-input_002dpath-1"><code>--pth <var>input-path</var></code></a>:</td><td> </td><td valign="top"><a href="#Remote-storage">Remote storage</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-_002d_002dquiet"><code>--quiet</code></a>:</td><td> </td><td valign="top"><a href="#ncks-netCDF-Kitchen-Sink">ncks netCDF Kitchen Sink</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-_002d_002dram_005fall"><code>--ram_all</code></a>:</td><td> </td><td valign="top"><a href="#Memory-Requirements">Memory Requirements</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-_002d_002dram_005fall-1"><code>--ram_all</code></a>:</td><td> </td><td valign="top"><a href="#RAM-disks">RAM disks</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-_002d_002drcd_005fnm-ulm_005fnm">‘<samp>--rcd_nm <var>ulm_nm</var></samp>’</a>:</td><td> </td><td valign="top"><a href="#ncecat-netCDF-Ensemble-Concatenator">ncecat netCDF Ensemble Concatenator</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-_002d_002drecord_005fappend"><code>--record_append</code></a>:</td><td> </td><td valign="top"><a href="#Record-Appending">Record Appending</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-_002d_002drec_005fapn"><code>--rec_apn</code></a>:</td><td> </td><td valign="top"><a href="#Record-Appending">Record Appending</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-_002d_002dretain"><code>--retain</code></a>:</td><td> </td><td valign="top"><a href="#Retaining-Retrieved-Files">Retaining Retrieved Files</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-_002d_002drevision"><code>--revision</code></a>:</td><td> </td><td valign="top"><a href="#Help-Requests-and-Bug-Reports">Help Requests and Bug Reports</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-_002d_002drevision-1"><code>--revision</code></a>:</td><td> </td><td valign="top"><a href="#Operator-Version">Operator Version</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-_002d_002drth_005fdbl"><code>--rth_dbl</code></a>:</td><td> </td><td valign="top"><a href="#Promoting-Single_002dprecision-to-Double">Promoting Single-precision to Double</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-_002d_002drth_005fflt"><code>--rth_flt</code></a>:</td><td> </td><td valign="top"><a href="#Promoting-Single_002dprecision-to-Double">Promoting Single-precision to Double</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-_002d_002drtn"><code>--rtn</code></a>:</td><td> </td><td valign="top"><a href="#Retaining-Retrieved-Files">Retaining Retrieved Files</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-_002d_002dscript"><code>--script</code></a>:</td><td> </td><td valign="top"><a href="#ncap2-netCDF-Arithmetic-Processor">ncap2 netCDF Arithmetic Processor</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-_002d_002dscript_002dfile"><code>--script-file</code></a>:</td><td> </td><td valign="top"><a href="#ncap2-netCDF-Arithmetic-Processor">ncap2 netCDF Arithmetic Processor</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-_002d_002dsng_005ffmt"><code>--sng_fmt</code></a>:</td><td> </td><td valign="top"><a href="#ncks-netCDF-Kitchen-Sink">ncks netCDF Kitchen Sink</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-_002d_002dspt"><code>--spt</code></a>:</td><td> </td><td valign="top"><a href="#ncap2-netCDF-Arithmetic-Processor">ncap2 netCDF Arithmetic Processor</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-_002d_002dstring"><code>--string</code></a>:</td><td> </td><td valign="top"><a href="#ncks-netCDF-Kitchen-Sink">ncks netCDF Kitchen Sink</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-_002d_002dthreads-thr_005fnbr"><code>--threads <var>thr_nbr</var></code></a>:</td><td> </td><td valign="top"><a href="#OpenMP-Threading">OpenMP Threading</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-_002d_002dthr_005fnbr-thr_005fnbr"><code>--thr_nbr <var>thr_nbr</var></code></a>:</td><td> </td><td valign="top"><a href="#OpenMP-Threading">OpenMP Threading</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-_002d_002dulm_005fnm-ulm_005fnm">‘<samp>--ulm_nm <var>ulm_nm</var></samp>’</a>:</td><td> </td><td valign="top"><a href="#ncecat-netCDF-Ensemble-Concatenator">ncecat netCDF Ensemble Concatenator</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-_002d_002dunion"><code>--union</code></a>:</td><td> </td><td valign="top"><a href="#Subsetting-Files">Subsetting Files</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-_002d_002dunion-1"><code>--union</code></a>:</td><td> </td><td valign="top"><a href="#Subsetting-Files">Subsetting Files</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-_002d_002dunits"><code>--units</code></a>:</td><td> </td><td valign="top"><a href="#ncks-netCDF-Kitchen-Sink">ncks netCDF Kitchen Sink</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-_002d_002dunn"><code>--unn</code></a>:</td><td> </td><td valign="top"><a href="#Subsetting-Files">Subsetting Files</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-_002d_002dunn-1"><code>--unn</code></a>:</td><td> </td><td valign="top"><a href="#Subsetting-Files">Subsetting Files</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-_002d_002dunpack"><code>--unpack</code></a>:</td><td> </td><td valign="top"><a href="#ncpdq-netCDF-Permute-Dimensions-Quickly">ncpdq netCDF Permute Dimensions Quickly</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-_002d_002dupk"><code>--upk</code></a>:</td><td> </td><td valign="top"><a href="#ncpdq-netCDF-Permute-Dimensions-Quickly">ncpdq netCDF Permute Dimensions Quickly</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-_002d_002dvariable-var"><code>--variable <var>var</var></code></a>:</td><td> </td><td valign="top"><a href="#Subsetting-Files">Subsetting Files</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-_002d_002dvariable-var-1"><code>--variable <var>var</var></code></a>:</td><td> </td><td valign="top"><a href="#Filters-for-ncks">Filters for <code>ncks</code></a></td></tr>
<tr><td></td><td valign="top"><a href="#index-_002d_002dversion"><code>--version</code></a>:</td><td> </td><td valign="top"><a href="#Help-Requests-and-Bug-Reports">Help Requests and Bug Reports</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-_002d_002dversion-1"><code>--version</code></a>:</td><td> </td><td valign="top"><a href="#Operator-Version">Operator Version</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-_002d_002dvrs"><code>--vrs</code></a>:</td><td> </td><td valign="top"><a href="#Help-Requests-and-Bug-Reports">Help Requests and Bug Reports</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-_002d_002dvrs-1"><code>--vrs</code></a>:</td><td> </td><td valign="top"><a href="#Operator-Version">Operator Version</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-_002d_002dweight-weight"><code>--weight <var>weight</var></code></a>:</td><td> </td><td valign="top"><a href="#ncwa-netCDF-Weighted-Averager">ncwa netCDF Weighted Averager</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-_002d_002dweight-wgt1_005b_002cwgt2_005d"><code>--weight <var>wgt1</var>[,<var>wgt2</var>]</code></a>:</td><td> </td><td valign="top"><a href="#ncflint-netCDF-File-Interpolator">ncflint netCDF File Interpolator</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-_002d_002dwgt_005fvar-weight"><code>--wgt_var <var>weight</var></code></a>:</td><td> </td><td valign="top"><a href="#ncwa-netCDF-Weighted-Averager">ncwa netCDF Weighted Averager</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-_002d_002dwgt_005fvar-wgt1_005b_002cwgt2_005d"><code>--wgt_var <var>wgt1</var>[,<var>wgt2</var>]</code></a>:</td><td> </td><td valign="top"><a href="#ncflint-netCDF-File-Interpolator">ncflint netCDF File Interpolator</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-_002d_002dwrite_005ftmp_005ffl"><code>--write_tmp_fl</code></a>:</td><td> </td><td valign="top"><a href="#Temporary-Output-Files">Temporary Output Files</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-_002d_002dwrt_005ftmp_005ffl"><code>--wrt_tmp_fl</code></a>:</td><td> </td><td valign="top"><a href="#Temporary-Output-Files">Temporary Output Files</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-_002d_002dxcl"><code>--xcl</code></a>:</td><td> </td><td valign="top"><a href="#Subsetting-Files">Subsetting Files</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-_002d_002dxcl-1"><code>--xcl</code></a>:</td><td> </td><td valign="top"><a href="#Filters-for-ncks">Filters for <code>ncks</code></a></td></tr>
<tr><td></td><td valign="top"><a href="#index-_002d_002dxml"><code>--xml</code></a>:</td><td> </td><td valign="top"><a href="#ncks-netCDF-Kitchen-Sink">ncks netCDF Kitchen Sink</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-_002d_002dxml_005fno_005flocation"><code>--xml_no_location</code></a>:</td><td> </td><td valign="top"><a href="#ncks-netCDF-Kitchen-Sink">ncks netCDF Kitchen Sink</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-_002d_002dxml_005fspr_005fchr"><code>--xml_spr_chr</code></a>:</td><td> </td><td valign="top"><a href="#ncks-netCDF-Kitchen-Sink">ncks netCDF Kitchen Sink</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-_002d_002dxml_005fspr_005fnmr"><code>--xml_spr_nmr</code></a>:</td><td> </td><td valign="top"><a href="#ncks-netCDF-Kitchen-Sink">ncks netCDF Kitchen Sink</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-_002d3"><code>-3</code></a>:</td><td> </td><td valign="top"><a href="#netCDF2_002f3_002f4-and-HDF4_002f5-Support">netCDF2/3/4 and HDF4/5 Support</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-_002d3-1"><code>-3</code></a>:</td><td> </td><td valign="top"><a href="#File-Formats-and-Conversion">File Formats and Conversion</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-_002d4"><code>-4</code></a>:</td><td> </td><td valign="top"><a href="#netCDF2_002f3_002f4-and-HDF4_002f5-Support">netCDF2/3/4 and HDF4/5 Support</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-_002d4-1"><code>-4</code></a>:</td><td> </td><td valign="top"><a href="#File-Formats-and-Conversion">File Formats and Conversion</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-_002d5"><code>-5</code></a>:</td><td> </td><td valign="top"><a href="#ncks-netCDF-Kitchen-Sink">ncks netCDF Kitchen Sink</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-_002d6"><code>-6</code></a>:</td><td> </td><td valign="top"><a href="#File-Formats-and-Conversion">File Formats and Conversion</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-_002d7"><code>-7</code></a>:</td><td> </td><td valign="top"><a href="#File-Formats-and-Conversion">File Formats and Conversion</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-_002dA"><code>-A</code></a>:</td><td> </td><td valign="top"><a href="#Temporary-Output-Files">Temporary Output Files</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-_002dA-1"><code>-A</code></a>:</td><td> </td><td valign="top"><a href="#Batch-Mode">Batch Mode</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-_002da"><code>-a</code></a>:</td><td> </td><td valign="top"><a href="#ncks-netCDF-Kitchen-Sink">ncks netCDF Kitchen Sink</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-_002da-1"><code>-a</code></a>:</td><td> </td><td valign="top"><a href="#Filters-for-ncks">Filters for <code>ncks</code></a></td></tr>
<tr><td></td><td valign="top"><a href="#index-_002dA-2"><code>-A</code></a>:</td><td> </td><td valign="top"><a href="#Filters-for-ncks">Filters for <code>ncks</code></a></td></tr>
<tr><td></td><td valign="top"><a href="#index-_002dA-3">‘<samp>-A</samp>’</a>:</td><td> </td><td valign="top"><a href="#ncpdq-netCDF-Permute-Dimensions-Quickly">ncpdq netCDF Permute Dimensions Quickly</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-_002db">‘<samp>-b</samp>’</a>:</td><td> </td><td valign="top"><a href="#Examples-ncap2">Examples ncap2</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-_002db-1">‘<samp>-b</samp>’</a>:</td><td> </td><td valign="top"><a href="#ncbo-netCDF-Binary-Operator">ncbo netCDF Binary Operator</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-_002db-2"><code>-b</code></a>:</td><td> </td><td valign="top"><a href="#ncks-netCDF-Kitchen-Sink">ncks netCDF Kitchen Sink</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-_002dB-mask_005fcond"><code>-B <var>mask_cond</var></code></a>:</td><td> </td><td valign="top"><a href="#ncwa-netCDF-Weighted-Averager">ncwa netCDF Weighted Averager</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-_002dB-mask_005fcond-1"><code>-B <var>mask_cond</var></code></a>:</td><td> </td><td valign="top"><a href="#Mask-condition">Mask condition</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-_002dC"><code>-C</code></a>:</td><td> </td><td valign="top"><a href="#Subsetting-Coordinate-Variables">Subsetting Coordinate Variables</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-_002dc"><code>-c</code></a>:</td><td> </td><td valign="top"><a href="#Subsetting-Coordinate-Variables">Subsetting Coordinate Variables</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-_002dC-1"><code>-C</code></a>:</td><td> </td><td valign="top"><a href="#CF-Conventions">CF Conventions</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-_002dc-1"><code>-c</code></a>:</td><td> </td><td valign="top"><a href="#CF-Conventions">CF Conventions</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-_002dC-2"><code>-C</code></a>:</td><td> </td><td valign="top"><a href="#Examples-ncap2">Examples ncap2</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-_002dD"><code>-D</code></a>:</td><td> </td><td valign="top"><a href="#Help-Requests-and-Bug-Reports">Help Requests and Bug Reports</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-_002dD-debug_002dlevel"><code>-D <var>debug-level</var></code></a>:</td><td> </td><td valign="top"><a href="#Help-Requests-and-Bug-Reports">Help Requests and Bug Reports</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-_002dD-debug_002dlevel-1"><code>-D <var>debug-level</var></code></a>:</td><td> </td><td valign="top"><a href="#Large-Datasets">Large Datasets</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-_002dD-debug_002dlevel-2"><code>-D <var>debug-level</var></code></a>:</td><td> </td><td valign="top"><a href="#Command-Line-Options">Command Line Options</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-_002dd-dim_002c_005bmin_005d_002c_005bmax_005d_002cstride"><code>-d <var>dim</var>,[<var>min</var>],[<var>max</var>],<var>stride</var></code></a>:</td><td> </td><td valign="top"><a href="#Stride">Stride</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-_002dd-dim_002c_005bmin_005d_002c_005bmax_005d_002c_005bstride_005d_002c_005bsubcycle_005d"><code>-d <var>dim</var>,[<var>min</var>],[<var>max</var>],[<var>stride</var>],[<var>subcycle</var>]</code></a>:</td><td> </td><td valign="top"><a href="#Subcycle">Subcycle</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-_002dd-dim_002c_005bmin_005d_005b_002c_005bmax_005d_005b_002c_005bstride_005d_005d_005d"><code>-d <var>dim</var>,[<var>min</var>][,[<var>max</var>][,[<var>stride</var>]]]</code></a>:</td><td> </td><td valign="top"><a href="#Hyperslabs">Hyperslabs</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-_002dd-dim_002c_005bmin_005d_005b_002c_005bmax_005d_005b_002c_005bstride_005d_005d_005d-1"><code>-d <var>dim</var>,[<var>min</var>][,[<var>max</var>][,[<var>stride</var>]]]</code></a>:</td><td> </td><td valign="top"><a href="#Multislabs">Multislabs</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-_002dd-dim_002c_005bmin_005d_005b_002c_005bmax_005d_005b_002c_005bstride_005d_005d_005d-2"><code>-d <var>dim</var>,[<var>min</var>][,[<var>max</var>][,[<var>stride</var>]]]</code></a>:</td><td> </td><td valign="top"><a href="#Wrapped-Coordinates">Wrapped Coordinates</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-_002dd-dim_002c_005bmin_005d_005b_002c_005bmax_005d_005b_002c_005bstride_005d_005d_005d-3"><code>-d <var>dim</var>,[<var>min</var>][,[<var>max</var>][,[<var>stride</var>]]]</code></a>:</td><td> </td><td valign="top"><a href="#UDUnits-Support">UDUnits Support</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-_002dd-dim_002c_005bmin_005d_005b_002c_005bmax_005d_005d"><code>-d <var>dim</var>,[<var>min</var>][,[<var>max</var>]]</code></a>:</td><td> </td><td valign="top"><a href="#ncwa-netCDF-Weighted-Averager">ncwa netCDF Weighted Averager</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-_002dF"><code>-F</code></a>:</td><td> </td><td valign="top"><a href="#C-and-Fortran-Index-Conventions">C and Fortran Index Conventions</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-_002df"><code>-f</code></a>:</td><td> </td><td valign="top"><a href="#Intrinsic-mathematical-methods">Intrinsic mathematical methods</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-_002dG-gpe_005fdsc"><code>-G <var>gpe_dsc</var></code></a>:</td><td> </td><td valign="top"><a href="#Group-Path-Editing">Group Path Editing</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-_002dg-grp"><code>-g <var>grp</var></code></a>:</td><td> </td><td valign="top"><a href="#Subsetting-Files">Subsetting Files</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-_002dh"><code>-h</code></a>:</td><td> </td><td valign="top"><a href="#History-Attribute">History Attribute</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-_002dH"><code>-H</code></a>:</td><td> </td><td valign="top"><a href="#File-List-Attributes">File List Attributes</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-_002dh-1"><code>-h</code></a>:</td><td> </td><td valign="top"><a href="#ncatted-netCDF-Attribute-Editor">ncatted netCDF Attribute Editor</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-_002dH-1"><code>-H</code></a>:</td><td> </td><td valign="top"><a href="#ncks-netCDF-Kitchen-Sink">ncks netCDF Kitchen Sink</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-_002dI"><code>-I</code></a>:</td><td> </td><td valign="top"><a href="#ncwa-netCDF-Weighted-Averager">ncwa netCDF Weighted Averager</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-_002dL"><code>-L</code></a>:</td><td> </td><td valign="top"><a href="#Deflation">Deflation</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-_002dl-output_002dpath"><code>-l <var>output-path</var></code></a>:</td><td> </td><td valign="top"><a href="#Remote-storage">Remote storage</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-_002dl-output_002dpath-1"><code>-l <var>output-path</var></code></a>:</td><td> </td><td valign="top"><a href="#Remote-storage">Remote storage</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-_002dM"><code>-M</code></a>:</td><td> </td><td valign="top"><a href="#Determining-File-Format">Determining File Format</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-_002dM-1"><code>-M</code></a>:</td><td> </td><td valign="top"><a href="#ncecat-netCDF-Ensemble-Concatenator">ncecat netCDF Ensemble Concatenator</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-_002dM-2"><code>-M</code></a>:</td><td> </td><td valign="top"><a href="#ncks-netCDF-Kitchen-Sink">ncks netCDF Kitchen Sink</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-_002dm"><code>-m</code></a>:</td><td> </td><td valign="top"><a href="#ncks-netCDF-Kitchen-Sink">ncks netCDF Kitchen Sink</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-_002dM-cnk_005fmap"><code>-M <var>cnk_map</var></code></a>:</td><td> </td><td valign="top"><a href="#Chunking">Chunking</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-_002dm-mask_005fvar"><code>-m <var>mask_var</var></code></a>:</td><td> </td><td valign="top"><a href="#ncwa-netCDF-Weighted-Averager">ncwa netCDF Weighted Averager</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-_002dM-pck_005fmap"><code>-M <var>pck_map</var></code></a>:</td><td> </td><td valign="top"><a href="#ncpdq-netCDF-Permute-Dimensions-Quickly">ncpdq netCDF Permute Dimensions Quickly</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-_002dN"><code>-N</code></a>:</td><td> </td><td valign="top"><a href="#Normalization-and-Integration">Normalization and Integration</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-_002dn-loop"><code>-n <var>loop</var></code></a>:</td><td> </td><td valign="top"><a href="#Large-Numbers-of-Files">Large Numbers of Files</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-_002dn-loop-1"><code>-n <var>loop</var></code></a>:</td><td> </td><td valign="top"><a href="#Large-Numbers-of-Files">Large Numbers of Files</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-_002dn-loop-2"><code>-n <var>loop</var></code></a>:</td><td> </td><td valign="top"><a href="#Specifying-Input-Files">Specifying Input Files</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-_002dO"><code>-O</code></a>:</td><td> </td><td valign="top"><a href="#Temporary-Output-Files">Temporary Output Files</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-_002dO-1"><code>-O</code></a>:</td><td> </td><td valign="top"><a href="#Batch-Mode">Batch Mode</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-_002do-fl_005fout"><code>-o <var>fl_out</var></code></a>:</td><td> </td><td valign="top"><a href="#Large-Numbers-of-Files">Large Numbers of Files</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-_002do-fl_005fout-1"><code>-o <var>fl_out</var></code></a>:</td><td> </td><td valign="top"><a href="#Specifying-Output-Files">Specifying Output Files</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-_002dP"><code>-P</code></a>:</td><td> </td><td valign="top"><a href="#ncks-netCDF-Kitchen-Sink">ncks netCDF Kitchen Sink</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-_002dp-input_002dpath"><code>-p <var>input-path</var></code></a>:</td><td> </td><td valign="top"><a href="#Specifying-Input-Files">Specifying Input Files</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-_002dp-input_002dpath-1"><code>-p <var>input-path</var></code></a>:</td><td> </td><td valign="top"><a href="#Remote-storage">Remote storage</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-_002dP-pck_005fplc"><code>-P <var>pck_plc</var></code></a>:</td><td> </td><td valign="top"><a href="#ncpdq-netCDF-Permute-Dimensions-Quickly">ncpdq netCDF Permute Dimensions Quickly</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-_002dQ"><code>-Q</code></a>:</td><td> </td><td valign="top"><a href="#ncks-netCDF-Kitchen-Sink">ncks netCDF Kitchen Sink</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-_002dq"><code>-q</code></a>:</td><td> </td><td valign="top"><a href="#ncks-netCDF-Kitchen-Sink">ncks netCDF Kitchen Sink</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-_002dr"><code>-r</code></a>:</td><td> </td><td valign="top"><a href="#Help-Requests-and-Bug-Reports">Help Requests and Bug Reports</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-_002dr-1"><code>-r</code></a>:</td><td> </td><td valign="top"><a href="#Help-Requests-and-Bug-Reports">Help Requests and Bug Reports</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-_002dR"><code>-R</code></a>:</td><td> </td><td valign="top"><a href="#Retaining-Retrieved-Files">Retaining Retrieved Files</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-_002dr-2"><code>-r</code></a>:</td><td> </td><td valign="top"><a href="#Operator-Version">Operator Version</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-_002ds"><code>-s</code></a>:</td><td> </td><td valign="top"><a href="#ncks-netCDF-Kitchen-Sink">ncks netCDF Kitchen Sink</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-_002dt-thr_005fnbr"><code>-t <var>thr_nbr</var></code></a>:</td><td> </td><td valign="top"><a href="#Single-and-Multi_002dfile-Operators">Single and Multi-file Operators</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-_002dt-thr_005fnbr-1"><code>-t <var>thr_nbr</var></code></a>:</td><td> </td><td valign="top"><a href="#OpenMP-Threading">OpenMP Threading</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-_002du"><code>-u</code></a>:</td><td> </td><td valign="top"><a href="#ncks-netCDF-Kitchen-Sink">ncks netCDF Kitchen Sink</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-_002dU"><code>-U</code></a>:</td><td> </td><td valign="top"><a href="#ncpdq-netCDF-Permute-Dimensions-Quickly">ncpdq netCDF Permute Dimensions Quickly</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-_002du-ulm_005fnm">‘<samp>-u <var>ulm_nm</var></samp>’</a>:</td><td> </td><td valign="top"><a href="#ncecat-netCDF-Ensemble-Concatenator">ncecat netCDF Ensemble Concatenator</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-_002dv">‘<samp>-v</samp>’</a>:</td><td> </td><td valign="top"><a href="#ncpdq-netCDF-Permute-Dimensions-Quickly">ncpdq netCDF Permute Dimensions Quickly</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-_002dv-var"><code>-v <var>var</var></code></a>:</td><td> </td><td valign="top"><a href="#Subsetting-Files">Subsetting Files</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-_002dv-var-1"><code>-v <var>var</var></code></a>:</td><td> </td><td valign="top"><a href="#Filters-for-ncks">Filters for <code>ncks</code></a></td></tr>
<tr><td></td><td valign="top"><a href="#index-_002dw-weight"><code>-w <var>weight</var></code></a>:</td><td> </td><td valign="top"><a href="#ncwa-netCDF-Weighted-Averager">ncwa netCDF Weighted Averager</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-_002dw-wgt1_005b_002cwgt2_005d"><code>-w <var>wgt1</var>[,<var>wgt2</var>]</code></a>:</td><td> </td><td valign="top"><a href="#ncflint-netCDF-File-Interpolator">ncflint netCDF File Interpolator</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-_002dx"><code>-x</code></a>:</td><td> </td><td valign="top"><a href="#Subsetting-Files">Subsetting Files</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-_002dX"><code>-X</code></a>:</td><td> </td><td valign="top"><a href="#Auxiliary-Coordinates">Auxiliary Coordinates</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-_002dx-1"><code>-x</code></a>:</td><td> </td><td valign="top"><a href="#Filters-for-ncks">Filters for <code>ncks</code></a></td></tr>
<tr><td></td><td valign="top"><a href="#index-_002dX-lon_005fmin_002clon_005fmax_002clat_005fmin_002clat_005fmax"><code>-X <var>lon_min</var>,<var>lon_max</var>,<var>lat_min</var>,<var>lat_max</var></code></a>:</td><td> </td><td valign="top"><a href="#Auxiliary-Coordinates">Auxiliary Coordinates</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-_002dy-op_005ftyp"><code>-y <var>op_typ</var></code></a>:</td><td> </td><td valign="top"><a href="#Operation-Types">Operation Types</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-_002dy-op_005ftyp-1"><code>-y <var>op_typ</var></code></a>:</td><td> </td><td valign="top"><a href="#ncbo-netCDF-Binary-Operator">ncbo netCDF Binary Operator</a></td></tr>
<tr><td colspan="4"> <hr></td></tr>
<tr><th><a name="General-Index_cp_symbol-9">.</a></th><td></td><td></td></tr>
<tr><td></td><td valign="top"><a href="#index-_002e"><kbd>.</kbd></a>:</td><td> </td><td valign="top"><a href="#ncrename-netCDF-Renamer">ncrename netCDF Renamer</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-_002e-_0028wildcard-character_0029"><code>.</code> (wildcard character)</a>:</td><td> </td><td valign="top"><a href="#Subsetting-Files">Subsetting Files</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-_002ebashrc"><samp>.bashrc</samp></a>:</td><td> </td><td valign="top"><a href="#Filters-for-ncks">Filters for <code>ncks</code></a></td></tr>
<tr><td></td><td valign="top"><a href="#index-_002enetrc"><samp>.netrc</samp></a>:</td><td> </td><td valign="top"><a href="#Remote-storage">Remote storage</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-_002erhosts"><samp>.rhosts</samp></a>:</td><td> </td><td valign="top"><a href="#Remote-storage">Remote storage</a></td></tr>
<tr><td colspan="4"> <hr></td></tr>
<tr><th><a name="General-Index_cp_symbol-10">/</a></th><td></td><td></td></tr>
<tr><td></td><td valign="top"><a href="#index-_002f"><code>/</code></a>:</td><td> </td><td valign="top"><a href="#ncbo-netCDF-Binary-Operator">ncbo netCDF Binary Operator</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-_002f-_0028division_0029"><code>/</code> (division)</a>:</td><td> </td><td valign="top"><a href="#Intrinsic-mathematical-methods">Intrinsic mathematical methods</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-_002f_002a_002e_002e_002e_002a_002f-_0028comment_0029"><code>/*...*/</code> (comment)</a>:</td><td> </td><td valign="top"><a href="#Syntax-of-ncap2-statements">Syntax of ncap2 statements</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-_002f_002f-_0028comment_0029"><code>//</code> (comment)</a>:</td><td> </td><td valign="top"><a href="#Syntax-of-ncap2-statements">Syntax of ncap2 statements</a></td></tr>
<tr><td colspan="4"> <hr></td></tr>
<tr><th><a name="General-Index_cp_symbol-11">0</a></th><td></td><td></td></tr>
<tr><td></td><td valign="top"><a href="#index-0-_0028NUL_0029"><code>0</code> (NUL)</a>:</td><td> </td><td valign="top"><a href="#ncatted-netCDF-Attribute-Editor">ncatted netCDF Attribute Editor</a></td></tr>
<tr><td colspan="4"> <hr></td></tr>
<tr><th><a name="General-Index_cp_symbol-12">3</a></th><td></td><td></td></tr>
<tr><td></td><td valign="top"><a href="#index-32_002dbit-offset-file-format">32-bit offset file format</a>:</td><td> </td><td valign="top"><a href="#Determining-File-Format">Determining File Format</a></td></tr>
<tr><td colspan="4"> <hr></td></tr>
<tr><th><a name="General-Index_cp_symbol-13">6</a></th><td></td><td></td></tr>
<tr><td></td><td valign="top"><a href="#index-64_002dbit-offset-file-format">64-bit offset file format</a>:</td><td> </td><td valign="top"><a href="#Determining-File-Format">Determining File Format</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-64BIT-files"><code>64BIT</code> files</a>:</td><td> </td><td valign="top"><a href="#File-Formats-and-Conversion">File Formats and Conversion</a></td></tr>
<tr><td colspan="4"> <hr></td></tr>
<tr><th><a name="General-Index_cp_symbol-14">:</a></th><td></td><td></td></tr>
<tr><td></td><td valign="top"><a href="#index-_003a-_0028separator-character_0029"><code>:</code> (separator character)</a>:</td><td> </td><td valign="top"><a href="#Group-Path-Editing">Group Path Editing</a></td></tr>
<tr><td colspan="4"> <hr></td></tr>
<tr><th><a name="General-Index_cp_symbol-15">;</a></th><td></td><td></td></tr>
<tr><td></td><td valign="top"><a href="#index-_003b-_0028end-of-statement_0029"><code>;</code> (end of statement)</a>:</td><td> </td><td valign="top"><a href="#Syntax-of-ncap2-statements">Syntax of ncap2 statements</a></td></tr>
<tr><td colspan="4"> <hr></td></tr>
<tr><th><a name="General-Index_cp_symbol-16"><</a></th><td></td><td></td></tr>
<tr><td></td><td valign="top"><a href="#index-_003carpa_002fnameser_002eh_003e"><code><samp><arpa/nameser.h></samp></code></a>:</td><td> </td><td valign="top"><a href="#Windows-Operating-System">Windows Operating System</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-_003cresolv_002eh_003e"><code><samp><resolv.h></samp></code></a>:</td><td> </td><td valign="top"><a href="#Windows-Operating-System">Windows Operating System</a></td></tr>
<tr><td colspan="4"> <hr></td></tr>
<tr><th><a name="General-Index_cp_symbol-17">?</a></th><td></td><td></td></tr>
<tr><td></td><td valign="top"><a href="#index-_003f-_0028filename-expansion_0029"><code>?</code> (filename expansion)</a>:</td><td> </td><td valign="top"><a href="#Subsetting-Files">Subsetting Files</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-_003f-_0028question-mark_0029"><code>?</code> (question mark)</a>:</td><td> </td><td valign="top"><a href="#ncatted-netCDF-Attribute-Editor">ncatted netCDF Attribute Editor</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-_003f-_0028wildcard-character_0029"><code>?</code> (wildcard character)</a>:</td><td> </td><td valign="top"><a href="#Subsetting-Files">Subsetting Files</a></td></tr>
<tr><td colspan="4"> <hr></td></tr>
<tr><th><a name="General-Index_cp_symbol-18">@</a></th><td></td><td></td></tr>
<tr><td></td><td valign="top"><a href="#index-_0040-_0028attribute_0029"><code>@</code> (attribute)</a>:</td><td> </td><td valign="top"><a href="#Syntax-of-ncap2-statements">Syntax of ncap2 statements</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-_0040-_0028separator-character_0029"><code>@</code> (separator character)</a>:</td><td> </td><td valign="top"><a href="#Group-Path-Editing">Group Path Editing</a></td></tr>
<tr><td colspan="4"> <hr></td></tr>
<tr><th><a name="General-Index_cp_symbol-19">[</a></th><td></td><td></td></tr>
<tr><td></td><td valign="top"><a href="#index-_005b_005d-_0028array-delimiters_0029"><code>[]</code> (array delimiters)</a>:</td><td> </td><td valign="top"><a href="#Syntax-of-ncap2-statements">Syntax of ncap2 statements</a></td></tr>
<tr><td colspan="4"> <hr></td></tr>
<tr><th><a name="General-Index_cp_symbol-20">\</a></th><td></td><td></td></tr>
<tr><td></td><td valign="top"><a href="#index-_005c-_0028backslash_0029"><code>\</code> (backslash)</a>:</td><td> </td><td valign="top"><a href="#ncatted-netCDF-Attribute-Editor">ncatted netCDF Attribute Editor</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-_005c_0022-_0028protected-double-quote_0029"><code>\"</code> (protected double quote)</a>:</td><td> </td><td valign="top"><a href="#ncatted-netCDF-Attribute-Editor">ncatted netCDF Attribute Editor</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-_005c_0027-_0028protected-end-quote_0029"><code>\'</code> (protected end quote)</a>:</td><td> </td><td valign="top"><a href="#ncatted-netCDF-Attribute-Editor">ncatted netCDF Attribute Editor</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-_005c_003f-_0028protected-question-mark_0029"><code>\?</code> (protected question mark)</a>:</td><td> </td><td valign="top"><a href="#ncatted-netCDF-Attribute-Editor">ncatted netCDF Attribute Editor</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-_005ca-_0028ASCII-BEL_002c-bell_0029"><code>\a</code> (<acronym>ASCII</acronym> BEL, bell)</a>:</td><td> </td><td valign="top"><a href="#ncatted-netCDF-Attribute-Editor">ncatted netCDF Attribute Editor</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-_005cb-_0028ASCII-BS_002c-backspace_0029"><code>\b</code> (<acronym>ASCII</acronym> BS, backspace)</a>:</td><td> </td><td valign="top"><a href="#ncatted-netCDF-Attribute-Editor">ncatted netCDF Attribute Editor</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-_005cf-_0028ASCII-FF_002c-formfeed_0029"><code>\f</code> (<acronym>ASCII</acronym> FF, formfeed)</a>:</td><td> </td><td valign="top"><a href="#ncatted-netCDF-Attribute-Editor">ncatted netCDF Attribute Editor</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-_005cn-_0028ASCII-LF_002c-linefeed_0029"><code>\n</code> (<acronym>ASCII</acronym> LF, linefeed)</a>:</td><td> </td><td valign="top"><a href="#ncatted-netCDF-Attribute-Editor">ncatted netCDF Attribute Editor</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-_005cn-_0028linefeed_0029"><code>\n</code> (linefeed)</a>:</td><td> </td><td valign="top"><a href="#Filters-for-ncks">Filters for <code>ncks</code></a></td></tr>
<tr><td></td><td valign="top"><a href="#index-_005cr-_0028ASCII-CR_002c-carriage-return_0029"><code>\r</code> (<acronym>ASCII</acronym> CR, carriage return)</a>:</td><td> </td><td valign="top"><a href="#ncatted-netCDF-Attribute-Editor">ncatted netCDF Attribute Editor</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-_005ct-_0028ASCII-HT_002c-horizontal-tab_0029"><code>\t</code> (<acronym>ASCII</acronym> HT, horizontal tab)</a>:</td><td> </td><td valign="top"><a href="#ncatted-netCDF-Attribute-Editor">ncatted netCDF Attribute Editor</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-_005ct-_0028horizontal-tab_0029"><code>\t</code> (horizontal tab)</a>:</td><td> </td><td valign="top"><a href="#Filters-for-ncks">Filters for <code>ncks</code></a></td></tr>
<tr><td></td><td valign="top"><a href="#index-_005cv-_0028ASCII-VT_002c-vertical-tab_0029"><code>\v</code> (<acronym>ASCII</acronym> VT, vertical tab)</a>:</td><td> </td><td valign="top"><a href="#ncatted-netCDF-Attribute-Editor">ncatted netCDF Attribute Editor</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-_005c_005c-_0028ASCII-_005c_002c-backslash_0029"><code>\\</code> (<acronym>ASCII</acronym> \, backslash)</a>:</td><td> </td><td valign="top"><a href="#ncatted-netCDF-Attribute-Editor">ncatted netCDF Attribute Editor</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-_005c_005c-_0028protected-backslash_0029"><code>\\</code> (protected backslash)</a>:</td><td> </td><td valign="top"><a href="#ncatted-netCDF-Attribute-Editor">ncatted netCDF Attribute Editor</a></td></tr>
<tr><td colspan="4"> <hr></td></tr>
<tr><th><a name="General-Index_cp_symbol-21">^</a></th><td></td><td></td></tr>
<tr><td></td><td valign="top"><a href="#index-_005e-_0028power_0029"><code>^</code> (power)</a>:</td><td> </td><td valign="top"><a href="#Intrinsic-mathematical-methods">Intrinsic mathematical methods</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-_005e-_0028wildcard-character_0029"><code>^</code> (wildcard character)</a>:</td><td> </td><td valign="top"><a href="#Subsetting-Files">Subsetting Files</a></td></tr>
<tr><td colspan="4"> <hr></td></tr>
<tr><th><a name="General-Index_cp_symbol-22">_</a></th><td></td><td></td></tr>
<tr><td></td><td valign="top"><a href="#index-_005fChunkSizes"><code>_ChunkSizes</code></a>:</td><td> </td><td valign="top"><a href="#ncks-netCDF-Kitchen-Sink">ncks netCDF Kitchen Sink</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-_005fDeflateLevel"><code>_DeflateLevel</code></a>:</td><td> </td><td valign="top"><a href="#ncks-netCDF-Kitchen-Sink">ncks netCDF Kitchen Sink</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-_005fEndianness"><code>_Endianness</code></a>:</td><td> </td><td valign="top"><a href="#ncks-netCDF-Kitchen-Sink">ncks netCDF Kitchen Sink</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-_005fFillValue"><code>_FillValue</code></a>:</td><td> </td><td valign="top"><a href="#Missing-Values">Missing Values</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-_005fFillValue-1"><code>_FillValue</code></a>:</td><td> </td><td valign="top"><a href="#Packed-data">Packed data</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-_005fFillValue-2"><code>_FillValue</code></a>:</td><td> </td><td valign="top"><a href="#ncatted-netCDF-Attribute-Editor">ncatted netCDF Attribute Editor</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-_005fFillValue-3"><code>_FillValue</code></a>:</td><td> </td><td valign="top"><a href="#ncflint-netCDF-File-Interpolator">ncflint netCDF File Interpolator</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-_005fFillValue-4"><var>_FillValue</var></a>:</td><td> </td><td valign="top"><a href="#ncpdq-netCDF-Permute-Dimensions-Quickly">ncpdq netCDF Permute Dimensions Quickly</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-_005fFillValue-5"><code>_FillValue</code></a>:</td><td> </td><td valign="top"><a href="#ncpdq-netCDF-Permute-Dimensions-Quickly">ncpdq netCDF Permute Dimensions Quickly</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-_005fFillValue-6"><code>_FillValue</code></a>:</td><td> </td><td valign="top"><a href="#ncrename-netCDF-Renamer">ncrename netCDF Renamer</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-_005fFletcher32"><code>_Fletcher32</code></a>:</td><td> </td><td valign="top"><a href="#ncks-netCDF-Kitchen-Sink">ncks netCDF Kitchen Sink</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-_005fFormat"><code>_Format</code></a>:</td><td> </td><td valign="top"><a href="#ncks-netCDF-Kitchen-Sink">ncks netCDF Kitchen Sink</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-_005fNOFILL"><code>_NOFILL</code></a>:</td><td> </td><td valign="top"><a href="#ncks-netCDF-Kitchen-Sink">ncks netCDF Kitchen Sink</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-_005fShuffle"><code>_Shuffle</code></a>:</td><td> </td><td valign="top"><a href="#ncks-netCDF-Kitchen-Sink">ncks netCDF Kitchen Sink</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-_005fStorage"><code>_Storage</code></a>:</td><td> </td><td valign="top"><a href="#ncks-netCDF-Kitchen-Sink">ncks netCDF Kitchen Sink</a></td></tr>
<tr><td colspan="4"> <hr></td></tr>
<tr><th><a name="General-Index_cp_symbol-23">|</a></th><td></td><td></td></tr>
<tr><td></td><td valign="top"><a href="#index-_007c-_0028wildcard-character_0029"><code>|</code> (wildcard character)</a>:</td><td> </td><td valign="top"><a href="#Subsetting-Files">Subsetting Files</a></td></tr>
<tr><td colspan="4"> <hr></td></tr>
<tr><th><a name="General-Index_cp_letter-A">A</a></th><td></td><td></td></tr>
<tr><td></td><td valign="top"><a href="#index-abs"><var>abs</var></a>:</td><td> </td><td valign="top"><a href="#Intrinsic-mathematical-methods">Intrinsic mathematical methods</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-absolute-value">absolute value</a>:</td><td> </td><td valign="top"><a href="#Intrinsic-mathematical-methods">Intrinsic mathematical methods</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-acos"><var>acos</var></a>:</td><td> </td><td valign="top"><a href="#Intrinsic-mathematical-methods">Intrinsic mathematical methods</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-acosh"><var>acosh</var></a>:</td><td> </td><td valign="top"><a href="#Intrinsic-mathematical-methods">Intrinsic mathematical methods</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-add"><code>add</code></a>:</td><td> </td><td valign="top"><a href="#ncbo-netCDF-Binary-Operator">ncbo netCDF Binary Operator</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-adding-data">adding data</a>:</td><td> </td><td valign="top"><a href="#ncbo-netCDF-Binary-Operator">ncbo netCDF Binary Operator</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-adding-data-1">adding data</a>:</td><td> </td><td valign="top"><a href="#ncflint-netCDF-File-Interpolator">ncflint netCDF File Interpolator</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-addition">addition</a>:</td><td> </td><td valign="top"><a href="#Intrinsic-mathematical-methods">Intrinsic mathematical methods</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-addition-1">addition</a>:</td><td> </td><td valign="top"><a href="#ncbo-netCDF-Binary-Operator">ncbo netCDF Binary Operator</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-addition-2">addition</a>:</td><td> </td><td valign="top"><a href="#ncflint-netCDF-File-Interpolator">ncflint netCDF File Interpolator</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-add_005foffset"><var>add_offset</var></a>:</td><td> </td><td valign="top"><a href="#Performance">Performance</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-add_005foffset-1"><code>add_offset</code></a>:</td><td> </td><td valign="top"><a href="#Packed-data">Packed data</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-add_005foffset-2"><code>add_offset</code></a>:</td><td> </td><td valign="top"><a href="#ncecat-netCDF-Ensemble-Concatenator">ncecat netCDF Ensemble Concatenator</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-add_005foffset-3"><code>add_offset</code></a>:</td><td> </td><td valign="top"><a href="#ncpdq-netCDF-Permute-Dimensions-Quickly">ncpdq netCDF Permute Dimensions Quickly</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-add_005foffset-4"><code>add_offset</code></a>:</td><td> </td><td valign="top"><a href="#ncrcat-netCDF-Record-Concatenator">ncrcat netCDF Record Concatenator</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-aggregation">aggregation</a>:</td><td> </td><td valign="top"><a href="#Combine-Files">Combine Files</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-Aleksandar-Jelenak">Aleksandar Jelenak</a>:</td><td> </td><td valign="top"><a href="#Contributors">Contributors</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-Alexander-Hansen">Alexander Hansen</a>:</td><td> </td><td valign="top"><a href="#Contributors">Contributors</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-alias"><code>alias</code></a>:</td><td> </td><td valign="top"><a href="#ncbo-netCDF-Binary-Operator">ncbo netCDF Binary Operator</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-alias-1">alias</a>:</td><td> </td><td valign="top"><a href="#Filters-for-ncks">Filters for <code>ncks</code></a></td></tr>
<tr><td></td><td valign="top"><a href="#index-alias-2"><code>alias</code></a>:</td><td> </td><td valign="top"><a href="#ncpdq-netCDF-Permute-Dimensions-Quickly">ncpdq netCDF Permute Dimensions Quickly</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-all">‘<samp>all</samp>’</a>:</td><td> </td><td valign="top"><a href="#Chunking">Chunking</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-alphabetization">alphabetization</a>:</td><td> </td><td valign="top"><a href="#ncks-netCDF-Kitchen-Sink">ncks netCDF Kitchen Sink</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-alphabetize-output">alphabetize output</a>:</td><td> </td><td valign="top"><a href="#Filters-for-ncks">Filters for <code>ncks</code></a></td></tr>
<tr><td></td><td valign="top"><a href="#index-alternate-invocations">alternate invocations</a>:</td><td> </td><td valign="top"><a href="#ncbo-netCDF-Binary-Operator">ncbo netCDF Binary Operator</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-anchor">anchor</a>:</td><td> </td><td valign="top"><a href="#Subsetting-Files">Subsetting Files</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-anchoring">anchoring</a>:</td><td> </td><td valign="top"><a href="#Subsetting-Files">Subsetting Files</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-Andrea-Cimatoribus">Andrea Cimatoribus</a>:</td><td> </td><td valign="top"><a href="#Contributors">Contributors</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-Andrew-Wittenberg">Andrew Wittenberg</a>:</td><td> </td><td valign="top"><a href="#Contributors">Contributors</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-annual-average">annual average</a>:</td><td> </td><td valign="top"><a href="#Annual-Average-over-Regions">Annual Average over Regions</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-annual-average-from-daily-data">annual average from daily data</a>:</td><td> </td><td valign="top"><a href="#Daily-data-in-one-file">Daily data in one file</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-annual-average-from-monthly-data">annual average from monthly data</a>:</td><td> </td><td valign="top"><a href="#Monthly-data-in-one-file">Monthly data in one file</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-anomalies">anomalies</a>:</td><td> </td><td valign="top"><a href="#ncbo-netCDF-Binary-Operator">ncbo netCDF Binary Operator</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-anomalies-1">anomalies</a>:</td><td> </td><td valign="top"><a href="#Annual-Average-over-Regions">Annual Average over Regions</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-anomalies-2">anomalies</a>:</td><td> </td><td valign="top"><a href="#Monthly-Cycle">Monthly Cycle</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-ANSI"><acronym>ANSI</acronym></a>:</td><td> </td><td valign="top"><a href="#Compatability">Compatability</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-ANSI-C"><code>ANSI C</code></a>:</td><td> </td><td valign="top"><a href="#Intrinsic-mathematical-methods">Intrinsic mathematical methods</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-appending-data">appending data</a>:</td><td> </td><td valign="top"><a href="#Examples-ncap2">Examples ncap2</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-appending-data-1">appending data</a>:</td><td> </td><td valign="top"><a href="#ncks-netCDF-Kitchen-Sink">ncks netCDF Kitchen Sink</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-appending-to-files">appending to files</a>:</td><td> </td><td valign="top"><a href="#Temporary-Output-Files">Temporary Output Files</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-appending-to-files-1">appending to files</a>:</td><td> </td><td valign="top"><a href="#Batch-Mode">Batch Mode</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-appending-to-files-2">appending to files</a>:</td><td> </td><td valign="top"><a href="#Filters-for-ncks">Filters for <code>ncks</code></a></td></tr>
<tr><td></td><td valign="top"><a href="#index-appending-variables">appending variables</a>:</td><td> </td><td valign="top"><a href="#Temporary-Output-Files">Temporary Output Files</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-appending-variables-1">appending variables</a>:</td><td> </td><td valign="top"><a href="#Appending-Variables">Appending Variables</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-appending-variables-2">appending variables</a>:</td><td> </td><td valign="top"><a href="#ncap2-netCDF-Arithmetic-Processor">ncap2 netCDF Arithmetic Processor</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-appending-variables-3">appending variables</a>:</td><td> </td><td valign="top"><a href="#ncpdq-netCDF-Permute-Dimensions-Quickly">ncpdq netCDF Permute Dimensions Quickly</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-AR4"><acronym>AR4</acronym></a>:</td><td> </td><td valign="top"><a href="#nces-netCDF-Ensemble-Statistics">nces netCDF Ensemble Statistics</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-arccosine-function">arccosine function</a>:</td><td> </td><td valign="top"><a href="#Intrinsic-mathematical-methods">Intrinsic mathematical methods</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-arcsine-function">arcsine function</a>:</td><td> </td><td valign="top"><a href="#Intrinsic-mathematical-methods">Intrinsic mathematical methods</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-arctangent-function">arctangent function</a>:</td><td> </td><td valign="top"><a href="#Intrinsic-mathematical-methods">Intrinsic mathematical methods</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-area"><code>area</code></a>:</td><td> </td><td valign="top"><a href="#CF-Conventions">CF Conventions</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-area_002daveraging">area-averaging</a>:</td><td> </td><td valign="top"><a href="#Annual-Average-over-Regions">Annual Average over Regions</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-arithmetic-operators">arithmetic operators</a>:</td><td> </td><td valign="top"><a href="#Missing-Values">Missing Values</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-arithmetic-operators-1">arithmetic operators</a>:</td><td> </td><td valign="top"><a href="#Missing-Values">Missing Values</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-arithmetic-operators-2">arithmetic operators</a>:</td><td> </td><td valign="top"><a href="#ncwa-netCDF-Weighted-Averager">ncwa netCDF Weighted Averager</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-arithmetic-processor">arithmetic processor</a>:</td><td> </td><td valign="top"><a href="#ncap2-netCDF-Arithmetic-Processor">ncap2 netCDF Arithmetic Processor</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-ARM-conventions"><acronym>ARM</acronym> conventions</a>:</td><td> </td><td valign="top"><a href="#ARM-Conventions">ARM Conventions</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-ARM-conventions-1">ARM conventions</a>:</td><td> </td><td valign="top"><a href="#ncrcat-netCDF-Record-Concatenator">ncrcat netCDF Record Concatenator</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-array"><code>array</code></a>:</td><td> </td><td valign="top"><a href="#Arrays-and-hyperslabs">Arrays and hyperslabs</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-array-function"><code>array</code> function</a>:</td><td> </td><td valign="top"><a href="#Arrays-and-hyperslabs">Arrays and hyperslabs</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-array-indexing">array indexing</a>:</td><td> </td><td valign="top"><a href="#Syntax-of-ncap2-statements">Syntax of ncap2 statements</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-array-storage">array storage</a>:</td><td> </td><td valign="top"><a href="#Syntax-of-ncap2-statements">Syntax of ncap2 statements</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-array-syntax">array syntax</a>:</td><td> </td><td valign="top"><a href="#Syntax-of-ncap2-statements">Syntax of ncap2 statements</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-arrays">arrays</a>:</td><td> </td><td valign="top"><a href="#Arrays-and-hyperslabs">Arrays and hyperslabs</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-arrival-value">arrival value</a>:</td><td> </td><td valign="top"><a href="#ncflint-netCDF-File-Interpolator">ncflint netCDF File Interpolator</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-ASCII"><acronym>ASCII</acronym></a>:</td><td> </td><td valign="top"><a href="#ncatted-netCDF-Attribute-Editor">ncatted netCDF Attribute Editor</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-ASCII-1"><acronym>ASCII</acronym></a>:</td><td> </td><td valign="top"><a href="#ncatted-netCDF-Attribute-Editor">ncatted netCDF Attribute Editor</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-asin"><var>asin</var></a>:</td><td> </td><td valign="top"><a href="#Intrinsic-mathematical-methods">Intrinsic mathematical methods</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-asinh"><var>asinh</var></a>:</td><td> </td><td valign="top"><a href="#Intrinsic-mathematical-methods">Intrinsic mathematical methods</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-asort"><code>asort</code></a>:</td><td> </td><td valign="top"><a href="#Sort-methods">Sort methods</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-assignment-statement">assignment statement</a>:</td><td> </td><td valign="top"><a href="#Syntax-of-ncap2-statements">Syntax of ncap2 statements</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-asynchronous-file-access">asynchronous file access</a>:</td><td> </td><td valign="top"><a href="#Remote-storage">Remote storage</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-atan"><var>atan</var></a>:</td><td> </td><td valign="top"><a href="#Intrinsic-mathematical-methods">Intrinsic mathematical methods</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-atanh"><var>atanh</var></a>:</td><td> </td><td valign="top"><a href="#Intrinsic-mathematical-methods">Intrinsic mathematical methods</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-attribute-inheritance">attribute inheritance</a>:</td><td> </td><td valign="top"><a href="#Attributes">Attributes</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-attribute-names">attribute names</a>:</td><td> </td><td valign="top"><a href="#ncatted-netCDF-Attribute-Editor">ncatted netCDF Attribute Editor</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-attribute-names-1">attribute names</a>:</td><td> </td><td valign="top"><a href="#ncrename-netCDF-Renamer">ncrename netCDF Renamer</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-attribute-propagation">attribute propagation</a>:</td><td> </td><td valign="top"><a href="#Attributes">Attributes</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-attribute-syntax">attribute syntax</a>:</td><td> </td><td valign="top"><a href="#Syntax-of-ncap2-statements">Syntax of ncap2 statements</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-attribute_002c-units">attribute, <code>units</code></a>:</td><td> </td><td valign="top"><a href="#UDUnits-Support">UDUnits Support</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-attributes">attributes</a>:</td><td> </td><td valign="top"><a href="#ncatted-netCDF-Attribute-Editor">ncatted netCDF Attribute Editor</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-attributes_002c-appending">attributes, appending</a>:</td><td> </td><td valign="top"><a href="#ncatted-netCDF-Attribute-Editor">ncatted netCDF Attribute Editor</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-attributes_002c-creating">attributes, creating</a>:</td><td> </td><td valign="top"><a href="#ncatted-netCDF-Attribute-Editor">ncatted netCDF Attribute Editor</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-attributes_002c-deleting">attributes, deleting</a>:</td><td> </td><td valign="top"><a href="#ncatted-netCDF-Attribute-Editor">ncatted netCDF Attribute Editor</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-attributes_002c-editing">attributes, editing</a>:</td><td> </td><td valign="top"><a href="#ncatted-netCDF-Attribute-Editor">ncatted netCDF Attribute Editor</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-attributes_002c-editing-1">attributes, editing</a>:</td><td> </td><td valign="top"><a href="#Annual-Average-over-Regions">Annual Average over Regions</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-attributes_002c-editing-2">attributes, editing</a>:</td><td> </td><td valign="top"><a href="#Regrid-MODIS-Data">Regrid MODIS Data</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-attributes_002c-global">attributes, global</a>:</td><td> </td><td valign="top"><a href="#Large-Numbers-of-Files">Large Numbers of Files</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-attributes_002c-global-1">attributes, global</a>:</td><td> </td><td valign="top"><a href="#History-Attribute">History Attribute</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-attributes_002c-global-2">attributes, global</a>:</td><td> </td><td valign="top"><a href="#File-List-Attributes">File List Attributes</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-attributes_002c-global-3">attributes, global</a>:</td><td> </td><td valign="top"><a href="#ARM-Conventions">ARM Conventions</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-attributes_002c-global-4">attributes, global</a>:</td><td> </td><td valign="top"><a href="#ncatted-netCDF-Attribute-Editor">ncatted netCDF Attribute Editor</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-attributes_002c-global-5">attributes, global</a>:</td><td> </td><td valign="top"><a href="#ncatted-netCDF-Attribute-Editor">ncatted netCDF Attribute Editor</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-attributes_002c-global-6">attributes, global</a>:</td><td> </td><td valign="top"><a href="#ncks-netCDF-Kitchen-Sink">ncks netCDF Kitchen Sink</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-attributes_002c-global-7">attributes, global</a>:</td><td> </td><td valign="top"><a href="#ncks-netCDF-Kitchen-Sink">ncks netCDF Kitchen Sink</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-attributes_002c-global-8">attributes, global</a>:</td><td> </td><td valign="top"><a href="#Filters-for-ncks">Filters for <code>ncks</code></a></td></tr>
<tr><td></td><td valign="top"><a href="#index-attributes_002c-global-9">attributes, global</a>:</td><td> </td><td valign="top"><a href="#ncrename-netCDF-Renamer">ncrename netCDF Renamer</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-attributes_002c-global-10">attributes, global</a>:</td><td> </td><td valign="top"><a href="#ncrename-netCDF-Renamer">ncrename netCDF Renamer</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-attributes_002c-modifying">attributes, modifying</a>:</td><td> </td><td valign="top"><a href="#ncatted-netCDF-Attribute-Editor">ncatted netCDF Attribute Editor</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-attributes_002c-modifying-1">attributes, modifying</a>:</td><td> </td><td valign="top"><a href="#Annual-Average-over-Regions">Annual Average over Regions</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-attributes_002c-modifying-2">attributes, modifying</a>:</td><td> </td><td valign="top"><a href="#Regrid-MODIS-Data">Regrid MODIS Data</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-attributes_002c-overwriting">attributes, overwriting</a>:</td><td> </td><td valign="top"><a href="#ncatted-netCDF-Attribute-Editor">ncatted netCDF Attribute Editor</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-attributes_002c-overwriting-1">attributes, overwriting</a>:</td><td> </td><td valign="top"><a href="#Annual-Average-over-Regions">Annual Average over Regions</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-attributes_002c-overwriting-2">attributes, overwriting</a>:</td><td> </td><td valign="top"><a href="#Regrid-MODIS-Data">Regrid MODIS Data</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-attributesncap2">attributes<code>ncap2</code></a>:</td><td> </td><td valign="top"><a href="#Attributes">Attributes</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-autoconf"><code>autoconf</code></a>:</td><td> </td><td valign="top"><a href="#Help-Requests-and-Bug-Reports">Help Requests and Bug Reports</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-autoconversion">autoconversion</a>:</td><td> </td><td valign="top"><a href="#Autoconversion">Autoconversion</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-automagic">automagic</a>:</td><td> </td><td valign="top"><a href="#Compatability">Compatability</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-automagic-1">automagic</a>:</td><td> </td><td valign="top"><a href="#Large-Numbers-of-Files">Large Numbers of Files</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-automatic-type-conversion">automatic type conversion</a>:</td><td> </td><td valign="top"><a href="#Type-Conversion">Type Conversion</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-automatic-type-conversion-1">automatic type conversion</a>:</td><td> </td><td valign="top"><a href="#Intrinsic-mathematical-methods">Intrinsic mathematical methods</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-auxiliary-coordinates">auxiliary coordinates</a>:</td><td> </td><td valign="top"><a href="#CF-Conventions">CF Conventions</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-average">average</a>:</td><td> </td><td valign="top"><a href="#Operation-Types">Operation Types</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-average-1">average</a>:</td><td> </td><td valign="top"><a href="#ncwa-netCDF-Weighted-Averager">ncwa netCDF Weighted Averager</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-average-2">average</a>:</td><td> </td><td valign="top"><a href="#Daily-data-in-one-file">Daily data in one file</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-average-3">average</a>:</td><td> </td><td valign="top"><a href="#Daily-data-in-one-file">Daily data in one file</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-average-4">average</a>:</td><td> </td><td valign="top"><a href="#Monthly-data-in-one-file">Monthly data in one file</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-average-5">average</a>:</td><td> </td><td valign="top"><a href="#Monthly-data-in-one-file">Monthly data in one file</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-average-6">average</a>:</td><td> </td><td valign="top"><a href="#One-time-point-one-file">One time point one file</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-average-7">average</a>:</td><td> </td><td valign="top"><a href="#Global-Distribution-of-Long_002dterm-Average">Global Distribution of Long-term Average</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-average-8">average</a>:</td><td> </td><td valign="top"><a href="#Annual-Average-over-Regions">Annual Average over Regions</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-average-9">average</a>:</td><td> </td><td valign="top"><a href="#Monthly-Cycle">Monthly Cycle</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-averaging-data">averaging data</a>:</td><td> </td><td valign="top"><a href="#Missing-Values">Missing Values</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-averaging-data-1">averaging data</a>:</td><td> </td><td valign="top"><a href="#nces-netCDF-Ensemble-Statistics">nces netCDF Ensemble Statistics</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-averaging-data-2">averaging data</a>:</td><td> </td><td valign="top"><a href="#ncra-netCDF-Record-Averager">ncra netCDF Record Averager</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-averaging-data-3">averaging data</a>:</td><td> </td><td valign="top"><a href="#ncwa-netCDF-Weighted-Averager">ncwa netCDF Weighted Averager</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-avg"><code>avg</code></a>:</td><td> </td><td valign="top"><a href="#Operation-Types">Operation Types</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-avg_0028_0029">avg()</a>:</td><td> </td><td valign="top"><a href="#Methods-and-functions">Methods and functions</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-avgsqr"><code>avgsqr</code></a>:</td><td> </td><td valign="top"><a href="#Operation-Types">Operation Types</a></td></tr>
<tr><td colspan="4"> <hr></td></tr>
<tr><th><a name="General-Index_cp_letter-B">B</a></th><td></td><td></td></tr>
<tr><td></td><td valign="top"><a href="#index-Barry-deFreese">Barry deFreese</a>:</td><td> </td><td valign="top"><a href="#Contributors">Contributors</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-base_005ftime"><code>base_time</code></a>:</td><td> </td><td valign="top"><a href="#ARM-Conventions">ARM Conventions</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-bash"><code>bash</code></a>:</td><td> </td><td valign="top"><a href="#Subsetting-Files">Subsetting Files</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-bash-1"><code>bash</code></a>:</td><td> </td><td valign="top"><a href="#Filters-for-ncks">Filters for <code>ncks</code></a></td></tr>
<tr><td></td><td valign="top"><a href="#index-Bash-shell">Bash shell</a>:</td><td> </td><td valign="top"><a href="#ncbo-netCDF-Binary-Operator">ncbo netCDF Binary Operator</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-Bash-Shell">Bash Shell</a>:</td><td> </td><td valign="top"><a href="#ncbo-netCDF-Binary-Operator">ncbo netCDF Binary Operator</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-Bash-shell-1">Bash shell</a>:</td><td> </td><td valign="top"><a href="#Filters-for-ncks">Filters for <code>ncks</code></a></td></tr>
<tr><td></td><td valign="top"><a href="#index-batch-mode">batch mode</a>:</td><td> </td><td valign="top"><a href="#Batch-Mode">Batch Mode</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-beer">beer</a>:</td><td> </td><td valign="top"><a href="#Promoting-Single_002dprecision-to-Double">Promoting Single-precision to Double</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-benchmarks">benchmarks</a>:</td><td> </td><td valign="top"><a href="#OpenMP-Threading">OpenMP Threading</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-Bessel-function">Bessel function</a>:</td><td> </td><td valign="top"><a href="#GSL-special-functions">GSL special functions</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-bilinear-interpolation">bilinear interpolation</a>:</td><td> </td><td valign="top"><a href="#Regrid-MODIS-Data">Regrid MODIS Data</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-Bill-Kocik">Bill Kocik</a>:</td><td> </td><td valign="top"><a href="#Contributors">Contributors</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-binary-format">binary format</a>:</td><td> </td><td valign="top"><a href="#ncks-netCDF-Kitchen-Sink">ncks netCDF Kitchen Sink</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-binary-operations">binary operations</a>:</td><td> </td><td valign="top"><a href="#Memory-for-ncap2">Memory for ncap2</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-binary-operations-1">binary operations</a>:</td><td> </td><td valign="top"><a href="#ncbo-netCDF-Binary-Operator">ncbo netCDF Binary Operator</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-binary-Operators">binary Operators</a>:</td><td> </td><td valign="top"><a href="#Expressions">Expressions</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-blank">blank</a>:</td><td> </td><td valign="top"><a href="#ncks-netCDF-Kitchen-Sink">ncks netCDF Kitchen Sink</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-bounds"><code>bounds</code></a>:</td><td> </td><td valign="top"><a href="#CF-Conventions">CF Conventions</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-bounds-convention">bounds convention</a>:</td><td> </td><td valign="top"><a href="#CF-Conventions">CF Conventions</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-Bourne-Shell">Bourne Shell</a>:</td><td> </td><td valign="top"><a href="#Stride">Stride</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-Bourne-Shell-1">Bourne Shell</a>:</td><td> </td><td valign="top"><a href="#ncbo-netCDF-Binary-Operator">ncbo netCDF Binary Operator</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-Brian-Mays">Brian Mays</a>:</td><td> </td><td valign="top"><a href="#Contributors">Contributors</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-broadcasting">broadcasting</a>:</td><td> </td><td valign="top"><a href="#ncbo-netCDF-Binary-Operator">ncbo netCDF Binary Operator</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-broadcasting-groups">broadcasting groups</a>:</td><td> </td><td valign="top"><a href="#netCDF2_002f3_002f4-and-HDF4_002f5-Support">netCDF2/3/4 and HDF4/5 Support</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-broadcasting-groups-1">broadcasting groups</a>:</td><td> </td><td valign="top"><a href="#ncbo-netCDF-Binary-Operator">ncbo netCDF Binary Operator</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-broadcasting-groups-2">broadcasting groups</a>:</td><td> </td><td valign="top"><a href="#ncbo-netCDF-Binary-Operator">ncbo netCDF Binary Operator</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-broadcasting-variables">broadcasting variables</a>:</td><td> </td><td valign="top"><a href="#Expressions">Expressions</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-broadcasting-variables-1">broadcasting variables</a>:</td><td> </td><td valign="top"><a href="#ncbo-netCDF-Binary-Operator">ncbo netCDF Binary Operator</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-broadcasting-variables-2">broadcasting variables</a>:</td><td> </td><td valign="top"><a href="#ncbo-netCDF-Binary-Operator">ncbo netCDF Binary Operator</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-broadcasting-variables-3">broadcasting variables</a>:</td><td> </td><td valign="top"><a href="#ncflint-netCDF-File-Interpolator">ncflint netCDF File Interpolator</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-broadcasting-variables-4">broadcasting variables</a>:</td><td> </td><td valign="top"><a href="#ncwa-netCDF-Weighted-Averager">ncwa netCDF Weighted Averager</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-BSD"><code>BSD</code></a>:</td><td> </td><td valign="top"><a href="#Command-Line-Options">Command Line Options</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-Buffer-sizes">Buffer sizes</a>:</td><td> </td><td valign="top"><a href="#Buffer-sizes">Buffer sizes</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-buffering">buffering</a>:</td><td> </td><td valign="top"><a href="#Performance">Performance</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-bugs_002c-reporting">bugs, reporting</a>:</td><td> </td><td valign="top"><a href="#Help-Requests-and-Bug-Reports">Help Requests and Bug Reports</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-byte_0028_0029">byte()</a>:</td><td> </td><td valign="top"><a href="#Methods-and-functions">Methods and functions</a></td></tr>
<tr><td colspan="4"> <hr></td></tr>
<tr><th><a name="General-Index_cp_letter-C">C</a></th><td></td><td></td></tr>
<tr><td></td><td valign="top"><a href="#index-C-index-convention">C index convention</a>:</td><td> </td><td valign="top"><a href="#C-and-Fortran-Index-Conventions">C and Fortran Index Conventions</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-C-language">C language</a>:</td><td> </td><td valign="top"><a href="#Compatability">Compatability</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-C-language-1">C language</a>:</td><td> </td><td valign="top"><a href="#Missing-Values">Missing Values</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-C-language-2">C language</a>:</td><td> </td><td valign="top"><a href="#Automatic-type-conversion">Automatic type conversion</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-C-language-3">C language</a>:</td><td> </td><td valign="top"><a href="#Promoting-Single_002dprecision-to-Double">Promoting Single-precision to Double</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-C-language-4">C language</a>:</td><td> </td><td valign="top"><a href="#Syntax-of-ncap2-statements">Syntax of ncap2 statements</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-C-language-5">C language</a>:</td><td> </td><td valign="top"><a href="#Expressions">Expressions</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-C-language-6">C language</a>:</td><td> </td><td valign="top"><a href="#ncatted-netCDF-Attribute-Editor">ncatted netCDF Attribute Editor</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-C-language-7">C language</a>:</td><td> </td><td valign="top"><a href="#ncks-netCDF-Kitchen-Sink">ncks netCDF Kitchen Sink</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-C-Shell">C Shell</a>:</td><td> </td><td valign="top"><a href="#Stride">Stride</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-C-Shell-1">C Shell</a>:</td><td> </td><td valign="top"><a href="#ncbo-netCDF-Binary-Operator">ncbo netCDF Binary Operator</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-c_002b_002b"><code>c++</code></a>:</td><td> </td><td valign="top"><a href="#Compatability">Compatability</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-C_002b_002b">C++</a>:</td><td> </td><td valign="top"><a href="#Compatability">Compatability</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-C89">C89</a>:</td><td> </td><td valign="top"><a href="#Compatability">Compatability</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-C89-1">C89</a>:</td><td> </td><td valign="top"><a href="#Compatability">Compatability</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-C99">C99</a>:</td><td> </td><td valign="top"><a href="#Compatability">Compatability</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-C99-1">C99</a>:</td><td> </td><td valign="top"><a href="#Compatability">Compatability</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-C99-2">C99</a>:</td><td> </td><td valign="top"><a href="#Windows-Operating-System">Windows Operating System</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-CAM3"><acronym>CAM3</acronym></a>:</td><td> </td><td valign="top"><a href="#Promoting-Single_002dprecision-to-Double">Promoting Single-precision to Double</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-CC"><code>CC</code></a>:</td><td> </td><td valign="top"><a href="#Compatability">Compatability</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-cc"><code>cc</code></a>:</td><td> </td><td valign="top"><a href="#Compatability">Compatability</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-CCM-Processor"><acronym>CCM</acronym> Processor</a>:</td><td> </td><td valign="top"><a href="#Specifying-Input-Files">Specifying Input Files</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-CCM-Processor-1"><acronym>CCM</acronym> Processor</a>:</td><td> </td><td valign="top"><a href="#ncra-netCDF-Record-Averager">ncra netCDF Record Averager</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-CCM-Processor-2"><acronym>CCM</acronym> Processor</a>:</td><td> </td><td valign="top"><a href="#ncrcat-netCDF-Record-Concatenator">ncrcat netCDF Record Concatenator</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-CCSM"><acronym>CCSM</acronym></a>:</td><td> </td><td valign="top"><a href="#Proposals-for-Institutional-Funding">Proposals for Institutional Funding</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-CCSM-1">CCSM</a>:</td><td> </td><td valign="top"><a href="#CCSM-Example">CCSM Example</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-CCSM-conventions"><acronym>CCSM</acronym> conventions</a>:</td><td> </td><td valign="top"><a href="#CF-Conventions">CF Conventions</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-CDL"><acronym>CDL</acronym></a>:</td><td> </td><td valign="top"><a href="#ncks-netCDF-Kitchen-Sink">ncks netCDF Kitchen Sink</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-ceil"><var>ceil</var></a>:</td><td> </td><td valign="top"><a href="#Intrinsic-mathematical-methods">Intrinsic mathematical methods</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-ceiling-function">ceiling function</a>:</td><td> </td><td valign="top"><a href="#Intrinsic-mathematical-methods">Intrinsic mathematical methods</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-cell-methods-convention">cell methods convention</a>:</td><td> </td><td valign="top"><a href="#CF-Conventions">CF Conventions</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-cell_002dbased-grids">cell-based grids</a>:</td><td> </td><td valign="top"><a href="#Auxiliary-Coordinates">Auxiliary Coordinates</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-cell_005fmethods"><code>cell_methods</code></a>:</td><td> </td><td valign="top"><a href="#CF-Conventions">CF Conventions</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-CF-compliance-checker"><acronym>CF</acronym> compliance checker</a>:</td><td> </td><td valign="top"><a href="#Group-Path-Editing">Group Path Editing</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-CF-conventions"><acronym>CF</acronym> conventions</a>:</td><td> </td><td valign="top"><a href="#Subsetting-Coordinate-Variables">Subsetting Coordinate Variables</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-CF-conventions-1"><acronym>CF</acronym> conventions</a>:</td><td> </td><td valign="top"><a href="#Auxiliary-Coordinates">Auxiliary Coordinates</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-CF-conventions-2"><acronym>CF</acronym> conventions</a>:</td><td> </td><td valign="top"><a href="#UDUnits-Support">UDUnits Support</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-CF-conventions-3"><acronym>CF</acronym> conventions</a>:</td><td> </td><td valign="top"><a href="#CF-Conventions">CF Conventions</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-CF-conventions-4"><acronym>CF</acronym> conventions</a>:</td><td> </td><td valign="top"><a href="#ncbo-netCDF-Binary-Operator">ncbo netCDF Binary Operator</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-cfchecker"><code>cfchecker</code></a>:</td><td> </td><td valign="top"><a href="#Group-Path-Editing">Group Path Editing</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-change_005fmiss_0028_0029"><code>change_miss()</code></a>:</td><td> </td><td valign="top"><a href="#Missing-values-ncap2">Missing values ncap2</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-char_0028_0029">char()</a>:</td><td> </td><td valign="top"><a href="#Methods-and-functions">Methods and functions</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-characters_002c-special">characters, special</a>:</td><td> </td><td valign="top"><a href="#ncatted-netCDF-Attribute-Editor">ncatted netCDF Attribute Editor</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-Charlie-Zender">Charlie Zender</a>:</td><td> </td><td valign="top"><a href="#Foreword">Foreword</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-Charlie-Zender-1">Charlie Zender</a>:</td><td> </td><td valign="top"><a href="#Contributors">Contributors</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-chocolate">chocolate</a>:</td><td> </td><td valign="top"><a href="#Contributing">Contributing</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-Chris-Barker">Chris Barker</a>:</td><td> </td><td valign="top"><a href="#Chunking">Chunking</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-chunking">chunking</a>:</td><td> </td><td valign="top"><a href="#netCDF2_002f3_002f4-and-HDF4_002f5-Support">netCDF2/3/4 and HDF4/5 Support</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-chunking-1">chunking</a>:</td><td> </td><td valign="top"><a href="#Chunking">Chunking</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-chunking-2">chunking</a>:</td><td> </td><td valign="top"><a href="#ncks-netCDF-Kitchen-Sink">ncks netCDF Kitchen Sink</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-chunking-map">chunking map</a>:</td><td> </td><td valign="top"><a href="#Chunking">Chunking</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-chunking-map-1">chunking map</a>:</td><td> </td><td valign="top"><a href="#Chunking">Chunking</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-chunking-policy">chunking policy</a>:</td><td> </td><td valign="top"><a href="#Chunking">Chunking</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-chunksize">chunksize</a>:</td><td> </td><td valign="top"><a href="#Chunking">Chunking</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-clang"><code>clang</code></a>:</td><td> </td><td valign="top"><a href="#Compatability">Compatability</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-CLASSIC-files"><code>CLASSIC</code> files</a>:</td><td> </td><td valign="top"><a href="#File-Formats-and-Conversion">File Formats and Conversion</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-client_002dserver">client-server</a>:</td><td> </td><td valign="top"><a href="#OPeNDAP">OPeNDAP</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-Climate-and-Forecast-Metadata-Convention">Climate and Forecast Metadata Convention</a>:</td><td> </td><td valign="top"><a href="#UDUnits-Support">UDUnits Support</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-climate-model">climate model</a>:</td><td> </td><td valign="top"><a href="#Philosophy">Philosophy</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-climate-model-1">climate model</a>:</td><td> </td><td valign="top"><a href="#Climate-Model-Paradigm">Climate Model Paradigm</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-climate-model-2">climate model</a>:</td><td> </td><td valign="top"><a href="#Concatenation">Concatenation</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-climate-model-3">climate model</a>:</td><td> </td><td valign="top"><a href="#Specifying-Input-Files">Specifying Input Files</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-climate-model-4">climate model</a>:</td><td> </td><td valign="top"><a href="#ncecat-netCDF-Ensemble-Concatenator">ncecat netCDF Ensemble Concatenator</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-climate-model-5">climate model</a>:</td><td> </td><td valign="top"><a href="#Normalization-and-Integration">Normalization and Integration</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-climate-model-6">climate model</a>:</td><td> </td><td valign="top"><a href="#Normalization-and-Integration">Normalization and Integration</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-clipping-operators">clipping operators</a>:</td><td> </td><td valign="top"><a href="#Expressions">Expressions</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-CMIP"><acronym>CMIP</acronym></a>:</td><td> </td><td valign="top"><a href="#nces-netCDF-Ensemble-Statistics">nces netCDF Ensemble Statistics</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-CMIP-1"><acronym>CMIP</acronym></a>:</td><td> </td><td valign="top"><a href="#ncecat-netCDF-Ensemble-Concatenator">ncecat netCDF Ensemble Concatenator</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-CMIP5"><acronym>CMIP5</acronym></a>:</td><td> </td><td valign="top"><a href="#CMIP5-Example">CMIP5 Example</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-cnk_005fall">‘<samp>cnk_all</samp>’</a>:</td><td> </td><td valign="top"><a href="#Chunking">Chunking</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-cnk_005fdmn">‘<samp>cnk_dmn</samp>’</a>:</td><td> </td><td valign="top"><a href="#Chunking">Chunking</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-cnk_005fg2d">‘<samp>cnk_g2d</samp>’</a>:</td><td> </td><td valign="top"><a href="#Chunking">Chunking</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-cnk_005fg3d">‘<samp>cnk_g3d</samp>’</a>:</td><td> </td><td valign="top"><a href="#Chunking">Chunking</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-cnk_005flfp">‘<samp>cnk_lfp</samp>’</a>:</td><td> </td><td valign="top"><a href="#Chunking">Chunking</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-cnk_005fmap"><var>cnk_map</var></a>:</td><td> </td><td valign="top"><a href="#Chunking">Chunking</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-cnk_005fprd">‘<samp>cnk_prd</samp>’</a>:</td><td> </td><td valign="top"><a href="#Chunking">Chunking</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-cnk_005frd1">‘<samp>cnk_rd1</samp>’</a>:</td><td> </td><td valign="top"><a href="#Chunking">Chunking</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-cnk_005fscl">‘<samp>cnk_scl</samp>’</a>:</td><td> </td><td valign="top"><a href="#Chunking">Chunking</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-cnk_005fxpl">‘<samp>cnk_xpl</samp>’</a>:</td><td> </td><td valign="top"><a href="#Chunking">Chunking</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-cnk_005fxst">‘<samp>cnk_xst</samp>’</a>:</td><td> </td><td valign="top"><a href="#Chunking">Chunking</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-cnk_005fxst-1">‘<samp>cnk_xst</samp>’</a>:</td><td> </td><td valign="top"><a href="#Chunking">Chunking</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-Comeau">Comeau</a>:</td><td> </td><td valign="top"><a href="#Compatability">Compatability</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-command-line-options">command line options</a>:</td><td> </td><td valign="top"><a href="#Command-Line-Options">Command Line Options</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-command-line-switches">command line switches</a>:</td><td> </td><td valign="top"><a href="#Philosophy">Philosophy</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-command-line-switches-1">command line switches</a>:</td><td> </td><td valign="top"><a href="#Common-features">Common features</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-command-line-switches-2">command line switches</a>:</td><td> </td><td valign="top"><a href="#Specifying-Output-Files">Specifying Output Files</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-command-line-switches-3">command line switches</a>:</td><td> </td><td valign="top"><a href="#Operator-Reference-Manual">Operator Reference Manual</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-comments">comments</a>:</td><td> </td><td valign="top"><a href="#Syntax-of-ncap2-statements">Syntax of ncap2 statements</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-como"><code>como</code></a>:</td><td> </td><td valign="top"><a href="#Compatability">Compatability</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-Compaq">Compaq</a>:</td><td> </td><td valign="top"><a href="#Compatability">Compatability</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-comparator">comparator</a>:</td><td> </td><td valign="top"><a href="#Mask-condition">Mask condition</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-compatability">compatability</a>:</td><td> </td><td valign="top"><a href="#Compatability">Compatability</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-compilers">compilers</a>:</td><td> </td><td valign="top"><a href="#Specifying-Output-Files">Specifying Output Files</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-complementary-error-function">complementary error function</a>:</td><td> </td><td valign="top"><a href="#Intrinsic-mathematical-methods">Intrinsic mathematical methods</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-compliance-checker">compliance checker</a>:</td><td> </td><td valign="top"><a href="#Group-Path-Editing">Group Path Editing</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-compression">compression</a>:</td><td> </td><td valign="top"><a href="#Deflation">Deflation</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-compression-1">compression</a>:</td><td> </td><td valign="top"><a href="#ncks-netCDF-Kitchen-Sink">ncks netCDF Kitchen Sink</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-concatenation">concatenation</a>:</td><td> </td><td valign="top"><a href="#Appending-Variables">Appending Variables</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-concatenation-1">concatenation</a>:</td><td> </td><td valign="top"><a href="#ncecat-netCDF-Ensemble-Concatenator">ncecat netCDF Ensemble Concatenator</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-concatenation-2">concatenation</a>:</td><td> </td><td valign="top"><a href="#ncpdq-netCDF-Permute-Dimensions-Quickly">ncpdq netCDF Permute Dimensions Quickly</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-concatenation-3">concatenation</a>:</td><td> </td><td valign="top"><a href="#ncrcat-netCDF-Record-Concatenator">ncrcat netCDF Record Concatenator</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-conditional-Operator">conditional Operator</a>:</td><td> </td><td valign="top"><a href="#Expressions">Expressions</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-config_002eguess"><samp>config.guess</samp></a>:</td><td> </td><td valign="top"><a href="#Help-Requests-and-Bug-Reports">Help Requests and Bug Reports</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-configure_002eeg"><samp>configure.eg</samp></a>:</td><td> </td><td valign="top"><a href="#Help-Requests-and-Bug-Reports">Help Requests and Bug Reports</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-constraint-expressions">constraint expressions</a>:</td><td> </td><td valign="top"><a href="#OPeNDAP">OPeNDAP</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-contents">contents</a>:</td><td> </td><td valign="top"><a href="#How-to-Use-This-guide">How to Use This guide</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-contributing">contributing</a>:</td><td> </td><td valign="top"><a href="#Contributing">Contributing</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-contributors">contributors</a>:</td><td> </td><td valign="top"><a href="#Contributors">Contributors</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-coordinate-limits">coordinate limits</a>:</td><td> </td><td valign="top"><a href="#Hyperslabs">Hyperslabs</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-coordinate-variable">coordinate variable</a>:</td><td> </td><td valign="top"><a href="#UDUnits-Support">UDUnits Support</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-coordinate-variable-1">coordinate variable</a>:</td><td> </td><td valign="top"><a href="#Operation-Types">Operation Types</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-coordinate-variable-2">coordinate variable</a>:</td><td> </td><td valign="top"><a href="#CF-Conventions">CF Conventions</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-coordinate-variable-3">coordinate variable</a>:</td><td> </td><td valign="top"><a href="#ncbo-netCDF-Binary-Operator">ncbo netCDF Binary Operator</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-coordinate-variable-4">coordinate variable</a>:</td><td> </td><td valign="top"><a href="#ncwa-netCDF-Weighted-Averager">ncwa netCDF Weighted Averager</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-coordinate-variables">coordinate variables</a>:</td><td> </td><td valign="top"><a href="#ncrename-netCDF-Renamer">ncrename netCDF Renamer</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-coordinates"><code>coordinates</code></a>:</td><td> </td><td valign="top"><a href="#Auxiliary-Coordinates">Auxiliary Coordinates</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-coordinates-1"><code>coordinates</code></a>:</td><td> </td><td valign="top"><a href="#CF-Conventions">CF Conventions</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-coordinates-2">coordinates</a>:</td><td> </td><td valign="top"><a href="#Add-Coordinates-to-MODIS-Data">Add Coordinates to MODIS Data</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-coordinates-convention">coordinates convention</a>:</td><td> </td><td valign="top"><a href="#CF-Conventions">CF Conventions</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-coordinates_002c-modifying">coordinates, modifying</a>:</td><td> </td><td valign="top"><a href="#Permute-MODIS-Coordinates">Permute MODIS Coordinates</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-core-dump">core dump</a>:</td><td> </td><td valign="top"><a href="#Help-Requests-and-Bug-Reports">Help Requests and Bug Reports</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-core-dump-1"><code>core dump</code></a>:</td><td> </td><td valign="top"><a href="#Large-Datasets">Large Datasets</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-core-dump-2"><code>core dump</code></a>:</td><td> </td><td valign="top"><a href="#Filters-for-ncks">Filters for <code>ncks</code></a></td></tr>
<tr><td></td><td valign="top"><a href="#index-cos"><var>cos</var></a>:</td><td> </td><td valign="top"><a href="#Intrinsic-mathematical-methods">Intrinsic mathematical methods</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-cosh"><var>cosh</var></a>:</td><td> </td><td valign="top"><a href="#Intrinsic-mathematical-methods">Intrinsic mathematical methods</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-cosine-function">cosine function</a>:</td><td> </td><td valign="top"><a href="#Intrinsic-mathematical-methods">Intrinsic mathematical methods</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-covariance">covariance</a>:</td><td> </td><td valign="top"><a href="#Examples-ncap2">Examples ncap2</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-cp"><code>cp</code></a>:</td><td> </td><td valign="top"><a href="#Subsetting-Files">Subsetting Files</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-Cray">Cray</a>:</td><td> </td><td valign="top"><a href="#Compatability">Compatability</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-Cray-1">Cray</a>:</td><td> </td><td valign="top"><a href="#Large-Datasets">Large Datasets</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-csh"><code>csh</code></a>:</td><td> </td><td valign="top"><a href="#Subsetting-Files">Subsetting Files</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-Csh-shell">Csh shell</a>:</td><td> </td><td valign="top"><a href="#Filters-for-ncks">Filters for <code>ncks</code></a></td></tr>
<tr><td></td><td valign="top"><a href="#index-cxx"><code>cxx</code></a>:</td><td> </td><td valign="top"><a href="#Compatability">Compatability</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-Cygwin">Cygwin</a>:</td><td> </td><td valign="top"><a href="#Windows-Operating-System">Windows Operating System</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-Cygwin-1">Cygwin</a>:</td><td> </td><td valign="top"><a href="#Symbolic-Links">Symbolic Links</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-C_005fformat"><var>C_format</var></a>:</td><td> </td><td valign="top"><a href="#Performance">Performance</a></td></tr>
<tr><td colspan="4"> <hr></td></tr>
<tr><th><a name="General-Index_cp_letter-D">D</a></th><td></td><td></td></tr>
<tr><td></td><td valign="top"><a href="#index-daily-data">daily data</a>:</td><td> </td><td valign="top"><a href="#Daily-data-in-one-file">Daily data in one file</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-daily-data-1">daily data</a>:</td><td> </td><td valign="top"><a href="#One-time-point-one-file">One time point one file</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-daily-data-2">daily data</a>:</td><td> </td><td valign="top"><a href="#Multiple-files-with-multiple-time-points">Multiple files with multiple time points</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-Daniel-Baumann">Daniel Baumann</a>:</td><td> </td><td valign="top"><a href="#Contributors">Contributors</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-Daniel-Wang">Daniel Wang</a>:</td><td> </td><td valign="top"><a href="#Contributors">Contributors</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-DAP"><acronym>DAP</acronym></a>:</td><td> </td><td valign="top"><a href="#OPeNDAP">OPeNDAP</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-data-access-protocol">data access protocol</a>:</td><td> </td><td valign="top"><a href="#OPeNDAP">OPeNDAP</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-data-safety">data safety</a>:</td><td> </td><td valign="top"><a href="#Temporary-Output-Files">Temporary Output Files</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-data-safety-1">data safety</a>:</td><td> </td><td valign="top"><a href="#ncrename-netCDF-Renamer">ncrename netCDF Renamer</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-data_002c-missing">data, missing</a>:</td><td> </td><td valign="top"><a href="#Missing-Values">Missing Values</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-data_002c-missing-1">data, missing</a>:</td><td> </td><td valign="top"><a href="#ncatted-netCDF-Attribute-Editor">ncatted netCDF Attribute Editor</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-date"><code>date</code></a>:</td><td> </td><td valign="top"><a href="#CF-Conventions">CF Conventions</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-datesec"><code>datesec</code></a>:</td><td> </td><td valign="top"><a href="#CF-Conventions">CF Conventions</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-dbg_005flvl"><var>dbg_lvl</var></a>:</td><td> </td><td valign="top"><a href="#Help-Requests-and-Bug-Reports">Help Requests and Bug Reports</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-dbg_005flvl-1"><var>dbg_lvl</var></a>:</td><td> </td><td valign="top"><a href="#Large-Datasets">Large Datasets</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-dbg_005flvl-2"><var>dbg_lvl</var></a>:</td><td> </td><td valign="top"><a href="#OpenMP-Threading">OpenMP Threading</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-DDRA"><acronym>DDRA</acronym></a>:</td><td> </td><td valign="top"><a href="#Proposals-for-Institutional-Funding">Proposals for Institutional Funding</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-Debian">Debian</a>:</td><td> </td><td valign="top"><a href="#netCDF2_002f3_002f4-and-HDF4_002f5-Support">netCDF2/3/4 and HDF4/5 Support</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-debug_002dlevel"><var>debug-level</var></a>:</td><td> </td><td valign="top"><a href="#Help-Requests-and-Bug-Reports">Help Requests and Bug Reports</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-debug_002dlevel-1"><var>debug-level</var></a>:</td><td> </td><td valign="top"><a href="#Large-Datasets">Large Datasets</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-debugging">debugging</a>:</td><td> </td><td valign="top"><a href="#Help-Requests-and-Bug-Reports">Help Requests and Bug Reports</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-debugging-1">debugging</a>:</td><td> </td><td valign="top"><a href="#Large-Datasets">Large Datasets</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-debugging-2">debugging</a>:</td><td> </td><td valign="top"><a href="#OpenMP-Threading">OpenMP Threading</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-DEC"><acronym>DEC</acronym></a>:</td><td> </td><td valign="top"><a href="#Compatability">Compatability</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-defdim_0028_0029"><code>defdim()</code></a>:</td><td> </td><td valign="top"><a href="#Dimensions">Dimensions</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-defining-dimensions-in-ncap2">defining dimensions in <code>ncap2</code></a>:</td><td> </td><td valign="top"><a href="#Dimensions">Dimensions</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-deflation">deflation</a>:</td><td> </td><td valign="top"><a href="#netCDF2_002f3_002f4-and-HDF4_002f5-Support">netCDF2/3/4 and HDF4/5 Support</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-deflation-1">deflation</a>:</td><td> </td><td valign="top"><a href="#Deflation">Deflation</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-deflation-2">deflation</a>:</td><td> </td><td valign="top"><a href="#ncks-netCDF-Kitchen-Sink">ncks netCDF Kitchen Sink</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-degenerate-dimension">degenerate dimension</a>:</td><td> </td><td valign="top"><a href="#Chunking">Chunking</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-degenerate-dimension-1">degenerate dimension</a>:</td><td> </td><td valign="top"><a href="#Operation-Types">Operation Types</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-degenerate-dimension-2">degenerate dimension</a>:</td><td> </td><td valign="top"><a href="#Examples-ncap2">Examples ncap2</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-degenerate-dimension-3">degenerate dimension</a>:</td><td> </td><td valign="top"><a href="#ncbo-netCDF-Binary-Operator">ncbo netCDF Binary Operator</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-degenerate-dimension-4">degenerate dimension</a>:</td><td> </td><td valign="top"><a href="#ncecat-netCDF-Ensemble-Concatenator">ncecat netCDF Ensemble Concatenator</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-degenerate-dimension-5">degenerate dimension</a>:</td><td> </td><td valign="top"><a href="#ncflint-netCDF-File-Interpolator">ncflint netCDF File Interpolator</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-degenerate-dimension-6">degenerate dimension</a>:</td><td> </td><td valign="top"><a href="#ncpdq-netCDF-Permute-Dimensions-Quickly">ncpdq netCDF Permute Dimensions Quickly</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-degenerate-dimension-7">degenerate dimension</a>:</td><td> </td><td valign="top"><a href="#ncra-netCDF-Record-Averager">ncra netCDF Record Averager</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-degenerate-dimension-8">degenerate dimension</a>:</td><td> </td><td valign="top"><a href="#ncwa-netCDF-Weighted-Averager">ncwa netCDF Weighted Averager</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-degenerate-dimension-9">degenerate dimension</a>:</td><td> </td><td valign="top"><a href="#Normalization-and-Integration">Normalization and Integration</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-delete-_0028groups_0029">delete (groups)</a>:</td><td> </td><td valign="top"><a href="#Group-Path-Editing">Group Path Editing</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-delete_005fmiss_0028_0029"><code>delete_miss()</code></a>:</td><td> </td><td valign="top"><a href="#Missing-values-ncap2">Missing values ncap2</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-demotion">demotion</a>:</td><td> </td><td valign="top"><a href="#Type-Conversion">Type Conversion</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-Dennis-Heimbigner">Dennis Heimbigner</a>:</td><td> </td><td valign="top"><a href="#Contributors">Contributors</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-derived-fields">derived fields</a>:</td><td> </td><td valign="top"><a href="#ncap2-netCDF-Arithmetic-Processor">ncap2 netCDF Arithmetic Processor</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-derived-fields-1">derived fields</a>:</td><td> </td><td valign="top"><a href="#ncap2-netCDF-Arithmetic-Processor">ncap2 netCDF Arithmetic Processor</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-digest">digest</a>:</td><td> </td><td valign="top"><a href="#MD5-digests">MD5 digests</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-Digital">Digital</a>:</td><td> </td><td valign="top"><a href="#Compatability">Compatability</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-dimension-limits">dimension limits</a>:</td><td> </td><td valign="top"><a href="#Hyperslabs">Hyperslabs</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-dimension-names">dimension names</a>:</td><td> </td><td valign="top"><a href="#ncrename-netCDF-Renamer">ncrename netCDF Renamer</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-dimension-order">dimension order</a>:</td><td> </td><td valign="top"><a href="#Annual-Average-over-Regions">Annual Average over Regions</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-dimensions_002c-growing">dimensions, growing</a>:</td><td> </td><td valign="top"><a href="#Examples-ncap2">Examples ncap2</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-disaggregate">disaggregate</a>:</td><td> </td><td valign="top"><a href="#Group-Path-Editing">Group Path Editing</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-disjoint-files">disjoint files</a>:</td><td> </td><td valign="top"><a href="#Appending-Variables">Appending Variables</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-diskless-files">diskless files</a>:</td><td> </td><td valign="top"><a href="#RAM-disks">RAM disks</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-dismember">dismember</a>:</td><td> </td><td valign="top"><a href="#Group-Path-Editing">Group Path Editing</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-Distributed-Data-Reduction-_0026-Analysis">Distributed Data Reduction & Analysis</a>:</td><td> </td><td valign="top"><a href="#Proposals-for-Institutional-Funding">Proposals for Institutional Funding</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-Distributed-Oceanographic-Data-System">Distributed Oceanographic Data System</a>:</td><td> </td><td valign="top"><a href="#OPeNDAP">OPeNDAP</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-divide"><code>divide</code></a>:</td><td> </td><td valign="top"><a href="#ncbo-netCDF-Binary-Operator">ncbo netCDF Binary Operator</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-dividing-data">dividing data</a>:</td><td> </td><td valign="top"><a href="#ncbo-netCDF-Binary-Operator">ncbo netCDF Binary Operator</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-division">division</a>:</td><td> </td><td valign="top"><a href="#Intrinsic-mathematical-methods">Intrinsic mathematical methods</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-dmn">‘<samp>dmn</samp>’</a>:</td><td> </td><td valign="top"><a href="#Chunking">Chunking</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-documentation">documentation</a>:</td><td> </td><td valign="top"><a href="#Availability">Availability</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-DODS"><acronym>DODS</acronym></a>:</td><td> </td><td valign="top"><a href="#OPeNDAP">OPeNDAP</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-DODS-1"><acronym>DODS</acronym></a>:</td><td> </td><td valign="top"><a href="#Retaining-Retrieved-Files">Retaining Retrieved Files</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-DODS_005fROOT"><code>DODS_ROOT</code></a>:</td><td> </td><td valign="top"><a href="#OPeNDAP">OPeNDAP</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-dot-product">dot product</a>:</td><td> </td><td valign="top"><a href="#Normalization-and-Integration">Normalization and Integration</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-dot-product-1">dot product</a>:</td><td> </td><td valign="top"><a href="#Normalization-and-Integration">Normalization and Integration</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-double_0028_0029">double()</a>:</td><td> </td><td valign="top"><a href="#Methods-and-functions">Methods and functions</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-double_002dprecision">double-precision</a>:</td><td> </td><td valign="top"><a href="#Intrinsic-mathematical-methods">Intrinsic mathematical methods</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-dsort"><code>dsort</code></a>:</td><td> </td><td valign="top"><a href="#Sort-methods">Sort methods</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-duration">duration</a>:</td><td> </td><td valign="top"><a href="#Subcycle">Subcycle</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-dynamic-linking">dynamic linking</a>:</td><td> </td><td valign="top"><a href="#Libraries">Libraries</a></td></tr>
<tr><td colspan="4"> <hr></td></tr>
<tr><th><a name="General-Index_cp_letter-E">E</a></th><td></td><td></td></tr>
<tr><td></td><td valign="top"><a href="#index-Ed-Hartnett">Ed Hartnett</a>:</td><td> </td><td valign="top"><a href="#Contributors">Contributors</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-Ed-Hill">Ed Hill</a>:</td><td> </td><td valign="top"><a href="#Contributors">Contributors</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-eddy-covariance">eddy covariance</a>:</td><td> </td><td valign="top"><a href="#Examples-ncap2">Examples ncap2</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-editing-attributes">editing attributes</a>:</td><td> </td><td valign="top"><a href="#ncatted-netCDF-Attribute-Editor">ncatted netCDF Attribute Editor</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-egrep"><code>egrep</code></a>:</td><td> </td><td valign="top"><a href="#Subsetting-Files">Subsetting Files</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-Elliptic-integrals">Elliptic integrals</a>:</td><td> </td><td valign="top"><a href="#GSL-special-functions">GSL special functions</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-ensemble">ensemble</a>:</td><td> </td><td valign="top"><a href="#Concatenation">Concatenation</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-ensemble-1">ensemble</a>:</td><td> </td><td valign="top"><a href="#nces-netCDF-Ensemble-Statistics">nces netCDF Ensemble Statistics</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-ensemble-average">ensemble average</a>:</td><td> </td><td valign="top"><a href="#nces-netCDF-Ensemble-Statistics">nces netCDF Ensemble Statistics</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-ensemble-concatenation">ensemble concatenation</a>:</td><td> </td><td valign="top"><a href="#ncecat-netCDF-Ensemble-Concatenator">ncecat netCDF Ensemble Concatenator</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-erf"><var>erf</var></a>:</td><td> </td><td valign="top"><a href="#Intrinsic-mathematical-methods">Intrinsic mathematical methods</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-erfc"><var>erfc</var></a>:</td><td> </td><td valign="top"><a href="#Intrinsic-mathematical-methods">Intrinsic mathematical methods</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-Eric-Blake">Eric Blake</a>:</td><td> </td><td valign="top"><a href="#Contributors">Contributors</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-error-function">error function</a>:</td><td> </td><td valign="top"><a href="#Intrinsic-mathematical-methods">Intrinsic mathematical methods</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-error-tolerance">error tolerance</a>:</td><td> </td><td valign="top"><a href="#Temporary-Output-Files">Temporary Output Files</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-Etienne-Tourigny">Etienne Tourigny</a>:</td><td> </td><td valign="top"><a href="#Contributors">Contributors</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-exclusion">exclusion</a>:</td><td> </td><td valign="top"><a href="#Subsetting-Files">Subsetting Files</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-exclusion-1">exclusion</a>:</td><td> </td><td valign="top"><a href="#Filters-for-ncks">Filters for <code>ncks</code></a></td></tr>
<tr><td></td><td valign="top"><a href="#index-exclusion-2">exclusion</a>:</td><td> </td><td valign="top"><a href="#Filters-for-ncks">Filters for <code>ncks</code></a></td></tr>
<tr><td></td><td valign="top"><a href="#index-execution-time">execution time</a>:</td><td> </td><td valign="top"><a href="#Libraries">Libraries</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-execution-time-1">execution time</a>:</td><td> </td><td valign="top"><a href="#Temporary-Output-Files">Temporary Output Files</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-execution-time-2">execution time</a>:</td><td> </td><td valign="top"><a href="#Performance">Performance</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-execution-time-3">execution time</a>:</td><td> </td><td valign="top"><a href="#Metadata-Optimization">Metadata Optimization</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-execution-time-4">execution time</a>:</td><td> </td><td valign="top"><a href="#Missing-Values">Missing Values</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-execution-time-5">execution time</a>:</td><td> </td><td valign="top"><a href="#ncrename-netCDF-Renamer">ncrename netCDF Renamer</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-exp"><var>exp</var></a>:</td><td> </td><td valign="top"><a href="#Intrinsic-mathematical-methods">Intrinsic mathematical methods</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-exponent">exponent</a>:</td><td> </td><td valign="top"><a href="#Promoting-Single_002dprecision-to-Double">Promoting Single-precision to Double</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-exponentiation">exponentiation</a>:</td><td> </td><td valign="top"><a href="#Intrinsic-mathematical-methods">Intrinsic mathematical methods</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-exponentiation-function">exponentiation function</a>:</td><td> </td><td valign="top"><a href="#Intrinsic-mathematical-methods">Intrinsic mathematical methods</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-expressions">expressions</a>:</td><td> </td><td valign="top"><a href="#Expressions">Expressions</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-extended-file-format">extended file format</a>:</td><td> </td><td valign="top"><a href="#Determining-File-Format">Determining File Format</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-extended-regular-expressions">extended regular expressions</a>:</td><td> </td><td valign="top"><a href="#Large-Numbers-of-Files">Large Numbers of Files</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-extended-regular-expressions-1">extended regular expressions</a>:</td><td> </td><td valign="top"><a href="#Subsetting-Files">Subsetting Files</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-extended-regular-expressions-2">extended regular expressions</a>:</td><td> </td><td valign="top"><a href="#Examples-ncap2">Examples ncap2</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-extended-regular-expressions-3">extended regular expressions</a>:</td><td> </td><td valign="top"><a href="#ncatted-netCDF-Attribute-Editor">ncatted netCDF Attribute Editor</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-extended-regular-expressions-4">extended regular expressions</a>:</td><td> </td><td valign="top"><a href="#ncatted-netCDF-Attribute-Editor">ncatted netCDF Attribute Editor</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-extraction">extraction</a>:</td><td> </td><td valign="top"><a href="#Subsetting-Files">Subsetting Files</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-extraction-1">extraction</a>:</td><td> </td><td valign="top"><a href="#Filters-for-ncks">Filters for <code>ncks</code></a></td></tr>
<tr><td></td><td valign="top"><a href="#index-extraction-2">extraction</a>:</td><td> </td><td valign="top"><a href="#Filters-for-ncks">Filters for <code>ncks</code></a></td></tr>
<tr><td colspan="4"> <hr></td></tr>
<tr><th><a name="General-Index_cp_letter-F">F</a></th><td></td><td></td></tr>
<tr><td></td><td valign="top"><a href="#index-f90"><code>f90</code></a>:</td><td> </td><td valign="top"><a href="#Windows-Operating-System">Windows Operating System</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-features_002c-requesting">features, requesting</a>:</td><td> </td><td valign="top"><a href="#Help-Requests-and-Bug-Reports">Help Requests and Bug Reports</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-File-buffers">File buffers</a>:</td><td> </td><td valign="top"><a href="#Buffer-sizes">Buffer sizes</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-file-combination">file combination</a>:</td><td> </td><td valign="top"><a href="#Combine-Files">Combine Files</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-file-deletion">file deletion</a>:</td><td> </td><td valign="top"><a href="#Retaining-Retrieved-Files">Retaining Retrieved Files</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-file-multiplication">file multiplication</a>:</td><td> </td><td valign="top"><a href="#ncflint-netCDF-File-Interpolator">ncflint netCDF File Interpolator</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-file-removal">file removal</a>:</td><td> </td><td valign="top"><a href="#Retaining-Retrieved-Files">Retaining Retrieved Files</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-file-retention">file retention</a>:</td><td> </td><td valign="top"><a href="#Retaining-Retrieved-Files">Retaining Retrieved Files</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-files_002c-multiple">files, multiple</a>:</td><td> </td><td valign="top"><a href="#Specifying-Input-Files">Specifying Input Files</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-files_002c-numerous-input">files, numerous input</a>:</td><td> </td><td valign="top"><a href="#Large-Numbers-of-Files">Large Numbers of Files</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-Filipe-Fernandes">Filipe Fernandes</a>:</td><td> </td><td valign="top"><a href="#Contributors">Contributors</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-filters">filters</a>:</td><td> </td><td valign="top"><a href="#Filters-for-ncks">Filters for <code>ncks</code></a></td></tr>
<tr><td></td><td valign="top"><a href="#index-findgen_002dequivalent">findgen-equivalent</a>:</td><td> </td><td valign="top"><a href="#Arrays-and-hyperslabs">Arrays and hyperslabs</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-fix-record-dimension">fix record dimension</a>:</td><td> </td><td valign="top"><a href="#ncecat-netCDF-Ensemble-Concatenator">ncecat netCDF Ensemble Concatenator</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-fix-record-dimension-1">fix record dimension</a>:</td><td> </td><td valign="top"><a href="#ncecat-netCDF-Ensemble-Concatenator">ncecat netCDF Ensemble Concatenator</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-fix-record-dimension-2">fix record dimension</a>:</td><td> </td><td valign="top"><a href="#ncks-netCDF-Kitchen-Sink">ncks netCDF Kitchen Sink</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-fixed-dimension">fixed dimension</a>:</td><td> </td><td valign="top"><a href="#ncecat-netCDF-Ensemble-Concatenator">ncecat netCDF Ensemble Concatenator</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-fixed-dimension-1">fixed dimension</a>:</td><td> </td><td valign="top"><a href="#ncecat-netCDF-Ensemble-Concatenator">ncecat netCDF Ensemble Concatenator</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-fixed-dimension-2">fixed dimension</a>:</td><td> </td><td valign="top"><a href="#ncks-netCDF-Kitchen-Sink">ncks netCDF Kitchen Sink</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-fixed-dimension-3">fixed dimension</a>:</td><td> </td><td valign="top"><a href="#ncks-netCDF-Kitchen-Sink">ncks netCDF Kitchen Sink</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-flags">flags</a>:</td><td> </td><td valign="top"><a href="#Examples-ncap2">Examples ncap2</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-flatten-_0028groups_0029">flatten (groups)</a>:</td><td> </td><td valign="top"><a href="#Group-Path-Editing">Group Path Editing</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-flattening">flattening</a>:</td><td> </td><td valign="top"><a href="#Autoconversion">Autoconversion</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-float"><code>float</code></a>:</td><td> </td><td valign="top"><a href="#Intrinsic-mathematical-methods">Intrinsic mathematical methods</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-float_0028_0029">float()</a>:</td><td> </td><td valign="top"><a href="#Methods-and-functions">Methods and functions</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-floor"><var>floor</var></a>:</td><td> </td><td valign="top"><a href="#Intrinsic-mathematical-methods">Intrinsic mathematical methods</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-floor-function">floor function</a>:</td><td> </td><td valign="top"><a href="#Intrinsic-mathematical-methods">Intrinsic mathematical methods</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-flt_005fbyt">‘<samp>flt_byt</samp>’</a>:</td><td> </td><td valign="top"><a href="#ncpdq-netCDF-Permute-Dimensions-Quickly">ncpdq netCDF Permute Dimensions Quickly</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-flt_005fsht">‘<samp>flt_sht</samp>’</a>:</td><td> </td><td valign="top"><a href="#ncpdq-netCDF-Permute-Dimensions-Quickly">ncpdq netCDF Permute Dimensions Quickly</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-for_0028_0029">for()</a>:</td><td> </td><td valign="top"><a href="#Loops">Loops</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-force-append">force append</a>:</td><td> </td><td valign="top"><a href="#Batch-Mode">Batch Mode</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-force-overwrite">force overwrite</a>:</td><td> </td><td valign="top"><a href="#Batch-Mode">Batch Mode</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-foreword">foreword</a>:</td><td> </td><td valign="top"><a href="#Foreword">Foreword</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-Fortran">Fortran</a>:</td><td> </td><td valign="top"><a href="#Promoting-Single_002dprecision-to-Double">Promoting Single-precision to Double</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-Fortran-1">Fortran</a>:</td><td> </td><td valign="top"><a href="#ncra-netCDF-Record-Averager">ncra netCDF Record Averager</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-Fortran-2">Fortran</a>:</td><td> </td><td valign="top"><a href="#ncrcat-netCDF-Record-Concatenator">ncrcat netCDF Record Concatenator</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-Fortran-index-convention">Fortran index convention</a>:</td><td> </td><td valign="top"><a href="#C-and-Fortran-Index-Conventions">C and Fortran Index Conventions</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-FORTRAN_005fformat"><var>FORTRAN_format</var></a>:</td><td> </td><td valign="top"><a href="#Performance">Performance</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-Francesco-Lovergine">Francesco Lovergine</a>:</td><td> </td><td valign="top"><a href="#Contributors">Contributors</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-ftp"><code>ftp</code></a>:</td><td> </td><td valign="top"><a href="#Windows-Operating-System">Windows Operating System</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-ftp-1"><code>ftp</code></a>:</td><td> </td><td valign="top"><a href="#Remote-storage">Remote storage</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-FTP"><acronym>FTP</acronym></a>:</td><td> </td><td valign="top"><a href="#Retaining-Retrieved-Files">Retaining Retrieved Files</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-funding">funding</a>:</td><td> </td><td valign="top"><a href="#Proposals-for-Institutional-Funding">Proposals for Institutional Funding</a></td></tr>
<tr><td colspan="4"> <hr></td></tr>
<tr><th><a name="General-Index_cp_letter-G">G</a></th><td></td><td></td></tr>
<tr><td></td><td valign="top"><a href="#index-g_002b_002b"><code>g++</code></a>:</td><td> </td><td valign="top"><a href="#Compatability">Compatability</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-g_002b_002b-1"><code>g++</code></a>:</td><td> </td><td valign="top"><a href="#Windows-Operating-System">Windows Operating System</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-g2d">‘<samp>g2d</samp>’</a>:</td><td> </td><td valign="top"><a href="#Chunking">Chunking</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-g3d">‘<samp>g3d</samp>’</a>:</td><td> </td><td valign="top"><a href="#Chunking">Chunking</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-GAG"><acronym>GAG</acronym></a>:</td><td> </td><td valign="top"><a href="#ncecat-netCDF-Ensemble-Concatenator">ncecat netCDF Ensemble Concatenator</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-gamma"><var>gamma</var></a>:</td><td> </td><td valign="top"><a href="#Compatability">Compatability</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-gamma-1"><var>gamma</var></a>:</td><td> </td><td valign="top"><a href="#Intrinsic-mathematical-methods">Intrinsic mathematical methods</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-gamma-function">gamma function</a>:</td><td> </td><td valign="top"><a href="#GSL-special-functions">GSL special functions</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-gamma-function-1">gamma function</a>:</td><td> </td><td valign="top"><a href="#Intrinsic-mathematical-methods">Intrinsic mathematical methods</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-Gary-Strand">Gary Strand</a>:</td><td> </td><td valign="top"><a href="#Contributors">Contributors</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-Gaussian-weights">Gaussian weights</a>:</td><td> </td><td valign="top"><a href="#Normalization-and-Integration">Normalization and Integration</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-Gavin-Burris">Gavin Burris</a>:</td><td> </td><td valign="top"><a href="#Contributors">Contributors</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-Gayathri-Venkitachalam">Gayathri Venkitachalam</a>:</td><td> </td><td valign="top"><a href="#Contributors">Contributors</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-gcc"><code>gcc</code></a>:</td><td> </td><td valign="top"><a href="#Compatability">Compatability</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-gcc-1"><code>gcc</code></a>:</td><td> </td><td valign="top"><a href="#Windows-Operating-System">Windows Operating System</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-GCM"><acronym>GCM</acronym></a>:</td><td> </td><td valign="top"><a href="#Climate-Model-Paradigm">Climate Model Paradigm</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-GCM-1"><acronym>GCM</acronym></a>:</td><td> </td><td valign="top"><a href="#Promoting-Single_002dprecision-to-Double">Promoting Single-precision to Double</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-geographical-weight">geographical weight</a>:</td><td> </td><td valign="top"><a href="#Monthly-Cycle">Monthly Cycle</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-George-Shapavalov">George Shapavalov</a>:</td><td> </td><td valign="top"><a href="#Contributors">Contributors</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-George-Shapovalov">George Shapovalov</a>:</td><td> </td><td valign="top"><a href="#Contributors">Contributors</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-George-White">George White</a>:</td><td> </td><td valign="top"><a href="#Contributors">Contributors</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-gethostname"><code>gethostname</code></a>:</td><td> </td><td valign="top"><a href="#Windows-Operating-System">Windows Operating System</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-getopt"><code>getopt</code></a>:</td><td> </td><td valign="top"><a href="#Command-Line-Options">Command Line Options</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-getopt_002eh"><samp>getopt.h</samp></a>:</td><td> </td><td valign="top"><a href="#Command-Line-Options">Command Line Options</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-getopt_005flong"><code>getopt_long</code></a>:</td><td> </td><td valign="top"><a href="#Command-Line-Options">Command Line Options</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-getuid"><code>getuid</code></a>:</td><td> </td><td valign="top"><a href="#Windows-Operating-System">Windows Operating System</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-get_005fmiss_0028_0029"><code>get_miss()</code></a>:</td><td> </td><td valign="top"><a href="#Missing-values-ncap2">Missing values ncap2</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-Glenn-Davis">Glenn Davis</a>:</td><td> </td><td valign="top"><a href="#Contributors">Contributors</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-global-attribute"><code>global</code> attribute</a>:</td><td> </td><td valign="top"><a href="#ncatted-netCDF-Attribute-Editor">ncatted netCDF Attribute Editor</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-global-attribute-1"><code>global</code> attribute</a>:</td><td> </td><td valign="top"><a href="#ncrename-netCDF-Renamer">ncrename netCDF Renamer</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-global-attributes">global attributes</a>:</td><td> </td><td valign="top"><a href="#Large-Numbers-of-Files">Large Numbers of Files</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-global-attributes-1">global attributes</a>:</td><td> </td><td valign="top"><a href="#History-Attribute">History Attribute</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-global-attributes-2">global attributes</a>:</td><td> </td><td valign="top"><a href="#File-List-Attributes">File List Attributes</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-global-attributes-3">global attributes</a>:</td><td> </td><td valign="top"><a href="#ARM-Conventions">ARM Conventions</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-global-attributes-4">global attributes</a>:</td><td> </td><td valign="top"><a href="#ncatted-netCDF-Attribute-Editor">ncatted netCDF Attribute Editor</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-global-attributes-5">global attributes</a>:</td><td> </td><td valign="top"><a href="#ncatted-netCDF-Attribute-Editor">ncatted netCDF Attribute Editor</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-global-attributes-6">global attributes</a>:</td><td> </td><td valign="top"><a href="#ncks-netCDF-Kitchen-Sink">ncks netCDF Kitchen Sink</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-global-attributes-7">global attributes</a>:</td><td> </td><td valign="top"><a href="#ncks-netCDF-Kitchen-Sink">ncks netCDF Kitchen Sink</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-global-attributes-8">global attributes</a>:</td><td> </td><td valign="top"><a href="#Filters-for-ncks">Filters for <code>ncks</code></a></td></tr>
<tr><td></td><td valign="top"><a href="#index-global-attributes-9">global attributes</a>:</td><td> </td><td valign="top"><a href="#ncrename-netCDF-Renamer">ncrename netCDF Renamer</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-global-attributes-10">global attributes</a>:</td><td> </td><td valign="top"><a href="#ncrename-netCDF-Renamer">ncrename netCDF Renamer</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-globbing">globbing</a>:</td><td> </td><td valign="top"><a href="#Large-Numbers-of-Files">Large Numbers of Files</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-globbing-1">globbing</a>:</td><td> </td><td valign="top"><a href="#Specifying-Input-Files">Specifying Input Files</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-globbing-2">globbing</a>:</td><td> </td><td valign="top"><a href="#Subsetting-Files">Subsetting Files</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-globbing-3">globbing</a>:</td><td> </td><td valign="top"><a href="#Examples-ncap2">Examples ncap2</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-globbing-4">globbing</a>:</td><td> </td><td valign="top"><a href="#ncbo-netCDF-Binary-Operator">ncbo netCDF Binary Operator</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-globbing-5">globbing</a>:</td><td> </td><td valign="top"><a href="#ncra-netCDF-Record-Averager">ncra netCDF Record Averager</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-globbing-6">globbing</a>:</td><td> </td><td valign="top"><a href="#ncrcat-netCDF-Record-Concatenator">ncrcat netCDF Record Concatenator</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-GNU"><acronym>GNU</acronym></a>:</td><td> </td><td valign="top"><a href="#Command-Line-Options">Command Line Options</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-GNU-1"><acronym>GNU</acronym></a>:</td><td> </td><td valign="top"><a href="#Subsetting-Files">Subsetting Files</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-gnu_002dwin32"><code>gnu-win32</code></a>:</td><td> </td><td valign="top"><a href="#Windows-Operating-System">Windows Operating System</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-GNU_002fLinux"><acronym>GNU</acronym>/Linux</a>:</td><td> </td><td valign="top"><a href="#Large-Datasets">Large Datasets</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-GNUmakefile"><samp>GNUmakefile</samp></a>:</td><td> </td><td valign="top"><a href="#Windows-Operating-System">Windows Operating System</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-God">God</a>:</td><td> </td><td valign="top"><a href="#UDUnits-Support">UDUnits Support</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-grep-_002dE"><code>grep -E</code></a>:</td><td> </td><td valign="top"><a href="#Subsetting-Files">Subsetting Files</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-group-aggregation">group aggregation</a>:</td><td> </td><td valign="top"><a href="#ncecat-netCDF-Ensemble-Concatenator">ncecat netCDF Ensemble Concatenator</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-group-aggregation-1">group aggregation</a>:</td><td> </td><td valign="top"><a href="#Combine-Files">Combine Files</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-group-names">group names</a>:</td><td> </td><td valign="top"><a href="#ncrename-netCDF-Renamer">ncrename netCDF Renamer</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-group-path">group path</a>:</td><td> </td><td valign="top"><a href="#Group-Path-Editing">Group Path Editing</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-group_002c-aggregation">group, aggregation</a>:</td><td> </td><td valign="top"><a href="#Annual-Average-over-Regions">Annual Average over Regions</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-group_002c-anomaly">group, anomaly</a>:</td><td> </td><td valign="top"><a href="#Annual-Average-over-Regions">Annual Average over Regions</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-group_002c-dimension-permutation">group, dimension permutation</a>:</td><td> </td><td valign="top"><a href="#Annual-Average-over-Regions">Annual Average over Regions</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-group_002c-spatial-averaging">group, spatial averaging</a>:</td><td> </td><td valign="top"><a href="#Annual-Average-over-Regions">Annual Average over Regions</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-group_002c-standard-deviation">group, standard deviation</a>:</td><td> </td><td valign="top"><a href="#Annual-Average-over-Regions">Annual Average over Regions</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-group_002c-temporal-averaging">group, temporal averaging</a>:</td><td> </td><td valign="top"><a href="#Annual-Average-over-Regions">Annual Average over Regions</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-groups">groups</a>:</td><td> </td><td valign="top"><a href="#netCDF2_002f3_002f4-and-HDF4_002f5-Support">netCDF2/3/4 and HDF4/5 Support</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-groups-1">groups</a>:</td><td> </td><td valign="top"><a href="#ncatted-netCDF-Attribute-Editor">ncatted netCDF Attribute Editor</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-groups_002c-averaging">groups, averaging</a>:</td><td> </td><td valign="top"><a href="#Global-Distribution-of-Long_002dterm-Average">Global Distribution of Long-term Average</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-groups_002c-creating">groups, creating</a>:</td><td> </td><td valign="top"><a href="#Combine-Files">Combine Files</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-groups_002c-moving">groups, moving</a>:</td><td> </td><td valign="top"><a href="#Group-Path-Editing">Group Path Editing</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-groups_002c-renaming">groups, renaming</a>:</td><td> </td><td valign="top"><a href="#Group-Path-Editing">Group Path Editing</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-growing-dimensions">growing dimensions</a>:</td><td> </td><td valign="top"><a href="#Examples-ncap2">Examples ncap2</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-GSL"><acronym>GSL</acronym></a>:</td><td> </td><td valign="top"><a href="#Compatability">Compatability</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-GSL-1"><acronym>GSL</acronym></a>:</td><td> </td><td valign="top"><a href="#GSL-special-functions">GSL special functions</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-GSL-2"><acronym>GSL</acronym></a>:</td><td> </td><td valign="top"><a href="#GSL-interpolation">GSL interpolation</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-gsl_005fsf_005fbessel_005fJn"><var>gsl_sf_bessel_Jn</var></a>:</td><td> </td><td valign="top"><a href="#GSL-special-functions">GSL special functions</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-gsl_005fsf_005fgamma"><var>gsl_sf_gamma</var></a>:</td><td> </td><td valign="top"><a href="#GSL-special-functions">GSL special functions</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-gsl_005fsf_005flegendre_005fPl"><code>gsl_sf_legendre_Pl</code></a>:</td><td> </td><td valign="top"><a href="#GSL-special-functions">GSL special functions</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-gw"><code>gw</code></a>:</td><td> </td><td valign="top"><a href="#CF-Conventions">CF Conventions</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-gw-1"><code>gw</code></a>:</td><td> </td><td valign="top"><a href="#Normalization-and-Integration">Normalization and Integration</a></td></tr>
<tr><td colspan="4"> <hr></td></tr>
<tr><th><a name="General-Index_cp_letter-H">H</a></th><td></td><td></td></tr>
<tr><td></td><td valign="top"><a href="#index-Harry-Mangalam">Harry Mangalam</a>:</td><td> </td><td valign="top"><a href="#Contributors">Contributors</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-hash">hash</a>:</td><td> </td><td valign="top"><a href="#MD5-digests">MD5 digests</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-HDF"><acronym>HDF</acronym></a>:</td><td> </td><td valign="top"><a href="#netCDF2_002f3_002f4-and-HDF4_002f5-Support">netCDF2/3/4 and HDF4/5 Support</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-HDF-1"><acronym>HDF</acronym></a>:</td><td> </td><td valign="top"><a href="#File-Formats-and-Conversion">File Formats and Conversion</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-HDF-2"><acronym>HDF</acronym></a>:</td><td> </td><td valign="top"><a href="#ncks-netCDF-Kitchen-Sink">ncks netCDF Kitchen Sink</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-HDF-3"><acronym>HDF</acronym></a>:</td><td> </td><td valign="top"><a href="#Proposals-for-Institutional-Funding">Proposals for Institutional Funding</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-HDF-unpacking"><acronym>HDF</acronym> unpacking</a>:</td><td> </td><td valign="top"><a href="#Packed-data">Packed data</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-HDF4"><acronym>HDF4</acronym></a>:</td><td> </td><td valign="top"><a href="#netCDF2_002f3_002f4-and-HDF4_002f5-Support">netCDF2/3/4 and HDF4/5 Support</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-HDF4-1"><acronym>HDF4</acronym></a>:</td><td> </td><td valign="top"><a href="#ncks-netCDF-Kitchen-Sink">ncks netCDF Kitchen Sink</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-HDF5"><acronym>HDF5</acronym></a>:</td><td> </td><td valign="top"><a href="#netCDF2_002f3_002f4-and-HDF4_002f5-Support">netCDF2/3/4 and HDF4/5 Support</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-HDF5-1"><acronym>HDF5</acronym></a>:</td><td> </td><td valign="top"><a href="#netCDF2_002f3_002f4-and-HDF4_002f5-Support">netCDF2/3/4 and HDF4/5 Support</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-hdp"><code>hdp</code></a>:</td><td> </td><td valign="top"><a href="#ncks-netCDF-Kitchen-Sink">ncks netCDF Kitchen Sink</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-help">help</a>:</td><td> </td><td valign="top"><a href="#Help-Requests-and-Bug-Reports">Help Requests and Bug Reports</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-Henry-Butowsky">Henry Butowsky</a>:</td><td> </td><td valign="top"><a href="#Contributors">Contributors</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-hgh_005fbyt">‘<samp>hgh_byt</samp>’</a>:</td><td> </td><td valign="top"><a href="#ncpdq-netCDF-Permute-Dimensions-Quickly">ncpdq netCDF Permute Dimensions Quickly</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-hgh_005fsht">‘<samp>hgh_sht</samp>’</a>:</td><td> </td><td valign="top"><a href="#ncpdq-netCDF-Permute-Dimensions-Quickly">ncpdq netCDF Permute Dimensions Quickly</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-hidden-attributes">hidden attributes</a>:</td><td> </td><td valign="top"><a href="#ncks-netCDF-Kitchen-Sink">ncks netCDF Kitchen Sink</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-Hierarchical-Data-Format">Hierarchical Data Format</a>:</td><td> </td><td valign="top"><a href="#netCDF2_002f3_002f4-and-HDF4_002f5-Support">netCDF2/3/4 and HDF4/5 Support</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-history"><code>history</code></a>:</td><td> </td><td valign="top"><a href="#Large-Numbers-of-Files">Large Numbers of Files</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-history-1"><code>history</code></a>:</td><td> </td><td valign="top"><a href="#Remote-storage">Remote storage</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-history-2"><code>history</code></a>:</td><td> </td><td valign="top"><a href="#History-Attribute">History Attribute</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-history-3"><code>history</code></a>:</td><td> </td><td valign="top"><a href="#ARM-Conventions">ARM Conventions</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-history-4"><code>history</code></a>:</td><td> </td><td valign="top"><a href="#ncatted-netCDF-Attribute-Editor">ncatted netCDF Attribute Editor</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-history-5"><code>history</code></a>:</td><td> </td><td valign="top"><a href="#Filters-for-ncks">Filters for <code>ncks</code></a></td></tr>
<tr><td></td><td valign="top"><a href="#index-hncgen"><code>hncgen</code></a>:</td><td> </td><td valign="top"><a href="#ncks-netCDF-Kitchen-Sink">ncks netCDF Kitchen Sink</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-HP"><acronym>HP</acronym></a>:</td><td> </td><td valign="top"><a href="#Compatability">Compatability</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-HPSS"><acronym>HPSS</acronym></a>:</td><td> </td><td valign="top"><a href="#Remote-storage">Remote storage</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-hsi"><code>hsi</code></a>:</td><td> </td><td valign="top"><a href="#Remote-storage">Remote storage</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-HTML"><acronym>HTML</acronym></a>:</td><td> </td><td valign="top"><a href="#Availability">Availability</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-HTTP-protocol"><acronym>HTTP</acronym> protocol</a>:</td><td> </td><td valign="top"><a href="#OPeNDAP">OPeNDAP</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-hyai"><code>hyai</code></a>:</td><td> </td><td valign="top"><a href="#CF-Conventions">CF Conventions</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-hyam"><code>hyam</code></a>:</td><td> </td><td valign="top"><a href="#CF-Conventions">CF Conventions</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-hybi"><code>hybi</code></a>:</td><td> </td><td valign="top"><a href="#CF-Conventions">CF Conventions</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-hybm"><code>hybm</code></a>:</td><td> </td><td valign="top"><a href="#CF-Conventions">CF Conventions</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-hybrid-coordinate-system">hybrid coordinate system</a>:</td><td> </td><td valign="top"><a href="#Left-hand-casting">Left hand casting</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-hyperbolic-arccosine-function">hyperbolic arccosine function</a>:</td><td> </td><td valign="top"><a href="#Intrinsic-mathematical-methods">Intrinsic mathematical methods</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-hyperbolic-arcsine-function">hyperbolic arcsine function</a>:</td><td> </td><td valign="top"><a href="#Intrinsic-mathematical-methods">Intrinsic mathematical methods</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-hyperbolic-arctangent-function">hyperbolic arctangent function</a>:</td><td> </td><td valign="top"><a href="#Intrinsic-mathematical-methods">Intrinsic mathematical methods</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-hyperbolic-cosine-function">hyperbolic cosine function</a>:</td><td> </td><td valign="top"><a href="#Intrinsic-mathematical-methods">Intrinsic mathematical methods</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-hyperbolic-sine-function">hyperbolic sine function</a>:</td><td> </td><td valign="top"><a href="#Intrinsic-mathematical-methods">Intrinsic mathematical methods</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-hyperbolic-tangent">hyperbolic tangent</a>:</td><td> </td><td valign="top"><a href="#Intrinsic-mathematical-methods">Intrinsic mathematical methods</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-hyperslab">hyperslab</a>:</td><td> </td><td valign="top"><a href="#Hyperslabs">Hyperslabs</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-hyperslab-1">hyperslab</a>:</td><td> </td><td valign="top"><a href="#Chunking">Chunking</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-hyperslab-2">hyperslab</a>:</td><td> </td><td valign="top"><a href="#nces-netCDF-Ensemble-Statistics">nces netCDF Ensemble Statistics</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-hyperslab-3">hyperslab</a>:</td><td> </td><td valign="top"><a href="#ncecat-netCDF-Ensemble-Concatenator">ncecat netCDF Ensemble Concatenator</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-hyperslab-4">hyperslab</a>:</td><td> </td><td valign="top"><a href="#ncra-netCDF-Record-Averager">ncra netCDF Record Averager</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-hyperslab-5">hyperslab</a>:</td><td> </td><td valign="top"><a href="#ncrcat-netCDF-Record-Concatenator">ncrcat netCDF Record Concatenator</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-hyperslab-6">hyperslab</a>:</td><td> </td><td valign="top"><a href="#ncwa-netCDF-Weighted-Averager">ncwa netCDF Weighted Averager</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-hyperslabs">hyperslabs</a>:</td><td> </td><td valign="top"><a href="#Arrays-and-hyperslabs">Arrays and hyperslabs</a></td></tr>
<tr><td colspan="4"> <hr></td></tr>
<tr><th><a name="General-Index_cp_letter-I">I</a></th><td></td><td></td></tr>
<tr><td></td><td valign="top"><a href="#index-I_002fO">I/O</a>:</td><td> </td><td valign="top"><a href="#OPeNDAP">OPeNDAP</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-I_002fO-1">I/O</a>:</td><td> </td><td valign="top"><a href="#C-and-Fortran-Index-Conventions">C and Fortran Index Conventions</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-I_002fO-2">I/O</a>:</td><td> </td><td valign="top"><a href="#Multislabs">Multislabs</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-I_002fO-block-size">I/O block size</a>:</td><td> </td><td valign="top"><a href="#Buffer-sizes">Buffer sizes</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-I18N">I18N</a>:</td><td> </td><td valign="top"><a href="#Internationalization">Internationalization</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-IBM"><acronym>IBM</acronym></a>:</td><td> </td><td valign="top"><a href="#Compatability">Compatability</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-icc"><code>icc</code></a>:</td><td> </td><td valign="top"><a href="#Compatability">Compatability</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-ID-Quoting">ID Quoting</a>:</td><td> </td><td valign="top"><a href="#ID-Quoting">ID Quoting</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-IDL"><acronym>IDL</acronym></a>:</td><td> </td><td valign="top"><a href="#Philosophy">Philosophy</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-IEEE"><acronym>IEEE</acronym></a>:</td><td> </td><td valign="top"><a href="#Automatic-type-conversion">Automatic type conversion</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-IEEE-NaN">IEEE NaN</a>:</td><td> </td><td valign="top"><a href="#ncatted-netCDF-Attribute-Editor">ncatted netCDF Attribute Editor</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-if_0028_0029">if()</a>:</td><td> </td><td valign="top"><a href="#if-statement">if statement</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-ilimit"><code>ilimit</code></a>:</td><td> </td><td valign="top"><a href="#Large-Datasets">Large Datasets</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-implicit-conversion">implicit conversion</a>:</td><td> </td><td valign="top"><a href="#Promoting-Single_002dprecision-to-Double">Promoting Single-precision to Double</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-include"><code>include</code></a>:</td><td> </td><td valign="top"><a href="#Include-files">Include files</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-including-files">including files</a>:</td><td> </td><td valign="top"><a href="#Syntax-of-ncap2-statements">Syntax of ncap2 statements</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-index-convention">index convention</a>:</td><td> </td><td valign="top"><a href="#C-and-Fortran-Index-Conventions">C and Fortran Index Conventions</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-indgen_002dequivalent">indgen-equivalent</a>:</td><td> </td><td valign="top"><a href="#Arrays-and-hyperslabs">Arrays and hyperslabs</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-inexact-conversion">inexact conversion</a>:</td><td> </td><td valign="top"><a href="#Intrinsic-mathematical-methods">Intrinsic mathematical methods</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-Info">Info</a>:</td><td> </td><td valign="top"><a href="#Availability">Availability</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-input-files">input files</a>:</td><td> </td><td valign="top"><a href="#Large-Numbers-of-Files">Large Numbers of Files</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-input-files-1">input files</a>:</td><td> </td><td valign="top"><a href="#Specifying-Input-Files">Specifying Input Files</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-input-files-2">input files</a>:</td><td> </td><td valign="top"><a href="#Specifying-Output-Files">Specifying Output Files</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-input-files-3">input files</a>:</td><td> </td><td valign="top"><a href="#Specifying-Output-Files">Specifying Output Files</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-input_002dpath"><var>input-path</var></a>:</td><td> </td><td valign="top"><a href="#Specifying-Input-Files">Specifying Input Files</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-input_002dpath-1"><var>input-path</var></a>:</td><td> </td><td valign="top"><a href="#Remote-storage">Remote storage</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-installation">installation</a>:</td><td> </td><td valign="top"><a href="#Compatability">Compatability</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-installation-1">installation</a>:</td><td> </td><td valign="top"><a href="#Help-Requests-and-Bug-Reports">Help Requests and Bug Reports</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-int_0028_0029">int()</a>:</td><td> </td><td valign="top"><a href="#Methods-and-functions">Methods and functions</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-int64_0028_0029">int64()</a>:</td><td> </td><td valign="top"><a href="#Methods-and-functions">Methods and functions</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-integration">integration</a>:</td><td> </td><td valign="top"><a href="#Normalization-and-Integration">Normalization and Integration</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-integrity">integrity</a>:</td><td> </td><td valign="top"><a href="#MD5-digests">MD5 digests</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-Intel">Intel</a>:</td><td> </td><td valign="top"><a href="#Compatability">Compatability</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-Internationalization">Internationalization</a>:</td><td> </td><td valign="top"><a href="#Internationalization">Internationalization</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-interoperability">interoperability</a>:</td><td> </td><td valign="top"><a href="#Packed-data">Packed data</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-interpolation">interpolation</a>:</td><td> </td><td valign="top"><a href="#ncflint-netCDF-File-Interpolator">ncflint netCDF File Interpolator</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-interpolation-1">interpolation</a>:</td><td> </td><td valign="top"><a href="#Regrid-MODIS-Data">Regrid MODIS Data</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-intersection">intersection</a>:</td><td> </td><td valign="top"><a href="#Subsetting-Files">Subsetting Files</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-intersection-1">intersection</a>:</td><td> </td><td valign="top"><a href="#Subsetting-Files">Subsetting Files</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-introduction">introduction</a>:</td><td> </td><td valign="top"><a href="#Introduction">Introduction</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-introduction-1">introduction</a>:</td><td> </td><td valign="top"><a href="#How-to-Use-This-guide">How to Use This guide</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-invert_005fmap"><code>invert_map</code></a>:</td><td> </td><td valign="top"><a href="#Sort-methods">Sort methods</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-IPCC"><acronym>IPCC</acronym></a>:</td><td> </td><td valign="top"><a href="#nces-netCDF-Ensemble-Statistics">nces netCDF Ensemble Statistics</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-IPCC-1"><acronym>IPCC</acronym></a>:</td><td> </td><td valign="top"><a href="#Proposals-for-Institutional-Funding">Proposals for Institutional Funding</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-irregular-grids">irregular grids</a>:</td><td> </td><td valign="top"><a href="#Irregular-grids">Irregular grids</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-ISO"><acronym>ISO</acronym></a>:</td><td> </td><td valign="top"><a href="#Compatability">Compatability</a></td></tr>
<tr><td colspan="4"> <hr></td></tr>
<tr><th><a name="General-Index_cp_letter-J">J</a></th><td></td><td></td></tr>
<tr><td></td><td valign="top"><a href="#index-James-Gallagher">James Gallagher</a>:</td><td> </td><td valign="top"><a href="#Contributors">Contributors</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-Jim-Edwards">Jim Edwards</a>:</td><td> </td><td valign="top"><a href="#Contributors">Contributors</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-John-Caron">John Caron</a>:</td><td> </td><td valign="top"><a href="#Contributors">Contributors</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-Juliana-Rew">Juliana Rew</a>:</td><td> </td><td valign="top"><a href="#Contributors">Contributors</a></td></tr>
<tr><td colspan="4"> <hr></td></tr>
<tr><th><a name="General-Index_cp_letter-K">K</a></th><td></td><td></td></tr>
<tr><td></td><td valign="top"><a href="#index-Karen-Schuchardt">Karen Schuchardt</a>:</td><td> </td><td valign="top"><a href="#Contributors">Contributors</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-Keith-Lindsay">Keith Lindsay</a>:</td><td> </td><td valign="top"><a href="#Contributors">Contributors</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-kitchen-sink">kitchen sink</a>:</td><td> </td><td valign="top"><a href="#ncks-netCDF-Kitchen-Sink">ncks netCDF Kitchen Sink</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-Kyle-Wilcox">Kyle Wilcox</a>:</td><td> </td><td valign="top"><a href="#Contributors">Contributors</a></td></tr>
<tr><td colspan="4"> <hr></td></tr>
<tr><th><a name="General-Index_cp_letter-L">L</a></th><td></td><td></td></tr>
<tr><td></td><td valign="top"><a href="#index-L10N">L10N</a>:</td><td> </td><td valign="top"><a href="#Internationalization">Internationalization</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-large-datasets">large datasets</a>:</td><td> </td><td valign="top"><a href="#Large-Datasets">Large Datasets</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-large-datasets-1">large datasets</a>:</td><td> </td><td valign="top"><a href="#OpenMP-Threading">OpenMP Threading</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-Large-File-Support">Large File Support</a>:</td><td> </td><td valign="top"><a href="#Large-Datasets">Large Datasets</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-Large-File-Support-1">Large File Support</a>:</td><td> </td><td valign="top"><a href="#Large-File-Support">Large File Support</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-lat_005fbnds"><code>lat_bnds</code></a>:</td><td> </td><td valign="top"><a href="#CF-Conventions">CF Conventions</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-LD_005fLIBRARY_005fPATH"><code>LD_LIBRARY_PATH</code></a>:</td><td> </td><td valign="top"><a href="#Libraries">Libraries</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-left-hand-casting">left hand casting</a>:</td><td> </td><td valign="top"><a href="#Memory-for-ncap2">Memory for ncap2</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-left-hand-casting-1">left hand casting</a>:</td><td> </td><td valign="top"><a href="#Left-hand-casting">Left hand casting</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-Legendre-polynomial">Legendre polynomial</a>:</td><td> </td><td valign="top"><a href="#GSL-special-functions">GSL special functions</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-Lempel_002dZiv-deflation">Lempel-Ziv deflation</a>:</td><td> </td><td valign="top"><a href="#Deflation">Deflation</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-Len-Makin">Len Makin</a>:</td><td> </td><td valign="top"><a href="#Contributors">Contributors</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-lexer">lexer</a>:</td><td> </td><td valign="top"><a href="#ncap2-netCDF-Arithmetic-Processor">ncap2 netCDF Arithmetic Processor</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-lfp">‘<samp>lfp</samp>’</a>:</td><td> </td><td valign="top"><a href="#Chunking">Chunking</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-LFS">LFS</a>:</td><td> </td><td valign="top"><a href="#Large-Datasets">Large Datasets</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-LFS-1">LFS</a>:</td><td> </td><td valign="top"><a href="#Large-File-Support">Large File Support</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-LHS"><acronym>LHS</acronym></a>:</td><td> </td><td valign="top"><a href="#Left-hand-casting">Left hand casting</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-libnco"><code>libnco</code></a>:</td><td> </td><td valign="top"><a href="#Compatability">Compatability</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-libraries">libraries</a>:</td><td> </td><td valign="top"><a href="#Libraries">Libraries</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-linkers">linkers</a>:</td><td> </td><td valign="top"><a href="#Specifying-Output-Files">Specifying Output Files</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-Linux">Linux</a>:</td><td> </td><td valign="top"><a href="#Intrinsic-mathematical-methods">Intrinsic mathematical methods</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-LLVM"><acronym>LLVM</acronym></a>:</td><td> </td><td valign="top"><a href="#Compatability">Compatability</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-ln"><var>ln</var></a>:</td><td> </td><td valign="top"><a href="#Intrinsic-mathematical-methods">Intrinsic mathematical methods</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-ln-_002ds"><code>ln -s</code></a>:</td><td> </td><td valign="top"><a href="#ncbo-netCDF-Binary-Operator">ncbo netCDF Binary Operator</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-ln-_002ds-1"><code>ln -s</code></a>:</td><td> </td><td valign="top"><a href="#ncpdq-netCDF-Permute-Dimensions-Quickly">ncpdq netCDF Permute Dimensions Quickly</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-log"><var>log</var></a>:</td><td> </td><td valign="top"><a href="#Intrinsic-mathematical-methods">Intrinsic mathematical methods</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-log10"><var>log10</var></a>:</td><td> </td><td valign="top"><a href="#Intrinsic-mathematical-methods">Intrinsic mathematical methods</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-logarithm_002c-base-10">logarithm, base 10</a>:</td><td> </td><td valign="top"><a href="#Intrinsic-mathematical-methods">Intrinsic mathematical methods</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-logarithm_002c-natural">logarithm, natural</a>:</td><td> </td><td valign="top"><a href="#Intrinsic-mathematical-methods">Intrinsic mathematical methods</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-long-double"><code>long double</code></a>:</td><td> </td><td valign="top"><a href="#Intrinsic-mathematical-methods">Intrinsic mathematical methods</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-long-options">long options</a>:</td><td> </td><td valign="top"><a href="#Command-Line-Options">Command Line Options</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-long-options-1">long options</a>:</td><td> </td><td valign="top"><a href="#ncpdq-netCDF-Permute-Dimensions-Quickly">ncpdq netCDF Permute Dimensions Quickly</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-long_002dterm-average">long-term average</a>:</td><td> </td><td valign="top"><a href="#Global-Distribution-of-Long_002dterm-Average">Global Distribution of Long-term Average</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-longitude">longitude</a>:</td><td> </td><td valign="top"><a href="#Wrapped-Coordinates">Wrapped Coordinates</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-lon_005fbnds"><code>lon_bnds</code></a>:</td><td> </td><td valign="top"><a href="#CF-Conventions">CF Conventions</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-Lori-Sentman">Lori Sentman</a>:</td><td> </td><td valign="top"><a href="#Contributors">Contributors</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-lrint_0028_0029_002e"><code><code>lrint()</code>.</code></a>:</td><td> </td><td valign="top"><a href="#Automatic-type-conversion">Automatic type conversion</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-lround_0028_0029_002e"><code><code>lround()</code>.</code></a>:</td><td> </td><td valign="top"><a href="#Automatic-type-conversion">Automatic type conversion</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-Luk-Claes">Luk Claes</a>:</td><td> </td><td valign="top"><a href="#Contributors">Contributors</a></td></tr>
<tr><td colspan="4"> <hr></td></tr>
<tr><th><a name="General-Index_cp_letter-M">M</a></th><td></td><td></td></tr>
<tr><td></td><td valign="top"><a href="#index-Macintosh">Macintosh</a>:</td><td> </td><td valign="top"><a href="#Compatability">Compatability</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-Makefile"><samp>Makefile</samp></a>:</td><td> </td><td valign="top"><a href="#Compatability">Compatability</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-Makefile-1"><samp>Makefile</samp></a>:</td><td> </td><td valign="top"><a href="#Windows-Operating-System">Windows Operating System</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-Makefile-2"><samp>Makefile</samp></a>:</td><td> </td><td valign="top"><a href="#OPeNDAP">OPeNDAP</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-malloc_0028_0029"><code>malloc()</code></a>:</td><td> </td><td valign="top"><a href="#Memory-for-ncap2">Memory for ncap2</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-mantissa">mantissa</a>:</td><td> </td><td valign="top"><a href="#Promoting-Single_002dprecision-to-Double">Promoting Single-precision to Double</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-manual-type-conversion">manual type conversion</a>:</td><td> </td><td valign="top"><a href="#Type-Conversion">Type Conversion</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-map_005fdmn">‘<samp>map_dmn</samp>’</a>:</td><td> </td><td valign="top"><a href="#Chunking">Chunking</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-map_005flfp">‘<samp>map_lfp</samp>’</a>:</td><td> </td><td valign="top"><a href="#Chunking">Chunking</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-map_005fprd">‘<samp>map_prd</samp>’</a>:</td><td> </td><td valign="top"><a href="#Chunking">Chunking</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-map_005frd1">‘<samp>map_rd1</samp>’</a>:</td><td> </td><td valign="top"><a href="#Chunking">Chunking</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-map_005fscl">‘<samp>map_scl</samp>’</a>:</td><td> </td><td valign="top"><a href="#Chunking">Chunking</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-map_005fxst">‘<samp>map_xst</samp>’</a>:</td><td> </td><td valign="top"><a href="#Chunking">Chunking</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-Mark-Flanner">Mark Flanner</a>:</td><td> </td><td valign="top"><a href="#Contributors">Contributors</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-Markus-Liebig">Markus Liebig</a>:</td><td> </td><td valign="top"><a href="#Contributors">Contributors</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-Martin-Dix">Martin Dix</a>:</td><td> </td><td valign="top"><a href="#Contributors">Contributors</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-Martin-Otte">Martin Otte</a>:</td><td> </td><td valign="top"><a href="#Contributors">Contributors</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-Martin-Schmidt">Martin Schmidt</a>:</td><td> </td><td valign="top"><a href="#Contributors">Contributors</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-Martin-Schultz">Martin Schultz</a>:</td><td> </td><td valign="top"><a href="#Group-Path-Editing">Group Path Editing</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-mask">mask</a>:</td><td> </td><td valign="top"><a href="#Irregular-grids">Irregular grids</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-mask-1">mask</a>:</td><td> </td><td valign="top"><a href="#Examples-ncap2">Examples ncap2</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-mask-condition">mask condition</a>:</td><td> </td><td valign="top"><a href="#Mask-condition">Mask condition</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-mask-condition-1">mask condition</a>:</td><td> </td><td valign="top"><a href="#Normalization-and-Integration">Normalization and Integration</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-masked-average">masked average</a>:</td><td> </td><td valign="top"><a href="#ncwa-netCDF-Weighted-Averager">ncwa netCDF Weighted Averager</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-Mass-Store-System">Mass Store System</a>:</td><td> </td><td valign="top"><a href="#Remote-storage">Remote storage</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-Matej-Vela">Matej Vela</a>:</td><td> </td><td valign="top"><a href="#Contributors">Contributors</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-mathematical-functions">mathematical functions</a>:</td><td> </td><td valign="top"><a href="#Intrinsic-mathematical-methods">Intrinsic mathematical methods</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-Matlab">Matlab</a>:</td><td> </td><td valign="top"><a href="#Philosophy">Philosophy</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-max"><code>max</code></a>:</td><td> </td><td valign="top"><a href="#Operation-Types">Operation Types</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-max_0028_0029">max()</a>:</td><td> </td><td valign="top"><a href="#Methods-and-functions">Methods and functions</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-maximum">maximum</a>:</td><td> </td><td valign="top"><a href="#Operation-Types">Operation Types</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-MD5-digest">MD5 digest</a>:</td><td> </td><td valign="top"><a href="#MD5-digests">MD5 digests</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-mean">mean</a>:</td><td> </td><td valign="top"><a href="#Operation-Types">Operation Types</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-memory-available">memory available</a>:</td><td> </td><td valign="top"><a href="#Memory-Requirements">Memory Requirements</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-memory-available-1">memory available</a>:</td><td> </td><td valign="top"><a href="#RAM-disks">RAM disks</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-memory-leaks">memory leaks</a>:</td><td> </td><td valign="top"><a href="#Memory-for-ncap2">Memory for ncap2</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-memory-requirements">memory requirements</a>:</td><td> </td><td valign="top"><a href="#Memory-Requirements">Memory Requirements</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-memory-requirements-1">memory requirements</a>:</td><td> </td><td valign="top"><a href="#Subsetting-Files">Subsetting Files</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-memory-requirements-2">memory requirements</a>:</td><td> </td><td valign="top"><a href="#RAM-disks">RAM disks</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-merging-files">merging files</a>:</td><td> </td><td valign="top"><a href="#Appending-Variables">Appending Variables</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-merging-files-1">merging files</a>:</td><td> </td><td valign="top"><a href="#ncks-netCDF-Kitchen-Sink">ncks netCDF Kitchen Sink</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-metadata">metadata</a>:</td><td> </td><td valign="top"><a href="#ncks-netCDF-Kitchen-Sink">ncks netCDF Kitchen Sink</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-metadata-optimization">metadata optimization</a>:</td><td> </td><td valign="top"><a href="#Metadata-Optimization">Metadata Optimization</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-metadata_002c-global">metadata, global</a>:</td><td> </td><td valign="top"><a href="#ncecat-netCDF-Ensemble-Concatenator">ncecat netCDF Ensemble Concatenator</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-metadata_002c-global-1">metadata, global</a>:</td><td> </td><td valign="top"><a href="#ncks-netCDF-Kitchen-Sink">ncks netCDF Kitchen Sink</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-Michael-Decker">Michael Decker</a>:</td><td> </td><td valign="top"><a href="#Group-Path-Editing">Group Path Editing</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-Michael-Prather">Michael Prather</a>:</td><td> </td><td valign="top"><a href="#Promoting-Single_002dprecision-to-Double">Promoting Single-precision to Double</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-Michael-Schulz">Michael Schulz</a>:</td><td> </td><td valign="top"><a href="#Contributors">Contributors</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-Microsoft">Microsoft</a>:</td><td> </td><td valign="top"><a href="#Compatability">Compatability</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-Microsoft-1">Microsoft</a>:</td><td> </td><td valign="top"><a href="#Windows-Operating-System">Windows Operating System</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-Microsoft-Visual-Studio">Microsoft Visual Studio</a>:</td><td> </td><td valign="top"><a href="#Windows-Operating-System">Windows Operating System</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-Mike-Folk">Mike Folk</a>:</td><td> </td><td valign="top"><a href="#netCDF2_002f3_002f4-and-HDF4_002f5-Support">netCDF2/3/4 and HDF4/5 Support</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-Mike-Page">Mike Page</a>:</td><td> </td><td valign="top"><a href="#Contributors">Contributors</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-min"><code>min</code></a>:</td><td> </td><td valign="top"><a href="#Operation-Types">Operation Types</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-min_0028_0029">min()</a>:</td><td> </td><td valign="top"><a href="#Methods-and-functions">Methods and functions</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-minimum">minimum</a>:</td><td> </td><td valign="top"><a href="#Operation-Types">Operation Types</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-missing-values">missing values</a>:</td><td> </td><td valign="top"><a href="#Missing-Values">Missing Values</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-missing-values-1">missing values</a>:</td><td> </td><td valign="top"><a href="#ncatted-netCDF-Attribute-Editor">ncatted netCDF Attribute Editor</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-missing-values-2">missing values</a>:</td><td> </td><td valign="top"><a href="#ncflint-netCDF-File-Interpolator">ncflint netCDF File Interpolator</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-missing-values-3">missing values</a>:</td><td> </td><td valign="top"><a href="#ncks-netCDF-Kitchen-Sink">ncks netCDF Kitchen Sink</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-missing-values-ncap2">missing values ncap2</a>:</td><td> </td><td valign="top"><a href="#Missing-values-ncap2">Missing values ncap2</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-missing_005fvalue"><code>missing_value</code></a>:</td><td> </td><td valign="top"><a href="#Missing-Values">Missing Values</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-missing_005fvalue-1"><code>missing_value</code></a>:</td><td> </td><td valign="top"><a href="#Packed-data">Packed data</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-missing_005fvalue-2"><code>missing_value</code></a>:</td><td> </td><td valign="top"><a href="#ncrename-netCDF-Renamer">ncrename netCDF Renamer</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-MKS-units">MKS units</a>:</td><td> </td><td valign="top"><a href="#UDUnits-Support">UDUnits Support</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-MKS-units-1">MKS units</a>:</td><td> </td><td valign="top"><a href="#UDUnits-Support">UDUnits Support</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-MODIS">MODIS</a>:</td><td> </td><td valign="top"><a href="#Regrid-MODIS-Data">Regrid MODIS Data</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-MODIS-1">MODIS</a>:</td><td> </td><td valign="top"><a href="#Add-Coordinates-to-MODIS-Data">Add Coordinates to MODIS Data</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-modulus">modulus</a>:</td><td> </td><td valign="top"><a href="#Intrinsic-mathematical-methods">Intrinsic mathematical methods</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-monotonic-coordinates">monotonic coordinates</a>:</td><td> </td><td valign="top"><a href="#Performance">Performance</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-monthly-average">monthly average</a>:</td><td> </td><td valign="top"><a href="#Daily-data-in-one-file">Daily data in one file</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-monthly-average-1">monthly average</a>:</td><td> </td><td valign="top"><a href="#Monthly-Cycle">Monthly Cycle</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-monthly-data">monthly data</a>:</td><td> </td><td valign="top"><a href="#Monthly-data-in-one-file">Monthly data in one file</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-monthly-data-1">monthly data</a>:</td><td> </td><td valign="top"><a href="#One-time-point-one-file">One time point one file</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-monthly-data-2">monthly data</a>:</td><td> </td><td valign="top"><a href="#Multiple-files-with-multiple-time-points">Multiple files with multiple time points</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-move-groups">move groups</a>:</td><td> </td><td valign="top"><a href="#Group-Path-Editing">Group Path Editing</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-MRO">MRO</a>:</td><td> </td><td valign="top"><a href="#Subcycle">Subcycle</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-MSA"><acronym>MSA</acronym></a>:</td><td> </td><td valign="top"><a href="#Multislabs">Multislabs</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-msk_005f_002a"><code>msk_*</code></a>:</td><td> </td><td valign="top"><a href="#CF-Conventions">CF Conventions</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-msrcp"><code>msrcp</code></a>:</td><td> </td><td valign="top"><a href="#Remote-storage">Remote storage</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-msrcp-1"><acronym>msrcp</acronym></a>:</td><td> </td><td valign="top"><a href="#Retaining-Retrieved-Files">Retaining Retrieved Files</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-msread"><code>msread</code></a>:</td><td> </td><td valign="top"><a href="#Remote-storage">Remote storage</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-MSS"><acronym>MSS</acronym></a>:</td><td> </td><td valign="top"><a href="#Remote-storage">Remote storage</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-multi_002dfile-operators">multi-file operators</a>:</td><td> </td><td valign="top"><a href="#Single-and-Multi_002dfile-Operators">Single and Multi-file Operators</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-multi_002dfile-operators-1">multi-file operators</a>:</td><td> </td><td valign="top"><a href="#Specifying-Input-Files">Specifying Input Files</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-multi_002dfile-operators-2">multi-file operators</a>:</td><td> </td><td valign="top"><a href="#Specifying-Output-Files">Specifying Output Files</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-multi_002dfile-operators-3">multi-file operators</a>:</td><td> </td><td valign="top"><a href="#nces-netCDF-Ensemble-Statistics">nces netCDF Ensemble Statistics</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-multi_002dfile-operators-4">multi-file operators</a>:</td><td> </td><td valign="top"><a href="#ncecat-netCDF-Ensemble-Concatenator">ncecat netCDF Ensemble Concatenator</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-multi_002dfile-operators-5">multi-file operators</a>:</td><td> </td><td valign="top"><a href="#ncra-netCDF-Record-Averager">ncra netCDF Record Averager</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-multi_002dfile-operators-6">multi-file operators</a>:</td><td> </td><td valign="top"><a href="#ncrcat-netCDF-Record-Concatenator">ncrcat netCDF Record Concatenator</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-multi_002dhyperslab">multi-hyperslab</a>:</td><td> </td><td valign="top"><a href="#Multislabs">Multislabs</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-Multi_002dRecord-Operator">Multi-Record Operator</a>:</td><td> </td><td valign="top"><a href="#Subcycle">Subcycle</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-multiplication">multiplication</a>:</td><td> </td><td valign="top"><a href="#Intrinsic-mathematical-methods">Intrinsic mathematical methods</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-multiplication-1">multiplication</a>:</td><td> </td><td valign="top"><a href="#ncbo-netCDF-Binary-Operator">ncbo netCDF Binary Operator</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-multiplication-2">multiplication</a>:</td><td> </td><td valign="top"><a href="#ncflint-netCDF-File-Interpolator">ncflint netCDF File Interpolator</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-multiply"><code>multiply</code></a>:</td><td> </td><td valign="top"><a href="#ncbo-netCDF-Binary-Operator">ncbo netCDF Binary Operator</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-multiplying-data">multiplying data</a>:</td><td> </td><td valign="top"><a href="#ncbo-netCDF-Binary-Operator">ncbo netCDF Binary Operator</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-multiplying-data-1">multiplying data</a>:</td><td> </td><td valign="top"><a href="#ncflint-netCDF-File-Interpolator">ncflint netCDF File Interpolator</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-multislab">multislab</a>:</td><td> </td><td valign="top"><a href="#Multislabs">Multislabs</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-mv"><code>mv</code></a>:</td><td> </td><td valign="top"><a href="#Subsetting-Files">Subsetting Files</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-MVS"><code>MVS</code></a>:</td><td> </td><td valign="top"><a href="#Compatability">Compatability</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-MVS-1"><acronym>MVS</acronym></a>:</td><td> </td><td valign="top"><a href="#Windows-Operating-System">Windows Operating System</a></td></tr>
<tr><td colspan="4"> <hr></td></tr>
<tr><th><a name="General-Index_cp_letter-N">N</a></th><td></td><td></td></tr>
<tr><td></td><td valign="top"><a href="#index-naked-characters">naked characters</a>:</td><td> </td><td valign="top"><a href="#ncbo-netCDF-Binary-Operator">ncbo netCDF Binary Operator</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-NaN">NaN</a>:</td><td> </td><td valign="top"><a href="#ncatted-netCDF-Attribute-Editor">ncatted netCDF Attribute Editor</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-NASA"><acronym>NASA</acronym></a>:</td><td> </td><td valign="top"><a href="#Proposals-for-Institutional-Funding">Proposals for Institutional Funding</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-NASA-EOSDIS"><acronym>NASA EOSDIS</acronym></a>:</td><td> </td><td valign="top"><a href="#Large-Numbers-of-Files">Large Numbers of Files</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-National-Virtual-Ocean-Data-System">National Virtual Ocean Data System</a>:</td><td> </td><td valign="top"><a href="#OPeNDAP">OPeNDAP</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-ncadd"><code>ncadd</code></a>:</td><td> </td><td valign="top"><a href="#ncbo-netCDF-Binary-Operator">ncbo netCDF Binary Operator</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-ncap"><code>ncap</code></a>:</td><td> </td><td valign="top"><a href="#ncap2-netCDF-Arithmetic-Processor">ncap2 netCDF Arithmetic Processor</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-ncap2-4"><code>ncap2</code></a>:</td><td> </td><td valign="top"><a href="#Compatability">Compatability</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-ncap2-5"><code>ncap2</code></a>:</td><td> </td><td valign="top"><a href="#ncap2-netCDF-Arithmetic-Processor">ncap2 netCDF Arithmetic Processor</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-ncap2"><code>ncap2</code></a>:</td><td> </td><td valign="top"><a href="#Memory-for-ncap2">Memory for ncap2</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-ncap2-1"><code>ncap2</code></a>:</td><td> </td><td valign="top"><a href="#OpenMP-Threading">OpenMP Threading</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-ncap2-2"><code>ncap2</code></a>:</td><td> </td><td valign="top"><a href="#Manual-type-conversion">Manual type conversion</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-ncap2-3"><code>ncap2</code></a>:</td><td> </td><td valign="top"><a href="#ncpdq-netCDF-Permute-Dimensions-Quickly">ncpdq netCDF Permute Dimensions Quickly</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-NCAR"><acronym>NCAR</acronym></a>:</td><td> </td><td valign="top"><a href="#Climate-Model-Paradigm">Climate Model Paradigm</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-NCAR-MSS"><acronym>NCAR MSS</acronym></a>:</td><td> </td><td valign="top"><a href="#Remote-storage">Remote storage</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-ncatted-3"><code>ncatted</code></a>:</td><td> </td><td valign="top"><a href="#Missing-Values">Missing Values</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-ncatted-4"><code>ncatted</code></a>:</td><td> </td><td valign="top"><a href="#ncatted-netCDF-Attribute-Editor">ncatted netCDF Attribute Editor</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-ncatted"><code>ncatted</code></a>:</td><td> </td><td valign="top"><a href="#Subsetting-Files">Subsetting Files</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-ncatted-1"><code>ncatted</code></a>:</td><td> </td><td valign="top"><a href="#Missing-Values">Missing Values</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-ncatted-2"><code>ncatted</code></a>:</td><td> </td><td valign="top"><a href="#History-Attribute">History Attribute</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-ncattget"><code>ncattget</code></a>:</td><td> </td><td valign="top"><a href="#ncatted-netCDF-Attribute-Editor">ncatted netCDF Attribute Editor</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-ncattget-1"><code>ncattget</code></a>:</td><td> </td><td valign="top"><a href="#Filters-for-ncks">Filters for <code>ncks</code></a></td></tr>
<tr><td></td><td valign="top"><a href="#index-ncavg"><code>ncavg</code></a>:</td><td> </td><td valign="top"><a href="#Filters-for-ncks">Filters for <code>ncks</code></a></td></tr>
<tr><td></td><td valign="top"><a href="#index-ncbo-1"><code>ncbo</code></a>:</td><td> </td><td valign="top"><a href="#ncbo-netCDF-Binary-Operator">ncbo netCDF Binary Operator</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-ncbo"><code>ncbo</code></a>:</td><td> </td><td valign="top"><a href="#Missing-Values">Missing Values</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-ncdiff"><code>ncdiff</code></a>:</td><td> </td><td valign="top"><a href="#ncbo-netCDF-Binary-Operator">ncbo netCDF Binary Operator</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-ncdismember"><code>ncdismember</code></a>:</td><td> </td><td valign="top"><a href="#Group-Path-Editing">Group Path Editing</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-ncdismember-1"><code>ncdismember</code></a>:</td><td> </td><td valign="top"><a href="#Group-Path-Editing">Group Path Editing</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-ncdivide"><code>ncdivide</code></a>:</td><td> </td><td valign="top"><a href="#ncbo-netCDF-Binary-Operator">ncbo netCDF Binary Operator</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-ncdmnsz"><code>ncdmnsz</code></a>:</td><td> </td><td valign="top"><a href="#Filters-for-ncks">Filters for <code>ncks</code></a></td></tr>
<tr><td></td><td valign="top"><a href="#index-ncdump"><code>ncdump</code></a>:</td><td> </td><td valign="top"><a href="#Determining-File-Format">Determining File Format</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-ncdump-1"><code>ncdump</code></a>:</td><td> </td><td valign="top"><a href="#ncks-netCDF-Kitchen-Sink">ncks netCDF Kitchen Sink</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-ncdump-2"><code>ncdump</code></a>:</td><td> </td><td valign="top"><a href="#ncks-netCDF-Kitchen-Sink">ncks netCDF Kitchen Sink</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-ncdump-3"><code>ncdump</code></a>:</td><td> </td><td valign="top"><a href="#ncks-netCDF-Kitchen-Sink">ncks netCDF Kitchen Sink</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-ncecat-1"><code>ncecat</code></a>:</td><td> </td><td valign="top"><a href="#ncecat-netCDF-Ensemble-Concatenator">ncecat netCDF Ensemble Concatenator</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-ncecat"><code>ncecat</code></a>:</td><td> </td><td valign="top"><a href="#Concatenation">Concatenation</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-nces-2"><code>nces</code></a>:</td><td> </td><td valign="top"><a href="#nces-netCDF-Ensemble-Statistics">nces netCDF Ensemble Statistics</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-nces"><code>nces</code></a>:</td><td> </td><td valign="top"><a href="#Averaging">Averaging</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-nces-1"><code>nces</code></a>:</td><td> </td><td valign="top"><a href="#Missing-Values">Missing Values</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-ncextr"><code>ncextr</code></a>:</td><td> </td><td valign="top"><a href="#ncks-netCDF-Kitchen-Sink">ncks netCDF Kitchen Sink</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-ncflint-2"><code>ncflint</code></a>:</td><td> </td><td valign="top"><a href="#ncflint-netCDF-File-Interpolator">ncflint netCDF File Interpolator</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-ncflint"><code>ncflint</code></a>:</td><td> </td><td valign="top"><a href="#Interpolating">Interpolating</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-ncflint-1"><code>ncflint</code></a>:</td><td> </td><td valign="top"><a href="#Missing-Values">Missing Values</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-ncgen"><code>ncgen</code></a>:</td><td> </td><td valign="top"><a href="#ncks-netCDF-Kitchen-Sink">ncks netCDF Kitchen Sink</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-ncgen_002dhdf"><code>ncgen-hdf</code></a>:</td><td> </td><td valign="top"><a href="#ncks-netCDF-Kitchen-Sink">ncks netCDF Kitchen Sink</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-ncks-1"><code>ncks</code></a>:</td><td> </td><td valign="top"><a href="#Deflation">Deflation</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-ncks-2"><code>ncks</code></a>:</td><td> </td><td valign="top"><a href="#Examples-ncap2">Examples ncap2</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-ncks-3"><code>ncks</code></a>:</td><td> </td><td valign="top"><a href="#ncks-netCDF-Kitchen-Sink">ncks netCDF Kitchen Sink</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-ncks"><code>ncks</code></a>:</td><td> </td><td valign="top"><a href="#Determining-File-Format">Determining File Format</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-NCL"><acronym>NCL</acronym></a>:</td><td> </td><td valign="top"><a href="#Philosophy">Philosophy</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-NCL-1"><acronym>NCL</acronym></a>:</td><td> </td><td valign="top"><a href="#ncpdq-netCDF-Permute-Dimensions-Quickly">ncpdq netCDF Permute Dimensions Quickly</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-nclist"><code>nclist</code></a>:</td><td> </td><td valign="top"><a href="#Filters-for-ncks">Filters for <code>ncks</code></a></td></tr>
<tr><td></td><td valign="top"><a href="#index-ncl_005fconvert2nc"><code>ncl_convert2nc</code></a>:</td><td> </td><td valign="top"><a href="#ncpdq-netCDF-Permute-Dimensions-Quickly">ncpdq netCDF Permute Dimensions Quickly</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-ncmax"><code>ncmax</code></a>:</td><td> </td><td valign="top"><a href="#Filters-for-ncks">Filters for <code>ncks</code></a></td></tr>
<tr><td></td><td valign="top"><a href="#index-ncmdn"><code>ncmdn</code></a>:</td><td> </td><td valign="top"><a href="#Filters-for-ncks">Filters for <code>ncks</code></a></td></tr>
<tr><td></td><td valign="top"><a href="#index-ncmin"><code>ncmin</code></a>:</td><td> </td><td valign="top"><a href="#Filters-for-ncks">Filters for <code>ncks</code></a></td></tr>
<tr><td></td><td valign="top"><a href="#index-NcML"><acronym>NcML</acronym></a>:</td><td> </td><td valign="top"><a href="#ncks-netCDF-Kitchen-Sink">ncks netCDF Kitchen Sink</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-ncmult"><code>ncmult</code></a>:</td><td> </td><td valign="top"><a href="#ncbo-netCDF-Binary-Operator">ncbo netCDF Binary Operator</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-ncmultiply"><code>ncmultiply</code></a>:</td><td> </td><td valign="top"><a href="#ncbo-netCDF-Binary-Operator">ncbo netCDF Binary Operator</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-NCO-availability"><acronym>NCO</acronym> availability</a>:</td><td> </td><td valign="top"><a href="#Availability">Availability</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-NCO-homepage"><acronym>NCO</acronym> homepage</a>:</td><td> </td><td valign="top"><a href="#Availability">Availability</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-nco-script-file">nco script file</a>:</td><td> </td><td valign="top"><a href="#Annual-Average-over-Regions">Annual Average over Regions</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-NCO-User-Guide"><cite>NCO User Guide</cite></a>:</td><td> </td><td valign="top"><a href="#Availability">Availability</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-nco_002econfig_002elog_002e_0024_007bGNU_005fTRP_007d_002efoo"><samp>nco.config.log.${GNU_TRP}.foo</samp></a>:</td><td> </td><td valign="top"><a href="#Help-Requests-and-Bug-Reports">Help Requests and Bug Reports</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-nco_002econfigure_002e_0024_007bGNU_005fTRP_007d_002efoo"><samp>nco.configure.${GNU_TRP}.foo</samp></a>:</td><td> </td><td valign="top"><a href="#Help-Requests-and-Bug-Reports">Help Requests and Bug Reports</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-nco_002emake_002e_0024_007bGNU_005fTRP_007d_002efoo"><samp>nco.make.${GNU_TRP}.foo</samp></a>:</td><td> </td><td valign="top"><a href="#Help-Requests-and-Bug-Reports">Help Requests and Bug Reports</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-nco_005finput_005ffile_005flist"><code>nco_input_file_list</code></a>:</td><td> </td><td valign="top"><a href="#Large-Numbers-of-Files">Large Numbers of Files</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-nco_005finput_005ffile_005flist-1"><code>nco_input_file_list</code></a>:</td><td> </td><td valign="top"><a href="#File-List-Attributes">File List Attributes</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-nco_005finput_005ffile_005fnumber"><code>nco_input_file_number</code></a>:</td><td> </td><td valign="top"><a href="#Large-Numbers-of-Files">Large Numbers of Files</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-nco_005finput_005ffile_005fnumber-1"><code>nco_input_file_number</code></a>:</td><td> </td><td valign="top"><a href="#File-List-Attributes">File List Attributes</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-nco_005fopenmp_005fthread_005fnumber"><code>nco_openmp_thread_number</code></a>:</td><td> </td><td valign="top"><a href="#OpenMP-Threading">OpenMP Threading</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-ncpack"><code>ncpack</code></a>:</td><td> </td><td valign="top"><a href="#ncpdq-netCDF-Permute-Dimensions-Quickly">ncpdq netCDF Permute Dimensions Quickly</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-ncpdq-2"><code>ncpdq</code></a>:</td><td> </td><td valign="top"><a href="#Chunking">Chunking</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-ncpdq-3"><code>ncpdq</code></a>:</td><td> </td><td valign="top"><a href="#ncecat-netCDF-Ensemble-Concatenator">ncecat netCDF Ensemble Concatenator</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-ncpdq-4"><code>ncpdq</code></a>:</td><td> </td><td valign="top"><a href="#ncpdq-netCDF-Permute-Dimensions-Quickly">ncpdq netCDF Permute Dimensions Quickly</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-ncpdq-5"><code>ncpdq</code></a>:</td><td> </td><td valign="top"><a href="#ncrcat-netCDF-Record-Concatenator">ncrcat netCDF Record Concatenator</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-ncpdq"><code>ncpdq</code></a>:</td><td> </td><td valign="top"><a href="#Concatenation">Concatenation</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-ncpdq-1"><code>ncpdq</code></a>:</td><td> </td><td valign="top"><a href="#OpenMP-Threading">OpenMP Threading</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-ncra-2"><code>ncra</code></a>:</td><td> </td><td valign="top"><a href="#Examples-ncap2">Examples ncap2</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-ncra-3"><code>ncra</code></a>:</td><td> </td><td valign="top"><a href="#ncra-netCDF-Record-Averager">ncra netCDF Record Averager</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-ncra"><code>ncra</code></a>:</td><td> </td><td valign="top"><a href="#Averaging">Averaging</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-ncra-1"><code>ncra</code></a>:</td><td> </td><td valign="top"><a href="#Missing-Values">Missing Values</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-ncrcat-2"><code>ncrcat</code></a>:</td><td> </td><td valign="top"><a href="#ncrcat-netCDF-Record-Concatenator">ncrcat netCDF Record Concatenator</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-ncrcat"><code>ncrcat</code></a>:</td><td> </td><td valign="top"><a href="#Concatenation">Concatenation</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-ncrcat-1"><code>ncrcat</code></a>:</td><td> </td><td valign="top"><a href="#OpenMP-Threading">OpenMP Threading</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-ncrecsz"><code>ncrecsz</code></a>:</td><td> </td><td valign="top"><a href="#Filters-for-ncks">Filters for <code>ncks</code></a></td></tr>
<tr><td></td><td valign="top"><a href="#index-ncrename"><code>ncrename</code></a>:</td><td> </td><td valign="top"><a href="#Missing-Values">Missing Values</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-ncrename-1"><code>ncrename</code></a>:</td><td> </td><td valign="top"><a href="#ncrename-netCDF-Renamer">ncrename netCDF Renamer</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-ncrng"><code>ncrng</code></a>:</td><td> </td><td valign="top"><a href="#Filters-for-ncks">Filters for <code>ncks</code></a></td></tr>
<tr><td></td><td valign="top"><a href="#index-NCSA"><acronym>NCSA</acronym></a>:</td><td> </td><td valign="top"><a href="#netCDF2_002f3_002f4-and-HDF4_002f5-Support">netCDF2/3/4 and HDF4/5 Support</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-ncsub"><code>ncsub</code></a>:</td><td> </td><td valign="top"><a href="#ncbo-netCDF-Binary-Operator">ncbo netCDF Binary Operator</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-ncsubtract"><code>ncsubtract</code></a>:</td><td> </td><td valign="top"><a href="#ncbo-netCDF-Binary-Operator">ncbo netCDF Binary Operator</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-ncunits"><code>ncunits</code></a>:</td><td> </td><td valign="top"><a href="#Filters-for-ncks">Filters for <code>ncks</code></a></td></tr>
<tr><td></td><td valign="top"><a href="#index-ncunpack"><code>ncunpack</code></a>:</td><td> </td><td valign="top"><a href="#ncpdq-netCDF-Permute-Dimensions-Quickly">ncpdq netCDF Permute Dimensions Quickly</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-ncwa-3"><code>ncwa</code></a>:</td><td> </td><td valign="top"><a href="#Examples-ncap2">Examples ncap2</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-ncwa-4"><code>ncwa</code></a>:</td><td> </td><td valign="top"><a href="#ncwa-netCDF-Weighted-Averager">ncwa netCDF Weighted Averager</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-ncwa"><code>ncwa</code></a>:</td><td> </td><td valign="top"><a href="#Averaging">Averaging</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-ncwa-1"><code>ncwa</code></a>:</td><td> </td><td valign="top"><a href="#OpenMP-Threading">OpenMP Threading</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-ncwa-2"><code>ncwa</code></a>:</td><td> </td><td valign="top"><a href="#Missing-Values">Missing Values</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-NC_005fBYTE"><code>NC_BYTE</code></a>:</td><td> </td><td valign="top"><a href="#ncpdq-netCDF-Permute-Dimensions-Quickly">ncpdq netCDF Permute Dimensions Quickly</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-NC_005fCHAR"><code>NC_CHAR</code></a>:</td><td> </td><td valign="top"><a href="#Hyperslabs">Hyperslabs</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-NC_005fCHAR-1"><code>NC_CHAR</code></a>:</td><td> </td><td valign="top"><a href="#ncbo-netCDF-Binary-Operator">ncbo netCDF Binary Operator</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-NC_005fCHAR-2"><code>NC_CHAR</code></a>:</td><td> </td><td valign="top"><a href="#ncpdq-netCDF-Permute-Dimensions-Quickly">ncpdq netCDF Permute Dimensions Quickly</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-NC_005fDISKLESS"><code>NC_DISKLESS</code></a>:</td><td> </td><td valign="top"><a href="#RAM-disks">RAM disks</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-NC_005fDOUBLE"><code>NC_DOUBLE</code></a>:</td><td> </td><td valign="top"><a href="#Intrinsic-mathematical-methods">Intrinsic mathematical methods</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-NC_005fDOUBLE-1"><code>NC_DOUBLE</code></a>:</td><td> </td><td valign="top"><a href="#ncpdq-netCDF-Permute-Dimensions-Quickly">ncpdq netCDF Permute Dimensions Quickly</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-NC_005fFLOAT"><code>NC_FLOAT</code></a>:</td><td> </td><td valign="top"><a href="#ncpdq-netCDF-Permute-Dimensions-Quickly">ncpdq netCDF Permute Dimensions Quickly</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-NC_005fFORMAT_005fDAP2"><code>NC_FORMAT_DAP2</code></a>:</td><td> </td><td valign="top"><a href="#Determining-File-Format">Determining File Format</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-NC_005fFORMAT_005fDAP4"><code>NC_FORMAT_DAP4</code></a>:</td><td> </td><td valign="top"><a href="#Determining-File-Format">Determining File Format</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-NC_005fFORMAT_005fNC3"><code>NC_FORMAT_NC3</code></a>:</td><td> </td><td valign="top"><a href="#Determining-File-Format">Determining File Format</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-NC_005fFORMAT_005fNC_005fHDF4"><code>NC_FORMAT_NC_HDF4</code></a>:</td><td> </td><td valign="top"><a href="#Determining-File-Format">Determining File Format</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-NC_005fFORMAT_005fNC_005fHDF5"><code>NC_FORMAT_NC_HDF5</code></a>:</td><td> </td><td valign="top"><a href="#Determining-File-Format">Determining File Format</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-NC_005fFORMAT_005fPNETCDF"><code>NC_FORMAT_PNETCDF</code></a>:</td><td> </td><td valign="top"><a href="#Determining-File-Format">Determining File Format</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-NC_005fINT"><code>NC_INT</code></a>:</td><td> </td><td valign="top"><a href="#ncpdq-netCDF-Permute-Dimensions-Quickly">ncpdq netCDF Permute Dimensions Quickly</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-NC_005fINT64"><code>NC_INT64</code></a>:</td><td> </td><td valign="top"><a href="#netCDF2_002f3_002f4-and-HDF4_002f5-Support">netCDF2/3/4 and HDF4/5 Support</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-NC_005fINT64-1"><code>NC_INT64</code></a>:</td><td> </td><td valign="top"><a href="#ncpdq-netCDF-Permute-Dimensions-Quickly">ncpdq netCDF Permute Dimensions Quickly</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-NC_005fSHORT"><code>NC_SHORT</code></a>:</td><td> </td><td valign="top"><a href="#ncpdq-netCDF-Permute-Dimensions-Quickly">ncpdq netCDF Permute Dimensions Quickly</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-NC_005fUBYTE"><code>NC_UBYTE</code></a>:</td><td> </td><td valign="top"><a href="#netCDF2_002f3_002f4-and-HDF4_002f5-Support">netCDF2/3/4 and HDF4/5 Support</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-NC_005fUBYTE-1"><code>NC_UBYTE</code></a>:</td><td> </td><td valign="top"><a href="#ncpdq-netCDF-Permute-Dimensions-Quickly">ncpdq netCDF Permute Dimensions Quickly</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-NC_005fUINT"><code>NC_UINT</code></a>:</td><td> </td><td valign="top"><a href="#netCDF2_002f3_002f4-and-HDF4_002f5-Support">netCDF2/3/4 and HDF4/5 Support</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-NC_005fUINT-1"><code>NC_UINT</code></a>:</td><td> </td><td valign="top"><a href="#ncpdq-netCDF-Permute-Dimensions-Quickly">ncpdq netCDF Permute Dimensions Quickly</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-NC_005fUINT64"><code>NC_UINT64</code></a>:</td><td> </td><td valign="top"><a href="#netCDF2_002f3_002f4-and-HDF4_002f5-Support">netCDF2/3/4 and HDF4/5 Support</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-NC_005fUINT64-1"><code>NC_UINT64</code></a>:</td><td> </td><td valign="top"><a href="#ncpdq-netCDF-Permute-Dimensions-Quickly">ncpdq netCDF Permute Dimensions Quickly</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-NC_005fUSHORT"><code>NC_USHORT</code></a>:</td><td> </td><td valign="top"><a href="#netCDF2_002f3_002f4-and-HDF4_002f5-Support">netCDF2/3/4 and HDF4/5 Support</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-NC_005fUSHORT-1"><code>NC_USHORT</code></a>:</td><td> </td><td valign="top"><a href="#ncpdq-netCDF-Permute-Dimensions-Quickly">ncpdq netCDF Permute Dimensions Quickly</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-nc_005f_005fenddef_0028_0029"><code>nc__enddef()</code></a>:</td><td> </td><td valign="top"><a href="#Metadata-Optimization">Metadata Optimization</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-ndims_0028_0029">ndims()</a>:</td><td> </td><td valign="top"><a href="#Methods-and-functions">Methods and functions</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-nearbyint"><var>nearbyint</var></a>:</td><td> </td><td valign="top"><a href="#Intrinsic-mathematical-methods">Intrinsic mathematical methods</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-nearest-integer-function-_0028exact_0029">nearest integer function (exact)</a>:</td><td> </td><td valign="top"><a href="#Intrinsic-mathematical-methods">Intrinsic mathematical methods</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-nearest-integer-function-_0028inexact_0029">nearest integer function (inexact)</a>:</td><td> </td><td valign="top"><a href="#Intrinsic-mathematical-methods">Intrinsic mathematical methods</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-NEC"><acronym>NEC</acronym></a>:</td><td> </td><td valign="top"><a href="#Compatability">Compatability</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-Neil-Davis">Neil Davis</a>:</td><td> </td><td valign="top"><a href="#Automatic-type-conversion">Automatic type conversion</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-nesting">nesting</a>:</td><td> </td><td valign="top"><a href="#Syntax-of-ncap2-statements">Syntax of ncap2 statements</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-netCDF">netCDF</a>:</td><td> </td><td valign="top"><a href="#Availability">Availability</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-netCDF2">netCDF2</a>:</td><td> </td><td valign="top"><a href="#netCDF2_002f3_002f4-and-HDF4_002f5-Support">netCDF2/3/4 and HDF4/5 Support</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-netCDF2-1">netCDF2</a>:</td><td> </td><td valign="top"><a href="#File-Formats-and-Conversion">File Formats and Conversion</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-NETCDF2_005fONLY"><code>NETCDF2_ONLY</code></a>:</td><td> </td><td valign="top"><a href="#netCDF2_002f3_002f4-and-HDF4_002f5-Support">netCDF2/3/4 and HDF4/5 Support</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-netCDF3">netCDF3</a>:</td><td> </td><td valign="top"><a href="#netCDF2_002f3_002f4-and-HDF4_002f5-Support">netCDF2/3/4 and HDF4/5 Support</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-netCDF3-1">netCDF3</a>:</td><td> </td><td valign="top"><a href="#File-Formats-and-Conversion">File Formats and Conversion</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-netCDF3-classic-file-format">netCDF3 classic file format</a>:</td><td> </td><td valign="top"><a href="#Determining-File-Format">Determining File Format</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-netCDF4">netCDF4</a>:</td><td> </td><td valign="top"><a href="#netCDF2_002f3_002f4-and-HDF4_002f5-Support">netCDF2/3/4 and HDF4/5 Support</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-netCDF4-1">netCDF4</a>:</td><td> </td><td valign="top"><a href="#File-Formats-and-Conversion">File Formats and Conversion</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-netCDF4-2">netCDF4</a>:</td><td> </td><td valign="top"><a href="#Multiple-Record-Dimensions">Multiple Record Dimensions</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-netCDF4-classic-file-format">netCDF4 classic file format</a>:</td><td> </td><td valign="top"><a href="#Determining-File-Format">Determining File Format</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-netCDF4-file-format">netCDF4 file format</a>:</td><td> </td><td valign="top"><a href="#Determining-File-Format">Determining File Format</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-NETCDF4-files"><code>NETCDF4</code> files</a>:</td><td> </td><td valign="top"><a href="#File-Formats-and-Conversion">File Formats and Conversion</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-NETCDF4_005fCLASSIC-files"><code>NETCDF4_CLASSIC</code> files</a>:</td><td> </td><td valign="top"><a href="#File-Formats-and-Conversion">File Formats and Conversion</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-NETCDF4_005fROOT"><code>NETCDF4_ROOT</code></a>:</td><td> </td><td valign="top"><a href="#netCDF2_002f3_002f4-and-HDF4_002f5-Support">netCDF2/3/4 and HDF4/5 Support</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-Nick-Bower">Nick Bower</a>:</td><td> </td><td valign="top"><a href="#Contributors">Contributors</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-NINTAP"><code>NINTAP</code></a>:</td><td> </td><td valign="top"><a href="#Specifying-Input-Files">Specifying Input Files</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-NINTAP-1"><code>NINTAP</code></a>:</td><td> </td><td valign="top"><a href="#ncra-netCDF-Record-Averager">ncra netCDF Record Averager</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-NINTAP-2"><code>NINTAP</code></a>:</td><td> </td><td valign="top"><a href="#ncrcat-netCDF-Record-Concatenator">ncrcat netCDF Record Concatenator</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-non_002dcoordinate-grid-properties">non-coordinate grid properties</a>:</td><td> </td><td valign="top"><a href="#CF-Conventions">CF Conventions</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-non_002drectangular-grids">non-rectangular grids</a>:</td><td> </td><td valign="top"><a href="#Irregular-grids">Irregular grids</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-non_002dstandard-grids">non-standard grids</a>:</td><td> </td><td valign="top"><a href="#Irregular-grids">Irregular grids</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-normalization">normalization</a>:</td><td> </td><td valign="top"><a href="#Normalization-and-Integration">Normalization and Integration</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-Not_002da_002dNumber">Not-a-Number</a>:</td><td> </td><td valign="top"><a href="#ncatted-netCDF-Attribute-Editor">ncatted netCDF Attribute Editor</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-NO_005fNETCDF_005f2"><code>NO_NETCDF_2</code></a>:</td><td> </td><td valign="top"><a href="#netCDF2_002f3_002f4-and-HDF4_002f5-Support">netCDF2/3/4 and HDF4/5 Support</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-NRA"><acronym>NRA</acronym></a>:</td><td> </td><td valign="top"><a href="#Proposals-for-Institutional-Funding">Proposals for Institutional Funding</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-nrnet"><code>nrnet</code></a>:</td><td> </td><td valign="top"><a href="#Remote-storage">Remote storage</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-NSF"><acronym>NSF</acronym></a>:</td><td> </td><td valign="top"><a href="#Proposals-for-Institutional-Funding">Proposals for Institutional Funding</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-NSF-1"><acronym>NSF</acronym></a>:</td><td> </td><td valign="top"><a href="#Proposals-for-Institutional-Funding">Proposals for Institutional Funding</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-NT-_0028Microsoft-operating-system_0029">NT (Microsoft operating system)</a>:</td><td> </td><td valign="top"><a href="#Windows-Operating-System">Windows Operating System</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-NUL">NUL</a>:</td><td> </td><td valign="top"><a href="#ncatted-netCDF-Attribute-Editor">ncatted netCDF Attribute Editor</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-NUL-1"><code>NUL</code></a>:</td><td> </td><td valign="top"><a href="#ncpdq-netCDF-Permute-Dimensions-Quickly">ncpdq netCDF Permute Dimensions Quickly</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-NUL_002dtermination">NUL-termination</a>:</td><td> </td><td valign="top"><a href="#ncatted-netCDF-Attribute-Editor">ncatted netCDF Attribute Editor</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-null-operation">null operation</a>:</td><td> </td><td valign="top"><a href="#ncflint-netCDF-File-Interpolator">ncflint netCDF File Interpolator</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-number-literals-ncap2">number literals <code>ncap2</code></a>:</td><td> </td><td valign="top"><a href="#Number-literals">Number literals</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-number_005fmiss_0028_0029"><code>number_miss()</code></a>:</td><td> </td><td valign="top"><a href="#Missing-values-ncap2">Missing values ncap2</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-numerator"><code>numerator</code></a>:</td><td> </td><td valign="top"><a href="#Normalization-and-Integration">Normalization and Integration</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-NVODS"><acronym>NVODS</acronym></a>:</td><td> </td><td valign="top"><a href="#OPeNDAP">OPeNDAP</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-nxt_005flsr">‘<samp>nxt_lsr</samp>’</a>:</td><td> </td><td valign="top"><a href="#ncpdq-netCDF-Permute-Dimensions-Quickly">ncpdq netCDF Permute Dimensions Quickly</a></td></tr>
<tr><td colspan="4"> <hr></td></tr>
<tr><th><a name="General-Index_cp_letter-O">O</a></th><td></td><td></td></tr>
<tr><td></td><td valign="top"><a href="#index-oceanography">oceanography</a>:</td><td> </td><td valign="top"><a href="#OPeNDAP">OPeNDAP</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-octal-dump">octal dump</a>:</td><td> </td><td valign="top"><a href="#Determining-File-Format">Determining File Format</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-od"><code>od</code></a>:</td><td> </td><td valign="top"><a href="#Determining-File-Format">Determining File Format</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-OMP_005fNUM_005fTHREADS"><code>OMP_NUM_THREADS</code></a>:</td><td> </td><td valign="top"><a href="#OpenMP-Threading">OpenMP Threading</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-on_002dline-documentation">on-line documentation</a>:</td><td> </td><td valign="top"><a href="#Availability">Availability</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-open-source">open source</a>:</td><td> </td><td valign="top"><a href="#Foreword">Foreword</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-open-source-1">open source</a>:</td><td> </td><td valign="top"><a href="#OPeNDAP">OPeNDAP</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-Open_002dsource-Project-for-a-Network-Data-Access-Protocol">Open-source Project for a Network Data Access Protocol</a>:</td><td> </td><td valign="top"><a href="#OPeNDAP">OPeNDAP</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-OPeNDAP_002e"><acronym>OPeNDAP</acronym>.</a>:</td><td> </td><td valign="top"><a href="#OPeNDAP">OPeNDAP</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-OpenMP">OpenMP</a>:</td><td> </td><td valign="top"><a href="#Memory-Requirements">Memory Requirements</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-OpenMP-1">OpenMP</a>:</td><td> </td><td valign="top"><a href="#Single-and-Multi_002dfile-Operators">Single and Multi-file Operators</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-OpenMP-2">OpenMP</a>:</td><td> </td><td valign="top"><a href="#OpenMP-Threading">OpenMP Threading</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-operation-types">operation types</a>:</td><td> </td><td valign="top"><a href="#Operation-Types">Operation Types</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-operation-types-1">operation types</a>:</td><td> </td><td valign="top"><a href="#ncra-netCDF-Record-Averager">ncra netCDF Record Averager</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-operation-types-2">operation types</a>:</td><td> </td><td valign="top"><a href="#ncwa-netCDF-Weighted-Averager">ncwa netCDF Weighted Averager</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-operator-speed">operator speed</a>:</td><td> </td><td valign="top"><a href="#Libraries">Libraries</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-operator-speed-1">operator speed</a>:</td><td> </td><td valign="top"><a href="#Temporary-Output-Files">Temporary Output Files</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-operator-speed-2">operator speed</a>:</td><td> </td><td valign="top"><a href="#Performance">Performance</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-operator-speed-3">operator speed</a>:</td><td> </td><td valign="top"><a href="#Metadata-Optimization">Metadata Optimization</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-operator-speed-4">operator speed</a>:</td><td> </td><td valign="top"><a href="#Missing-Values">Missing Values</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-operator-speed-5">operator speed</a>:</td><td> </td><td valign="top"><a href="#ncrename-netCDF-Renamer">ncrename netCDF Renamer</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-operators">operators</a>:</td><td> </td><td valign="top"><a href="#Summary">Summary</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-OptIPuter">OptIPuter</a>:</td><td> </td><td valign="top"><a href="#Proposals-for-Institutional-Funding">Proposals for Institutional Funding</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-Orion-Powlawski">Orion Powlawski</a>:</td><td> </td><td valign="top"><a href="#Contributors">Contributors</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-ORO"><code>ORO</code></a>:</td><td> </td><td valign="top"><a href="#CF-Conventions">CF Conventions</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-ORO-1"><code>ORO</code></a>:</td><td> </td><td valign="top"><a href="#Normalization-and-Integration">Normalization and Integration</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-OS"><acronym>OS</acronym></a>:</td><td> </td><td valign="top"><a href="#Compatability">Compatability</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-output-file">output file</a>:</td><td> </td><td valign="top"><a href="#Large-Numbers-of-Files">Large Numbers of Files</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-output-file-1">output file</a>:</td><td> </td><td valign="top"><a href="#Specifying-Output-Files">Specifying Output Files</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-output_002dpath"><var>output-path</var></a>:</td><td> </td><td valign="top"><a href="#Remote-storage">Remote storage</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-overview">overview</a>:</td><td> </td><td valign="top"><a href="#Performance">Performance</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-overwriting-files">overwriting files</a>:</td><td> </td><td valign="top"><a href="#Temporary-Output-Files">Temporary Output Files</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-overwriting-files-1">overwriting files</a>:</td><td> </td><td valign="top"><a href="#Batch-Mode">Batch Mode</a></td></tr>
<tr><td colspan="4"> <hr></td></tr>
<tr><th><a name="General-Index_cp_letter-P">P</a></th><td></td><td></td></tr>
<tr><td></td><td valign="top"><a href="#index-pack_0028_0029">pack()</a>:</td><td> </td><td valign="top"><a href="#Methods-and-functions">Methods and functions</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-pack_0028x_0029"><code>pack(x)</code></a>:</td><td> </td><td valign="top"><a href="#Packed-data">Packed data</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-packing">packing</a>:</td><td> </td><td valign="top"><a href="#OPeNDAP">OPeNDAP</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-packing-1">packing</a>:</td><td> </td><td valign="top"><a href="#Chunking">Chunking</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-packing-2">packing</a>:</td><td> </td><td valign="top"><a href="#Packed-data">Packed data</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-packing-3">packing</a>:</td><td> </td><td valign="top"><a href="#ncecat-netCDF-Ensemble-Concatenator">ncecat netCDF Ensemble Concatenator</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-packing-4">packing</a>:</td><td> </td><td valign="top"><a href="#ncpdq-netCDF-Permute-Dimensions-Quickly">ncpdq netCDF Permute Dimensions Quickly</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-packing-5">packing</a>:</td><td> </td><td valign="top"><a href="#ncrcat-netCDF-Record-Concatenator">ncrcat netCDF Record Concatenator</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-packing-map">packing map</a>:</td><td> </td><td valign="top"><a href="#ncpdq-netCDF-Permute-Dimensions-Quickly">ncpdq netCDF Permute Dimensions Quickly</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-packing-policy">packing policy</a>:</td><td> </td><td valign="top"><a href="#ncpdq-netCDF-Permute-Dimensions-Quickly">ncpdq netCDF Permute Dimensions Quickly</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-pack_005fbyte_0028_0029">pack_byte()</a>:</td><td> </td><td valign="top"><a href="#Methods-and-functions">Methods and functions</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-pack_005fint_0028_0029">pack_int()</a>:</td><td> </td><td valign="top"><a href="#Methods-and-functions">Methods and functions</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-pack_005fshort_0028_0029">pack_short()</a>:</td><td> </td><td valign="top"><a href="#Methods-and-functions">Methods and functions</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-papers">papers</a>:</td><td> </td><td valign="top"><a href="#Performance">Performance</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-parallel"><code>parallel</code></a>:</td><td> </td><td valign="top"><a href="#Parallel">Parallel</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-parallelism">parallelism</a>:</td><td> </td><td valign="top"><a href="#OpenMP-Threading">OpenMP Threading</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-parallelism-1">parallelism</a>:</td><td> </td><td valign="top"><a href="#Proposals-for-Institutional-Funding">Proposals for Institutional Funding</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-parser">parser</a>:</td><td> </td><td valign="top"><a href="#ncap2-netCDF-Arithmetic-Processor">ncap2 netCDF Arithmetic Processor</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-pasting-variables">pasting variables</a>:</td><td> </td><td valign="top"><a href="#Appending-Variables">Appending Variables</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-pathcc"><code>pathcc</code></a>:</td><td> </td><td valign="top"><a href="#Compatability">Compatability</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-pathCC"><code>pathCC</code></a>:</td><td> </td><td valign="top"><a href="#Compatability">Compatability</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-PathScale">PathScale</a>:</td><td> </td><td valign="top"><a href="#Compatability">Compatability</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-Patrice-Dumas">Patrice Dumas</a>:</td><td> </td><td valign="top"><a href="#Contributors">Contributors</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-Patrick-Kursawe">Patrick Kursawe</a>:</td><td> </td><td valign="top"><a href="#Contributors">Contributors</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-pattern-matching">pattern matching</a>:</td><td> </td><td valign="top"><a href="#Large-Numbers-of-Files">Large Numbers of Files</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-pattern-matching-1">pattern matching</a>:</td><td> </td><td valign="top"><a href="#Subsetting-Files">Subsetting Files</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-pattern-matching-2">pattern matching</a>:</td><td> </td><td valign="top"><a href="#ncatted-netCDF-Attribute-Editor">ncatted netCDF Attribute Editor</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-pattern-matching-3">pattern matching</a>:</td><td> </td><td valign="top"><a href="#ncatted-netCDF-Attribute-Editor">ncatted netCDF Attribute Editor</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-PayPal">PayPal</a>:</td><td> </td><td valign="top"><a href="#Contributing">Contributing</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-pck_005fmap"><var>pck_map</var></a>:</td><td> </td><td valign="top"><a href="#ncpdq-netCDF-Permute-Dimensions-Quickly">ncpdq netCDF Permute Dimensions Quickly</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-pck_005fplc"><var>pck_plc</var></a>:</td><td> </td><td valign="top"><a href="#ncpdq-netCDF-Permute-Dimensions-Quickly">ncpdq netCDF Permute Dimensions Quickly</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-peak-memory-usage">peak memory usage</a>:</td><td> </td><td valign="top"><a href="#Memory-Requirements">Memory Requirements</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-peak-memory-usage-1">peak memory usage</a>:</td><td> </td><td valign="top"><a href="#RAM-disks">RAM disks</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-Pedro-Vicente">Pedro Vicente</a>:</td><td> </td><td valign="top"><a href="#Contributors">Contributors</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-performance">performance</a>:</td><td> </td><td valign="top"><a href="#Libraries">Libraries</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-performance-1">performance</a>:</td><td> </td><td valign="top"><a href="#Temporary-Output-Files">Temporary Output Files</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-performance-2">performance</a>:</td><td> </td><td valign="top"><a href="#Performance">Performance</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-performance-3">performance</a>:</td><td> </td><td valign="top"><a href="#Performance">Performance</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-performance-4">performance</a>:</td><td> </td><td valign="top"><a href="#Metadata-Optimization">Metadata Optimization</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-performance-5">performance</a>:</td><td> </td><td valign="top"><a href="#Missing-Values">Missing Values</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-performance-6">performance</a>:</td><td> </td><td valign="top"><a href="#ncrename-netCDF-Renamer">ncrename netCDF Renamer</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-Perl">Perl</a>:</td><td> </td><td valign="top"><a href="#Philosophy">Philosophy</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-Perl-1">Perl</a>:</td><td> </td><td valign="top"><a href="#Large-Numbers-of-Files">Large Numbers of Files</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-Perl-2">Perl</a>:</td><td> </td><td valign="top"><a href="#ncatted-netCDF-Attribute-Editor">ncatted netCDF Attribute Editor</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-permute-dimensions">permute dimensions</a>:</td><td> </td><td valign="top"><a href="#ncpdq-netCDF-Permute-Dimensions-Quickly">ncpdq netCDF Permute Dimensions Quickly</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-permute_0028_0029">permute()</a>:</td><td> </td><td valign="top"><a href="#Arrays-and-hyperslabs">Arrays and hyperslabs</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-Peter-Campbell">Peter Campbell</a>:</td><td> </td><td valign="top"><a href="#Contributors">Contributors</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-pgcc"><code>pgcc</code></a>:</td><td> </td><td valign="top"><a href="#Compatability">Compatability</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-pgCC"><code>pgCC</code></a>:</td><td> </td><td valign="top"><a href="#Compatability">Compatability</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-PGI"><acronym>PGI</acronym></a>:</td><td> </td><td valign="top"><a href="#Compatability">Compatability</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-philosophy">philosophy</a>:</td><td> </td><td valign="top"><a href="#Philosophy">Philosophy</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-pipes">pipes</a>:</td><td> </td><td valign="top"><a href="#Large-Numbers-of-Files">Large Numbers of Files</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-plc_005fall">‘<samp>plc_all</samp>’</a>:</td><td> </td><td valign="top"><a href="#Chunking">Chunking</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-plc_005fg2d">‘<samp>plc_g2d</samp>’</a>:</td><td> </td><td valign="top"><a href="#Chunking">Chunking</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-plc_005fg3d">‘<samp>plc_g3d</samp>’</a>:</td><td> </td><td valign="top"><a href="#Chunking">Chunking</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-plc_005fxpl">‘<samp>plc_xpl</samp>’</a>:</td><td> </td><td valign="top"><a href="#Chunking">Chunking</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-plc_005fxst">‘<samp>plc_xst</samp>’</a>:</td><td> </td><td valign="top"><a href="#Chunking">Chunking</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-portability">portability</a>:</td><td> </td><td valign="top"><a href="#Compatability">Compatability</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-positional-arguments">positional arguments</a>:</td><td> </td><td valign="top"><a href="#Specifying-Output-Files">Specifying Output Files</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-POSIX"><acronym>POSIX</acronym></a>:</td><td> </td><td valign="top"><a href="#Command-Line-Options">Command Line Options</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-POSIX-1"><acronym>POSIX</acronym></a>:</td><td> </td><td valign="top"><a href="#Subsetting-Files">Subsetting Files</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-pow"><var>pow</var></a>:</td><td> </td><td valign="top"><a href="#Intrinsic-mathematical-methods">Intrinsic mathematical methods</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-power">power</a>:</td><td> </td><td valign="top"><a href="#Intrinsic-mathematical-methods">Intrinsic mathematical methods</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-power-function">power function</a>:</td><td> </td><td valign="top"><a href="#Intrinsic-mathematical-methods">Intrinsic mathematical methods</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-prd">‘<samp>prd</samp>’</a>:</td><td> </td><td valign="top"><a href="#Chunking">Chunking</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-precision">precision</a>:</td><td> </td><td valign="top"><a href="#Intrinsic-mathematical-methods">Intrinsic mathematical methods</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-preprocessor-tokens">preprocessor tokens</a>:</td><td> </td><td valign="top"><a href="#Windows-Operating-System">Windows Operating System</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-presentations">presentations</a>:</td><td> </td><td valign="top"><a href="#Availability">Availability</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-print_0028_0029-ncap2">print() <code>ncap2</code></a>:</td><td> </td><td valign="top"><a href="#print-statement">print statement</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-printf"><code>printf</code></a>:</td><td> </td><td valign="top"><a href="#Compatability">Compatability</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-printf_0028_0029"><code>printf()</code></a>:</td><td> </td><td valign="top"><a href="#ncatted-netCDF-Attribute-Editor">ncatted netCDF Attribute Editor</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-printf_0028_0029-1"><code>printf()</code></a>:</td><td> </td><td valign="top"><a href="#ncks-netCDF-Kitchen-Sink">ncks netCDF Kitchen Sink</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-printf_0028_0029-2"><code>printf()</code></a>:</td><td> </td><td valign="top"><a href="#Filters-for-ncks">Filters for <code>ncks</code></a></td></tr>
<tr><td></td><td valign="top"><a href="#index-printing-files-contents">printing files contents</a>:</td><td> </td><td valign="top"><a href="#ncks-netCDF-Kitchen-Sink">ncks netCDF Kitchen Sink</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-printing-variables">printing variables</a>:</td><td> </td><td valign="top"><a href="#ncks-netCDF-Kitchen-Sink">ncks netCDF Kitchen Sink</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-Processor">Processor</a>:</td><td> </td><td valign="top"><a href="#ncra-netCDF-Record-Averager">ncra netCDF Record Averager</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-Processor-1">Processor</a>:</td><td> </td><td valign="top"><a href="#ncrcat-netCDF-Record-Concatenator">ncrcat netCDF Record Concatenator</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-Processor_002c-CCM">Processor, <acronym>CCM</acronym></a>:</td><td> </td><td valign="top"><a href="#Specifying-Input-Files">Specifying Input Files</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-promotion">promotion</a>:</td><td> </td><td valign="top"><a href="#Type-Conversion">Type Conversion</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-promotion-1">promotion</a>:</td><td> </td><td valign="top"><a href="#Promoting-Single_002dprecision-to-Double">Promoting Single-precision to Double</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-promotion-2">promotion</a>:</td><td> </td><td valign="top"><a href="#Intrinsic-mathematical-methods">Intrinsic mathematical methods</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-proposals">proposals</a>:</td><td> </td><td valign="top"><a href="#Proposals-for-Institutional-Funding">Proposals for Institutional Funding</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-pseudonym">pseudonym</a>:</td><td> </td><td valign="top"><a href="#Symbolic-Links">Symbolic Links</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-publications">publications</a>:</td><td> </td><td valign="top"><a href="#Availability">Availability</a></td></tr>
<tr><td colspan="4"> <hr></td></tr>
<tr><th><a name="General-Index_cp_letter-Q">Q</a></th><td></td><td></td></tr>
<tr><td></td><td valign="top"><a href="#index-QLogic">QLogic</a>:</td><td> </td><td valign="top"><a href="#Compatability">Compatability</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-Qt">Qt</a>:</td><td> </td><td valign="top"><a href="#Windows-Operating-System">Windows Operating System</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-quadruple_002dprecision">quadruple-precision</a>:</td><td> </td><td valign="top"><a href="#Intrinsic-mathematical-methods">Intrinsic mathematical methods</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-Quick-Start">Quick Start</a>:</td><td> </td><td valign="top"><a href="#Quick-Start">Quick Start</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-quiet">quiet</a>:</td><td> </td><td valign="top"><a href="#ncks-netCDF-Kitchen-Sink">ncks netCDF Kitchen Sink</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-quotes">quotes</a>:</td><td> </td><td valign="top"><a href="#Subsetting-Files">Subsetting Files</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-quotes-1">quotes</a>:</td><td> </td><td valign="top"><a href="#Examples-ncap2">Examples ncap2</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-quotes-2">quotes</a>:</td><td> </td><td valign="top"><a href="#ncbo-netCDF-Binary-Operator">ncbo netCDF Binary Operator</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-quotes-3">quotes</a>:</td><td> </td><td valign="top"><a href="#ncpdq-netCDF-Permute-Dimensions-Quickly">ncpdq netCDF Permute Dimensions Quickly</a></td></tr>
<tr><td colspan="4"> <hr></td></tr>
<tr><th><a name="General-Index_cp_letter-R">R</a></th><td></td><td></td></tr>
<tr><td></td><td valign="top"><a href="#index-RAG"><acronym>RAG</acronym></a>:</td><td> </td><td valign="top"><a href="#ncecat-netCDF-Ensemble-Concatenator">ncecat netCDF Ensemble Concatenator</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-RAM"><acronym>RAM</acronym></a>:</td><td> </td><td valign="top"><a href="#Memory-Requirements">Memory Requirements</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-RAM-1"><acronym>RAM</acronym></a>:</td><td> </td><td valign="top"><a href="#RAM-disks">RAM disks</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-RAM-disks"><acronym>RAM</acronym> disks</a>:</td><td> </td><td valign="top"><a href="#Temporary-Output-Files">Temporary Output Files</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-RAM-disks-1"><acronym>RAM</acronym> disks</a>:</td><td> </td><td valign="top"><a href="#RAM-disks">RAM disks</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-RAM-files"><acronym>RAM</acronym> files</a>:</td><td> </td><td valign="top"><a href="#Temporary-Output-Files">Temporary Output Files</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-RAM-files-1"><acronym>RAM</acronym> files</a>:</td><td> </td><td valign="top"><a href="#RAM-disks">RAM disks</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-RAM-variables"><acronym>RAM</acronym> variables</a>:</td><td> </td><td valign="top"><a href="#RAM-disks">RAM disks</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-RAM-variables-1"><acronym>RAM</acronym> variables</a>:</td><td> </td><td valign="top"><a href="#Methods-and-functions">Methods and functions</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-ram_005fdelete_0028_0029">ram_delete()</a>:</td><td> </td><td valign="top"><a href="#RAM-variables">RAM variables</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-ram_005fwrite_0028_0029">ram_write()</a>:</td><td> </td><td valign="top"><a href="#RAM-variables">RAM variables</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-random-walk">random walk</a>:</td><td> </td><td valign="top"><a href="#Promoting-Single_002dprecision-to-Double">Promoting Single-precision to Double</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-rank">rank</a>:</td><td> </td><td valign="top"><a href="#Expressions">Expressions</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-rank-1">rank</a>:</td><td> </td><td valign="top"><a href="#ncbo-netCDF-Binary-Operator">ncbo netCDF Binary Operator</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-rank-2">rank</a>:</td><td> </td><td valign="top"><a href="#ncbo-netCDF-Binary-Operator">ncbo netCDF Binary Operator</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-rank-3">rank</a>:</td><td> </td><td valign="top"><a href="#ncbo-netCDF-Binary-Operator">ncbo netCDF Binary Operator</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-rank-4">rank</a>:</td><td> </td><td valign="top"><a href="#ncwa-netCDF-Weighted-Averager">ncwa netCDF Weighted Averager</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-rcp"><code>rcp</code></a>:</td><td> </td><td valign="top"><a href="#Windows-Operating-System">Windows Operating System</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-rcp-1"><code>rcp</code></a>:</td><td> </td><td valign="top"><a href="#Remote-storage">Remote storage</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-RCS"><acronym>RCS</acronym></a>:</td><td> </td><td valign="top"><a href="#Operator-Version">Operator Version</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-rd1">‘<samp>rd1</samp>’</a>:</td><td> </td><td valign="top"><a href="#Chunking">Chunking</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-re_002ddimension">re-dimension</a>:</td><td> </td><td valign="top"><a href="#ncpdq-netCDF-Permute-Dimensions-Quickly">ncpdq netCDF Permute Dimensions Quickly</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-re_002dorder-dimensions">re-order dimensions</a>:</td><td> </td><td valign="top"><a href="#ncpdq-netCDF-Permute-Dimensions-Quickly">ncpdq netCDF Permute Dimensions Quickly</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-record-aggregation">record aggregation</a>:</td><td> </td><td valign="top"><a href="#ncecat-netCDF-Ensemble-Concatenator">ncecat netCDF Ensemble Concatenator</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-record-append">record append</a>:</td><td> </td><td valign="top"><a href="#Record-Appending">Record Appending</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-record-average">record average</a>:</td><td> </td><td valign="top"><a href="#ncra-netCDF-Record-Averager">ncra netCDF Record Averager</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-record-concatenation">record concatenation</a>:</td><td> </td><td valign="top"><a href="#ncrcat-netCDF-Record-Concatenator">ncrcat netCDF Record Concatenator</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-record-dimension">record dimension</a>:</td><td> </td><td valign="top"><a href="#Appending-Variables">Appending Variables</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-record-dimension-1">record dimension</a>:</td><td> </td><td valign="top"><a href="#C-and-Fortran-Index-Conventions">C and Fortran Index Conventions</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-record-dimension-2">record dimension</a>:</td><td> </td><td valign="top"><a href="#Chunking">Chunking</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-record-dimension-3">record dimension</a>:</td><td> </td><td valign="top"><a href="#nces-netCDF-Ensemble-Statistics">nces netCDF Ensemble Statistics</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-record-dimension-4">record dimension</a>:</td><td> </td><td valign="top"><a href="#ncecat-netCDF-Ensemble-Concatenator">ncecat netCDF Ensemble Concatenator</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-record-dimension-5">record dimension</a>:</td><td> </td><td valign="top"><a href="#ncecat-netCDF-Ensemble-Concatenator">ncecat netCDF Ensemble Concatenator</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-record-dimension-6">record dimension</a>:</td><td> </td><td valign="top"><a href="#ncecat-netCDF-Ensemble-Concatenator">ncecat netCDF Ensemble Concatenator</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-record-dimension-7">record dimension</a>:</td><td> </td><td valign="top"><a href="#ncks-netCDF-Kitchen-Sink">ncks netCDF Kitchen Sink</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-record-dimension-8">record dimension</a>:</td><td> </td><td valign="top"><a href="#ncks-netCDF-Kitchen-Sink">ncks netCDF Kitchen Sink</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-record-dimension-9">record dimension</a>:</td><td> </td><td valign="top"><a href="#ncpdq-netCDF-Permute-Dimensions-Quickly">ncpdq netCDF Permute Dimensions Quickly</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-record-dimension-10">record dimension</a>:</td><td> </td><td valign="top"><a href="#ncpdq-netCDF-Permute-Dimensions-Quickly">ncpdq netCDF Permute Dimensions Quickly</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-record-dimension-11">record dimension</a>:</td><td> </td><td valign="top"><a href="#ncpdq-netCDF-Permute-Dimensions-Quickly">ncpdq netCDF Permute Dimensions Quickly</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-record-dimension-12">record dimension</a>:</td><td> </td><td valign="top"><a href="#ncra-netCDF-Record-Averager">ncra netCDF Record Averager</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-record-dimension-13">record dimension</a>:</td><td> </td><td valign="top"><a href="#ncra-netCDF-Record-Averager">ncra netCDF Record Averager</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-record-dimension-14">record dimension</a>:</td><td> </td><td valign="top"><a href="#ncrcat-netCDF-Record-Concatenator">ncrcat netCDF Record Concatenator</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-record-variable">record variable</a>:</td><td> </td><td valign="top"><a href="#C-and-Fortran-Index-Conventions">C and Fortran Index Conventions</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-record-variable-1">record variable</a>:</td><td> </td><td valign="top"><a href="#ncpdq-netCDF-Permute-Dimensions-Quickly">ncpdq netCDF Permute Dimensions Quickly</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-rectangular-grids">rectangular grids</a>:</td><td> </td><td valign="top"><a href="#Irregular-grids">Irregular grids</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-recursion">recursion</a>:</td><td> </td><td valign="top"><a href="#Subsetting-Files">Subsetting Files</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-recursive">recursive</a>:</td><td> </td><td valign="top"><a href="#Subsetting-Files">Subsetting Files</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-regex"><code>regex</code></a>:</td><td> </td><td valign="top"><a href="#Subsetting-Files">Subsetting Files</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-regression">regression</a>:</td><td> </td><td valign="top"><a href="#Annual-Average-over-Regions">Annual Average over Regions</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-regressions-archive">regressions archive</a>:</td><td> </td><td valign="top"><a href="#Help-Requests-and-Bug-Reports">Help Requests and Bug Reports</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-regrid">regrid</a>:</td><td> </td><td valign="top"><a href="#Regrid-MODIS-Data">Regrid MODIS Data</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-regular-expressions">regular expressions</a>:</td><td> </td><td valign="top"><a href="#Large-Numbers-of-Files">Large Numbers of Files</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-regular-expressions-1">regular expressions</a>:</td><td> </td><td valign="top"><a href="#Specifying-Input-Files">Specifying Input Files</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-regular-expressions-2">regular expressions</a>:</td><td> </td><td valign="top"><a href="#Subsetting-Files">Subsetting Files</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-regular-expressions-3">regular expressions</a>:</td><td> </td><td valign="top"><a href="#Examples-ncap2">Examples ncap2</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-regular-expressions-4">regular expressions</a>:</td><td> </td><td valign="top"><a href="#ncatted-netCDF-Attribute-Editor">ncatted netCDF Attribute Editor</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-regular-expressions-5">regular expressions</a>:</td><td> </td><td valign="top"><a href="#ncatted-netCDF-Attribute-Editor">ncatted netCDF Attribute Editor</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-remap"><code>remap</code></a>:</td><td> </td><td valign="top"><a href="#Sort-methods">Sort methods</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-Remik-Ziemlinski">Remik Ziemlinski</a>:</td><td> </td><td valign="top"><a href="#Contributors">Contributors</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-remote-files">remote files</a>:</td><td> </td><td valign="top"><a href="#Windows-Operating-System">Windows Operating System</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-remote-files-1">remote files</a>:</td><td> </td><td valign="top"><a href="#Remote-storage">Remote storage</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-rename-groups">rename groups</a>:</td><td> </td><td valign="top"><a href="#Group-Path-Editing">Group Path Editing</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-renaming-attributes">renaming attributes</a>:</td><td> </td><td valign="top"><a href="#ncrename-netCDF-Renamer">ncrename netCDF Renamer</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-renaming-attributes-1">renaming attributes</a>:</td><td> </td><td valign="top"><a href="#Regrid-MODIS-Data">Regrid MODIS Data</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-renaming-dimensions">renaming dimensions</a>:</td><td> </td><td valign="top"><a href="#ncrename-netCDF-Renamer">ncrename netCDF Renamer</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-renaming-dimensions-1">renaming dimensions</a>:</td><td> </td><td valign="top"><a href="#Regrid-MODIS-Data">Regrid MODIS Data</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-renaming-groups">renaming groups</a>:</td><td> </td><td valign="top"><a href="#ncrename-netCDF-Renamer">ncrename netCDF Renamer</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-renaming-variables">renaming variables</a>:</td><td> </td><td valign="top"><a href="#ncrename-netCDF-Renamer">ncrename netCDF Renamer</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-renaming-variables-1">renaming variables</a>:</td><td> </td><td valign="top"><a href="#Annual-Average-over-Regions">Annual Average over Regions</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-renaming-variables-2">renaming variables</a>:</td><td> </td><td valign="top"><a href="#Regrid-MODIS-Data">Regrid MODIS Data</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-reporting-bugs">reporting bugs</a>:</td><td> </td><td valign="top"><a href="#Help-Requests-and-Bug-Reports">Help Requests and Bug Reports</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-reshape-variables">reshape variables</a>:</td><td> </td><td valign="top"><a href="#ncpdq-netCDF-Permute-Dimensions-Quickly">ncpdq netCDF Permute Dimensions Quickly</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-restrict"><code>restrict</code></a>:</td><td> </td><td valign="top"><a href="#Compatability">Compatability</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-reverse-data">reverse data</a>:</td><td> </td><td valign="top"><a href="#ncpdq-netCDF-Permute-Dimensions-Quickly">ncpdq netCDF Permute Dimensions Quickly</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-reverse-dimensions">reverse dimensions</a>:</td><td> </td><td valign="top"><a href="#ncpdq-netCDF-Permute-Dimensions-Quickly">ncpdq netCDF Permute Dimensions Quickly</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-reverse-dimensions-1">reverse dimensions</a>:</td><td> </td><td valign="top"><a href="#ncpdq-netCDF-Permute-Dimensions-Quickly">ncpdq netCDF Permute Dimensions Quickly</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-reverse-dimensions-2">reverse dimensions</a>:</td><td> </td><td valign="top"><a href="#ncpdq-netCDF-Permute-Dimensions-Quickly">ncpdq netCDF Permute Dimensions Quickly</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-reverse_0028_0029">reverse()</a>:</td><td> </td><td valign="top"><a href="#Arrays-and-hyperslabs">Arrays and hyperslabs</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-rew">‘<samp>rew</samp>’</a>:</td><td> </td><td valign="top"><a href="#Chunking">Chunking</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-rint"><var>rint</var></a>:</td><td> </td><td valign="top"><a href="#Intrinsic-mathematical-methods">Intrinsic mathematical methods</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-rms"><code>rms</code></a>:</td><td> </td><td valign="top"><a href="#Operation-Types">Operation Types</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-rmssdn"><code>rmssdn</code></a>:</td><td> </td><td valign="top"><a href="#Operation-Types">Operation Types</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-rmssdn_0028_0029">rmssdn()</a>:</td><td> </td><td valign="top"><a href="#Methods-and-functions">Methods and functions</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-root_002dmean_002dsquare">root-mean-square</a>:</td><td> </td><td valign="top"><a href="#Operation-Types">Operation Types</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-Rorik-Peterson">Rorik Peterson</a>:</td><td> </td><td valign="top"><a href="#Contributors">Contributors</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-round"><var>round</var></a>:</td><td> </td><td valign="top"><a href="#Intrinsic-mathematical-methods">Intrinsic mathematical methods</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-rounding">rounding</a>:</td><td> </td><td valign="top"><a href="#Promoting-Single_002dprecision-to-Double">Promoting Single-precision to Double</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-rounding-functions">rounding functions</a>:</td><td> </td><td valign="top"><a href="#Intrinsic-mathematical-methods">Intrinsic mathematical methods</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-RPM"><acronym>RPM</acronym></a>:</td><td> </td><td valign="top"><a href="#netCDF2_002f3_002f4-and-HDF4_002f5-Support">netCDF2/3/4 and HDF4/5 Support</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-running-average">running average</a>:</td><td> </td><td valign="top"><a href="#ncra-netCDF-Record-Averager">ncra netCDF Record Averager</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-Russ-Rew">Russ Rew</a>:</td><td> </td><td valign="top"><a href="#Contributors">Contributors</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-Russ-Rew-1">Russ Rew</a>:</td><td> </td><td valign="top"><a href="#Contributors">Contributors</a></td></tr>
<tr><td colspan="4"> <hr></td></tr>
<tr><th><a name="General-Index_cp_letter-S">S</a></th><td></td><td></td></tr>
<tr><td></td><td valign="top"><a href="#index-safeguards">safeguards</a>:</td><td> </td><td valign="top"><a href="#Temporary-Output-Files">Temporary Output Files</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-safeguards-1">safeguards</a>:</td><td> </td><td valign="top"><a href="#ncrename-netCDF-Renamer">ncrename netCDF Renamer</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-scale_005ffactor"><code>scale_factor</code></a>:</td><td> </td><td valign="top"><a href="#Packed-data">Packed data</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-scale_005ffactor-1"><code>scale_factor</code></a>:</td><td> </td><td valign="top"><a href="#ncecat-netCDF-Ensemble-Concatenator">ncecat netCDF Ensemble Concatenator</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-scale_005ffactor-2"><code>scale_factor</code></a>:</td><td> </td><td valign="top"><a href="#ncpdq-netCDF-Permute-Dimensions-Quickly">ncpdq netCDF Permute Dimensions Quickly</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-scale_005ffactor-3"><code>scale_factor</code></a>:</td><td> </td><td valign="top"><a href="#ncrcat-netCDF-Record-Concatenator">ncrcat netCDF Record Concatenator</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-scale_005fformat"><var>scale_format</var></a>:</td><td> </td><td valign="top"><a href="#Performance">Performance</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-scaling">scaling</a>:</td><td> </td><td valign="top"><a href="#Performance">Performance</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-scaling-1">scaling</a>:</td><td> </td><td valign="top"><a href="#ncflint-netCDF-File-Interpolator">ncflint netCDF File Interpolator</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-Scientific-Data-Operators">Scientific Data Operators</a>:</td><td> </td><td valign="top"><a href="#Proposals-for-Institutional-Funding">Proposals for Institutional Funding</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-scl">‘<samp>scl</samp>’</a>:</td><td> </td><td valign="top"><a href="#Chunking">Chunking</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-Scott-Capps">Scott Capps</a>:</td><td> </td><td valign="top"><a href="#Contributors">Contributors</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-scp"><code>scp</code></a>:</td><td> </td><td valign="top"><a href="#Windows-Operating-System">Windows Operating System</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-scp-1"><code>scp</code></a>:</td><td> </td><td valign="top"><a href="#Remote-storage">Remote storage</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-script-file">script file</a>:</td><td> </td><td valign="top"><a href="#ncap2-netCDF-Arithmetic-Processor">ncap2 netCDF Arithmetic Processor</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-SDO"><acronym>SDO</acronym></a>:</td><td> </td><td valign="top"><a href="#Proposals-for-Institutional-Funding">Proposals for Institutional Funding</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-seasonal-average">seasonal average</a>:</td><td> </td><td valign="top"><a href="#Monthly-data-in-one-file">Monthly data in one file</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-security">security</a>:</td><td> </td><td valign="top"><a href="#MD5-digests">MD5 digests</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-SEIII"><acronym>SEIII</acronym></a>:</td><td> </td><td valign="top"><a href="#Proposals-for-Institutional-Funding">Proposals for Institutional Funding</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-semi_002dcolon">semi-colon</a>:</td><td> </td><td valign="top"><a href="#Syntax-of-ncap2-statements">Syntax of ncap2 statements</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-separator">separator</a>:</td><td> </td><td valign="top"><a href="#ncks-netCDF-Kitchen-Sink">ncks netCDF Kitchen Sink</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-server">server</a>:</td><td> </td><td valign="top"><a href="#Large-Datasets">Large Datasets</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-server-1">server</a>:</td><td> </td><td valign="top"><a href="#OPeNDAP">OPeNDAP</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-server-2">server</a>:</td><td> </td><td valign="top"><a href="#Retaining-Retrieved-Files">Retaining Retrieved Files</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-server-3">server</a>:</td><td> </td><td valign="top"><a href="#Retaining-Retrieved-Files">Retaining Retrieved Files</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-Server_002dSide-Distributed-Data-Reduction-_0026-Analysis">Server-Side Distributed Data Reduction & Analysis</a>:</td><td> </td><td valign="top"><a href="#Proposals-for-Institutional-Funding">Proposals for Institutional Funding</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-server_002dside-processing">server-side processing</a>:</td><td> </td><td valign="top"><a href="#OPeNDAP">OPeNDAP</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-server_002dside-processing-1">server-side processing</a>:</td><td> </td><td valign="top"><a href="#Proposals-for-Institutional-Funding">Proposals for Institutional Funding</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-set_005fmiss_0028_0029"><code>set_miss()</code></a>:</td><td> </td><td valign="top"><a href="#Missing-values-ncap2">Missing values ncap2</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-sftp"><code>sftp</code></a>:</td><td> </td><td valign="top"><a href="#Windows-Operating-System">Windows Operating System</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-sftp-1"><code>sftp</code></a>:</td><td> </td><td valign="top"><a href="#Remote-storage">Remote storage</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-SGI"><acronym>SGI</acronym></a>:</td><td> </td><td valign="top"><a href="#Compatability">Compatability</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-Sh-shell">Sh shell</a>:</td><td> </td><td valign="top"><a href="#Filters-for-ncks">Filters for <code>ncks</code></a></td></tr>
<tr><td></td><td valign="top"><a href="#index-shared-memory-machines">shared memory machines</a>:</td><td> </td><td valign="top"><a href="#Memory-Requirements">Memory Requirements</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-shared-memory-parallelism">shared memory parallelism</a>:</td><td> </td><td valign="top"><a href="#OpenMP-Threading">OpenMP Threading</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-shell">shell</a>:</td><td> </td><td valign="top"><a href="#Large-Numbers-of-Files">Large Numbers of Files</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-shell-1">shell</a>:</td><td> </td><td valign="top"><a href="#Subsetting-Files">Subsetting Files</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-shell-2">shell</a>:</td><td> </td><td valign="top"><a href="#UDUnits-Support">UDUnits Support</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-shell-3">shell</a>:</td><td> </td><td valign="top"><a href="#Examples-ncap2">Examples ncap2</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-shell-4">shell</a>:</td><td> </td><td valign="top"><a href="#ncbo-netCDF-Binary-Operator">ncbo netCDF Binary Operator</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-shell-5">shell</a>:</td><td> </td><td valign="top"><a href="#Filters-for-ncks">Filters for <code>ncks</code></a></td></tr>
<tr><td></td><td valign="top"><a href="#index-signedness"><var>signedness</var></a>:</td><td> </td><td valign="top"><a href="#Performance">Performance</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-sin"><var>sin</var></a>:</td><td> </td><td valign="top"><a href="#Intrinsic-mathematical-methods">Intrinsic mathematical methods</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-sine-function">sine function</a>:</td><td> </td><td valign="top"><a href="#Intrinsic-mathematical-methods">Intrinsic mathematical methods</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-single_002dprecision">single-precision</a>:</td><td> </td><td valign="top"><a href="#Intrinsic-mathematical-methods">Intrinsic mathematical methods</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-sinh"><var>sinh</var></a>:</td><td> </td><td valign="top"><a href="#Intrinsic-mathematical-methods">Intrinsic mathematical methods</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-size_0028_0029">size()</a>:</td><td> </td><td valign="top"><a href="#Methods-and-functions">Methods and functions</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-SMP"><acronym>SMP</acronym></a>:</td><td> </td><td valign="top"><a href="#OpenMP-Threading">OpenMP Threading</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-sort"><code>sort</code></a>:</td><td> </td><td valign="top"><a href="#Sort-methods">Sort methods</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-sort-alphabetically">sort alphabetically</a>:</td><td> </td><td valign="top"><a href="#ncks-netCDF-Kitchen-Sink">ncks netCDF Kitchen Sink</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-sort-alphabetically-1">sort alphabetically</a>:</td><td> </td><td valign="top"><a href="#Filters-for-ncks">Filters for <code>ncks</code></a></td></tr>
<tr><td></td><td valign="top"><a href="#index-source-code">source code</a>:</td><td> </td><td valign="top"><a href="#Availability">Availability</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-spatial-distribution">spatial distribution</a>:</td><td> </td><td valign="top"><a href="#Global-Distribution-of-Long_002dterm-Average">Global Distribution of Long-term Average</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-special-attributes">special attributes</a>:</td><td> </td><td valign="top"><a href="#ncks-netCDF-Kitchen-Sink">ncks netCDF Kitchen Sink</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-special-characters">special characters</a>:</td><td> </td><td valign="top"><a href="#ncatted-netCDF-Attribute-Editor">ncatted netCDF Attribute Editor</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-speed">speed</a>:</td><td> </td><td valign="top"><a href="#Libraries">Libraries</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-speed-1">speed</a>:</td><td> </td><td valign="top"><a href="#Temporary-Output-Files">Temporary Output Files</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-speed-2">speed</a>:</td><td> </td><td valign="top"><a href="#Large-Datasets">Large Datasets</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-speed-3">speed</a>:</td><td> </td><td valign="top"><a href="#Performance">Performance</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-speed-4">speed</a>:</td><td> </td><td valign="top"><a href="#Metadata-Optimization">Metadata Optimization</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-speed-5">speed</a>:</td><td> </td><td valign="top"><a href="#Missing-Values">Missing Values</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-speed-6">speed</a>:</td><td> </td><td valign="top"><a href="#ncrename-netCDF-Renamer">ncrename netCDF Renamer</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-sqravg"><code>sqravg</code></a>:</td><td> </td><td valign="top"><a href="#Operation-Types">Operation Types</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-sqravg_0028_0029">sqravg()</a>:</td><td> </td><td valign="top"><a href="#Methods-and-functions">Methods and functions</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-sqrt"><code>sqrt</code></a>:</td><td> </td><td valign="top"><a href="#Operation-Types">Operation Types</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-sqrt-1"><var>sqrt</var></a>:</td><td> </td><td valign="top"><a href="#Intrinsic-mathematical-methods">Intrinsic mathematical methods</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-square-root-function">square root function</a>:</td><td> </td><td valign="top"><a href="#Intrinsic-mathematical-methods">Intrinsic mathematical methods</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-SSDDRA"><acronym>SSDDRA</acronym></a>:</td><td> </td><td valign="top"><a href="#Proposals-for-Institutional-Funding">Proposals for Institutional Funding</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-SSH"><acronym>SSH</acronym></a>:</td><td> </td><td valign="top"><a href="#Windows-Operating-System">Windows Operating System</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-SSH-1"><acronym>SSH</acronym></a>:</td><td> </td><td valign="top"><a href="#Retaining-Retrieved-Files">Retaining Retrieved Files</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-sshort_0028_0029">sshort()</a>:</td><td> </td><td valign="top"><a href="#Methods-and-functions">Methods and functions</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-standard-deviation">standard deviation</a>:</td><td> </td><td valign="top"><a href="#Operation-Types">Operation Types</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-standard-deviation-1">standard deviation</a>:</td><td> </td><td valign="top"><a href="#Operation-Types">Operation Types</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-standard-deviation-2">standard deviation</a>:</td><td> </td><td valign="top"><a href="#Annual-Average-over-Regions">Annual Average over Regions</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-standard-input">standard input</a>:</td><td> </td><td valign="top"><a href="#Large-Numbers-of-Files">Large Numbers of Files</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-standard-input-1">standard input</a>:</td><td> </td><td valign="top"><a href="#nces-netCDF-Ensemble-Statistics">nces netCDF Ensemble Statistics</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-standard-input-2">standard input</a>:</td><td> </td><td valign="top"><a href="#ncecat-netCDF-Ensemble-Concatenator">ncecat netCDF Ensemble Concatenator</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-standard-input-3">standard input</a>:</td><td> </td><td valign="top"><a href="#ncra-netCDF-Record-Averager">ncra netCDF Record Averager</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-standard-input-4">standard input</a>:</td><td> </td><td valign="top"><a href="#ncrcat-netCDF-Record-Concatenator">ncrcat netCDF Record Concatenator</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-standard_005fname"><code>standard_name</code></a>:</td><td> </td><td valign="top"><a href="#Auxiliary-Coordinates">Auxiliary Coordinates</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-stat_0028_0029-system-call"><code>stat() system call</code></a>:</td><td> </td><td valign="top"><a href="#Buffer-sizes">Buffer sizes</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-statement">statement</a>:</td><td> </td><td valign="top"><a href="#Syntax-of-ncap2-statements">Syntax of ncap2 statements</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-static-linking">static linking</a>:</td><td> </td><td valign="top"><a href="#Libraries">Libraries</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-stdin"><code>stdin</code></a>:</td><td> </td><td valign="top"><a href="#Large-Numbers-of-Files">Large Numbers of Files</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-stdin-1"><code>stdin</code></a>:</td><td> </td><td valign="top"><a href="#File-List-Attributes">File List Attributes</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-stdin-2"><code>stdin</code></a>:</td><td> </td><td valign="top"><a href="#nces-netCDF-Ensemble-Statistics">nces netCDF Ensemble Statistics</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-stdin-3"><code>stdin</code></a>:</td><td> </td><td valign="top"><a href="#ncecat-netCDF-Ensemble-Concatenator">ncecat netCDF Ensemble Concatenator</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-stdin-4"><code>stdin</code></a>:</td><td> </td><td valign="top"><a href="#ncra-netCDF-Record-Averager">ncra netCDF Record Averager</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-stdin-5"><code>stdin</code></a>:</td><td> </td><td valign="top"><a href="#ncrcat-netCDF-Record-Concatenator">ncrcat netCDF Record Concatenator</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-Steve-Emmerson">Steve Emmerson</a>:</td><td> </td><td valign="top"><a href="#Contributors">Contributors</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-stride">stride</a>:</td><td> </td><td valign="top"><a href="#Hyperslabs">Hyperslabs</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-stride-1">stride</a>:</td><td> </td><td valign="top"><a href="#Stride">Stride</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-stride-2">stride</a>:</td><td> </td><td valign="top"><a href="#Multislabs">Multislabs</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-stride-3">stride</a>:</td><td> </td><td valign="top"><a href="#UDUnits-Support">UDUnits Support</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-stride-4">stride</a>:</td><td> </td><td valign="top"><a href="#ncra-netCDF-Record-Averager">ncra netCDF Record Averager</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-stride-5">stride</a>:</td><td> </td><td valign="top"><a href="#ncra-netCDF-Record-Averager">ncra netCDF Record Averager</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-stride-6">stride</a>:</td><td> </td><td valign="top"><a href="#ncrcat-netCDF-Record-Concatenator">ncrcat netCDF Record Concatenator</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-stride-7">stride</a>:</td><td> </td><td valign="top"><a href="#ncrcat-netCDF-Record-Concatenator">ncrcat netCDF Record Concatenator</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-strings">strings</a>:</td><td> </td><td valign="top"><a href="#ncatted-netCDF-Attribute-Editor">ncatted netCDF Attribute Editor</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-Stu-Muller">Stu Muller</a>:</td><td> </td><td valign="top"><a href="#Contributors">Contributors</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-stub">stub</a>:</td><td> </td><td valign="top"><a href="#Remote-storage">Remote storage</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-sub_002dcycle">sub-cycle</a>:</td><td> </td><td valign="top"><a href="#Subcycle">Subcycle</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-subcycle">subcycle</a>:</td><td> </td><td valign="top"><a href="#Subcycle">Subcycle</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-subsetting">subsetting</a>:</td><td> </td><td valign="top"><a href="#Subsetting-Files">Subsetting Files</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-subsetting-1">subsetting</a>:</td><td> </td><td valign="top"><a href="#Subsetting-Coordinate-Variables">Subsetting Coordinate Variables</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-subsetting-2">subsetting</a>:</td><td> </td><td valign="top"><a href="#CF-Conventions">CF Conventions</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-subsetting-3">subsetting</a>:</td><td> </td><td valign="top"><a href="#Filters-for-ncks">Filters for <code>ncks</code></a></td></tr>
<tr><td></td><td valign="top"><a href="#index-subsetting-4">subsetting</a>:</td><td> </td><td valign="top"><a href="#Filters-for-ncks">Filters for <code>ncks</code></a></td></tr>
<tr><td></td><td valign="top"><a href="#index-subtract"><code>subtract</code></a>:</td><td> </td><td valign="top"><a href="#ncbo-netCDF-Binary-Operator">ncbo netCDF Binary Operator</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-subtracting-data">subtracting data</a>:</td><td> </td><td valign="top"><a href="#ncbo-netCDF-Binary-Operator">ncbo netCDF Binary Operator</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-subtraction">subtraction</a>:</td><td> </td><td valign="top"><a href="#Intrinsic-mathematical-methods">Intrinsic mathematical methods</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-subtraction-1">subtraction</a>:</td><td> </td><td valign="top"><a href="#ncbo-netCDF-Binary-Operator">ncbo netCDF Binary Operator</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-summary">summary</a>:</td><td> </td><td valign="top"><a href="#Summary">Summary</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-Sun">Sun</a>:</td><td> </td><td valign="top"><a href="#Compatability">Compatability</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-swap-space">swap space</a>:</td><td> </td><td valign="top"><a href="#Large-Datasets">Large Datasets</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-swap-space-1">swap space</a>:</td><td> </td><td valign="top"><a href="#Memory-Requirements">Memory Requirements</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-swap-space-2">swap space</a>:</td><td> </td><td valign="top"><a href="#RAM-disks">RAM disks</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-switches">switches</a>:</td><td> </td><td valign="top"><a href="#Command-Line-Options">Command Line Options</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-symbolic-links">symbolic links</a>:</td><td> </td><td valign="top"><a href="#Symbolic-Links">Symbolic Links</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-symbolic-links-1">symbolic links</a>:</td><td> </td><td valign="top"><a href="#Statistics-vs_002e-Concatenation">Statistics vs. Concatenation</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-symbolic-links-2">symbolic links</a>:</td><td> </td><td valign="top"><a href="#Large-Numbers-of-Files">Large Numbers of Files</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-symbolic-links-3">symbolic links</a>:</td><td> </td><td valign="top"><a href="#ncbo-netCDF-Binary-Operator">ncbo netCDF Binary Operator</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-symbolic-links-4">symbolic links</a>:</td><td> </td><td valign="top"><a href="#ncpdq-netCDF-Permute-Dimensions-Quickly">ncpdq netCDF Permute Dimensions Quickly</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-synchronous-file-access">synchronous file access</a>:</td><td> </td><td valign="top"><a href="#Remote-storage">Remote storage</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-synonym">synonym</a>:</td><td> </td><td valign="top"><a href="#Symbolic-Links">Symbolic Links</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-syntax">syntax</a>:</td><td> </td><td valign="top"><a href="#Syntax-of-ncap2-statements">Syntax of ncap2 statements</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-System-calls">System calls</a>:</td><td> </td><td valign="top"><a href="#Buffer-sizes">Buffer sizes</a></td></tr>
<tr><td colspan="4"> <hr></td></tr>
<tr><th><a name="General-Index_cp_letter-T">T</a></th><td></td><td></td></tr>
<tr><td></td><td valign="top"><a href="#index-Takeshi-Enomoto">Takeshi Enomoto</a>:</td><td> </td><td valign="top"><a href="#Contributors">Contributors</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-tan"><var>tan</var></a>:</td><td> </td><td valign="top"><a href="#Intrinsic-mathematical-methods">Intrinsic mathematical methods</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-tanh"><var>tanh</var></a>:</td><td> </td><td valign="top"><a href="#Intrinsic-mathematical-methods">Intrinsic mathematical methods</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-temporary-files">temporary files</a>:</td><td> </td><td valign="top"><a href="#Temporary-Output-Files">Temporary Output Files</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-temporary-files-1">temporary files</a>:</td><td> </td><td valign="top"><a href="#RAM-disks">RAM disks</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-temporary-output-files">temporary output files</a>:</td><td> </td><td valign="top"><a href="#Temporary-Output-Files">Temporary Output Files</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-temporary-output-files-1">temporary output files</a>:</td><td> </td><td valign="top"><a href="#RAM-disks">RAM disks</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-temporary-output-files-2">temporary output files</a>:</td><td> </td><td valign="top"><a href="#ncrename-netCDF-Renamer">ncrename netCDF Renamer</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-TeXinfo">TeXinfo</a>:</td><td> </td><td valign="top"><a href="#Availability">Availability</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-threads">threads</a>:</td><td> </td><td valign="top"><a href="#Memory-Requirements">Memory Requirements</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-threads-1">threads</a>:</td><td> </td><td valign="top"><a href="#Single-and-Multi_002dfile-Operators">Single and Multi-file Operators</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-threads-2">threads</a>:</td><td> </td><td valign="top"><a href="#OpenMP-Threading">OpenMP Threading</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-thr_005fnbr"><var>thr_nbr</var></a>:</td><td> </td><td valign="top"><a href="#OpenMP-Threading">OpenMP Threading</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-time"><code>time</code></a>:</td><td> </td><td valign="top"><a href="#UDUnits-Support">UDUnits Support</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-time-1"><code>time</code></a>:</td><td> </td><td valign="top"><a href="#ARM-Conventions">ARM Conventions</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-time_002daveraging">time-averaging</a>:</td><td> </td><td valign="top"><a href="#Examples-ncap2">Examples ncap2</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-time_002daveraging-1">time-averaging</a>:</td><td> </td><td valign="top"><a href="#Daily-data-in-one-file">Daily data in one file</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-time_002daveraging-2">time-averaging</a>:</td><td> </td><td valign="top"><a href="#Daily-data-in-one-file">Daily data in one file</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-time_002daveraging-3">time-averaging</a>:</td><td> </td><td valign="top"><a href="#Monthly-data-in-one-file">Monthly data in one file</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-time_002daveraging-4">time-averaging</a>:</td><td> </td><td valign="top"><a href="#Monthly-data-in-one-file">Monthly data in one file</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-time_002daveraging-5">time-averaging</a>:</td><td> </td><td valign="top"><a href="#One-time-point-one-file">One time point one file</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-time_002daveraging-6">time-averaging</a>:</td><td> </td><td valign="top"><a href="#Global-Distribution-of-Long_002dterm-Average">Global Distribution of Long-term Average</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-time_002daveraging-7">time-averaging</a>:</td><td> </td><td valign="top"><a href="#Annual-Average-over-Regions">Annual Average over Regions</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-time_002daveraging-8">time-averaging</a>:</td><td> </td><td valign="top"><a href="#Monthly-Cycle">Monthly Cycle</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-timestamp">timestamp</a>:</td><td> </td><td valign="top"><a href="#History-Attribute">History Attribute</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-time_005foffset"><code>time_offset</code></a>:</td><td> </td><td valign="top"><a href="#ARM-Conventions">ARM Conventions</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-total">total</a>:</td><td> </td><td valign="top"><a href="#Operation-Types">Operation Types</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-transpose">transpose</a>:</td><td> </td><td valign="top"><a href="#C-and-Fortran-Index-Conventions">C and Fortran Index Conventions</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-transpose-1">transpose</a>:</td><td> </td><td valign="top"><a href="#ncpdq-netCDF-Permute-Dimensions-Quickly">ncpdq netCDF Permute Dimensions Quickly</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-TREFHT"><acronym>TREFHT</acronym></a>:</td><td> </td><td valign="top"><a href="#Promoting-Single_002dprecision-to-Double">Promoting Single-precision to Double</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-trunc"><var>trunc</var></a>:</td><td> </td><td valign="top"><a href="#Intrinsic-mathematical-methods">Intrinsic mathematical methods</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-trunc_0028_0029"><code>trunc()</code></a>:</td><td> </td><td valign="top"><a href="#Automatic-type-conversion">Automatic type conversion</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-truncate-_0028groups_0029">truncate (groups)</a>:</td><td> </td><td valign="top"><a href="#Group-Path-Editing">Group Path Editing</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-truncation-function">truncation function</a>:</td><td> </td><td valign="top"><a href="#Intrinsic-mathematical-methods">Intrinsic mathematical methods</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-truth-condition">truth condition</a>:</td><td> </td><td valign="top"><a href="#Mask-condition">Mask condition</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-truth-condition-1">truth condition</a>:</td><td> </td><td valign="top"><a href="#Normalization-and-Integration">Normalization and Integration</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-ttl"><code>ttl</code></a>:</td><td> </td><td valign="top"><a href="#Operation-Types">Operation Types</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-ttl_0028_0029">ttl()</a>:</td><td> </td><td valign="top"><a href="#Methods-and-functions">Methods and functions</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-type-conversion">type conversion</a>:</td><td> </td><td valign="top"><a href="#Type-Conversion">Type Conversion</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-type_0028_0029">type()</a>:</td><td> </td><td valign="top"><a href="#Methods-and-functions">Methods and functions</a></td></tr>
<tr><td colspan="4"> <hr></td></tr>
<tr><th><a name="General-Index_cp_letter-U">U</a></th><td></td><td></td></tr>
<tr><td></td><td valign="top"><a href="#index-ubyte_0028_0029">ubyte()</a>:</td><td> </td><td valign="top"><a href="#Methods-and-functions">Methods and functions</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-UDUnits">UDUnits</a>:</td><td> </td><td valign="top"><a href="#Compatability">Compatability</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-UDUnits-1">UDUnits</a>:</td><td> </td><td valign="top"><a href="#UDUnits-Support">UDUnits Support</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-UDUnits-2">UDUnits</a>:</td><td> </td><td valign="top"><a href="#CF-Conventions">CF Conventions</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-uint_0028_0029">uint()</a>:</td><td> </td><td valign="top"><a href="#Methods-and-functions">Methods and functions</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-ulimit"><code>ulimit</code></a>:</td><td> </td><td valign="top"><a href="#Large-Datasets">Large Datasets</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-unary-operations">unary operations</a>:</td><td> </td><td valign="top"><a href="#Memory-for-ncap2">Memory for ncap2</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-underlying-file-format">underlying file format</a>:</td><td> </td><td valign="top"><a href="#Determining-File-Format">Determining File Format</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-UNICOS"><acronym>UNICOS</acronym></a>:</td><td> </td><td valign="top"><a href="#Large-Datasets">Large Datasets</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-Unidata">Unidata</a>:</td><td> </td><td valign="top"><a href="#Compatability">Compatability</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-Unidata-1">Unidata</a>:</td><td> </td><td valign="top"><a href="#netCDF2_002f3_002f4-and-HDF4_002f5-Support">netCDF2/3/4 and HDF4/5 Support</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-Unidata-2">Unidata</a>:</td><td> </td><td valign="top"><a href="#UDUnits-Support">UDUnits Support</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-union">union</a>:</td><td> </td><td valign="top"><a href="#Subsetting-Files">Subsetting Files</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-union-1">union</a>:</td><td> </td><td valign="top"><a href="#Subsetting-Files">Subsetting Files</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-union-of-files">union of files</a>:</td><td> </td><td valign="top"><a href="#Appending-Variables">Appending Variables</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-unit64_0028_0029">unit64()</a>:</td><td> </td><td valign="top"><a href="#Methods-and-functions">Methods and functions</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-units"><code>units</code></a>:</td><td> </td><td valign="top"><a href="#UDUnits-Support">UDUnits Support</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-units-1"><code>units</code></a>:</td><td> </td><td valign="top"><a href="#UDUnits-Support">UDUnits Support</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-units-2"><code>units</code></a>:</td><td> </td><td valign="top"><a href="#UDUnits-Support">UDUnits Support</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-units-3"><code>units</code></a>:</td><td> </td><td valign="top"><a href="#ncatted-netCDF-Attribute-Editor">ncatted netCDF Attribute Editor</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-units-4"><code>units</code></a>:</td><td> </td><td valign="top"><a href="#ncatted-netCDF-Attribute-Editor">ncatted netCDF Attribute Editor</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-units-5"><code>units</code></a>:</td><td> </td><td valign="top"><a href="#ncflint-netCDF-File-Interpolator">ncflint netCDF File Interpolator</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-UNIX"><acronym>UNIX</acronym></a>:</td><td> </td><td valign="top"><a href="#Compatability">Compatability</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-UNIX-1"><acronym>UNIX</acronym></a>:</td><td> </td><td valign="top"><a href="#Windows-Operating-System">Windows Operating System</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-UNIX-2"><acronym>UNIX</acronym></a>:</td><td> </td><td valign="top"><a href="#Large-Numbers-of-Files">Large Numbers of Files</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-UNIX-3"><acronym>UNIX</acronym></a>:</td><td> </td><td valign="top"><a href="#Command-Line-Options">Command Line Options</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-UNIX-4"><acronym>UNIX</acronym></a>:</td><td> </td><td valign="top"><a href="#Specifying-Input-Files">Specifying Input Files</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-UNIX-5"><acronym>UNIX</acronym></a>:</td><td> </td><td valign="top"><a href="#Filters-for-ncks">Filters for <code>ncks</code></a></td></tr>
<tr><td></td><td valign="top"><a href="#index-unlimited-dimension">unlimited dimension</a>:</td><td> </td><td valign="top"><a href="#ncecat-netCDF-Ensemble-Concatenator">ncecat netCDF Ensemble Concatenator</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-unmap"><code>unmap</code></a>:</td><td> </td><td valign="top"><a href="#Sort-methods">Sort methods</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-unpack_0028_0029">unpack()</a>:</td><td> </td><td valign="top"><a href="#Methods-and-functions">Methods and functions</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-unpack_0028x_0029"><code>unpack(x)</code></a>:</td><td> </td><td valign="top"><a href="#Packed-data">Packed data</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-unpacking">unpacking</a>:</td><td> </td><td valign="top"><a href="#OPeNDAP">OPeNDAP</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-unpacking-1">unpacking</a>:</td><td> </td><td valign="top"><a href="#Packed-data">Packed data</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-unpacking-2">unpacking</a>:</td><td> </td><td valign="top"><a href="#ncecat-netCDF-Ensemble-Concatenator">ncecat netCDF Ensemble Concatenator</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-unpacking-3">unpacking</a>:</td><td> </td><td valign="top"><a href="#ncpdq-netCDF-Permute-Dimensions-Quickly">ncpdq netCDF Permute Dimensions Quickly</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-unpacking-4">unpacking</a>:</td><td> </td><td valign="top"><a href="#ncrcat-netCDF-Record-Concatenator">ncrcat netCDF Record Concatenator</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-URL"><acronym>URL</acronym></a>:</td><td> </td><td valign="top"><a href="#Remote-storage">Remote storage</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-User-Guide"><cite>User Guide</cite></a>:</td><td> </td><td valign="top"><a href="#Availability">Availability</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-ushort_0028_0029">ushort()</a>:</td><td> </td><td valign="top"><a href="#Methods-and-functions">Methods and functions</a></td></tr>
<tr><td colspan="4"> <hr></td></tr>
<tr><th><a name="General-Index_cp_letter-V">V</a></th><td></td><td></td></tr>
<tr><td></td><td valign="top"><a href="#index-value-list">value list</a>:</td><td> </td><td valign="top"><a href="#Attributes">Attributes</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-variable-names">variable names</a>:</td><td> </td><td valign="top"><a href="#ncrename-netCDF-Renamer">ncrename netCDF Renamer</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-variables_002c-appending">variables, appending</a>:</td><td> </td><td valign="top"><a href="#Annual-Average-over-Regions">Annual Average over Regions</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-variance">variance</a>:</td><td> </td><td valign="top"><a href="#Operation-Types">Operation Types</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-version">version</a>:</td><td> </td><td valign="top"><a href="#Operator-Version">Operator Version</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-Vista-_0028Microsoft-operating-system_0029">Vista (Microsoft operating system)</a>:</td><td> </td><td valign="top"><a href="#Windows-Operating-System">Windows Operating System</a></td></tr>
<tr><td colspan="4"> <hr></td></tr>
<tr><th><a name="General-Index_cp_letter-W">W</a></th><td></td><td></td></tr>
<tr><td></td><td valign="top"><a href="#index-weighted-average">weighted average</a>:</td><td> </td><td valign="top"><a href="#ncwa-netCDF-Weighted-Averager">ncwa netCDF Weighted Averager</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-weighted-average-1">weighted average</a>:</td><td> </td><td valign="top"><a href="#Monthly-Cycle">Monthly Cycle</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-Wenshan-Wang">Wenshan Wang</a>:</td><td> </td><td valign="top"><a href="#Contributors">Contributors</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-wget"><code>wget</code></a>:</td><td> </td><td valign="top"><a href="#Remote-storage">Remote storage</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-where_0028_0029">where()</a>:</td><td> </td><td valign="top"><a href="#Where-statement">Where statement</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-while_0028_0029">while()</a>:</td><td> </td><td valign="top"><a href="#Loops">Loops</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-whitespace">whitespace</a>:</td><td> </td><td valign="top"><a href="#UDUnits-Support">UDUnits Support</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-wildcards">wildcards</a>:</td><td> </td><td valign="top"><a href="#Specifying-Input-Files">Specifying Input Files</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-wildcards-1">wildcards</a>:</td><td> </td><td valign="top"><a href="#Subsetting-Files">Subsetting Files</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-wildcards-2">wildcards</a>:</td><td> </td><td valign="top"><a href="#ncatted-netCDF-Attribute-Editor">ncatted netCDF Attribute Editor</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-wildcards-3">wildcards</a>:</td><td> </td><td valign="top"><a href="#ncatted-netCDF-Attribute-Editor">ncatted netCDF Attribute Editor</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-WIN32"><code>WIN32</code></a>:</td><td> </td><td valign="top"><a href="#Windows-Operating-System">Windows Operating System</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-Windows">Windows</a>:</td><td> </td><td valign="top"><a href="#Compatability">Compatability</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-Windows-1">Windows</a>:</td><td> </td><td valign="top"><a href="#Windows-Operating-System">Windows Operating System</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-wrapped-coordinates">wrapped coordinates</a>:</td><td> </td><td valign="top"><a href="#Hyperslabs">Hyperslabs</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-wrapped-coordinates-1">wrapped coordinates</a>:</td><td> </td><td valign="top"><a href="#Wrapped-Coordinates">Wrapped Coordinates</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-wrapped-coordinates-2">wrapped coordinates</a>:</td><td> </td><td valign="top"><a href="#Irregular-grids">Irregular grids</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-wrapped-coordinates-3">wrapped coordinates</a>:</td><td> </td><td valign="top"><a href="#Filters-for-ncks">Filters for <code>ncks</code></a></td></tr>
<tr><td></td><td valign="top"><a href="#index-wrapped-filenames">wrapped filenames</a>:</td><td> </td><td valign="top"><a href="#Specifying-Input-Files">Specifying Input Files</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-WRF"><acronym>WRF</acronym></a>:</td><td> </td><td valign="top"><a href="#Irregular-grids">Irregular grids</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-WWW-documentation">WWW documentation</a>:</td><td> </td><td valign="top"><a href="#Availability">Availability</a></td></tr>
<tr><td colspan="4"> <hr></td></tr>
<tr><th><a name="General-Index_cp_letter-X">X</a></th><td></td><td></td></tr>
<tr><td></td><td valign="top"><a href="#index-xargs"><code>xargs</code></a>:</td><td> </td><td valign="top"><a href="#Large-Numbers-of-Files">Large Numbers of Files</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-xargs-1"><code>xargs</code></a>:</td><td> </td><td valign="top"><a href="#Specifying-Output-Files">Specifying Output Files</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-xlC"><code>xlC</code></a>:</td><td> </td><td valign="top"><a href="#Compatability">Compatability</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-xlc"><code>xlc</code></a>:</td><td> </td><td valign="top"><a href="#Compatability">Compatability</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-XML"><acronym>XML</acronym></a>:</td><td> </td><td valign="top"><a href="#ncks-netCDF-Kitchen-Sink">ncks netCDF Kitchen Sink</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-XP-_0028Microsoft-operating-system_0029">XP (Microsoft operating system)</a>:</td><td> </td><td valign="top"><a href="#Windows-Operating-System">Windows Operating System</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-xpl">‘<samp>xpl</samp>’</a>:</td><td> </td><td valign="top"><a href="#Chunking">Chunking</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-xst">‘<samp>xst</samp>’</a>:</td><td> </td><td valign="top"><a href="#Chunking">Chunking</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-xst-1">‘<samp>xst</samp>’</a>:</td><td> </td><td valign="top"><a href="#Chunking">Chunking</a></td></tr>
<tr><td colspan="4"> <hr></td></tr>
<tr><th><a name="General-Index_cp_letter-Y">Y</a></th><td></td><td></td></tr>
<tr><td></td><td valign="top"><a href="#index-Yorick">Yorick</a>:</td><td> </td><td valign="top"><a href="#Philosophy">Philosophy</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-Yorick-1">Yorick</a>:</td><td> </td><td valign="top"><a href="#Performance">Performance</a></td></tr>
<tr><td colspan="4"> <hr></td></tr>
</table>
<table><tr><th valign="top">Jump to: </th><td><a class="summary-letter" href="#General-Index_cp_symbol-1"><b>"</b></a>
<a class="summary-letter" href="#General-Index_cp_symbol-2"><b>#</b></a>
<a class="summary-letter" href="#General-Index_cp_symbol-3"><b>$</b></a>
<a class="summary-letter" href="#General-Index_cp_symbol-4"><b>%</b></a>
<a class="summary-letter" href="#General-Index_cp_symbol-5"><b>'</b></a>
<a class="summary-letter" href="#General-Index_cp_symbol-6"><b>*</b></a>
<a class="summary-letter" href="#General-Index_cp_symbol-7"><b>+</b></a>
<a class="summary-letter" href="#General-Index_cp_symbol-8"><b>-</b></a>
<a class="summary-letter" href="#General-Index_cp_symbol-9"><b>.</b></a>
<a class="summary-letter" href="#General-Index_cp_symbol-10"><b>/</b></a>
<a class="summary-letter" href="#General-Index_cp_symbol-11"><b>0</b></a>
<a class="summary-letter" href="#General-Index_cp_symbol-12"><b>3</b></a>
<a class="summary-letter" href="#General-Index_cp_symbol-13"><b>6</b></a>
<a class="summary-letter" href="#General-Index_cp_symbol-14"><b>:</b></a>
<a class="summary-letter" href="#General-Index_cp_symbol-15"><b>;</b></a>
<a class="summary-letter" href="#General-Index_cp_symbol-16"><b><</b></a>
<a class="summary-letter" href="#General-Index_cp_symbol-17"><b>?</b></a>
<a class="summary-letter" href="#General-Index_cp_symbol-18"><b>@</b></a>
<a class="summary-letter" href="#General-Index_cp_symbol-19"><b>[</b></a>
<a class="summary-letter" href="#General-Index_cp_symbol-20"><b>\</b></a>
<a class="summary-letter" href="#General-Index_cp_symbol-21"><b>^</b></a>
<a class="summary-letter" href="#General-Index_cp_symbol-22"><b>_</b></a>
<a class="summary-letter" href="#General-Index_cp_symbol-23"><b>|</b></a>
<br>
<a class="summary-letter" href="#General-Index_cp_letter-A"><b>A</b></a>
<a class="summary-letter" href="#General-Index_cp_letter-B"><b>B</b></a>
<a class="summary-letter" href="#General-Index_cp_letter-C"><b>C</b></a>
<a class="summary-letter" href="#General-Index_cp_letter-D"><b>D</b></a>
<a class="summary-letter" href="#General-Index_cp_letter-E"><b>E</b></a>
<a class="summary-letter" href="#General-Index_cp_letter-F"><b>F</b></a>
<a class="summary-letter" href="#General-Index_cp_letter-G"><b>G</b></a>
<a class="summary-letter" href="#General-Index_cp_letter-H"><b>H</b></a>
<a class="summary-letter" href="#General-Index_cp_letter-I"><b>I</b></a>
<a class="summary-letter" href="#General-Index_cp_letter-J"><b>J</b></a>
<a class="summary-letter" href="#General-Index_cp_letter-K"><b>K</b></a>
<a class="summary-letter" href="#General-Index_cp_letter-L"><b>L</b></a>
<a class="summary-letter" href="#General-Index_cp_letter-M"><b>M</b></a>
<a class="summary-letter" href="#General-Index_cp_letter-N"><b>N</b></a>
<a class="summary-letter" href="#General-Index_cp_letter-O"><b>O</b></a>
<a class="summary-letter" href="#General-Index_cp_letter-P"><b>P</b></a>
<a class="summary-letter" href="#General-Index_cp_letter-Q"><b>Q</b></a>
<a class="summary-letter" href="#General-Index_cp_letter-R"><b>R</b></a>
<a class="summary-letter" href="#General-Index_cp_letter-S"><b>S</b></a>
<a class="summary-letter" href="#General-Index_cp_letter-T"><b>T</b></a>
<a class="summary-letter" href="#General-Index_cp_letter-U"><b>U</b></a>
<a class="summary-letter" href="#General-Index_cp_letter-V"><b>V</b></a>
<a class="summary-letter" href="#General-Index_cp_letter-W"><b>W</b></a>
<a class="summary-letter" href="#General-Index_cp_letter-X"><b>X</b></a>
<a class="summary-letter" href="#General-Index_cp_letter-Y"><b>Y</b></a>
</td></tr></table>
<div class="footnote">
<hr>
<h4 class="footnotes-heading">Footnotes</h4>
<h3><a name="FOOT1" href="#DOCF1">(1)</a></h3>
<p>To produce these formats, <samp>nco.texi</samp> was simply run through the
freely available programs <code>texi2dvi</code>, <code>dvips</code>,
<code>texi2html</code>, and <code>makeinfo</code>.
Due to a bug in TeX, the resulting Postscript file, <samp>nco.ps</samp>,
contains the Table of Contents as the final pages.
Thus if you print <samp>nco.ps</samp>, remember to insert the Table of
Contents after the cover sheet before you staple the manual.
</p>
<h3><a name="FOOT2" href="#DOCF2">(2)</a></h3>
<p>The ‘<samp>_BSD_SOURCE</samp>’ token is required on some Linux platforms where
<code>gcc</code> dislikes the network header files like
<samp>netinet/in.h</samp>).</p>
<h3><a name="FOOT3" href="#DOCF3">(3)</a></h3>
<p><acronym>NCO</acronym> may still build with an
<acronym>ANSI</acronym> or <acronym>ISO</acronym> C89 or C94/95-compliant compiler if the
C <span class="nolinebreak">pre-processor</span><!-- /@w --> undefines the <code>restrict</code> type qualifier, e.g.,
by invoking the compiler with ‘<samp>-Drestrict=''</samp>’.</p>
<h3><a name="FOOT4" href="#DOCF4">(4)</a></h3>
<p>The Cygwin package is available from<br>
<code>http://sourceware.redhat.com/cygwin</code><br>
<a name="index-gcc-1"></a>
<a name="index-g_002b_002b-1"></a>
Currently, Cygwin 20.x<!-- /@w --> comes with the <acronym>GNU</acronym> C/C++
compilers (<code>gcc</code>, <code>g++</code>.
These <acronym>GNU</acronym> compilers may be used to build the netCDF
distribution itself.</p>
<h3><a name="FOOT5" href="#DOCF5">(5)</a></h3>
<p>The <code>ldd</code> command, if it is available on your system,
will tell you where the executable is looking for each dynamically
loaded library. Use, e.g., <code>ldd `which nces`</code>.</p>
<h3><a name="FOOT6" href="#DOCF6">(6)</a></h3>
<p>The Hierarchical Data Format, or <acronym>HDF</acronym>, is another
self-describing data format similar to, but more elaborate than,
netCDF.
<acronym>HDF</acronym> comes in two flavors, <acronym>HDF4</acronym> and <acronym>HDF5</acronym>.
Often people use the shorthand <acronym>HDF</acronym> to refer to the older
format <acronym>HDF4</acronym>.
People almost always use <acronym>HDF5</acronym> to refer to <acronym>HDF5</acronym>.</p>
<h3><a name="FOOT7" href="#DOCF7">(7)</a></h3>
<p>One must link the <acronym>NCO</acronym> code to the <acronym>HDF4</acronym>
<acronym>MFHDF</acronym> library instead of the usual netCDF library.
Apparently ‘<samp>MF</samp>’ stands for Multi-file not for Mike Folk.
In any case, until about 2007 the <acronym>MFHDF</acronym> library only supported
netCDF2<!-- /@w --> calls.
Most people will never again install <acronym>NCO</acronym> 1.2.x and so will
never use <acronym>NCO</acronym> to write <acronym>HDF4</acronym> files.
It is simply too much trouble.</p>
<h3><a name="FOOT8" href="#DOCF8">(8)</a></h3>
<p>The procedure for doing this is documented at
<a href="http://www.unidata.ucar.edu/software/netcdf/docs/build_hdf4.html">http://www.unidata.ucar.edu/software/netcdf/docs/build_hdf4.html</a>.</p>
<h3><a name="FOOT9" href="#DOCF9">(9)</a></h3>
<p>Prior to <acronym>NCO</acronym> version 4.4.0 (January, 2014), we recommend the
<code>ncl_convert2nc</code> tool to convert <acronym>HDF</acronym> to netCDF3 when
both these are true: 1. You<!-- /@w --> must have netCDF3 and 2. the<!-- /@w -->
<acronym>HDF</acronym> file contains netCDF4 atomic types.
More recent versions of <acronym>NCO</acronym> handle this problem fine, so we
no longer recommend <code>ncl_convert2nc</code> because <code>ncks</code>
is faster and more space-efficient.
Both automatically convert netCDF4 types to netCDF3 types, yet
<code>ncl_convert2nc</code> cannot produce full netCDF4 files.
In contrast, <code>ncks</code> will happily convert <acronym>HDF</acronym> straight
to netCDF4 files with netCDF4 types.
Hence <code>ncks</code> can and does preserve the variable types.
Unsigned bytes stay unsigned bytes.
64-bit integers stay 64-bit integers.
Strings stay strings.
Hence, <code>ncks</code> conversions often result in smaller files than
<code>ncl_convert2nc</code> conversions.</p>
<h3><a name="FOOT10" href="#DOCF10">(10)</a></h3>
<p>The <code>ncrename</code> and <code>ncatted</code> operators are
exceptions to this rule.
See <a href="#ncrename-netCDF-Renamer">ncrename netCDF Renamer</a>.</p>
<h3><a name="FOOT11" href="#DOCF11">(11)</a></h3>
<p>The OS-specific system move command is used.
This is <code>mv</code> for UNIX, and <code>move</code> for Windows.</p>
<h3><a name="FOOT12" href="#DOCF12">(12)</a></h3>
<p>The terminology <em>merging</em> is
reserved for an (unwritten) operator which replaces hyperslabs of a
variable in one file with hyperslabs of the same variable from another
file</p>
<h3><a name="FOOT13" href="#DOCF13">(13)</a></h3>
<p>Yes, the terminology is confusing.
By all means mail me if you think of a better nomenclature.
Should <acronym>NCO</acronym> use <em>paste</em> instead of <em>append</em>?
</p>
<h3><a name="FOOT14" href="#DOCF14">(14)</a></h3>
<p>Currently
<code>nces</code> and <code>ncrcat</code> are symbolically linked to the
<code>ncra</code> executable, which behaves slightly differently based on
its invocation name (i.e., ‘<samp>argv[0]</samp>’).
These three operators share the same source code, and merely have
different inner loops.</p>
<h3><a name="FOOT15" href="#DOCF15">(15)</a></h3>
<p>The third averaging operator, <code>ncwa</code>, is the most
sophisticated averager in <acronym>NCO</acronym>.
However, <code>ncwa</code> is in a different class than <code>ncra</code> and
<code>nces</code> because it operates on a single file per invocation (as
opposed to multiple files).
On that single file, however, <code>ncwa</code> provides a richer set of
averaging options—including weighting, masking, and broadcasting.</p>
<h3><a name="FOOT16" href="#DOCF16">(16)</a></h3>
<p>The exact length which exceeds the operating system internal
limit for command line lengths varies from <acronym>OS</acronym> to <acronym>OS</acronym>
and from shell to shell.
<acronym>GNU</acronym> <code>bash</code> may not have any arbitrary fixed limits to the
size of command line arguments.
Many <acronym>OS</acronym>s cannot handle command line arguments (including
results of file globbing) exceeding 4096 characters.</p>
<h3><a name="FOOT17" href="#DOCF17">(17)</a></h3>
<p>If a <code>getopt_long</code> function cannot be found on the system,
<acronym>NCO</acronym> will use the <code>getopt_long</code> from the
<code>my_getopt</code> package by Benjamin Sittler
<a href="mailto:bsittler@iname.com">bsittler@iname.com</a>.
This is <acronym>BSD</acronym>-licensed software available from
<a href="http://www.geocities.com/ResearchTriangle/Node/9405/#my_getopt">http://www.geocities.com/ResearchTriangle/Node/9405/#my_getopt</a>.</p>
<h3><a name="FOOT18" href="#DOCF18">(18)</a></h3>
<p>The ‘<samp>-n</samp>’ option is a backward compatible superset of the
<code>NINTAP</code> option from the <acronym>NCAR</acronym> <acronym>CCM</acronym> Processor.</p>
<h3><a name="FOOT19" href="#DOCF19">(19)</a></h3>
<p><acronym>NCO</acronym> does not implement command line options to
specify <acronym>FTP</acronym> logins and passwords because copying those data
into the <code>history</code> global attribute in the output file (done by
default) poses an unacceptable security risk.
</p>
<h3><a name="FOOT20" href="#DOCF20">(20)</a></h3>
<p>The <code>hsi</code> command must be in the user’s path in one of
the following directories: <code>/usr/local/bin</code>, <code>/opt/hpss/bin</code>,
or <code>/ncar/opt/hpss/hsi</code>.
Tell us if the <acronym>HPSS</acronym> installation at your site places the
<code>hsi</code> command in a different location, and we will add that
location to the list of acceptable paths to search for <code>hsi</code>.
</p>
<h3><a name="FOOT21" href="#DOCF21">(21)</a></h3>
<p><acronym>NCO</acronym> supported the old <acronym>NCAR</acronym> Mass Storage
System (<acronym>MSS</acronym>) until version 4.0.7 in April, 2011.
<acronym>NCO</acronym> supported <acronym>MSS</acronym>-retrievals via a variety of
mechanisms including the <code>msread</code>, <code>msrcp</code>, and
<code>nrnet</code> commands invoked either automatically or with sentinels
like <code>ncks -p mss:/ZENDER/nco -l . in.nc</code>.
Once the <acronym>MSS</acronym> was decommissioned in March, 2011, support for
these retrieval mechanisms was replaced by support for <acronym>HPSS</acronym>
in <acronym>NCO</acronym>.
</p>
<h3><a name="FOOT22" href="#DOCF22">(22)</a></h3>
<a name="index-NVODS"></a>
<a name="index-National-Virtual-Ocean-Data-System"></a>
<a name="index-open-source-1"></a>
<p><acronym>DODS</acronym> is being deprecated because it is ambiguous, referring
both to a protocol and to a collection of (oceanography) data.
It is superceded by two terms.
<acronym>DAP</acronym> is the discipline-neutral Data Access Protocol at the
heart of <acronym>DODS</acronym>.
The National Virtual Ocean Data System (<acronym>NVODS</acronym>) refers to the
collection of oceanography data and oceanographic extensions to
<acronym>DAP</acronym>.
In other words, <acronym>NVODS</acronym> is implemented with <acronym>OPeNDAP</acronym>.
<acronym>OPeNDAP</acronym> is <em>also</em> the open source project which
maintains, develops, and promulgates the <acronym>DAP</acronym> standard.
<acronym>OPeNDAP</acronym> and <acronym>DAP</acronym> really are interchangeable.
Got it yet?</p>
<h3><a name="FOOT23" href="#DOCF23">(23)</a></h3>
<p>Automagic support for <acronym>DODS</acronym> version 3.2.x was deprecated in
December, 2003 after <acronym>NCO</acronym> version 2.8.4.
<acronym>NCO</acronym> support for <acronym>OPeNDAP</acronym> versions 3.4.x commenced in
December, 2003, with <acronym>NCO</acronym> version 2.8.5.
<acronym>NCO</acronym> support for <acronym>OPeNDAP</acronym> versions 3.5.x commenced in
June, 2005, with <acronym>NCO</acronym> version 3.0.1.
<acronym>NCO</acronym> support for <acronym>OPeNDAP</acronym> versions 3.6.x commenced in
June, 2006, with <acronym>NCO</acronym> version 3.1.3.
<acronym>NCO</acronym> support for <acronym>OPeNDAP</acronym> versions 3.7.x commenced in
January, 2007, with <acronym>NCO</acronym> version 3.1.9.</p>
<h3><a name="FOOT24" href="#DOCF24">(24)</a></h3>
<p>The minimal set of libraries required to build <acronym>NCO</acronym> as
<acronym>OPeNDAP</acronym> clients, where <acronym>OPeNDAP</acronym> is supplied as a
separate library apart from <samp>libnetcdf.a</samp>, are, in link order,
<samp>libnc-dap.a</samp>, <samp>libdap.a</samp>, and
<samp>libxml2</samp> and <samp>libcurl.a</samp>.</p>
<h3><a name="FOOT25" href="#DOCF25">(25)</a></h3>
<p>We are most familiar with the <acronym>OPeNDAP</acronym> ability to enable
network-transparent data access.
<a name="index-constraint-expressions"></a>
<a name="index-server_002dside-processing"></a>
<acronym>OPeNDAP</acronym> has many other features, including sophisticated
hyperslabbing and server-side processing via <em>constraint expressions</em>.
If you know more about this, please consider writing a section
on "<acronym>OPeNDAP</acronym> Capabilities of Interest to <acronym>NCO</acronym> Users"
for incorporation in the <cite>NCO User Guide</cite>.</p>
<h3><a name="FOOT26" href="#DOCF26">(26)</a></h3>
<p>The reason (and mnemonic) for ‘<samp>-7</samp>’ is that <code>NETCDF4_CLASSIC</code>
files include great features of both netCDF3 (compatibility) and
netCDF4 (compression, chunking) and, well, <em>3+4=7</em>.</p>
<h3><a name="FOOT27" href="#DOCF27">(27)</a></h3>
<p>Linux and <acronym>AIX</acronym> do support <acronym>LFS</acronym>.</p>
<h3><a name="FOOT28" href="#DOCF28">(28)</a></h3>
<p>Intersection-mode can also be explicitly invoked with the ‘<samp>--nsx</samp>’
or ‘<samp>--intersection</samp>’ switches.
These switches are supplied for clarity and consistency and do
absolutely nothing since intersection-mode is the default.</p>
<h3><a name="FOOT29" href="#DOCF29">(29)</a></h3>
<p>Note that the <samp>-3</samp> switch should appear <em>after</em> the
<samp>-G</samp> and <samp>-g</samp> switches.
This is due to an artifact of the <acronym>GPE</acronym> implementation which we
wish to remove in the future.</p>
<h3><a name="FOOT30" href="#DOCF30">(30)</a></h3>
<p>CFchecker is developed by Michael Decker and Martin Schultz at
Forschungszentrum Jülich and distributed at
<a href="https://bitbucket.org/mde_/cfchecker">https://bitbucket.org/mde_/cfchecker</a>.</p>
<h3><a name="FOOT31" href="#DOCF31">(31)</a></h3>
<p>When originally released in 2012 this was called the
<em>duration feature</em>, and was abbreviated <acronym>DRN</acronym>.</p>
<h3><a name="FOOT32" href="#DOCF32">(32)</a></h3>
<p>The old functionality, i.e., where the ignored values are indicated by
<code>missing_value</code> not <code>_FillValue</code>, may still be selected
<em>at <acronym>NCO</acronym> build time</em> by compiling <acronym>NCO</acronym>
with the token definition
<kbd>CPPFLAGS='-UNCO_USE_FILL_VALUE'</kbd>.
</p>
<h3><a name="FOOT33" href="#DOCF33">(33)</a></h3>
<p>For example, the <acronym>DOE</acronym> <acronym>ARM</acronym> program often
uses <var>att_type</var> = <code>NC_CHAR</code> and <var>_FillValue</var> =
‘<samp>-99999.</samp>’.
</p>
<h3><a name="FOOT34" href="#DOCF34">(34)</a></h3>
<p>On modern Linux systems the block size defaults to 8192 B<!-- /@w -->.
The GLADE filesystem at NCAR has a block size of 512 kB<!-- /@w -->.</p>
<h3><a name="FOOT35" href="#DOCF35">(35)</a></h3>
<p>Although not a part of the standard, <acronym>NCO</acronym> enforces
the policy that the <code>_FillValue</code> attribute, if any, of a packed
variable is also stored at the original precision.</p>
<h3><a name="FOOT36" href="#DOCF36">(36)</a></h3>
<p><em>32767 = 2^15-1</em>
</p>
<h3><a name="FOOT37" href="#DOCF37">(37)</a></h3>
<p>Operators began performing automatic type conversions before
arithmetic in <acronym>NCO</acronym> version 1.2<!-- /@w -->, August, 2000.
Previous versions never performed unnecessary type conversion for
arithmetic.</p>
<h3><a name="FOOT38" href="#DOCF38">(38)</a></h3>
<a name="index-C-language-2"></a>
<p>The actual type conversions with trunction were handled by intrinsic
type conversion, so the <code>trunc()</code> function was never explicitly
called, although the results would be the same if it were.</p>
<h3><a name="FOOT39" href="#DOCF39">(39)</a></h3>
<p>According to Wikipedia’s summary of <acronym>IEEE</acronym> standard
754, “If a decimal string with at most 6 significant digits is
converted to IEEE 754 single-precision and then converted back to the
same number of significant decimal, then the final string should match
the original; and if an IEEE 754 single-precision is converted to a
decimal string with at least 9 significant decimal and then converted
back to single, then the final number must match the original”.</p>
<h3><a name="FOOT40" href="#DOCF40">(40)</a></h3>
<p>According to Wikipedia’s summary of <acronym>IEEE</acronym> standard
754, “If a decimal string with at most 15 significant digits is
converted to IEEE 754 double-precision representation and then converted
back to a string with the same number of significant digits, then the
final string should match the original; and if an IEEE 754 double
precision is converted to a decimal string with at least 17 significant
digits and then converted back to double, then the final number must
match the original”.</p>
<h3><a name="FOOT41" href="#DOCF41">(41)</a></h3>
<p>See page 21<!-- /@w --> in Section 1.2 of the First edition for this
gem:
</p><blockquote>
<p>One does not need much experience in scientific computing to recognize
that the implicit conversion rules are, in fact, sheer madness!
In effect, they make it impossible to write efficient numerical
programs.
</p></blockquote>
<h3><a name="FOOT42" href="#DOCF42">(42)</a></h3>
<p>For example, the <acronym>CMIP5</acronym> archive tends to distribute
monthly average timeseries in 50-year chunks.</p>
<h3><a name="FOOT43" href="#DOCF43">(43)</a></h3>
<a name="index-Michael-Prather"></a>
<p>Thanks to Michael J.<!-- /@w --> Prather for explaining this to me.</p>
<h3><a name="FOOT44" href="#DOCF44">(44)</a></h3>
<p>The exception is appending/altering the attributes <code>x_op</code>,
<code>y_op</code>, <code>z_op</code>, and <code>t_op</code> for variables which have been
averaged across space and time dimensions.
This feature is scheduled for future inclusion in <acronym>NCO</acronym>.
</p>
<h3><a name="FOOT45" href="#DOCF45">(45)</a></h3>
<p>The <acronym>CF</acronym> conventions recommend <code>time</code> be stored in the
format <var>time</var> since <var>base_time</var>, e.g., the <code>units</code>
attribute of <code>time</code> might be
‘<samp>days since 1992-10-8 15:15:42.5 -6:00</samp>’.
A problem<!-- /@w --> with this format occurs when using <code>ncrcat</code> to
concatenate multiple files, each with a different <var>base_time</var>.
That is, any <code>time</code> values from files following the first file to
be concatenated should be corrected to the <var>base_time</var> offset
specified in the <code>units</code> attribute of <code>time</code> from the first
file.
The analogous problem has been fixed in <acronym>ARM</acronym> files
(see <a href="#ARM-Conventions">ARM Conventions</a>) and could be fixed for <acronym>CF</acronym> files if
there is sufficient lobbying.
</p>
<h3><a name="FOOT46" href="#DOCF46">(46)</a></h3>
<p><code>ncap2</code> is the successor to <code>ncap</code> which was
put into maintenance mode in November, 2006.
This documentation refers to <code>ncap2</code>, which has a superset of
the <code>ncap</code> functionality.
Eventually <code>ncap</code> will be deprecated in favor <code>ncap2</code>.
<code>ncap2</code> may be renamed <code>ncap</code> in 2013.</p>
<h3><a name="FOOT47" href="#DOCF47">(47)</a></h3>
<p>These are the <acronym>GSL</acronym> standard function names postfixed with
<code>_e</code>.
<acronym>NCO</acronym> calls these functions automatically, without the
<acronym>NCO</acronym> command having to specifically indicate the <code>_e</code>
function suffix.
</p>
<h3><a name="FOOT48" href="#DOCF48">(48)</a></h3>
<p>ANSI C<!-- /@w --> compilers are guaranteed to support double-precision versions
of these functions.
These functions normally operate on netCDF variables of type <code>NC_DOUBLE</code>
without having to perform intrinsic conversions.
For example, <acronym>ANSI</acronym> compilers provide <code>sin</code> for the sine of C-type
<code>double</code> variables.
The <acronym>ANSI</acronym> standard does not require, but many compilers provide,
an extended set of mathematical functions that apply to single
(<code>float</code>) and quadruple (<code>long double</code>) precision variables.
Using these functions (e.g., <code>sinf</code> for <code>float</code>,
<code>sinl</code> for <code>long double</code>), when available, is (presumably)
more efficient than casting variables to type <code>double</code>,
performing the operation, and then re-casting.
<acronym>NCO</acronym> uses the faster intrinsic functions when they are
available, and uses the casting method when they are not.
</p>
<h3><a name="FOOT49" href="#DOCF49">(49)</a></h3>
<p>Linux supports more of these intrinsic functions than
other OSs.</p>
<h3><a name="FOOT50" href="#DOCF50">(50)</a></h3>
<p>A naked<!-- /@w --> (i.e., unprotected or unquoted) ‘<samp>*</samp>’ is a
wildcard character.
A naked<!-- /@w --> ‘<samp>-</samp>’ may confuse the command line parser.
A naked<!-- /@w --> ‘<samp>+</samp>’ and ‘<samp>/</samp>’ are relatively harmless.</p>
<h3><a name="FOOT51" href="#DOCF51">(51)</a></h3>
<p>The widely used shell Bash correctly interprets all these
special characters even when they are not quoted.
That is, Bash does not prevent <acronym>NCO</acronym> from correctly interpreting
the intended arithmetic operation when the following arguments are given
(without quotes) to <code>ncbo</code>:
‘<samp>--op_typ=+</samp>’, ‘<samp>--op_typ=-</samp>’, ‘<samp>--op_typ=*</samp>’,
and ‘<samp>--op_typ=/</samp>’</p>
<h3><a name="FOOT52" href="#DOCF52">(52)</a></h3>
<p>The command to do this is ‘<samp>ln -s -f ncbo ncadd</samp>’</p>
<h3><a name="FOOT53" href="#DOCF53">(53)</a></h3>
<p>The command to do this is ‘<samp>alias ncadd='ncbo --op_typ=add'</samp>’</p>
<h3><a name="FOOT54" href="#DOCF54">(54)</a></h3>
<p>Prior to <acronym>NCO</acronym> version 4.3.1 (May, 2013), <code>ncbo</code>
would only broadcast variables in <var>file_2</var> to conform to
<var>file_1</var>.
Variables in <var>file_1</var> were <em>never</em> broadcast to conform to the
dimensions in <var>file_2</var>.</p>
<h3><a name="FOOT55" href="#DOCF55">(55)</a></h3>
<p>This is because <code>ncra</code> collapses the record dimension
to a size of 1<!-- /@w --> (making it a <em>degenerate</em> dimension), but does
not remove it, while, unless ‘<samp>-b</samp>’ is given, <code>ncwa</code> removes
all averaged dimensions.
In other words, by default <code>ncra</code> changes variable size though
not rank, while, <code>ncwa</code> changes both variable size and rank.</p>
<h3><a name="FOOT56" href="#DOCF56">(56)</a></h3>
<p>The old ncea command was deprecated in <acronym>NCO</acronym> version 4.3.9,
released December, 2013.
<acronym>NCO</acronym> will attempt to maintain back-compatibility and work
as expected with invocations of <code>ncea</code> for as long as possible.
Please replace <code>ncea</code> by <code>nces</code> in all future work.</p>
<h3><a name="FOOT57" href="#DOCF57">(57)</a></h3>
<p>As of <acronym>NCO</acronym> version 4.4.2 (released February, 2014)
<code>nces</code> allows hyperslabs in all dimensions so long as the
hyperslabs resolve to the same size.
The fixed (i.e., non-record) dimensions should be the same size in
all ensemble members both before and after hyperslabbing, although
the hypserslabs may (and usually do) change the size of the dimensions
from the input to the output files.
Prior to this, <code>nces</code> was only guaranteed to work on hyperslabs
in the record dimension that resolved to the same size.</p>
<h3><a name="FOOT58" href="#DOCF58">(58)</a></h3>
<p>Those familiar with netCDF mechanics might wish to know what is
happening here: <code>ncks</code> does not attempt to redefine the variable
in <var>output-file</var> to match its definition in <var>input-file</var>,
<code>ncks</code> merely copies the values of the variable and its
coordinate dimensions, if any, from <var>input-file</var> to
<var>output-file</var>.
</p>
<h3><a name="FOOT59" href="#DOCF59">(59)</a></h3>
<p>This limitation, imposed by the netCDF storage layer,
may be relaxed in the future with netCDF4.</p>
<h3><a name="FOOT60" href="#DOCF60">(60)</a></h3>
<p>Prior to <acronym>NCO</acronym> 4.4.0 and netCDF 4.3.1 (January, 2014),
<acronym>NCO</acronym> requires the ‘<samp>--hdf4</samp>’ switch to correctly read
HDF4 input files.
For example, ‘<samp>ncpdq --hdf4 --hdf_upk -P xst_new modis.hdf modis.nc</samp>’.
That switch is now obsolete, though harmless for backwards compatibility.
Prior to version 4.3.7 (October, 2013), <acronym>NCO</acronym> lacked the
software necessary to workaround netCDF library flaws handling
<acronym>HDF4</acronym> files, and thus <acronym>NCO</acronym> failed to convert
<acronym>HDF4</acronym> files to netCDF files.
In those cases, use the <code>ncl_convert2nc</code> command distributed
with <acronym>NCL</acronym> to convert <acronym>HDF4</acronym> files to netCDF.</p>
<h3><a name="FOOT61" href="#DOCF61">(61)</a></h3>
<p><code>ncpdq</code> does not support packing data using the
<acronym>HDF</acronym> convention.
Although it is now straightforward to support this, we think it might
sow more confusion than it reaps.
Let us know if you disagree and would like <acronym>NCO</acronym> to support
packing data with <acronym>HDF</acronym> algorithm.</p>
<h3><a name="FOOT62" href="#DOCF62">(62)</a></h3>
<p>The default behavior of (‘<samp>-I</samp>’) changed on
19981201—before this date the default was not to weight or mask
coordinate variables.</p>
<h3><a name="FOOT63" href="#DOCF63">(63)</a></h3>
<p>If <code>lat_wgt</code> contains Gaussian weights then the value of
<code>latitude</code> in the <var>output-file</var> will be the area-weighted
centroid of the hyperslab.
For the example given, this is about 30 degrees.<!-- /@w --></p>
<h3><a name="FOOT64" href="#DOCF64">(64)</a></h3>
<p>The three switches ‘<samp>-m</samp>’, ‘<samp>-T</samp>’, and ‘<samp>-M</samp>’ are
maintained for backward compatibility and may be deprecated in the
future.
It is safest to write scripts using ‘<samp>--mask_condition</samp>’.</p>
<h3><a name="FOOT65" href="#DOCF65">(65)</a></h3>
<p><code>gw</code> stands for <em>Gaussian weight</em> in many
climate models.</p>
<h3><a name="FOOT66" href="#DOCF66">(66)</a></h3>
<p><code>ORO</code> stands for <em>Orography</em> in some climate models
and in those models <em><var>ORO</var> < 0.5</em> selects ocean gridpoints.</p>
<h3><a name="FOOT67" href="#DOCF67">(67)</a></h3>
<p>Unfortunately the ‘<samp>-B</samp>’ and ‘<samp>--mask_condition</samp>’
options are unsupported on Windows (with the <acronym>MVS</acronym> compiler),
which lacks a free, standard parser and lexer.</p>
<h3><a name="FOOT68" href="#DOCF68">(68)</a></h3>
<a name="index-chocolate"></a>
<p>Happy users have sent me a few gifts, though.
This includes a box of imported chocolate.
Mmm.
Appreciation and gifts are definitely better than money.
Naturally, I’m too lazy to split and send gifts to the other developers.
However, unlike some <acronym>NCO</acronym> developers, I have a steady "real job".
My intent is to split monetary donations among the active developers
and to send them their shares via PayPal.</p>
</div>
<hr>
</body>
</html>
|