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

xbxu at mcs.anl.gov xbxu at mcs.anl.gov
Mon Jun 6 13:04:14 CDT 2011


Author: xbxu
Date: 2011-06-06 13:04:13 -0500 (Mon, 06 Jun 2011)
New Revision: 4951

Modified:
   MOAB/trunk/src/io/ReadNC.cpp
Log:
only create dim_name tag for lon,lat,lev,time
only create __<dim_name>_LOC_VALS tag for time
__<var_name>_DIMS created for variables having at least one dimension.


Modified: MOAB/trunk/src/io/ReadNC.cpp
===================================================================
--- MOAB/trunk/src/io/ReadNC.cpp	2011-06-06 17:42:25 UTC (rev 4950)
+++ MOAB/trunk/src/io/ReadNC.cpp	2011-06-06 18:04:13 UTC (rev 4951)
@@ -1228,10 +1228,7 @@
   dimNamesSz = dimNames.size();
   for (unsigned int i = 0; i != dimNamesSz; ++i) {
     tag_name = dimNames[i];
-    Tag tagh = 0; 
-    DataType data_type;
     void * val = NULL;
-    int val_len = 0;
     if (tag_name == "lon") 
       val = &ilVals[0];
     else if (tag_name == "lat")
@@ -1241,22 +1238,20 @@
     else if (tag_name == "time")
       val = &tVals[0];
     else {
-      std::string s = "Unrecognized dimension name";
-      s += tag_name;
-      s += "\n";
-      ERRORR(MB_FAILURE, s.c_str());      
+      continue;
     }
+    Tag tagh = 0; 
+    DataType data_type;
+    int val_len = dimVals[i];
     switch (varInfo[tag_name].varDataType) {
     case NC_BYTE:
     case NC_CHAR:
     case NC_DOUBLE:
       data_type = MB_TYPE_DOUBLE;
-      val_len = sizeof(double) * dimVals[i];
       break;
     case NC_FLOAT:
     case NC_INT:
       data_type = MB_TYPE_INTEGER;
-      val_len = sizeof(int) * dimVals[i];
       break;
     case NC_SHORT:
     default:
@@ -1300,25 +1295,16 @@
 
   // __<dim_name>_LOC_VALS
   for (unsigned int i = 0; i != dimNamesSz; ++i) {
-    if (dimNames[i] != "lon" && dimNames[i] != "lat" && dimNames[i] != "lev") {
-      Tag tagh = 0; 
-      std::vector<int> val;
-      if (dimNames[i] == "time") {
-	val = tstep_nums;


More information about the moab-dev mailing list