MPAS-Dev / MPAS-Tools

MPAS Tools Repository
Other
37 stars 63 forks source link

Add a check and a warning in processing the ismip6 flux variables #495

Closed hollyhan closed 1 year ago

hollyhan commented 1 year ago

This PR adds a check for the 'units' attribute in daysSinceStart because without the check for the 'units' attribute, the processing fails when processing output files that have been cleaned up for the time loop issues. The PR also 1) modifies the functions for generating ismip6 grid scripfile and writing 2d flux and state files to account for cases when x and y polar coordinate variables are missing in the ismip6 grid files, and 2) add a warning statement on differences between the assigned volume and threshold cells.

hollyhan commented 1 year ago

Update on some of the test results (the results are in the directory: /global/cscratch1/sd/hollyhan/ISM_SimulationChecker/outputs_4km_trhille/ISMIP6AE_4km_20230105/hist_04/):

The calculated x coordinate variable show the following:

(e3sm_unified_1.8.0_nompi) hollyhan@cori05:/global/cscratch1/sd/hollyhan/MPAS-Tools/landice/output_processing_li/ismip6_postprocessi
ng> ncdump -v x /global/cscratch1/sd/hollyhan/ISM_SimulationChecker/outputs_4km_trhille/ISMIP6AE_4km_20230105/hist_04/lithk_AIS_DOE_MALI_hist.nc 
netcdf lithk_AIS_DOE_MALI_hist {
dimensions:
    time = 16 ;
    x = 1521 ;
    y = 1521 ;
variables:
    double lithk(time, y, x) ;
        lithk:_FillValue = NaN ;
        lithk:standard_name = "land_ice_thickness" ;
        lithk:units = "m" ;
    double x(x) ;
        x:units = "m" ;
        x:standard_name = "x" ;
        x:long_name = "x" ;
    double y(y) ;
        y:units = "m" ;
        y:standard_name = "y" ;
        y:long_name = "y" ;
    double time(time) ;
        time:units = "days since 2000-01-01" ;
        time:calendar = "noleap" ;
        time:standard_name = "time" ;
        time:long_name = "time" ;

// global attributes:
        :AUTHORS = "Matthew Hoffman, Trevor Hillebrand, Holly Kyeore Han" ;
        :MODEL = "MALI (MPAS-Albany Land Ice model)" ;
        :GROUP = "Los Alamos National Laboratory, Department of Energy" ;
        :VARIABLE = "Ice thickness" ;
        :DATE = "03-Mar-2023" ;
data:

 x = -3040000, -3036000, -3032000, -3028000, -3024000, -3020000, -3016000, 
    -3012000, -3008000, -3004000, -3000000, -2996000, -2992000, -2988000, 
    -2984000, -2980000, -2976000, -2972000, -2968000, -2964000, -2960000, 
    -2956000, -2952000, -2948000, -2944000, -2940000, -2936000, -2932000, 
    -2928000, -2924000, -2920000, -2916000, -2912000, -2908000, -2904000, 
    -2900000, -2896000, -2892000, -2888000, -2884000, -2880000, -2876000, 
    -2872000, -2868000, -2864000, -2860000, -2856000, -2852000, -2848000, 
    -2844000, -2840000, -2836000, -2832000, -2828000, -2824000, -2820000, 
    -2816000, -2812000, -2808000, -2804000, -2800000, -2796000, -2792000, 
    -2788000, -2784000, -2780000, -2776000, -2772000, -2768000, -2764000, 
    -2760000, -2756000, -2752000, -2748000, -2744000, -2740000, -2736000, 
    -2732000, -2728000, -2724000, -2720000, -2716000, -2712000, -2708000, 
    -2704000, -2700000, -2696000, -2692000, -2688000, -2684000, -2680000, 
    -2676000, -2672000, -2668000, -2664000, -2660000, -2656000, -2652000, 
    -2648000, -2644000, -2640000, -2636000, -2632000, -2628000, -2624000, 
    -2620000, -2616000, -2612000, -2608000, -2604000, -2600000, -2596000, 
    -2592000, -2588000, -2584000, -2580000, -2576000, -2572000, -2568000, 
    -2564000, -2560000, -2556000, -2552000, -2548000, -2544000, -2540000, 
    -2536000, -2532000, -2528000, -2524000, -2520000, -2516000, -2512000, 
    -2508000, -2504000, -2500000, -2496000, -2492000, -2488000, -2484000, 
    -2480000, -2476000, -2472000, -2468000, -2464000, -2460000, -2456000, 
    -2452000, -2448000, -2444000, -2440000, -2436000, -2432000, -2428000, 
    -2424000, -2420000, -2416000, -2412000, -2408000, -2404000, -2400000, 
    -2396000, -2392000, -2388000, -2384000, -2380000, -2376000, -2372000, 
    -2368000, -2364000, -2360000, -2356000, -2352000, -2348000, -2344000, 
    -2340000, -2336000, -2332000, -2328000, -2324000, -2320000, -2316000, 
    -2312000, -2308000, -2304000, -2300000, -2296000, -2292000, -2288000, 
    -2284000, -2280000, -2276000, -2272000, -2268000, -2264000, -2260000, 
    -2256000, -2252000, -2248000, -2244000, -2240000, -2236000, -2232000, 
    -2228000, -2224000, -2220000, -2216000, -2212000, -2208000, -2204000, 
    -2200000, -2196000, -2192000, -2188000, -2184000, -2180000, -2176000, 
    -2172000, -2168000, -2164000, -2160000, -2156000, -2152000, -2148000, 
    -2144000, -2140000, -2136000, -2132000, -2128000, -2124000, -2120000, 
    -2116000, -2112000, -2108000, -2104000, -2100000, -2096000, -2092000, 
    -2088000, -2084000, -2080000, -2076000, -2072000, -2068000, -2064000, 
    -2060000, -2056000, -2052000, -2048000, -2044000, -2040000, -2036000, 
    -2032000, -2028000, -2024000, -2020000, -2016000, -2012000, -2008000, 
    -2004000, -2000000, -1996000, -1992000, -1988000, -1984000, -1980000, 
    -1976000, -1972000, -1968000, -1964000, -1960000, -1956000, -1952000, 
    -1948000, -1944000, -1940000, -1936000, -1932000, -1928000, -1924000, 
    -1920000, -1916000, -1912000, -1908000, -1904000, -1900000, -1896000, 
    -1892000, -1888000, -1884000, -1880000, -1876000, -1872000, -1868000, 
    -1864000, -1860000, -1856000, -1852000, -1848000, -1844000, -1840000, 
    -1836000, -1832000, -1828000, -1824000, -1820000, -1816000, -1812000, 
    -1808000, -1804000, -1800000, -1796000, -1792000, -1788000, -1784000, 
    -1780000, -1776000, -1772000, -1768000, -1764000, -1760000, -1756000, 
    -1752000, -1748000, -1744000, -1740000, -1736000, -1732000, -1728000, 
    -1724000, -1720000, -1716000, -1712000, -1708000, -1704000, -1700000, 
    -1696000, -1692000, -1688000, -1684000, -1680000, -1676000, -1672000, 
    -1668000, -1664000, -1660000, -1656000, -1652000, -1648000, -1644000, 
    -1640000, -1636000, -1632000, -1628000, -1624000, -1620000, -1616000, 
    -1612000, -1608000, -1604000, -1600000, -1596000, -1592000, -1588000, 
    -1584000, -1580000, -1576000, -1572000, -1568000, -1564000, -1560000, 
    -1556000, -1552000, -1548000, -1544000, -1540000, -1536000, -1532000, 
    -1528000, -1524000, -1520000, -1516000, -1512000, -1508000, -1504000, 
    -1500000, -1496000, -1492000, -1488000, -1484000, -1480000, -1476000, 
    -1472000, -1468000, -1464000, -1460000, -1456000, -1452000, -1448000, 
    -1444000, -1440000, -1436000, -1432000, -1428000, -1424000, -1420000, 
    -1416000, -1412000, -1408000, -1404000, -1400000, -1396000, -1392000, 
    -1388000, -1384000, -1380000, -1376000, -1372000, -1368000, -1364000, 
    -1360000, -1356000, -1352000, -1348000, -1344000, -1340000, -1336000, 
    -1332000, -1328000, -1324000, -1320000, -1316000, -1312000, -1308000, 
    -1304000, -1300000, -1296000, -1292000, -1288000, -1284000, -1280000, 
    -1276000, -1272000, -1268000, -1264000, -1260000, -1256000, -1252000, 
    -1248000, -1244000, -1240000, -1236000, -1232000, -1228000, -1224000, 
    -1220000, -1216000, -1212000, -1208000, -1204000, -1200000, -1196000, 
    -1192000, -1188000, -1184000, -1180000, -1176000, -1172000, -1168000, 
    -1164000, -1160000, -1156000, -1152000, -1148000, -1144000, -1140000, 
    -1136000, -1132000, -1128000, -1124000, -1120000, -1116000, -1112000, 
    -1108000, -1104000, -1100000, -1096000, -1092000, -1088000, -1084000, 
    -1080000, -1076000, -1072000, -1068000, -1064000, -1060000, -1056000, 
    -1052000, -1048000, -1044000, -1040000, -1036000, -1032000, -1028000, 
    -1024000, -1020000, -1016000, -1012000, -1008000, -1004000, -1000000, 
    -996000, -992000, -988000, -984000, -980000, -976000, -972000, -968000, 
    -964000, -960000, -956000, -952000, -948000, -944000, -940000, -936000, 
    -932000, -928000, -924000, -920000, -916000, -912000, -908000, -904000, 
    -900000, -896000, -892000, -888000, -884000, -880000, -876000, -872000, 
    -868000, -864000, -860000, -856000, -852000, -848000, -844000, -840000, 
    -836000, -832000, -828000, -824000, -820000, -816000, -812000, -808000, 
    -804000, -800000, -796000, -792000, -788000, -784000, -780000, -776000, 
    -772000, -768000, -764000, -760000, -756000, -752000, -748000, -744000, 
    -740000, -736000, -732000, -728000, -724000, -720000, -716000, -712000, 
    -708000, -704000, -700000, -696000, -692000, -688000, -684000, -680000, 
    -676000, -672000, -668000, -664000, -660000, -656000, -652000, -648000, 
    -644000, -640000, -636000, -632000, -628000, -624000, -620000, -616000, 
    -612000, -608000, -604000, -600000, -596000, -592000, -588000, -584000, 
    -580000, -576000, -572000, -568000, -564000, -560000, -556000, -552000, 
    -548000, -544000, -540000, -536000, -532000, -528000, -524000, -520000, 
    -516000, -512000, -508000, -504000, -500000, -496000, -492000, -488000, 
    -484000, -480000, -476000, -472000, -468000, -464000, -460000, -456000, 
    -452000, -448000, -444000, -440000, -436000, -432000, -428000, -424000, 
    -420000, -416000, -412000, -408000, -404000, -400000, -396000, -392000, 
    -388000, -384000, -380000, -376000, -372000, -368000, -364000, -360000, 
    -356000, -352000, -348000, -344000, -340000, -336000, -332000, -328000, 
    -324000, -320000, -316000, -312000, -308000, -304000, -300000, -296000, 
    -292000, -288000, -284000, -280000, -276000, -272000, -268000, -264000, 
    -260000, -256000, -252000, -248000, -244000, -240000, -236000, -232000, 
    -228000, -224000, -220000, -216000, -212000, -208000, -204000, -200000, 
    -196000, -192000, -188000, -184000, -180000, -176000, -172000, -168000, 
    -164000, -160000, -156000, -152000, -148000, -144000, -140000, -136000, 
    -132000, -128000, -124000, -120000, -116000, -112000, -108000, -104000, 
    -100000, -96000, -92000, -88000, -84000, -80000, -76000, -72000, -68000, 
    -64000, -60000, -56000, -52000, -48000, -44000, -40000, -36000, -32000, 
    -28000, -24000, -20000, -16000, -12000, -8000, -4000, 0, 4000, 8000, 
    12000, 16000, 20000, 24000, 28000, 32000, 36000, 40000, 44000, 48000, 
    52000, 56000, 60000, 64000, 68000, 72000, 76000, 80000, 84000, 88000, 
    92000, 96000, 100000, 104000, 108000, 112000, 116000, 120000, 124000, 
    128000, 132000, 136000, 140000, 144000, 148000, 152000, 156000, 160000, 
    164000, 168000, 172000, 176000, 180000, 184000, 188000, 192000, 196000, 
    200000, 204000, 208000, 212000, 216000, 220000, 224000, 228000, 232000, 
    236000, 240000, 244000, 248000, 252000, 256000, 260000, 264000, 268000, 
    272000, 276000, 280000, 284000, 288000, 292000, 296000, 300000, 304000, 
    308000, 312000, 316000, 320000, 324000, 328000, 332000, 336000, 340000, 
    344000, 348000, 352000, 356000, 360000, 364000, 368000, 372000, 376000, 
    380000, 384000, 388000, 392000, 396000, 400000, 404000, 408000, 412000, 
    416000, 420000, 424000, 428000, 432000, 436000, 440000, 444000, 448000, 
    452000, 456000, 460000, 464000, 468000, 472000, 476000, 480000, 484000, 
    488000, 492000, 496000, 500000, 504000, 508000, 512000, 516000, 520000, 
    524000, 528000, 532000, 536000, 540000, 544000, 548000, 552000, 556000, 
    560000, 564000, 568000, 572000, 576000, 580000, 584000, 588000, 592000, 
    596000, 600000, 604000, 608000, 612000, 616000, 620000, 624000, 628000, 
    632000, 636000, 640000, 644000, 648000, 652000, 656000, 660000, 664000, 
    668000, 672000, 676000, 680000, 684000, 688000, 692000, 696000, 700000, 
    704000, 708000, 712000, 716000, 720000, 724000, 728000, 732000, 736000, 
    740000, 744000, 748000, 752000, 756000, 760000, 764000, 768000, 772000, 
    776000, 780000, 784000, 788000, 792000, 796000, 800000, 804000, 808000, 
    812000, 816000, 820000, 824000, 828000, 832000, 836000, 840000, 844000, 
    848000, 852000, 856000, 860000, 864000, 868000, 872000, 876000, 880000, 
    884000, 888000, 892000, 896000, 900000, 904000, 908000, 912000, 916000, 
    920000, 924000, 928000, 932000, 936000, 940000, 944000, 948000, 952000, 
    956000, 960000, 964000, 968000, 972000, 976000, 980000, 984000, 988000, 
    992000, 996000, 1000000, 1004000, 1008000, 1012000, 1016000, 1020000, 
    1024000, 1028000, 1032000, 1036000, 1040000, 1044000, 1048000, 1052000, 
    1056000, 1060000, 1064000, 1068000, 1072000, 1076000, 1080000, 1084000, 
    1088000, 1092000, 1096000, 1100000, 1104000, 1108000, 1112000, 1116000, 
    1120000, 1124000, 1128000, 1132000, 1136000, 1140000, 1144000, 1148000, 
    1152000, 1156000, 1160000, 1164000, 1168000, 1172000, 1176000, 1180000, 
    1184000, 1188000, 1192000, 1196000, 1200000, 1204000, 1208000, 1212000, 
    1216000, 1220000, 1224000, 1228000, 1232000, 1236000, 1240000, 1244000, 
    1248000, 1252000, 1256000, 1260000, 1264000, 1268000, 1272000, 1276000, 
    1280000, 1284000, 1288000, 1292000, 1296000, 1300000, 1304000, 1308000, 
    1312000, 1316000, 1320000, 1324000, 1328000, 1332000, 1336000, 1340000, 
    1344000, 1348000, 1352000, 1356000, 1360000, 1364000, 1368000, 1372000, 
    1376000, 1380000, 1384000, 1388000, 1392000, 1396000, 1400000, 1404000, 
    1408000, 1412000, 1416000, 1420000, 1424000, 1428000, 1432000, 1436000, 
    1440000, 1444000, 1448000, 1452000, 1456000, 1460000, 1464000, 1468000, 
    1472000, 1476000, 1480000, 1484000, 1488000, 1492000, 1496000, 1500000, 
    1504000, 1508000, 1512000, 1516000, 1520000, 1524000, 1528000, 1532000, 
    1536000, 1540000, 1544000, 1548000, 1552000, 1556000, 1560000, 1564000, 
    1568000, 1572000, 1576000, 1580000, 1584000, 1588000, 1592000, 1596000, 
    1600000, 1604000, 1608000, 1612000, 1616000, 1620000, 1624000, 1628000, 
    1632000, 1636000, 1640000, 1644000, 1648000, 1652000, 1656000, 1660000, 
    1664000, 1668000, 1672000, 1676000, 1680000, 1684000, 1688000, 1692000, 
    1696000, 1700000, 1704000, 1708000, 1712000, 1716000, 1720000, 1724000, 
    1728000, 1732000, 1736000, 1740000, 1744000, 1748000, 1752000, 1756000, 
    1760000, 1764000, 1768000, 1772000, 1776000, 1780000, 1784000, 1788000, 
    1792000, 1796000, 1800000, 1804000, 1808000, 1812000, 1816000, 1820000, 
    1824000, 1828000, 1832000, 1836000, 1840000, 1844000, 1848000, 1852000, 
    1856000, 1860000, 1864000, 1868000, 1872000, 1876000, 1880000, 1884000, 
    1888000, 1892000, 1896000, 1900000, 1904000, 1908000, 1912000, 1916000, 
    1920000, 1924000, 1928000, 1932000, 1936000, 1940000, 1944000, 1948000, 
    1952000, 1956000, 1960000, 1964000, 1968000, 1972000, 1976000, 1980000, 
    1984000, 1988000, 1992000, 1996000, 2000000, 2004000, 2008000, 2012000, 
    2016000, 2020000, 2024000, 2028000, 2032000, 2036000, 2040000, 2044000, 
    2048000, 2052000, 2056000, 2060000, 2064000, 2068000, 2072000, 2076000, 
    2080000, 2084000, 2088000, 2092000, 2096000, 2100000, 2104000, 2108000, 
    2112000, 2116000, 2120000, 2124000, 2128000, 2132000, 2136000, 2140000, 
    2144000, 2148000, 2152000, 2156000, 2160000, 2164000, 2168000, 2172000, 
    2176000, 2180000, 2184000, 2188000, 2192000, 2196000, 2200000, 2204000, 
    2208000, 2212000, 2216000, 2220000, 2224000, 2228000, 2232000, 2236000, 
    2240000, 2244000, 2248000, 2252000, 2256000, 2260000, 2264000, 2268000, 
    2272000, 2276000, 2280000, 2284000, 2288000, 2292000, 2296000, 2300000, 
    2304000, 2308000, 2312000, 2316000, 2320000, 2324000, 2328000, 2332000, 
    2336000, 2340000, 2344000, 2348000, 2352000, 2356000, 2360000, 2364000, 
    2368000, 2372000, 2376000, 2380000, 2384000, 2388000, 2392000, 2396000, 
    2400000, 2404000, 2408000, 2412000, 2416000, 2420000, 2424000, 2428000, 
    2432000, 2436000, 2440000, 2444000, 2448000, 2452000, 2456000, 2460000, 
    2464000, 2468000, 2472000, 2476000, 2480000, 2484000, 2488000, 2492000, 
    2496000, 2500000, 2504000, 2508000, 2512000, 2516000, 2520000, 2524000, 
    2528000, 2532000, 2536000, 2540000, 2544000, 2548000, 2552000, 2556000, 
    2560000, 2564000, 2568000, 2572000, 2576000, 2580000, 2584000, 2588000, 
    2592000, 2596000, 2600000, 2604000, 2608000, 2612000, 2616000, 2620000, 
    2624000, 2628000, 2632000, 2636000, 2640000, 2644000, 2648000, 2652000, 
    2656000, 2660000, 2664000, 2668000, 2672000, 2676000, 2680000, 2684000, 
    2688000, 2692000, 2696000, 2700000, 2704000, 2708000, 2712000, 2716000, 
    2720000, 2724000, 2728000, 2732000, 2736000, 2740000, 2744000, 2748000, 
    2752000, 2756000, 2760000, 2764000, 2768000, 2772000, 2776000, 2780000, 
    2784000, 2788000, 2792000, 2796000, 2800000, 2804000, 2808000, 2812000, 
    2816000, 2820000, 2824000, 2828000, 2832000, 2836000, 2840000, 2844000, 
    2848000, 2852000, 2856000, 2860000, 2864000, 2868000, 2872000, 2876000, 
    2880000, 2884000, 2888000, 2892000, 2896000, 2900000, 2904000, 2908000, 
    2912000, 2916000, 2920000, 2924000, 2928000, 2932000, 2936000, 2940000, 
    2944000, 2948000, 2952000, 2956000, 2960000, 2964000, 2968000, 2972000, 
    2976000, 2980000, 2984000, 2988000, 2992000, 2996000, 3000000, 3004000, 
    3008000, 3012000, 3016000, 3020000, 3024000, 3028000, 3032000, 3036000, 
    3040000 ;
}

Ice thickness at the initial time level on the ismip6-4km grid ('lithk_AIS_DOE_MALI_hist.nc'):

image
xylar commented 1 year ago

But I also have a more general concern. Do we know the 4km atm files are exactly the grid ISMIP6 defined for writing output to? I ask, because the wiki has a section defining the grid, and we should be able to define that without needing to specify an external grid

@matthewhoffman, regardless of whether the atmosphere data are on the same projection or not, adding x and y coordinates is the right thing to do in my opinion.

But you are correct that we could presumably use the latitude and longitude fields to remap from, with no need to assume anything about the projection.

xylar commented 1 year ago

I also think it would be a pretty major mistake if the atmosphere data weren't on the ISMIP6 grid, but I can't rule that out.

xylar commented 1 year ago

@matthewhoffman, if you take a look at create_atm_scrip(source_grid_file, source_grid_scripfile), it is using the lat and lon variables rather than the x and y coordinates to compute the SCRIP file. So I think there's no harm at all in adding the x and y coordinates to the files. @hollyhan, could you remind us why the missing x and y coordinates (as opposed to dimensions) were giving you trouble?

matthewhoffman commented 1 year ago

Thanks for the input, @xylar . My understanding is the x,y coords are just needed to make the regridded files complete, and possibly for plotting. The solution here takes care of the problem so I'm happy to proceed with this if you are.

hollyhan commented 1 year ago

Hi @matthewhoffman, @xylar and @trhille,

I've updated the PR to create x and y coordinate values when they are not included in the ismip6 grid file, and to make a copy of the ismip6 files with the newly created 'x' and 'y' values. In doing so, I reverted changes I made previously to use the function scrip_from_atm back to using create_SCRIP_file_from_planar_rectangular_grid.py, which uses the specific projection string that ISMIP6 requires.

I've tested the code on 4-km and 8-km res ismip6 grid files that don't have x and y included. For example,

(e3sm_unified_1.8.1_nompi) hollyhan@perlmutter:login24:/pscratch/sd/h/hollyhan/MPAS-Tools/landice/output_processing_li/ismip6_postprocessing> ./post_process_mali_to_ismip6.py  --res 8 -i_state /pscratch/sd/h/hollyhan/ISM_SimulationChecker/outputs_4km_trhille/folder_files/output_state_all_${name_exp}_04.nc -i_flux /pscratch/sd/h/hollyhan/ISM_SimulationChecker/outputs_4km_trhille/folder_files/output_flux_all_${name_exp}_04.nc -g /pscratch/sd/h/hollyhan/ISM_SimulationChecker/outputs_4km_trhille/folder_files/globalStats_${name_exp}_04.nc -i_mesh /pscratch/sd/h/hollyhan/ISM_SimulationChecker/outputs_4km_trhille/rst.2015-01-01.nc  --ismip6_grid_file NorESM1-M_8km_anomaly_1995-2300_v2.nc -p /pscratch/sd/h/hollyhan/test_ismip6postprocess_8km -e ${name_exp} --mali_mesh_name AIS_4to20km --mapping_file map_AIS_4to20km_to_ismip6_4km_conserve_test.nc

---Checking the coordinate variables of the ismip6 grid file---
'x' and 'y' coordinates don't exist in the file.
Creating a copy file with them ...
Checking grid corners...

....
(e3sm_unified_1.8.1_nompi) hollyhan@perlmutter:login03:/pscratch/sd/h/hollyhan/MPAS-Tools/landice/output_processing_li/ismip6_postprocessing> ncdump -v x temp_NorESM1-M_8km_anomaly_1995-2300_v2.nc 

x = -3040000, -3032000, -3024000, -3016000, -3008000, -3000000, -2992000, 
    -2984000, -2976000, -2968000, -2960000, -2952000, -2944000, -2936000, 
    -2928000, -2920000, -2912000, -2904000, -2896000, -2888000, -2880000, 
    -2872000, -2864000, -2856000, -2848000, -2840000, -2832000, -2824000, 
    -2816000, -2808000, -2800000, -2792000, -2784000, -2776000, -2768000, 
    -2760000, -2752000, -2744000, -2736000, -2728000, -2720000, -2712000, 
    -2704000, -2696000, -2688000, -2680000, -2672000, -2664000, -2656000, 
    -2648000, -2640000, -2632000, -2624000, -2616000, -2608000, -2600000, 
    -2592000, -2584000, -2576000, -2568000, -2560000, -2552000, -2544000, 
    -2536000, -2528000, -2520000, -2512000, -2504000, -2496000, -2488000, 
    -2480000, -2472000, -2464000, -2456000, -2448000, -2440000, -2432000, 
    -2424000, -2416000, -2408000, -2400000, -2392000, -2384000, -2376000, 
    -2368000, -2360000, -2352000, -2344000, -2336000, -2328000, -2320000, 
    -2312000, -2304000, -2296000, -2288000, -2280000, -2272000, -2264000, 
    -2256000, -2248000, -2240000, -2232000, -2224000, -2216000, -2208000, 
    -2200000, -2192000, -2184000, -2176000, -2168000, -2160000, -2152000, 
    -2144000, -2136000, -2128000, -2120000, -2112000, -2104000, -2096000, 
    -2088000, -2080000, -2072000, -2064000, -2056000, -2048000, -2040000, 
    -2032000, -2024000, -2016000, -2008000, -2000000, -1992000, -1984000, 
    -1976000, -1968000, -1960000, -1952000, -1944000, -1936000, -1928000, 
    -1920000, -1912000, -1904000, -1896000, -1888000, -1880000, -1872000, 
    -1864000, -1856000, -1848000, -1840000, -1832000, -1824000, -1816000, 
    -1808000, -1800000, -1792000, -1784000, -1776000, -1768000, -1760000, 
    -1752000, -1744000, -1736000, -1728000, -1720000, -1712000, -1704000, 
    -1696000, -1688000, -1680000, -1672000, -1664000, -1656000, -1648000, 
    -1640000, -1632000, -1624000, -1616000, -1608000, -1600000, -1592000, 
    -1584000, -1576000, -1568000, -1560000, -1552000, -1544000, -1536000, 
    -1528000, -1520000, -1512000, -1504000, -1496000, -1488000, -1480000, 
    -1472000, -1464000, -1456000, -1448000, -1440000, -1432000, -1424000, 
    -1416000, -1408000, -1400000, -1392000, -1384000, -1376000, -1368000, 
    -1360000, -1352000, -1344000, -1336000, -1328000, -1320000, -1312000, 
    -1304000, -1296000, -1288000, -1280000, -1272000, -1264000, -1256000, 
    -1248000, -1240000, -1232000, -1224000, -1216000, -1208000, -1200000, 
    -1192000, -1184000, -1176000, -1168000, -1160000, -1152000, -1144000, 
    -1136000, -1128000, -1120000, -1112000, -1104000, -1096000, -1088000, 
    -1080000, -1072000, -1064000, -1056000, -1048000, -1040000, -1032000, 
    -1024000, -1016000, -1008000, -1000000, -992000, -984000, -976000, 
    -968000, -960000, -952000, -944000, -936000, -928000, -920000, -912000, 
    -904000, -896000, -888000, -880000, -872000, -864000, -856000, -848000, 
    -840000, -832000, -824000, -816000, -808000, -800000, -792000, -784000, 
    -776000, -768000, -760000, -752000, -744000, -736000, -728000, -720000, 
    -712000, -704000, -696000, -688000, -680000, -672000, -664000, -656000, 
    -648000, -640000, -632000, -624000, -616000, -608000, -600000, -592000, 
    -584000, -576000, -568000, -560000, -552000, -544000, -536000, -528000, 
    -520000, -512000, -504000, -496000, -488000, -480000, -472000, -464000, 
    -456000, -448000, -440000, -432000, -424000, -416000, -408000, -400000, 
    -392000, -384000, -376000, -368000, -360000, -352000, -344000, -336000, 
    -328000, -320000, -312000, -304000, -296000, -288000, -280000, -272000, 
    -264000, -256000, -248000, -240000, -232000, -224000, -216000, -208000, 
    -200000, -192000, -184000, -176000, -168000, -160000, -152000, -144000, 
    -136000, -128000, -120000, -112000, -104000, -96000, -88000, -80000, 
    -72000, -64000, -56000, -48000, -40000, -32000, -24000, -16000, -8000, 0, 
    8000, 16000, 24000, 32000, 40000, 48000, 56000, 64000, 72000, 80000, 
    88000, 96000, 104000, 112000, 120000, 128000, 136000, 144000, 152000, 
    160000, 168000, 176000, 184000, 192000, 200000, 208000, 216000, 224000, 
    232000, 240000, 248000, 256000, 264000, 272000, 280000, 288000, 296000, 
    304000, 312000, 320000, 328000, 336000, 344000, 352000, 360000, 368000, 
    376000, 384000, 392000, 400000, 408000, 416000, 424000, 432000, 440000, 
    448000, 456000, 464000, 472000, 480000, 488000, 496000, 504000, 512000, 
    520000, 528000, 536000, 544000, 552000, 560000, 568000, 576000, 584000, 
    592000, 600000, 608000, 616000, 624000, 632000, 640000, 648000, 656000, 
    664000, 672000, 680000, 688000, 696000, 704000, 712000, 720000, 728000, 
    736000, 744000, 752000, 760000, 768000, 776000, 784000, 792000, 800000, 
    808000, 816000, 824000, 832000, 840000, 848000, 856000, 864000, 872000, 
    880000, 888000, 896000, 904000, 912000, 920000, 928000, 936000, 944000, 
    952000, 960000, 968000, 976000, 984000, 992000, 1000000, 1008000, 
    1016000, 1024000, 1032000, 1040000, 1048000, 1056000, 1064000, 1072000, 
    1080000, 1088000, 1096000, 1104000, 1112000, 1120000, 1128000, 1136000, 
    1144000, 1152000, 1160000, 1168000, 1176000, 1184000, 1192000, 1200000, 
    1208000, 1216000, 1224000, 1232000, 1240000, 1248000, 1256000, 1264000, 
    1272000, 1280000, 1288000, 1296000, 1304000, 1312000, 1320000, 1328000, 
    1336000, 1344000, 1352000, 1360000, 1368000, 1376000, 1384000, 1392000, 
    1400000, 1408000, 1416000, 1424000, 1432000, 1440000, 1448000, 1456000, 
    1464000, 1472000, 1480000, 1488000, 1496000, 1504000, 1512000, 1520000, 
    1528000, 1536000, 1544000, 1552000, 1560000, 1568000, 1576000, 1584000, 
    1592000, 1600000, 1608000, 1616000, 1624000, 1632000, 1640000, 1648000, 
    1656000, 1664000, 1672000, 1680000, 1688000, 1696000, 1704000, 1712000, 
    1720000, 1728000, 1736000, 1744000, 1752000, 1760000, 1768000, 1776000, 
    1784000, 1792000, 1800000, 1808000, 1816000, 1824000, 1832000, 1840000, 
    1848000, 1856000, 1864000, 1872000, 1880000, 1888000, 1896000, 1904000, 
    1912000, 1920000, 1928000, 1936000, 1944000, 1952000, 1960000, 1968000, 
    1976000, 1984000, 1992000, 2000000, 2008000, 2016000, 2024000, 2032000, 
    2040000, 2048000, 2056000, 2064000, 2072000, 2080000, 2088000, 2096000, 
    2104000, 2112000, 2120000, 2128000, 2136000, 2144000, 2152000, 2160000, 
    2168000, 2176000, 2184000, 2192000, 2200000, 2208000, 2216000, 2224000, 
    2232000, 2240000, 2248000, 2256000, 2264000, 2272000, 2280000, 2288000, 
    2296000, 2304000, 2312000, 2320000, 2328000, 2336000, 2344000, 2352000, 
    2360000, 2368000, 2376000, 2384000, 2392000, 2400000, 2408000, 2416000, 
    2424000, 2432000, 2440000, 2448000, 2456000, 2464000, 2472000, 2480000, 
    2488000, 2496000, 2504000, 2512000, 2520000, 2528000, 2536000, 2544000, 
    2552000, 2560000, 2568000, 2576000, 2584000, 2592000, 2600000, 2608000, 
    2616000, 2624000, 2632000, 2640000, 2648000, 2656000, 2664000, 2672000, 
    2680000, 2688000, 2696000, 2704000, 2712000, 2720000, 2728000, 2736000, 
    2744000, 2752000, 2760000, 2768000, 2776000, 2784000, 2792000, 2800000, 
    2808000, 2816000, 2824000, 2832000, 2840000, 2848000, 2856000, 2864000, 
    2872000, 2880000, 2888000, 2896000, 2904000, 2912000, 2920000, 2928000, 
    2936000, 2944000, 2952000, 2960000, 2968000, 2976000, 2984000, 2992000, 
    3000000, 3008000, 3016000, 3024000, 3032000, 3040000 ;

If the grid corners do not match, a user gets an error message such as the following:

(e3sm_unified_1.8.1_nompi) hollyhan@perlmutter:login24:/pscratch/sd/h/hollyhan/MPAS-Tools/landice/output_processing_li/ismip6_postprocessing> ./post_process_mali_to_ismip6.py  --res 4 -i_state /pscratch/sd/h/hollyhan/ISM_SimulationChecker/outputs_4km_trhille/folder_files/output_state_all_${name_exp}_04.nc -i_flux /pscratch/sd/h/hollyhan/ISM_SimulationChecker/outputs_4km_trhille/folder_files/output_flux_all_${name_exp}_04.nc -g /pscratch/sd/h/hollyhan/ISM_SimulationChecker/outputs_4km_trhille/folder_files/globalStats_${name_exp}_04.nc -i_mesh /pscratch/sd/h/hollyhan/ISM_SimulationChecker/outputs_4km_trhille/rst.2015-01-01.nc  --ismip6_grid_file NorESM1-M_8km_anomaly_1995-2300_v2.nc -p /pscratch/sd/h/hollyhan/test_ismip6postprocess_8km -e ${name_exp} --mali_mesh_name AIS_4to20km --mapping_file map_AIS_4to20km_to_ismip6_4km_conserve_test.nc

---Checking the coordinate variables of the ismip6 grid file---
'x' and 'y' coordinates don't exist in the file.
Creating a copy file with them ...
Checking grid corners...
Traceback (most recent call last):
  File "/pscratch/sd/h/hollyhan/MPAS-Tools/landice/output_processing_li/ismip6_postprocessing/./post_process_mali_to_ismip6.py", line 226, in <module>
    main()
  File "/pscratch/sd/h/hollyhan/MPAS-Tools/landice/output_processing_li/ismip6_postprocessing/./post_process_mali_to_ismip6.py", line 93, in main
    raise ValueError(f"The lower left corner values must be at "
ValueError: The lower left corner values must be at -3040000m and -3040000m. But the values are at -1520000m and -1520000m.

Thank you for reviewing it again!

hollyhan commented 1 year ago

Thanks for the detailed review, @matthewhoffman! I've addressed the both of the minor comments that raised. Hope the codes look how you envisioned with the new changes. I've tested the code with the new changes on Perlmutter, and it passed as shown below:

(e3sm_unified_1.8.1_pm-cpu) hollyhan@nid004178:/pscratch/sd/h/hollyhan/MPAS-Tools/landice/output_processing_li/ismip6_postprocessing> ./post_process_mali_to_ismip6.py  --res 4 -i_state /pscratch/sd/h/hollyhan/ISM_SimulationChecker/outputs_4km_trhille/folder_files/output_state_all_${name_exp}_04.nc -i_flux /pscratch/sd/h/hollyhan/ISM_SimulationChecker/outputs_4km_trhille/folder_files/output_flux_all_${name_exp}_04.nc -g /pscratch/sd/h/hollyhan/ISM_SimulationChecker/outputs_4km_trhille/folder_files/globalStats_${name_exp}_04.nc -i_mesh /pscratch/sd/h/hollyhan/ISM_SimulationChecker/outputs_4km_trhille/rst.2015-01-01.nc  --ismip6_grid_file /pscratch/sd/h/hollyhan/ISM_SimulationChecker/outputs_4km_trhille/NorESM1-M_4km_clim_1995-2014.nc -p /pscratch/sd/h/hollyhan/test_ismip6postprocess -e ${name_exp} --mali_mesh_name AIS_4to20km --mapping_file map_AIS_4to20km_to_ismip6_4km_conserve_with_xy_coord.nc

---Checking the coordinate variables of the ismip6 grid file---
'x' and 'y' coordinates don't exist in the file.
Creating them and a copy file of the ismip6 grid file...
Checking the grid corners...
Grid corners are as ismip6-required: lower right corner values at -3040000.0m and -3040000.0m, and upper right corner values at 3040000.0m and 3040000.0m

---Processing remapping file---
Creating new mapping file.Mapping method used: conserve
Mapping file does not exist. Building one based on the input/ouptut meshes
Creating temporary scripfiles for ismip6 grid and mali mesh...
== Gathering information.  (Invoke with --help for more details. All arguments are optional)

grid rank is 2
Building matrix version of x, y locations.
Unprojecting.
Filling in corners of each cell.
 -- Landice Masks are disabled

 -- WARNING: sphereRadius<0 so setting sphereRadius = 6371220.0
 -- WARNING: 'on_a_sphere' attribute is 'NO', which means that there may be some disagreement regarding area between the planar (source) and spherical (target) mesh
Input latCell min/max values (radians): -1.5695404658410532, -1.0964145999234098
Input lonCell min/max values (radians): 7.2047435728003e-06, 6.283164667290495
Calculated grid_center_lat min/max values (radians): -1.5695404658410532, -1.0964145999234098
Calculated grid_center_lon min/max values (radians): 7.2047435728003e-06, 6.283164667290495
Calculated grid_area min/max values (sq radians): 2.6159873831700514e-07, 1.0476949449951053e-05
Creation of SCRIP file is complete.
Creating a mapping file... Mapping method used: conserve
PE 0: MPICH processor detected:
PE 0:   AMD Milan (25:1:1) (family:model:stepping)
MPI VERSION    : CRAY MPICH version 8.1.22.12 (ANL base 3.4a2)
MPI BUILD INFO : Wed Nov 09 12:31 2022 (git hash cfc6f82) (CH4)
PE 0: MPICH environment settings =====================================
PE 0:   MPICH_ENV_DISPLAY                              = 1
PE 0:   MPICH_VERSION_DISPLAY                          = 1
PE 0:   MPICH_ABORT_ON_ERROR                           = 0
PE 0:   MPICH_CPUMASK_DISPLAY                          = 0
PE 0:   MPICH_STATS_DISPLAY                            = 0
PE 0:   MPICH_RANK_REORDER_METHOD                      = 1
PE 0:   MPICH_RANK_REORDER_DISPLAY                     = 0
PE 0:   MPICH_MEMCPY_MEM_CHECK                         = 0
PE 0:   MPICH_USE_SYSTEM_MEMCPY                        = 0
PE 0:   MPICH_OPTIMIZED_MEMCPY                         = 1
PE 0:   MPICH_ALLOC_MEM_PG_SZ                          = 4096
PE 0:   MPICH_ALLOC_MEM_POLICY                         = PREFERRED
PE 0:   MPICH_ALLOC_MEM_AFFINITY                       = SYS_DEFAULT
PE 0:   MPICH_MALLOC_FALLBACK                          = 0
PE 0:   MPICH_MEM_DEBUG_FNAME                          = 
PE 0:   MPICH_INTERNAL_MEM_AFFINITY                    = SYS_DEFAULT
PE 0:   MPICH_NO_BUFFER_ALIAS_CHECK                    = 0
PE 0:   MPICH_COLL_SYNC                                = 0
PE 0:   MPICH_SINGLE_HOST_ENABLED                        = 1
PE 0: MPICH/RMA environment settings =================================
PE 0:   MPICH_RMA_MAX_PENDING                          = 128
PE 0:   MPICH_RMA_SHM_ACCUMULATE                       = 0
PE 0: MPICH/Dynamic Process Management environment settings ==========
PE 0:   MPICH_DPM_DIR                                  = 6521360
PE 0:   MPICH_LOCAL_SPAWN_SERVER                       = 0
PE 0: MPICH/SMP environment settings =================================
PE 0:   MPICH_SMP_SINGLE_COPY_MODE                     = XPMEM
PE 0:   MPICH_SMP_SINGLE_COPY_SIZE                     = 8192
PE 0:   MPICH_SHM_PROGRESS_MAX_BATCH_SIZE              = 8
PE 0: MPICH/COLLECTIVE environment settings ==========================
PE 0:   MPICH_COLL_OPT_OFF                             = 0
PE 0:   MPICH_BCAST_ONLY_TREE                          = 1
PE 0:   MPICH_BCAST_INTERNODE_RADIX                    = 4
PE 0:   MPICH_BCAST_INTRANODE_RADIX                    = 4
PE 0:   MPICH_ALLTOALL_SHORT_MSG                       = 64-512
PE 0:   MPICH_ALLTOALL_SYNC_FREQ                       = 1-24
PE 0:   MPICH_ALLTOALLV_THROTTLE                       = 8
PE 0:   MPICH_ALLGATHER_VSHORT_MSG                     = 1024-4096
PE 0:   MPICH_ALLGATHERV_VSHORT_MSG                    = 1024-4096
PE 0:   MPICH_GATHERV_SHORT_MSG                        = 131072
PE 0:   MPICH_GATHERV_MIN_COMM_SIZE                    = 64
PE 0:   MPICH_GATHERV_MAX_TMP_SIZE                     = 536870912
PE 0:   MPICH_GATHERV_SYNC_FREQ                        = 16
PE 0:   MPICH_IGATHERV_RAND_COMMSIZE                   = 2048
PE 0:   MPICH_IGATHERV_RAND_RECVLIST                   = 0
PE 0:   MPICH_SCATTERV_SHORT_MSG                       = 2048-8192
PE 0:   MPICH_SCATTERV_MIN_COMM_SIZE                   = 64
PE 0:   MPICH_SCATTERV_MAX_TMP_SIZE                    = 536870912
PE 0:   MPICH_SCATTERV_SYNC_FREQ                       = 16
PE 0:   MPICH_SCATTERV_SYNCHRONOUS                     = 0
PE 0:   MPICH_ALLREDUCE_MAX_SMP_SIZE                   = 262144
PE 0:   MPICH_ALLREDUCE_BLK_SIZE                       = 716800
PE 0:   MPICH_GPU_ALLREDUCE_USE_KERNEL                 = 0
PE 0:   MPICH_ALLREDUCE_NO_SMP                         = 0
PE 0:   MPICH_REDUCE_NO_SMP                            = 0
PE 0:   MPICH_REDUCE_SCATTER_COMMUTATIVE_LONG_MSG_SIZE = 524288
PE 0:   MPICH_REDUCE_SCATTER_MAX_COMMSIZE              = 1000
PE 0:   MPICH_SHARED_MEM_COLL_OPT                      = 1
PE 0:   MPICH_SHARED_MEM_COLL_NCELLS                   = 8
PE 0:   MPICH_SHARED_MEM_COLL_CELLSZ                   = 256
PE 0: MPICH MPIIO environment settings ===============================
PE 0:   MPICH_MPIIO_HINTS_DISPLAY                      = 0
PE 0:   MPICH_MPIIO_HINTS                              = NULL
PE 0:   MPICH_MPIIO_ABORT_ON_RW_ERROR                  = disable
PE 0:   MPICH_MPIIO_CB_ALIGN                           = 2
PE 0:   MPICH_MPIIO_DVS_MAXNODES                       = -1
PE 0:   MPICH_MPIIO_AGGREGATOR_PLACEMENT_DISPLAY       = 0
PE 0:   MPICH_MPIIO_AGGREGATOR_PLACEMENT_STRIDE        = -1
PE 0:   MPICH_MPIIO_MAX_NUM_IRECV                      = 50
PE 0:   MPICH_MPIIO_MAX_NUM_ISEND                      = 50
PE 0:   MPICH_MPIIO_MAX_SIZE_ISEND                     = 10485760
PE 0:   MPICH_MPIIO_OFI_STARTUP_CONNECT                = disable
PE 0:   MPICH_MPIIO_OFI_STARTUP_NODES_AGGREGATOR        = 2
PE 0: MPICH MPIIO statistics environment settings ====================
PE 0:   MPICH_MPIIO_STATS                              = 0
PE 0:   MPICH_MPIIO_TIMERS                             = 0
PE 0:   MPICH_MPIIO_WRITE_EXIT_BARRIER                 = 1
PE 0: MPICH Thread Safety settings ===================================
PE 0:   MPICH_ASYNC_PROGRESS                           = 0
PE 0:   MPICH_OPT_THREAD_SYNC                          = 1
PE 0:   rank 0 required = single, was provided = single
 Starting weight generation with these inputs: 
   Source File: temp_mali_scrip.nc
   Destination File: temp_ismip6_4km_scrip.nc
   Weight File: map_AIS_4to20km_to_ismip6_4km_conserve.nc
   Source File is in SCRIP format
   Source Grid is a regional grid
   Source Grid is an unstructured grid
   Use the center coordinates of the source grid to do the regrid
   Destination File is in SCRIP format
   Destination Grid is a regional grid
   Destination Grid is a logically rectangular grid
   Use the center coordinates of the destination grid to do the regrid
   Regrid Method: conserve
   Pole option: NONE
   Ignore unmapped destination points
   Line Type: greatcircle
   Norm Type: dstarea
   Extrap. Method: none

 Completed weight generation successfully.

Removing the temporary mesh and scripfiles...
---Processing remapping file complete---

Using output path: /pscratch/sd/h/hollyhan/test_ismip6postprocess

---Processing state file---
Calculating needed state file adjustments.
Remapping state file.
Input #00: /pscratch/sd/h/hollyhan/MPAS-Tools/landice/output_processing_li/ismip6_postprocessing/tmp_state.nc
PDQ(in)  : /pscratch/sd/h/hollyhan/MPAS-Tools/landice/output_processing_li/ismip6_postprocessing/tmp_state.nc
PDQ(out) : /tmp/ncremap_tmp_pdq.nc.pid148300.flidx0
att(in)  : /tmp/ncremap_tmp_pdq.nc.pid148300.flidx0
att(out) : /tmp/ncremap_tmp_att.nc.pid148300.flidx0
Map/Wgt  : map_AIS_4to20km_to_ismip6_4km_conserve.nc
Writing processed and remapped state fields to ISMIP6 file format.
---Processing state file complete---

---Processing global stats file---
---Processing global stats file complete---

---Processing flux file---
Adjusting flux fields that need modification before time averaging.
No bedTopography field found; using bedTopography from mesh file.
===starting cleaning floatingBasalMassBalApplied===
    Time: 21 / 51
    Time: 41 / 51
===done cleaning floatingBasalMassBalApplied===
===starting facemelt flux processing===
===done facemelt flux processing!===
===starting the calving flux processing===
    Time: 1 / 51
    Time: 21 / 51
    Time: 41 / 51
===done calving flux processing!===
Starting time averaging of flux variables
simulationStartTime=2000-01-01_00:00:00; simulationStartDate=2000-01-01; refYear=2000
start year=<xarray.DataArray 'daysSinceStart' ()>
array(2000.); final year=<xarray.DataArray 'daysSinceStart' ()>
array(2015.)
    begin looping over years
     year index: 0, year=2000.0; timeBindsMin=0.0, timeBndsMax=365.0
         year=2000.0, decYears=<xarray.DataArray 'daysSinceStart' ()>
array(2000.36453751), daysSinceStart=<xarray.DataArray 'daysSinceStart' ()>
array(133.056192)
Attributes:
    _FillValue:    nan
    long_name:     Time since simulationStartTime in days, for plotting
    cell_methods:  Time: mean, xtime=2000-05-14_01:20:55
         year=2000.0, decYears=<xarray.DataArray 'daysSinceStart' ()>
array(2000.72694004), daysSinceStart=<xarray.DataArray 'daysSinceStart' ()>
array(133.056192)
Attributes:
    _FillValue:    nan
    long_name:     Time since simulationStartTime in days, for plotting
    cell_methods:  Time: mean, xtime=2000-09-23_07:59:41
         year=2000.0, decYears=<xarray.DataArray 'daysSinceStart' ()>
array(2001.), daysSinceStart=<xarray.DataArray 'daysSinceStart' ()>
array(133.056192)
Attributes:
    _FillValue:    nan
    long_name:     Time since simulationStartTime in days, for plotting
    cell_methods:  Time: mean, xtime=2001-01-01_00:00:00
     year index: 1, year=2001.0; timeBindsMin=365.0, timeBndsMax=730.0
         year=2001.0, decYears=<xarray.DataArray 'daysSinceStart' ()>
array(2001.36409976), daysSinceStart=<xarray.DataArray 'daysSinceStart' ()>
array(265.333113)
Attributes:
    _FillValue:    nan
    long_name:     Time since simulationStartTime in days, for plotting
    cell_methods:  Time: mean, xtime=2001-05-13_21:30:50
         year=2001.0, decYears=<xarray.DataArray 'daysSinceStart' ()>
array(2001.52909383), daysSinceStart=<xarray.DataArray 'daysSinceStart' ()>
array(265.333113)
Attributes:
    _FillValue:    nan
    long_name:     Time since simulationStartTime in days, for plotting
    cell_methods:  Time: mean, xtime=2001-07-13_02:51:43
         year=2001.0, decYears=<xarray.DataArray 'daysSinceStart' ()>
array(2001.89392459), daysSinceStart=<xarray.DataArray 'daysSinceStart' ()>
array(265.333113)
Attributes:
    _FillValue:    nan
    long_name:     Time since simulationStartTime in days, for plotting
    cell_methods:  Time: mean, xtime=2001-11-23_06:46:46
         year=2001.0, decYears=<xarray.DataArray 'daysSinceStart' ()>
array(2002.), daysSinceStart=<xarray.DataArray 'daysSinceStart' ()>
array(265.333113)
Attributes:
    _FillValue:    nan
    long_name:     Time since simulationStartTime in days, for plotting
    cell_methods:  Time: mean, xtime=2002-01-01_00:00:00
     year index: 2, year=2002.0; timeBindsMin=730.0, timeBndsMax=1095.0
         year=2002.0, decYears=<xarray.DataArray 'daysSinceStart' ()>
array(2002.3652507), daysSinceStart=<xarray.DataArray 'daysSinceStart' ()>
array(365.)
Attributes:
    _FillValue:    nan
    long_name:     Time since simulationStartTime in days, for plotting
    cell_methods:  Time: mean, xtime=2002-05-14_07:35:46
         year=2002.0, decYears=<xarray.DataArray 'daysSinceStart' ()>
array(2002.73079053), daysSinceStart=<xarray.DataArray 'daysSinceStart' ()>
array(365.)
Attributes:
    _FillValue:    nan
    long_name:     Time since simulationStartTime in days, for plotting
    cell_methods:  Time: mean, xtime=2002-09-24_17:43:30
         year=2002.0, decYears=<xarray.DataArray 'daysSinceStart' ()>
array(2003.), daysSinceStart=<xarray.DataArray 'daysSinceStart' ()>
array(365.)
Attributes:
    _FillValue:    nan
    long_name:     Time since simulationStartTime in days, for plotting
    cell_methods:  Time: mean, xtime=2003-01-01_00:00:00
     year index: 3, year=2003.0; timeBindsMin=1095.0, timeBndsMax=1460.0
         year=2003.0, decYears=<xarray.DataArray 'daysSinceStart' ()>
array(2003.36587909), daysSinceStart=<xarray.DataArray 'daysSinceStart' ()>
array(497.896412)
Attributes:
    _FillValue:    nan
    long_name:     Time since simulationStartTime in days, for plotting
    cell_methods:  Time: mean, xtime=2003-05-14_13:06:03
         year=2003.0, decYears=<xarray.DataArray 'daysSinceStart' ()>
array(2003.73192856), daysSinceStart=<xarray.DataArray 'daysSinceStart' ()>
array(497.896412)
Attributes:
    _FillValue:    nan
    long_name:     Time since simulationStartTime in days, for plotting
    cell_methods:  Time: mean, xtime=2003-09-25_03:41:39
         year=2003.0, decYears=<xarray.DataArray 'daysSinceStart' ()>
array(2003.90836821), daysSinceStart=<xarray.DataArray 'daysSinceStart' ()>
array(497.896412)
Attributes:
    _FillValue:    nan
    long_name:     Time since simulationStartTime in days, for plotting
    cell_methods:  Time: mean, xtime=2003-11-28_13:18:20
         year=2003.0, decYears=<xarray.DataArray 'daysSinceStart' ()>
array(2004.), daysSinceStart=<xarray.DataArray 'daysSinceStart' ()>
array(497.896412)
Attributes:
    _FillValue:    nan
    long_name:     Time since simulationStartTime in days, for plotting
    cell_methods:  Time: mean, xtime=2004-01-01_00:00:00
     year index: 4, year=2004.0; timeBindsMin=1460.0, timeBndsMax=1825.0
         year=2004.0, decYears=<xarray.DataArray 'daysSinceStart' ()>
array(2004.36616093), daysSinceStart=<xarray.DataArray 'daysSinceStart' ()>
array(558.119248)
Attributes:
    _FillValue:    nan
    long_name:     Time since simulationStartTime in days, for plotting
    cell_methods:  Time: mean, xtime=2004-05-14_15:34:11
         year=2004.0, decYears=<xarray.DataArray 'daysSinceStart' ()>
array(2004.64305121), daysSinceStart=<xarray.DataArray 'daysSinceStart' ()>
array(558.119248)
Attributes:
    _FillValue:    nan
    long_name:     Time since simulationStartTime in days, for plotting
    cell_methods:  Time: mean, xtime=2004-08-23_17:07:43
         year=2004.0, decYears=<xarray.DataArray 'daysSinceStart' ()>
array(2004.92331577), daysSinceStart=<xarray.DataArray 'daysSinceStart' ()>
array(558.119248)
Attributes:
    _FillValue:    nan
    long_name:     Time since simulationStartTime in days, for plotting
    cell_methods:  Time: mean, xtime=2004-12-04_00:14:46
         year=2004.0, decYears=<xarray.DataArray 'daysSinceStart' ()>
array(2005.), daysSinceStart=<xarray.DataArray 'daysSinceStart' ()>
array(558.119248)
Attributes:
    _FillValue:    nan
    long_name:     Time since simulationStartTime in days, for plotting
    cell_methods:  Time: mean, xtime=2005-01-01_00:00:00
     year index: 5, year=2005.0; timeBindsMin=1825.0, timeBndsMax=2190.0
         year=2005.0, decYears=<xarray.DataArray 'daysSinceStart' ()>
array(2005.36628463), daysSinceStart=<xarray.DataArray 'daysSinceStart' ()>
array(691.282477)
Attributes:
    _FillValue:    nan
    long_name:     Time since simulationStartTime in days, for plotting
    cell_methods:  Time: mean, xtime=2005-05-14_16:39:12
         year=2005.0, decYears=<xarray.DataArray 'daysSinceStart' ()>
array(2005.71637329), daysSinceStart=<xarray.DataArray 'daysSinceStart' ()>
array(691.282477)
Attributes:
    _FillValue:    nan
    long_name:     Time since simulationStartTime in days, for plotting
    cell_methods:  Time: mean, xtime=2005-09-19_11:25:48
         year=2005.0, decYears=<xarray.DataArray 'daysSinceStart' ()>
array(2006.), daysSinceStart=<xarray.DataArray 'daysSinceStart' ()>
array(691.282477)
Attributes:
    _FillValue:    nan
    long_name:     Time since simulationStartTime in days, for plotting
    cell_methods:  Time: mean, xtime=2006-01-01_00:00:00
     year index: 6, year=2006.0; timeBindsMin=2190.0, timeBndsMax=2555.0
         year=2006.0, decYears=<xarray.DataArray 'daysSinceStart' ()>
array(2006.14946617), daysSinceStart=<xarray.DataArray 'daysSinceStart' ()>
array(730.)
Attributes:
    _FillValue:    nan
    long_name:     Time since simulationStartTime in days, for plotting
    cell_methods:  Time: mean, xtime=2006-02-24_13:19:25
         year=2006.0, decYears=<xarray.DataArray 'daysSinceStart' ()>
array(2006.51586768), daysSinceStart=<xarray.DataArray 'daysSinceStart' ()>
array(730.)
Attributes:
    _FillValue:    nan
    long_name:     Time since simulationStartTime in days, for plotting
    cell_methods:  Time: mean, xtime=2006-07-08_07:00:03
         year=2006.0, decYears=<xarray.DataArray 'daysSinceStart' ()>
array(2006.88233977), daysSinceStart=<xarray.DataArray 'daysSinceStart' ()>
array(730.)
Attributes:
    _FillValue:    nan
    long_name:     Time since simulationStartTime in days, for plotting
    cell_methods:  Time: mean, xtime=2006-11-19_01:17:47
         year=2006.0, decYears=<xarray.DataArray 'daysSinceStart' ()>
array(2007.), daysSinceStart=<xarray.DataArray 'daysSinceStart' ()>
array(730.)
Attributes:
    _FillValue:    nan
    long_name:     Time since simulationStartTime in days, for plotting
    cell_methods:  Time: mean, xtime=2007-01-01_00:00:00
     year index: 7, year=2007.0; timeBindsMin=2555.0, timeBndsMax=2920.0
         year=2007.0, decYears=<xarray.DataArray 'daysSinceStart' ()>
array(2007.36651855), daysSinceStart=<xarray.DataArray 'daysSinceStart' ()>
array(863.316505)
Attributes:
    _FillValue:    nan
    long_name:     Time since simulationStartTime in days, for plotting
    cell_methods:  Time: mean, xtime=2007-05-14_18:42:09
         year=2007.0, decYears=<xarray.DataArray 'daysSinceStart' ()>
array(2007.72222355), daysSinceStart=<xarray.DataArray 'daysSinceStart' ()>
array(863.316505)
Attributes:
    _FillValue:    nan
    long_name:     Time since simulationStartTime in days, for plotting
    cell_methods:  Time: mean, xtime=2007-09-21_14:40:42
         year=2007.0, decYears=<xarray.DataArray 'daysSinceStart' ()>
array(2008.), daysSinceStart=<xarray.DataArray 'daysSinceStart' ()>
array(863.316505)
Attributes:
    _FillValue:    nan
    long_name:     Time since simulationStartTime in days, for plotting
    cell_methods:  Time: mean, xtime=2008-01-01_00:00:00
     year index: 8, year=2008.0; timeBindsMin=2920.0, timeBndsMax=3285.0
         year=2008.0, decYears=<xarray.DataArray 'daysSinceStart' ()>
array(2008.36670668), daysSinceStart=<xarray.DataArray 'daysSinceStart' ()>
array(996.738542)
Attributes:
    _FillValue:    nan
    long_name:     Time since simulationStartTime in days, for plotting
    cell_methods:  Time: mean, xtime=2008-05-14_20:21:02
         year=2008.0, decYears=<xarray.DataArray 'daysSinceStart' ()>
array(2008.63208822), daysSinceStart=<xarray.DataArray 'daysSinceStart' ()>
array(996.738542)
Attributes:
    _FillValue:    nan
    long_name:     Time since simulationStartTime in days, for plotting
    cell_methods:  Time: mean, xtime=2008-08-19_17:05:34
         year=2008.0, decYears=<xarray.DataArray 'daysSinceStart' ()>
array(2008.9989335), daysSinceStart=<xarray.DataArray 'daysSinceStart' ()>
array(996.738542)
Attributes:
    _FillValue:    nan
    long_name:     Time since simulationStartTime in days, for plotting
    cell_methods:  Time: mean, xtime=2008-12-31_14:39:27
         year=2008.0, decYears=<xarray.DataArray 'daysSinceStart' ()>
array(2009.), daysSinceStart=<xarray.DataArray 'daysSinceStart' ()>
array(996.738542)
Attributes:
    _FillValue:    nan
    long_name:     Time since simulationStartTime in days, for plotting
    cell_methods:  Time: mean, xtime=2009-01-01_00:00:00
     year index: 9, year=2009.0; timeBindsMin=3285.0, timeBndsMax=3650.0
         year=2009.0, decYears=<xarray.DataArray 'daysSinceStart' ()>
array(2009.36697783), daysSinceStart=<xarray.DataArray 'daysSinceStart' ()>
array(1095.)
Attributes:
    _FillValue:    nan
    long_name:     Time since simulationStartTime in days, for plotting
    cell_methods:  Time: mean, xtime=2009-05-14_22:43:33
         year=2009.0, decYears=<xarray.DataArray 'daysSinceStart' ()>
array(2009.66976357), daysSinceStart=<xarray.DataArray 'daysSinceStart' ()>
array(1095.)
Attributes:
    _FillValue:    nan
    long_name:     Time since simulationStartTime in days, for plotting
    cell_methods:  Time: mean, xtime=2009-09-02_11:07:44
         year=2009.0, decYears=<xarray.DataArray 'daysSinceStart' ()>
array(2010.), daysSinceStart=<xarray.DataArray 'daysSinceStart' ()>
array(1095.)
Attributes:
    _FillValue:    nan
    long_name:     Time since simulationStartTime in days, for plotting
    cell_methods:  Time: mean, xtime=2010-01-01_00:00:00
     year index: 10, year=2010.0; timeBindsMin=3650.0, timeBndsMax=4015.0
         year=2010.0, decYears=<xarray.DataArray 'daysSinceStart' ()>
array(2010.3673607), daysSinceStart=<xarray.DataArray 'daysSinceStart' ()>
array(1228.545868)
Attributes:
    _FillValue:    nan
    long_name:     Time since simulationStartTime in days, for plotting
    cell_methods:  Time: mean, xtime=2010-05-15_02:04:47
         year=2010.0, decYears=<xarray.DataArray 'daysSinceStart' ()>
array(2010.73490985), daysSinceStart=<xarray.DataArray 'daysSinceStart' ()>
array(1228.545868)
Attributes:
    _FillValue:    nan
    long_name:     Time since simulationStartTime in days, for plotting
    cell_methods:  Time: mean, xtime=2010-09-26_05:48:37
         year=2010.0, decYears=<xarray.DataArray 'daysSinceStart' ()>
array(2011.), daysSinceStart=<xarray.DataArray 'daysSinceStart' ()>
array(1228.545868)
Attributes:
    _FillValue:    nan
    long_name:     Time since simulationStartTime in days, for plotting
    cell_methods:  Time: mean, xtime=2011-01-01_00:00:00
     year index: 11, year=2011.0; timeBindsMin=4015.0, timeBndsMax=4380.0
         year=2011.0, decYears=<xarray.DataArray 'daysSinceStart' ()>
array(2011.36785258), daysSinceStart=<xarray.DataArray 'daysSinceStart' ()>
array(1362.153924)
Attributes:
    _FillValue:    nan
    long_name:     Time since simulationStartTime in days, for plotting
    cell_methods:  Time: mean, xtime=2011-05-15_06:23:19
         year=2011.0, decYears=<xarray.DataArray 'daysSinceStart' ()>
array(2011.73592688), daysSinceStart=<xarray.DataArray 'daysSinceStart' ()>
array(1362.153924)
Attributes:
    _FillValue:    nan
    long_name:     Time since simulationStartTime in days, for plotting
    cell_methods:  Time: mean, xtime=2011-09-26_14:43:10
         year=2011.0, decYears=<xarray.DataArray 'daysSinceStart' ()>
array(2012.), daysSinceStart=<xarray.DataArray 'daysSinceStart' ()>
array(1362.153924)
Attributes:
    _FillValue:    nan
    long_name:     Time since simulationStartTime in days, for plotting
    cell_methods:  Time: mean, xtime=2012-01-01_00:00:00
     year index: 12, year=2012.0; timeBindsMin=4380.0, timeBndsMax=4745.0
         year=2012.0, decYears=<xarray.DataArray 'daysSinceStart' ()>
array(2012.36843395), daysSinceStart=<xarray.DataArray 'daysSinceStart' ()>
array(1426.554398)
Attributes:
    _FillValue:    nan
    long_name:     Time since simulationStartTime in days, for plotting
    cell_methods:  Time: mean, xtime=2012-05-15_11:28:53
         year=2012.0, decYears=<xarray.DataArray 'daysSinceStart' ()>
array(2012.73712135), daysSinceStart=<xarray.DataArray 'daysSinceStart' ()>
array(1426.554398)
Attributes:
    _FillValue:    nan
    long_name:     Time since simulationStartTime in days, for plotting
    cell_methods:  Time: mean, xtime=2012-09-27_01:10:59
         year=2012.0, decYears=<xarray.DataArray 'daysSinceStart' ()>
array(2013.), daysSinceStart=<xarray.DataArray 'daysSinceStart' ()>
array(1426.554398)
Attributes:
    _FillValue:    nan
    long_name:     Time since simulationStartTime in days, for plotting
    cell_methods:  Time: mean, xtime=2013-01-01_00:00:00
     year index: 13, year=2013.0; timeBindsMin=4745.0, timeBndsMax=5110.0
         year=2013.0, decYears=<xarray.DataArray 'daysSinceStart' ()>
array(2013.3690931), daysSinceStart=<xarray.DataArray 'daysSinceStart' ()>
array(1460.)
Attributes:
    _FillValue:    nan
    long_name:     Time since simulationStartTime in days, for plotting
    cell_methods:  Time: mean, xtime=2013-05-15_17:15:20
         year=2013.0, decYears=<xarray.DataArray 'daysSinceStart' ()>
array(2013.73846372), daysSinceStart=<xarray.DataArray 'daysSinceStart' ()>
array(1460.)
Attributes:
    _FillValue:    nan
    long_name:     Time since simulationStartTime in days, for plotting
    cell_methods:  Time: mean, xtime=2013-09-27_12:56:32
         year=2013.0, decYears=<xarray.DataArray 'daysSinceStart' ()>
array(2014.), daysSinceStart=<xarray.DataArray 'daysSinceStart' ()>
array(1460.)
Attributes:
    _FillValue:    nan
    long_name:     Time since simulationStartTime in days, for plotting
    cell_methods:  Time: mean, xtime=2014-01-01_00:00:00
     year index: 14, year=2014.0; timeBindsMin=5110.0, timeBndsMax=5475.0
         year=2014.0, decYears=<xarray.DataArray 'daysSinceStart' ()>
array(2014.36980695), daysSinceStart=<xarray.DataArray 'daysSinceStart' ()>
array(1593.648738)
Attributes:
    _FillValue:    nan
    long_name:     Time since simulationStartTime in days, for plotting
    cell_methods:  Time: mean, xtime=2014-05-15_23:30:32
         year=2014.0, decYears=<xarray.DataArray 'daysSinceStart' ()>
array(2014.65704122), daysSinceStart=<xarray.DataArray 'daysSinceStart' ()>
array(1593.648738)
Attributes:
    _FillValue:    nan
    long_name:     Time since simulationStartTime in days, for plotting
    cell_methods:  Time: mean, xtime=2014-08-28_19:40:52
         year=2014.0, decYears=<xarray.DataArray 'daysSinceStart' ()>
array(2014.79995063), daysSinceStart=<xarray.DataArray 'daysSinceStart' ()>
array(1593.648738)
Attributes:
    _FillValue:    nan
    long_name:     Time since simulationStartTime in days, for plotting
    cell_methods:  Time: mean, xtime=2014-10-19_23:34:03
         year=2014.0, decYears=<xarray.DataArray 'daysSinceStart' ()>
array(2015.), daysSinceStart=<xarray.DataArray 'daysSinceStart' ()>
array(1593.648738)
Attributes:
    _FillValue:    nan
    long_name:     Time since simulationStartTime in days, for plotting
    cell_methods:  Time: mean, xtime=2015-01-01_00:00:00
    write time averaged values
avg shape=(15, 385379), time shape=(15,)
Input #00: /pscratch/sd/h/hollyhan/MPAS-Tools/landice/output_processing_li/ismip6_postprocessing/flux_time_avg.nc
PDQ(in)  : /pscratch/sd/h/hollyhan/MPAS-Tools/landice/output_processing_li/ismip6_postprocessing/flux_time_avg.nc
PDQ(out) : /tmp/ncremap_tmp_pdq.nc.pid148621.flidx0
att(in)  : /tmp/ncremap_tmp_pdq.nc.pid148621.flidx0
att(out) : /tmp/ncremap_tmp_att.nc.pid148621.flidx0
Map/Wgt  : map_AIS_4to20km_to_ismip6_4km_conserve.nc
Writing 2d flux variables
---Processing flux file complete---

---All processing complete---