[MOAB-dev] commit/MOAB: danwu: Updated some comments for NC writer.

commits-noreply at bitbucket.org commits-noreply at bitbucket.org
Wed May 7 17:29:30 CDT 2014


1 new commit in MOAB:

https://bitbucket.org/fathomteam/moab/commits/990d8c95c1fc/
Changeset:   990d8c95c1fc
Branch:      master
User:        danwu
Date:        2014-05-08 00:29:15
Summary:     Updated some comments for NC writer.

Affected #:  4 files

diff --git a/src/io/NCWriteGCRM.cpp b/src/io/NCWriteGCRM.cpp
index b1e5a7d..c449a67 100644
--- a/src/io/NCWriteGCRM.cpp
+++ b/src/io/NCWriteGCRM.cpp
@@ -239,9 +239,7 @@ ErrorCode NCWriteGCRM::write_nonset_variables(std::vector<WriteNC::VarData>& vda
   Range* pLocalEntsOwned = NULL;
   Range* pLocalGidEntsOwned = NULL;
 
-  // Now look at requested var_names; if they have time, we will have a list, and write one at a time
-  // For each variable tag in the indexed lists, write a time step data
-  // Assume the first dimension is time (need to check); if not, just write regularly
+  // For each indexed variable tag, write a time step data
   for (unsigned int i = 0; i < vdatas.size(); i++) {
     WriteNC::VarData& variableData = vdatas[i];
 
@@ -270,15 +268,15 @@ ErrorCode NCWriteGCRM::write_nonset_variables(std::vector<WriteNC::VarData>& vda
         pLocalGidEntsOwned = &localGidCellsOwned;
         break;
       default:
-        ERRORR(MB_FAILURE, "Unexpected entity location type for MPAS non-set variable.");
+        ERRORR(MB_FAILURE, "Unexpected entity location type for GCRM non-set variable.");
     }
 
-    // A typical variable has 3 dimensions as (Time, nCells, nVertLevels)
+    // A typical GCRM non-set variable has 3 dimensions as (time, cells, layers)
     for (unsigned int t = 0; t < tstep_nums.size(); t++) {
       // We will write one time step, and count will be one; start will be different
-      // Use tag_get_data instead of tag_iterate to get values, as localEntsOwned
+      // Use tag_get_data instead of tag_iterate to copy tag data, as localEntsOwned
       // might not be contiguous.
-      variableData.writeStarts[0] = t; // This is time, again
+      variableData.writeStarts[0] = t; // This is start for time
       std::vector<double> tag_data(pLocalEntsOwned->size() * variableData.numLev);
       ErrorCode rval = mbImpl->tag_get_data(variableData.varTags[t], *pLocalEntsOwned, &tag_data[0]);
       ERRORR(rval, "Trouble getting tag data on owned vertices.");
@@ -289,7 +287,8 @@ ErrorCode NCWriteGCRM::write_nonset_variables(std::vector<WriteNC::VarData>& vda
       size_t idxReq = 0;
 #endif
 
-      // Now write from memory directly
+      // Now write copied tag data
+      // Use nonblocking put (request aggregation)
       switch (variableData.varDataType) {
         case NC_DOUBLE: {
           size_t indexInDoubleArray = 0;

diff --git a/src/io/NCWriteHOMME.cpp b/src/io/NCWriteHOMME.cpp
index 0e4b55c..d7b865d 100644
--- a/src/io/NCWriteHOMME.cpp
+++ b/src/io/NCWriteHOMME.cpp
@@ -143,10 +143,7 @@ ErrorCode NCWriteHOMME::write_nonset_variables(std::vector<WriteNC::VarData>& vd
   int success;
   int num_local_verts_owned = localVertsOwned.size();
 
-  // Now look at requested var_names; if they have time, we will have a list, and write one at a time
-  // Need to transpose from lev dimension
-  // For each variable tag in the indexed lists, write a time step data
-  // Assume the first dimension is time (need to check); if not, just write regularly
+  // For each indexed variable tag, write a time step data
   for (unsigned int i = 0; i < vdatas.size(); i++) {
     WriteNC::VarData& variableData = vdatas[i];
 
@@ -167,10 +164,10 @@ ErrorCode NCWriteHOMME::write_nonset_variables(std::vector<WriteNC::VarData>& vd
     // to NC format (lev, ncol) for writing
     for (unsigned int t = 0; t < tstep_nums.size(); t++) {
       // We will write one time step, and count will be one; start will be different
-      // Use tag_get_data instead of tag_iterate to get values, as localVertsOwned
+      // Use tag_get_data instead of tag_iterate to copy tag data, as localVertsOwned
       // might not be contiguous. We should also transpose for level so that means
       // deep copy for transpose
-      variableData.writeStarts[0] = t; // This is time, again
+      variableData.writeStarts[0] = t; // This is start for time
       std::vector<double> tag_data(num_local_verts_owned * variableData.numLev);
       ErrorCode rval = mbImpl->tag_get_data(variableData.varTags[t], localVertsOwned, &tag_data[0]);
       ERRORR(rval, "Trouble getting tag data on owned vertices.");
@@ -181,7 +178,8 @@ ErrorCode NCWriteHOMME::write_nonset_variables(std::vector<WriteNC::VarData>& vd
       size_t idxReq = 0;
 #endif
 
-      // Now write from memory directly
+      // Now transpose and write copied tag data
+      // Use nonblocking put (request aggregation)
       switch (variableData.varDataType) {
         case NC_DOUBLE: {
           std::vector<double> tmpdoubledata(num_local_verts_owned * variableData.numLev);

diff --git a/src/io/NCWriteHelper.cpp b/src/io/NCWriteHelper.cpp
index aefa572..f466677 100644
--- a/src/io/NCWriteHelper.cpp
+++ b/src/io/NCWriteHelper.cpp
@@ -672,6 +672,7 @@ ErrorCode ScdNCWriteHelper::write_nonset_variables(std::vector<WriteNC::VarData>
 
   int success;
 
+  // For each indexed variable tag, write a time step data
   for (unsigned int i = 0; i < vdatas.size(); i++) {
     WriteNC::VarData& variableData = vdatas[i];
 
@@ -698,6 +699,7 @@ ErrorCode ScdNCWriteHelper::write_nonset_variables(std::vector<WriteNC::VarData>
 
     for (unsigned int t = 0; t < tstep_nums.size(); t++) {
       // We will write one time step, and count will be one; start will be different
+      // Use tag_iterate to get tag data (assume that localCellsOwned is contiguous)
       // We should also transpose for level so that means deep copy for transpose
       variableData.writeStarts[0] = t; // This is start for time
       int count;
@@ -706,8 +708,9 @@ ErrorCode ScdNCWriteHelper::write_nonset_variables(std::vector<WriteNC::VarData>
       ERRORR(rval, "Failed to get tag iterator on owned faces.");
       assert(count == (int)localCellsOwned.size());
 
-      // Use collective I/O mode put (synchronous write) for the time being, we can try nonblocking put
-      // (request aggregation) later
+      // Now transpose and write tag data
+      // Use collective I/O mode put (synchronous write) for the time being, we can try
+      // nonblocking put (request aggregation) later
       switch (variableData.varDataType) {
         case NC_DOUBLE: {
           std::vector<double> tmpdoubledata(ni*nj*nk);

diff --git a/src/io/NCWriteMPAS.cpp b/src/io/NCWriteMPAS.cpp
index d149b03..0665425 100644
--- a/src/io/NCWriteMPAS.cpp
+++ b/src/io/NCWriteMPAS.cpp
@@ -239,9 +239,7 @@ ErrorCode NCWriteMPAS::write_nonset_variables(std::vector<WriteNC::VarData>& vda
   Range* pLocalEntsOwned = NULL;
   Range* pLocalGidEntsOwned = NULL;
 
-  // Now look at requested var_names; if they have time, we will have a list, and write one at a time
   // For each variable tag in the indexed lists, write a time step data
-  // Assume the first dimension is time (need to check); if not, just write regularly
   for (unsigned int i = 0; i < vdatas.size(); i++) {
     WriteNC::VarData& variableData = vdatas[i];
 
@@ -273,12 +271,12 @@ ErrorCode NCWriteMPAS::write_nonset_variables(std::vector<WriteNC::VarData>& vda
         ERRORR(MB_FAILURE, "Unexpected entity location type for MPAS non-set variable.");
     }
 
-    // A typical variable has 3 dimensions as (Time, nCells, nVertLevels)
+    // A typical MPAS non-set variable has 3 dimensions as (Time, nCells, nVertLevels)
     for (unsigned int t = 0; t < tstep_nums.size(); t++) {
       // We will write one time step, and count will be one; start will be different
-      // Use tag_get_data instead of tag_iterate to get values, as localEntsOwned
+      // Use tag_get_data instead of tag_iterate to copy tag data, as localEntsOwned
       // might not be contiguous.
-      variableData.writeStarts[0] = t; // This is time, again
+      variableData.writeStarts[0] = t; // This is start for time
       std::vector<double> tag_data(pLocalEntsOwned->size() * variableData.numLev);
       ErrorCode rval = mbImpl->tag_get_data(variableData.varTags[t], *pLocalEntsOwned, &tag_data[0]);
       ERRORR(rval, "Trouble getting tag data on owned vertices.");
@@ -289,7 +287,8 @@ ErrorCode NCWriteMPAS::write_nonset_variables(std::vector<WriteNC::VarData>& vda
       size_t idxReq = 0;
 #endif
 
-      // Now write from memory directly
+      // Now write copied tag data
+      // Use nonblocking put (request aggregation)
       switch (variableData.varDataType) {
         case NC_DOUBLE: {
           size_t indexInDoubleArray = 0;

Repository URL: https://bitbucket.org/fathomteam/moab/

--

This is a commit notification from bitbucket.org. You are receiving
this because you have the service enabled, addressing the recipient of
this email.


More information about the moab-dev mailing list