[MOAB-dev] r5727 - MOAB/trunk/src/io

iulian at mcs.anl.gov iulian at mcs.anl.gov
Wed Sep 5 15:18:07 CDT 2012


Author: iulian
Date: 2012-09-05 15:18:07 -0500 (Wed, 05 Sep 2012)
New Revision: 5727

Modified:
   MOAB/trunk/src/io/ReadNC.cpp
Log:
thanks Kara for finding this bug;
interestingly enough, only a MAC experienced a problem with this out-of-range 
index.


Modified: MOAB/trunk/src/io/ReadNC.cpp
===================================================================
--- MOAB/trunk/src/io/ReadNC.cpp	2012-09-04 18:41:06 UTC (rev 5726)
+++ MOAB/trunk/src/io/ReadNC.cpp	2012-09-05 20:18:07 UTC (rev 5727)
@@ -2243,7 +2243,9 @@
       std::size_t i;
       for (i = 0; i != ilCVals.size(); ++i)
         ilVals[i] = ilCVals[i] - dif;
-      ilVals[i] = ilCVals[i-1] + dif;
+      // the last one is needed only if not periodic
+      if (!locallyPeriodic[0])
+        ilVals[i] = ilCVals[i-1] + dif;
     }
     else {
       ERRORR(MB_FAILURE, "Couldn't find x coordinate.");



More information about the moab-dev mailing list