[cig-commits] [commit] rajesh-petsc-schur: Changed the shapes of T and Tdot members of the All_variables struct as part of caps_per_proc removal (82c1d38)
cig_noreply at geodynamics.org
cig_noreply at geodynamics.org
Wed Nov 5 19:11:05 PST 2014
Repository : https://github.com/geodynamics/citcoms
On branch : rajesh-petsc-schur
Link : https://github.com/geodynamics/citcoms/compare/464e1b32299b15819f93efd98d969cddb84dfe51...f97ae655a50bdbd6dac1923a3471ee4dae178fbd
>---------------------------------------------------------------
commit 82c1d385cc72f24aa0ddaa8fe7d98cb371994056
Author: Rajesh Kommu <rajesh.kommu at gmail.com>
Date: Fri Sep 19 14:23:48 2014 -0700
Changed the shapes of T and Tdot members of the All_variables struct as part of caps_per_proc removal
>---------------------------------------------------------------
82c1d385cc72f24aa0ddaa8fe7d98cb371994056
lib/Advection_diffusion.c | 100 +++++++++++++++++++--------------------
lib/BC_util.c | 14 +++---
lib/Checkpoints.c | 8 ++--
lib/Composition_related.c | 4 +-
lib/Full_parallel_related.c | 28 +++++------
lib/Global_operations.c | 4 +-
lib/Initial_temperature.c | 30 ++++++------
lib/Instructions.c | 4 +-
lib/Lith_age.c | 14 +++---
lib/Mineral_physics_models.c | 8 ++--
lib/Output.c | 2 +-
lib/Output_gzdir.c | 12 ++---
lib/Output_h5.c | 2 +-
lib/Output_vtk.c | 2 +-
lib/Pan_problem_misc_functions.c | 2 +-
lib/Phase_change.c | 4 +-
lib/Process_buoyancy.c | 18 +++----
lib/Regional_parallel_related.c | 16 +++----
lib/Sphere_harmonics.c | 2 +-
lib/Viscosity_structures.c | 20 ++++----
lib/global_defs.h | 6 +--
lib/prototypes.h | 2 +-
22 files changed, 150 insertions(+), 152 deletions(-)
diff --git a/lib/Advection_diffusion.c b/lib/Advection_diffusion.c
index c27081c..ab29303 100644
--- a/lib/Advection_diffusion.c
+++ b/lib/Advection_diffusion.c
@@ -38,12 +38,12 @@
#include "parsing.h"
static void set_diffusion_timestep(struct All_variables *E);
-static void predictor(struct All_variables *E, double **field,
- double **fielddot);
-static void corrector(struct All_variables *E, double **field,
- double **fielddot, double **Dfielddot);
+static void predictor(struct All_variables *E, double *field,
+ double *fielddot);
+static void corrector(struct All_variables *E, double *field,
+ double *fielddot, double *Dfielddot);
static void pg_solver(struct All_variables *E,
- double **T, double **Tdot, double **DTdot,
+ double *T, double *Tdot, double *DTdot,
struct SOURCES *Q0,
double diff, int bc, unsigned int **FLAGS);
static void pg_shape_fn(struct All_variables *E, int el,
@@ -56,7 +56,7 @@ static void element_residual(struct All_variables *E, int el,
struct Shape_function_dx *GNx,
struct Shape_function_dA *dOmega,
float VV[4][9],
- double **field, double **fielddot,
+ double *field, double *fielddot,
struct SOURCES *Q0,
double Eres[9], double rtf[4][9],
double diff, float **BC,
@@ -100,10 +100,10 @@ void advection_diffusion_allocate_memory(struct All_variables *E)
{
int i,m;
- E->Tdot[CPPR]= (double *)malloc((E->lmesh.nno+1)*sizeof(double));
+ E->Tdot= (double *)malloc((E->lmesh.nno+1)*sizeof(double));
for(i=1;i<=E->lmesh.nno;i++)
- E->Tdot[CPPR][i]=0.0;
+ E->Tdot[i]=0.0;
}
@@ -189,20 +189,20 @@ void PG_timestep_solve(struct All_variables *E)
void assimilate_lith_conform_bcs();
int i,m,psc_pass,iredo;
double time0,time1,T_interior1;
- double *DTdot[NCS], *T1[NCS], *Tdot1[NCS];
+ double *DTdot, *T1, *Tdot1;
E->advection.timesteps++;
- DTdot[CPPR]= (double *)malloc((E->lmesh.nno+1)*sizeof(double));
+ DTdot= (double *)malloc((E->lmesh.nno+1)*sizeof(double));
if(E->advection.monitor_max_T) {
- T1[CPPR]= (double *)malloc((E->lmesh.nno+1)*sizeof(double));
- Tdot1[CPPR]= (double *)malloc((E->lmesh.nno+1)*sizeof(double));
+ T1= (double *)malloc((E->lmesh.nno+1)*sizeof(double));
+ Tdot1= (double *)malloc((E->lmesh.nno+1)*sizeof(double));
for (i=1;i<=E->lmesh.nno;i++) {
- T1[CPPR][i] = E->T[CPPR][i];
- Tdot1[CPPR][i] = E->Tdot[CPPR][i];
+ T1[i] = E->T[i];
+ Tdot1[i] = E->Tdot[i];
}
/* get the max temperature for old T */
@@ -247,8 +247,8 @@ void PG_timestep_solve(struct All_variables *E)
T_interior1, E->monitor.T_interior);
}
for (i=1;i<=E->lmesh.nno;i++) {
- E->T[CPPR][i] = T1[CPPR][i];
- E->Tdot[CPPR][i] = Tdot1[CPPR][i];
+ E->T[i] = T1[i];
+ E->Tdot[i] = Tdot1[i];
}
iredo = 1;
E->advection.dt_reduced *= 0.5;
@@ -271,11 +271,11 @@ void PG_timestep_solve(struct All_variables *E)
if (E->advection.last_sub_iterations==5)
E->control.keep_going = 0;
- free((void *) DTdot[CPPR] );
+ free((void *) DTdot );
if(E->advection.monitor_max_T) {
- free((void *) T1[CPPR] );
- free((void *) Tdot1[CPPR] );
+ free((void *) T1 );
+ free((void *) Tdot1 );
}
if(E->control.lith_age) {
@@ -312,7 +312,7 @@ static void set_diffusion_timestep(struct All_variables *E)
predictor and corrector steps.
============================== */
-static void predictor(struct All_variables *E, double **field, double **fielddot)
+static void predictor(struct All_variables *E, double *field, double *fielddot)
{
int node,m;
double multiplier;
@@ -320,14 +320,14 @@ static void predictor(struct All_variables *E, double **field, double **fielddot
multiplier = (1.0-E->advection.gamma) * E->advection.timestep;
for(node=1;node<=E->lmesh.nno;node++) {
- field[CPPR][node] += multiplier * fielddot[CPPR][node] ;
- fielddot[CPPR][node] = 0.0;
+ field[node] += multiplier * fielddot[node] ;
+ fielddot[node] = 0.0;
}
}
-static void corrector(struct All_variables *E, double **field,
- double **fielddot, double **Dfielddot)
+static void corrector(struct All_variables *E, double *field,
+ double *fielddot, double *Dfielddot)
{
int node,m;
double multiplier;
@@ -335,8 +335,8 @@ static void corrector(struct All_variables *E, double **field,
multiplier = E->advection.gamma * E->advection.timestep;
for(node=1;node<=E->lmesh.nno;node++) {
- field[CPPR][node] += multiplier * Dfielddot[CPPR][node];
- fielddot[CPPR][node] += Dfielddot[CPPR][node];
+ field[node] += multiplier * Dfielddot[node];
+ fielddot[node] += Dfielddot[node];
}
}
@@ -351,7 +351,7 @@ static void corrector(struct All_variables *E, double **field,
static void pg_solver(struct All_variables *E,
- double **T, double **Tdot, double **DTdot,
+ double *T, double *Tdot, double *DTdot,
struct SOURCES *Q0,
double diff, int bc, unsigned int **FLAGS)
{
@@ -371,7 +371,7 @@ static void pg_solver(struct All_variables *E,
const int lev=E->mesh.levmax;
for(i=1;i<=E->lmesh.nno;i++)
- DTdot[CPPR][i] = 0.0;
+ DTdot[i] = 0.0;
for(el=1;el<=E->lmesh.nel;el++) {
@@ -388,7 +388,7 @@ static void pg_solver(struct All_variables *E,
for(a=1;a<=ends;a++) {
a1 = E->ien[el].node[a];
- DTdot[CPPR][a1] += Eres[a];
+ DTdot[a1] += Eres[a];
}
} /* next element */
@@ -397,9 +397,9 @@ static void pg_solver(struct All_variables *E,
for(i=1;i<=E->lmesh.nno;i++) {
if(!(E->node[CPPR][i] & (TBX | TBY | TBZ))){
- DTdot[CPPR][i] *= E->TMass[CPPR][i]; /* lumped mass matrix */
+ DTdot[i] *= E->TMass[CPPR][i]; /* lumped mass matrix */
} else {
- DTdot[CPPR][i] = 0.0; /* lumped mass matrix */
+ DTdot[i] = 0.0; /* lumped mass matrix */
}
}
}
@@ -483,7 +483,7 @@ static void element_residual(struct All_variables *E, int el,
struct Shape_function_dx *GNx,
struct Shape_function_dA *dOmega,
float VV[4][9],
- double **field, double **fielddot,
+ double *field, double *fielddot,
struct SOURCES *Q0,
double Eres[9], double rtf[4][9],
double diff, float **BC,
@@ -526,11 +526,11 @@ static void element_residual(struct All_variables *E, int el,
for(j=1;j<=ends;j++) {
node = E->ien[el].node[j];
- T = field[CPPR][node];
+ T = field[node];
if(E->node[CPPR][node] & (TBX | TBY | TBZ))
DT=0.0;
else
- DT = fielddot[CPPR][node];
+ DT = fielddot[node];
for(i=1;i<=vpts;i++) {
dT[i] += DT * E->N.vpt[GNVINDEX(j,i)];
@@ -632,8 +632,6 @@ static void element_residual(struct All_variables *E, int el,
}
}
}
-
- return;
}
@@ -670,13 +668,13 @@ static void filter(struct All_variables *E)
/* compute sum(rho*cp*T) before filtering, skipping nodes
that's shared by another processor */
if(!(E->NODE[lev][CPPR][i] & SKIP))
- Tsum0 += E->T[CPPR][i]*rhocp[nz];
+ Tsum0 += E->T[i]*rhocp[nz];
/* remove overshoot */
- if(E->T[CPPR][i]<Tmin) Tmin=E->T[CPPR][i];
- if(E->T[CPPR][i]<Tmin0) E->T[CPPR][i]=Tmin0;
- if(E->T[CPPR][i]>Tmax) Tmax=E->T[CPPR][i];
- if(E->T[CPPR][i]>Tmax0) E->T[CPPR][i]=Tmax0;
+ if(E->T[i]<Tmin) Tmin=E->T[i];
+ if(E->T[i]<Tmin0) E->T[i]=Tmin0;
+ if(E->T[i]>Tmax) Tmax=E->T[i];
+ if(E->T[i]>Tmax0) E->T[i]=Tmax0;
}
@@ -688,15 +686,15 @@ static void filter(struct All_variables *E)
nz = ((i-1) % E->lmesh.noz) + 1;
/* remvoe undershoot */
- if(E->T[CPPR][i]<=fabs(2*Tmin0-Tmin1))
- E->T[CPPR][i]=Tmin0;
- if(E->T[CPPR][i]>=(2*Tmax0-Tmax1))
- E->T[CPPR][i]=Tmax0;
+ if(E->T[i]<=fabs(2*Tmin0-Tmin1))
+ E->T[i]=Tmin0;
+ if(E->T[i]>=(2*Tmax0-Tmax1))
+ E->T[i]=Tmax0;
/* sum(rho*cp*T) after filtering */
if (!(E->NODE[lev][CPPR][i] & SKIP)) {
- Tsum1 += E->T[CPPR][i]*rhocp[nz];
- if(E->T[CPPR][i]!=Tmin0 && E->T[CPPR][i]!=Tmax0) {
+ Tsum1 += E->T[i]*rhocp[nz];
+ if(E->T[i]!=Tmin0 && E->T[i]!=Tmax0) {
sum_rhocp += rhocp[nz];
}
}
@@ -711,8 +709,8 @@ static void filter(struct All_variables *E)
/* keep sum(rho*cp*T) the same before/after the filtering by distributing
the difference back to nodes */
for(i=1;i<=E->lmesh.nno;i++) {
- if(E->T[CPPR][i]!=Tmin0 && E->T[CPPR][i]!=Tmax0)
- E->T[CPPR][i] +=TDIST;
+ if(E->T[i]!=Tmin0 && E->T[i]!=Tmax0)
+ E->T[i] +=TDIST;
}
free(rhocp);
@@ -765,7 +763,7 @@ static void process_adi_heating(struct All_variables *E, double *heating)
for(i=1; i<=ends; i++) {
j = E->ien[e].node[i];
temp1 += E->sphere.cap[CPPR].V[3][j]
- * (E->T[CPPR][j] + E->control.surface_temp);
+ * (E->T[j] + E->control.surface_temp);
}
heating[e] = matprop * temp1 * temp2;
@@ -800,7 +798,7 @@ static void latent_heating(struct All_variables *E,
for(i=1; i<=ends; i++) {
j = E->ien[e].node[i];
temp = (1.0 - B[CPPR][j]) * B[CPPR][j]
- * (E->T[CPPR][j] + E->control.surface_temp);
+ * (E->T[j] + E->control.surface_temp);
temp2 += temp * E->sphere.cap[CPPR].V[3][j];
temp3 += temp;
}
diff --git a/lib/BC_util.c b/lib/BC_util.c
index 0e90603..69fe70e 100644
--- a/lib/BC_util.c
+++ b/lib/BC_util.c
@@ -133,25 +133,25 @@ void temperatures_conform_bcs2(E)
case 0: /* no match, next node */
break;
case TBX:
- E->T[CPPR][node] = E->sphere.cap[CPPR].TB[1][node];
+ E->T[node] = E->sphere.cap[CPPR].TB[1][node];
break;
case TBZ:
- E->T[CPPR][node] = E->sphere.cap[CPPR].TB[3][node];
+ E->T[node] = E->sphere.cap[CPPR].TB[3][node];
break;
case TBY:
- E->T[CPPR][node] = E->sphere.cap[CPPR].TB[2][node];
+ E->T[node] = E->sphere.cap[CPPR].TB[2][node];
break;
case (TBX | TBZ): /* clashes ! */
- E->T[CPPR][node] = 0.5 * (E->sphere.cap[CPPR].TB[1][node] + E->sphere.cap[CPPR].TB[3][node]);
+ E->T[node] = 0.5 * (E->sphere.cap[CPPR].TB[1][node] + E->sphere.cap[CPPR].TB[3][node]);
break;
case (TBX | TBY): /* clashes ! */
- E->T[CPPR][node] = 0.5 * (E->sphere.cap[CPPR].TB[1][node] + E->sphere.cap[CPPR].TB[2][node]);
+ E->T[node] = 0.5 * (E->sphere.cap[CPPR].TB[1][node] + E->sphere.cap[CPPR].TB[2][node]);
break;
case (TBZ | TBY): /* clashes ! */
- E->T[CPPR][node] = 0.5 * (E->sphere.cap[CPPR].TB[3][node] + E->sphere.cap[CPPR].TB[2][node]);
+ E->T[node] = 0.5 * (E->sphere.cap[CPPR].TB[3][node] + E->sphere.cap[CPPR].TB[2][node]);
break;
case (TBZ | TBY | TBX): /* clashes ! */
- E->T[CPPR][node] = 0.3333333 * (E->sphere.cap[CPPR].TB[1][node] + E->sphere.cap[CPPR].TB[2][node] + E->sphere.cap[CPPR].TB[3][node]);
+ E->T[node] = 0.3333333 * (E->sphere.cap[CPPR].TB[1][node] + E->sphere.cap[CPPR].TB[2][node] + E->sphere.cap[CPPR].TB[3][node]);
break;
}
diff --git a/lib/Checkpoints.c b/lib/Checkpoints.c
index 2b01d1d..8d0371d 100644
--- a/lib/Checkpoints.c
+++ b/lib/Checkpoints.c
@@ -399,8 +399,8 @@ static void energy_checkpoint(struct All_variables *E, FILE *fp)
write_sentinel(fp);
- fwrite(E->T[CPPR], sizeof(double), E->lmesh.nno+1, fp);
- fwrite(E->Tdot[CPPR], sizeof(double), E->lmesh.nno+1, fp);
+ fwrite(E->T, sizeof(double), E->lmesh.nno+1, fp);
+ fwrite(E->Tdot, sizeof(double), E->lmesh.nno+1, fp);
}
@@ -412,9 +412,9 @@ static void read_energy_checkpoint(struct All_variables *E, FILE *fp)
/* the 0-th element of T/Tdot is not init'd
* and won't be used when read it. */
- if(fread(E->T[CPPR], sizeof(double), E->lmesh.nno+1, fp)!= E->lmesh.nno+1)
+ if(fread(E->T, sizeof(double), E->lmesh.nno+1, fp)!= E->lmesh.nno+1)
myerror(E,"read_energy_checkpoint: error at T");
- if(fread(E->Tdot[CPPR], sizeof(double), E->lmesh.nno+1, fp)!=E->lmesh.nno+1)
+ if(fread(E->Tdot, sizeof(double), E->lmesh.nno+1, fp)!=E->lmesh.nno+1)
myerror(E,"read_energy_checkpoint: error at Tdot");
}
diff --git a/lib/Composition_related.c b/lib/Composition_related.c
index eb65981..90806b1 100644
--- a/lib/Composition_related.c
+++ b/lib/Composition_related.c
@@ -405,7 +405,7 @@ static void compute_elemental_composition_absolute_method(struct All_variables *
void map_composition_to_nodes(struct All_variables *E)
{
- double *tmp[NCS];
+ double *tmp;
int i, n, kk;
int nelem, nodenum;
int j;
@@ -437,7 +437,7 @@ void map_composition_to_nodes(struct All_variables *E)
} /* end nelem */
for(i=0;i<E->composition.ncomp;i++) {
- tmp[CPPR] = E->composition.comp_node[CPPR][i];
+ tmp = E->composition.comp_node[CPPR][i];
(E->exchange_node_d)(E,tmp,E->mesh.levmax);
}
diff --git a/lib/Full_parallel_related.c b/lib/Full_parallel_related.c
index eff5cc3..a3f6ca1 100644
--- a/lib/Full_parallel_related.c
+++ b/lib/Full_parallel_related.c
@@ -40,8 +40,8 @@
static void set_horizontal_communicator(struct All_variables*);
static void set_vertical_communicator(struct All_variables*);
-static void exchange_node_d(struct All_variables *, double**, int);
-static void exchange_node_f(struct All_variables *, float**, int);
+static void exchange_node_d(struct All_variables *, double*, int);
+static void exchange_node_f(struct All_variables *, float*, int);
/* ============================================ */
@@ -955,7 +955,7 @@ void full_exchange_id_d(E, U, lev)
/* ================================================ */
static void exchange_node_d(E, U, lev)
struct All_variables *E;
- double **U;
+ double *U;
int lev;
{
@@ -989,7 +989,7 @@ static void exchange_node_d(E, U, lev)
kk=k;
for (j=1;j<=E->parallel.NUM_NODE[lev][CPPR].pass[k];j++)
- S[kk][j-1] = U[CPPR][ E->parallel.EXCHANGE_NODE[lev][CPPR][j].pass[k] ];
+ S[kk][j-1] = U[ E->parallel.EXCHANGE_NODE[lev][CPPR][j].pass[k] ];
if (E->parallel.PROCESSOR[lev][CPPR].pass[k]!=E->parallel.me) {
if (E->parallel.PROCESSOR[lev][CPPR].pass[k]!=-1) {
@@ -1014,7 +1014,7 @@ static void exchange_node_d(E, U, lev)
else {
kk=k;
for (j=1;j<=E->parallel.NUM_NODE[lev][CPPR].pass[k];j++)
- U[CPPR][ E->parallel.EXCHANGE_NODE[lev][CPPR][j].pass[k] ] += S[kk][j-1];
+ U[ E->parallel.EXCHANGE_NODE[lev][CPPR][j].pass[k] ] += S[kk][j-1];
}
} /* for k */
@@ -1026,7 +1026,7 @@ static void exchange_node_d(E, U, lev)
if (E->parallel.PROCESSOR[lev][CPPR].pass[k]!=E->parallel.me)
if (E->parallel.PROCESSOR[lev][CPPR].pass[k]!=-1) {
for (j=1;j<=E->parallel.NUM_NODE[lev][CPPR].pass[k];j++)
- U[CPPR][ E->parallel.EXCHANGE_NODE[lev][CPPR][j].pass[k] ] += R[kk][j-1];
+ U[ E->parallel.EXCHANGE_NODE[lev][CPPR][j].pass[k] ] += R[kk][j-1];
}
}
@@ -1037,7 +1037,7 @@ static void exchange_node_d(E, U, lev)
kk = k + E->sphere.max_connections;
for (j=1;j<=E->parallel.NUM_NODE[lev][CPPR].pass[kk];j++)
- SV[jj++] = U[CPPR][ E->parallel.EXCHANGE_NODE[lev][CPPR][j].pass[kk] ];
+ SV[jj++] = U[ E->parallel.EXCHANGE_NODE[lev][CPPR][j].pass[kk] ];
MPI_Sendrecv(SV,E->parallel.NUM_NODEz[lev].pass[k],MPI_DOUBLE,
E->parallel.PROCESSORz[lev].pass[k],1,
@@ -1046,7 +1046,7 @@ static void exchange_node_d(E, U, lev)
jj = 0;
for (j=1;j<=E->parallel.NUM_NODE[lev][CPPR].pass[kk];j++)
- U[CPPR][ E->parallel.EXCHANGE_NODE[lev][CPPR][j].pass[kk] ] += RV[jj++];
+ U[ E->parallel.EXCHANGE_NODE[lev][CPPR][j].pass[kk] ] += RV[jj++];
}
kk = 0;
@@ -1065,7 +1065,7 @@ static void exchange_node_d(E, U, lev)
static void exchange_node_f(E, U, lev)
struct All_variables *E;
- float **U;
+ float *U;
int lev;
{
@@ -1100,7 +1100,7 @@ static void exchange_node_f(E, U, lev)
kk=k;
for (j=1;j<=E->parallel.NUM_NODE[lev][CPPR].pass[k];j++)
- S[kk][j-1] = U[CPPR][ E->parallel.EXCHANGE_NODE[lev][CPPR][j].pass[k] ];
+ S[kk][j-1] = U[ E->parallel.EXCHANGE_NODE[lev][CPPR][j].pass[k] ];
if (E->parallel.PROCESSOR[lev][CPPR].pass[k]!=E->parallel.me) {
if (E->parallel.PROCESSOR[lev][CPPR].pass[k]!=-1) {
@@ -1125,7 +1125,7 @@ static void exchange_node_f(E, U, lev)
else {
kk=k;
for (j=1;j<=E->parallel.NUM_NODE[lev][CPPR].pass[k];j++)
- U[CPPR][ E->parallel.EXCHANGE_NODE[lev][CPPR][j].pass[k] ] += S[kk][j-1];
+ U[ E->parallel.EXCHANGE_NODE[lev][CPPR][j].pass[k] ] += S[kk][j-1];
}
} /* for k */
@@ -1137,7 +1137,7 @@ static void exchange_node_f(E, U, lev)
if (E->parallel.PROCESSOR[lev][CPPR].pass[k]!=E->parallel.me)
if (E->parallel.PROCESSOR[lev][CPPR].pass[k]!=-1) {
for (j=1;j<=E->parallel.NUM_NODE[lev][CPPR].pass[k];j++)
- U[CPPR][ E->parallel.EXCHANGE_NODE[lev][CPPR][j].pass[k] ] += R[kk][j-1];
+ U[ E->parallel.EXCHANGE_NODE[lev][CPPR][j].pass[k] ] += R[kk][j-1];
}
}
@@ -1148,7 +1148,7 @@ static void exchange_node_f(E, U, lev)
kk = k + E->sphere.max_connections;
for (j=1;j<=E->parallel.NUM_NODE[lev][CPPR].pass[kk];j++)
- SV[jj++] = U[CPPR][ E->parallel.EXCHANGE_NODE[lev][CPPR][j].pass[kk] ];
+ SV[jj++] = U[ E->parallel.EXCHANGE_NODE[lev][CPPR][j].pass[kk] ];
MPI_Sendrecv(SV,E->parallel.NUM_NODEz[lev].pass[k],MPI_FLOAT,
E->parallel.PROCESSORz[lev].pass[k],1,
@@ -1157,7 +1157,7 @@ static void exchange_node_f(E, U, lev)
jj = 0;
for (j=1;j<=E->parallel.NUM_NODE[lev][CPPR].pass[kk];j++)
- U[CPPR][ E->parallel.EXCHANGE_NODE[lev][CPPR][j].pass[kk] ] += RV[jj++];
+ U[ E->parallel.EXCHANGE_NODE[lev][CPPR][j].pass[kk] ] += RV[jj++];
}
kk = 0;
diff --git a/lib/Global_operations.c b/lib/Global_operations.c
index fbd5154..b619123 100644
--- a/lib/Global_operations.c
+++ b/lib/Global_operations.c
@@ -708,14 +708,14 @@ float global_fmax(E,a)
double Tmaxd(E,T)
struct All_variables *E;
- double **T;
+ double *T;
{
double global_dmax(),temp,temp1;
int i,m;
temp = -10.0;
for(i=1;i<=E->lmesh.nno;i++)
- temp = max(T[CPPR][i],temp);
+ temp = max(T[i],temp);
temp1 = global_dmax(E,temp);
return (temp1);
diff --git a/lib/Initial_temperature.c b/lib/Initial_temperature.c
index d03677b..2c78b78 100644
--- a/lib/Initial_temperature.c
+++ b/lib/Initial_temperature.c
@@ -245,7 +245,7 @@ static void debug_tic(struct All_variables *E)
fprintf(E->fp_out,"output_temperature\n");
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[CPPR][1][j],E->sx[CPPR][2][j],E->sx[CPPR][3][j],j,E->T[CPPR][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[j]);
fflush(E->fp_out);
}
@@ -285,7 +285,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[CPPR][i] = max(0.0,min(g,1.0));
+ E->T[i] = max(0.0,min(g,1.0));
}
fclose (fp);
@@ -308,7 +308,7 @@ static void linear_temperature_profile(struct All_variables *E)
for(k=1; k<=noz; k++) {
node = k + (j-1)*noz + (i-1)*nox*noz;
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);
+ E->T[node] = E->control.TBCbotval - (E->control.TBCtopval + E->control.TBCbotval)*(r1 - E->sphere.ri)/(E->sphere.ro - E->sphere.ri);
}
}
@@ -328,7 +328,7 @@ static void conductive_temperature_profile(struct All_variables *E)
for(k=1; k<=noz; k++) {
node = k + (j-1)*noz + (i-1)*nox*noz;
r1 = E->sx[CPPR][3][node];
- E->T[CPPR][node] = (E->control.TBCtopval*E->sphere.ro
+ E->T[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)
@@ -343,7 +343,7 @@ static void constant_temperature_profile(struct All_variables *E, double mantle_
int m, i;
for(i=1; i<=E->lmesh.nno; i++)
- E->T[CPPR][i] = mantle_temp;
+ E->T[i] = mantle_temp;
}
@@ -366,7 +366,7 @@ static void add_top_tbl(struct All_variables *E, double age_in_myrs, double mant
for(k=1; k<=noz; k++) {
node = k + (j-1)*noz + (i-1)*nox*noz;
r1 = E->sx[CPPR][3][node];
- E->T[CPPR][node] -= dT * erfc(tmp * (E->sphere.ro - r1));
+ E->T[node] -= dT * erfc(tmp * (E->sphere.ro - r1));
}
}
@@ -389,7 +389,7 @@ static void add_bottom_tbl(struct All_variables *E, double age_in_myrs, double m
for(k=1; k<=noz; k++) {
node = k + (j-1)*noz + (i-1)*nox*noz;
r1 = E->sx[CPPR][3][node];
- E->T[CPPR][node] += dT * erfc(tmp * (r1 - E->sphere.ri));
+ E->T[node] += dT * erfc(tmp * (r1 - E->sphere.ri));
}
}
@@ -437,7 +437,7 @@ static void add_perturbations_at_layers(struct All_variables *E)
t1 = (E->sx[CPPR][1][node] - E->control.theta_min) * tlen;
f1 = (E->sx[CPPR][2][node] - E->control.fi_min) * flen;
- E->T[CPPR][node] += con * cos(ll*t1) * cos(mm*f1);
+ E->T[node] += con * cos(ll*t1) * cos(mm*f1);
}
}
else {
@@ -449,7 +449,7 @@ static void add_perturbations_at_layers(struct All_variables *E)
t1 = E->sx[CPPR][1][node];
f1 = E->sx[CPPR][2][node];
- E->T[CPPR][node] += con * modified_plgndr_a(ll,mm,t1) * cos(mm*f1);
+ E->T[node] += con * modified_plgndr_a(ll,mm,t1) * cos(mm*f1);
}
} /* end if */
} /* end for p */
@@ -498,7 +498,7 @@ static void add_perturbations_at_all_layers(struct All_variables *E)
f1 = (E->sx[CPPR][2][node] - E->control.fi_min) * flen;
r1 = E->sx[CPPR][3][node];
- E->T[CPPR][node] += con * cos(ll*t1) * cos(mm*f1)
+ E->T[node] += con * cos(ll*t1) * cos(mm*f1)
* sin((r1-E->sphere.ri) * rlen);
}
}
@@ -513,7 +513,7 @@ static void add_perturbations_at_all_layers(struct All_variables *E)
f1 = E->sx[CPPR][2][node];
r1 = E->sx[CPPR][3][node];
- E->T[CPPR][node] += con * modified_plgndr_a(ll,mm,t1)
+ E->T[node] += con * modified_plgndr_a(ll,mm,t1)
* (cos(mm*f1) + sin(mm*f1))
* sin((r1-E->sphere.ri) * rlen);
}
@@ -563,15 +563,15 @@ static void add_spherical_anomaly(struct All_variables *E)
distance = sqrt(dx[1]*dx[1] + dx[2]*dx[2] + dx[3]*dx[3]);
if (distance < radius){
- E->T[CPPR][node] += amp * exp(-1.0*distance/radius);
+ E->T[node] += amp * exp(-1.0*distance/radius);
if(E->convection.blob_bc_persist){
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[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];
+ E->sphere.cap[CPPR].TB[1][node]=E->T[node];
+ E->sphere.cap[CPPR].TB[2][node]=E->T[node];
+ E->sphere.cap[CPPR].TB[3][node]=E->T[node];
}
}
}
diff --git a/lib/Instructions.c b/lib/Instructions.c
index 4967d91..811a019 100644
--- a/lib/Instructions.c
+++ b/lib/Instructions.c
@@ -952,7 +952,7 @@ void allocate_common_vars(E)
ely = E->lmesh.ely;
E->P = (double *) malloc(npno*sizeof(double));
- E->T[CPPR] = (double *) malloc((nno+1)*sizeof(double));
+ E->T = (double *) malloc((nno+1)*sizeof(double));
E->NP[CPPR] = (float *) malloc((nno+1)*sizeof(float));
E->buoyancy[CPPR] = (double *) malloc((nno+1)*sizeof(double));
@@ -1130,7 +1130,7 @@ void allocate_common_vars(E)
E->sphere.cap[CPPR].TB[k][i] = 0.0;
for(i=1;i<=E->lmesh.nno;i++)
- E->T[CPPR][i] = 0.0;
+ E->T[i] = 0.0;
for(i=1;i<=E->lmesh.nel;i++) {
E->mat[CPPR][i]=1;
diff --git a/lib/Lith_age.c b/lib/Lith_age.c
index 80a8061..942a5cd 100644
--- a/lib/Lith_age.c
+++ b/lib/Lith_age.c
@@ -133,11 +133,11 @@ void lith_age_construct_tic(struct All_variables *E)
nodeg=E->lmesh.nxs-1+j+(E->lmesh.nys+i-2)*gnox;
node=k+(j-1)*noz+(i-1)*nox*noz;
r1=E->sx[CPPR][3][node];
- E->T[CPPR][node] = E->control.mantle_temp;
+ E->T[node] = E->control.mantle_temp;
if( r1 >= E->sphere.ro-E->control.lith_age_depth )
{ /* if closer than (lith_age_depth) from top */
temp = (E->sphere.ro-r1) *0.5 /sqrt(E->age_t[nodeg]);
- E->T[CPPR][node] = E->control.mantle_temp * erf(temp);
+ E->T[node] = E->control.mantle_temp * erf(temp);
}
}
@@ -168,9 +168,9 @@ void lith_age_update_tbc(struct All_variables *E)
r1=E->sx[CPPR][3][node];
if(fabs(r1-rout)>=e_4 && fabs(r1-rin)>=e_4) {
- 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];
+ E->sphere.cap[CPPR].TB[1][node]=E->T[node];
+ E->sphere.cap[CPPR].TB[2][node]=E->T[node];
+ E->sphere.cap[CPPR].TB[3][node]=E->T[node];
}
}
}
@@ -417,10 +417,10 @@ void assimilate_lith_conform_bcs(struct All_variables *E)
if(depth <= E->control.lith_age_depth) {
/* daf == depth_assimilation_factor */
daf = 0.5*depth/E->control.lith_age_depth;
- E->T[CPPR][node] = daf*E->T[CPPR][node] + (1.0-daf)*assimilate_new_temp;
+ E->T[node] = daf*E->T[node] + (1.0-daf)*assimilate_new_temp;
}
else
- E->T[CPPR][node] = assimilate_new_temp;
+ E->T[node] = assimilate_new_temp;
} /* end switch */
} /* next node */
diff --git a/lib/Mineral_physics_models.c b/lib/Mineral_physics_models.c
index 86c2e75..a3260b9 100644
--- a/lib/Mineral_physics_models.c
+++ b/lib/Mineral_physics_models.c
@@ -181,8 +181,8 @@ static void modified_Trampert_Vacher_Vlaar_PEPI2001(struct All_variables *E,
depthkm = malloc((E->lmesh.noz+1) * sizeof(double));
for(nz=1; nz<=E->lmesh.noz; nz++) {
- get_prem(E->sx[m][3][nz], &vpr[nz], &vsr[nz], &rhor[nz]);
- depthkm[nz] = (1.0 - E->sx[m][3][nz]) * E->data.radius_km;
+ get_prem(E->sx[CPPR][3][nz], &vpr[nz], &vsr[nz], &rhor[nz]);
+ depthkm[nz] = (1.0 - E->sx[CPPR][3][nz]) * E->data.radius_km;
}
/* deviation from the reference */
@@ -192,7 +192,7 @@ static void modified_Trampert_Vacher_Vlaar_PEPI2001(struct All_variables *E,
d = depthkm[nz];
d2 = d * d;
- dT = (E->T[m][i+1] - E->Have.T[nz]) * E->data.ref_temperature;
+ dT = (E->T[i+1] - E->Have.T[nz]) * E->data.ref_temperature;
drho = -dT * E->refstate.thermal_expansivity[nz] * E->data.therm_exp;
@@ -201,7 +201,7 @@ static void modified_Trampert_Vacher_Vlaar_PEPI2001(struct All_variables *E,
if(E->control.tracer && E->composition.on && E->composition.ichemical_buoyancy)
for(j=0; j<E->composition.ncomp; j++) {
- dC = E->composition.comp_node[m][j][i+1] - E->Have.C[j][nz];
+ dC = E->composition.comp_node[CPPR][j][i+1] - E->Have.C[j][nz];
drho += dC * E->composition.buoyancy_ratio[j]
* E->data.ref_temperature * E->data.therm_exp / E->refstate.rho[nz];
diff --git a/lib/Output.c b/lib/Output.c
index 83f62bc..7f943b6 100644
--- a/lib/Output.c
+++ b/lib/Output.c
@@ -351,7 +351,7 @@ void output_velo(struct All_variables *E, int cycles)
fprintf(fp1,"%3d %7d\n",CPPR,E->lmesh.nno);
for(i=1;i<=E->lmesh.nno;i++) {
- fprintf(fp1,"%.6e %.6e %.6e %.6e\n",E->sphere.cap[CPPR].V[1][i],E->sphere.cap[CPPR].V[2][i],E->sphere.cap[CPPR].V[3][i],E->T[CPPR][i]);
+ fprintf(fp1,"%.6e %.6e %.6e %.6e\n",E->sphere.cap[CPPR].V[1][i],E->sphere.cap[CPPR].V[2][i],E->sphere.cap[CPPR].V[3][i],E->T[i]);
}
fclose(fp1);
diff --git a/lib/Output_gzdir.c b/lib/Output_gzdir.c
index 159b506..3171519 100644
--- a/lib/Output_gzdir.c
+++ b/lib/Output_gzdir.c
@@ -521,7 +521,7 @@ void gzdir_output_velo_temp(struct All_variables *E, int cycles)
fp1 = output_open(output_file,"a");
}
for(i=1;i<=E->lmesh.nno;i++){
- cvec[0] = E->T[CPPR][i];
+ cvec[0] = E->T[i];
if(be_write_float_to_file(cvec,1,fp1)!=1)
BE_WERROR;
}
@@ -616,7 +616,7 @@ void gzdir_output_velo_temp(struct All_variables *E, int cycles)
if(E->output.gzdir.vtk_io){
/* VTK */
for(i=1;i<=E->lmesh.nno;i++)
- gzprintf(gzout,"%.6e\n",E->T[CPPR][i]);
+ gzprintf(gzout,"%.6e\n",E->T[i]);
} else {
/* old velo + T output */
if(E->output.gzdir.rnr){
@@ -627,7 +627,7 @@ void gzdir_output_velo_temp(struct All_variables *E, int cycles)
sub_netr(E->sx[CPPR][3][i],E->sx[CPPR][1][i],E->sx[CPPR][2][i],(vcorr+0),(vcorr+1),omega);
gzprintf(gzout,"%.6e %.6e %.6e %.6e\n",
vcorr[0],vcorr[1],
- E->sphere.cap[CPPR].V[3][i],E->T[CPPR][i]);
+ E->sphere.cap[CPPR].V[3][i],E->T[i]);
}
}else{
@@ -635,7 +635,7 @@ void gzdir_output_velo_temp(struct All_variables *E, int cycles)
gzprintf(gzout,"%.6e %.6e %.6e %.6e\n",
E->sphere.cap[CPPR].V[1][i],
E->sphere.cap[CPPR].V[2][i],
- E->sphere.cap[CPPR].V[3][i],E->T[CPPR][i]);
+ E->sphere.cap[CPPR].V[3][i],E->T[i]);
}
}
gzclose(gzout);
@@ -1225,7 +1225,7 @@ void restart_tic_from_gzdir_file(struct All_variables *E)
fprintf(stderr,"WARNING: found a NaN in input temperatures\n");
g=0.0;
}
- E->T[CPPR][i] = g;
+ E->T[i] = g;
}
break;
default: /* old style velo */
@@ -1238,7 +1238,7 @@ void restart_tic_from_gzdir_file(struct All_variables *E)
E->sphere.cap[m].V[1][i] = v3; */
/* I don't like that */
//E->T[m][i] = max(0.0,min(g,1.0));
- E->T[CPPR][i] = g;
+ E->T[i] = g;
}
break;
}
diff --git a/lib/Output_h5.c b/lib/Output_h5.c
index 676d028..7b5fcfb 100644
--- a/lib/Output_h5.c
+++ b/lib/Output_h5.c
@@ -543,7 +543,7 @@ void h5output_temperature(struct All_variables *E, int cycles)
{
n = k + i*nz + j*nz*nx;
m = k + j*mz + i*mz*my;
- field->data[m] = E->T[CPPR][n+1];
+ field->data[m] = E->T[n+1];
}
}
}
diff --git a/lib/Output_vtk.c b/lib/Output_vtk.c
index 3662d05..d1c6cde 100644
--- a/lib/Output_vtk.c
+++ b/lib/Output_vtk.c
@@ -112,7 +112,7 @@ static void vtk_output_temp(struct All_variables *E, FILE *fp)
fprintf(fp, " <DataArray type=\"Float32\" Name=\"temperature\" format=\"%s\">\n", E->output.vtk_format);
for(i=0;i <= nodes;i++)
- floattemp[i] = (float) *(E->T[CPPR]+i+1);
+ floattemp[i] = (float) *(E->T+i+1);
if (strcmp(E->output.vtk_format,"binary") == 0) {
write_binary_array(nodes,floattemp,fp);
diff --git a/lib/Pan_problem_misc_functions.c b/lib/Pan_problem_misc_functions.c
index 12ba811..403f83d 100644
--- a/lib/Pan_problem_misc_functions.c
+++ b/lib/Pan_problem_misc_functions.c
@@ -165,7 +165,7 @@ void get_buoyancy(struct All_variables *E, double **buoy)
* since the horizontal average of buoy will be removed.
*/
buoy[CPPR][i] = temp * E->refstate.rho[nz]
- * E->refstate.thermal_expansivity[nz] * E->T[CPPR][i];
+ * E->refstate.thermal_expansivity[nz] * E->T[i];
}
/* chemical buoyancy */
diff --git a/lib/Phase_change.c b/lib/Phase_change.c
index 02f26d9..1bd54cd 100644
--- a/lib/Phase_change.c
+++ b/lib/Phase_change.c
@@ -166,7 +166,7 @@ static void calc_phase_change(struct All_variables *E,
* 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[CPPR][i] - transT);
+ - clapeyron * (E->T[i] - transT);
B[CPPR][i] = pt5 * (one + tanh(inv_width * e_pressure));
}
@@ -193,6 +193,6 @@ static void debug_phase_change(struct All_variables *E, float **B)
fprintf(E->fp_out,"output_phase_change_buoyancy\n");
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[CPPR][3][j],E->T[CPPR][j],j,B[CPPR][j]);
+ fprintf(E->fp_out,"Z = %.6e T = %.6e B[%06d] = %.6e \n",E->sx[CPPR][3][j],E->T[j],j,B[CPPR][j]);
fflush(E->fp_out);
}
diff --git a/lib/Process_buoyancy.c b/lib/Process_buoyancy.c
index fe673fa..419c902 100644
--- a/lib/Process_buoyancy.c
+++ b/lib/Process_buoyancy.c
@@ -53,7 +53,7 @@ void heat_flux(E)
struct All_variables *E;
{
int m,e,el,i,j,node,lnode,nz;
- float *flux[NCS],*SU[NCS],*RU[NCS];
+ float *flux,*SU[NCS],*RU[NCS];
float VV[4][9],u[9],T[9],dTdz[9],rho[9],area,uT;
float *sum_h;
@@ -74,10 +74,10 @@ void heat_flux(E)
for(i=0;i<=4;i++)
sum_h[i] = 0.0;
- flux[CPPR] = (float *) malloc((1+nno)*sizeof(float));
+ flux = (float *) malloc((1+nno)*sizeof(float));
for(i=1;i<=nno;i++) {
- flux[CPPR][i] = 0.0;
+ flux[i] = 0.0;
}
for(e=1;e<=E->lmesh.nel;e++) {
@@ -93,8 +93,8 @@ void heat_flux(E)
nz = ((E->ien[e].node[j]-1) % E->lmesh.noz)+1;
rho[i] += E->refstate.rho[nz]*E->N.vpt[GNVINDEX(j,i)];
u[i] += VV[3][j]*E->N.vpt[GNVINDEX(j,i)];
- T[i] += E->T[CPPR][E->ien[e].node[j]]*E->N.vpt[GNVINDEX(j,i)];
- dTdz[i] += -E->T[CPPR][E->ien[e].node[j]]*E->gNX[CPPR][e].vpt[GNVXINDEX(2,j,i)];
+ T[i] += E->T[E->ien[e].node[j]]*E->N.vpt[GNVINDEX(j,i)];
+ dTdz[i] += -E->T[E->ien[e].node[j]]*E->gNX[CPPR][e].vpt[GNVXINDEX(2,j,i)];
}
}
@@ -108,7 +108,7 @@ void heat_flux(E)
uT /= E->eco[e].area;
for(j=1;j<=ends;j++)
- flux[CPPR][E->ien[e].node[j]] += uT*E->TWW[lev][CPPR][e].node[j];
+ flux[E->ien[e].node[j]] += uT*E->TWW[lev][CPPR][e].node[j];
} /* end of e */
@@ -116,7 +116,7 @@ void heat_flux(E)
(E->exchange_node_f)(E,flux,lev);
for(i=1;i<=nno;i++)
- flux[CPPR][i] *= E->MASS[lev][CPPR][i];
+ flux[i] *= E->MASS[lev][CPPR][i];
if (E->parallel.me_loc[3]==E->parallel.nprocz-1)
for(i=1;i<=E->lmesh.nsf;i++)
@@ -181,7 +181,7 @@ void heat_flux(E)
}
- free((void *)flux[CPPR]);
+ free((void *)flux);
free((void *)sum_h);
}
@@ -203,7 +203,7 @@ void compute_horiz_avg(struct All_variables *E)
S3[CPPR] = (float *)malloc((E->lmesh.nno+1)*sizeof(float));
for(i=1;i<=E->lmesh.nno;i++) {
- S1[CPPR][i] = E->T[CPPR][i];
+ S1[CPPR][i] = E->T[i];
S2[CPPR][i] = E->sphere.cap[CPPR].V[1][i]*E->sphere.cap[CPPR].V[1][i]
+ E->sphere.cap[CPPR].V[2][i]*E->sphere.cap[CPPR].V[2][i];
S3[CPPR][i] = E->sphere.cap[CPPR].V[3][i]*E->sphere.cap[CPPR].V[3][i];
diff --git a/lib/Regional_parallel_related.c b/lib/Regional_parallel_related.c
index f3b9b03..f237376 100644
--- a/lib/Regional_parallel_related.c
+++ b/lib/Regional_parallel_related.c
@@ -38,8 +38,8 @@
static void set_horizontal_communicator(struct All_variables*);
static void set_vertical_communicator(struct All_variables*);
-static void exchange_node_d(struct All_variables *, double**, int);
-static void exchange_node_f(struct All_variables *, float**, int);
+static void exchange_node_d(struct All_variables *, double*, int);
+static void exchange_node_f(struct All_variables *, float*, int);
/* ============================================ */
@@ -742,7 +742,7 @@ void regional_exchange_id_d(E, U, lev)
/* ================================================ */
static void exchange_node_d(E, U, lev)
struct All_variables *E;
- double **U;
+ double *U;
int lev;
{
@@ -761,7 +761,7 @@ static void exchange_node_d(E, U, lev)
for (k=1;k<=E->parallel.TNUM_PASS[lev][CPPR];k++) {
for (j=1;j<=E->parallel.NUM_NODE[lev][CPPR].pass[k];j++)
- S[k][j-1] = U[CPPR][ E->parallel.EXCHANGE_NODE[lev][CPPR][j].pass[k] ];
+ S[k][j-1] = U[ E->parallel.EXCHANGE_NODE[lev][CPPR][j].pass[k] ];
MPI_Sendrecv(S[k],E->parallel.NUM_NODE[lev][CPPR].pass[k],MPI_DOUBLE,
E->parallel.PROCESSOR[lev][CPPR].pass[k],1,
@@ -770,7 +770,7 @@ static void exchange_node_d(E, U, lev)
E->parallel.world,&status);
for (j=1;j<=E->parallel.NUM_NODE[lev][CPPR].pass[k];j++)
- U[CPPR][ E->parallel.EXCHANGE_NODE[lev][CPPR][j].pass[k] ] += R[k][j-1];
+ U[ E->parallel.EXCHANGE_NODE[lev][CPPR][j].pass[k] ] += R[k][j-1];
}
for (k=1;k<=E->parallel.TNUM_PASS[lev][CPPR];k++) {
@@ -784,7 +784,7 @@ static void exchange_node_d(E, U, lev)
static void exchange_node_f(E, U, lev)
struct All_variables *E;
- float **U;
+ float *U;
int lev;
{
@@ -804,7 +804,7 @@ static void exchange_node_f(E, U, lev)
for (k=1;k<=E->parallel.TNUM_PASS[lev][CPPR];k++) {
for (j=1;j<=E->parallel.NUM_NODE[lev][CPPR].pass[k];j++)
- S[k][j-1] = U[CPPR][ E->parallel.EXCHANGE_NODE[lev][CPPR][j].pass[k] ];
+ S[k][j-1] = U[ E->parallel.EXCHANGE_NODE[lev][CPPR][j].pass[k] ];
MPI_Sendrecv(S[k],E->parallel.NUM_NODE[lev][CPPR].pass[k],MPI_FLOAT,
E->parallel.PROCESSOR[lev][CPPR].pass[k],1,
@@ -813,7 +813,7 @@ static void exchange_node_f(E, U, lev)
E->parallel.world,&status);
for (j=1;j<=E->parallel.NUM_NODE[lev][CPPR].pass[k];j++)
- U[CPPR][ E->parallel.EXCHANGE_NODE[lev][CPPR][j].pass[k] ] += R[k][j-1];
+ U[ E->parallel.EXCHANGE_NODE[lev][CPPR][j].pass[k] ] += R[k][j-1];
}
for (k=1;k<=E->parallel.TNUM_PASS[lev][CPPR];k++) {
diff --git a/lib/Sphere_harmonics.c b/lib/Sphere_harmonics.c
index 848870d..2f99c7a 100644
--- a/lib/Sphere_harmonics.c
+++ b/lib/Sphere_harmonics.c
@@ -162,7 +162,7 @@ void debug_sphere_expansion(struct All_variables *E)
for(j=1;j<=E->lmesh.nox;j++) {
node= k + (j-1)*E->lmesh.noz + (i-1)*E->lmesh.nox*E->lmesh.noz;
p = j + (i-1)*E->lmesh.nox;
- TT[CPPR][p] = E->T[CPPR][node];
+ TT[CPPR][p] = E->T[node];
}
/* expand TT into spherical harmonics */
diff --git a/lib/Viscosity_structures.c b/lib/Viscosity_structures.c
index 44e0ed4..ffe31e3 100644
--- a/lib/Viscosity_structures.c
+++ b/lib/Viscosity_structures.c
@@ -489,7 +489,7 @@ void visc_from_T(E,EEta,propogate)
tempa = E->viscosity.N0[l]*E->VIP[CPPR][i];
for(kk=1;kk<=ends;kk++) {
- TT[kk] = E->T[CPPR][E->ien[i].node[kk]];
+ TT[kk] = E->T[E->ien[i].node[kk]];
}
for(jj=1;jj<=vpts;jj++) {
@@ -516,7 +516,7 @@ void visc_from_T(E,EEta,propogate)
tempa = E->viscosity.N0[l]*E->VIP[CPPR][i];
for(kk=1;kk<=ends;kk++) {
- TT[kk] = E->T[CPPR][E->ien[i].node[kk]];
+ TT[kk] = E->T[E->ien[i].node[kk]];
}
for(jj=1;jj<=vpts;jj++) {
@@ -546,7 +546,7 @@ void visc_from_T(E,EEta,propogate)
tempa = E->viscosity.N0[l];
for(kk=1;kk<=ends;kk++) {
- TT[kk] = E->T[CPPR][E->ien[i].node[kk]];
+ TT[kk] = E->T[E->ien[i].node[kk]];
}
for(jj=1;jj<=vpts;jj++) {
@@ -575,7 +575,7 @@ void visc_from_T(E,EEta,propogate)
tempa = E->viscosity.N0[l];
for(kk=1;kk<=ends;kk++) {
- TT[kk] = E->T[CPPR][E->ien[i].node[kk]];
+ TT[kk] = E->T[E->ien[i].node[kk]];
zz[kk] = (1.-E->sx[CPPR][3][E->ien[i].node[kk]]);
}
@@ -607,7 +607,7 @@ void visc_from_T(E,EEta,propogate)
tempa = E->viscosity.N0[l];
/* fprintf(stderr,"\nINSIDE visc_from_T, l=%d, tempa=%g",l+1,tempa);*/
for(kk=1;kk<=ends;kk++) {
- TT[kk] = E->T[CPPR][E->ien[i].node[kk]];
+ TT[kk] = E->T[E->ien[i].node[kk]];
}
for(jj=1;jj<=vpts;jj++) {
@@ -656,7 +656,7 @@ void visc_from_T(E,EEta,propogate)
tempa = E->viscosity.N0[l];
for(kk=1;kk<=ends;kk++) {
- TT[kk] = E->T[CPPR][E->ien[i].node[kk]];
+ TT[kk] = E->T[E->ien[i].node[kk]];
zz[kk] = (1.0 - E->sx[CPPR][3][E->ien[i].node[kk]]);
}
@@ -711,7 +711,7 @@ void visc_from_T(E,EEta,propogate)
tempa = E->viscosity.N0[l];
for(kk=1;kk<=ends;kk++) {
- TT[kk] = E->T[CPPR][E->ien[i].node[kk]];
+ TT[kk] = E->T[E->ien[i].node[kk]];
zz[kk] = (1.-E->sx[CPPR][3][E->ien[i].node[kk]]);
}
@@ -759,7 +759,7 @@ void visc_from_T(E,EEta,propogate)
tempa = E->viscosity.N0[l];
for(kk=1;kk<=ends;kk++) {
- TT[kk] = E->T[CPPR][E->ien[i].node[kk]];
+ TT[kk] = E->T[E->ien[i].node[kk]];
zz[kk] = E->sx[CPPR][3][E->ien[i].node[kk]]; /* radius */
}
@@ -795,7 +795,7 @@ void visc_from_T(E,EEta,propogate)
else
tempa = E->viscosity.N0[l];
for(kk=1;kk<=ends;kk++)
- TT[kk] = E->T[CPPR][E->ien[i].node[kk]];
+ TT[kk] = E->T[E->ien[i].node[kk]];
for(jj=1;jj<=vpts;jj++) {
temp=0.0;
@@ -827,7 +827,7 @@ void visc_from_T(E,EEta,propogate)
tempa = E->viscosity.N0[l];
for(kk=1;kk<=ends;kk++) {
- TT[kk] = E->T[CPPR][E->ien[i].node[kk]];
+ TT[kk] = E->T[E->ien[i].node[kk]];
zz[kk] = E->sx[CPPR][3][E->ien[i].node[kk]]; /* radius */
}
diff --git a/lib/global_defs.h b/lib/global_defs.h
index 4ff4237..c5206ca 100644
--- a/lib/global_defs.h
+++ b/lib/global_defs.h
@@ -830,7 +830,7 @@ struct All_variables {
double *heating_latent;
double *P,*F,*U;
- double *T[NCS],*Tdot[NCS],*buoyancy[NCS];
+ double *T,*Tdot,*buoyancy[NCS];
double *u1;
double *temp,*temp1;
double *Mass[NCS], *MASS[MAX_LEVELS][NCS];
@@ -908,8 +908,8 @@ struct All_variables {
void (* problem_output)(struct All_variables *, int);
/* the following function pointers are for exchanger */
- void (* exchange_node_d)(struct All_variables *, double**, int);
- void (* exchange_node_f)(struct All_variables *, float**, int);
+ void (* exchange_node_d)(struct All_variables *, double*, int);
+ void (* exchange_node_f)(struct All_variables *, float*, int);
void (* temperatures_conform_bcs)(struct All_variables *);
};
diff --git a/lib/prototypes.h b/lib/prototypes.h
index 9fe1aa3..a2870f8 100644
--- a/lib/prototypes.h
+++ b/lib/prototypes.h
@@ -212,7 +212,7 @@ float global_tdot(struct All_variables *, float **, float **, int);
float global_fmin(struct All_variables *, double);
double global_dmax(struct All_variables *, double);
float global_fmax(struct All_variables *, double);
-double Tmaxd(struct All_variables *, double **);
+double Tmaxd(struct All_variables *, double *);
float Tmax(struct All_variables *, float **);
double vnorm_nonnewt(struct All_variables *, double *, double *, int);
void sum_across_depth_sph1(struct All_variables *, float *, float *);
More information about the CIG-COMMITS
mailing list