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

tan2 at geodynamics.org tan2 at geodynamics.org
Wed Sep 19 13:33:42 PDT 2007


Author: tan2
Date: 2007-09-19 13:33:42 -0700 (Wed, 19 Sep 2007)
New Revision: 7991

Modified:
   mc/3D/CitcomS/trunk/lib/Checkpoints.c
Log:
Shrink the size of arrays

Modified: mc/3D/CitcomS/trunk/lib/Checkpoints.c
===================================================================
--- mc/3D/CitcomS/trunk/lib/Checkpoints.c	2007-09-19 20:31:11 UTC (rev 7990)
+++ mc/3D/CitcomS/trunk/lib/Checkpoints.c	2007-09-19 20:33:42 UTC (rev 7991)
@@ -246,6 +246,8 @@
     for(m=1; m<=E->sphere.caps_per_proc; m++)
         fwrite(&(E->trace.ntracers[m]), sizeof(int), 1, fp);
 
+    /* the 0-th element of basicq/extraq/ntracer_flavor is not init'd
+     * and won't be used when read it. */
     for(m=1; m<=E->sphere.caps_per_proc; m++) {
         for(i=0; i<E->trace.number_of_basic_quantities; i++) {
             fwrite(E->trace.basicq[m][i], sizeof(double),
@@ -346,6 +348,8 @@
     fwrite(E->composition.initial_bulk_composition, sizeof(double),
            E->composition.ncomp, fp);
 
+    /* the 0-th element of comp_el/comp_node is not init'd
+     * and won't be used when read it. */
     for(m=1; m<=E->sphere.caps_per_proc; m++) {
         for(i=0; i<E->composition.ncomp; i++)
             fwrite(E->composition.comp_el[m][i], sizeof(double),
@@ -427,6 +431,8 @@
 
     read_sentinel(fp, E->parallel.me);
 
+    /* the 0-th element of T/Tdot is not init'd
+     * and won't be used when read it. */
     for(m=1; m<=E->sphere.caps_per_proc; m++) {
         fread(E->T[m], sizeof(double), E->lmesh.nno+1, fp);
         fread(E->Tdot[m], sizeof(double), E->lmesh.nno+1, fp);
@@ -446,6 +452,8 @@
     fwrite(&(E->monitor.vdotv), sizeof(float), 1, fp);
     fwrite(&(E->monitor.incompressibility), sizeof(float), 1, fp);
 
+    /* the 0-th element of P/NP/EVI/VI is not init'd
+     * and won't be used when read it. */
     for(m=1; m<=E->sphere.caps_per_proc; m++) {
         /* Pressure at equation points and nodes */
         /* Writing E->NP instead of calling p_to_nodes() because p_to_nodes()
@@ -458,8 +466,8 @@
 
         /* viscosity at quadrature points and node points */
         fwrite(E->EVI[lev][m], sizeof(float),
-               (E->lmesh.nel+2)*vpoints[E->mesh.nsd], fp);
-        fwrite(E->VI[lev][m], sizeof(float), E->lmesh.nno+2, fp);
+               (E->lmesh.nel+1)*vpoints[E->mesh.nsd], fp);
+        fwrite(E->VI[lev][m], sizeof(float), E->lmesh.nno+1, fp);
     }
 
     return;



More information about the cig-commits mailing list