[cig-commits] [commit] rajesh-petsc-schur: replaced all occurences of the caps_per_proc iteration variable by CPPR in Initial_temperature.c (d7e5b62)

cig_noreply at geodynamics.org cig_noreply at geodynamics.org
Wed Nov 5 19:05:28 PST 2014


Repository : https://github.com/geodynamics/citcoms

On branch  : rajesh-petsc-schur
Link       : https://github.com/geodynamics/citcoms/compare/464e1b32299b15819f93efd98d969cddb84dfe51...f97ae655a50bdbd6dac1923a3471ee4dae178fbd

>---------------------------------------------------------------

commit d7e5b6298b057a4e847babe6bb417701fb1a3d44
Author: Rajesh Kommu <rajesh.kommu at gmail.com>
Date:   Mon Sep 15 14:53:06 2014 -0700

    replaced all occurences of the caps_per_proc iteration variable by CPPR in Initial_temperature.c


>---------------------------------------------------------------

d7e5b6298b057a4e847babe6bb417701fb1a3d44
 lib/Initial_temperature.c | 68 +++++++++++++++++++++++------------------------
 1 file changed, 34 insertions(+), 34 deletions(-)

diff --git a/lib/Initial_temperature.c b/lib/Initial_temperature.c
index bb2f7f3..67ec333 100644
--- a/lib/Initial_temperature.c
+++ b/lib/Initial_temperature.c
@@ -245,10 +245,10 @@ static void debug_tic(struct All_variables *E)
   int m, j;
 
   fprintf(E->fp_out,"output_temperature\n");
-  for(m=1;m<=E->sphere.caps_per_proc;m++)        {
-    fprintf(E->fp_out,"for cap %d\n",E->sphere.capid[m]);
+  for(m=1;m<=E->sphere.caps_per_proc;m++) {
+    fprintf(E->fp_out,"for cap %d\n",E->sphere.capid[CPPR]);
     for (j=1;j<=E->lmesh.nno;j++)
-      fprintf(E->fp_out,"X = %.6e Z = %.6e Y = %.6e T[%06d] = %.6e \n",E->sx[m][1][j],E->sx[m][2][j],E->sx[m][3][j],j,E->T[m][j]);
+      fprintf(E->fp_out,"X = %.6e Z = %.6e Y = %.6e T[%06d] = %.6e \n",E->sx[CPPR][1][j],E->sx[CPPR][2][j],E->sx[CPPR][3][j],j,E->T[CPPR][j]);
   }
   fflush(E->fp_out);
 
@@ -292,7 +292,7 @@ static void read_tic_from_file(struct All_variables *E)
       }
       /* Truncate the temperature to be within (0,1). */
       /* This might not be desirable in some situations. */
-      E->T[m][i] = max(0.0,min(g,1.0));
+      E->T[CPPR][i] = max(0.0,min(g,1.0));
     }
   }
   fclose (fp);
@@ -318,8 +318,8 @@ static void linear_temperature_profile(struct All_variables *E)
             for(j=1; j<=nox;j ++)
                 for(k=1; k<=noz; k++) {
                     node = k + (j-1)*noz + (i-1)*nox*noz;
-                    r1 = E->sx[m][3][node];
-                    E->T[m][node] = E->control.TBCbotval - (E->control.TBCtopval + E->control.TBCbotval)*(r1 - E->sphere.ri)/(E->sphere.ro - E->sphere.ri);
+                    r1 = E->sx[CPPR][3][node];
+                    E->T[CPPR][node] = E->control.TBCbotval - (E->control.TBCtopval + E->control.TBCbotval)*(r1 - E->sphere.ri)/(E->sphere.ro - E->sphere.ri);
                 }
 
     return;
@@ -341,8 +341,8 @@ static void conductive_temperature_profile(struct All_variables *E)
             for(j=1; j<=nox;j ++)
                 for(k=1; k<=noz; k++) {
                     node = k + (j-1)*noz + (i-1)*nox*noz;
-                    r1 = E->sx[m][3][node];
-                    E->T[m][node] = (E->control.TBCtopval*E->sphere.ro
+                    r1 = E->sx[CPPR][3][node];
+                    E->T[CPPR][node] = (E->control.TBCtopval*E->sphere.ro
                                      - E->control.TBCbotval*E->sphere.ri)
                         / (E->sphere.ro - E->sphere.ri)
                         + (E->control.TBCbotval - E->control.TBCtopval)
@@ -360,7 +360,7 @@ static void constant_temperature_profile(struct All_variables *E, double mantle_
 
     for(m=1; m<=E->sphere.caps_per_proc; m++)
         for(i=1; i<=E->lmesh.nno; i++)
-            E->T[m][i] = mantle_temp;
+            E->T[CPPR][i] = mantle_temp;
 
     return;
 }
@@ -385,8 +385,8 @@ static void add_top_tbl(struct All_variables *E, double age_in_myrs, double mant
             for(j=1; j<=nox;j ++)
                 for(k=1; k<=noz; k++) {
                     node = k + (j-1)*noz + (i-1)*nox*noz;
-                    r1 = E->sx[m][3][node];
-                    E->T[m][node] -= dT * erfc(tmp * (E->sphere.ro - r1));
+                    r1 = E->sx[CPPR][3][node];
+                    E->T[CPPR][node] -= dT * erfc(tmp * (E->sphere.ro - r1));
                 }
 
     return;
@@ -411,8 +411,8 @@ static void add_bottom_tbl(struct All_variables *E, double age_in_myrs, double m
             for(j=1; j<=nox;j ++)
                 for(k=1; k<=noz; k++) {
                     node = k + (j-1)*noz + (i-1)*nox*noz;
-                    r1 = E->sx[m][3][node];
-                    E->T[m][node] += dT * erfc(tmp * (r1 - E->sphere.ri));
+                    r1 = E->sx[CPPR][3][node];
+                    E->T[CPPR][node] += dT * erfc(tmp * (r1 - E->sphere.ri));
                 }
 
     return;
@@ -460,10 +460,10 @@ static void add_perturbations_at_layers(struct All_variables *E)
                 for(i=1; i<=noy; i++)
                     for(j=1; j<=nox;j ++) {
                         node = k + (j-1)*noz + (i-1)*nox*noz;
-                        t1 = (E->sx[m][1][node] - E->control.theta_min) * tlen;
-                        f1 = (E->sx[m][2][node] - E->control.fi_min) * flen;
+                        t1 = (E->sx[CPPR][1][node] - E->control.theta_min) * tlen;
+                        f1 = (E->sx[CPPR][2][node] - E->control.fi_min) * flen;
 
-                        E->T[m][node] += con * cos(ll*t1) * cos(mm*f1);
+                        E->T[CPPR][node] += con * cos(ll*t1) * cos(mm*f1);
                     }
         }
         else {
@@ -473,10 +473,10 @@ static void add_perturbations_at_layers(struct All_variables *E)
                 for(i=1; i<=noy; i++)
                     for(j=1; j<=nox;j ++) {
                         node = k + (j-1)*noz + (i-1)*nox*noz;
-                        t1 = E->sx[m][1][node];
-                        f1 = E->sx[m][2][node];
+                        t1 = E->sx[CPPR][1][node];
+                        f1 = E->sx[CPPR][2][node];
 
-                        E->T[m][node] += con * modified_plgndr_a(ll,mm,t1) * cos(mm*f1);
+                        E->T[CPPR][node] += con * modified_plgndr_a(ll,mm,t1) * cos(mm*f1);
                     }
         } /* end if */
     } /* end for p */
@@ -524,11 +524,11 @@ static void add_perturbations_at_all_layers(struct All_variables *E)
                     for(j=1; j<=nox;j ++)
                         for(k=1; k<=noz; k++) {
                             node = k + (j-1)*noz + (i-1)*nox*noz;
-                            t1 = (E->sx[m][1][node] - E->control.theta_min) * tlen;
-                            f1 = (E->sx[m][2][node] - E->control.fi_min) * flen;
-                            r1 = E->sx[m][3][node];
+                            t1 = (E->sx[CPPR][1][node] - E->control.theta_min) * tlen;
+                            f1 = (E->sx[CPPR][2][node] - E->control.fi_min) * flen;
+                            r1 = E->sx[CPPR][3][node];
 
-                            E->T[m][node] += con * cos(ll*t1) * cos(mm*f1)
+                            E->T[CPPR][node] += con * cos(ll*t1) * cos(mm*f1)
                                 * sin((r1-E->sphere.ri) * rlen);
                         }
         }
@@ -540,9 +540,9 @@ static void add_perturbations_at_all_layers(struct All_variables *E)
                     for(j=1; j<=nox;j ++)
                         for(k=1; k<=noz; k++) {
                             node = k + (j-1)*noz + (i-1)*nox*noz;
-                            t1 = E->sx[m][1][node];
-                            f1 = E->sx[m][2][node];
-                            r1 = E->sx[m][3][node];
+                            t1 = E->sx[CPPR][1][node];
+                            f1 = E->sx[CPPR][2][node];
+                            r1 = E->sx[CPPR][3][node];
 
                             E->T[m][node] += con * modified_plgndr_a(ll,mm,t1)
                                 * (cos(mm*f1) + sin(mm*f1))
@@ -591,21 +591,21 @@ static void add_spherical_anomaly(struct All_variables *E)
             for(j=1; j<=nox;j ++)
                 for(k=1; k<=noz; k++) {
                     node = k + (j-1)*noz + (i-1)*nox*noz;
-		    dx[1] = E->x[m][1][node] - x_center[1];
-		    dx[2] = E->x[m][2][node] - x_center[2];
-		    dx[3] = E->x[m][3][node] - x_center[3];
+		    dx[1] = E->x[CPPR][1][node] - x_center[1];
+		    dx[2] = E->x[CPPR][2][node] - x_center[2];
+		    dx[3] = E->x[CPPR][3][node] - x_center[3];
                     distance = sqrt(dx[1]*dx[1] + dx[2]*dx[2] + dx[3]*dx[3]);
 
                     if (distance < radius){
-		      E->T[m][node] += amp * exp(-1.0*distance/radius);
+		      E->T[CPPR][node] += amp * exp(-1.0*distance/radius);
 
 		      if(E->convection.blob_bc_persist){
-			r1 = E->sx[m][3][node];
+			r1 = E->sx[CPPR][3][node];
 			if((fabs(r1 - rout) < e_4) || (fabs(r1 - rin) < e_4)){
 			  /* at bottom or top of box, assign as TBC */
-			  E->sphere.cap[m].TB[1][node]=E->T[m][node];
-			  E->sphere.cap[m].TB[2][node]=E->T[m][node];
-			  E->sphere.cap[m].TB[3][node]=E->T[m][node];
+			  E->sphere.cap[CPPR].TB[1][node]=E->T[CPPR][node];
+			  E->sphere.cap[CPPR].TB[2][node]=E->T[CPPR][node];
+			  E->sphere.cap[CPPR].TB[3][node]=E->T[CPPR][node];
 			}
 		      }
 		    }



More information about the CIG-COMMITS mailing list