[cig-commits] r19374 - mc/3D/CitcomCU/trunk/src

becker at geodynamics.org becker at geodynamics.org
Mon Jan 16 14:34:15 PST 2012


Author: becker
Date: 2012-01-16 14:34:14 -0800 (Mon, 16 Jan 2012)
New Revision: 19374

Modified:
   mc/3D/CitcomCU/trunk/src/Boundary_conditions.c
   mc/3D/CitcomCU/trunk/src/Output_gzdir.c
Log:
Fixed very simple restart bug.



Modified: mc/3D/CitcomCU/trunk/src/Boundary_conditions.c
===================================================================
--- mc/3D/CitcomCU/trunk/src/Boundary_conditions.c	2012-01-16 21:25:08 UTC (rev 19373)
+++ mc/3D/CitcomCU/trunk/src/Boundary_conditions.c	2012-01-16 22:34:14 UTC (rev 19374)
@@ -126,11 +126,16 @@
 
 void freeze_surface(struct All_variables *E)
 {
-
+  
   int lev,top;
   if(E->parallel.me == 0)
     fprintf(stderr,"WARNING: freezing surface boundary condition at time step %i\n",
 	    E->monitor.solution_cycles);
+  /* 
+
+  WARNING: this is not working yet
+
+  */
   /* no slip on top */
   E->mesh.topvbc = 1;E->control.VBXtopval=E->control.VBYtopval=E->control.plate_vel=0.0;
   velocity_boundary_conditions(E);  
@@ -343,24 +348,23 @@
 {
 	int i, j;
 	int node1, node2;
-	//const int dims = E->mesh.nsd;
 
 	/* Temps and bc-values  at top level only */
-	/* fixed temperature at x=0 */
 
-	if(E->parallel.me_loc[1] == 0 || E->parallel.me_loc[1] == E->parallel.nprocx - 1)
+
+	if((E->parallel.me_loc[1] == 0) || (E->parallel.me_loc[1] == E->parallel.nprocx - 1)) /* left or right */
 		for(j = 1; j <= E->lmesh.noy; j++)
 			for(i = 1; i <= E->lmesh.noz; i++)
 			{
 				node1 = i + (j - 1) * E->lmesh.noz * E->lmesh.nox;
 				node2 = node1 + (E->lmesh.nox - 1) * E->lmesh.noz;
-				if(E->parallel.me_loc[1] == 0)
+				if(E->parallel.me_loc[1] == 0) /* left zero flux */
 				{
 					E->node[node1] = E->node[node1] & (~TBX);
 					E->node[node1] = E->node[node1] | FBX;
 					E->TB[1][node1] = 0.0;
 				}
-				if(E->parallel.me_loc[1] == E->parallel.nprocx - 1)
+				if(E->parallel.me_loc[1] == E->parallel.nprocx - 1) /* right zero flux */
 				{
 					E->node[node2] = E->node[node2] & (~TBX);
 					E->node[node2] = E->node[node2] | FBX;
@@ -368,19 +372,19 @@
 				}
 			}					/* end for loop i & j */
 
-	if(E->parallel.me_loc[2] == 0 || E->parallel.me_loc[2] == E->parallel.nprocy - 1)
+	if((E->parallel.me_loc[2] == 0) || (E->parallel.me_loc[2] == E->parallel.nprocy - 1)) /* front or back */
 		for(j = 1; j <= E->lmesh.nox; j++)
 			for(i = 1; i <= E->lmesh.noz; i++)
 			{
 				node1 = i + (j - 1) * E->lmesh.noz;
 				node2 = node1 + (E->lmesh.noy - 1) * E->lmesh.noz * E->lmesh.nox;
-				if(E->parallel.me_loc[2] == 0)
+				if(E->parallel.me_loc[2] == 0) /* front zero flux */
 				{
 					E->node[node1] = E->node[node1] & (~TBY);
 					E->node[node1] = E->node[node1] | FBY;
 					E->TB[2][node1] = 0.0;
 				}
-				if(E->parallel.me_loc[2] == E->parallel.nprocy - 1)
+				if(E->parallel.me_loc[2] == E->parallel.nprocy - 1) /* back zero flux */
 				{
 					E->node[node2] = E->node[node2] & (~TBY);
 					E->node[node2] = E->node[node2] | FBY;

Modified: mc/3D/CitcomCU/trunk/src/Output_gzdir.c
===================================================================
--- mc/3D/CitcomCU/trunk/src/Output_gzdir.c	2012-01-16 21:25:08 UTC (rev 19373)
+++ mc/3D/CitcomCU/trunk/src/Output_gzdir.c	2012-01-16 22:34:14 UTC (rev 19374)
@@ -2,7 +2,7 @@
  * CitcomCU is a Finite Element Code that solves for thermochemical
  * convection within a three dimensional domain appropriate for convection
  
-* within the Earth's mantle. Cartesian and regional-spherical geometries
+ * within the Earth's mantle. Cartesian and regional-spherical geometries
  * are implemented. See the file README contained with this distribution
  * for further details.
  * 
@@ -708,12 +708,16 @@
 	fprintf(stderr,"read error\n");
 	parallel_process_termination();
       }
-      sscanf(input_s, "%i %i %g", &i, &j, &E->monitor.elapsed_time);
-
+      sscanf(input_s, "%i %i %f", &i, &j, &E->monitor.elapsed_time);
+      if(j != E->lmesh.nno)
+	myerror("mismatch of total node number upon restart",E);
+      gzgets (gzin,input_s, 200);
+      sscanf(input_s, "%i %i", &i, &j);
+      /*  */
       for(node = 1; node <= E->lmesh.nno; node++)
 	{
 	  gzgets (gzin,input_s, 200);
-	  sscanf(input_s, "%g", &E->T[node]);
+	  sscanf(input_s, "%f", &E->T[node]);
 	  //if(E->SX[3][node] == 0)fprintf(stderr,"%g %g\n",E->SX[3][node],E->T[node]);
 	  E->C[node] = 0;
 	}
@@ -749,7 +753,7 @@
       for(node = 1; node <= E->lmesh.nno; node++)
 	{  
 	  gzgets (gzin,input_s, 200);
-   	  sscanf(input_s, "%g", &E->C[node]);
+   	  sscanf(input_s, "%f", &E->C[node]);
 	}
       gzclose(gzin);
       



More information about the CIG-COMMITS mailing list