[MOAB-dev] r5157 - MOAB/trunk/src/io
xbxu at mcs.anl.gov
xbxu at mcs.anl.gov
Fri Sep 9 09:46:08 CDT 2011
Author: xbxu
Date: 2011-09-09 09:46:07 -0500 (Fri, 09 Sep 2011)
New Revision: 5157
Modified:
MOAB/trunk/src/io/ReadNC.cpp
Log:
o create nc conventional tags only when loading header info
o fix the bug to read correct time steps when specific time steps are
specified
o only create dim_name tag for lat, lon, lev and time for now
o treat variable names lat, lon etc. as a single dimension variable
o passes make check in serial and parallel.
Modified: MOAB/trunk/src/io/ReadNC.cpp
===================================================================
--- MOAB/trunk/src/io/ReadNC.cpp 2011-09-08 21:03:29 UTC (rev 5156)
+++ MOAB/trunk/src/io/ReadNC.cpp 2011-09-09 14:46:07 UTC (rev 5157)
@@ -192,10 +192,12 @@
mbImpl->release_interface(scdi);
ERRORR(rval, "Trouble creating scd element sequence.");
- // create nc conventional tags
- rval = create_tags(scdi, tmp_set, tstep_nums);
- ERRORR(rval, "Trouble creating nc conventional tags.");
-
+ // create nc conventional tags when loading header info only
+ if (nomesh && novars) {
+ rval = create_tags(scdi, tmp_set, tstep_nums);
+ ERRORR(rval, "Trouble creating nc conventional tags.");
+ }
+
return MB_SUCCESS;
}
@@ -470,7 +472,7 @@
// set up the dimensions and counts
// first time
- vdatas[i].readDims[t].push_back(t);
+ vdatas[i].readDims[t].push_back(tstep_nums[t]);
vdatas[i].readCounts[t].push_back(1);
// then z/y/x
@@ -1107,9 +1109,9 @@
val = &klVals[0];
else if (tag_name == "time")
val = &tVals[0];
- else {
+ else
continue;
- }
+
Tag tagh = 0;
DataType data_type;
int val_len = dimVals[i];
@@ -1171,43 +1173,46 @@
for (unsigned int i = 0; i != dimNamesSz; ++i) {
if (dimNames[i] != "time")
continue;
- if (!tstep_nums.empty()) {
- Tag tagh = 0;
- std::vector<int> val = tstep_nums;
- std::stringstream ss_tag_name;
- ss_tag_name << "__" << dimNames[i] << "_LOC_VALS";
More information about the moab-dev
mailing list