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

gurnis at geodynamics.org gurnis at geodynamics.org
Fri Sep 29 16:14:31 PDT 2006


Author: gurnis
Date: 2006-09-29 16:14:31 -0700 (Fri, 29 Sep 2006)
New Revision: 4668

Modified:
   mc/3D/CitcomS/trunk/lib/Full_read_input_from_files.c
   mc/3D/CitcomS/trunk/lib/Problem_related.c
   mc/3D/CitcomS/trunk/lib/Regional_lith_age_read_files.c
Log:
Fixed age bug in Regional. In Regional_lith_age_read_files.c,   find_age_in_MY() was not being converted to a float

Modified: mc/3D/CitcomS/trunk/lib/Full_read_input_from_files.c
===================================================================
--- mc/3D/CitcomS/trunk/lib/Full_read_input_from_files.c	2006-09-29 21:50:21 UTC (rev 4667)
+++ mc/3D/CitcomS/trunk/lib/Full_read_input_from_files.c	2006-09-29 23:14:31 UTC (rev 4668)
@@ -51,7 +51,6 @@
 
     const int dims=E->mesh.nsd;
 
-
     nox=E->mesh.nox;
     noy=E->mesh.noy;
     noz=E->mesh.noz;
@@ -74,8 +73,11 @@
       pos_age = 1;
     }
 
+    fprintf(stderr,"inside full... caps_per_proc=%d\n",E->sphere.caps_per_proc);
+
     for (m=1;m<=E->sphere.caps_per_proc;m++)  {
       cap = E->sphere.capid[m] - 1;  /* capid: 1-12 */
+      fprintf(stderr,"inside full... cap=%d\n",cap);
 
       switch (action) { /* set up files to open */
 

Modified: mc/3D/CitcomS/trunk/lib/Problem_related.c
===================================================================
--- mc/3D/CitcomS/trunk/lib/Problem_related.c	2006-09-29 21:50:21 UTC (rev 4667)
+++ mc/3D/CitcomS/trunk/lib/Problem_related.c	2006-09-29 23:14:31 UTC (rev 4668)
@@ -50,7 +50,7 @@
 {
   float find_age_in_MY();
 
-  int nn,m,i,j,k,kk,el,lev,els;
+  int nn,m,i,j,k,kk,el,lev,els,cap;
   int elx,ely,elz,e,elg,emax,gmax;
   float *VIP1,*VIP2;
 
@@ -65,6 +65,8 @@
   const int dims=E->mesh.nsd,dofs=E->mesh.dof;
   const int ends=enodes[dims];
 
+  fprintf(stderr,"inside read_mat_from_files\n");
+
   elx=E->lmesh.elx;
   elz=E->lmesh.elz;
   ely=E->lmesh.ely;
@@ -94,33 +96,38 @@
     nage=age1/1.;
     newage1=1.*nage;
 
-    sprintf(output_file,"%s%0.0f",E->control.mat_file,newage1);
-    if(E->parallel.me==0)
-      fprintf(E->fp,"%s %f %s\n","newage1",newage1,output_file);
-    fp1=fopen(output_file,"r");
-    if (fp1 == NULL) {
-      fprintf(E->fp,"(Problem_related #1) Cannot open %s\n",output_file);
-      exit(8);
-    }
+    for(m=1;m<=E->sphere.caps_per_proc;m++) {
+       cap = E->sphere.capid[m] - 1; /* capid: 1-12 */
+       fprintf(stderr,"Problem_related cap=%d\n",cap);
 
-    newage2=newage1+1.;
-    sprintf(output_file,"%s%0.0f",E->control.mat_file,newage2);
-    if(E->parallel.me==0)
-      fprintf(E->fp,"%s %f %s\n","newage2",newage2,output_file);
-    fp2=fopen(output_file,"r");
-    if (fp2 == NULL) {
-      fprintf(E->fp,"(Problem_related #2) Cannot open %s\n",output_file);
-      exit(8);
-    }
+       sprintf(output_file,"%s%0.0f.%d",E->control.mat_file,newage1,cap);
+       fprintf(E->fp,"%s %f %s\n","open mat file newage1",newage1,output_file);
+       fp1=fopen(output_file,"r");
+       if (fp1 == NULL) {
+         fprintf(E->fp,"(Problem_related #1) Cannot open %s\n",output_file);
+         exit(8);
+        }
 
+       newage2=newage1+1.;
+       sprintf(output_file,"%s%0.0f.%d",E->control.mat_file,newage2,cap);
+       fprintf(E->fp,"%s %f %s\n","open mat file newage2",newage2,output_file);
+       fp2=fopen(output_file,"r");
+       if (fp2 == NULL) {
+         fprintf(E->fp,"(Problem_related #2) Cannot open %s\n",output_file);
+         exit(8);
+       }
+    } /*end m */
+
     for(i=1;i<=gmax;i++)  {
-      fscanf(fp1,"%d %f", &nn,&(VIP1[i]));
-      fscanf(fp2,"%d %f", &nn,&(VIP2[i]));
+         fscanf(fp1,"%d %f", &nn,&(VIP1[i]));
+         fscanf(fp2,"%d %f", &nn,&(VIP2[i]));
     }
 
     fclose(fp1);
     fclose(fp2);
 
+    fprintf(stderr,"lmesh.exs=%d\n",E->lmesh.exs);
+    fprintf(stderr,"lmesh.eys=%d\n",E->lmesh.eys);
 
     for (m=1;m<=E->sphere.caps_per_proc;m++)
       for (k=1;k<=ely;k++)

Modified: mc/3D/CitcomS/trunk/lib/Regional_lith_age_read_files.c
===================================================================
--- mc/3D/CitcomS/trunk/lib/Regional_lith_age_read_files.c	2006-09-29 21:50:21 UTC (rev 4667)
+++ mc/3D/CitcomS/trunk/lib/Regional_lith_age_read_files.c	2006-09-29 23:14:31 UTC (rev 4668)
@@ -32,6 +32,8 @@
 
 void regional_lith_age_read_files(struct All_variables *E, int output)
 {
+  float find_age_in_MY();
+
   FILE *fp1, *fp2;
   float age, newage1, newage2;
   char output_file1[255],output_file2[255];



More information about the cig-commits mailing list