/usr/include/pnetcdf is in libpnetcdf-dev 1.7.0~pre1-1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
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 | //
// generic include file for the PnetCDF C++ API
//
using namespace std;
#include <exception>
#include <string>
#include <typeinfo>
#include <vector>
#include <set>
#include <map>
#include <pnetcdf.h>
extern int
ncmpi_insert_compound(int ncid, nc_type xtype, const char *name,
MPI_Offset offset, nc_type field_typeid);
/* Insert a named array into a compound type. */
extern int
ncmpi_insert_array_compound(int ncid, nc_type xtype, const char *name,
MPI_Offset offset, nc_type field_typeid,
int ndims, const int *dim_sizes);
extern int
ncmpi_insert_enum(int ncid, nc_type xtype, const char *name,
const void *value);
extern int
ncmpi_def_compound(int ncid, MPI_Offset size, const char *name, nc_type *typeidp);
extern int
ncmpi_inq_enum(int ncid, nc_type xtype, char *name, nc_type *base_nc_typep,
MPI_Offset *base_sizep, MPI_Offset *num_membersp);
/* Get information about an enum member: a name and value. Name size
* * will be <= NC_MAX_NAME. */
extern int
ncmpi_inq_enum_member(int ncid, nc_type xtype, int idx, char *name,
void *value);
extern int
ncmpi_inq_enum_ident(int ncid, nc_type xtype, long long value, char *identifier);
extern int
ncmpi_inq_compound_nfields(int ncid, nc_type xtype, MPI_Offset *nfieldsp);
extern int
ncmpi_inq_compound_name(int ncid, nc_type xtype, char *name);
/* Get the size of a compound type. */
extern int
ncmpi_inq_compound_size(int ncid, nc_type xtype, MPI_Offset *sizep);
/* Get the number of fields in this compound type. */
extern int
ncmpi_inq_compound_nfields(int ncid, nc_type xtype, MPI_Offset *nfieldsp);
/* Given the xtype and the fieldid, get all info about it. */
extern int
ncmpi_inq_compound_field(int ncid, nc_type xtype, int fieldid, char *name,
MPI_Offset *offsetp, nc_type *field_typeidp, int *ndimsp,
int *dim_sizesp);
/* Given the typeid and the fieldid, get the name. */
extern int
ncmpi_inq_compound_fieldname(int ncid, nc_type xtype, int fieldid,
char *name);
extern int
ncmpi_inq_compound(int ncid, nc_type xtype, char *name, MPI_Offset *sizep,
MPI_Offset *nfieldsp);
/* Given the xtype and the name, get the fieldid. */
extern int
ncmpi_inq_compound_fieldindex(int ncid, nc_type xtype, const char *name,
int *fieldidp);
/* Given the xtype and fieldid, get the offset. */
extern int
ncmpi_inq_compound_fieldoffset(int ncid, nc_type xtype, int fieldid,
MPI_Offset *offsetp);
/* Given the xtype and the fieldid, get the type of that field. */
extern int
ncmpi_inq_compound_fieldtype(int ncid, nc_type xtype, int fieldid,
nc_type *field_typeidp);
/* Given the xtype and the fieldid, get the number of dimensions for
* * that field (scalars are 0). */
extern int
ncmpi_inq_compound_fieldndims(int ncid, nc_type xtype, int fieldid,
int *ndimsp);
extern int
ncmpi_inq_compound_fielddim_sizes(int ncid, nc_type xtype, int fieldid,
int *dim_sizes);
extern int
ncmpi_inq_unlimdims(int ncid, int *nunlimdimsp, int *unlimdimidsp);
extern int
ncmpi_inq_grpname_len(int ncid, MPI_Offset *lenp);
/* Given an ncid, find the ncid of its parent group. */
extern int
ncmpi_inq_grp_parent(int ncid, int *parent_ncid);
/* Given a name and parent ncid, find group ncid. */
extern int
ncmpi_inq_grp_ncid(int ncid, const char *grp_name, int *grp_ncid);
/* Given a full name and ncid, find group ncid. */
extern int
ncmpi_inq_grp_full_ncid(int ncid, const char *full_name, int *grp_ncid);
/* Get a list of ids for all the variables in a group. */
extern int
ncmpi_inq_varids(int ncid, int *nvars, int *varids);
/* Find all dimids for a location. This finds all dimensions in a
* * group, or any of its parents. */
extern int
ncmpi_inq_dimids(int ncid, int *ndims, int *dimids, int include_parents);
extern int
ncmpi_inq_type(int ncid, nc_type xtype, char *name, MPI_Offset *size);
/* Find all user-defined types for a location. This finds all
* * user-defined types in a group. */
extern int
ncmpi_inq_typeids(int ncid, int *ntypes, int *typeids);
/* Are two types equal? */
extern int
ncmpi_inq_type_equal(int ncid1, nc_type typeid1, int ncid2,
nc_type typeid2, int *equal);
/* Create a group. its ncid is returned in the new_ncid pointer. */
extern int
ncmpi_def_grp(int parent_ncid, const char *name, int *new_ncid);
/* Rename a group */
extern int
ncmpi_rename_grp(int grpid, const char *name);
extern int
ncmpi_inq_grps(int ncid, int *numgrps, int *ncids);
/* Given locid, find name of group. (Root group is named "/".) */
extern int
ncmpi_inq_grpname(int ncid, char *name);
/* Given ncid, find full name and len of full name. (Root group is
* * named "/", with length 1.) */
extern int
ncmpi_inq_grpname_full(int ncid, MPI_Offset *lenp, char *full_name);
extern int
ncmpi_def_enum(int ncid, nc_type base_typeid, const char *name,
nc_type *typeidp);
extern int
ncmpi_def_vlen(int ncid, const char *name, nc_type base_typeid, nc_type *xtypep);
/* Find out about a vlen. */
extern int
ncmpi_inq_vlen(int ncid, nc_type xtype, char *name, MPI_Offset *datum_sizep,
nc_type *base_nc_typep);
typedef struct {
MPI_Offset len; /**< Length of VL data (in base type units) */
void *p; /**< Pointer to VL data */
} nc_vlen_t;
extern int
ncmpi_free_vlen(nc_vlen_t *vl);
extern int
ncmpi_free_vlens(MPI_Offset len, nc_vlen_t vlens[]);
/* Put or get one element in a vlen array. */
extern int
ncmpi_put_vlen_element(int ncid, int typeid1, void *vlen_element,
MPI_Offset len, const void *data);
extern int
ncmpi_get_vlen_element(int ncid, int typeid1, const void *vlen_element,
MPI_Offset *len, void *data);
extern int
ncmpi_def_opaque(int ncid, MPI_Offset size, const char *name, nc_type *xtypep);
/* Get information about an opaque type. */
extern int
ncmpi_inq_opaque(int ncid, nc_type xtype, char *name, MPI_Offset *sizep);
extern int
ncmpi_inq_user_type(int ncid, nc_type xtype, char *name, MPI_Offset *size,
nc_type *base_nc_typep, MPI_Offset *nfieldsp, int *classp);
extern int
ncmpi_def_var_chunking(int ncid, int varid, int storage, const MPI_Offset *chunksizesp);
extern int
ncmpi_inq_var_chunking(int ncid, int varid, int *storagep, MPI_Offset *chunksizesp);
extern int
ncmpi_def_var_endian(int ncid, int varid, int endian);
/* Learn about the endianness of a variable. */
extern int
ncmpi_inq_var_endian(int ncid, int varid, int *endianp);
extern int
ncmpi_set_chunk_cache(MPI_Offset size, MPI_Offset nelems, float preemption);
extern int
ncmpi_def_var_deflate(int ncid, int varid, int shuffle, int deflate,
int deflate_level);
extern int
ncmpi_inq_var_deflate(int ncid, int varid, int *shufflep,
int *deflatep, int *deflate_levelp);
extern int
ncmpi_inq_var_szip(int ncid, int varid, int *options_maskp, int *pixels_per_blockp);
/* Set fletcher32 checksum for a var. This must be done after nc_def_var
* and before nc_enddef. */
extern int
ncmpi_def_var_fletcher32(int ncid, int varid, int fletcher32);
/* Inquire about fletcher32 checksum for a var. */
extern int
ncmpi_inq_var_fletcher32(int ncid, int varid, int *fletcher32p);
namespace PnetCDF
{
/*!
Function checks error code and if necessary throws an exception.
\param retCode Integer value returned by %netCDF C-routines.
\param file The name of the file from which this call originates.
\param line The line number in the file from which this call originates.
*/
void ncmpiCheck(int retCode, const char* file, int line);
/*!
Function checks if the file (group) is in define mode.
If not, it places it in the define mode.
While this is automatically done by the underlying C API
for netCDF-4 files, the netCDF-3 files still need this call.
*/
void ncmpiCheckDefineMode(int ncid);
/*!
Function checks if the file (group) is in data mode.
If not, it places it in the data mode.
While this is automatically done by the underlying C API
for netCDF-4 files, the netCDF-3 files still need this call.
*/
void ncmpiCheckDataMode(int ncid);
};
namespace PnetCDF
{
class NcmpiGroup; // forward declaration to avoid cyclic reference.
/*! Base class inherited by NcOpaque, NcVlen, NcCompound and NcEnum classes. */
class NcmpiType
{
public:
/*!
List of netCDF types that can be represented.
The enumeration list contains the complete set of netCDF variable types. In addition, the type NC_TYPE
is included. This enables the user to instantiate a netCDF type object without explcitly needing to know
it precise type.
*/
enum ncmpiType
{
ncmpi_BYTE = NC_BYTE, //!< signed 1 byte integer
ncmpi_CHAR = NC_CHAR, //!< ISO/ASCII character
ncmpi_SHORT = NC_SHORT, //!< signed 2 byte integer
ncmpi_INT = NC_INT, //!< signed 4 byte integer
ncmpi_FLOAT = NC_FLOAT, //!< single precision floating point number
ncmpi_DOUBLE = NC_DOUBLE, //!< double precision floating point number
ncmpi_UBYTE = NC_UBYTE, //!< unsigned 1 byte int
ncmpi_USHORT = NC_USHORT, //!< unsigned 2-byte int
ncmpi_UINT = NC_UINT, //!< unsigned 4-byte int
ncmpi_INT64 = NC_INT64, //!< signed 8-byte int
ncmpi_UINT64 = NC_UINT64, //!< unsigned 8-byte int
// PnetCDF does not support types below
ncmpi_STRING = NC_STRING, //!< string
ncmpi_VLEN = NC_VLEN, //!< "NcVlen type"
ncmpi_OPAQUE = NC_OPAQUE, //!< "NcOpaque type"
ncmpi_ENUM = NC_ENUM, //!< "NcEnum type"
ncmpi_COMPOUND = NC_COMPOUND //!< "NcCompound type"
};
/*! Constructor generates a \ref isNull "null object". */
NcmpiType();
/*!
Constructor for a non-global type.
This object describes the "essential" information for all netCDF types required by NcmpiVar, NcmpiAtt objects.
New netCDF types can be added using the appropriate "add" method in the NcmpiGroup object.
\param grp Parent NcmpiGroup object.
\param name Name of this type.
*/
NcmpiType(const PnetCDF::NcmpiGroup& grp, const std::string& name);
/*!
Constructor for a non-global type.
This object describes the "essential" information for all netCDF types required by NcmpiVar, NcmpiAtt objects.
New netCDF types can be added using the appropriate "add" method in the NcmpiGroup object.
\param grp Parent NcmpiGroup object.
\param id type id
*/
NcmpiType(const PnetCDF::NcmpiGroup& grp, nc_type id);
/*!
Constructor for a global type
This object describes the "essential" information for a netCDF global type.
\param id type id
*/
NcmpiType(nc_type id);
/*! The copy constructor. */
NcmpiType(const NcmpiType& rhs);
/*! destructor */
virtual ~NcmpiType() {}
/*! equivalence operator */
bool operator==(const NcmpiType&) const;
/*! != operator */
bool operator!=(const NcmpiType &) const;
// accessors to private data.
/*! The netCDF Id of this type. */
nc_type getId() const {return myId;}
/*! Gets parent group. For an atomic type, returns a Null object.*/
PnetCDF::NcmpiGroup getParentGroup() const;
/*!
The name of this type. For atomic types, the CDL type names are returned. These are as follows:
- NcmpiByte String returned is "byte".
- NcmpiUbyte String returned is "ubyte".
- NcmpiChar String returned is "char".
- NcmpiShort String returned is "short".
- NcmpiUshort String returned is "ushort".
- NcmpiInt String returned is "int".
- NcmpiUint String returned is "uint".
- NcmpiInt64 String returned is "int64".
- NcmpiUint64 String returned is "uint64".
- NcmpiFloat String returned is "float".
- NcmpiDouble String returned is "double".
*/
std::string getName() const;
/*!
The size in bytes.
This function will work on any type, including atomic and any user defined type, whether
compound, opaque, enumeration, or variable length array.
*/
MPI_Offset getSize() const;
/*!
The type class returned as enumeration type.
Valid for all types, whether atomic or user-defined. User-defined types are returned as one of the following
enumeration types: ncmpi_VLEN, ncmpi_OPAQUE, ncmpi_ENUM, or ncmpi_COMPOUND.
*/
ncmpiType getTypeClass() const;
/*!
Return a string containing the name of the enumerated type. (ie one of the following strings:
"ncmpi_BYTE", "ncmpi_CHAR", "ncmpi_SHORT", "ncmpi_INT", "ncmpi_FLOAT", "ncmpi_DOUBLE", "ncmpi_UBYTE", "ncmpi_USHORT",
"ncmpi_UINT", "ncmpi_INT64", "ncmpi_UINT64", "ncmpi_STRING", "ncmpi_VLEN", "ncmpi_OPAQUE", "ncmpi_ENUM", "ncmpi_COMPOUND"
*/
std::string getTypeClassName() const;
/*! Returns true if this object is null (i.e. it has no contents); otherwise returns false. */
bool isNull() const {return nullObject;}
/*! comparator operator */
friend bool operator<(const NcmpiType& lhs,const NcmpiType& rhs);
/*! comparator operator */
friend bool operator>(const NcmpiType& lhs,const NcmpiType& rhs);
protected:
/*! assignment operator */
NcmpiType& operator=(const NcmpiType& rhs);
bool nullObject;
/*! the type Id */
nc_type myId;
/*! the group Id */
int groupId;
};
}
namespace PnetCDF
{
/*! Abstract base class represents inherited by ncmpiVarAtt and ncmpiGroupAtt. */
class NcmpiAtt
{
public:
/*! destructor */
virtual ~NcmpiAtt()=0;
/*! Constructor generates a \ref isNull "null object". */
NcmpiAtt ();
/*! Constructor for non-null instances. */
NcmpiAtt(bool nullObject);
/*! The copy constructor. */
NcmpiAtt(const NcmpiAtt& rhs);
/*! Get the attribute name. */
std::string getName() const {return myName;}
/*! Gets attribute length. */
MPI_Offset getAttLength() const;
/*! Returns the attribute type. */
NcmpiType getType() const;
/*! Gets parent group. */
NcmpiGroup getParentGroup() const;
/*! equivalence operator */
bool operator== (const NcmpiAtt& rhs) const;
/*! != operator */
bool operator!=(const NcmpiAtt& rhs) const;
/*! \overload
*/
void getValues(char* dataValues) const;
/*! \overload
*/
void getValues(unsigned char* dataValues) const;
/*! \overload
*/
void getValues(signed char* dataValues) const;
/*! \overload
*/
void getValues(short* dataValues) const;
/*! \overload
*/
void getValues(int* dataValues) const;
/*! \overload
*/
void getValues(long* dataValues) const;
/*! \overload
*/
void getValues(float* dataValues) const;
/*! \overload
*/
void getValues(double* dataValues) const;
/*! \overload
*/
void getValues(unsigned short* dataValues) const;
/*! \overload
*/
void getValues(unsigned int* dataValues) const;
/*! \overload
*/
void getValues(long long* dataValues) const;
/*! \overload
*/
void getValues(unsigned long long* dataValues) const;
/*! \overload
*/
void getValues(char** dataValues) const;
/*! \overload
(The string variable does not need preallocating.)
*/
void getValues(std::string& dataValues) const;
/*!
Gets a netCDF attribute.
The user must ensure that the variable "dataValues" has sufficient space to hold the attribute.
\param dataValues On return contains the value of the attribute.
If the type of data values differs from the netCDF variable type, type conversion will occur.
(However, no type conversion is carried out for variables using the user-defined data types:
ncmpi_Vlen, ncmpi_Opaque, ncmpi_Compound and ncmpi_Enum.)
*/
void getValues(void* dataValues) const;
/*! Returns true if this object is null (i.e. it has no contents); otherwise returns false. */
bool isNull() const {return nullObject;}
protected:
/*! assignment operator */
NcmpiAtt& operator= (const NcmpiAtt& rhs);
bool nullObject;
std::string myName;
int groupId;
int varId;
};
}
namespace PnetCDF
{
class NcmpiGroup; // forward declaration.
/*! Class represents a netCDF enum type */
class NcmpiEnumType : public NcmpiType
{
public:
/*! List of NetCDF-4 Enumeration types.*/
enum ncmpiEnumType {
ncmpi_BYTE = NC_BYTE, //!< signed 1 byte integer
ncmpi_SHORT = NC_SHORT, //!< signed 2 byte integer
ncmpi_INT = NC_INT, //!< signed 4 byte integer
ncmpi_UBYTE = NC_UBYTE, //!< unsigned 1 byte int
ncmpi_USHORT = NC_USHORT, //!< unsigned 2-byte int
ncmpi_UINT = NC_UINT, //!< unsigned 4-byte int
ncmpi_INT64 = NC_INT64, //!< signed 8-byte int
ncmpi_UINT64 = NC_UINT64 //!< unsigned 8-byte int
};
/*! Constructor generates a \ref isNull "null object". */
NcmpiEnumType();
/*!
Constructor.
The enum Type must already exist in the netCDF file. New netCDF enum types can
be added using NcmpiGroup::addNcmpiEnumType();
\param grp The parent group where this type is defined.
\param name Name of new type.
*/
NcmpiEnumType(const NcmpiGroup& grp, const std::string& name);
/*!
Constructor.
Constructs from the base type NcmpiType object. Will throw an exception if the NcmpiType is not the base of an Enum type.
\param ncmpiType A Nctype object.
*/
NcmpiEnumType(const NcmpiType& ncmpiType);
/*! assignment operator */
NcmpiEnumType& operator=(const NcmpiEnumType& rhs);
/*!
Assignment operator.
This assigns from the base type NcmpiType object. Will throw an exception if the NcmpiType is not the base of an Enum type.
*/
NcmpiEnumType& operator=(const NcmpiType& rhs);
/*! The copy constructor. */
NcmpiEnumType(const NcmpiEnumType& rhs);
/*! Destructor */
~NcmpiEnumType(){}
/*!
Adds a new member to this NcmpiEnumType type.
\param name Name for this new Enum memebr.
\param memberValue Member value, must be of the correct NcmpiType.
*/
template <class T> void addMember(const std::string& name, T memberValue)
{
ncmpiCheck(ncmpi_insert_enum(groupId, myId, name.c_str(), (void*) &memberValue),__FILE__,__LINE__);
}
/*! Returns number of members in this NcmpiEnumType object. */
MPI_Offset getMemberCount() const;
/*! Returns the member name for the given zero-based index. */
std::string getMemberNameFromIndex(int index) const;
/*! Returns the member name for the given NcmpiEnumType value. */
template <class T> std::string getMemberNameFromValue(const T memberValue) const {
char charName[NC_MAX_NAME+1];
ncmpiCheck(ncmpi_inq_enum_ident(groupId,myId,static_cast<long long>(memberValue),charName),__FILE__,__LINE__);
return std::string(charName);
}
/*!
Returns the value of a member with the given zero-based index.
\param name Name for this new Enum member.
\param memberValue Member value, returned by this routine.
*/
template <class T> void getMemberValue(int index, T& memberValue) const
{
char* charName=NULL;
ncmpiCheck(ncmpi_inq_enum_member(groupId,myId,index,charName,&memberValue),__FILE__,__LINE__);
}
/*! Returns the base type. */
NcmpiType getBaseType() const;
};
}
namespace PnetCDF
{
class NcmpiGroup; // forward declaration.
/*! Class represents a netCDF group attribute */
class NcmpiGroupAtt : public NcmpiAtt
{
public:
/*! assignment operator */
NcmpiGroupAtt& operator= (const NcmpiGroupAtt& rhs);
/*! Constructor generates a \ref isNull "null object". */
NcmpiGroupAtt ();
/*! The copy constructor. */
NcmpiGroupAtt(const NcmpiGroupAtt& rhs) ;
/*!
Constructor for an existing global attribute.
\param grp Parent Group object.
\param index The index (id) of the attribute.
*/
NcmpiGroupAtt(const NcmpiGroup& grp, const int index);
/*! equivalence operator */
bool operator== (const NcmpiGroupAtt& rhs);
/*! comparator operator */
friend bool operator<(const NcmpiGroupAtt& lhs,const NcmpiGroupAtt& rhs);
/*! comparator operator */
friend bool operator>(const NcmpiGroupAtt& lhs,const NcmpiGroupAtt& rhs);
};
}
namespace PnetCDF
{
class NcmpiVar; // forward declaration.
class NcmpiDim; // forward declaration.
class NcmpiVlenType; // forward declaration.
class NcmpiCompoundType; // forward declaration.
class NcmpiOpaqueType; // forward declaration.
/*! Class represents a netCDF group. */
class NcmpiGroup
{
public:
/*!
The enumeration list contains the options for selecting groups (used for returned set of NcmpiGroup objects).
*/
enum GroupLocation
{
ChildrenGrps, //!< Select from the set of children in the current group.
ParentsGrps, //!< Select from set of parent groups (excludes the current group).
ChildrenOfChildrenGrps, //!< Select from set of all children of children in the current group.
AllChildrenGrps, //!< Select from set of all children of the current group and beneath.
ParentsAndCurrentGrps, //!< Select from set of parent groups(includes the current group).
AllGrps //!< Select from set of parent groups, current groups and all the children beneath.
};
/*!
The enumeration list contains the options for selecting groups.
*/
enum Location
{
Current, //!< Select from contents of current group.
Parents, //!< Select from contents of parents groups.
Children, //!< Select from contents of children groups.
ParentsAndCurrent, //!< Select from contents of current and parents groups.
ChildrenAndCurrent, //!< Select from contents of current and child groups.
All //!< Select from contents of current, parents and child groups.
};
/*! assignment operator */
NcmpiGroup& operator=(const NcmpiGroup& rhs);
/*! Constructor generates a \ref isNull "null object". */
NcmpiGroup();
//* constructor */
NcmpiGroup(int groupId);
/*! The copy constructor. */
NcmpiGroup(const NcmpiGroup& rhs);
/*! destructor */
virtual ~NcmpiGroup();
/*! equivalence operator */
bool operator==(const NcmpiGroup& rhs) const;
/*! != operator */
bool operator!=(const NcmpiGroup& rhs) const;
/*! comparator operator */
friend bool operator<(const NcmpiGroup& lhs,const NcmpiGroup& rhs);
/*! comparator operator */
friend bool operator>(const NcmpiGroup& lhs,const NcmpiGroup& rhs);
// /////////////
// NcmpiGroup-related methods
// /////////////
/*! Gets the group name. */
/*!
Method will throw an PnetCDF::exceptions::NcNullgrp exception if the group is null (ie NcmpiGroup::isNull()=true).
\param fullName If true then the full name is returned with subgroups separated by a forward slash "/" (default is false)
\return The group name.
*/
std::string getName(bool fullName=false) const;
/*!
Gets the parent group.
Method will throw an PnetCDF::exceptions::NcNullgrp exception if the group is null (ie NcmpiGroup::isNull()=true).
If the current root is the parent group, then return a null group.
*/
NcmpiGroup getParentGroup() const ;
/*!
Gets the group id.
Method will throw an PnetCDF::exceptions::NcNullgrp exception if the group is null (ie NcmpiGroup::isNull()=true).
*/
int getId() const;
/*!
Gets the number of NcmpiGroup objects.
Method will throw an PnetCDF::exceptions::NcNullgrp exception if the group is null (ie NcmpiGroup::isNull()=true).
\param location Enumeration type controlling the groups to search.
\return Number of groups.
*/
int getGroupCount(NcmpiGroup::GroupLocation location=ChildrenGrps) const;
/*!
Gets the collection of NcmpiGroup objects.
Method will throw an PnetCDF::exceptions::NcNullgrp exception if the group is null (ie NcmpiGroup::isNull()=true).
\param location Enumeration type controlling the groups to search.
\return A STL multimap object, containing pairs of <attribute name, NcmpiGroup object> entities.
*/
std::multimap<std::string,NcmpiGroup> getGroups(NcmpiGroup::GroupLocation location=ChildrenGrps) const;
/*!
Gets NcmpiGroup objects with a given name.
Method will throw an PnetCDF::exceptions::NcNullgrp exception if the group is null (ie NcmpiGroup::isNull()=true).
\param name Name of group.
\param location Enumeration type controlling the groups to search.
\return Set of NcmpiGroup objects with given name.
*/
std::set<NcmpiGroup> getGroups(const std::string& name,NcmpiGroup::GroupLocation location=ChildrenGrps) const;
/*!
Gets the named child NcmpiGroup object.
Method will throw an PnetCDF::exceptions::NcNullgrp exception if the group is null (ie NcmpiGroup::isNull()=true).
\param name Group name.
\param location Enumeration type controlling the groups to search.
\return An NcmpiGroup object. If there are multiple objects indentied with the same name,
the object closest to the current group is returned. If no valid object is found ,
a \ref NcmpiGroup::isNull "null node" is returned.
*/
NcmpiGroup getGroup(const std::string& name,NcmpiGroup::GroupLocation location=ChildrenGrps) const;
/*!
Adds a new child netCDF group object.
Method will throw an PnetCDF::exceptions::NcNullgrp exception if the group is null (ie NcmpiGroup::isNull()=true).
\param name Variable name.
\return NcmpiGroup The NcmpiGroup object for this new netCDF group.
*/
NcmpiGroup addGroup(const std::string& name) const;
/*! Returns true if this object is null (i.e. it has no contents); otherwise returns false. */
bool isNull() const {return nullObject;}
/*! Returns true if this is the root group, otherwise returns false. */
bool isRootGroup() const;
// /////////////
// NcmpiVar-related accessors
// /////////////
/*!
Gets the number of NcmpiVar objects in this group.
\param location Enumeration type controlling the groups to search.
\return Number of variables.
*/
int getVarCount(NcmpiGroup::Location location=Current) const;
/*!
Gets the number of record variable NcmpiVar objects in this group.
\param location Enumeration type controlling the groups to search.
\return Number of record variables.
*/
int getRecVarCount(NcmpiGroup::Location location=Current) const;
/*!
Gets the size of record block, i.e. the sume of single records of all
the record variables.
\param location Enumeration type controlling the groups to search.
\return size of record bock.
*/
MPI_Offset getRecSize(NcmpiGroup::Location location=Current) const;
/*!
Gets the number of fixed-size variable NcmpiVar objects in this group.
\param location Enumeration type controlling the groups to search.
\return Number of fixed-size variables.
*/
int getFixVarCount(NcmpiGroup::Location location=Current) const;
/*!
Get the collection of NcmpiVar objects.
\param location Enumeration type controlling the groups to search.
\return A STL multimap object, containing pairs of <attribute name, NcmpiVar object> entities.
*/
std::multimap<std::string,NcmpiVar> getVars(NcmpiGroup::Location location=Current) const;
/*!
Gets all NcmpiVar objects with a given name.
\param name Name of attribute
\param location Enumeration type controlling the groups to search.
\return Set of NcmpiVar objects.
*/
std::set<NcmpiVar> getVars(const std::string& name,NcmpiGroup::Location location=Current) const;
/*!
Gets the named NcmpiVar object..
\param name Variable name.
\param location Enumeration type controlling the groups to search.
\return A NcmpiVar object. If there are multiple objects indentied with the
same name, the object closest to the current group is returned.
If no valid object is found , a \ref NcmpiVar::isNull "null node" is returned.
*/
NcmpiVar getVar(const std::string& name,NcmpiGroup::Location location=Current) const;
/*!
Adds a new netCDF scalar variable.
The NcmpiType must be non-null, and be defined in either the current group or a parent group.
An NcNullType exception is thrown if the NcmpiType object is invalid.
\param name Variable name.
\param typeName Type name.
\return The NcmpiVar object for this new netCDF variable.
*/
NcmpiVar addVar(const std::string& name, const NcmpiType& ncmpiType) const;
/*!
Adds a new netCDF variable.
The NcmpiType and NcmpiDim objects must be non-null, and be defined in either the current group or a parent group.
An NcNullType exception is thrown if the NcmpiType object is invalid.
An NcNullDim exception is thrown if the NcmpiDim object is invalid.
\param name Variable name.
\param typeName Type name.
\param dimName Dimension name.
\return The NcmpiVar object for this new netCDF variable.
*/
NcmpiVar addVar(const std::string& name, const std::string& typeName, const std::string& dimName) const;
/*!
Adds a new netCDF variable.
The NcmpiType and NcmpiDim objects must be non-null, and be defined in either the current group or a parent group.
An NcNullType exception is thrown if the NcmpiType object is invalid.
An NcNullDim exception is thrown if the NcmpiDim object is invalid.
\param name Variable name.
\param ncmpiType NcmpiType object.
\param ncmpiDim NcmpiDim object.
\return The NcmpiVar object for this new netCDF variable.
*/
NcmpiVar addVar(const std::string& name, const NcmpiType& ncmpiType, const NcmpiDim& ncmpiDim) const;
/*!
Adds a new netCDF multi-dimensional variable.
The NcmpiType and NcmpiDim objects must be non-null, and be defined in either the current group or a parent group.
An NcNullType exception is thrown if the NcmpiType object is invalid.
An NcNullDim exception is thrown if the NcmpiDim object is invalid.
\param name Variable name.
\param typeName Type name.
\param dimNames Vector of dimension names.
\return The NcmpiVar object for this new netCDF variable.
*/
NcmpiVar addVar(const std::string& name, const std::string& typeName, const std::vector<std::string>& dimNames) const;
/*!
Adds a new multi-dimensional netCDF variable.
The NcmpiType and NcmpiDim objects must be non-null, and be defined in either the current group or a parent group.
An NcNullType exception is thrown if the NcmpiType object is invalid.
An NcNullDim exception is thrown if any of the the NcmpiDim objects are invalid.
\param name Variable name.
\param ncmpiType NcmpiType object.
\param ncmpiDimvector Vector of NcmpiDim objects.
\return The NcmpiVar object for this new netCDF variable.
*/
NcmpiVar addVar(const std::string& name, const NcmpiType& ncmpiType, const std::vector<NcmpiDim>& ncmpiDimVector) const;
// /////////////
// NcmpiGroupAtt-related methods
// /////////////
/*!
Gets the number of group attributes.
\param location Enumeration type controlling the groups to search.
\return Number of attributes.
*/
int getAttCount(NcmpiGroup::Location location=Current) const;
/*!
Gets the collection of NcmpiGroupAtt objects.
\param location Enumeration type controlling the groups to search.
\return A STL multimap object, containing pairs of <attribute name, NcmpiGroupAtt object> entities.
*/
std::multimap<std::string,NcmpiGroupAtt> getAtts(NcmpiGroup::Location location=Current) const;
/*!
Gets all NcmpiGroupAtt objects with a given name.
\param name Name of attribute
\param location Enumeration type controlling the groups to search.
\return Set of NcmpiGroupAtt objects.
*/
std::set<NcmpiGroupAtt> getAtts(const std::string& name,NcmpiGroup::Location location=Current) const;
/*!
Gets the named NcmpiGroupAtt object.
\param name Name of attribute
\param location Enumeration type controlling the groups to search.
\return A NcmpiGroupAtt object. If there are multiple objects indentied with the
same name, the object closest to the current group is returned. If no valid object is found ,
a \ref NcmpiGroupAtt::isNull "null node" is returned.
*/
NcmpiGroupAtt getAtt(const std::string& name,NcmpiGroup::Location location=Current) const;
/*! \overload
*/
NcmpiGroupAtt putAtt(const std::string& name, MPI_Offset len, const char** dataValues) const ;
/*! \overload
*/
NcmpiGroupAtt putAtt(const std::string& name, const std::string& dataValues) const ;
/*! \overload
*/
NcmpiGroupAtt putAtt(const std::string& name, const NcmpiType& type, short datumValue) const ;
/*! \overload
*/
NcmpiGroupAtt putAtt(const std::string& name, const NcmpiType& type, int datumValue) const ;
/*! \overload
*/
NcmpiGroupAtt putAtt(const std::string& name, const NcmpiType& type, long datumValue) const ;
/*! \overload
*/
NcmpiGroupAtt putAtt(const std::string& name, const NcmpiType& type, float datumValue) const ;
/*! \overload
*/
NcmpiGroupAtt putAtt(const std::string& name, const NcmpiType& type, double datumValue) const ;
/*! \overload
*/
NcmpiGroupAtt putAtt(const std::string& name, const NcmpiType& type, unsigned short datumValue) const ;
/*! \overload
*/
NcmpiGroupAtt putAtt(const std::string& name, const NcmpiType& type, unsigned int datumValue) const ;
/*! \overload
*/
NcmpiGroupAtt putAtt(const std::string& name, const NcmpiType& type, unsigned long long datumValue) const ;
/*! \overload
*/
NcmpiGroupAtt putAtt(const std::string& name, const NcmpiType& type, long long datumValue) const ;
/*! \overload
*/
NcmpiGroupAtt putAtt(const std::string& name, const NcmpiType& type, MPI_Offset len, const unsigned char* dataValues) const ;
/*! \overload
*/
NcmpiGroupAtt putAtt(const std::string& name, const NcmpiType& type, MPI_Offset len, const signed char* dataValues) const ;
/*! \overload
*/
NcmpiGroupAtt putAtt(const std::string& name, const NcmpiType& type, MPI_Offset len, const short* dataValues) const ;
/*! \overload
*/
NcmpiGroupAtt putAtt(const std::string& name, const NcmpiType& type, MPI_Offset len, const int* dataValues) const ;
/*! \overload
*/
NcmpiGroupAtt putAtt(const std::string& name, const NcmpiType& type, MPI_Offset len, const long* dataValues) const ;
/*! \overload
*/
NcmpiGroupAtt putAtt(const std::string& name, const NcmpiType& type, MPI_Offset len, const float* dataValues) const ;
/*! \overload
*/
NcmpiGroupAtt putAtt(const std::string& name, const NcmpiType& type, MPI_Offset len, const double* dataValues) const ;
/*! \overload
*/
NcmpiGroupAtt putAtt(const std::string& name, const NcmpiType& type, MPI_Offset len, const unsigned short* dataValues) const ;
/*! \overload
*/
NcmpiGroupAtt putAtt(const std::string& name, const NcmpiType& type, MPI_Offset len, const unsigned int* dataValues) const ;
/*! \overload
*/
NcmpiGroupAtt putAtt(const std::string& name, const NcmpiType& type, MPI_Offset len, const unsigned long long* dataValues) const ;
/*! \overload
*/
NcmpiGroupAtt putAtt(const std::string& name, const NcmpiType& type, MPI_Offset len, const long long* dataValues) const ;
/*!
Creates a new NetCDF group attribute or if already exisiting replaces it.
If you are writing a _Fill_Value_ attribute, and will tell the HDF5 layer to use
the specified fill value for that variable.
\par
Although it's possible to create attributes of all types, text and double attributes are adequate for most purposes.
\param name Name of attribute.
\param type The attribute type.
\param len The length of the attribute (number of Nctype repeats).
\param dataValues Data Values to put into the new attribute.
If the type of data values differs from the netCDF variable type, type conversion will occur.
(However, no type conversion is carried out for variables using the user-defined data types:
ncmpi_Vlen, ncmpi_Opaque, ncmpi_Compound and ncmpi_Enum.)
\return The NcmpiGroupAtt object for this new netCDF attribute.
*/
NcmpiGroupAtt putAtt(const std::string& name, const NcmpiType& type, MPI_Offset len, const void* dataValues) const ;
// /////////////
// NcmpiDim-related methods
// /////////////
/*!
Gets the number of NcmpiDim objects.
\param location Enumeration type controlling the groups to search.
\return Number of dimensions.
*/
int getDimCount(NcmpiGroup::Location location=Current) const;
/*!
Gets the collection of NcmpiDim objects.
\param location Enumeration type controlling the groups to search.
\return A STL multimap object, containing pairs of <attribute name, NcmpiDim object> entities.
*/
std::multimap<std::string,NcmpiDim> getDims(NcmpiGroup::Location location=Current) const;
/*!
Gets NcmpiDim objects with a given name.
\param name Name of dimension.
\param location Enumeration type controlling the groups to search.
\return Set of NcmpiDim objects with given name.
*/
std::set<NcmpiDim> getDims(const std::string& name,NcmpiGroup::Location location=Current) const;
/*!
Gets the named NcmpiDim object.
\param name Name of dimension.
\param location Enumeration type controlling the groups to search.
\return An NcmpiDim object. If there are multiple objects indentied with the same name,
the object closest to the current group is returned. If no valid object is found , a \ref NcmpiDim::isNull "null node" is returned.
*/
NcmpiDim getDim(const std::string& name,NcmpiGroup::Location location=Current) const;
/*!
Adds a new netCDF dimension.
\param The name of new dimension.
\param Length of dimension; that is, number of values for this dimension as an index to variables
that use it.
\return The NcmpiDim object for this new netCDF dimension.
*/
NcmpiDim addDim(const std::string& name, MPI_Offset dimSize) const;
/*!
Adds a new unlimited netCDF dimension.
\param The name of new dimension.
\return The NcmpiDim object for this new netCDF dimension.
*/
NcmpiDim addDim(const std::string& name) const;
// /////////////
// NcmpiType-related methods
// /////////////
/*!
Gets the number of type objects.
\param location Enumeration type controlling the groups to search.
\return Number of types.
*/
int getTypeCount(NcmpiGroup::Location location=Current) const;
/*!
Gets the number of type objects with a given enumeration type.
\param enumType The enumeration value of the object type.
\param location Enumeration type controlling the groups to search.
\return Number of types of the given enumeration type.
*/
int getTypeCount(NcmpiType::ncmpiType enumType, NcmpiGroup::Location location=Current) const;
/*!
Gets the collection of NcmpiType objects.
\param location Enumeration type controlling the groups to search.
\return A STL multimap object, on return contains pairs of <Type name, NcmpiType object> entities.
For atomic types, the type returned is the CDL name.
*/
std::multimap<std::string,NcmpiType> getTypes(NcmpiGroup::Location location=Current) const;
/*!
Gets the collection of NcmpiType objects with a given name.
\param name Name of type. For atomic types, the CDL name is expected. This is consistent with the
string returned from NcmpiType::getName().
\param location Enumeration type controlling the groups to search.
\return Set of NcmpiType objects.
*/
std::set<NcmpiType> getTypes(const std::string& name, NcmpiGroup::Location location=Current) const;
/*!
Gets the collection of NcmpiType objects with a given data type.
\param enumType Enumeration type specifying the data type.
\param location Enumeration type controlling the groups to search.
\return Set of Nctype objects.
*/
std::set<NcmpiType> getTypes(NcmpiType::ncmpiType enumType, NcmpiGroup::Location location=Current) const;
/*!
Gets the collection of NcmpiType objects with a given name and data type.
\param name Name of type. For atomic types, the CDL name is expected. This is consistent with the
string returned from NcmpiType::getName().
\param enumType Enumeration type specifying the data type.
\param location Enumeration type controlling the groups to search.
\return Set of Nctype objects.
*/
std::set<NcmpiType> getTypes(const std::string& name, NcmpiType::ncmpiType enumType, NcmpiGroup::Location location=Current) const;
/*!
Gets the NcmpiType object with a given name.
\param name Name of type. For atomic types, the CDL name is expected. This is consistent with the
string returned from NcmpiType::getName().
\param location Enumeration type controlling the groups to search.
\return NcmpiType object. If there are multiple objects indentied with the same name,
the object closest to the current group is returned. If no valid object is found , a \ref NcmpiType::isNull "null node" is returned.
*/
NcmpiType getType(const std::string& name, NcmpiGroup::Location location=Current) const;
/*!
Adds a new netCDF enum type.
\param name Name of type. For atomic types, the CDL name is expected. This is consistent with the
string returned from NcmpiType::getName().
\param enumType The enumeration value of the object type.
\return The NcmpiEnumType object for this new netCDF enum type.
*/
NcmpiEnumType addEnumType(const std::string& name,NcmpiEnumType::ncmpiEnumType basetype) const;
/*!
Adds a new netCDF Vlen type.
\param name Name of type.
\param basetype A NcmpiType object to be used for the basetype.
\return The NcmpiVlenType object for this new netCDF vlen type.
*/
NcmpiVlenType addVlenType(const std::string& name,NcmpiType& basetype) const;
/*!
Adds a new netCDF Opaque type.
\param name Name of type.
\param size The size of the new type in bytes.
\return The NcmpiOpaqueType object for this new netCDF opaque type..
*/
NcmpiOpaqueType addOpaqueType(const std::string& name, MPI_Offset size) const;
/*!
Adds a new netCDF UserDefined type.
\param name Name of type.
\param size The size of the new type in bytes.
\return The new NcmpiCompoundType object for this new netCDF userDefined type.
*/
NcmpiCompoundType addCompoundType(const std::string& name, MPI_Offset size) const;
/*!
Gets a collection of coordinate variables.
Coordinate variable have an NcmpiDim and NcmpiVar object with the same name defined in the same group.
\par
The method returns STL map object containing a coordinate variables in the current group and optionally
in the parent and child groups. It is expected that within each group, the names of dimensions are unique and
the the names of variables are unique. However, if this is not the case, this method will still work correctly.
\param location Enumeration type controlling the groups to search.
\return The NcmpiVar dimension variable. If no valid object is found , a \ref NcmpiVar::isNull "null node" is returned.
*/
std::map<std::string,NcmpiGroup> getCoordVars(NcmpiGroup::Location location=Current) const;
/*!
Gets the NcmpiDim and NcmpiVar object pair for a named coordinate variable.
Coordinate variable have an NcmpiDim and NcmpiVar object with the same name defined in the same group.
\par
The method returns two objects for the named coordinate variable. The method searches first in the current
group and optionally in the parent and child group and returns the first instance found.
\param location Enumeration type controlling the groups to search.
\return The set of names of dimension variables.
*/
void getCoordVar(std::string& coordVarName, NcmpiDim& ncmpiDim, NcmpiVar& ncmpiVar, NcmpiGroup::Location location=Current) const;
protected:
/*! assignment operator */
/* NcmpiGroup& operator=(const NcmpiGroup& rhs); */
bool nullObject;
int myId;
};
}
namespace PnetCDF
{
/*! Class represents a netCDF atomic Byte type. */
class NcmpiByte : public NcmpiType
{
public:
/*! equivalence operator */
bool operator==(const NcmpiByte & rhs);
/*! storage size */
int sizeoff();
~NcmpiByte();
/*! Constructor */
NcmpiByte();
};
/*! A global instance of the NcmpiByte class within the netCDF namespace. */
extern NcmpiByte ncmpiByte;
}
namespace PnetCDF
{
/*! Class represents a netCDF atomic Char type. */
class NcmpiChar : public NcmpiType
{
public:
/*! equivalence operator */
bool operator==(const NcmpiChar & rhs);
~NcmpiChar();
/*! Constructor */
NcmpiChar();
};
/*! A global instance of the NcmpiChar class within the netCDF namespace. */
extern NcmpiChar ncmpiChar;
}
namespace PnetCDF
{
class NcmpiGroup; // forward declaration.
/*!
Class represents a netCDF compound type
*/
class NcmpiCompoundType : public NcmpiType
{
public:
/*! Constructor generates a \ref isNull "null object". */
NcmpiCompoundType();
/*!
Constructor.
The compound Type must already exist in the netCDF file. New netCDF compound types can be
added using NcmpiGroup::addNcmpiCompoundType();
\param grp The parent group where this type is defined.
\param name Name of new type.
*/
NcmpiCompoundType(const NcmpiGroup& grp, const std::string& name);
/*!
Constructor.
Constructs from the base type NcmpiType object. Will throw an exception if the NcmpiType is not the base of a Compound type.
\param ncmpiType A Nctype object.
*/
NcmpiCompoundType(const NcmpiType& ncmpiType);
/*! assignment operator */
NcmpiCompoundType& operator=(const NcmpiCompoundType& rhs);
/*!
Assignment operator.
This assigns from the base type NcmpiType object. Will throw an exception if the NcmpiType is not the base of a Compound type.
*/
NcmpiCompoundType& operator=(const NcmpiType& rhs);
/*! The copy constructor. */
NcmpiCompoundType(const NcmpiCompoundType& rhs);
/*! equivalence operator */
bool operator==(const NcmpiCompoundType & rhs);
/*! destructor */
~NcmpiCompoundType(){;}
/*!
Adds a named field.
\param memName Name of new field.
\param newMemberType The type of the new member.
\param offset Offset of this member in bytes, obtained by a call to offsetof. For example
the offset of a member "mem4" in structure struct1 is: offsetof(struct1,mem4).
*/
void addMember(const std::string& memName, const NcmpiType& newMemberType,MPI_Offset offset);
/*!
Adds a named array field.
\param memName Name of new field.
\param newMemberType The type of the new member.
\param offset Offset of this member in bytes, obtained by a call to offsetof. For example
the offset of a member "mem4" in structure struct1 is: offsetof(struct1,mem4).
\param shape The shape of the array field.
*/
void addMember(const std::string& memName, const NcmpiType& newMemberType, MPI_Offset offset, const std::vector<int>& shape);
/*! Returns number of members in this NcmpiCompoundType object. */
MPI_Offset getMemberCount() const;
/*! Returns a NcmpiType object for a single member. */
NcmpiType getMember(int memberIndex) const;
/*! Returns the offset of the member with given index. */
MPI_Offset getMemberOffset(const int index) const;
/*!
Returns the number of dimensions of a member with the given index.
\param Index of member (numbering starts at zero).
\return The number of dimensions of the field. Non-array fields have 0 dimensions.
*/
int getMemberDimCount(int memberIndex) const;
/*!
Returns the shape of a given member.
\param Index of member (numbering starts at zero).
\return The size of the dimensions of the field. Non-array fields have 0 dimensions.
*/
std::vector<int> getMemberShape(int memberIndex) const;
};
}
namespace PnetCDF
{
/*! Class represents a netCDF atomic Double type. */
class NcmpiDouble : public NcmpiType
{
public:
/*! equivalence operator */
bool operator==(const NcmpiDouble & rhs);
/*! destructor */
~NcmpiDouble();
/*! Constructor */
NcmpiDouble();
};
/*! A global instance of the NcmpiDouble class within the netCDF namespace. */
extern NcmpiDouble ncmpiDouble;
}
namespace PnetCDF
{
/*! Class represents a netCDF atomic Float type. */
class NcmpiFloat : public NcmpiType
{
public:
/*! equivalence operator */
bool operator==(const NcmpiFloat & rhs);
/*! destructor */
~NcmpiFloat();
/*! Constructor */
NcmpiFloat();
};
/*! A global instance of the NcmpiFloat class within the netCDF namespace. */
extern NcmpiFloat ncmpiFloat;
}
namespace PnetCDF
{
/*! Class represents a netCDF atomic Int type. */
class NcmpiInt : public NcmpiType
{
public:
/*! equivalence operator */
bool operator==(const NcmpiInt & rhs);
/*! destructor */
~NcmpiInt();
/*! Constructor */
NcmpiInt();
};
/*! A global instance of the NcmpiInt class within the netCDF namespace. */
extern NcmpiInt ncmpiInt;
}
namespace PnetCDF
{
/*! Class represents a netCDF atomic Int64 type. */
class NcmpiInt64 : public NcmpiType
{
public:
/*! equivalence operator */
bool operator==(const NcmpiInt64 & rhs);
/*! destructor */
~NcmpiInt64();
/*! Constructor */
NcmpiInt64();
};
/*! A global instance of the NcmpiInt64 class within the netCDF namespace. */
extern NcmpiInt64 ncmpiInt64;
}
namespace PnetCDF
{
class NcmpiGroup; // forward declaration.
/*! Class represents a netCDF opaque type */
class NcmpiOpaqueType : public NcmpiType
{
public:
/*! Constructor generates a \ref isNull "null object". */
NcmpiOpaqueType();
/*!
Constructor.
The opaque Type must already exist in the netCDF file. New netCDF opaque types #
can be added using NcmpiGroup::addNcmpiOpaqueType();
\param grp The parent group where this type is defined.
\param name Name of new type.
*/
NcmpiOpaqueType(const NcmpiGroup& grp, const std::string& name);
/*!
Constructor.
Constructs from the base type NcmpiType object. Will throw an exception if the NcmpiType is not the base of a Opaque type.
\param ncmpiType A Nctype object.
*/
NcmpiOpaqueType(const NcmpiType& ncmpiType);
/*! assignment operator */
NcmpiOpaqueType& operator=(const NcmpiOpaqueType& rhs);
/*!
Assignment operator.
This assigns from the base type NcmpiType object. Will throw an exception if the NcmpiType is not the base of an Opaque type.
*/
NcmpiOpaqueType& operator=(const NcmpiType& rhs);
/*! The copy constructor.*/
NcmpiOpaqueType(const NcmpiOpaqueType& rhs);
/*! destructor */
~NcmpiOpaqueType(){;}
/*! Returns the size of the opaque type in bytes. */
MPI_Offset getTypeSize() const;
};
}
namespace PnetCDF
{
/*! Class represents a netCDF atomic Short type. */
class NcmpiShort : public NcmpiType
{
public:
/*! equivalence operator */
bool operator==(const NcmpiShort & rhs);
/*! destructor */
~NcmpiShort();
/*! Constructor */
NcmpiShort();
};
/*! A global instance of the NcmpiShort class within the netCDF namespace. */
extern NcmpiShort ncmpiShort;
}
namespace PnetCDF
{
/*! Class represents a netCDF atomic Ubyte type. */
class NcmpiUbyte : public NcmpiType
{
public:
/*! equivalence operator */
bool operator==(const NcmpiUbyte & rhs);
/*! destructor */
~NcmpiUbyte();
/*! Constructor */
NcmpiUbyte();
};
/*! A global instance of the NcmpiUbyte class within the netCDF namespace. */
extern NcmpiUbyte ncmpiUbyte;
}
namespace PnetCDF
{
/*! Class represents a netCDF atomic Uint type. */
class NcmpiUint : public NcmpiType
{
public:
/*! equivalence operator */
bool operator==(const NcmpiUint & rhs);
/*! destructor */
~NcmpiUint();
/*! Constructor */
NcmpiUint();
};
/*! A global instance of the NcmpiUint class within the netCDF namespace. */
extern NcmpiUint ncmpiUint;
}
namespace PnetCDF
{
/*! Class represents a netCDF atomic Uint64 type.*/
class NcmpiUint64 : public NcmpiType
{
public:
/*! equivalence operator */
bool operator==(const NcmpiUint64 & rhs);
/*! destructor */
~NcmpiUint64();
/*! Constructor */
NcmpiUint64();
};
/*! A global instance of the NcmpiUint64 class within the netCDF namespace. */
extern NcmpiUint64 ncmpiUint64;
}
namespace PnetCDF
{
/*! Class represents a netCDF atomic Ushort type. */
class NcmpiUshort : public NcmpiType
{
public:
/*! equivalence operator */
bool operator==(const NcmpiUshort & rhs);
/*! destructor */
~NcmpiUshort();
/*! Constructor */
NcmpiUshort();
};
// declare that the class instance ncmpiUshort is known by all....
extern NcmpiUshort ncmpiUshort;
}
namespace PnetCDF
{
//! Exception classes.
/*!
These exceptions are thrown if the netCDF-4 API encounters an error.
*/
namespace exceptions
{
/*!
Base object is thrown if a netCDF exception is encountered.
An unsatisfactory return from a call to one of the netCDF C-routines
generates an exception using an object inheriting this class. All other netCDF-related
errors including those originating in the C++ binding, generates an NcmpiException.
*/
class NcmpiException : public std::exception {
public:
//NcmpiException(const string& complaint,const char* fileName,int lineNumber);
NcmpiException(const char* complaint,const char* fileName,int lineNumber);
NcmpiException(int errorCode, const char* complaint,const char* fileName,int lineNumber);
NcmpiException(const NcmpiException& e) throw();
NcmpiException& operator=(const NcmpiException& e) throw();
virtual ~NcmpiException() throw();
const char* what() const throw();
int errorCode() const throw();
private:
std::string* what_msg;
int ec;
};
/*! Thrown if the specified netCDF ID does not refer to an open netCDF dataset. */
class NcBadId : public NcmpiException
{
public:
NcBadId(const char* complaint,const char* file,int line);
};
/*! Thrown if too many netcdf files are open. */
class NcNFile : public NcmpiException
{
public:
NcNFile(const char* complaint,const char* file,int line);
};
/*! Thrown if, having set NC_NOCLOBBER, the specified dataset already exists. */
class NcExist : public NcmpiException
{
public:
NcExist(const char* complaint,const char* file,int line);
};
/*! Thrown if not a netCDF id. */
class NcInvalidArg : public NcmpiException
{
public:
NcInvalidArg(const char* complaint,const char* file,int line);
};
/*! Thrown if invalid argument. */
class NcInvalidWrite : public NcmpiException
{
public:
NcInvalidWrite(const char* complaint,const char* file,int line);
};
/*! Thrown if operation not allowed in data mode. */
class NcNotInDefineMode : public NcmpiException
{
public:
NcNotInDefineMode(const char* complaint,const char* file,int line);
};
/*! Thrown if operation not allowed in defined mode. */
class NcInDefineMode : public NcmpiException
{
public:
NcInDefineMode(const char* complaint,const char* file,int line);
};
/*!
Index exceeds dimension bound.
Exception may be generated during operations to get or put netCDF variable data.
The exception is thrown if the specified indices were out of range for the rank of the
specified variable. For example, a negative index or an index that is larger than
the corresponding dimension length will cause an error.
*/
class NcInvalidCoords : public NcmpiException
{
public:
NcInvalidCoords(const char* complaint,const char* file,int line);
};
/*! Thrown if NC_MAX_DIMS is exceeded. */
class NcMaxDims : public NcmpiException
{
public:
NcMaxDims(const char* complaint,const char* file,int line);
};
/*! Thrown if string match to name is in use. */
class NcNameInUse : public NcmpiException
{
public:
NcNameInUse(const char* complaint,const char* file,int line);
};
/*! Thrown if attribute is not found. */
class NcNotAtt : public NcmpiException
{
public:
NcNotAtt(const char* complaint,const char* file,int line);
};
/*! Thrown if Nc_MAX_ATTRS is exceeded. */
class NcMaxAtts : public NcmpiException
{
public:
NcMaxAtts(const char* complaint,const char* file,int line);
};
/*! Thrown if not a valid netCDF data type. */
class NcBadType : public NcmpiException
{
public:
NcBadType(const char* complaint,const char* file,int line);
};
/*! Thrown if an invalid dimension id or name. */
class NcBadDim : public NcmpiException
{
public:
NcBadDim(const char* complaint,const char* file,int line);
};
/*! Thrown if Nc_UNLIMITED is in the wrong index. */
class NcUnlimPos : public NcmpiException
{
public:
NcUnlimPos(const char* complaint,const char* file,int line);
};
/*! Thrown if NC_MAX_VARS is exceeded. */
class NcMaxVars : public NcmpiException
{
public:
NcMaxVars(const char* complaint,const char* file,int line);
};
/*! Thrown if variable is not found. */
class NcNotVar : public NcmpiException
{
public:
NcNotVar(const char* complaint,const char* file,int line);
};
/*! Thrown if the action is prohibited on the NC_GLOBAL varid. */
class NcGlobal : public NcmpiException
{
public:
NcGlobal(const char* complaint,const char* file,int line);
};
/*! Thrown if not a netCDF file. */
class NcNotNCF : public NcmpiException
{
public:
NcNotNCF(const char* complaint,const char* file,int line);
};
/*! Thrown if in FORTRAN, string is too short. */
class NcSts : public NcmpiException
{
public:
NcSts(const char* complaint,const char* file,int line);
};
/*! Thrown if NC_MAX_NAME is exceeded. */
class NcMaxName : public NcmpiException
{
public:
NcMaxName(const char* complaint,const char* file,int line);
};
/*! Thrown if NC_UNLIMITED size is already in use. */
class NcUnlimit : public NcmpiException
{
public:
NcUnlimit(const char* complaint,const char* file,int line);
};
/*! Thrown if ncmpi_rec op when there are no record vars. */
class NcNoRecVars : public NcmpiException
{
public:
NcNoRecVars(const char* complaint,const char* file,int line);
};
/*! Thrown if attempt to convert between text and numbers. */
class NcmpiChar : public NcmpiException
{
public:
NcmpiChar(const char* complaint,const char* file,int line);
};
/*! Thrown if edge+start exceeds dimension bound. */
class NcEdge : public NcmpiException
{
public:
NcEdge(const char* complaint,const char* file,int line);
};
/*! Thrown if illegal stride. */
class NcStride : public NcmpiException
{
public:
NcStride(const char* complaint,const char* file,int line);
};
/*! Thrown if attribute or variable name contains illegal characters. */
class NcBadName : public NcmpiException
{
public:
NcBadName(const char* complaint,const char* file,int line);
};
/*! Thrown if math result not representable. */
class NcRange : public NcmpiException
{
public:
NcRange(const char* complaint,const char* file,int line);
};
/*! Thrown if memory allocation (malloc) failure. */
class NcNoMem : public NcmpiException
{
public:
NcNoMem(const char* complaint,const char* file,int line);
};
/*! Thrown if one or more variable sizes violate format constraints */
class NcmpiVarSize : public NcmpiException
{
public:
NcmpiVarSize(const char* complaint,const char* file,int line);
};
/*! Thrown if invalid dimension size. */
class NcmpiDimSize : public NcmpiException
{
public:
NcmpiDimSize(const char* complaint,const char* file,int line);
};
/*! Thrown if file likely truncated or possibly corrupted. */
class NcTrunc : public NcmpiException
{
public:
NcTrunc(const char* complaint,const char* file,int line);
};
/*! Thrown if an error was reported by the HDF5 layer. */
class NcHdfErr : public NcmpiException
{
public:
NcHdfErr(const char* complaint,const char* file,int line);
};
/*! Thrown if cannot read. */
class NcCantRead : public NcmpiException
{
public:
NcCantRead(const char* complaint,const char* file,int line);
};
/*! Thrown if cannot write. */
class NcCantWrite : public NcmpiException
{
public:
NcCantWrite(const char* complaint,const char* file,int line);
};
/*! Thrown if cannot create. */
class NcCantCreate : public NcmpiException
{
public:
NcCantCreate(const char* complaint,const char* file,int line);
};
/*! Thrown if file meta. */
class NcmpiFileMeta : public NcmpiException
{
public:
NcmpiFileMeta(const char* complaint,const char* file,int line);
};
/*! Thrown if dim meta. */
class NcmpiDimMeta : public NcmpiException
{
public:
NcmpiDimMeta(const char* complaint,const char* file,int line);
};
/*! Thrown if attribute meta. */
class NcmpiAttMeta : public NcmpiException
{
public:
NcmpiAttMeta(const char* complaint,const char* file,int line);
};
/*! Thrown if variable meta. */
class NcmpiVarMeta : public NcmpiException
{
public:
NcmpiVarMeta(const char* complaint,const char* file,int line);
};
/*! Thrown if no compound. */
class NcNoCompound : public NcmpiException
{
public:
NcNoCompound(const char* complaint,const char* file,int line);
};
/*! Thrown if attribute exists. */
class NcmpiAttExists : public NcmpiException
{
public:
NcmpiAttExists(const char* complaint,const char* file,int line);
};
/*! Thrown if attempting netcdf-4 operation on netcdf-3 file. */
class NcNotNc4 : public NcmpiException
{
public:
NcNotNc4(const char* complaint,const char* file,int line);
};
/*! Thrown if attempting netcdf-4 operation on strict nc3 netcdf-4 file. */
class NcStrictNc3 : public NcmpiException
{
public:
NcStrictNc3(const char* complaint,const char* file,int line);
};
/*! Thrown if bad group id. */
class NcBadGroupId : public NcmpiException
{
public:
NcBadGroupId(const char* complaint,const char* file,int line);
};
/*! Thrown if bad type id. */
class NcBadTypeId : public NcmpiException
{
public:
NcBadTypeId(const char* complaint,const char* file,int line);
};
/*! Thrown if bad field id. */
class NcBadFieldId : public NcmpiException
{
public:
NcBadFieldId(const char* complaint,const char* file,int line);
};
/*! Thrown if cannot find the field id. */
class NcUnknownName : public NcmpiException
{
public:
NcUnknownName(const char* complaint,const char* file,int line);
};
/*! Thrown if cannot return a netCDF group. */
class NcEnoGrp : public NcmpiException
{
public:
NcEnoGrp(const char* complaint,const char* file,int line);
};
/*!
Thrown if the requested operation is on a NULL group.
This exception is thrown if an operation on a NcmpiGroup object is requested which is empty. To test if the object is empty used NcmpiGroup::isNull()
*/
class NcNullGrp : public NcmpiException
{
public:
NcNullGrp(const char* complaint,const char* file,int line);
};
/*!
Thrown if the requested operation is on a NULL type.
This exception is thrown if an operation on a NcmpiType object is requested which is empty. To test if the object is empty used NcmpiType::isNull()
*/
class NcNullType : public NcmpiException
{
public:
NcNullType(const char* complaint,const char* file,int line);
};
/*!
Thrown if the requested operation is on a NULL dimension.
This exception is thrown if an operation on a NcmpiDim object is requested which is empty. To test if the object is empty used NcmpiDim::isNull()
*/
class NcNullDim : public NcmpiException
{
public:
NcNullDim(const char* complaint,const char* file,int line);
};
/*!
Thrown if an operation to set the chunking, endianness, fill of a NcmpiVar object is issued after a
call to NcmpiVar::getVar or NcmpiVar::putVar has been made.
*/
class NcElateDef : public NcmpiException
{
public:
NcElateDef(const char* complaint,const char* file,int line);
};
}
}
namespace PnetCDF
{
class NcmpiGroup; // forward declaration.
/*! Class represents a netCDF dimension */
class NcmpiDim {
public:
/*! destructor*/
~NcmpiDim(){};
/*! Constructor generates a \ref isNull "null object". */
NcmpiDim ();
/*!
Constructor for a dimension .
The dimension must already exist in the netCDF file. New netCDF variables can be added using NcmpiGroup::addNcmpiDim();
\param grp Parent NcmpiGroup object.
\param dimId Id of the NcmpiDim object.
*/
NcmpiDim(const NcmpiGroup& grp, int dimId);
/*! assignment operator */
NcmpiDim& operator =(const NcmpiDim &);
/*! equivalence operator */
bool operator==(const NcmpiDim& rhs) const;
/*! != operator */
bool operator!=(const NcmpiDim& rhs) const;
/*! The copy constructor. */
NcmpiDim(const NcmpiDim& ncmpiDim);
/*! The name of this dimension.*/
const std::string getName() const;
/*! The netCDF Id of this dimension. */
int getId() const {return myId;};
/*! Gets a NcmpiGroup object of the parent group. */
NcmpiGroup getParentGroup() const;
/*! Returns true if this is an unlimited dimension */
bool isUnlimited() const;
/*! The size of the dimension; for unlimited, this is the number of records written so far. */
MPI_Offset getSize() const;
/*!renames the dimension */
void rename( const std::string& newName);
/*! Returns true if this object is null (i.e. it has no contents); otherwise returns false. */
bool isNull() const {return nullObject;}
/*! comparator operator */
friend bool operator<(const NcmpiDim& lhs,const NcmpiDim& rhs);
/*! comparator operator */
friend bool operator>(const NcmpiDim& lhs,const NcmpiDim& rhs);
private:
bool nullObject;
int myId;
int groupId;
};
}
//! C++ API for PnetCDF.
namespace PnetCDF
{
/*!
Class represents a netCDF root group.
The Ncfile class is the same as the NcmpiGroup class with the additional
functionality for opening and closing files.
*/
class NcmpiFile : public NcmpiGroup
{
public:
enum FileMode
{
read, //!< File exists, open read-only.
write, //!< File exists, open for writing.
replace, //!< Create new file, even if already exists.
newFile //!< Create new file, fail if already exists.
};
enum FileFormat
{
classic, //!< Classic format, classic data model
classic2, //!< 64-bit offset format, classic data model
nc4, //!< (default) netCDF-4/HDF5 format, enhanced data model
nc4classic, //!< netCDF-4/HDF5 format, classic data model
classic5, //!< CDF-5 format, classic data model
BadFormat
};
/*! Constructor generates a \ref isNull "null object". */
NcmpiFile();
/*!
Creates/opens a netCDF file.
\param comm MPI intra-communicator
\param filePath Name of netCDF optional path.
\param fMode The file mode:
- 'read' File exists, open for read-only.
- 'write' File exists, open for writing.
- 'replace' Create new file, even it already exists.
- 'newFile' Create new file, fail it exists already.
\param info MPI info object containing MPI and PnetCDF IO hints
*/
NcmpiFile(const MPI_Comm &comm,
const std::string &filePath,
FileMode fMode,
const MPI_Info &info = MPI_INFO_NULL);
/*!
Creates a netCDF file of a specified format.
\param comm MPI intra-communicator
\param filePath Name of netCDF optional path.
\param fMode The file mode:
- 'replace' Create new file, even it already exists.
- 'newFile' Create new file, fail it exists already.
\param info MPI info object containing MPI and PnetCDF IO hints
*/
NcmpiFile(const MPI_Comm &comm,
const std::string &filePath,
FileMode fMode,
FileFormat fFormat,
const MPI_Info &info = MPI_INFO_NULL);
/*! destructor */
virtual ~NcmpiFile(); //closes file and releases all resources
//! Synchronize an open netcdf dataset to disk
void sync();
//! Leave define mode, used for classic model
void enddef();
FileFormat getFormat( void ) const;
void Wait_all(int num, int *array_of_requests, int *array_of_statuses);
void Wait(int num, int *array_of_requests, int *array_of_statuses);
void Cancel(int num, int *array_of_requests, int *array_of_statuses);
void Buffer_attach(MPI_Offset bufsize);
void Buffer_detach(void);
void Inq_nreqs(int *nreqs);
void Inq_buffer_usage(MPI_Offset *usage);
void Inq_buffer_size(MPI_Offset *buf_size);
void Inq_file_info(MPI_Info *info);
void Inq_put_size(MPI_Offset *put_size);
void Inq_get_size(MPI_Offset *get_size);
void Inq_header_size(MPI_Offset *header_size);
void Inq_header_extent(MPI_Offset *header_extent);
private:
/* Do not allow definition of NcmpiFile involving copying any NcmpiFile
or NcmpiGroup. Because the destructor closes the file and releases
al resources such an action could leave NcmpiFile objects in an
invalid state
*/
NcmpiFile& operator =(const NcmpiGroup & rhs);
NcmpiFile& operator =(const NcmpiFile & rhs);
NcmpiFile(const NcmpiGroup& rhs);
NcmpiFile(const NcmpiFile& rhs);
};
}
namespace PnetCDF
{
class NcmpiGroup; // forward declaration.
class NcmpiVar; // forward declaration.
/*! Class represents a netCDF attribute local to a netCDF variable. */
class NcmpiVarAtt : public NcmpiAtt
{
public:
/*! assignment operator */
NcmpiVarAtt& operator= (const NcmpiVarAtt& rhs);
/*! Constructor generates a \ref isNull "null object". */
NcmpiVarAtt ();
/*! The copy constructor. */
NcmpiVarAtt(const NcmpiVarAtt& rhs) ;
/*!
Constructor for an existing local attribute.
\param grp Parent Group object.
\param NcmpiVar Parent NcmpiVar object.
\param index The index (id) of the attribute.
*/
NcmpiVarAtt(const NcmpiGroup& grp, const NcmpiVar& ncmpiVar, const int index);
/*! Returns the NcmpiVar parent object. */
NcmpiVar getParentVar() const;
/*! comparator operator */
friend bool operator<(const NcmpiVarAtt& lhs,const NcmpiVarAtt& rhs);
/*! comparator operator */
friend bool operator>(const NcmpiVarAtt& lhs,const NcmpiVarAtt& rhs);
};
}
namespace PnetCDF
{
// class NcmpiGroup; // forward declaration.
class NcmpiDim; // forward declaration.
// class NcmpiVarAtt; // forward declaration.
class NcmpiType; // forward declaration.
/*! Class represents a netCDF variable. */
class NcmpiVar
{
public:
/*! Used for chunking specifications (see NcmpiVar::setChunking, NcmpiVar::getChunkingParameters). */
enum ChunkMode
{
/*!
Chunked storage is used for this variable.
*/
ncmpi_CHUNKED = NC_CHUNKED,
/*! Contiguous storage is used for this variable. Variables with one or more unlimited
dimensions cannot use contiguous storage. If contiguous storage is turned on, the
chunkSizes parameter is ignored.
*/
ncmpi_CONTIGUOUS = NC_CONTIGUOUS
};
/*!
Used to specifying the endianess of the data, (see NcmpiVar::setEndianness, NcmpiVar::getEndianness). By default this is NC_ENDIAN_NATIVE.
*/
enum EndianMode
{
ncmpi_ENDIAN_NATIVE = NC_ENDIAN_NATIVE, //!< Native endian.
ncmpi_ENDIAN_LITTLE = NC_ENDIAN_LITTLE, //!< Little endian.
ncmpi_ENDIAN_BIG = NC_ENDIAN_BIG //!< Big endian.
};
/*! Used for checksum specification (see NcmpiVar::setChecksum, NcmpiVar::getChecksum). */
enum ChecksumMode
{
ncmpi_NOCHECKSUM = NC_NOCHECKSUM, //!< No checksum (the default).
ncmpi_FLETCHER32 = NC_FLETCHER32 //!< Selects the Fletcher32 checksum filter.
};
/*! destructor */
~NcmpiVar(){};
/*! Constructor generates a \ref isNull "null object". */
NcmpiVar ();
/*! Constructor for a variable .
The variable must already exist in the netCDF file. New netCDF variables can be added using NcmpiGroup::addNcmpiVar();
\param grp Parent NcmpiGroup object.
\param varId Id of the is NcmpiVar object.
*/
NcmpiVar (const NcmpiGroup& grp, const int& varId);
/*! assignment operator */
NcmpiVar& operator =(const NcmpiVar& rhs);
/*! equivalence operator */
bool operator==(const NcmpiVar& rhs) const;
/*! != operator */
bool operator!=(const NcmpiVar& rhs) const;
/*! The copy constructor. */
NcmpiVar(const NcmpiVar& ncmpiVar);
/*! Name of this NcmpiVar object.*/
std::string getName() const;
/*! Gets parent group. */
NcmpiGroup getParentGroup() const;
/*! Returns the variable type. */
NcmpiType getType() const;
/*! Rename the variable. */
void rename( const std::string& newname ) const;
/*! Get the variable id. */
int getId() const;
/*! Returns true if this object variable is not defined. */
bool isNull() const {return nullObject;}
/*! comparator operator */
friend bool operator<(const NcmpiVar& lhs,const NcmpiVar& rhs);
/*! comparator operator */
friend bool operator>(const NcmpiVar& lhs,const NcmpiVar& rhs);
/////////////////
// Information about Dimensions
/////////////////
/*! The the number of dimensions. */
int getDimCount() const ;
/*! Gets the i'th NcmpiDim object. */
NcmpiDim getDim(int i) const;
/*! Gets the set of NcmpiDim objects. */
std::vector<NcmpiDim> getDims() const;
/////////////////
// Information about Attributes
/////////////////
/*! Gets the number of attributes. */
int getAttCount() const;
/*! Gets attribute by name */
NcmpiVarAtt getAtt(const std::string& name) const;
/*! Gets the set of attributes. */
std::map<std::string,NcmpiVarAtt> getAtts() const;
/////////////////////////
/*! \overload
*/
NcmpiVarAtt putAtt(const std::string& name, const std::string& dataValues) const ;
/*! \overload
*/
NcmpiVarAtt putAtt(const std::string& name, const NcmpiType& type, MPI_Offset len, const unsigned char* dataValues) const ;
/*! \overload
*/
NcmpiVarAtt putAtt(const std::string& name, const NcmpiType& type, MPI_Offset len, const signed char* dataValues) const ;
/*! \overload
*/
NcmpiVarAtt putAtt(const std::string& name, const NcmpiType& type, short datumValue) const ;
/*! \overload
*/
NcmpiVarAtt putAtt(const std::string& name, const NcmpiType& type, int datumValue) const ;
/*! \overload
*/
NcmpiVarAtt putAtt(const std::string& name, const NcmpiType& type, long datumValue) const ;
/*! \overload
*/
NcmpiVarAtt putAtt(const std::string& name, const NcmpiType& type, float datumValue) const ;
/*! \overload
*/
NcmpiVarAtt putAtt(const std::string& name, const NcmpiType& type, double datumValue) const ;
/*! \overload
*/
NcmpiVarAtt putAtt(const std::string& name, const NcmpiType& type, unsigned short datumValue) const ;
/*! \overload
*/
NcmpiVarAtt putAtt(const std::string& name, const NcmpiType& type, unsigned int datumValue) const ;
/*! \overload
*/
NcmpiVarAtt putAtt(const std::string& name, const NcmpiType& type, unsigned long long datumValue) const ;
/*! \overload
*/
NcmpiVarAtt putAtt(const std::string& name, const NcmpiType& type, long long datumValue) const ;
/*! \overload
*/
NcmpiVarAtt putAtt(const std::string& name, const NcmpiType& type, MPI_Offset len, const short* dataValues) const ;
/*! \overload
*/
NcmpiVarAtt putAtt(const std::string& name, const NcmpiType& type, MPI_Offset len, const int* dataValues) const ;
/*! \overload
*/
NcmpiVarAtt putAtt(const std::string& name, const NcmpiType& type, MPI_Offset len, const long* dataValues) const ;
/*! \overload
*/
NcmpiVarAtt putAtt(const std::string& name, const NcmpiType& type, MPI_Offset len, const float* dataValues) const ;
/*! \overload
*/
NcmpiVarAtt putAtt(const std::string& name, const NcmpiType& type, MPI_Offset len, const double* dataValues) const ;
/*! \overload
*/
NcmpiVarAtt putAtt(const std::string& name, const NcmpiType& type, MPI_Offset len, const unsigned short* dataValues) const ;
/*! \overload
*/
NcmpiVarAtt putAtt(const std::string& name, const NcmpiType& type, MPI_Offset len, const unsigned int* dataValues) const ;
/*! \overload
*/
NcmpiVarAtt putAtt(const std::string& name, const NcmpiType& type, MPI_Offset len, const unsigned long long* dataValues) const ;
/*! \overload
*/
NcmpiVarAtt putAtt(const std::string& name, const NcmpiType& type, MPI_Offset len, const long long* dataValues) const ;
/*!
Creates a new variable attribute or if already exisiting replaces it.
If you are writing a _Fill_Value_ attribute, and will tell the HDF5 layer to use
the specified fill value for that variable.
\par
Although it's possible to create attributes of all types, text and double attributes are adequate for most purposes.
\param name Name of attribute.
\param type The attribute type.
\param len The length of the attribute (number of Nctype repeats).
\param dataValues Data Values to put into the new attribute.
If the type of data values differs from the netCDF variable type, type conversion will occur.
(However, no type conversion is carried out for variables using the user-defined data types:
ncmpi_Vlen, ncmpi_Opaque, ncmpi_Compound and ncmpi_Enum.)
\return The NcmpiVarAtt object for this new netCDF attribute.
*/
NcmpiVarAtt putAtt(const std::string& name, const NcmpiType& type, MPI_Offset len, const void* dataValues) const ;
////////////////////
// Chunking details
////////////////////
/*! Sets chunking parameters.
\param chunkMode Enumeration type. Allowable parameters are: "ncmpi_CONTIGUOUS", "ncmpi_CHUNKED"
\param chunksizes Shape of chunking, used if ChunkMode=ncmpi_CHUNKED.
*/
void setChunking(ChunkMode chunkMode, std::vector<MPI_Offset>& chunksizes) const;
/*! Gets the chunking parameters
\param chunkMode On return contains either: "ncmpi_CONTIGUOUS" or "ncmpi_CHUNKED"
\param chunksizes On return contains shape of chunking, used if ChunkMode=ncmpi_CHUNKED.
*/
void getChunkingParameters(ChunkMode& chunkMode, std::vector<MPI_Offset>& chunkSizes) const;
////////////////////
// Fill details
////////////////////
// Sets the fill parameters
/*!
\overload
*/
void setFill(bool fillMode, void *fillValue=NULL) const;
/*!
This is an overloaded member function, provided for convenience.
It differs from the above function in what argument(s) it accepts.
The function can be used for any type, including user-defined types.
\param fillMode Setting to true, turns on fill mode.
\param fillValue Pointer to fill value.
Must be the same type as the variable. Ignored if fillMode=.false.
*/
// void setFill(bool fillMode,const void* fillValue=NULL) const;
/*! Sets the fill parameters
\param fillMode Setting to true, turns on fill mode.
\param fillValue Fill value for the variable.
Must be the same type as the variable. Ignored if fillMode=.false.
*/
/*
template<class T>
void setFill(bool fillMode, T fillValue) const
{
ncmpiCheck(ncmpi_def_var_fill(groupId,myId,static_cast<int> (!fillMode),&fillValue),__FILE__,__LINE__);
}
*/
/*!
This is an overloaded member function, provided for convenience.
It differs from the above function in what argument(s) it accepts.
The function can be used for any type, including user-defined types.
\param fillMode On return set to true if fill mode is enabled.
\param fillValue On return containts a pointer to fill value.
Must be the same type as the variable. Ignored if fillMode=.false.
*/
void getFillModeParameters(bool& fillMode, void* fillValue=NULL) const;
/*! Gets the fill parameters
\param On return set to true if fill mode is enabled.
\param On return is set to the fill value.
*/
template <class T> void getFillModeParameters(bool& fillMode,T& fillValue) const{
int fillModeInt;
ncmpiCheck(ncmpi_inq_var_fill(groupId,myId,&fillModeInt,&fillValue),__FILE__,__LINE__);
fillMode= static_cast<bool> (fillModeInt == 0);
}
/* fill variable */
void fillRec(MPI_Offset recno) const;
////////////////////
// Compression details
////////////////////
/*! Sets the compression parameters
\param enableShuffleFilter Set to true to turn on shuffle filter.
\param enableDeflateFilter Set to true to turn on deflate filter.
\param deflateLevel The deflate level, must be 0 and 9.
*/
void setCompression(bool enableShuffleFilter, bool enableDeflateFilter, int deflateLevel) const;
/*! Gets the compression parameters
\param enableShuffleFilter On return set to true if the shuffle filter is enabled.
\param enableDeflateFilter On return set to true if the deflate filter is enabled.
\param deflateLevel On return set to the deflate level.
*/
void getCompressionParameters(bool& shuffleFilterEnabled, bool& deflateFilterEnabled, int& deflateLevel) const;
////////////////////
// Endianness details
////////////////////
/*! Sets the endianness of the variable.
\param Endianness enumeration type. Allowable parameters are: "ncmpi_ENDIAN_NATIVE" (the default), "ncmpi_ENDIAN_LITTLE", "ncmpi_ENDIAN_BIG"
*/
void setEndianness(EndianMode endianMode) const;
/*! Gets the endianness of the variable.
\return Endianness enumeration type. Allowable parameters are: "ncmpi_ENDIAN_NATIVE" (the default), "ncmpi_ENDIAN_LITTLE", "ncmpi_ENDIAN_BIG"
*/
EndianMode getEndianness() const;
////////////////////
// Checksum details
////////////////////
/*! Sets the checksum parameters of a variable.
\param ChecksumMode Enumeration type. Allowable parameters are: "ncmpi_NOCHECKSUM", "ncmpi_FLETCHER32".
*/
void setChecksum(ChecksumMode checksumMode) const;
/*! Gets the checksum parameters of the variable.
\return ChecksumMode Enumeration type. Allowable parameters are: "ncmpi_NOCHECKSUM", "ncmpi_FLETCHER32".
*/
ChecksumMode getChecksum() const;
////////////////////
// data reading
////////////////////
// Reads the entire data into the netCDF variable. (independent data mode)
/*!
This is an overloaded member function, provided for convenience.
It differs from the above function in what argument(s) it accepts.
In addition, no data conversion is carried out. This means that
the type of the data in memory must match the type of the variable.
*/
// void getVar(void* dataValues) const;
/*! \overload
*/
void getVar(char* dataValues) const;
/*! \overload
*/
void getVar(unsigned char* dataValues) const;
/*! \overload
*/
void getVar(signed char* dataValues) const;
/*! \overload
*/
void getVar(short* dataValues) const;
/*! \overload
*/
void getVar(int* dataValues) const;
/*! \overload
*/
void getVar(long* dataValues) const;
/*! \overload
*/
void getVar(float* dataValues) const;
/*! \overload
*/
void getVar(double* dataValues) const;
/*! \overload
*/
void getVar(unsigned short* dataValues) const;
/*! \overload
*/
void getVar(unsigned int* dataValues) const;
/*! \overload
*/
void getVar(unsigned long long* dataValues) const;
/*!
Reads the entire data from an netCDF variable.
This is the simplest interface to use for reading the value of a scalar variable
or when all the values of a multidimensional variable can be read at once. The values
are read into consecutive locations with the last dimension varying fastest.
Take care when using the simplest forms of this interface with record variables when you
don't specify how many records are to be read. If you try to read all the values of a
record variable into an array but there are more records in the file than you assume,
more data will be read than you expect, which may cause a segmentation violation.
\param dataValues Pointer to the location into which the data value is read. If the type of
data value differs from the netCDF variable type, type conversion will occur.
(However, no type conversion is carried out for variables using the user-defined data types:
ncmpi_Vlen, ncmpi_Opaque, ncmpi_Compound and ncmpi_Enum.)
*/
void getVar(long long* dataValues) const;
void getVar(void* dataValues, MPI_Offset bufcount, MPI_Datatype buftype) const;
//////////////////////
// Reads a single datum value from a variable of an open netCDF dataset.
/*!
This is an overloaded member function, provided for convenience.
It differs from the above function in what argument(s) it accepts.
In addition, no data conversion is carried out. This means that
the type of the data in memory must match the type of the variable.
*/
// void getVar(const std::vector<MPI_Offset>& index, void* dataumValue) const;
/*! \overload
*/
void getVar(const std::vector<MPI_Offset>& index, char* dataumValue) const;
/*! \overload
*/
void getVar(const std::vector<MPI_Offset>& index, unsigned char* dataumValue) const;
/*! \overload
*/
void getVar(const std::vector<MPI_Offset>& index, signed char* dataumValue) const;
/*! \overload
*/
void getVar(const std::vector<MPI_Offset>& index, short* dataumValue) const;
/*! \overload
*/
void getVar(const std::vector<MPI_Offset>& index, int* dataumValue) const;
/*! \overload
*/
void getVar(const std::vector<MPI_Offset>& index, long* dataumValue) const;
/*! \overload
*/
void getVar(const std::vector<MPI_Offset>& index, float* dataumValue) const;
/*! \overload
*/
void getVar(const std::vector<MPI_Offset>& index, double* dataumValue) const;
/*! \overload
*/
void getVar(const std::vector<MPI_Offset>& index, unsigned short* dataumValue) const;
/*! \overload
*/
void getVar(const std::vector<MPI_Offset>& index, unsigned int* dataumValue) const;
/*! \overload
*/
void getVar(const std::vector<MPI_Offset>& index, unsigned long long* dataumValue) const;
/*! Reads a single datum value from a variable of an open netCDF dataset.
The value is converted from the external data type of the variable, if necessary.
\param index Vector specifying the index of the data value to be read.
The indices are relative to 0, so for example, the first data value of a two-dimensional
variable would have index (0,0). The elements of index must correspond to the variable's dimensions.
Hence, if the variable is a record variable, the first index is the record number.
\param datumValue Pointer to the location into which the data value is read. If the type of
data value differs from the netCDF variable type, type conversion will occur.
(However, no type conversion is carried out for variables using the user-defined data types:
ncmpi_Vlen, ncmpi_Opaque, ncmpi_Compound and ncmpi_Enum.)
*/
void getVar(const std::vector<MPI_Offset>& index, long long* dataumValue) const;
void getVar(const std::vector<MPI_Offset>& index, void* dataumValue, MPI_Offset bufcount, MPI_Datatype buftype) const;
//////////////////////
// Reads an array of values from a netCDF variable of an open netCDF dataset.
/*!
This is an overloaded member function, provided for convenience.
It differs from the above function in what argument(s) it accepts.
In addition, no data conversion is carried out. This means that
the type of the data in memory must match the type of the variable.
*/
// void getVar(const std::vector<MPI_Offset>& start, const std::vector<MPI_Offset>& count, void* dataValues) const;
/*! \overload
*/
void getVar(const std::vector<MPI_Offset>& start, const std::vector<MPI_Offset>& count, char* dataValues) const;
/*! \overload
*/
void getVar(const std::vector<MPI_Offset>& start, const std::vector<MPI_Offset>& count, unsigned char* dataValues) const;
/*! \overload
*/
void getVar(const std::vector<MPI_Offset>& start, const std::vector<MPI_Offset>& count, signed char* dataValues) const;
/*! \overload
*/
void getVar(const std::vector<MPI_Offset>& start, const std::vector<MPI_Offset>& count, short* dataValues) const;
/*! \overload
*/
void getVar(const std::vector<MPI_Offset>& start, const std::vector<MPI_Offset>& count, int* dataValues) const;
/*! \overload
*/
void getVar(const std::vector<MPI_Offset>& start, const std::vector<MPI_Offset>& count, long* dataValues) const;
/*! \overload
*/
void getVar(const std::vector<MPI_Offset>& start, const std::vector<MPI_Offset>& count, float* dataValues) const;
/*! \overload
*/
void getVar(const std::vector<MPI_Offset>& start, const std::vector<MPI_Offset>& count, double* dataValues) const;
/*! \overload
*/
void getVar(const std::vector<MPI_Offset>& start, const std::vector<MPI_Offset>& count, unsigned short* dataValues) const;
/*! \overload
*/
void getVar(const std::vector<MPI_Offset>& start, const std::vector<MPI_Offset>& count, unsigned int* dataValues) const;
/*! \overload
*/
void getVar(const std::vector<MPI_Offset>& start, const std::vector<MPI_Offset>& count, unsigned long long* dataValues) const;
/*!
Reads an array of values from a netCDF variable of an open netCDF dataset.
The array is specified by giving a corner and a vector of edge lengths.
The values are read into consecutive locations with the last dimension varying fastest.
\param start
Vector specifying the index in the variable where the first of the data values will be read.
The indices are relative to 0, so for example, the first data value of a variable would have index (0, 0, ... , 0).
The length of start must be the same as the number of dimensions of the specified variable.
The elements of start correspond, in order, to the variable's dimensions. Hence, if the variable is a record variable,
the first index would correspond to the starting record number for reading the data values.
\param count
Vector specifying the edge lengths along each dimension of the block of data values to be read.
To read a single value, for example, specify count as (1, 1, ... , 1). The length of count is the number of
dimensions of the specified variable. The elements of count correspond, in order, to the variable's dimensions.
Hence, if the variable is a record variable, the first element of count corresponds to a count of the number of records to read.
Note: setting any element of the count array to zero causes the function to exit without error, and without doing anything.
\param dataValues Pointer to the location into which the data value is read. If the type of
data value differs from the netCDF variable type, type conversion will occur.
(However, no type conversion is carried out for variables using the user-defined data types:
ncmpi_Vlen, ncmpi_Opaque, ncmpi_Compound and ncmpi_Enum.)
*/
void getVar(const std::vector<MPI_Offset>& start, const std::vector<MPI_Offset>& count, long long* dataValues) const;
void getVar(const std::vector<MPI_Offset>& start, const std::vector<MPI_Offset>& count, void* dataValues, MPI_Offset bufcount, MPI_Datatype buftype) const;
//////////////////////
// Reads a subsampled (strided) array section of values from a netCDF variable.
/*!
This is an overloaded member function, provided for convenience.
It differs from the above function in what argument(s) it accepts.
In addition, no data conversion is carried out. This means that
the type of the data in memory must match the type of the variable.
*/
// void getVar(const std::vector<MPI_Offset>& start, const std::vector<MPI_Offset>& count, const std::vector<MPI_Offset>& stride, void* dataValues) const;
/*! \overload
*/
void getVar(const std::vector<MPI_Offset>& start, const std::vector<MPI_Offset>& count, const std::vector<MPI_Offset>& stride, char* dataValues) const;
/*! \overload
*/
void getVar(const std::vector<MPI_Offset>& start, const std::vector<MPI_Offset>& count, const std::vector<MPI_Offset>& stride, unsigned char* dataValues) const;
/*! \overload
*/
void getVar(const std::vector<MPI_Offset>& start, const std::vector<MPI_Offset>& count, const std::vector<MPI_Offset>& stride, signed char* dataValues) const;
/*! \overload
*/
void getVar(const std::vector<MPI_Offset>& start, const std::vector<MPI_Offset>& count, const std::vector<MPI_Offset>& stride, short* dataValues) const;
/*! \overload
*/
void getVar(const std::vector<MPI_Offset>& start, const std::vector<MPI_Offset>& count, const std::vector<MPI_Offset>& stride, int* dataValues) const;
/*! \overload
*/
void getVar(const std::vector<MPI_Offset>& start, const std::vector<MPI_Offset>& count, const std::vector<MPI_Offset>& stride, long* dataValues) const;
/*! \overload
*/
void getVar(const std::vector<MPI_Offset>& start, const std::vector<MPI_Offset>& count, const std::vector<MPI_Offset>& stride, float* dataValues) const;
/*! \overload
*/
void getVar(const std::vector<MPI_Offset>& start, const std::vector<MPI_Offset>& count, const std::vector<MPI_Offset>& stride, double* dataValues) const;
/*! \overload
*/
void getVar(const std::vector<MPI_Offset>& start, const std::vector<MPI_Offset>& count, const std::vector<MPI_Offset>& stride, unsigned short* dataValues) const;
/*! \overload
*/
void getVar(const std::vector<MPI_Offset>& start, const std::vector<MPI_Offset>& count, const std::vector<MPI_Offset>& stride, unsigned int* dataValues) const;
/*! \overload
*/
void getVar(const std::vector<MPI_Offset>& start, const std::vector<MPI_Offset>& count, const std::vector<MPI_Offset>& stride, unsigned long long* dataValues) const;
/*!
Reads a subsampled (strided) array section of values from a netCDF variable.
The subsampled array section is specified by giving a corner, a vector of edge lengths, and a stride vector.
The values are read with the last dimension of the netCDF variable varying fastest.
\param start
Vector specifying the index in the variable where the first of the data values will be read.
The indices are relative to 0, so for example, the first data value of a variable would have index (0, 0, ... , 0).
The length of start must be the same as the number of dimensions of the specified variable.
The elements of start correspond, in order, to the variable's dimensions. Hence, if the variable is a record variable,
the first index would correspond to the starting record number for reading the data values.
\param count
Vector specifying the edge lengths along each dimension of the block of data values to be read.
To read a single value, for example, specify count as (1, 1, ... , 1). The length of count is the number of
dimensions of the specified variable. The elements of count correspond, in order, to the variable's dimensions.
Hence, if the variable is a record variable, the first element of count corresponds to a count of the number of records to read.
Note: setting any element of the count array to zero causes the function to exit without error, and without doing anything.
\param stride
Vector specifying the interval between selected indices. The elements of the stride vector correspond, in order,
to the variable's dimensions. A value of 1 accesses adjacent values of the netCDF variable in the corresponding
dimension; a value of 2 accesses every other value of the netCDF variable in the corresponding dimension; and so
on. A NULL stride argument is treated as (1, 1, ... , 1).
\param dataValues Pointer to the location into which the data value is read. If the type of
data value differs from the netCDF variable type, type conversion will occur.
(However, no type conversion is carried out for variables using the user-defined data types:
ncmpi_Vlen, ncmpi_Opaque, ncmpi_Compound and ncmpi_Enum.)
*/
void getVar(const std::vector<MPI_Offset>& start, const std::vector<MPI_Offset>& count, const std::vector<MPI_Offset>& stride, long long* dataValues) const;
void getVar(const std::vector<MPI_Offset>& start, const std::vector<MPI_Offset>& count, const std::vector<MPI_Offset>& stride, void* dataValues, MPI_Offset bufcount, MPI_Datatype buftype) const;
//////////////////////
// Reads a mapped array section of values from a netCDF variable.
/*!
This is an overloaded member function, provided for convenience.
It differs from the above function in what argument(s) it accepts.
In addition, no data conversion is carried out. This means that
the type of the data in memory must match the type of the variable.
*/
// void getVar(const std::vector<MPI_Offset>& start, const std::vector<MPI_Offset>& count, const std::vector<MPI_Offset>& stride, const std::vector<MPI_Offset>& imap, void* dataValues) const;
/*! \overload
*/
void getVar(const std::vector<MPI_Offset>& start, const std::vector<MPI_Offset>& count, const std::vector<MPI_Offset>& stride, const std::vector<MPI_Offset>& imap, char* dataValues) const;
/*! \overload
*/
void getVar(const std::vector<MPI_Offset>& start, const std::vector<MPI_Offset>& count, const std::vector<MPI_Offset>& stride, const std::vector<MPI_Offset>& imap, unsigned char* dataValues) const;
/*! \overload
*/
void getVar(const std::vector<MPI_Offset>& start, const std::vector<MPI_Offset>& count, const std::vector<MPI_Offset>& stride, const std::vector<MPI_Offset>& imap, signed char* dataValues) const;
/*! \overload
*/
void getVar(const std::vector<MPI_Offset>& start, const std::vector<MPI_Offset>& count, const std::vector<MPI_Offset>& stride, const std::vector<MPI_Offset>& imap, short* dataValues) const;
/*! \overload
*/
void getVar(const std::vector<MPI_Offset>& start, const std::vector<MPI_Offset>& count, const std::vector<MPI_Offset>& stride, const std::vector<MPI_Offset>& imap, int* dataValues) const;
/*! \overload
*/
void getVar(const std::vector<MPI_Offset>& start, const std::vector<MPI_Offset>& count, const std::vector<MPI_Offset>& stride, const std::vector<MPI_Offset>& imap, long* dataValues) const;
/*! \overload
*/
void getVar(const std::vector<MPI_Offset>& start, const std::vector<MPI_Offset>& count, const std::vector<MPI_Offset>& stride, const std::vector<MPI_Offset>& imap, float* dataValues) const;
/*! \overload
*/
void getVar(const std::vector<MPI_Offset>& start, const std::vector<MPI_Offset>& count, const std::vector<MPI_Offset>& stride, const std::vector<MPI_Offset>& imap, double* dataValues) const;
/*! \overload
*/
void getVar(const std::vector<MPI_Offset>& start, const std::vector<MPI_Offset>& count, const std::vector<MPI_Offset>& stride, const std::vector<MPI_Offset>& imap, unsigned short* dataValues) const;
/*! \overload
*/
void getVar(const std::vector<MPI_Offset>& start, const std::vector<MPI_Offset>& count, const std::vector<MPI_Offset>& stride, const std::vector<MPI_Offset>& imap, unsigned int* dataValues) const;
/*! \overload
*/
void getVar(const std::vector<MPI_Offset>& start, const std::vector<MPI_Offset>& count, const std::vector<MPI_Offset>& stride, const std::vector<MPI_Offset>& imap, unsigned long long* dataValues) const;
/*!
Reads a mapped array section of values from a netCDF variable.
The mapped array section is specified by giving a corner, a vector of edge lengths, a stride vector, and an
index mapping vector. The index mapping vector is a vector of integers that specifies the mapping between the
dimensions of a netCDF variable and the in-memory structure of the internal data array. No assumptions are
made about the ordering or length of the dimensions of the data array.
\param start
Vector specifying the index in the variable where the first of the data values will be read.
The indices are relative to 0, so for example, the first data value of a variable would have index (0, 0, ... , 0).
The length of start must be the same as the number of dimensions of the specified variable.
The elements of start correspond, in order, to the variable's dimensions. Hence, if the variable is a record variable,
the first index would correspond to the starting record number for reading the data values.
\param count
Vector specifying the edge lengths along each dimension of the block of data values to be read.
To read a single value, for example, specify count as (1, 1, ... , 1). The length of count is the number of
dimensions of the specified variable. The elements of count correspond, in order, to the variable's dimensions.
Hence, if the variable is a record variable, the first element of count corresponds to a count of the number of records to read.
Note: setting any element of the count array to zero causes the function to exit without error, and without doing anything.
\param stride
Vector specifying the interval between selected indices. The elements of the stride vector correspond, in order,
to the variable's dimensions. A value of 1 accesses adjacent values of the netCDF variable in the corresponding
dimension; a value of 2 accesses every other value of the netCDF variable in the corresponding dimension; and so
on. A NULL stride argument is treated as (1, 1, ... , 1).
\param imap
Vector of integers that specifies the mapping between the dimensions of a netCDF variable and the in-memory
structure of the internal data array. imap[0] gives the distance between elements of the internal array corresponding
to the most slowly varying dimension of the netCDF variable. imap[n-1] (where n is the rank of the netCDF variable)
gives the distance between elements of the internal array corresponding to the most rapidly varying dimension of the
netCDF variable. Intervening imap elements correspond to other dimensions of the netCDF variable in the obvious way.
Distances between elements are specified in type-independent units of elements (the distance between internal elements
that occupy adjacent memory locations is 1 and not the element's byte-length as in netCDF 2).
\param dataValues Pointer to the location into which the data value is read. If the type of
data value differs from the netCDF variable type, type conversion will occur.
(However, no type conversion is carried out for variables using the user-defined data types:
ncmpi_Vlen, ncmpi_Opaque, ncmpi_Compound and ncmpi_Enum.)
*/
void getVar(const std::vector<MPI_Offset>& start, const std::vector<MPI_Offset>& count, const std::vector<MPI_Offset>& stride, const std::vector<MPI_Offset>& imap, long long* dataValues) const;
void getVar(const std::vector<MPI_Offset>& start, const std::vector<MPI_Offset>& count, const std::vector<MPI_Offset>& stride, const std::vector<MPI_Offset>& imap, void* dataValues, MPI_Offset bufcount, MPI_Datatype buftype) const;
//////////////////////
// Reads the entire data into the netCDF variable. (collective data mode)
/*!
This is an overloaded member function, provided for convenience.
It differs from the above function in what argument(s) it accepts.
In addition, no data conversion is carried out. This means that
the type of the data in memory must match the type of the variable.
*/
// void getVar_all(void* dataValues) const;
/*! \overload
*/
void getVar_all(char* dataValues) const;
/*! \overload
*/
void getVar_all(unsigned char* dataValues) const;
/*! \overload
*/
void getVar_all(signed char* dataValues) const;
/*! \overload
*/
void getVar_all(short* dataValues) const;
/*! \overload
*/
void getVar_all(int* dataValues) const;
/*! \overload
*/
void getVar_all(long* dataValues) const;
/*! \overload
*/
void getVar_all(float* dataValues) const;
/*! \overload
*/
void getVar_all(double* dataValues) const;
/*! \overload
*/
void getVar_all(unsigned short* dataValues) const;
/*! \overload
*/
void getVar_all(unsigned int* dataValues) const;
/*! \overload
*/
void getVar_all(unsigned long long* dataValues) const;
/*!
Reads the entire data from an netCDF variable.
This is the simplest interface to use for reading the value of a scalar variable
or when all the values of a multidimensional variable can be read at once. The values
are read into consecutive locations with the last dimension varying fastest.
Take care when using the simplest forms of this interface with record variables when you
don't specify how many records are to be read. If you try to read all the values of a
record variable into an array but there are more records in the file than you assume,
more data will be read than you expect, which may cause a segmentation violation.
\param dataValues Pointer to the location into which the data value is read. If the type of
data value differs from the netCDF variable type, type conversion will occur.
(However, no type conversion is carried out for variables using the user-defined data types:
ncmpi_Vlen, ncmpi_Opaque, ncmpi_Compound and ncmpi_Enum.)
*/
void getVar_all(long long* dataValues) const;
void getVar_all(void* dataValues, MPI_Offset bufcount, MPI_Datatype buftype) const;
////////////////////
// Reads a single datum value from a variable of an open netCDF dataset.
/*!
This is an overloaded member function, provided for convenience.
It differs from the above function in what argument(s) it accepts.
In addition, no data conversion is carried out. This means that
the type of the data in memory must match the type of the variable.
*/
// void getVar_all(const std::vector<MPI_Offset>& index, void* dataumValue) const;
/*! \overload
*/
void getVar_all(const std::vector<MPI_Offset>& index, char* dataumValue) const;
/*! \overload
*/
void getVar_all(const std::vector<MPI_Offset>& index, unsigned char* dataumValue) const;
/*! \overload
*/
void getVar_all(const std::vector<MPI_Offset>& index, signed char* dataumValue) const;
/*! \overload
*/
void getVar_all(const std::vector<MPI_Offset>& index, short* dataumValue) const;
/*! \overload
*/
void getVar_all(const std::vector<MPI_Offset>& index, int* dataumValue) const;
/*! \overload
*/
void getVar_all(const std::vector<MPI_Offset>& index, long* dataumValue) const;
/*! \overload
*/
void getVar_all(const std::vector<MPI_Offset>& index, float* dataumValue) const;
/*! \overload
*/
void getVar_all(const std::vector<MPI_Offset>& index, double* dataumValue) const;
/*! \overload
*/
void getVar_all(const std::vector<MPI_Offset>& index, unsigned short* dataumValue) const;
/*! \overload
*/
void getVar_all(const std::vector<MPI_Offset>& index, unsigned int* dataumValue) const;
/*! \overload
*/
void getVar_all(const std::vector<MPI_Offset>& index, unsigned long long* dataumValue) const;
/*! Reads a single datum value from a variable of an open netCDF dataset.
The value is converted from the external data type of the variable, if necessary.
\param index Vector specifying the index of the data value to be read.
The indices are relative to 0, so for example, the first data value of a two-dimensional
variable would have index (0,0). The elements of index must correspond to the variable's dimensions.
Hence, if the variable is a record variable, the first index is the record number.
\param datumValue Pointer to the location into which the data value is read. If the type of
data value differs from the netCDF variable type, type conversion will occur.
(However, no type conversion is carried out for variables using the user-defined data types:
ncmpi_Vlen, ncmpi_Opaque, ncmpi_Compound and ncmpi_Enum.)
*/
void getVar_all(const std::vector<MPI_Offset>& index, long long* dataumValue) const;
void getVar_all(const std::vector<MPI_Offset>& index, void* dataumValue, MPI_Offset bufcount, MPI_Datatype buftype) const;
//////////////////////
// Reads an array of values from a netCDF variable of an open netCDF dataset.
/*!
This is an overloaded member function, provided for convenience.
It differs from the above function in what argument(s) it accepts.
In addition, no data conversion is carried out. This means that
the type of the data in memory must match the type of the variable.
*/
// void getVar_all(const std::vector<MPI_Offset>& start, const std::vector<MPI_Offset>& count, void* dataValues) const;
/*! \overload
*/
void getVar_all(const std::vector<MPI_Offset>& start, const std::vector<MPI_Offset>& count, char* dataValues) const;
/*! \overload
*/
void getVar_all(const std::vector<MPI_Offset>& start, const std::vector<MPI_Offset>& count, unsigned char* dataValues) const;
/*! \overload
*/
void getVar_all(const std::vector<MPI_Offset>& start, const std::vector<MPI_Offset>& count, signed char* dataValues) const;
/*! \overload
*/
void getVar_all(const std::vector<MPI_Offset>& start, const std::vector<MPI_Offset>& count, short* dataValues) const;
/*! \overload
*/
void getVar_all(const std::vector<MPI_Offset>& start, const std::vector<MPI_Offset>& count, int* dataValues) const;
/*! \overload
*/
void getVar_all(const std::vector<MPI_Offset>& start, const std::vector<MPI_Offset>& count, long* dataValues) const;
/*! \overload
*/
void getVar_all(const std::vector<MPI_Offset>& start, const std::vector<MPI_Offset>& count, float* dataValues) const;
/*! \overload
*/
void getVar_all(const std::vector<MPI_Offset>& start, const std::vector<MPI_Offset>& count, double* dataValues) const;
/*! \overload
*/
void getVar_all(const std::vector<MPI_Offset>& start, const std::vector<MPI_Offset>& count, unsigned short* dataValues) const;
/*! \overload
*/
void getVar_all(const std::vector<MPI_Offset>& start, const std::vector<MPI_Offset>& count, unsigned int* dataValues) const;
/*! \overload
*/
void getVar_all(const std::vector<MPI_Offset>& start, const std::vector<MPI_Offset>& count, unsigned long long* dataValues) const;
/*!
Reads an array of values from a netCDF variable of an open netCDF dataset.
The array is specified by giving a corner and a vector of edge lengths.
The values are read into consecutive locations with the last dimension varying fastest.
\param start
Vector specifying the index in the variable where the first of the data values will be read.
The indices are relative to 0, so for example, the first data value of a variable would have index (0, 0, ... , 0).
The length of start must be the same as the number of dimensions of the specified variable.
The elements of start correspond, in order, to the variable's dimensions. Hence, if the variable is a record variable,
the first index would correspond to the starting record number for reading the data values.
\param count
Vector specifying the edge lengths along each dimension of the block of data values to be read.
To read a single value, for example, specify count as (1, 1, ... , 1). The length of count is the number of
dimensions of the specified variable. The elements of count correspond, in order, to the variable's dimensions.
Hence, if the variable is a record variable, the first element of count corresponds to a count of the number of records to read.
Note: setting any element of the count array to zero causes the function to exit without error, and without doing anything.
\param dataValues Pointer to the location into which the data value is read. If the type of
data value differs from the netCDF variable type, type conversion will occur.
(However, no type conversion is carried out for variables using the user-defined data types:
ncmpi_Vlen, ncmpi_Opaque, ncmpi_Compound and ncmpi_Enum.)
*/
void getVar_all(const std::vector<MPI_Offset>& start, const std::vector<MPI_Offset>& count, long long* dataValues) const;
void getVar_all(const std::vector<MPI_Offset>& start, const std::vector<MPI_Offset>& count, void* dataValues, MPI_Offset bufcount, MPI_Datatype buftype) const;
//////////////////////
// Reads a subsampled (strided) array section of values from a netCDF variable.
/*!
This is an overloaded member function, provided for convenience.
It differs from the above function in what argument(s) it accepts.
In addition, no data conversion is carried out. This means that
the type of the data in memory must match the type of the variable.
*/
// void getVar_all(const std::vector<MPI_Offset>& start, const std::vector<MPI_Offset>& count, const std::vector<MPI_Offset>& stride, void* dataValues) const;
/*! \overload
*/
void getVar_all(const std::vector<MPI_Offset>& start, const std::vector<MPI_Offset>& count, const std::vector<MPI_Offset>& stride, char* dataValues) const;
/*! \overload
*/
void getVar_all(const std::vector<MPI_Offset>& start, const std::vector<MPI_Offset>& count, const std::vector<MPI_Offset>& stride, unsigned char* dataValues) const;
/*! \overload
*/
void getVar_all(const std::vector<MPI_Offset>& start, const std::vector<MPI_Offset>& count, const std::vector<MPI_Offset>& stride, signed char* dataValues) const;
/*! \overload
*/
void getVar_all(const std::vector<MPI_Offset>& start, const std::vector<MPI_Offset>& count, const std::vector<MPI_Offset>& stride, short* dataValues) const;
/*! \overload
*/
void getVar_all(const std::vector<MPI_Offset>& start, const std::vector<MPI_Offset>& count, const std::vector<MPI_Offset>& stride, int* dataValues) const;
/*! \overload
*/
void getVar_all(const std::vector<MPI_Offset>& start, const std::vector<MPI_Offset>& count, const std::vector<MPI_Offset>& stride, long* dataValues) const;
/*! \overload
*/
void getVar_all(const std::vector<MPI_Offset>& start, const std::vector<MPI_Offset>& count, const std::vector<MPI_Offset>& stride, float* dataValues) const;
/*! \overload
*/
void getVar_all(const std::vector<MPI_Offset>& start, const std::vector<MPI_Offset>& count, const std::vector<MPI_Offset>& stride, double* dataValues) const;
/*! \overload
*/
void getVar_all(const std::vector<MPI_Offset>& start, const std::vector<MPI_Offset>& count, const std::vector<MPI_Offset>& stride, unsigned short* dataValues) const;
/*! \overload
*/
void getVar_all(const std::vector<MPI_Offset>& start, const std::vector<MPI_Offset>& count, const std::vector<MPI_Offset>& stride, unsigned int* dataValues) const;
/*! \overload
*/
void getVar_all(const std::vector<MPI_Offset>& start, const std::vector<MPI_Offset>& count, const std::vector<MPI_Offset>& stride, unsigned long long* dataValues) const;
/*!
Reads a subsampled (strided) array section of values from a netCDF variable.
The subsampled array section is specified by giving a corner, a vector of edge lengths, and a stride vector.
The values are read with the last dimension of the netCDF variable varying fastest.
\param start
Vector specifying the index in the variable where the first of the data values will be read.
The indices are relative to 0, so for example, the first data value of a variable would have index (0, 0, ... , 0).
The length of start must be the same as the number of dimensions of the specified variable.
The elements of start correspond, in order, to the variable's dimensions. Hence, if the variable is a record variable,
the first index would correspond to the starting record number for reading the data values.
\param count
Vector specifying the edge lengths along each dimension of the block of data values to be read.
To read a single value, for example, specify count as (1, 1, ... , 1). The length of count is the number of
dimensions of the specified variable. The elements of count correspond, in order, to the variable's dimensions.
Hence, if the variable is a record variable, the first element of count corresponds to a count of the number of records to read.
Note: setting any element of the count array to zero causes the function to exit without error, and without doing anything.
\param stride
Vector specifying the interval between selected indices. The elements of the stride vector correspond, in order,
to the variable's dimensions. A value of 1 accesses adjacent values of the netCDF variable in the corresponding
dimension; a value of 2 accesses every other value of the netCDF variable in the corresponding dimension; and so
on. A NULL stride argument is treated as (1, 1, ... , 1).
\param dataValues Pointer to the location into which the data value is read. If the type of
data value differs from the netCDF variable type, type conversion will occur.
(However, no type conversion is carried out for variables using the user-defined data types:
ncmpi_Vlen, ncmpi_Opaque, ncmpi_Compound and ncmpi_Enum.)
*/
void getVar_all(const std::vector<MPI_Offset>& start, const std::vector<MPI_Offset>& count, const std::vector<MPI_Offset>& stride, long long* dataValues) const;
void getVar_all(const std::vector<MPI_Offset>& start, const std::vector<MPI_Offset>& count, const std::vector<MPI_Offset>& stride, void* dataValues, MPI_Offset bufcount, MPI_Datatype buftype) const;
//////////////////////
// Reads a mapped array section of values from a netCDF variable.
/*!
This is an overloaded member function, provided for convenience.
It differs from the above function in what argument(s) it accepts.
In addition, no data conversion is carried out. This means that
the type of the data in memory must match the type of the variable.
*/
// void getVar_all(const std::vector<MPI_Offset>& start, const std::vector<MPI_Offset>& count, const std::vector<MPI_Offset>& stride, const std::vector<MPI_Offset>& imap, void* dataValues) const;
/*! \overload
*/
void getVar_all(const std::vector<MPI_Offset>& start, const std::vector<MPI_Offset>& count, const std::vector<MPI_Offset>& stride, const std::vector<MPI_Offset>& imap, char* dataValues) const;
/*! \overload
*/
void getVar_all(const std::vector<MPI_Offset>& start, const std::vector<MPI_Offset>& count, const std::vector<MPI_Offset>& stride, const std::vector<MPI_Offset>& imap, unsigned char* dataValues) const;
/*! \overload
*/
void getVar_all(const std::vector<MPI_Offset>& start, const std::vector<MPI_Offset>& count, const std::vector<MPI_Offset>& stride, const std::vector<MPI_Offset>& imap, signed char* dataValues) const;
/*! \overload
*/
void getVar_all(const std::vector<MPI_Offset>& start, const std::vector<MPI_Offset>& count, const std::vector<MPI_Offset>& stride, const std::vector<MPI_Offset>& imap, short* dataValues) const;
/*! \overload
*/
void getVar_all(const std::vector<MPI_Offset>& start, const std::vector<MPI_Offset>& count, const std::vector<MPI_Offset>& stride, const std::vector<MPI_Offset>& imap, int* dataValues) const;
/*! \overload
*/
void getVar_all(const std::vector<MPI_Offset>& start, const std::vector<MPI_Offset>& count, const std::vector<MPI_Offset>& stride, const std::vector<MPI_Offset>& imap, long* dataValues) const;
/*! \overload
*/
void getVar_all(const std::vector<MPI_Offset>& start, const std::vector<MPI_Offset>& count, const std::vector<MPI_Offset>& stride, const std::vector<MPI_Offset>& imap, float* dataValues) const;
/*! \overload
*/
void getVar_all(const std::vector<MPI_Offset>& start, const std::vector<MPI_Offset>& count, const std::vector<MPI_Offset>& stride, const std::vector<MPI_Offset>& imap, double* dataValues) const;
/*! \overload
*/
void getVar_all(const std::vector<MPI_Offset>& start, const std::vector<MPI_Offset>& count, const std::vector<MPI_Offset>& stride, const std::vector<MPI_Offset>& imap, unsigned short* dataValues) const;
/*! \overload
*/
void getVar_all(const std::vector<MPI_Offset>& start, const std::vector<MPI_Offset>& count, const std::vector<MPI_Offset>& stride, const std::vector<MPI_Offset>& imap, unsigned int* dataValues) const;
/*! \overload
*/
void getVar_all(const std::vector<MPI_Offset>& start, const std::vector<MPI_Offset>& count, const std::vector<MPI_Offset>& stride, const std::vector<MPI_Offset>& imap, unsigned long long* dataValues) const;
/*!
Reads a mapped array section of values from a netCDF variable.
The mapped array section is specified by giving a corner, a vector of edge lengths, a stride vector, and an
index mapping vector. The index mapping vector is a vector of integers that specifies the mapping between the
dimensions of a netCDF variable and the in-memory structure of the internal data array. No assumptions are
made about the ordering or length of the dimensions of the data array.
\param start
Vector specifying the index in the variable where the first of the data values will be read.
The indices are relative to 0, so for example, the first data value of a variable would have index (0, 0, ... , 0).
The length of start must be the same as the number of dimensions of the specified variable.
The elements of start correspond, in order, to the variable's dimensions. Hence, if the variable is a record variable,
the first index would correspond to the starting record number for reading the data values.
\param count
Vector specifying the edge lengths along each dimension of the block of data values to be read.
To read a single value, for example, specify count as (1, 1, ... , 1). The length of count is the number of
dimensions of the specified variable. The elements of count correspond, in order, to the variable's dimensions.
Hence, if the variable is a record variable, the first element of count corresponds to a count of the number of records to read.
Note: setting any element of the count array to zero causes the function to exit without error, and without doing anything.
\param stride
Vector specifying the interval between selected indices. The elements of the stride vector correspond, in order,
to the variable's dimensions. A value of 1 accesses adjacent values of the netCDF variable in the corresponding
dimension; a value of 2 accesses every other value of the netCDF variable in the corresponding dimension; and so
on. A NULL stride argument is treated as (1, 1, ... , 1).
\param imap
Vector of integers that specifies the mapping between the dimensions of a netCDF variable and the in-memory
structure of the internal data array. imap[0] gives the distance between elements of the internal array corresponding
to the most slowly varying dimension of the netCDF variable. imap[n-1] (where n is the rank of the netCDF variable)
gives the distance between elements of the internal array corresponding to the most rapidly varying dimension of the
netCDF variable. Intervening imap elements correspond to other dimensions of the netCDF variable in the obvious way.
Distances between elements are specified in type-independent units of elements (the distance between internal elements
that occupy adjacent memory locations is 1 and not the element's byte-length as in netCDF 2).
\param dataValues Pointer to the location into which the data value is read. If the type of
data value differs from the netCDF variable type, type conversion will occur.
(However, no type conversion is carried out for variables using the user-defined data types:
ncmpi_Vlen, ncmpi_Opaque, ncmpi_Compound and ncmpi_Enum.)
*/
void getVar_all(const std::vector<MPI_Offset>& start, const std::vector<MPI_Offset>& count, const std::vector<MPI_Offset>& stride, const std::vector<MPI_Offset>& imap, long long* dataValues) const;
void getVar_all(const std::vector<MPI_Offset>& start, const std::vector<MPI_Offset>& count, const std::vector<MPI_Offset>& stride, const std::vector<MPI_Offset>& imap, void* dataValues, MPI_Offset bufcount, MPI_Datatype buftype) const;
////////////////////
// Nonblocking data reading
////////////////////
// Reads the entire data into the netCDF variable.
/*!
This is an overloaded member function, provided for convenience.
It differs from the above function in what argument(s) it accepts.
In addition, no data conversion is carried out. This means that
the type of the data in memory must match the type of the variable.
*/
// void igetVar(void* dataValues, int *req) const;
/*! \overload
*/
void igetVar(char* dataValues, int *req) const;
/*! \overload
*/
void igetVar(unsigned char* dataValues, int *req) const;
/*! \overload
*/
void igetVar(signed char* dataValues, int *req) const;
/*! \overload
*/
void igetVar(short* dataValues, int *req) const;
/*! \overload
*/
void igetVar(int* dataValues, int *req) const;
/*! \overload
*/
void igetVar(long* dataValues, int *req) const;
/*! \overload
*/
void igetVar(float* dataValues, int *req) const;
/*! \overload
*/
void igetVar(double* dataValues, int *req) const;
/*! \overload
*/
void igetVar(unsigned short* dataValues, int *req) const;
/*! \overload
*/
void igetVar(unsigned int* dataValues, int *req) const;
/*! \overload
*/
void igetVar(unsigned long long* dataValues, int *req) const;
/*!
Reads the entire data from an netCDF variable.
This is the simplest interface to use for reading the value of a scalar variable
or when all the values of a multidimensional variable can be read at once. The values
are read into consecutive locations with the last dimension varying fastest.
Take care when using the simplest forms of this interface with record variables when you
don't specify how many records are to be read. If you try to read all the values of a
record variable into an array but there are more records in the file than you assume,
more data will be read than you expect, which may cause a segmentation violation.
\param dataValues Pointer to the location into which the data value is read. If the type of
data value differs from the netCDF variable type, type conversion will occur.
(However, no type conversion is carried out for variables using the user-defined data types:
ncmpi_Vlen, ncmpi_Opaque, ncmpi_Compound and ncmpi_Enum.)
*/
void igetVar(long long* dataValues, int *req) const;
void igetVar(void* dataValues, MPI_Offset bufcount, MPI_Datatype buftype, int *req) const;
//////////////////////
// Reads a single datum value from a variable of an open netCDF dataset.
/*!
This is an overloaded member function, provided for convenience.
It differs from the above function in what argument(s) it accepts.
In addition, no data conversion is carried out. This means that
the type of the data in memory must match the type of the variable.
*/
// void igetVar(const std::vector<MPI_Offset>& index, void* dataumValue, int *req) const;
/*! \overload
*/
void igetVar(const std::vector<MPI_Offset>& index, char* dataumValue, int *req) const;
/*! \overload
*/
void igetVar(const std::vector<MPI_Offset>& index, unsigned char* dataumValue, int *req) const;
/*! \overload
*/
void igetVar(const std::vector<MPI_Offset>& index, signed char* dataumValue, int *req) const;
/*! \overload
*/
void igetVar(const std::vector<MPI_Offset>& index, short* dataumValue, int *req) const;
/*! \overload
*/
void igetVar(const std::vector<MPI_Offset>& index, int* dataumValue, int *req) const;
/*! \overload
*/
void igetVar(const std::vector<MPI_Offset>& index, long* dataumValue, int *req) const;
/*! \overload
*/
void igetVar(const std::vector<MPI_Offset>& index, float* dataumValue, int *req) const;
/*! \overload
*/
void igetVar(const std::vector<MPI_Offset>& index, double* dataumValue, int *req) const;
/*! \overload
*/
void igetVar(const std::vector<MPI_Offset>& index, unsigned short* dataumValue, int *req) const;
/*! \overload
*/
void igetVar(const std::vector<MPI_Offset>& index, unsigned int* dataumValue, int *req) const;
/*! \overload
*/
void igetVar(const std::vector<MPI_Offset>& index, unsigned long long* dataumValue, int *req) const;
/*! Reads a single datum value from a variable of an open netCDF dataset.
The value is converted from the external data type of the variable, if necessary.
\param index Vector specifying the index of the data value to be read.
The indices are relative to 0, so for example, the first data value of a two-dimensional
variable would have index (0,0). The elements of index must correspond to the variable's dimensions.
Hence, if the variable is a record variable, the first index is the record number.
\param datumValue Pointer to the location into which the data value is read. If the type of
data value differs from the netCDF variable type, type conversion will occur.
(However, no type conversion is carried out for variables using the user-defined data types:
ncmpi_Vlen, ncmpi_Opaque, ncmpi_Compound and ncmpi_Enum.)
*/
void igetVar(const std::vector<MPI_Offset>& index, long long* dataumValue, int *req) const;
void igetVar(const std::vector<MPI_Offset>& index, void* dataumValue, MPI_Offset bufcount, MPI_Datatype buftype, int *req) const;
//////////////////////
// Reads an array of values from a netCDF variable of an open netCDF dataset.
/*!
This is an overloaded member function, provided for convenience.
It differs from the above function in what argument(s) it accepts.
In addition, no data conversion is carried out. This means that
the type of the data in memory must match the type of the variable.
*/
// void igetVar(const std::vector<MPI_Offset>& start, const std::vector<MPI_Offset>& count, void* dataValues, int *req) const;
/*! \overload
*/
void igetVar(const std::vector<MPI_Offset>& start, const std::vector<MPI_Offset>& count, char* dataValues, int *req) const;
/*! \overload
*/
void igetVar(const std::vector<MPI_Offset>& start, const std::vector<MPI_Offset>& count, unsigned char* dataValues, int *req) const;
/*! \overload
*/
void igetVar(const std::vector<MPI_Offset>& start, const std::vector<MPI_Offset>& count, signed char* dataValues, int *req) const;
/*! \overload
*/
void igetVar(const std::vector<MPI_Offset>& start, const std::vector<MPI_Offset>& count, short* dataValues, int *req) const;
/*! \overload
*/
void igetVar(const std::vector<MPI_Offset>& start, const std::vector<MPI_Offset>& count, int* dataValues, int *req) const;
/*! \overload
*/
void igetVar(const std::vector<MPI_Offset>& start, const std::vector<MPI_Offset>& count, long* dataValues, int *req) const;
/*! \overload
*/
void igetVar(const std::vector<MPI_Offset>& start, const std::vector<MPI_Offset>& count, float* dataValues, int *req) const;
/*! \overload
*/
void igetVar(const std::vector<MPI_Offset>& start, const std::vector<MPI_Offset>& count, double* dataValues, int *req) const;
/*! \overload
*/
void igetVar(const std::vector<MPI_Offset>& start, const std::vector<MPI_Offset>& count, unsigned short* dataValues, int *req) const;
/*! \overload
*/
void igetVar(const std::vector<MPI_Offset>& start, const std::vector<MPI_Offset>& count, unsigned int* dataValues, int *req) const;
/*! \overload
*/
void igetVar(const std::vector<MPI_Offset>& start, const std::vector<MPI_Offset>& count, unsigned long long* dataValues, int *req) const;
/*!
Reads an array of values from a netCDF variable of an open netCDF dataset.
The array is specified by giving a corner and a vector of edge lengths.
The values are read into consecutive locations with the last dimension varying fastest.
\param start
Vector specifying the index in the variable where the first of the data values will be read.
The indices are relative to 0, so for example, the first data value of a variable would have index (0, 0, ... , 0).
The length of start must be the same as the number of dimensions of the specified variable.
The elements of start correspond, in order, to the variable's dimensions. Hence, if the variable is a record variable,
the first index would correspond to the starting record number for reading the data values.
\param count
Vector specifying the edge lengths along each dimension of the block of data values to be read.
To read a single value, for example, specify count as (1, 1, ... , 1). The length of count is the number of
dimensions of the specified variable. The elements of count correspond, in order, to the variable's dimensions.
Hence, if the variable is a record variable, the first element of count corresponds to a count of the number of records to read.
Note: setting any element of the count array to zero causes the function to exit without error, and without doing anything.
\param dataValues Pointer to the location into which the data value is read. If the type of
data value differs from the netCDF variable type, type conversion will occur.
(However, no type conversion is carried out for variables using the user-defined data types:
ncmpi_Vlen, ncmpi_Opaque, ncmpi_Compound and ncmpi_Enum.)
*/
void igetVar(const std::vector<MPI_Offset>& start, const std::vector<MPI_Offset>& count, long long* dataValues, int *req) const;
void igetVar(const std::vector<MPI_Offset>& start, const std::vector<MPI_Offset>& count, void* dataValues, MPI_Offset bufcount, MPI_Datatype buftype, int *req) const;
//////////////////////
// Reads a subsampled (strided) array section of values from a netCDF variable.
/*!
This is an overloaded member function, provided for convenience.
It differs from the above function in what argument(s) it accepts.
In addition, no data conversion is carried out. This means that
the type of the data in memory must match the type of the variable.
*/
// void igetVar(const std::vector<MPI_Offset>& start, const std::vector<MPI_Offset>& count, const std::vector<MPI_Offset>& stride, void* dataValues, int *req) const;
/*! \overload
*/
void igetVar(const std::vector<MPI_Offset>& start, const std::vector<MPI_Offset>& count, const std::vector<MPI_Offset>& stride, char* dataValues, int *req) const;
/*! \overload
*/
void igetVar(const std::vector<MPI_Offset>& start, const std::vector<MPI_Offset>& count, const std::vector<MPI_Offset>& stride, unsigned char* dataValues, int *req) const;
/*! \overload
*/
void igetVar(const std::vector<MPI_Offset>& start, const std::vector<MPI_Offset>& count, const std::vector<MPI_Offset>& stride, signed char* dataValues, int *req) const;
/*! \overload
*/
void igetVar(const std::vector<MPI_Offset>& start, const std::vector<MPI_Offset>& count, const std::vector<MPI_Offset>& stride, short* dataValues, int *req) const;
/*! \overload
*/
void igetVar(const std::vector<MPI_Offset>& start, const std::vector<MPI_Offset>& count, const std::vector<MPI_Offset>& stride, int* dataValues, int *req) const;
/*! \overload
*/
void igetVar(const std::vector<MPI_Offset>& start, const std::vector<MPI_Offset>& count, const std::vector<MPI_Offset>& stride, long* dataValues, int *req) const;
/*! \overload
*/
void igetVar(const std::vector<MPI_Offset>& start, const std::vector<MPI_Offset>& count, const std::vector<MPI_Offset>& stride, float* dataValues, int *req) const;
/*! \overload
*/
void igetVar(const std::vector<MPI_Offset>& start, const std::vector<MPI_Offset>& count, const std::vector<MPI_Offset>& stride, double* dataValues, int *req) const;
/*! \overload
*/
void igetVar(const std::vector<MPI_Offset>& start, const std::vector<MPI_Offset>& count, const std::vector<MPI_Offset>& stride, unsigned short* dataValues, int *req) const;
/*! \overload
*/
void igetVar(const std::vector<MPI_Offset>& start, const std::vector<MPI_Offset>& count, const std::vector<MPI_Offset>& stride, unsigned int* dataValues, int *req) const;
/*! \overload
*/
void igetVar(const std::vector<MPI_Offset>& start, const std::vector<MPI_Offset>& count, const std::vector<MPI_Offset>& stride, unsigned long long* dataValues, int *req) const;
/*!
Reads a subsampled (strided) array section of values from a netCDF variable.
The subsampled array section is specified by giving a corner, a vector of edge lengths, and a stride vector.
The values are read with the last dimension of the netCDF variable varying fastest.
\param start
Vector specifying the index in the variable where the first of the data values will be read.
The indices are relative to 0, so for example, the first data value of a variable would have index (0, 0, ... , 0).
The length of start must be the same as the number of dimensions of the specified variable.
The elements of start correspond, in order, to the variable's dimensions. Hence, if the variable is a record variable,
the first index would correspond to the starting record number for reading the data values.
\param count
Vector specifying the edge lengths along each dimension of the block of data values to be read.
To read a single value, for example, specify count as (1, 1, ... , 1). The length of count is the number of
dimensions of the specified variable. The elements of count correspond, in order, to the variable's dimensions.
Hence, if the variable is a record variable, the first element of count corresponds to a count of the number of records to read.
Note: setting any element of the count array to zero causes the function to exit without error, and without doing anything.
\param stride
Vector specifying the interval between selected indices. The elements of the stride vector correspond, in order,
to the variable's dimensions. A value of 1 accesses adjacent values of the netCDF variable in the corresponding
dimension; a value of 2 accesses every other value of the netCDF variable in the corresponding dimension; and so
on. A NULL stride argument is treated as (1, 1, ... , 1).
\param dataValues Pointer to the location into which the data value is read. If the type of
data value differs from the netCDF variable type, type conversion will occur.
(However, no type conversion is carried out for variables using the user-defined data types:
ncmpi_Vlen, ncmpi_Opaque, ncmpi_Compound and ncmpi_Enum.)
*/
void igetVar(const std::vector<MPI_Offset>& start, const std::vector<MPI_Offset>& count, const std::vector<MPI_Offset>& stride, long long* dataValues, int *req) const;
void igetVar(const std::vector<MPI_Offset>& start, const std::vector<MPI_Offset>& count, const std::vector<MPI_Offset>& stride, void* dataValues, MPI_Offset bufcount, MPI_Datatype buftype, int *req) const;
//////////////////////
// Reads a mapped array section of values from a netCDF variable.
/*!
This is an overloaded member function, provided for convenience.
It differs from the above function in what argument(s) it accepts.
In addition, no data conversion is carried out. This means that
the type of the data in memory must match the type of the variable.
*/
// void igetVar(const std::vector<MPI_Offset>& start, const std::vector<MPI_Offset>& count, const std::vector<MPI_Offset>& stride, const std::vector<MPI_Offset>& imap, void* dataValues, int *req) const;
/*! \overload
*/
void igetVar(const std::vector<MPI_Offset>& start, const std::vector<MPI_Offset>& count, const std::vector<MPI_Offset>& stride, const std::vector<MPI_Offset>& imap, char* dataValues, int *req) const;
/*! \overload
*/
void igetVar(const std::vector<MPI_Offset>& start, const std::vector<MPI_Offset>& count, const std::vector<MPI_Offset>& stride, const std::vector<MPI_Offset>& imap, unsigned char* dataValues, int *req) const;
/*! \overload
*/
void igetVar(const std::vector<MPI_Offset>& start, const std::vector<MPI_Offset>& count, const std::vector<MPI_Offset>& stride, const std::vector<MPI_Offset>& imap, signed char* dataValues, int *req) const;
/*! \overload
*/
void igetVar(const std::vector<MPI_Offset>& start, const std::vector<MPI_Offset>& count, const std::vector<MPI_Offset>& stride, const std::vector<MPI_Offset>& imap, short* dataValues, int *req) const;
/*! \overload
*/
void igetVar(const std::vector<MPI_Offset>& start, const std::vector<MPI_Offset>& count, const std::vector<MPI_Offset>& stride, const std::vector<MPI_Offset>& imap, int* dataValues, int *req) const;
/*! \overload
*/
void igetVar(const std::vector<MPI_Offset>& start, const std::vector<MPI_Offset>& count, const std::vector<MPI_Offset>& stride, const std::vector<MPI_Offset>& imap, long* dataValues, int *req) const;
/*! \overload
*/
void igetVar(const std::vector<MPI_Offset>& start, const std::vector<MPI_Offset>& count, const std::vector<MPI_Offset>& stride, const std::vector<MPI_Offset>& imap, float* dataValues, int *req) const;
/*! \overload
*/
void igetVar(const std::vector<MPI_Offset>& start, const std::vector<MPI_Offset>& count, const std::vector<MPI_Offset>& stride, const std::vector<MPI_Offset>& imap, double* dataValues, int *req) const;
/*! \overload
*/
void igetVar(const std::vector<MPI_Offset>& start, const std::vector<MPI_Offset>& count, const std::vector<MPI_Offset>& stride, const std::vector<MPI_Offset>& imap, unsigned short* dataValues, int *req) const;
/*! \overload
*/
void igetVar(const std::vector<MPI_Offset>& start, const std::vector<MPI_Offset>& count, const std::vector<MPI_Offset>& stride, const std::vector<MPI_Offset>& imap, unsigned int* dataValues, int *req) const;
/*! \overload
*/
void igetVar(const std::vector<MPI_Offset>& start, const std::vector<MPI_Offset>& count, const std::vector<MPI_Offset>& stride, const std::vector<MPI_Offset>& imap, unsigned long long* dataValues, int *req) const;
/*!
Reads a mapped array section of values from a netCDF variable.
The mapped array section is specified by giving a corner, a vector of edge lengths, a stride vector, and an
index mapping vector. The index mapping vector is a vector of integers that specifies the mapping between the
dimensions of a netCDF variable and the in-memory structure of the internal data array. No assumptions are
made about the ordering or length of the dimensions of the data array.
\param start
Vector specifying the index in the variable where the first of the data values will be read.
The indices are relative to 0, so for example, the first data value of a variable would have index (0, 0, ... , 0).
The length of start must be the same as the number of dimensions of the specified variable.
The elements of start correspond, in order, to the variable's dimensions. Hence, if the variable is a record variable,
the first index would correspond to the starting record number for reading the data values.
\param count
Vector specifying the edge lengths along each dimension of the block of data values to be read.
To read a single value, for example, specify count as (1, 1, ... , 1). The length of count is the number of
dimensions of the specified variable. The elements of count correspond, in order, to the variable's dimensions.
Hence, if the variable is a record variable, the first element of count corresponds to a count of the number of records to read.
Note: setting any element of the count array to zero causes the function to exit without error, and without doing anything.
\param stride
Vector specifying the interval between selected indices. The elements of the stride vector correspond, in order,
to the variable's dimensions. A value of 1 accesses adjacent values of the netCDF variable in the corresponding
dimension; a value of 2 accesses every other value of the netCDF variable in the corresponding dimension; and so
on. A NULL stride argument is treated as (1, 1, ... , 1).
\param imap
Vector of integers that specifies the mapping between the dimensions of a netCDF variable and the in-memory
structure of the internal data array. imap[0] gives the distance between elements of the internal array corresponding
to the most slowly varying dimension of the netCDF variable. imap[n-1] (where n is the rank of the netCDF variable)
gives the distance between elements of the internal array corresponding to the most rapidly varying dimension of the
netCDF variable. Intervening imap elements correspond to other dimensions of the netCDF variable in the obvious way.
Distances between elements are specified in type-independent units of elements (the distance between internal elements
that occupy adjacent memory locations is 1 and not the element's byte-length as in netCDF 2).
\param dataValues Pointer to the location into which the data value is read. If the type of
data value differs from the netCDF variable type, type conversion will occur.
(However, no type conversion is carried out for variables using the user-defined data types:
ncmpi_Vlen, ncmpi_Opaque, ncmpi_Compound and ncmpi_Enum.)
*/
void igetVar(const std::vector<MPI_Offset>& start, const std::vector<MPI_Offset>& count, const std::vector<MPI_Offset>& stride, const std::vector<MPI_Offset>& imap, long long* dataValues, int *req) const;
void igetVar(const std::vector<MPI_Offset>& start, const std::vector<MPI_Offset>& count, const std::vector<MPI_Offset>& stride, const std::vector<MPI_Offset>& imap, void* dataValues, MPI_Offset bufcount, MPI_Datatype buftype, int *req) const;
//////////////////////
// Reads a list of subarrays of values from a netCDF variable of an open netCDF dataset. (independent I/O APIs)
/*!
This is an overloaded member function, provided for convenience.
It differs from the above function in what argument(s) it accepts.
In addition, no data conversion is carried out. This means that
the type of the data in memory must match the type of the variable.
*/
// void getVarn(const int num, MPI_Offset* const starts[], MPI_Offset* const counts[], void* dataValues) const;
/*! \overload
*/
void getVarn(const int num, MPI_Offset* const starts[], MPI_Offset* const counts[], char* dataValues) const;
/*! \overload
*/
void getVarn(const int num, MPI_Offset* const starts[], MPI_Offset* const counts[], unsigned char* dataValues) const;
/*! \overload
*/
void getVarn(const int num, MPI_Offset* const starts[], MPI_Offset* const counts[], signed char* dataValues) const;
/*! \overload
*/
void getVarn(const int num, MPI_Offset* const starts[], MPI_Offset* const counts[], short* dataValues) const;
/*! \overload
*/
void getVarn(const int num, MPI_Offset* const starts[], MPI_Offset* const counts[], int* dataValues) const;
/*! \overload
*/
void getVarn(const int num, MPI_Offset* const starts[], MPI_Offset* const counts[], long* dataValues) const;
/*! \overload
*/
void getVarn(const int num, MPI_Offset* const starts[], MPI_Offset* const counts[], float* dataValues) const;
/*! \overload
*/
void getVarn(const int num, MPI_Offset* const starts[], MPI_Offset* const counts[], double* dataValues) const;
/*! \overload
*/
void getVarn(const int num, MPI_Offset* const starts[], MPI_Offset* const counts[], unsigned short* dataValues) const;
/*! \overload
*/
void getVarn(const int num, MPI_Offset* const starts[], MPI_Offset* const counts[], unsigned int* dataValues) const;
/*! \overload
*/
void getVarn(const int num, MPI_Offset* const starts[], MPI_Offset* const counts[], unsigned long long* dataValues) const;
/*!
Reads a list of subarrays from a netCDF variable of an open netCDF dataset.
Each subarray i is specified by giving a corner (starts[i][*]) and a vector of edge lengths (counts[i][*]).
The values are read into consecutive locations with the last dimension varying fastest.
\param num
Number of subarrays.
\param starts
2D array of size [num][ndims] where num is the number of subarrays to get and ndims if the number of dimensions of the specified variable.
Each subarray i is specified by starts[i][*], the first of the data values will be read, and counts[i][*], edge lengths of the subarray.
The indices are relative to 0, so for example, the first data value of a variable would have index (0, 0, ... , 0).
The length of the second dimension of starts and counts must be the same as the number of dimensions of the specified variable.
The elements of starts's second dimension correspond, in order, to the variable's dimensions. Hence, if the variable is a record variable,
the first element starts[*][0] would correspond to the starting record number for reading the data values.
\param counts
2D array of size [num][ndims] where num is the number of subarrays to get and ndims if the number of dimensions of the specified variable.
To read a single value, for example, specify count as (1, 1, ... , 1). The length of each count[i] is the number of
dimensions of the specified variable. The elements of each count[i] correspond, in order, to the variable's dimensions.
Hence, if the variable is a record variable, the first element of count[i] corresponds to a count of the number of records to read.
Note: setting any element of the count array to zero causes the function to exit without error, and without doing anything.
\param dataValues Pointer to the location into which the data value is read. If the type of
data value differs from the netCDF variable type, type conversion will occur.
(However, no type conversion is carried out for variables using the user-defined data types:
ncmpi_Vlen, ncmpi_Opaque, ncmpi_Compound and ncmpi_Enum.)
*/
void getVarn(const int num, MPI_Offset* const starts[], MPI_Offset* const counts[], long long* dataValues) const;
void getVarn(const int num, MPI_Offset* const starts[], MPI_Offset* const counts[], void* dataValues, MPI_Offset bufcount, MPI_Datatype buftype) const;
// Reads a list of subarrays of values from a netCDF variable of an open netCDF dataset. (collective I/O APIs)
/*!
This is an overloaded member function, provided for convenience.
It differs from the above function in what argument(s) it accepts.
In addition, no data conversion is carried out. This means that
the type of the data in memory must match the type of the variable.
*/
// void getVarn_all(const int num, MPI_Offset* const starts[], MPI_Offset* const counts[], void* dataValues) const;
/*! \overload
*/
void getVarn_all(const int num, MPI_Offset* const starts[], MPI_Offset* const counts[], char* dataValues) const;
/*! \overload
*/
void getVarn_all(const int num, MPI_Offset* const starts[], MPI_Offset* const counts[], unsigned char* dataValues) const;
/*! \overload
*/
void getVarn_all(const int num, MPI_Offset* const starts[], MPI_Offset* const counts[], signed char* dataValues) const;
/*! \overload
*/
void getVarn_all(const int num, MPI_Offset* const starts[], MPI_Offset* const counts[], short* dataValues) const;
/*! \overload
*/
void getVarn_all(const int num, MPI_Offset* const starts[], MPI_Offset* const counts[], int* dataValues) const;
/*! \overload
*/
void getVarn_all(const int num, MPI_Offset* const starts[], MPI_Offset* const counts[], long* dataValues) const;
/*! \overload
*/
void getVarn_all(const int num, MPI_Offset* const starts[], MPI_Offset* const counts[], float* dataValues) const;
/*! \overload
*/
void getVarn_all(const int num, MPI_Offset* const starts[], MPI_Offset* const counts[], double* dataValues) const;
/*! \overload
*/
void getVarn_all(const int num, MPI_Offset* const starts[], MPI_Offset* const counts[], unsigned short* dataValues) const;
/*! \overload
*/
void getVarn_all(const int num, MPI_Offset* const starts[], MPI_Offset* const counts[], unsigned int* dataValues) const;
/*! \overload
*/
void getVarn_all(const int num, MPI_Offset* const starts[], MPI_Offset* const counts[], unsigned long long* dataValues) const;
/*!
Reads a list of subarrays from a netCDF variable of an open netCDF dataset.
Each subarray i is specified by giving a corner (starts[i][*]) and a vector of edge lengths (counts[i][*]).
The values are read into consecutive locations with the last dimension varying fastest.
\param num
Number of subarrays.
\param starts
2D array of size [num][ndims] where num is the number of subarrays to get and ndims if the number of dimensions of the specified variable.
Each subarray i is specified by starts[i][*], the first of the data values will be read, and counts[i][*], edge lengths of the subarray.
The indices are relative to 0, so for example, the first data value of a variable would have index (0, 0, ... , 0).
The length of the second dimension of starts and counts must be the same as the number of dimensions of the specified variable.
The elements of starts's second dimension correspond, in order, to the variable's dimensions. Hence, if the variable is a record variable,
the first element starts[*][0] would correspond to the starting record number for reading the data values.
\param counts
2D array of size [num][ndims] where num is the number of subarrays to get and ndims if the number of dimensions of the specified variable.
To read a single value, for example, specify count as (1, 1, ... , 1). The length of each count[i] is the number of
dimensions of the specified variable. The elements of each count[i] correspond, in order, to the variable's dimensions.
Hence, if the variable is a record variable, the first element of count[i] corresponds to a count of the number of records to read.
Note: setting any element of the count array to zero causes the function to exit without error, and without doing anything.
\param dataValues Pointer to the location into which the data value is read. If the type of
data value differs from the netCDF variable type, type conversion will occur.
(However, no type conversion is carried out for variables using the user-defined data types:
ncmpi_Vlen, ncmpi_Opaque, ncmpi_Compound and ncmpi_Enum.)
*/
void getVarn_all(const int num, MPI_Offset* const starts[], MPI_Offset* const counts[], long long* dataValues) const;
void getVarn_all(const int num, MPI_Offset* const starts[], MPI_Offset* const counts[], void* dataValues, MPI_Offset bufcount, MPI_Datatype buftype) const;
/* vard APIs take filetype and buftype */
void getVard (MPI_Datatype filetype, void* dataValues, MPI_Offset bufcount, MPI_Datatype buftype) const;
void getVard_all(MPI_Datatype filetype, void* dataValues, MPI_Offset bufcount, MPI_Datatype buftype) const;
//////////////////////
// Nonblocking reads a list of subarrays of values from a netCDF variable of an open netCDF dataset.
/*!
This is an overloaded member function, provided for convenience.
It differs from the above function in what argument(s) it accepts.
In addition, no data conversion is carried out. This means that
the type of the data in memory must match the type of the variable.
*/
// void igetVarn(const int num, MPI_Offset* const starts[], MPI_Offset* const counts[], void* dataValues, int *req) const;
/*! \overload
*/
void igetVarn(const int num, MPI_Offset* const starts[], MPI_Offset* const counts[], char* dataValues, int *req) const;
/*! \overload
*/
void igetVarn(const int num, MPI_Offset* const starts[], MPI_Offset* const counts[], unsigned char* dataValues, int *req) const;
/*! \overload
*/
void igetVarn(const int num, MPI_Offset* const starts[], MPI_Offset* const counts[], signed char* dataValues, int *req) const;
/*! \overload
*/
void igetVarn(const int num, MPI_Offset* const starts[], MPI_Offset* const counts[], short* dataValues, int *req) const;
/*! \overload
*/
void igetVarn(const int num, MPI_Offset* const starts[], MPI_Offset* const counts[], int* dataValues, int *req) const;
/*! \overload
*/
void igetVarn(const int num, MPI_Offset* const starts[], MPI_Offset* const counts[], long* dataValues, int *req) const;
/*! \overload
*/
void igetVarn(const int num, MPI_Offset* const starts[], MPI_Offset* const counts[], float* dataValues, int *req) const;
/*! \overload
*/
void igetVarn(const int num, MPI_Offset* const starts[], MPI_Offset* const counts[], double* dataValues, int *req) const;
/*! \overload
*/
void igetVarn(const int num, MPI_Offset* const starts[], MPI_Offset* const counts[], unsigned short* dataValues, int *req) const;
/*! \overload
*/
void igetVarn(const int num, MPI_Offset* const starts[], MPI_Offset* const counts[], unsigned int* dataValues, int *req) const;
/*! \overload
*/
void igetVarn(const int num, MPI_Offset* const starts[], MPI_Offset* const counts[], unsigned long long* dataValues, int *req) const;
/*!
Reads a list of subarrays from a netCDF variable of an open netCDF dataset.
Each subarray i is specified by giving a corner (starts[i][*]) and a vector of edge lengths (counts[i][*]).
The values are read into consecutive locations with the last dimension varying fastest.
\param num
Number of subarrays.
\param starts
2D array of size [num][ndims] where num is the number of subarrays to get and ndims if the number of dimensions of the specified variable.
Each subarray i is specified by starts[i][*], the first of the data values will be read, and counts[i][*], edge lengths of the subarray.
The indices are relative to 0, so for example, the first data value of a variable would have index (0, 0, ... , 0).
The length of the second dimension of starts and counts must be the same as the number of dimensions of the specified variable.
The elements of starts's second dimension correspond, in order, to the variable's dimensions. Hence, if the variable is a record variable,
the first element starts[*][0] would correspond to the starting record number for reading the data values.
\param counts
2D array of size [num][ndims] where num is the number of subarrays to get and ndims if the number of dimensions of the specified variable.
To read a single value, for example, specify count as (1, 1, ... , 1). The length of each count[i] is the number of
dimensions of the specified variable. The elements of each count[i] correspond, in order, to the variable's dimensions.
Hence, if the variable is a record variable, the first element of count[i] corresponds to a count of the number of records to read.
Note: setting any element of the count array to zero causes the function to exit without error, and without doing anything.
\param dataValues Pointer to the location into which the data value is read. If the type of
data value differs from the netCDF variable type, type conversion will occur.
(However, no type conversion is carried out for variables using the user-defined data types:
ncmpi_Vlen, ncmpi_Opaque, ncmpi_Compound and ncmpi_Enum.)
*/
void igetVarn(const int num, MPI_Offset* const starts[], MPI_Offset* const counts[], long long* dataValues, int *req) const;
void igetVarn(const int num, MPI_Offset* const starts[], MPI_Offset* const counts[], void* dataValues, MPI_Offset bufcount, MPI_Datatype buftype, int *req) const;
//////////////////////
// data writing (independent data mode)
////////////////////
// Writes the entire data into the netCDF variable.
/*!
This is an overloaded member function, provided for convenience.
It differs from the above function in what argument(s) it accepts.
In addition, no data conversion is carried out. This means that
the type of the data in memory must match the type of the variable.
*/
// void putVar(const void* dataValues) const;
/*! \overload
*/
void putVar(const char* dataValues) const;
/*! \overload
*/
void putVar(const unsigned char* dataValues) const;
/*! \overload
*/
void putVar(const signed char* dataValues) const;
/*! \overload
*/
void putVar(const short* dataValues) const;
/*! \overload
*/
void putVar(const int* dataValues) const;
/*! \overload
*/
void putVar(const long* dataValues) const;
/*! \overload
*/
void putVar(const float* dataValues) const;
/*! \overload
*/
void putVar(const double* dataValues) const;
/*! \overload
*/
void putVar(const unsigned short* dataValues) const;
/*! \overload
*/
void putVar(const unsigned int* dataValues) const;
/*! \overload
*/
void putVar(const unsigned long long* dataValues) const;
/*!
Writes the entire data into the netCDF variable.
This is the simplest interface to use for writing a value in a scalar variable
or whenever all the values of a multidimensional variable can all be
written at once. The values to be written are associated with the
netCDF variable by assuming that the last dimension of the netCDF
variable varies fastest in the C interface.
Take care when using the simplest forms of this interface with
record variables when you don't specify how many records are to be
written. If you try to write all the values of a record variable
into a netCDF file that has no record data yet (hence has 0 records),
nothing will be written. Similarly, if you try to write all of a record
variable but there are more records in the file than you assume, more data
may be written to the file than you supply, which may result in a
segmentation violation.
\param dataValues The data values. The order in which the data will be written to the netCDF variable is with the last
dimension of the specified variable varying fastest. If the type of data values differs from the netCDF variable type, type conversion will occur.
(However, no type conversion is carried out for variables using the user-defined data types:
ncmpi_Vlen, ncmpi_Opaque, ncmpi_Compound and ncmpi_Enum.)
*/
void putVar(const long long* dataValues) const;
void putVar(const void* dataValues, MPI_Offset bufcount, MPI_Datatype buftype) const;
/////////////////////////
// Writes a single datum into the netCDF variable.
/*!
This is an overloaded member function, provided for convenience.
It differs from the above function in what argument(s) it accepts.
In addition, no data conversion is carried out. This means that
the type of the data in memory must match the type of the variable.
*/
// void putVar(const std::vector<MPI_Offset>& index, const void* dataumValue) const;
/*! \overload
*/
void putVar(const std::vector<MPI_Offset>& index, const std::string& dataumValue) const;
/*! \overload
*/
void putVar(const std::vector<MPI_Offset>& index, const unsigned char* dataumValue) const;
/*! \overload
*/
void putVar(const std::vector<MPI_Offset>& index, const signed char* dataumValue) const;
/*! \overload
*/
void putVar(const std::vector<MPI_Offset>& index, const short dataumValue) const;
/*! \overload
*/
void putVar(const std::vector<MPI_Offset>& index, const int dataumValue) const;
/*! \overload
*/
void putVar(const std::vector<MPI_Offset>& index, const long dataumValue) const;
/*! \overload
*/
void putVar(const std::vector<MPI_Offset>& index, const float dataumValue) const;
/*! \overload
*/
void putVar(const std::vector<MPI_Offset>& index, const double dataumValue) const;
/*! \overload
*/
void putVar(const std::vector<MPI_Offset>& index, const unsigned short dataumValue) const;
/*! \overload
*/
void putVar(const std::vector<MPI_Offset>& index, const unsigned int dataumValue) const;
/*! \overload
*/
void putVar(const std::vector<MPI_Offset>& index, const unsigned long long dataumValue) const;
/*!
Writes a single datum into the netCDF variable.
\param index Vector specifying the index where the data values will be written. The indices are relative to 0, so for example,
the first data value of a two-dimensional variable would have index (0,0). The elements of index must correspond to the variable's dimensions.
Hence, if the variable uses the unlimited dimension, the first index would correspond to the unlimited dimension.
\param datumValue The data value. If the type of data values differs from the netCDF variable type, type conversion will occur.
(However, no type conversion is carried out for variables using the user-defined data types:
ncmpi_Vlen, ncmpi_Opaque, ncmpi_Compound and ncmpi_Enum.)
*/
void putVar(const std::vector<MPI_Offset>& index, const long long dataumValue) const;
void putVar(const std::vector<MPI_Offset>& index, const void* dataumValue, MPI_Offset bufcount, MPI_Datatype buftype) const;
/////////////////////////
// Writes an array of values into the netCDF variable.
/*!
This is an overloaded member function, provided for convenience.
It differs from the above function in what argument(s) it accepts.
In addition, no data conversion is carried out. This means that
the type of the data in memory must match the type of the variable.
*/
// void putVar(const std::vector<MPI_Offset>& startp, const std::vector<MPI_Offset>& countp, const void* dataValues) const;
/*! \overload
*/
void putVar(const std::vector<MPI_Offset>& startp, const std::vector<MPI_Offset>& countp, const char* dataValues) const;
/*! \overload
*/
void putVar(const std::vector<MPI_Offset>& startp, const std::vector<MPI_Offset>& countp, const unsigned char* dataValues) const;
/*! \overload
*/
void putVar(const std::vector<MPI_Offset>& startp, const std::vector<MPI_Offset>& countp, const signed char* dataValues) const;
/*! \overload
*/
void putVar(const std::vector<MPI_Offset>& startp, const std::vector<MPI_Offset>& countp, const short* dataValues) const;
/*! \overload
*/
void putVar(const std::vector<MPI_Offset>& startp, const std::vector<MPI_Offset>& countp, const int* dataValues) const;
/*! \overload
*/
void putVar(const std::vector<MPI_Offset>& startp, const std::vector<MPI_Offset>& countp, const long* dataValues) const;
/*! \overload
*/
void putVar(const std::vector<MPI_Offset>& startp, const std::vector<MPI_Offset>& countp, const float* dataValues) const;
/*! \overload
*/
void putVar(const std::vector<MPI_Offset>& startp, const std::vector<MPI_Offset>& countp, const double* dataValues) const;
/*! \overload
*/
void putVar(const std::vector<MPI_Offset>& startp, const std::vector<MPI_Offset>& countp, const unsigned short* dataValues) const;
/*! \overload
*/
void putVar(const std::vector<MPI_Offset>& startp, const std::vector<MPI_Offset>& countp, const unsigned int* dataValues) const;
/*! \overload
*/
void putVar(const std::vector<MPI_Offset>& startp, const std::vector<MPI_Offset>& countp, const unsigned long long* dataValues) const;
/*!
Writes an array of values into the netCDF variable.
The portion of the netCDF variable to write is specified by giving a corner and a vector of edge lengths
that refer to an array section of the netCDF variable. The values to be written are associated with
the netCDF variable by assuming that the last dimension of the netCDF variable varies fastest.
\param startp Vector specifying the index where the first data values will be written. The indices are relative to 0, so for
example, the first data value of a variable would have index (0, 0, ... , 0). The elements of start correspond, in order, to the
variable's dimensions. Hence, if the variable is a record variable, the first index corresponds to the starting record number for writing the data values.
\param countp Vector specifying the number of indices selected along each dimension.
To write a single value, for example, specify count as (1, 1, ... , 1). The elements of
count correspond, in order, to the variable's dimensions. Hence, if the variable is a record
variable, the first element of count corresponds to a count of the number of records to write. Note: setting any element
of the count array to zero causes the function to exit without error, and without doing anything.
\param dataValues The data values. The order in which the data will be written to the netCDF variable is with the last
dimension of the specified variable varying fastest. If the type of data values differs from the netCDF variable
type, type conversion will occur. (However, no type conversion is
carried out for variables using the user-defined data types:
ncmpi_Vlen, ncmpi_Opaque, ncmpi_Compound and ncmpi_Enum.)
*/
void putVar(const std::vector<MPI_Offset>& startp, const std::vector<MPI_Offset>& countp, const long long* dataValues) const;
void putVar(const std::vector<MPI_Offset>& startp, const std::vector<MPI_Offset>& countp, const void* dataValues, MPI_Offset bufcount, MPI_Datatype buftype) const;
////////////////
// Writes a set of subsampled array values into the netCDF variable.
/*!
This is an overloaded member function, provided for convenience.
It differs from the above function in what argument(s) it accepts.
In addition, no data conversion is carried out. This means that
the type of the data in memory must match the type of the variable.
*/
// void putVar(const std::vector<MPI_Offset>& startp, const std::vector<MPI_Offset>& countp, const std::vector<MPI_Offset>& stridep, const void* dataValues) const;
/*! \overload
*/
void putVar(const std::vector<MPI_Offset>& startp, const std::vector<MPI_Offset>& countp, const std::vector<MPI_Offset>& stridep, const char* dataValues) const;
/*! \overload
*/
void putVar(const std::vector<MPI_Offset>& startp, const std::vector<MPI_Offset>& countp, const std::vector<MPI_Offset>& stridep, const unsigned char* dataValues) const;
/*! \overload
*/
void putVar(const std::vector<MPI_Offset>& startp, const std::vector<MPI_Offset>& countp, const std::vector<MPI_Offset>& stridep, const signed char* dataValues) const;
/*! \overload
*/
void putVar(const std::vector<MPI_Offset>& startp, const std::vector<MPI_Offset>& countp, const std::vector<MPI_Offset>& stridep, const short* dataValues) const;
/*! \overload
*/
void putVar(const std::vector<MPI_Offset>& startp, const std::vector<MPI_Offset>& countp, const std::vector<MPI_Offset>& stridep, const int* dataValues) const;
/*! \overload
*/
void putVar(const std::vector<MPI_Offset>& startp, const std::vector<MPI_Offset>& countp, const std::vector<MPI_Offset>& stridep, const long* dataValues) const;
/*! \overload
*/
void putVar(const std::vector<MPI_Offset>& startp, const std::vector<MPI_Offset>& countp, const std::vector<MPI_Offset>& stridep, const float* dataValues) const;
/*! \overload
*/
void putVar(const std::vector<MPI_Offset>& startp, const std::vector<MPI_Offset>& countp, const std::vector<MPI_Offset>& stridep, const double* dataValues) const;
/*! \overload
*/
void putVar(const std::vector<MPI_Offset>& startp, const std::vector<MPI_Offset>& countp, const std::vector<MPI_Offset>& stridep, const unsigned short* dataValues) const;
/*! \overload
*/
void putVar(const std::vector<MPI_Offset>& startp, const std::vector<MPI_Offset>& countp, const std::vector<MPI_Offset>& stridep, const unsigned int* dataValues) const;
/*! \overload
*/
void putVar(const std::vector<MPI_Offset>& startp, const std::vector<MPI_Offset>& countp, const std::vector<MPI_Offset>& stridep, const unsigned long long* dataValues) const;
/*!
Writes an array of values into the netCDF variable.
The subsampled array section is specified by giving a corner, a vector of counts, and a stride vector.
\param startp Vector specifying the index where the first data values will be written. The indices are relative to 0, so for
example, the first data value of a variable would have index (0, 0, ... , 0). The elements of start correspond, in order, to the
variable's dimensions. Hence, if the variable is a record variable, the first index corresponds to the starting record number for writing the data values.
\param countp Vector specifying the number of indices selected along each dimension.
To write a single value, for example, specify count as (1, 1, ... , 1). The elements of
count correspond, in order, to the variable's dimensions. Hence, if the variable is a record
variable, the first element of count corresponds to a count of the number of records to write. Note: setting any element
of the count array to zero causes the function to exit without error, and without doing anything.
\param stridep A vector of MPI_Offset integers that specifies the sampling interval along each dimension of the netCDF variable.
The elements of the stride vector correspond, in order, to the netCDF variable's dimensions (stride[0] gives the sampling interval
along the most slowly varying dimension of the netCDF variable). Sampling intervals are specified in type-independent units of
elements (a value of 1 selects consecutive elements of the netCDF variable along the corresponding dimension, a value of 2 selects
every other element, etc.). A NULL stride argument is treated as (1, 1, ... , 1).
\param dataValues The data values. The order in which the data will be written to the netCDF variable is with the last
dimension of the specified variable varying fastest. If the type of data values differs from the netCDF variable type, type conversion will occur.
(However, no type conversion is carried out for variables using the user-defined data types: ncmpi_Vlen, ncmpi_Opaque, ncmpi_Compound and ncmpi_Enum.
*/
void putVar(const std::vector<MPI_Offset>& startp, const std::vector<MPI_Offset>& countp, const std::vector<MPI_Offset>& stridep, const long long* dataValues) const;
void putVar(const std::vector<MPI_Offset>& startp, const std::vector<MPI_Offset>& countp, const std::vector<MPI_Offset>& stridep, const void* dataValues, MPI_Offset bufcount, MPI_Datatype buftype) const;
////////////////
// Writes a mapped array section of values into the netCDF variable.
/*!
This is an overloaded member function, provided for convenience.
It differs from the above function in what argument(s) it accepts.
In addition, no data conversion is carried out. This means that
the type of the data in memory must match the type of the variable.
*/
// void putVar(const std::vector<MPI_Offset>& startp, const std::vector<MPI_Offset>& countp, const std::vector<MPI_Offset>& stridep, const std::vector<MPI_Offset>& imapp, const void* dataValues) const;
/*! \overload
*/
void putVar(const std::vector<MPI_Offset>& startp, const std::vector<MPI_Offset>& countp, const std::vector<MPI_Offset>& stridep, const std::vector<MPI_Offset>& imapp, const char* dataValues) const;
/*! \overload
*/
void putVar(const std::vector<MPI_Offset>& startp, const std::vector<MPI_Offset>& countp, const std::vector<MPI_Offset>& stridep, const std::vector<MPI_Offset>& imapp, const unsigned char* dataValues) const;
/*! \overload
*/
void putVar(const std::vector<MPI_Offset>& startp, const std::vector<MPI_Offset>& countp, const std::vector<MPI_Offset>& stridep, const std::vector<MPI_Offset>& imapp, const signed char* dataValues) const;
/*! \overload
*/
void putVar(const std::vector<MPI_Offset>& startp, const std::vector<MPI_Offset>& countp, const std::vector<MPI_Offset>& stridep, const std::vector<MPI_Offset>& imapp, const short* dataValues) const;
/*! \overload
*/
void putVar(const std::vector<MPI_Offset>& startp, const std::vector<MPI_Offset>& countp, const std::vector<MPI_Offset>& stridep, const std::vector<MPI_Offset>& imapp, const int* dataValues) const;
/*! \overload
*/
void putVar(const std::vector<MPI_Offset>& startp, const std::vector<MPI_Offset>& countp, const std::vector<MPI_Offset>& stridep, const std::vector<MPI_Offset>& imapp, const long* dataValues) const;
/*! \overload
*/
void putVar(const std::vector<MPI_Offset>& startp, const std::vector<MPI_Offset>& countp, const std::vector<MPI_Offset>& stridep, const std::vector<MPI_Offset>& imapp, const float* dataValues) const;
/*! \overload
*/
void putVar(const std::vector<MPI_Offset>& startp, const std::vector<MPI_Offset>& countp, const std::vector<MPI_Offset>& stridep, const std::vector<MPI_Offset>& imapp, const double* dataValues) const;
/*! \overload
*/
void putVar(const std::vector<MPI_Offset>& startp, const std::vector<MPI_Offset>& countp, const std::vector<MPI_Offset>& stridep, const std::vector<MPI_Offset>& imapp, const unsigned short* dataValues) const;
/*! \overload
*/
void putVar(const std::vector<MPI_Offset>& startp, const std::vector<MPI_Offset>& countp, const std::vector<MPI_Offset>& stridep, const std::vector<MPI_Offset>& imapp, const unsigned int* dataValues) const;
/*! \overload
*/
void putVar(const std::vector<MPI_Offset>& startp, const std::vector<MPI_Offset>& countp, const std::vector<MPI_Offset>& stridep, const std::vector<MPI_Offset>& imapp, const unsigned long long* dataValues) const;
/*!
Writes a mapped array section of values into the netCDF variable.
The mapped array section is specified by giving a corner, a vector of counts, a stride vector, and an index mapping vector.
The index mapping vector is a vector of integers that specifies the mapping between the dimensions of a netCDF variable and the in-memory structure of the internal data array.
No assumptions are made about the ordering or length of the dimensions of the data array.
\param countp Vector specifying the number of indices selected along each dimension.
To write a single value, for example, specify count as (1, 1, ... , 1). The elements of
count correspond, in order, to the variable's dimensions. Hence, if the variable is a record
variable, the first element of count corresponds to a count of the number of records to write. Note: setting any element
of the count array to zero causes the function to exit without error, and without doing anything.
\param stridep A vector of MPI_Offset integers that specifies the sampling interval along each dimension of the netCDF variable.
The elements of the stride vector correspond, in order, to the netCDF variable's dimensions (stride[0] gives the sampling interval
along the most slowly varying dimension of the netCDF variable). Sampling intervals are specified in type-independent units of
elements (a value of 1 selects consecutive elements of the netCDF variable along the corresponding dimension, a value of 2 selects
every other element, etc.). A NULL stride argument is treated as (1, 1, ... , 1).
\param imap Vector specifies the mapping between the dimensions of a netCDF variable and the in-memory structure of the internal data array.
The elements of the index mapping vector correspond, in order, to the netCDF variable's dimensions (imap[0] gives the distance between elements
of the internal array corresponding to the most slowly varying dimension of the netCDF variable). Distances between elements are
specified in type-independent units of elements (the distance between internal elements that occupy adjacent memory locations is
1 and not the element's byte-length as in netCDF 2). A NULL argument means the memory-resident values have the same structure as
the associated netCDF variable.
\param dataValues The data values. The order in which the data will be written to the netCDF variable is with the last
dimension of the specified variable varying fastest. If the type of data values differs from the netCDF variable type, type conversion will occur.
(However, no type conversion is carried out for variables using the user-defined data types: ncmpi_Vlen, ncmpi_Opaque, ncmpi_Compound and ncmpi_Enum.)
*/
void putVar(const std::vector<MPI_Offset>& startp, const std::vector<MPI_Offset>& countp, const std::vector<MPI_Offset>& stridep, const std::vector<MPI_Offset>& imapp, const long long* dataValues) const;
void putVar(const std::vector<MPI_Offset>& startp, const std::vector<MPI_Offset>& countp, const std::vector<MPI_Offset>& stridep, const std::vector<MPI_Offset>& imapp, const void* dataValues, MPI_Offset bufcount, MPI_Datatype buftype) const;
////////////////////
// data writing (collective data mode)
////////////////////
// Writes the entire data into the netCDF variable.
/*!
This is an overloaded member function, provided for convenience.
It differs from the above function in what argument(s) it accepts.
In addition, no data conversion is carried out. This means that
the type of the data in memory must match the type of the variable.
*/
// void putVar_all(const void* dataValues) const;
/*! \overload
*/
void putVar_all(const char* dataValues) const;
/*! \overload
*/
void putVar_all(const unsigned char* dataValues) const;
/*! \overload
*/
void putVar_all(const signed char* dataValues) const;
/*! \overload
*/
void putVar_all(const short* dataValues) const;
/*! \overload
*/
void putVar_all(const int* dataValues) const;
/*! \overload
*/
void putVar_all(const long* dataValues) const;
/*! \overload
*/
void putVar_all(const float* dataValues) const;
/*! \overload
*/
void putVar_all(const double* dataValues) const;
/*! \overload
*/
void putVar_all(const unsigned short* dataValues) const;
/*! \overload
*/
void putVar_all(const unsigned int* dataValues) const;
/*! \overload
*/
void putVar_all(const unsigned long long* dataValues) const;
/*!
Writes the entire data into the netCDF variable.
This is the simplest interface to use for writing a value in a scalar variable
or whenever all the values of a multidimensional variable can all be
written at once. The values to be written are associated with the
netCDF variable by assuming that the last dimension of the netCDF
variable varies fastest in the C interface.
Take care when using the simplest forms of this interface with
record variables when you don't specify how many records are to be
written. If you try to write all the values of a record variable
into a netCDF file that has no record data yet (hence has 0 records),
nothing will be written. Similarly, if you try to write all of a record
variable but there are more records in the file than you assume, more data
may be written to the file than you supply, which may result in a
segmentation violation.
\param dataValues The data values. The order in which the data will be written to the netCDF variable is with the last
dimension of the specified variable varying fastest. If the type of data values differs from the netCDF variable type, type conversion will occur.
(However, no type conversion is carried out for variables using the user-defined data types:
ncmpi_Vlen, ncmpi_Opaque, ncmpi_Compound and ncmpi_Enum.)
*/
void putVar_all(const long long* dataValues) const;
void putVar_all(const void* dataValues, MPI_Offset bufcount, MPI_Datatype buftype) const;
/////////////////////////
// Writes a single datum into the netCDF variable.
/*!
This is an overloaded member function, provided for convenience.
It differs from the above function in what argument(s) it accepts.
In addition, no data conversion is carried out. This means that
the type of the data in memory must match the type of the variable.
*/
// void putVar_all(const std::vector<MPI_Offset>& index, const void* dataumValue) const;
/*! \overload
*/
void putVar_all(const std::vector<MPI_Offset>& index, const std::string& dataumValue) const;
/*! \overload
*/
void putVar_all(const std::vector<MPI_Offset>& index, const unsigned char* dataumValue) const;
/*! \overload
*/
void putVar_all(const std::vector<MPI_Offset>& index, const signed char* dataumValue) const;
/*! \overload
*/
void putVar_all(const std::vector<MPI_Offset>& index, const short dataumValue) const;
/*! \overload
*/
void putVar_all(const std::vector<MPI_Offset>& index, const int dataumValue) const;
/*! \overload
*/
void putVar_all(const std::vector<MPI_Offset>& index, const long dataumValue) const;
/*! \overload
*/
void putVar_all(const std::vector<MPI_Offset>& index, const float dataumValue) const;
/*! \overload
*/
void putVar_all(const std::vector<MPI_Offset>& index, const double dataumValue) const;
/*! \overload
*/
void putVar_all(const std::vector<MPI_Offset>& index, const unsigned short dataumValue) const;
/*! \overload
*/
void putVar_all(const std::vector<MPI_Offset>& index, const unsigned int dataumValue) const;
/*! \overload
*/
void putVar_all(const std::vector<MPI_Offset>& index, const unsigned long long dataumValue) const;
/*!
Writes a single datum into the netCDF variable.
\param index Vector specifying the index where the data values will be written. The indices are relative to 0, so for example,
the first data value of a two-dimensional variable would have index (0,0). The elements of index must correspond to the variable's dimensions.
Hence, if the variable uses the unlimited dimension, the first index would correspond to the unlimited dimension.
\param datumValue The data value. If the type of data values differs from the netCDF variable type, type conversion will occur.
(However, no type conversion is carried out for variables using the user-defined data types:
ncmpi_Vlen, ncmpi_Opaque, ncmpi_Compound and ncmpi_Enum.)
*/
void putVar_all(const std::vector<MPI_Offset>& index, const long long dataumValue) const;
void putVar_all(const std::vector<MPI_Offset>& index, const void* dataumValue, MPI_Offset bufcount, MPI_Datatype buftype) const;
/////////////////////////
// Writes an array of values into the netCDF variable.
/*!
This is an overloaded member function, provided for convenience.
It differs from the above function in what argument(s) it accepts.
In addition, no data conversion is carried out. This means that
the type of the data in memory must match the type of the variable.
*/
// void putVar_all(const std::vector<MPI_Offset>& startp, const std::vector<MPI_Offset>& countp, const void* dataValues) const;
/*! \overload
*/
void putVar_all(const std::vector<MPI_Offset>& startp, const std::vector<MPI_Offset>& countp, const char* dataValues) const;
/*! \overload
*/
void putVar_all(const std::vector<MPI_Offset>& startp, const std::vector<MPI_Offset>& countp, const unsigned char* dataValues) const;
/*! \overload
*/
void putVar_all(const std::vector<MPI_Offset>& startp, const std::vector<MPI_Offset>& countp, const signed char* dataValues) const;
/*! \overload
*/
void putVar_all(const std::vector<MPI_Offset>& startp, const std::vector<MPI_Offset>& countp, const short* dataValues) const;
/*! \overload
*/
void putVar_all(const std::vector<MPI_Offset>& startp, const std::vector<MPI_Offset>& countp, const int* dataValues) const;
/*! \overload
*/
void putVar_all(const std::vector<MPI_Offset>& startp, const std::vector<MPI_Offset>& countp, const long* dataValues) const;
/*! \overload
*/
void putVar_all(const std::vector<MPI_Offset>& startp, const std::vector<MPI_Offset>& countp, const float* dataValues) const;
/*! \overload
*/
void putVar_all(const std::vector<MPI_Offset>& startp, const std::vector<MPI_Offset>& countp, const double* dataValues) const;
/*! \overload
*/
void putVar_all(const std::vector<MPI_Offset>& startp, const std::vector<MPI_Offset>& countp, const unsigned short* dataValues) const;
/*! \overload
*/
void putVar_all(const std::vector<MPI_Offset>& startp, const std::vector<MPI_Offset>& countp, const unsigned int* dataValues) const;
/*! \overload
*/
void putVar_all(const std::vector<MPI_Offset>& startp, const std::vector<MPI_Offset>& countp, const unsigned long long* dataValues) const;
/*!
Writes an array of values into the netCDF variable.
The portion of the netCDF variable to write is specified by giving a corner and a vector of edge lengths
that refer to an array section of the netCDF variable. The values to be written are associated with
the netCDF variable by assuming that the last dimension of the netCDF variable varies fastest.
\param startp Vector specifying the index where the first data values will be written. The indices are relative to 0, so for
example, the first data value of a variable would have index (0, 0, ... , 0). The elements of start correspond, in order, to the
variable's dimensions. Hence, if the variable is a record variable, the first index corresponds to the starting record number for writing the data values.
\param countp Vector specifying the number of indices selected along each dimension.
To write a single value, for example, specify count as (1, 1, ... , 1). The elements of
count correspond, in order, to the variable's dimensions. Hence, if the variable is a record
variable, the first element of count corresponds to a count of the number of records to write. Note: setting any element
of the count array to zero causes the function to exit without error, and without doing anything.
\param dataValues The data values. The order in which the data will be written to the netCDF variable is with the last
dimension of the specified variable varying fastest. If the type of data values differs from the netCDF variable
type, type conversion will occur. (However, no type conversion is
carried out for variables using the user-defined data types:
ncmpi_Vlen, ncmpi_Opaque, ncmpi_Compound and ncmpi_Enum.)
*/
void putVar_all(const std::vector<MPI_Offset>& startp, const std::vector<MPI_Offset>& countp, const long long* dataValues) const;
void putVar_all(const std::vector<MPI_Offset>& startp, const std::vector<MPI_Offset>& countp, const void* dataValues, MPI_Offset bufcount, MPI_Datatype buftype) const;
////////////////
// Writes a set of subsampled array values into the netCDF variable.
/*!
This is an overloaded member function, provided for convenience.
It differs from the above function in what argument(s) it accepts.
In addition, no data conversion is carried out. This means that
the type of the data in memory must match the type of the variable.
*/
// void putVar_all(const std::vector<MPI_Offset>& startp, const std::vector<MPI_Offset>& countp, const std::vector<MPI_Offset>& stridep, const void* dataValues) const;
/*! \overload
*/
void putVar_all(const std::vector<MPI_Offset>& startp, const std::vector<MPI_Offset>& countp, const std::vector<MPI_Offset>& stridep, const char* dataValues) const;
/*! \overload
*/
void putVar_all(const std::vector<MPI_Offset>& startp, const std::vector<MPI_Offset>& countp, const std::vector<MPI_Offset>& stridep, const unsigned char* dataValues) const;
/*! \overload
*/
void putVar_all(const std::vector<MPI_Offset>& startp, const std::vector<MPI_Offset>& countp, const std::vector<MPI_Offset>& stridep, const signed char* dataValues) const;
/*! \overload
*/
void putVar_all(const std::vector<MPI_Offset>& startp, const std::vector<MPI_Offset>& countp, const std::vector<MPI_Offset>& stridep, const short* dataValues) const;
/*! \overload
*/
void putVar_all(const std::vector<MPI_Offset>& startp, const std::vector<MPI_Offset>& countp, const std::vector<MPI_Offset>& stridep, const int* dataValues) const;
/*! \overload
*/
void putVar_all(const std::vector<MPI_Offset>& startp, const std::vector<MPI_Offset>& countp, const std::vector<MPI_Offset>& stridep, const long* dataValues) const;
/*! \overload
*/
void putVar_all(const std::vector<MPI_Offset>& startp, const std::vector<MPI_Offset>& countp, const std::vector<MPI_Offset>& stridep, const float* dataValues) const;
/*! \overload
*/
void putVar_all(const std::vector<MPI_Offset>& startp, const std::vector<MPI_Offset>& countp, const std::vector<MPI_Offset>& stridep, const double* dataValues) const;
/*! \overload
*/
void putVar_all(const std::vector<MPI_Offset>& startp, const std::vector<MPI_Offset>& countp, const std::vector<MPI_Offset>& stridep, const unsigned short* dataValues) const;
/*! \overload
*/
void putVar_all(const std::vector<MPI_Offset>& startp, const std::vector<MPI_Offset>& countp, const std::vector<MPI_Offset>& stridep, const unsigned int* dataValues) const;
/*! \overload
*/
void putVar_all(const std::vector<MPI_Offset>& startp, const std::vector<MPI_Offset>& countp, const std::vector<MPI_Offset>& stridep, const unsigned long long* dataValues) const;
/*!
Writes an array of values into the netCDF variable.
The subsampled array section is specified by giving a corner, a vector of counts, and a stride vector.
\param startp Vector specifying the index where the first data values will be written. The indices are relative to 0, so for
example, the first data value of a variable would have index (0, 0, ... , 0). The elements of start correspond, in order, to the
variable's dimensions. Hence, if the variable is a record variable, the first index corresponds to the starting record number for writing the data values.
\param countp Vector specifying the number of indices selected along each dimension.
To write a single value, for example, specify count as (1, 1, ... , 1). The elements of
count correspond, in order, to the variable's dimensions. Hence, if the variable is a record
variable, the first element of count corresponds to a count of the number of records to write. Note: setting any element
of the count array to zero causes the function to exit without error, and without doing anything.
\param stridep A vector of MPI_Offset integers that specifies the sampling interval along each dimension of the netCDF variable.
The elements of the stride vector correspond, in order, to the netCDF variable's dimensions (stride[0] gives the sampling interval
along the most slowly varying dimension of the netCDF variable). Sampling intervals are specified in type-independent units of
elements (a value of 1 selects consecutive elements of the netCDF variable along the corresponding dimension, a value of 2 selects
every other element, etc.). A NULL stride argument is treated as (1, 1, ... , 1).
\param dataValues The data values. The order in which the data will be written to the netCDF variable is with the last
dimension of the specified variable varying fastest. If the type of data values differs from the netCDF variable type, type conversion will occur.
(However, no type conversion is carried out for variables using the user-defined data types: ncmpi_Vlen, ncmpi_Opaque, ncmpi_Compound and ncmpi_Enum.
*/
void putVar_all(const std::vector<MPI_Offset>& startp, const std::vector<MPI_Offset>& countp, const std::vector<MPI_Offset>& stridep, const long long* dataValues) const;
void putVar_all(const std::vector<MPI_Offset>& startp, const std::vector<MPI_Offset>& countp, const std::vector<MPI_Offset>& stridep, const void* dataValues, MPI_Offset bufcount, MPI_Datatype buftype) const;
////////////////
// Writes a mapped array section of values into the netCDF variable.
/*!
This is an overloaded member function, provided for convenience.
It differs from the above function in what argument(s) it accepts.
In addition, no data conversion is carried out. This means that
the type of the data in memory must match the type of the variable.
*/
// void putVar_all(const std::vector<MPI_Offset>& startp, const std::vector<MPI_Offset>& countp, const std::vector<MPI_Offset>& stridep, const std::vector<MPI_Offset>& imapp, const void* dataValues) const;
/*! \overload
*/
void putVar_all(const std::vector<MPI_Offset>& startp, const std::vector<MPI_Offset>& countp, const std::vector<MPI_Offset>& stridep, const std::vector<MPI_Offset>& imapp, const char* dataValues) const;
/*! \overload
*/
void putVar_all(const std::vector<MPI_Offset>& startp, const std::vector<MPI_Offset>& countp, const std::vector<MPI_Offset>& stridep, const std::vector<MPI_Offset>& imapp, const unsigned char* dataValues) const;
/*! \overload
*/
void putVar_all(const std::vector<MPI_Offset>& startp, const std::vector<MPI_Offset>& countp, const std::vector<MPI_Offset>& stridep, const std::vector<MPI_Offset>& imapp, const signed char* dataValues) const;
/*! \overload
*/
void putVar_all(const std::vector<MPI_Offset>& startp, const std::vector<MPI_Offset>& countp, const std::vector<MPI_Offset>& stridep, const std::vector<MPI_Offset>& imapp, const short* dataValues) const;
/*! \overload
*/
void putVar_all(const std::vector<MPI_Offset>& startp, const std::vector<MPI_Offset>& countp, const std::vector<MPI_Offset>& stridep, const std::vector<MPI_Offset>& imapp, const int* dataValues) const;
/*! \overload
*/
void putVar_all(const std::vector<MPI_Offset>& startp, const std::vector<MPI_Offset>& countp, const std::vector<MPI_Offset>& stridep, const std::vector<MPI_Offset>& imapp, const long* dataValues) const;
/*! \overload
*/
void putVar_all(const std::vector<MPI_Offset>& startp, const std::vector<MPI_Offset>& countp, const std::vector<MPI_Offset>& stridep, const std::vector<MPI_Offset>& imapp, const float* dataValues) const;
/*! \overload
*/
void putVar_all(const std::vector<MPI_Offset>& startp, const std::vector<MPI_Offset>& countp, const std::vector<MPI_Offset>& stridep, const std::vector<MPI_Offset>& imapp, const double* dataValues) const;
/*! \overload
*/
void putVar_all(const std::vector<MPI_Offset>& startp, const std::vector<MPI_Offset>& countp, const std::vector<MPI_Offset>& stridep, const std::vector<MPI_Offset>& imapp, const unsigned short* dataValues) const;
/*! \overload
*/
void putVar_all(const std::vector<MPI_Offset>& startp, const std::vector<MPI_Offset>& countp, const std::vector<MPI_Offset>& stridep, const std::vector<MPI_Offset>& imapp, const unsigned int* dataValues) const;
/*! \overload
*/
void putVar_all(const std::vector<MPI_Offset>& startp, const std::vector<MPI_Offset>& countp, const std::vector<MPI_Offset>& stridep, const std::vector<MPI_Offset>& imapp, const unsigned long long* dataValues) const;
/*!
Writes a mapped array section of values into the netCDF variable.
The mapped array section is specified by giving a corner, a vector of counts, a stride vector, and an index mapping vector.
The index mapping vector is a vector of integers that specifies the mapping between the dimensions of a netCDF variable and the in-memory structure of the internal data array.
No assumptions are made about the ordering or length of the dimensions of the data array.
\param countp Vector specifying the number of indices selected along each dimension.
To write a single value, for example, specify count as (1, 1, ... , 1). The elements of
count correspond, in order, to the variable's dimensions. Hence, if the variable is a record
variable, the first element of count corresponds to a count of the number of records to write. Note: setting any element
of the count array to zero causes the function to exit without error, and without doing anything.
\param stridep A vector of MPI_Offset integers that specifies the sampling interval along each dimension of the netCDF variable.
The elements of the stride vector correspond, in order, to the netCDF variable's dimensions (stride[0] gives the sampling interval
along the most slowly varying dimension of the netCDF variable). Sampling intervals are specified in type-independent units of
elements (a value of 1 selects consecutive elements of the netCDF variable along the corresponding dimension, a value of 2 selects
every other element, etc.). A NULL stride argument is treated as (1, 1, ... , 1).
\param imap Vector specifies the mapping between the dimensions of a netCDF variable and the in-memory structure of the internal data array.
The elements of the index mapping vector correspond, in order, to the netCDF variable's dimensions (imap[0] gives the distance between elements
of the internal array corresponding to the most slowly varying dimension of the netCDF variable). Distances between elements are
specified in type-independent units of elements (the distance between internal elements that occupy adjacent memory locations is
1 and not the element's byte-length as in netCDF 2). A NULL argument means the memory-resident values have the same structure as
the associated netCDF variable.
\param dataValues The data values. The order in which the data will be written to the netCDF variable is with the last
dimension of the specified variable varying fastest. If the type of data values differs from the netCDF variable type, type conversion will occur.
(However, no type conversion is carried out for variables using the user-defined data types: ncmpi_Vlen, ncmpi_Opaque, ncmpi_Compound and ncmpi_Enum.)
*/
void putVar_all(const std::vector<MPI_Offset>& startp, const std::vector<MPI_Offset>& countp, const std::vector<MPI_Offset>& stridep, const std::vector<MPI_Offset>& imapp, const long long* dataValues) const;
void putVar_all(const std::vector<MPI_Offset>& startp, const std::vector<MPI_Offset>& countp, const std::vector<MPI_Offset>& stridep, const std::vector<MPI_Offset>& imapp, const void* dataValues, MPI_Offset bufcount, MPI_Datatype buftype) const;
////////////////////
// Writes a list of subarrays into the netCDF variable. (independent I/O APIs)
/*!
This is an overloaded member function, provided for convenience.
It differs from the above function in what argument(s) it accepts.
In addition, no data conversion is carried out. This means that
the type of the data in memory must match the type of the variable.
*/
// void putVarn(const int num, MPI_Offset* const starts[], MPI_Offset* const counts[], const void* dataValues) const;
/*! \overload
*/
void putVarn(const int num, MPI_Offset* const starts[], MPI_Offset* const counts[], const char* dataValues) const;
/*! \overload
*/
void putVarn(const int num, MPI_Offset* const starts[], MPI_Offset* const counts[], const unsigned char* dataValues) const;
/*! \overload
*/
void putVarn(const int num, MPI_Offset* const starts[], MPI_Offset* const counts[], const signed char* dataValues) const;
/*! \overload
*/
void putVarn(const int num, MPI_Offset* const starts[], MPI_Offset* const counts[], const short* dataValues) const;
/*! \overload
*/
void putVarn(const int num, MPI_Offset* const starts[], MPI_Offset* const counts[], const int* dataValues) const;
/*! \overload
*/
void putVarn(const int num, MPI_Offset* const starts[], MPI_Offset* const counts[], const long* dataValues) const;
/*! \overload
*/
void putVarn(const int num, MPI_Offset* const starts[], MPI_Offset* const counts[], const float* dataValues) const;
/*! \overload
*/
void putVarn(const int num, MPI_Offset* const starts[], MPI_Offset* const counts[], const double* dataValues) const;
/*! \overload
*/
void putVarn(const int num, MPI_Offset* const starts[], MPI_Offset* const counts[], const unsigned short* dataValues) const;
/*! \overload
*/
void putVarn(const int num, MPI_Offset* const starts[], MPI_Offset* const counts[], const unsigned int* dataValues) const;
/*! \overload
*/
void putVarn(const int num, MPI_Offset* const starts[], MPI_Offset* const counts[], const unsigned long long* dataValues) const;
/*!
Writes a list of subarrays into the netCDF variable.
Each subarray i is specified by giving a corner (starts[i][*]) and a vector of edge lengths (counts[i][*]).
The values to be written are associated with the netCDF variable by assuming that the last dimension of the netCDF variable varies fastest.
\param num
Number of subarrays.
\param starts
2D array of size [num][ndims] where num is the number of subarrays to get and ndims if the number of dimensions of the specified variable.
Each subarray i is specified by starts[i][*], the first of the data values will be written, and counts[i][*], edge lengths of the subarray.
The indices are relative to 0, so for example, the first data value of a variable would have index (0, 0, ... , 0).
The length of the second dimension of starts and counts must be the same as the number of dimensions of the specified variable.
The elements of starts's second dimension correspond, in order, to the variable's dimensions. Hence, if the variable is a record variable,
the first element starts[*][0] would correspond to the starting record number for writing the data values.
\param counts
2D array of size [num][ndims] where num is the number of subarrays to get and ndims if the number of dimensions of the specified variable.
To write a single value, for example, specify count as (1, 1, ... , 1). The length of each count[i] is the number of
dimensions of the specified variable. The elements of each count[i] correspond, in order, to the variable's dimensions.
Hence, if the variable is a record variable, the first element of count[i] corresponds to a count of the number of records to write.
Note: setting any element of the count array to zero causes the function to exit without error, and without doing anything.
\param dataValues Pointer to the location into which the data value is written. If the type of
data value differs from the netCDF variable type, type conversion will occur.
*/
void putVarn(const int num, MPI_Offset* const starts[], MPI_Offset* const counts[], const long long* dataValues) const;
void putVarn(const int num, MPI_Offset* const starts[], MPI_Offset* const counts[], const void* dataValues, MPI_Offset bufcount, MPI_Datatype buftype) const;
////////////////
// Writes an array of values into the netCDF variable. (collective I/O APIs)
/*!
This is an overloaded member function, provided for convenience.
It differs from the above function in what argument(s) it accepts.
In addition, no data conversion is carried out. This means that
the type of the data in memory must match the type of the variable.
*/
// void putVarn_all(const int num, MPI_Offset* const starts[], MPI_Offset* const counts[], const void* dataValues) const;
/*! \overload
*/
void putVarn_all(const int num, MPI_Offset* const starts[], MPI_Offset* const counts[], const char* dataValues) const;
/*! \overload
*/
void putVarn_all(const int num, MPI_Offset* const starts[], MPI_Offset* const counts[], const unsigned char* dataValues) const;
/*! \overload
*/
void putVarn_all(const int num, MPI_Offset* const starts[], MPI_Offset* const counts[], const signed char* dataValues) const;
/*! \overload
*/
void putVarn_all(const int num, MPI_Offset* const starts[], MPI_Offset* const counts[], const short* dataValues) const;
/*! \overload
*/
void putVarn_all(const int num, MPI_Offset* const starts[], MPI_Offset* const counts[], const int* dataValues) const;
/*! \overload
*/
void putVarn_all(const int num, MPI_Offset* const starts[], MPI_Offset* const counts[], const long* dataValues) const;
/*! \overload
*/
void putVarn_all(const int num, MPI_Offset* const starts[], MPI_Offset* const counts[], const float* dataValues) const;
/*! \overload
*/
void putVarn_all(const int num, MPI_Offset* const starts[], MPI_Offset* const counts[], const double* dataValues) const;
/*! \overload
*/
void putVarn_all(const int num, MPI_Offset* const starts[], MPI_Offset* const counts[], const unsigned short* dataValues) const;
/*! \overload
*/
void putVarn_all(const int num, MPI_Offset* const starts[], MPI_Offset* const counts[], const unsigned int* dataValues) const;
/*! \overload
*/
void putVarn_all(const int num, MPI_Offset* const starts[], MPI_Offset* const counts[], const unsigned long long* dataValues) const;
/*!
Writes an array of values into the netCDF variable.
The portion of the netCDF variable to write is specified by giving a corner and a vector of edge lengths
that refer to an array section of the netCDF variable. The values to be written are associated with
the netCDF variable by assuming that the last dimension of the netCDF variable varies fastest.
\param startp Vector specifying the index where the first data values will be written. The indices are relative to 0, so for
example, the first data value of a variable would have index (0, 0, ... , 0). The elements of start correspond, in order, to the
variable's dimensions. Hence, if the variable is a record variable, the first index corresponds to the starting record number for writing the data values.
\param countp Vector specifying the number of indices selected along each dimension.
To write a single value, for example, specify count as (1, 1, ... , 1). The elements of
count correspond, in order, to the variable's dimensions. Hence, if the variable is a record
variable, the first element of count corresponds to a count of the number of records to write. Note: setting any element
of the count array to zero causes the function to exit without error, and without doing anything.
\param dataValues The data values. The order in which the data will be written to the netCDF variable is with the last
dimension of the specified variable varying fastest. If the type of data values differs from the netCDF variable
type, type conversion will occur. (However, no type conversion is
carried out for variables using the user-defined data types:
ncmpi_Vlen, ncmpi_Opaque, ncmpi_Compound and ncmpi_Enum.)
*/
void putVarn_all(const int num, MPI_Offset* const starts[], MPI_Offset* const counts[], const long long* dataValues) const;
void putVarn_all(const int num, MPI_Offset* const starts[], MPI_Offset* const counts[], const void* dataValues, MPI_Offset bufcount, MPI_Datatype buftype) const;
/* vard APIs take filetype and buftype */
void putVard (MPI_Datatype filetype, const void* dataValues, MPI_Offset bufcount, MPI_Datatype buftype) const;
void putVard_all(MPI_Datatype filetype, const void* dataValues, MPI_Offset bufcount, MPI_Datatype buftype) const;
////////////////
// Nonblocking data writing
////////////////////
// Writes the entire data into the netCDF variable.
/*!
This is an overloaded member function, provided for convenience.
It differs from the above function in what argument(s) it accepts.
In addition, no data conversion is carried out. This means that
the type of the data in memory must match the type of the variable.
*/
// void iputVar(const void* dataValues, int *req) const;
/*! \overload
*/
void iputVar(const char* dataValues, int *req) const;
/*! \overload
*/
void iputVar(const unsigned char* dataValues, int *req) const;
/*! \overload
*/
void iputVar(const signed char* dataValues, int *req) const;
/*! \overload
*/
void iputVar(const short* dataValues, int *req) const;
/*! \overload
*/
void iputVar(const int* dataValues, int *req) const;
/*! \overload
*/
void iputVar(const long* dataValues, int *req) const;
/*! \overload
*/
void iputVar(const float* dataValues, int *req) const;
/*! \overload
*/
void iputVar(const double* dataValues, int *req) const;
/*! \overload
*/
void iputVar(const unsigned short* dataValues, int *req) const;
/*! \overload
*/
void iputVar(const unsigned int* dataValues, int *req) const;
/*! \overload
*/
void iputVar(const unsigned long long* dataValues, int *req) const;
/*!
Writes the entire data into the netCDF variable.
This is the simplest interface to use for writing a value in a scalar variable
or whenever all the values of a multidimensional variable can all be
written at once. The values to be written are associated with the
netCDF variable by assuming that the last dimension of the netCDF
variable varies fastest in the C interface.
Take care when using the simplest forms of this interface with
record variables when you don't specify how many records are to be
written. If you try to write all the values of a record variable
into a netCDF file that has no record data yet (hence has 0 records),
nothing will be written. Similarly, if you try to write all of a record
variable but there are more records in the file than you assume, more data
may be written to the file than you supply, which may result in a
segmentation violation.
\param dataValues The data values. The order in which the data will be written to the netCDF variable is with the last
dimension of the specified variable varying fastest. If the type of data values differs from the netCDF variable type, type conversion will occur.
(However, no type conversion is carried out for variables using the user-defined data types:
ncmpi_Vlen, ncmpi_Opaque, ncmpi_Compound and ncmpi_Enum.)
*/
void iputVar(const long long* dataValues, int *req) const;
void iputVar(const void* dataValues, MPI_Offset bufcount, MPI_Datatype buftype, int *req) const;
/////////////////////////
// Writes a single datum into the netCDF variable.
/*!
This is an overloaded member function, provided for convenience.
It differs from the above function in what argument(s) it accepts.
In addition, no data conversion is carried out. This means that
the type of the data in memory must match the type of the variable.
*/
// void iputVar(const std::vector<MPI_Offset>& index, const void* dataumValue, int *req) const;
/*! \overload
*/
void iputVar(const std::vector<MPI_Offset>& index, const std::string& dataumValue, int *req) const;
/*! \overload
*/
void iputVar(const std::vector<MPI_Offset>& index, const unsigned char* dataumValue, int *req) const;
/*! \overload
*/
void iputVar(const std::vector<MPI_Offset>& index, const signed char* dataumValue, int *req) const;
/*! \overload
*/
void iputVar(const std::vector<MPI_Offset>& index, const short dataumValue, int *req) const;
/*! \overload
*/
void iputVar(const std::vector<MPI_Offset>& index, const int dataumValue, int *req) const;
/*! \overload
*/
void iputVar(const std::vector<MPI_Offset>& index, const long dataumValue, int *req) const;
/*! \overload
*/
void iputVar(const std::vector<MPI_Offset>& index, const float dataumValue, int *req) const;
/*! \overload
*/
void iputVar(const std::vector<MPI_Offset>& index, const double dataumValue, int *req) const;
/*! \overload
*/
void iputVar(const std::vector<MPI_Offset>& index, const unsigned short dataumValue, int *req) const;
/*! \overload
*/
void iputVar(const std::vector<MPI_Offset>& index, const unsigned int dataumValue, int *req) const;
/*! \overload
*/
void iputVar(const std::vector<MPI_Offset>& index, const unsigned long long dataumValue, int *req) const;
/*!
Writes a single datum into the netCDF variable.
\param index Vector specifying the index where the data values will be written. The indices are relative to 0, so for example,
the first data value of a two-dimensional variable would have index (0,0). The elements of index must correspond to the variable's dimensions.
Hence, if the variable uses the unlimited dimension, the first index would correspond to the unlimited dimension.
\param datumValue The data value. If the type of data values differs from the netCDF variable type, type conversion will occur.
(However, no type conversion is carried out for variables using the user-defined data types:
ncmpi_Vlen, ncmpi_Opaque, ncmpi_Compound and ncmpi_Enum.)
*/
void iputVar(const std::vector<MPI_Offset>& index, const long long dataumValue, int *req) const;
void iputVar(const std::vector<MPI_Offset>& index, const void* dataumValue, MPI_Offset bufcount, MPI_Datatype buftype, int *req) const;
/////////////////////////
// Writes an array of values into the netCDF variable.
/*!
This is an overloaded member function, provided for convenience.
It differs from the above function in what argument(s) it accepts.
In addition, no data conversion is carried out. This means that
the type of the data in memory must match the type of the variable.
*/
// void iputVar(const std::vector<MPI_Offset>& startp, const std::vector<MPI_Offset>& countp, const void* dataValues, int *req) const;
/*! \overload
*/
void iputVar(const std::vector<MPI_Offset>& startp, const std::vector<MPI_Offset>& countp, const char* dataValues, int *req) const;
/*! \overload
*/
void iputVar(const std::vector<MPI_Offset>& startp, const std::vector<MPI_Offset>& countp, const unsigned char* dataValues, int *req) const;
/*! \overload
*/
void iputVar(const std::vector<MPI_Offset>& startp, const std::vector<MPI_Offset>& countp, const signed char* dataValues, int *req) const;
/*! \overload
*/
void iputVar(const std::vector<MPI_Offset>& startp, const std::vector<MPI_Offset>& countp, const short* dataValues, int *req) const;
/*! \overload
*/
void iputVar(const std::vector<MPI_Offset>& startp, const std::vector<MPI_Offset>& countp, const int* dataValues, int *req) const;
/*! \overload
*/
void iputVar(const std::vector<MPI_Offset>& startp, const std::vector<MPI_Offset>& countp, const long* dataValues, int *req) const;
/*! \overload
*/
void iputVar(const std::vector<MPI_Offset>& startp, const std::vector<MPI_Offset>& countp, const float* dataValues, int *req) const;
/*! \overload
*/
void iputVar(const std::vector<MPI_Offset>& startp, const std::vector<MPI_Offset>& countp, const double* dataValues, int *req) const;
/*! \overload
*/
void iputVar(const std::vector<MPI_Offset>& startp, const std::vector<MPI_Offset>& countp, const unsigned short* dataValues, int *req) const;
/*! \overload
*/
void iputVar(const std::vector<MPI_Offset>& startp, const std::vector<MPI_Offset>& countp, const unsigned int* dataValues, int *req) const;
/*! \overload
*/
void iputVar(const std::vector<MPI_Offset>& startp, const std::vector<MPI_Offset>& countp, const unsigned long long* dataValues, int *req) const;
/*!
Writes an array of values into the netCDF variable.
The portion of the netCDF variable to write is specified by giving a corner and a vector of edge lengths
that refer to an array section of the netCDF variable. The values to be written are associated with
the netCDF variable by assuming that the last dimension of the netCDF variable varies fastest.
\param startp Vector specifying the index where the first data values will be written. The indices are relative to 0, so for
example, the first data value of a variable would have index (0, 0, ... , 0). The elements of start correspond, in order, to the
variable's dimensions. Hence, if the variable is a record variable, the first index corresponds to the starting record number for writing the data values.
\param countp Vector specifying the number of indices selected along each dimension.
To write a single value, for example, specify count as (1, 1, ... , 1). The elements of
count correspond, in order, to the variable's dimensions. Hence, if the variable is a record
variable, the first element of count corresponds to a count of the number of records to write. Note: setting any element
of the count array to zero causes the function to exit without error, and without doing anything.
\param dataValues The data values. The order in which the data will be written to the netCDF variable is with the last
dimension of the specified variable varying fastest. If the type of data values differs from the netCDF variable
type, type conversion will occur. (However, no type conversion is
carried out for variables using the user-defined data types:
ncmpi_Vlen, ncmpi_Opaque, ncmpi_Compound and ncmpi_Enum.)
*/
void iputVar(const std::vector<MPI_Offset>& startp, const std::vector<MPI_Offset>& countp, const long long* dataValues, int *req) const;
void iputVar(const std::vector<MPI_Offset>& startp, const std::vector<MPI_Offset>& countp, const void* dataValues, MPI_Offset bufcount, MPI_Datatype buftype, int *req) const;
////////////////
// Writes a set of subsampled array values into the netCDF variable.
/*!
This is an overloaded member function, provided for convenience.
It differs from the above function in what argument(s) it accepts.
In addition, no data conversion is carried out. This means that
the type of the data in memory must match the type of the variable.
*/
// void iputVar(const std::vector<MPI_Offset>& startp, const std::vector<MPI_Offset>& countp, const std::vector<MPI_Offset>& stridep, const void* dataValues, int *req) const;
/*! \overload
*/
void iputVar(const std::vector<MPI_Offset>& startp, const std::vector<MPI_Offset>& countp, const std::vector<MPI_Offset>& stridep, const char* dataValues, int *req) const;
/*! \overload
*/
void iputVar(const std::vector<MPI_Offset>& startp, const std::vector<MPI_Offset>& countp, const std::vector<MPI_Offset>& stridep, const unsigned char* dataValues, int *req) const;
/*! \overload
*/
void iputVar(const std::vector<MPI_Offset>& startp, const std::vector<MPI_Offset>& countp, const std::vector<MPI_Offset>& stridep, const signed char* dataValues, int *req) const;
/*! \overload
*/
void iputVar(const std::vector<MPI_Offset>& startp, const std::vector<MPI_Offset>& countp, const std::vector<MPI_Offset>& stridep, const short* dataValues, int *req) const;
/*! \overload
*/
void iputVar(const std::vector<MPI_Offset>& startp, const std::vector<MPI_Offset>& countp, const std::vector<MPI_Offset>& stridep, const int* dataValues, int *req) const;
/*! \overload
*/
void iputVar(const std::vector<MPI_Offset>& startp, const std::vector<MPI_Offset>& countp, const std::vector<MPI_Offset>& stridep, const long* dataValues, int *req) const;
/*! \overload
*/
void iputVar(const std::vector<MPI_Offset>& startp, const std::vector<MPI_Offset>& countp, const std::vector<MPI_Offset>& stridep, const float* dataValues, int *req) const;
/*! \overload
*/
void iputVar(const std::vector<MPI_Offset>& startp, const std::vector<MPI_Offset>& countp, const std::vector<MPI_Offset>& stridep, const double* dataValues, int *req) const;
/*! \overload
*/
void iputVar(const std::vector<MPI_Offset>& startp, const std::vector<MPI_Offset>& countp, const std::vector<MPI_Offset>& stridep, const unsigned short* dataValues, int *req) const;
/*! \overload
*/
void iputVar(const std::vector<MPI_Offset>& startp, const std::vector<MPI_Offset>& countp, const std::vector<MPI_Offset>& stridep, const unsigned int* dataValues, int *req) const;
/*! \overload
*/
void iputVar(const std::vector<MPI_Offset>& startp, const std::vector<MPI_Offset>& countp, const std::vector<MPI_Offset>& stridep, const unsigned long long* dataValues, int *req) const;
/*!
Writes an array of values into the netCDF variable.
The subsampled array section is specified by giving a corner, a vector of counts, and a stride vector.
\param startp Vector specifying the index where the first data values will be written. The indices are relative to 0, so for
example, the first data value of a variable would have index (0, 0, ... , 0). The elements of start correspond, in order, to the
variable's dimensions. Hence, if the variable is a record variable, the first index corresponds to the starting record number for writing the data values.
\param countp Vector specifying the number of indices selected along each dimension.
To write a single value, for example, specify count as (1, 1, ... , 1). The elements of
count correspond, in order, to the variable's dimensions. Hence, if the variable is a record
variable, the first element of count corresponds to a count of the number of records to write. Note: setting any element
of the count array to zero causes the function to exit without error, and without doing anything.
\param stridep A vector of MPI_Offset integers that specifies the sampling interval along each dimension of the netCDF variable.
The elements of the stride vector correspond, in order, to the netCDF variable's dimensions (stride[0] gives the sampling interval
along the most slowly varying dimension of the netCDF variable). Sampling intervals are specified in type-independent units of
elements (a value of 1 selects consecutive elements of the netCDF variable along the corresponding dimension, a value of 2 selects
every other element, etc.). A NULL stride argument is treated as (1, 1, ... , 1).
\param dataValues The data values. The order in which the data will be written to the netCDF variable is with the last
dimension of the specified variable varying fastest. If the type of data values differs from the netCDF variable type, type conversion will occur.
(However, no type conversion is carried out for variables using the user-defined data types: ncmpi_Vlen, ncmpi_Opaque, ncmpi_Compound and ncmpi_Enum.
*/
void iputVar(const std::vector<MPI_Offset>& startp, const std::vector<MPI_Offset>& countp, const std::vector<MPI_Offset>& stridep, const long long* dataValues, int *req) const;
void iputVar(const std::vector<MPI_Offset>& startp, const std::vector<MPI_Offset>& countp, const std::vector<MPI_Offset>& stridep, const void* dataValues, MPI_Offset bufcount, MPI_Datatype buftype, int *req) const;
////////////////
// Writes a mapped array section of values into the netCDF variable.
/*!
This is an overloaded member function, provided for convenience.
It differs from the above function in what argument(s) it accepts.
In addition, no data conversion is carried out. This means that
the type of the data in memory must match the type of the variable.
*/
// void iputVar(const std::vector<MPI_Offset>& startp, const std::vector<MPI_Offset>& countp, const std::vector<MPI_Offset>& stridep, const std::vector<MPI_Offset>& imapp, const void* dataValues, int *req) const;
/*! \overload
*/
void iputVar(const std::vector<MPI_Offset>& startp, const std::vector<MPI_Offset>& countp, const std::vector<MPI_Offset>& stridep, const std::vector<MPI_Offset>& imapp, const char* dataValues, int *req) const;
/*! \overload
*/
void iputVar(const std::vector<MPI_Offset>& startp, const std::vector<MPI_Offset>& countp, const std::vector<MPI_Offset>& stridep, const std::vector<MPI_Offset>& imapp, const unsigned char* dataValues, int *req) const;
/*! \overload
*/
void iputVar(const std::vector<MPI_Offset>& startp, const std::vector<MPI_Offset>& countp, const std::vector<MPI_Offset>& stridep, const std::vector<MPI_Offset>& imapp, const signed char* dataValues, int *req) const;
/*! \overload
*/
void iputVar(const std::vector<MPI_Offset>& startp, const std::vector<MPI_Offset>& countp, const std::vector<MPI_Offset>& stridep, const std::vector<MPI_Offset>& imapp, const short* dataValues, int *req) const;
/*! \overload
*/
void iputVar(const std::vector<MPI_Offset>& startp, const std::vector<MPI_Offset>& countp, const std::vector<MPI_Offset>& stridep, const std::vector<MPI_Offset>& imapp, const int* dataValues, int *req) const;
/*! \overload
*/
void iputVar(const std::vector<MPI_Offset>& startp, const std::vector<MPI_Offset>& countp, const std::vector<MPI_Offset>& stridep, const std::vector<MPI_Offset>& imapp, const long* dataValues, int *req) const;
/*! \overload
*/
void iputVar(const std::vector<MPI_Offset>& startp, const std::vector<MPI_Offset>& countp, const std::vector<MPI_Offset>& stridep, const std::vector<MPI_Offset>& imapp, const float* dataValues, int *req) const;
/*! \overload
*/
void iputVar(const std::vector<MPI_Offset>& startp, const std::vector<MPI_Offset>& countp, const std::vector<MPI_Offset>& stridep, const std::vector<MPI_Offset>& imapp, const double* dataValues, int *req) const;
/*! \overload
*/
void iputVar(const std::vector<MPI_Offset>& startp, const std::vector<MPI_Offset>& countp, const std::vector<MPI_Offset>& stridep, const std::vector<MPI_Offset>& imapp, const unsigned short* dataValues, int *req) const;
/*! \overload
*/
void iputVar(const std::vector<MPI_Offset>& startp, const std::vector<MPI_Offset>& countp, const std::vector<MPI_Offset>& stridep, const std::vector<MPI_Offset>& imapp, const unsigned int* dataValues, int *req) const;
/*! \overload
*/
void iputVar(const std::vector<MPI_Offset>& startp, const std::vector<MPI_Offset>& countp, const std::vector<MPI_Offset>& stridep, const std::vector<MPI_Offset>& imapp, const unsigned long long* dataValues, int *req) const;
/*!
Writes a mapped array section of values into the netCDF variable.
The mapped array section is specified by giving a corner, a vector of counts, a stride vector, and an index mapping vector.
The index mapping vector is a vector of integers that specifies the mapping between the dimensions of a netCDF variable and the in-memory structure of the internal data array.
No assumptions are made about the ordering or length of the dimensions of the data array.
\param countp Vector specifying the number of indices selected along each dimension.
To write a single value, for example, specify count as (1, 1, ... , 1). The elements of
count correspond, in order, to the variable's dimensions. Hence, if the variable is a record
variable, the first element of count corresponds to a count of the number of records to write. Note: setting any element
of the count array to zero causes the function to exit without error, and without doing anything.
\param stridep A vector of MPI_Offset integers that specifies the sampling interval along each dimension of the netCDF variable.
The elements of the stride vector correspond, in order, to the netCDF variable's dimensions (stride[0] gives the sampling interval
along the most slowly varying dimension of the netCDF variable). Sampling intervals are specified in type-independent units of
elements (a value of 1 selects consecutive elements of the netCDF variable along the corresponding dimension, a value of 2 selects
every other element, etc.). A NULL stride argument is treated as (1, 1, ... , 1).
\param imap Vector specifies the mapping between the dimensions of a netCDF variable and the in-memory structure of the internal data array.
The elements of the index mapping vector correspond, in order, to the netCDF variable's dimensions (imap[0] gives the distance between elements
of the internal array corresponding to the most slowly varying dimension of the netCDF variable). Distances between elements are
specified in type-independent units of elements (the distance between internal elements that occupy adjacent memory locations is
1 and not the element's byte-length as in netCDF 2). A NULL argument means the memory-resident values have the same structure as
the associated netCDF variable.
\param dataValues The data values. The order in which the data will be written to the netCDF variable is with the last
dimension of the specified variable varying fastest. If the type of data values differs from the netCDF variable type, type conversion will occur.
(However, no type conversion is carried out for variables using the user-defined data types: ncmpi_Vlen, ncmpi_Opaque, ncmpi_Compound and ncmpi_Enum.)
*/
void iputVar(const std::vector<MPI_Offset>& startp, const std::vector<MPI_Offset>& countp, const std::vector<MPI_Offset>& stridep, const std::vector<MPI_Offset>& imapp, const long long* dataValues, int *req) const;
void iputVar(const std::vector<MPI_Offset>& startp, const std::vector<MPI_Offset>& countp, const std::vector<MPI_Offset>& stridep, const std::vector<MPI_Offset>& imapp, const void* dataValues, MPI_Offset bufcount, MPI_Datatype buftype, int *req) const;
////////////////////
// Writes a list of subarrays into the netCDF variable. (independent I/O APIs)
/*!
This is an overloaded member function, provided for convenience.
It differs from the above function in what argument(s) it accepts.
In addition, no data conversion is carried out. This means that
the type of the data in memory must match the type of the variable.
*/
// void putVarn(const int num, MPI_Offset* const starts[], MPI_Offset* const counts[], const void* dataValues) const;
/*! \overload
*/
void iputVarn(const int num, MPI_Offset* const starts[], MPI_Offset* const counts[], const char* dataValues, int *req) const;
/*! \overload
*/
void iputVarn(const int num, MPI_Offset* const starts[], MPI_Offset* const counts[], const unsigned char* dataValues, int *req) const;
/*! \overload
*/
void iputVarn(const int num, MPI_Offset* const starts[], MPI_Offset* const counts[], const signed char* dataValues, int *req) const;
/*! \overload
*/
void iputVarn(const int num, MPI_Offset* const starts[], MPI_Offset* const counts[], const short* dataValues, int *req) const;
/*! \overload
*/
void iputVarn(const int num, MPI_Offset* const starts[], MPI_Offset* const counts[], const int* dataValues, int *req) const;
/*! \overload
*/
void iputVarn(const int num, MPI_Offset* const starts[], MPI_Offset* const counts[], const long* dataValues, int *req) const;
/*! \overload
*/
void iputVarn(const int num, MPI_Offset* const starts[], MPI_Offset* const counts[], const float* dataValues, int *req) const;
/*! \overload
*/
void iputVarn(const int num, MPI_Offset* const starts[], MPI_Offset* const counts[], const double* dataValues, int *req) const;
/*! \overload
*/
void iputVarn(const int num, MPI_Offset* const starts[], MPI_Offset* const counts[], const unsigned short* dataValues, int *req) const;
/*! \overload
*/
void iputVarn(const int num, MPI_Offset* const starts[], MPI_Offset* const counts[], const unsigned int* dataValues, int *req) const;
/*! \overload
*/
void iputVarn(const int num, MPI_Offset* const starts[], MPI_Offset* const counts[], const unsigned long long* dataValues, int *req) const;
/*!
Writes a list of subarrays into the netCDF variable.
Each subarray i is specified by giving a corner (starts[i][*]) and a vector of edge lengths (counts[i][*]).
The values to be written are associated with the netCDF variable by assuming that the last dimension of the netCDF variable varies fastest.
\param num
Number of subarrays.
\param starts
2D array of size [num][ndims] where num is the number of subarrays to get and ndims if the number of dimensions of the specified variable.
Each subarray i is specified by starts[i][*], the first of the data values will be written, and counts[i][*], edge lengths of the subarray.
The indices are relative to 0, so for example, the first data value of a variable would have index (0, 0, ... , 0).
The length of the second dimension of starts and counts must be the same as the number of dimensions of the specified variable.
The elements of starts's second dimension correspond, in order, to the variable's dimensions. Hence, if the variable is a record variable,
the first element starts[*][0] would correspond to the starting record number for writing the data values.
\param counts
2D array of size [num][ndims] where num is the number of subarrays to get and ndims if the number of dimensions of the specified variable.
To write a single value, for example, specify count as (1, 1, ... , 1). The length of each count[i] is the number of
dimensions of the specified variable. The elements of each count[i] correspond, in order, to the variable's dimensions.
Hence, if the variable is a record variable, the first element of count[i] corresponds to a count of the number of records to write.
Note: setting any element of the count array to zero causes the function to exit without error, and without doing anything.
\param dataValues Pointer to the location into which the data value is written. If the type of
data value differs from the netCDF variable type, type conversion will occur.
*/
void iputVarn(const int num, MPI_Offset* const starts[], MPI_Offset* const counts[], const long long* dataValues, int *req) const;
void iputVarn(const int num, MPI_Offset* const starts[], MPI_Offset* const counts[], const void* dataValues, MPI_Offset bufcount, MPI_Datatype buftype, int *req) const;
////////////////////
// Buffered nonblocking data writing
////////////////////
// Writes the entire data into the netCDF variable.
/*!
This is an overloaded member function, provided for convenience.
It differs from the above function in what argument(s) it accepts.
In addition, no data conversion is carried out. This means that
the type of the data in memory must match the type of the variable.
*/
// void bputVar(const void* dataValues, int *req) const;
/*! \overload
*/
void bputVar(const char* dataValues, int *req) const;
/*! \overload
*/
void bputVar(const unsigned char* dataValues, int *req) const;
/*! \overload
*/
void bputVar(const signed char* dataValues, int *req) const;
/*! \overload
*/
void bputVar(const short* dataValues, int *req) const;
/*! \overload
*/
void bputVar(const int* dataValues, int *req) const;
/*! \overload
*/
void bputVar(const long* dataValues, int *req) const;
/*! \overload
*/
void bputVar(const float* dataValues, int *req) const;
/*! \overload
*/
void bputVar(const double* dataValues, int *req) const;
/*! \overload
*/
void bputVar(const unsigned short* dataValues, int *req) const;
/*! \overload
*/
void bputVar(const unsigned int* dataValues, int *req) const;
/*! \overload
*/
void bputVar(const unsigned long long* dataValues, int *req) const;
/*!
Writes the entire data into the netCDF variable.
This is the simplest interface to use for writing a value in a scalar variable
or whenever all the values of a multidimensional variable can all be
written at once. The values to be written are associated with the
netCDF variable by assuming that the last dimension of the netCDF
variable varies fastest in the C interface.
Take care when using the simplest forms of this interface with
record variables when you don't specify how many records are to be
written. If you try to write all the values of a record variable
into a netCDF file that has no record data yet (hence has 0 records),
nothing will be written. Similarly, if you try to write all of a record
variable but there are more records in the file than you assume, more data
may be written to the file than you supply, which may result in a
segmentation violation.
\param dataValues The data values. The order in which the data will be written to the netCDF variable is with the last
dimension of the specified variable varying fastest. If the type of data values differs from the netCDF variable type, type conversion will occur.
(However, no type conversion is carried out for variables using the user-defined data types:
ncmpi_Vlen, ncmpi_Opaque, ncmpi_Compound and ncmpi_Enum.)
*/
void bputVar(const long long* dataValues, int *req) const;
void bputVar(const void* dataValues, MPI_Offset bufcount, MPI_Datatype buftype, int *req) const;
/////////////////////////
// Writes a single datum into the netCDF variable.
/*!
This is an overloaded member function, provided for convenience.
It differs from the above function in what argument(s) it accepts.
In addition, no data conversion is carried out. This means that
the type of the data in memory must match the type of the variable.
*/
// void bputVar(const std::vector<MPI_Offset>& index, const void* dataumValue, int *req) const;
/*! \overload
*/
void bputVar(const std::vector<MPI_Offset>& index, const std::string& dataumValue, int *req) const;
/*! \overload
*/
void bputVar(const std::vector<MPI_Offset>& index, const unsigned char* dataumValue, int *req) const;
/*! \overload
*/
void bputVar(const std::vector<MPI_Offset>& index, const signed char* dataumValue, int *req) const;
/*! \overload
*/
void bputVar(const std::vector<MPI_Offset>& index, const short dataumValue, int *req) const;
/*! \overload
*/
void bputVar(const std::vector<MPI_Offset>& index, const int dataumValue, int *req) const;
/*! \overload
*/
void bputVar(const std::vector<MPI_Offset>& index, const long dataumValue, int *req) const;
/*! \overload
*/
void bputVar(const std::vector<MPI_Offset>& index, const float dataumValue, int *req) const;
/*! \overload
*/
void bputVar(const std::vector<MPI_Offset>& index, const double dataumValue, int *req) const;
/*! \overload
*/
void bputVar(const std::vector<MPI_Offset>& index, const unsigned short dataumValue, int *req) const;
/*! \overload
*/
void bputVar(const std::vector<MPI_Offset>& index, const unsigned int dataumValue, int *req) const;
/*! \overload
*/
void bputVar(const std::vector<MPI_Offset>& index, const unsigned long long dataumValue, int *req) const;
/*!
Writes a single datum into the netCDF variable.
\param index Vector specifying the index where the data values will be written. The indices are relative to 0, so for example,
the first data value of a two-dimensional variable would have index (0,0). The elements of index must correspond to the variable's dimensions.
Hence, if the variable uses the unlimited dimension, the first index would correspond to the unlimited dimension.
\param datumValue The data value. If the type of data values differs from the netCDF variable type, type conversion will occur.
(However, no type conversion is carried out for variables using the user-defined data types:
ncmpi_Vlen, ncmpi_Opaque, ncmpi_Compound and ncmpi_Enum.)
*/
void bputVar(const std::vector<MPI_Offset>& index, const long long dataumValue, int *req) const;
void bputVar(const std::vector<MPI_Offset>& index, const void* dataumValue, MPI_Offset bufcount, MPI_Datatype buftype, int *req) const;
/////////////////////////
// Writes an array of values into the netCDF variable.
/*!
This is an overloaded member function, provided for convenience.
It differs from the above function in what argument(s) it accepts.
In addition, no data conversion is carried out. This means that
the type of the data in memory must match the type of the variable.
*/
// void bputVar(const std::vector<MPI_Offset>& startp, const std::vector<MPI_Offset>& countp, const void* dataValues, int *req) const;
/*! \overload
*/
void bputVar(const std::vector<MPI_Offset>& startp, const std::vector<MPI_Offset>& countp, const char* dataValues, int *req) const;
/*! \overload
*/
void bputVar(const std::vector<MPI_Offset>& startp, const std::vector<MPI_Offset>& countp, const unsigned char* dataValues, int *req) const;
/*! \overload
*/
void bputVar(const std::vector<MPI_Offset>& startp, const std::vector<MPI_Offset>& countp, const signed char* dataValues, int *req) const;
/*! \overload
*/
void bputVar(const std::vector<MPI_Offset>& startp, const std::vector<MPI_Offset>& countp, const short* dataValues, int *req) const;
/*! \overload
*/
void bputVar(const std::vector<MPI_Offset>& startp, const std::vector<MPI_Offset>& countp, const int* dataValues, int *req) const;
/*! \overload
*/
void bputVar(const std::vector<MPI_Offset>& startp, const std::vector<MPI_Offset>& countp, const long* dataValues, int *req) const;
/*! \overload
*/
void bputVar(const std::vector<MPI_Offset>& startp, const std::vector<MPI_Offset>& countp, const float* dataValues, int *req) const;
/*! \overload
*/
void bputVar(const std::vector<MPI_Offset>& startp, const std::vector<MPI_Offset>& countp, const double* dataValues, int *req) const;
/*! \overload
*/
void bputVar(const std::vector<MPI_Offset>& startp, const std::vector<MPI_Offset>& countp, const unsigned short* dataValues, int *req) const;
/*! \overload
*/
void bputVar(const std::vector<MPI_Offset>& startp, const std::vector<MPI_Offset>& countp, const unsigned int* dataValues, int *req) const;
/*! \overload
*/
void bputVar(const std::vector<MPI_Offset>& startp, const std::vector<MPI_Offset>& countp, const unsigned long long* dataValues, int *req) const;
/*!
Writes an array of values into the netCDF variable.
The portion of the netCDF variable to write is specified by giving a corner and a vector of edge lengths
that refer to an array section of the netCDF variable. The values to be written are associated with
the netCDF variable by assuming that the last dimension of the netCDF variable varies fastest.
\param startp Vector specifying the index where the first data values will be written. The indices are relative to 0, so for
example, the first data value of a variable would have index (0, 0, ... , 0). The elements of start correspond, in order, to the
variable's dimensions. Hence, if the variable is a record variable, the first index corresponds to the starting record number for writing the data values.
\param countp Vector specifying the number of indices selected along each dimension.
To write a single value, for example, specify count as (1, 1, ... , 1). The elements of
count correspond, in order, to the variable's dimensions. Hence, if the variable is a record
variable, the first element of count corresponds to a count of the number of records to write. Note: setting any element
of the count array to zero causes the function to exit without error, and without doing anything.
\param dataValues The data values. The order in which the data will be written to the netCDF variable is with the last
dimension of the specified variable varying fastest. If the type of data values differs from the netCDF variable
type, type conversion will occur. (However, no type conversion is
carried out for variables using the user-defined data types:
ncmpi_Vlen, ncmpi_Opaque, ncmpi_Compound and ncmpi_Enum.)
*/
void bputVar(const std::vector<MPI_Offset>& startp, const std::vector<MPI_Offset>& countp, const long long* dataValues, int *req) const;
void bputVar(const std::vector<MPI_Offset>& startp, const std::vector<MPI_Offset>& countp, const void* dataValues, MPI_Offset bufcount, MPI_Datatype buftype, int *req) const;
////////////////
// Writes a set of subsampled array values into the netCDF variable.
/*!
This is an overloaded member function, provided for convenience.
It differs from the above function in what argument(s) it accepts.
In addition, no data conversion is carried out. This means that
the type of the data in memory must match the type of the variable.
*/
// void bputVar(const std::vector<MPI_Offset>& startp, const std::vector<MPI_Offset>& countp, const std::vector<MPI_Offset>& stridep, const void* dataValues, int *req) const;
/*! \overload
*/
void bputVar(const std::vector<MPI_Offset>& startp, const std::vector<MPI_Offset>& countp, const std::vector<MPI_Offset>& stridep, const char* dataValues, int *req) const;
/*! \overload
*/
void bputVar(const std::vector<MPI_Offset>& startp, const std::vector<MPI_Offset>& countp, const std::vector<MPI_Offset>& stridep, const unsigned char* dataValues, int *req) const;
/*! \overload
*/
void bputVar(const std::vector<MPI_Offset>& startp, const std::vector<MPI_Offset>& countp, const std::vector<MPI_Offset>& stridep, const signed char* dataValues, int *req) const;
/*! \overload
*/
void bputVar(const std::vector<MPI_Offset>& startp, const std::vector<MPI_Offset>& countp, const std::vector<MPI_Offset>& stridep, const short* dataValues, int *req) const;
/*! \overload
*/
void bputVar(const std::vector<MPI_Offset>& startp, const std::vector<MPI_Offset>& countp, const std::vector<MPI_Offset>& stridep, const int* dataValues, int *req) const;
/*! \overload
*/
void bputVar(const std::vector<MPI_Offset>& startp, const std::vector<MPI_Offset>& countp, const std::vector<MPI_Offset>& stridep, const long* dataValues, int *req) const;
/*! \overload
*/
void bputVar(const std::vector<MPI_Offset>& startp, const std::vector<MPI_Offset>& countp, const std::vector<MPI_Offset>& stridep, const float* dataValues, int *req) const;
/*! \overload
*/
void bputVar(const std::vector<MPI_Offset>& startp, const std::vector<MPI_Offset>& countp, const std::vector<MPI_Offset>& stridep, const double* dataValues, int *req) const;
/*! \overload
*/
void bputVar(const std::vector<MPI_Offset>& startp, const std::vector<MPI_Offset>& countp, const std::vector<MPI_Offset>& stridep, const unsigned short* dataValues, int *req) const;
/*! \overload
*/
void bputVar(const std::vector<MPI_Offset>& startp, const std::vector<MPI_Offset>& countp, const std::vector<MPI_Offset>& stridep, const unsigned int* dataValues, int *req) const;
/*! \overload
*/
void bputVar(const std::vector<MPI_Offset>& startp, const std::vector<MPI_Offset>& countp, const std::vector<MPI_Offset>& stridep, const unsigned long long* dataValues, int *req) const;
/*!
Writes an array of values into the netCDF variable.
The subsampled array section is specified by giving a corner, a vector of counts, and a stride vector.
\param startp Vector specifying the index where the first data values will be written. The indices are relative to 0, so for
example, the first data value of a variable would have index (0, 0, ... , 0). The elements of start correspond, in order, to the
variable's dimensions. Hence, if the variable is a record variable, the first index corresponds to the starting record number for writing the data values.
\param countp Vector specifying the number of indices selected along each dimension.
To write a single value, for example, specify count as (1, 1, ... , 1). The elements of
count correspond, in order, to the variable's dimensions. Hence, if the variable is a record
variable, the first element of count corresponds to a count of the number of records to write. Note: setting any element
of the count array to zero causes the function to exit without error, and without doing anything.
\param stridep A vector of MPI_Offset integers that specifies the sampling interval along each dimension of the netCDF variable.
The elements of the stride vector correspond, in order, to the netCDF variable's dimensions (stride[0] gives the sampling interval
along the most slowly varying dimension of the netCDF variable). Sampling intervals are specified in type-independent units of
elements (a value of 1 selects consecutive elements of the netCDF variable along the corresponding dimension, a value of 2 selects
every other element, etc.). A NULL stride argument is treated as (1, 1, ... , 1).
\param dataValues The data values. The order in which the data will be written to the netCDF variable is with the last
dimension of the specified variable varying fastest. If the type of data values differs from the netCDF variable type, type conversion will occur.
(However, no type conversion is carried out for variables using the user-defined data types: ncmpi_Vlen, ncmpi_Opaque, ncmpi_Compound and ncmpi_Enum.
*/
void bputVar(const std::vector<MPI_Offset>& startp, const std::vector<MPI_Offset>& countp, const std::vector<MPI_Offset>& stridep, const long long* dataValues, int *req) const;
void bputVar(const std::vector<MPI_Offset>& startp, const std::vector<MPI_Offset>& countp, const std::vector<MPI_Offset>& stridep, const void* dataValues, MPI_Offset bufcount, MPI_Datatype buftype, int *req) const;
////////////////
// Writes a mapped array section of values into the netCDF variable.
/*!
This is an overloaded member function, provided for convenience.
It differs from the above function in what argument(s) it accepts.
In addition, no data conversion is carried out. This means that
the type of the data in memory must match the type of the variable.
*/
// void bputVar(const std::vector<MPI_Offset>& startp, const std::vector<MPI_Offset>& countp, const std::vector<MPI_Offset>& stridep, const std::vector<MPI_Offset>& imapp, const void* dataValues, int *req) const;
/*! \overload
*/
void bputVar(const std::vector<MPI_Offset>& startp, const std::vector<MPI_Offset>& countp, const std::vector<MPI_Offset>& stridep, const std::vector<MPI_Offset>& imapp, const char* dataValues, int *req) const;
/*! \overload
*/
void bputVar(const std::vector<MPI_Offset>& startp, const std::vector<MPI_Offset>& countp, const std::vector<MPI_Offset>& stridep, const std::vector<MPI_Offset>& imapp, const unsigned char* dataValues, int *req) const;
/*! \overload
*/
void bputVar(const std::vector<MPI_Offset>& startp, const std::vector<MPI_Offset>& countp, const std::vector<MPI_Offset>& stridep, const std::vector<MPI_Offset>& imapp, const signed char* dataValues, int *req) const;
/*! \overload
*/
void bputVar(const std::vector<MPI_Offset>& startp, const std::vector<MPI_Offset>& countp, const std::vector<MPI_Offset>& stridep, const std::vector<MPI_Offset>& imapp, const short* dataValues, int *req) const;
/*! \overload
*/
void bputVar(const std::vector<MPI_Offset>& startp, const std::vector<MPI_Offset>& countp, const std::vector<MPI_Offset>& stridep, const std::vector<MPI_Offset>& imapp, const int* dataValues, int *req) const;
/*! \overload
*/
void bputVar(const std::vector<MPI_Offset>& startp, const std::vector<MPI_Offset>& countp, const std::vector<MPI_Offset>& stridep, const std::vector<MPI_Offset>& imapp, const long* dataValues, int *req) const;
/*! \overload
*/
void bputVar(const std::vector<MPI_Offset>& startp, const std::vector<MPI_Offset>& countp, const std::vector<MPI_Offset>& stridep, const std::vector<MPI_Offset>& imapp, const float* dataValues, int *req) const;
/*! \overload
*/
void bputVar(const std::vector<MPI_Offset>& startp, const std::vector<MPI_Offset>& countp, const std::vector<MPI_Offset>& stridep, const std::vector<MPI_Offset>& imapp, const double* dataValues, int *req) const;
/*! \overload
*/
void bputVar(const std::vector<MPI_Offset>& startp, const std::vector<MPI_Offset>& countp, const std::vector<MPI_Offset>& stridep, const std::vector<MPI_Offset>& imapp, const unsigned short* dataValues, int *req) const;
/*! \overload
*/
void bputVar(const std::vector<MPI_Offset>& startp, const std::vector<MPI_Offset>& countp, const std::vector<MPI_Offset>& stridep, const std::vector<MPI_Offset>& imapp, const unsigned int* dataValues, int *req) const;
/*! \overload
*/
void bputVar(const std::vector<MPI_Offset>& startp, const std::vector<MPI_Offset>& countp, const std::vector<MPI_Offset>& stridep, const std::vector<MPI_Offset>& imapp, const unsigned long long* dataValues, int *req) const;
/*!
Writes a mapped array section of values into the netCDF variable.
The mapped array section is specified by giving a corner, a vector of counts, a stride vector, and an index mapping vector.
The index mapping vector is a vector of integers that specifies the mapping between the dimensions of a netCDF variable and the in-memory structure of the internal data array.
No assumptions are made about the ordering or length of the dimensions of the data array.
\param countp Vector specifying the number of indices selected along each dimension.
To write a single value, for example, specify count as (1, 1, ... , 1). The elements of
count correspond, in order, to the variable's dimensions. Hence, if the variable is a record
variable, the first element of count corresponds to a count of the number of records to write. Note: setting any element
of the count array to zero causes the function to exit without error, and without doing anything.
\param stridep A vector of MPI_Offset integers that specifies the sampling interval along each dimension of the netCDF variable.
The elements of the stride vector correspond, in order, to the netCDF variable's dimensions (stride[0] gives the sampling interval
along the most slowly varying dimension of the netCDF variable). Sampling intervals are specified in type-independent units of
elements (a value of 1 selects consecutive elements of the netCDF variable along the corresponding dimension, a value of 2 selects
every other element, etc.). A NULL stride argument is treated as (1, 1, ... , 1).
\param imap Vector specifies the mapping between the dimensions of a netCDF variable and the in-memory structure of the internal data array.
The elements of the index mapping vector correspond, in order, to the netCDF variable's dimensions (imap[0] gives the distance between elements
of the internal array corresponding to the most slowly varying dimension of the netCDF variable). Distances between elements are
specified in type-independent units of elements (the distance between internal elements that occupy adjacent memory locations is
1 and not the element's byte-length as in netCDF 2). A NULL argument means the memory-resident values have the same structure as
the associated netCDF variable.
\param dataValues The data values. The order in which the data will be written to the netCDF variable is with the last
dimension of the specified variable varying fastest. If the type of data values differs from the netCDF variable type, type conversion will occur.
(However, no type conversion is carried out for variables using the user-defined data types: ncmpi_Vlen, ncmpi_Opaque, ncmpi_Compound and ncmpi_Enum.)
*/
void bputVar(const std::vector<MPI_Offset>& startp, const std::vector<MPI_Offset>& countp, const std::vector<MPI_Offset>& stridep, const std::vector<MPI_Offset>& imapp, const long long* dataValues, int *req) const;
void bputVar(const std::vector<MPI_Offset>& startp, const std::vector<MPI_Offset>& countp, const std::vector<MPI_Offset>& stridep, const std::vector<MPI_Offset>& imapp, const void* dataValues, MPI_Offset bufcount, MPI_Datatype buftype, int *req) const;
void Inq_file_offset(MPI_Offset *offset);
private:
bool nullObject;
int myId;
int groupId;
};
}
namespace PnetCDF
{
class NcmpiGroup; // forward declaration.
/*! Class represents a netCDF VLEN type */
class NcmpiVlenType : public NcmpiType
{
public:
/*! Constructor generates a \ref isNull "null object". */
NcmpiVlenType();
/*!
Constructor.
The vlen Type must already exist in the netCDF file. New netCDF vlen types can be added
using NcmpiGroup::addNcmpiVlenType();
\param grp The parent group where this type is defined.
\param name Name of new type.
*/
NcmpiVlenType(const NcmpiGroup& grp, const std::string& name);
/*!
Constructor.
Constructs from the base type NcmpiType object. Will throw an exception if the NcmpiType is not the base of a Vlen type.
\param ncmpiType A Nctype object.
*/
NcmpiVlenType(const NcmpiType& ncmpiType);
/*! assignment operator */
NcmpiVlenType& operator=(const NcmpiVlenType& rhs);
/*!
Assignment operator.
This assigns from the base type NcmpiType object. Will throw an exception if the NcmpiType is not the base of a Vlen type.
*/
NcmpiVlenType& operator=(const NcmpiType& rhs);
/*! The copy constructor. */
NcmpiVlenType(const NcmpiVlenType& rhs);
~NcmpiVlenType(){;}
/*! Returns the base type. */
NcmpiType getBaseType() const;
};
}
|