ESCOMP / CISM

Community Ice Sheet Model
GNU Lesser General Public License v3.0
6 stars 11 forks source link

Ensure that we don't try to print diagnostics outside array bounds #44

Closed billsacks closed 2 years ago

billsacks commented 2 years ago

I have run 3 CESM-CISM debug tests that were failing before (all with Antarctica); they now pass.

@whlipscomb I'll merge this once you approve.

billsacks commented 2 years ago

Thanks for the catch, @whlipscomb ! I think it should work right now, but please let me know if you see any other issues.

Here is a sample of the output (when I checked the output with the buggy code, there were only 4 rows for each variable, because it was effectively using jtest = 1 instead of jtest = 16):

112:
112: adjust thck: itest, jtest, rank =           3          16         112
112:
112: Before thck adjustment, usrf (m):
112:   277.562   356.353   457.771   530.058   615.079   672.004
112:   199.529   275.884   401.627   466.389   557.691   636.234
112:   142.300   191.138   310.010   426.479   522.109   609.718
112:    76.492   143.198   202.430   370.188   469.461   560.776
112:    55.183    95.793   151.730   294.327   412.291   525.256
112:    51.500    94.954   120.261   247.587   384.764   499.527
112:    34.596   117.300   188.208   238.145   364.252   483.843
112:
112: Before thck adjustment, thck (m):
112:   991.011  1045.217  1156.221  1325.497  1418.595  1468.612
112:   889.430   948.456  1157.434  1276.198  1291.437  1358.095
112:   786.833   937.032  1066.448  1145.403  1219.621  1400.691
112:   741.803   959.238   968.295  1026.165  1186.926  1437.509
112:   519.488   851.641   923.829  1091.538  1248.260  1505.987
112:   479.061   886.538  1126.097  1110.270  1280.644  1503.819
112:   290.632   919.017  1214.570  1235.027  1405.126  1367.522
112:
112: Before thck adjustment, topg (m):
112:  -713.449  -688.865  -698.450  -795.439  -803.517  -796.608
112:  -689.902  -672.572  -755.808  -809.810  -733.745  -721.861
112:  -644.533  -745.894  -756.438  -718.924  -697.512  -790.974
112:  -673.384  -818.485  -765.865  -655.977  -717.464  -876.732
112:  -810.546  -899.029  -776.111  -797.210  -835.969  -980.731
112:  -970.441  -928.659 -1013.923  -862.995  -895.880 -1004.292
112:  -789.503  -820.322 -1026.362  -996.882 -1040.874  -883.679
112:
112: Before thck adjustment, cavity thickness (m):
112:     0.000     0.000     0.000    -0.000    -0.000     0.000
112:    -0.000    -0.000     0.000     0.000    -0.000    -0.000
112:    -0.000     0.000    -0.000    -0.000     0.000     0.000
112:     8.073     2.445     0.000    -0.000    -0.000    -0.000
112:   346.241   143.181     4.012     0.000    -0.000    -0.000
112:   542.881   137.075     8.087     0.312     0.000    -0.000
112:   533.466    18.605     0.000     0.000    -0.000     0.000