[cig-commits] r4230 - mc/3D/CitcomS/trunk/lib

luis at geodynamics.org luis at geodynamics.org
Fri Aug 4 16:13:27 PDT 2006


Author: luis
Date: 2006-08-04 16:13:27 -0700 (Fri, 04 Aug 2006)
New Revision: 4230

Modified:
   mc/3D/CitcomS/trunk/lib/Output_h5.c
   mc/3D/CitcomS/trunk/lib/hdf5_info.h
Log:
Renamed E->hdf5.step to something less confusing: E->hdf5.count


Modified: mc/3D/CitcomS/trunk/lib/Output_h5.c
===================================================================
--- mc/3D/CitcomS/trunk/lib/Output_h5.c	2006-08-04 22:14:20 UTC (rev 4229)
+++ mc/3D/CitcomS/trunk/lib/Output_h5.c	2006-08-04 23:13:27 UTC (rev 4230)
@@ -175,10 +175,11 @@
     /* disable horizontal average h5output   by Tan2 */
     /* h5output_ave_r(E, cycles); */
 
-    /* prepare for next step */
-    E->hdf5.step += 1;
+    /* Count how many times we have called this function.
+     * This statement should always be the last one.
+     */
+    E->hdf5.count += 1;
 
-    return;
 #endif
 }
 
@@ -349,8 +350,12 @@
     E->hdf5.scalar2d = (double *)malloc((nx*ny)*sizeof(double));
     E->hdf5.scalar1d = (double *)malloc((nz)*sizeof(double));
 
-    /* step about to be executed */
-    E->hdf5.step = 0;
+    /* Number of times we have called h5output()
+     *
+     * TODO:
+     *  Under a restart, initialize to the last count instead.
+     */
+    E->hdf5.count = 0;
 
 #endif
 }
@@ -1066,7 +1071,7 @@
     cap = h5open_cap(E);
     dataset = H5Dopen(cap, "velocity");
     h5write_field(dataset, H5T_NATIVE_DOUBLE, E->hdf5.vector3d,
-                  E->hdf5.step+1, nodex, nodey, nodez, 3, E);
+                  E->hdf5.count+1, nodex, nodey, nodez, 3, E);
 
     /* release resources */
     status = H5Dclose(dataset);
@@ -1126,7 +1131,7 @@
     cap = h5open_cap(E);
     dataset = H5Dopen(cap, "temperature");
     h5write_field(dataset, H5T_NATIVE_DOUBLE, E->hdf5.scalar3d,
-                  E->hdf5.step+1, nodex, nodey, nodez, 0, E);
+                  E->hdf5.count+1, nodex, nodey, nodez, 0, E);
 
     /* release resources */
     status = H5Dclose(dataset);

Modified: mc/3D/CitcomS/trunk/lib/hdf5_info.h
===================================================================
--- mc/3D/CitcomS/trunk/lib/hdf5_info.h	2006-08-04 22:14:20 UTC (rev 4229)
+++ mc/3D/CitcomS/trunk/lib/hdf5_info.h	2006-08-04 23:13:27 UTC (rev 4230)
@@ -41,8 +41,8 @@
     /* Default type used is H5T_NATIVE_FLOAT */
     hid_t type_id;
 
-    /* Keep track of step (instead of cycle) that is about to be executed */
-    int step;
+    /* Keep track of how many times we call h5output() */
+    int count;
 
     /* Group names under which to store the appropriate data,
      * represented by an array of strings. For a regional



More information about the cig-commits mailing list