[cig-commits] r7811 - mc/3D/CitcomS/trunk/lib
tan2 at geodynamics.org
tan2 at geodynamics.org
Mon Aug 13 14:43:35 PDT 2007
Author: tan2
Date: 2007-08-13 14:43:34 -0700 (Mon, 13 Aug 2007)
New Revision: 7811
Modified:
mc/3D/CitcomS/trunk/lib/Obsolete.c
mc/3D/CitcomS/trunk/lib/Phase_change.c
Log:
Moved obsolete functions phae_change_* from Phase_change.c to Obsolete.c and declared private functions to be static
Modified: mc/3D/CitcomS/trunk/lib/Obsolete.c
===================================================================
--- mc/3D/CitcomS/trunk/lib/Obsolete.c 2007-08-11 06:46:14 UTC (rev 7810)
+++ mc/3D/CitcomS/trunk/lib/Obsolete.c 2007-08-13 21:43:34 UTC (rev 7811)
@@ -703,6 +703,114 @@
+/* ========================================================== */
+/* From Phase_change.c */
+/* =========================================================== */
+
+
+void phase_change_410(E,B,B_b)
+ struct All_variables *E;
+ float **B,**B_b;
+{
+ int i,j,k,n,ns,m;
+ float e_pressure,pt5,one;
+
+ pt5 = 0.5; one=1.0;
+
+ for(m=1;m<=E->sphere.caps_per_proc;m++) {
+ for(i=1;i<=E->lmesh.nno;i++) {
+ e_pressure = (E->sphere.ro-E->sx[m][3][i])-E->viscosity.z410-
+ E->control.clapeyron410*(E->T[m][i]-E->control.transT410);
+
+ B[m][i] = pt5*(one+tanh(E->control.width410*e_pressure));
+ }
+
+ ns = 0;
+ for (k=1;k<=E->lmesh.noy;k++)
+ for (j=1;j<=E->lmesh.nox;j++) {
+ ns = ns + 1;
+ B_b[m][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];
+ }
+ }
+ }
+
+
+ return;
+ }
+
+
+void phase_change_670(E,B,B_b)
+ struct All_variables *E;
+ float **B,**B_b;
+{
+ int i,j,k,n,ns,m;
+ float e_pressure,pt5,one;
+
+ pt5 = 0.5; one=1.0;
+
+ for(m=1;m<=E->sphere.caps_per_proc;m++) {
+ for(i=1;i<=E->lmesh.nno;i++) {
+ e_pressure = (E->sphere.ro-E->sx[m][3][i])-E->viscosity.zlm-
+ E->control.clapeyron670*(E->T[m][i]-E->control.transT670);
+
+ B[m][i] = pt5*(one+tanh(E->control.width670*e_pressure));
+ }
+
+ ns = 0;
+ for (k=1;k<=E->lmesh.noy;k++)
+ for (j=1;j<=E->lmesh.nox;j++) {
+ ns = ns + 1;
+ B_b[m][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];
+ }
+ }
+ }
+
+
+ return;
+ }
+
+
+void phase_change_cmb(E,B,B_b)
+ struct All_variables *E;
+ float **B,**B_b;
+{
+ int i,j,k,n,ns,m;
+ float e_pressure,pt5,one;
+
+ pt5 = 0.5; one=1.0;
+
+ for(m=1;m<=E->sphere.caps_per_proc;m++) {
+ for(i=1;i<=E->lmesh.nno;i++) {
+ e_pressure = (E->sphere.ro-E->sx[m][3][i])-E->viscosity.zcmb-
+ E->control.clapeyroncmb*(E->T[m][i]-E->control.transTcmb);
+
+ B[m][i] = pt5*(one+tanh(E->control.widthcmb*e_pressure));
+ }
+
+ ns = 0;
+ for (k=1;k<=E->lmesh.noy;k++)
+ for (j=1;j<=E->lmesh.nox;j++) {
+ ns = ns + 1;
+ B_b[m][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];
+ }
+ }
+ }
+
+ return;
+}
+
/* version */
/* $Id$ */
Modified: mc/3D/CitcomS/trunk/lib/Phase_change.c
===================================================================
--- mc/3D/CitcomS/trunk/lib/Phase_change.c 2007-08-11 06:46:14 UTC (rev 7810)
+++ mc/3D/CitcomS/trunk/lib/Phase_change.c 2007-08-13 21:43:34 UTC (rev 7811)
@@ -32,17 +32,18 @@
#include "parsing.h"
#include "phase_change.h"
-void phase_change_apply(struct All_variables *E, double **buoy,
- float **B, float **B_b,
- float Ra, float clapeyron,
- float depth, float transT, float width);
-void calc_phase_change(struct All_variables *E,
- float **B, float **B_b,
- float Ra, float clapeyron,
- float depth, float transT, float width);
-void debug_phase_change(struct All_variables *E, float **B);
+static void phase_change_apply(struct All_variables *E, double **buoy,
+ float **B, float **B_b,
+ float Ra, float clapeyron,
+ float depth, float transT, float width);
+static void calc_phase_change(struct All_variables *E,
+ float **B, float **B_b,
+ float Ra, float clapeyron,
+ float depth, float transT, float width);
+static void debug_phase_change(struct All_variables *E, float **B);
+
void phase_change_allocate(struct All_variables *E)
{
int j;
@@ -129,10 +130,10 @@
}
-void phase_change_apply(struct All_variables *E, double **buoy,
- float **B, float **B_b,
- float Ra, float clapeyron,
- float depth, float transT, float width)
+static void phase_change_apply(struct All_variables *E, double **buoy,
+ float **B, float **B_b,
+ float Ra, float clapeyron,
+ float depth, float transT, float width)
{
int m, i;
@@ -152,10 +153,10 @@
}
-void calc_phase_change(struct All_variables *E,
- float **B, float **B_b,
- float Ra, float clapeyron,
- float depth, float transT, float width)
+static void calc_phase_change(struct All_variables *E,
+ float **B, float **B_b,
+ float Ra, float clapeyron,
+ float depth, float transT, float width)
{
int i,j,k,n,ns,m;
float e_pressure,pt5,one;
@@ -188,7 +189,7 @@
}
-void debug_phase_change(struct All_variables *E, float **B)
+static void debug_phase_change(struct All_variables *E, float **B)
{
int m, j;
@@ -202,110 +203,3 @@
return;
}
-
-
-
-/* The following three functions are obsolete. */
-
-void phase_change_410(E,B,B_b)
- struct All_variables *E;
- float **B,**B_b;
-{
- int i,j,k,n,ns,m;
- float e_pressure,pt5,one;
-
- pt5 = 0.5; one=1.0;
-
- for(m=1;m<=E->sphere.caps_per_proc;m++) {
- for(i=1;i<=E->lmesh.nno;i++) {
- e_pressure = (E->sphere.ro-E->sx[m][3][i])-E->viscosity.z410-
- E->control.clapeyron410*(E->T[m][i]-E->control.transT410);
-
- B[m][i] = pt5*(one+tanh(E->control.width410*e_pressure));
- }
-
- ns = 0;
- for (k=1;k<=E->lmesh.noy;k++)
- for (j=1;j<=E->lmesh.nox;j++) {
- ns = ns + 1;
- B_b[m][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];
- }
- }
- }
-
-
- return;
- }
-
-
-void phase_change_670(E,B,B_b)
- struct All_variables *E;
- float **B,**B_b;
-{
- int i,j,k,n,ns,m;
- float e_pressure,pt5,one;
-
- pt5 = 0.5; one=1.0;
-
- for(m=1;m<=E->sphere.caps_per_proc;m++) {
- for(i=1;i<=E->lmesh.nno;i++) {
- e_pressure = (E->sphere.ro-E->sx[m][3][i])-E->viscosity.zlm-
- E->control.clapeyron670*(E->T[m][i]-E->control.transT670);
-
- B[m][i] = pt5*(one+tanh(E->control.width670*e_pressure));
- }
-
- ns = 0;
- for (k=1;k<=E->lmesh.noy;k++)
- for (j=1;j<=E->lmesh.nox;j++) {
- ns = ns + 1;
- B_b[m][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];
- }
- }
- }
-
-
- return;
- }
-
-
-void phase_change_cmb(E,B,B_b)
- struct All_variables *E;
- float **B,**B_b;
-{
- int i,j,k,n,ns,m;
- float e_pressure,pt5,one;
-
- pt5 = 0.5; one=1.0;
-
- for(m=1;m<=E->sphere.caps_per_proc;m++) {
- for(i=1;i<=E->lmesh.nno;i++) {
- e_pressure = (E->sphere.ro-E->sx[m][3][i])-E->viscosity.zcmb-
- E->control.clapeyroncmb*(E->T[m][i]-E->control.transTcmb);
-
- B[m][i] = pt5*(one+tanh(E->control.widthcmb*e_pressure));
- }
-
- ns = 0;
- for (k=1;k<=E->lmesh.noy;k++)
- for (j=1;j<=E->lmesh.nox;j++) {
- ns = ns + 1;
- B_b[m][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];
- }
- }
- }
-
- return;
- }
More information about the cig-commits
mailing list