[cig-commits] [commit] rajesh-petsc-schur: replaced all occurences of the caps_per_proc iteration variable by CPPR in Phase_change.c (7b4b3f5)
cig_noreply at geodynamics.org
cig_noreply at geodynamics.org
Tue Sep 16 16:14:01 PDT 2014
Repository : https://github.com/geodynamics/citcoms
On branch : rajesh-petsc-schur
Link : https://github.com/geodynamics/citcoms/compare/400e8500968f38074f2de7627682299fce9f86bb...1bfd8478d42e61b89bc8cfc1679ae9dcc94936f5
>---------------------------------------------------------------
commit 7b4b3f50b3c81831c69e08c842804f48e3a333cb
Author: Rajesh Kommu <rajesh.kommu at gmail.com>
Date: Tue Sep 16 09:09:28 2014 -0700
replaced all occurences of the caps_per_proc iteration variable by CPPR in Phase_change.c
>---------------------------------------------------------------
7b4b3f50b3c81831c69e08c842804f48e3a333cb
lib/Phase_change.c | 30 +++++++++++++++---------------
1 file changed, 15 insertions(+), 15 deletions(-)
diff --git a/lib/Phase_change.c b/lib/Phase_change.c
index f2e2df5..f1b2c17 100644
--- a/lib/Phase_change.c
+++ b/lib/Phase_change.c
@@ -51,12 +51,12 @@ void phase_change_allocate(struct All_variables *E)
int nsf = E->lmesh.nsf;
for (j=1;j<=E->sphere.caps_per_proc;j++) {
- E->Fas410[j] = (float *) malloc((nno+1)*sizeof(float));
- E->Fas410_b[j] = (float *) malloc((nsf+1)*sizeof(float));
- E->Fas670[j] = (float *) malloc((nno+1)*sizeof(float));
- E->Fas670_b[j] = (float *) malloc((nsf+1)*sizeof(float));
- E->Fascmb[j] = (float *) malloc((nno+1)*sizeof(float));
- E->Fascmb_b[j] = (float *) malloc((nsf+1)*sizeof(float));
+ E->Fas410[CPPR] = (float *) malloc((nno+1)*sizeof(float));
+ E->Fas410_b[CPPR] = (float *) malloc((nsf+1)*sizeof(float));
+ E->Fas670[CPPR] = (float *) malloc((nno+1)*sizeof(float));
+ E->Fas670_b[CPPR] = (float *) malloc((nsf+1)*sizeof(float));
+ E->Fascmb[CPPR] = (float *) malloc((nno+1)*sizeof(float));
+ E->Fascmb_b[CPPR] = (float *) malloc((nsf+1)*sizeof(float));
}
return;
@@ -140,7 +140,7 @@ static void phase_change_apply(struct All_variables *E, double **buoy,
calc_phase_change(E, B, B_b, Ra, clapeyron, depth, transT, inv_width);
for(m=1;m<=E->sphere.caps_per_proc;m++)
for(i=1;i<=E->lmesh.nno;i++)
- buoy[m][i] -= Ra * B[m][i];
+ buoy[CPPR][i] -= Ra * B[CPPR][i];
if (E->control.verbose) {
fprintf(E->fp_out, "Ra=%f, clapeyron=%f, depth=%f, transT=%f, inv_width=%f\n",
@@ -169,14 +169,14 @@ static void calc_phase_change(struct All_variables *E,
* phase. B is between 0 and 1. */
for(i=1;i<=E->lmesh.nno;i++) {
nz = ((i-1) % E->lmesh.noz) + 1;
- dz = (E->sphere.ro-E->sx[m][3][i]) - depth;
+ dz = (E->sphere.ro-E->sx[CPPR][3][i]) - depth;
/*XXX: dz*rho[nz]*g[nz] is only a approximation for the reduced
* pressure, a more accurate formula is:
* integral(rho(z)*g(z)*dz) from depth_ph to current depth */
e_pressure = dz * E->refstate.rho[nz] * E->refstate.gravity[nz]
- - clapeyron * (E->T[m][i] - transT);
+ - clapeyron * (E->T[CPPR][i] - transT);
- B[m][i] = pt5 * (one + tanh(inv_width * e_pressure));
+ B[CPPR][i] = pt5 * (one + tanh(inv_width * e_pressure));
}
/* compute the phase boundary, defined as the depth where B==0.5 */
@@ -184,11 +184,11 @@ static void calc_phase_change(struct All_variables *E,
for (k=1;k<=E->lmesh.noy;k++)
for (j=1;j<=E->lmesh.nox;j++) {
ns++;
- B_b[m][ns]=0.0;
+ B_b[CPPR][ns]=0.0;
for (i=1;i<E->lmesh.noz;i++) {
n = (k-1)*E->lmesh.noz*E->lmesh.nox + (j-1)*E->lmesh.noz + i;
- if (B[m][n]>=pt5 && B[m][n+1]<=pt5)
- B_b[m][ns]=(E->sx[m][3][n+1]-E->sx[m][3][n])*(pt5-B[m][n])/(B[m][n+1]-B[m][n])+E->sx[m][3][n];
+ if (B[CPPR][n]>=pt5 && B[m][n+1]<=pt5)
+ B_b[CPPR][ns]=(E->sx[CPPR][3][n+1]-E->sx[CPPR][3][n])*(pt5-B[CPPR][n])/(B[CPPR][n+1]-B[CPPR][n])+E->sx[CPPR][3][n];
}
}
}
@@ -203,9 +203,9 @@ static void debug_phase_change(struct All_variables *E, float **B)
fprintf(E->fp_out,"output_phase_change_buoyancy\n");
for(m=1;m<=E->sphere.caps_per_proc;m++) {
- fprintf(E->fp_out,"for cap %d\n",E->sphere.capid[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,"Z = %.6e T = %.6e B[%06d] = %.6e \n",E->sx[m][3][j],E->T[m][j],j,B[m][j]);
+ fprintf(E->fp_out,"Z = %.6e T = %.6e B[%06d] = %.6e \n",E->sx[CPPR][3][j],E->T[CPPR][j],j,B[CPPR][j]);
}
fflush(E->fp_out);
More information about the CIG-COMMITS
mailing list