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

tan2 at geodynamics.org tan2 at geodynamics.org
Fri Aug 10 16:45:05 PDT 2007


Author: tan2
Date: 2007-08-10 16:44:58 -0700 (Fri, 10 Aug 2007)
New Revision: 7803

Modified:
   mc/3D/CitcomS/trunk/lib/Drive_solvers.c
   mc/3D/CitcomS/trunk/lib/Global_operations.c
Log:
Fixed two type-mismatch errors. Issue127 is fixed by this change and r7802.

Modified: mc/3D/CitcomS/trunk/lib/Drive_solvers.c
===================================================================
--- mc/3D/CitcomS/trunk/lib/Drive_solvers.c	2007-08-10 23:43:49 UTC (rev 7802)
+++ mc/3D/CitcomS/trunk/lib/Drive_solvers.c	2007-08-10 23:44:58 UTC (rev 7803)
@@ -1,6 +1,6 @@
 /*
  *~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- * 
+ *
  *<LicenseText>
  *
  * CitcomS by Louis Moresi, Shijie Zhong, Lijie Han, Eh Tan,
@@ -22,7 +22,7 @@
  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
  *
  *</LicenseText>
- * 
+ *
  *~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  */
 #include <math.h>
@@ -31,8 +31,8 @@
 #include "global_defs.h"
 #include "drive_solvers.h"
 
-float global_fvdot();
-float vnorm_nonnewt();
+double global_vdot();
+double vnorm_nonnewt();
 
 
 /************************************************************/
@@ -62,9 +62,6 @@
   void velocities_conform_bcs();
   void assemble_forces();
   void sphere_harmonics_layer();
-  double global_vdot(),kineticE_radial();
-  float global_fvdot();
-  float vnorm_nonnewt();
   void get_system_viscosity();
 
   float vmag;
@@ -72,7 +69,7 @@
   double Udot_mag, dUdot_mag;
   int m,count,i,j,k;
 
-  float *oldU[NCS], *delta_U[NCS];
+  double *oldU[NCS], *delta_U[NCS];
 
   const int nno = E->lmesh.nno;
   const int nel = E->lmesh.nel;
@@ -98,8 +95,8 @@
   if (E->viscosity.SDEPV || E->viscosity.PDEPV) {
 
     for (m=1;m<=E->sphere.caps_per_proc;m++)  {
-      delta_U[m] = (float *)malloc((neq+2)*sizeof(float));
-      oldU[m] = (float *)malloc((neq+2)*sizeof(float));
+      delta_U[m] = (double *)malloc((neq+2)*sizeof(double));
+      oldU[m] = (double *)malloc((neq+2)*sizeof(double));
       for(i=0;i<=neq;i++)
 	oldU[m][i]=0.0;
     }
@@ -115,10 +112,10 @@
 	  oldU[m][i] = E->U[m][i];
 	}
 
-      Udot_mag  = sqrt(global_fvdot(E,oldU,oldU,E->mesh.levmax));
+      Udot_mag  = sqrt(global_vdot(E,oldU,oldU,E->mesh.levmax));
       dUdot_mag = vnorm_nonnewt(E,delta_U,oldU,E->mesh.levmax);
 
-	    
+
       if(E->parallel.me==0){
 	fprintf(stderr,"Stress dep. visc./plast.: DUdot = %.4e (%.4e) for iteration %d\n",
 		dUdot_mag,Udot_mag,count);
@@ -153,8 +150,6 @@
   void construct_stiffness_B_matrix();
   void velocities_conform_bcs();
   void assemble_forces_pseudo_surf();
-  float global_fvdot();
-  float vnorm_nonnewt();
   void get_system_viscosity();
   void std_timestep();
   void get_STD_freesurf(struct All_variables *, float**);
@@ -164,7 +159,7 @@
   double Udot_mag, dUdot_mag;
   int m,count,i,j,k,topo_loop;
 
-  float *oldU[NCS], *delta_U[NCS];
+  double *oldU[NCS], *delta_U[NCS];
 
   const int nno = E->lmesh.nno;
   const int nel = E->lmesh.nel;
@@ -193,8 +188,8 @@
 	  if (E->viscosity.SDEPV || E->viscosity.PDEPV) {
 
 		  for (m=1;m<=E->sphere.caps_per_proc;m++)  {
-			  delta_U[m] = (float *)malloc((neq+2)*sizeof(float));
-			  oldU[m] = (float *)malloc((neq+2)*sizeof(float));
+			  delta_U[m] = (double *)malloc((neq+2)*sizeof(double));
+			  oldU[m] = (double *)malloc((neq+2)*sizeof(double));
 			  for(i=0;i<=neq;i++)
 				  oldU[m][i]=0.0;
 		  }
@@ -210,7 +205,7 @@
 					  oldU[m][i] = E->U[m][i];
 				  }
 
-			  Udot_mag  = sqrt(global_fvdot(E,oldU,oldU,E->mesh.levmax));
+			  Udot_mag  = sqrt(global_vdot(E,oldU,oldU,E->mesh.levmax));
 			  dUdot_mag = vnorm_nonnewt(E,delta_U,oldU,E->mesh.levmax);
 
 			  if(E->parallel.me==0){
@@ -219,7 +214,7 @@
 				  fflush(E->fp);
 			  }
 
-			  if (count>50 || dUdot_mag<E->viscosity.sdepv_misfit) 
+			  if (count>50 || dUdot_mag<E->viscosity.sdepv_misfit)
 				  break;
 
 			  get_system_viscosity(E,1,E->EVI[E->mesh.levmax],E->VI[E->mesh.levmax]);

Modified: mc/3D/CitcomS/trunk/lib/Global_operations.c
===================================================================
--- mc/3D/CitcomS/trunk/lib/Global_operations.c	2007-08-10 23:43:49 UTC (rev 7802)
+++ mc/3D/CitcomS/trunk/lib/Global_operations.c	2007-08-10 23:44:58 UTC (rev 7803)
@@ -704,12 +704,12 @@
   }
 
 
-float  vnorm_nonnewt(E,dU,U,lev)
+double  vnorm_nonnewt(E,dU,U,lev)
   struct All_variables *E;
-  float **dU,**U;
+  double **dU,**U;
   int lev;
 {
- float temp1,temp2,dtemp,temp;
+ double temp1,temp2,dtemp,temp;
  int a,e,i,m,node;
  const int dims = E->mesh.nsd;
  const int ends = enodes[dims];
@@ -730,8 +730,8 @@
          }
 
 
-  MPI_Allreduce(&dtemp, &temp2,1,MPI_FLOAT,MPI_SUM,E->parallel.world);
-  MPI_Allreduce(&temp, &temp1,1,MPI_FLOAT,MPI_SUM,E->parallel.world);
+  MPI_Allreduce(&dtemp, &temp2,1,MPI_DOUBLE,MPI_SUM,E->parallel.world);
+  MPI_Allreduce(&temp, &temp1,1,MPI_DOUBLE,MPI_SUM,E->parallel.world);
 
   temp1 = sqrt(temp2/temp1);
 



More information about the cig-commits mailing list