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

iulian at mcs.anl.gov iulian at mcs.anl.gov
Wed Nov 21 10:18:36 CST 2012


Author: iulian
Date: 2012-11-21 10:18:36 -0600 (Wed, 21 Nov 2012)
New Revision: 5880

Modified:
   MOAB/trunk/src/io/ReadNC.cpp
   MOAB/trunk/src/io/ReadNC.hpp
Log:
generalize the hack for dummy vars; store the dummy names in a set, and
skip them at reading time.
this needs to go away in a sunny day


Modified: MOAB/trunk/src/io/ReadNC.cpp
===================================================================
--- MOAB/trunk/src/io/ReadNC.cpp	2012-11-21 00:04:05 UTC (rev 5879)
+++ MOAB/trunk/src/io/ReadNC.cpp	2012-11-21 16:18:36 UTC (rev 5880)
@@ -1603,7 +1603,7 @@
   int success;
   std::vector<int> requests(vdatas.size() * tstep_nums.size()), statuss(vdatas.size() * tstep_nums.size());
   for (unsigned int i = 0; i < vdatas.size(); i++) {
-    if (vdatas[i].varName=="ncol" || vdatas[i].varName=="nbnd")
+    if (dummyVarNames.find(vdatas[i].varName)!= dummyVarNames.end() )
        continue;// this is a dummy one, we don't have it; we created it for the dummy tag
     for (unsigned int t = 0; t < tstep_nums.size(); t++) {
       void *data = vdatas[i].varDatas[t];
@@ -3065,6 +3065,7 @@
     data.numAtts=0;
     dbgOut.tprintf(2, "Dummy varInfo created for dimension %s\n", dimNames[i].c_str());
     std::cout<<"dummy varInfo created for dimension "<< dimNames[i] << "\n";
+    dummyVarNames.insert(dimNames[i]);
   }
   return MB_SUCCESS;
 }

Modified: MOAB/trunk/src/io/ReadNC.hpp
===================================================================
--- MOAB/trunk/src/io/ReadNC.hpp	2012-11-21 00:04:05 UTC (rev 5879)
+++ MOAB/trunk/src/io/ReadNC.hpp	2012-11-21 16:18:36 UTC (rev 5880)
@@ -308,6 +308,8 @@
   
     //! dimensions
   std::vector<std::string> dimNames;
+  // these should be taken out when we fix the dummy var info things
+  std::set<std::string> dummyVarNames;
   std::vector<int> dimVals;
   std::string iName, jName, kName,tName;
   std::string iCName, jCName;



More information about the moab-dev mailing list