[cig-commits] r7894 - in mc/3D/CitcomS/trunk: lib module
tan2 at geodynamics.org
tan2 at geodynamics.org
Mon Aug 27 12:34:09 PDT 2007
Author: tan2
Date: 2007-08-27 12:34:08 -0700 (Mon, 27 Aug 2007)
New Revision: 7894
Modified:
mc/3D/CitcomS/trunk/lib/Advection_diffusion.c
mc/3D/CitcomS/trunk/lib/Checkpoints.c
mc/3D/CitcomS/trunk/lib/Construct_arrays.c
mc/3D/CitcomS/trunk/lib/Determine_net_rotation.c
mc/3D/CitcomS/trunk/lib/Drive_solvers.c
mc/3D/CitcomS/trunk/lib/Full_geometry_cartesian.c
mc/3D/CitcomS/trunk/lib/Full_lith_age_read_files.c
mc/3D/CitcomS/trunk/lib/Full_tracer_advection.c
mc/3D/CitcomS/trunk/lib/General_matrix_functions.c
mc/3D/CitcomS/trunk/lib/Instructions.c
mc/3D/CitcomS/trunk/lib/Lith_age.c
mc/3D/CitcomS/trunk/lib/Pan_problem_misc_functions.c
mc/3D/CitcomS/trunk/lib/Parsing.c
mc/3D/CitcomS/trunk/lib/Regional_lith_age_read_files.c
mc/3D/CitcomS/trunk/lib/Regional_sphere_related.c
mc/3D/CitcomS/trunk/lib/Regional_tracer_advection.c
mc/3D/CitcomS/trunk/lib/Regional_version_dependent.c
mc/3D/CitcomS/trunk/lib/Tracer_setup.c
mc/3D/CitcomS/trunk/lib/Viscosity_structures.c
mc/3D/CitcomS/trunk/lib/output.h
mc/3D/CitcomS/trunk/module/setProperties.c
Log:
Clean up the code and declared function prototypes to avoid compiler warnings
Modified: mc/3D/CitcomS/trunk/lib/Advection_diffusion.c
===================================================================
--- mc/3D/CitcomS/trunk/lib/Advection_diffusion.c 2007-08-27 04:43:01 UTC (rev 7893)
+++ mc/3D/CitcomS/trunk/lib/Advection_diffusion.c 2007-08-27 19:34:08 UTC (rev 7894)
@@ -200,6 +200,8 @@
double Tmaxd();
void temperatures_conform_bcs();
+ void lith_age_conform_tbc();
+ void assimilate_lith_conform_bcs();
int i,m,psc_pass,iredo;
double time0,time1,T_interior1;
double *DTdot[NCS], *T1[NCS], *Tdot1[NCS];
@@ -730,6 +732,7 @@
static void process_visc_heating(struct All_variables *E, int m,
double *heating, double *total_heating)
{
+ void strain_rate_2_inv();
int e, i;
double visc, temp;
float *strain_sqr;
@@ -802,24 +805,22 @@
int e, i, j;
const int ends = enodes[E->mesh.nsd];
- temp1 = 2.0 * width * clapeyron * Ra / E->control.Atemp;
+ temp1 = 2.0 * width * clapeyron * Ra / E->control.Atemp / ends;
for(e=1; e<=E->lmesh.nel; e++) {
temp2 = 0;
temp3 = 0;
for(i=1; i<=ends; i++) {
j = E->ien[m][e].node[i];
- temp2 += temp1 * (1.0 - B[m][j]) * B[m][j]
+ temp2 += (1.0 - B[m][j]) * B[m][j]
* E->sphere.cap[m].V[3][j] * (E->T[m][j] + E->data.surf_temp)
* E->control.disptn_number;
- temp3 += temp1 * clapeyron * (1.0 - B[m][j])
+ temp3 += clapeyron * (1.0 - B[m][j])
* B[m][j] * (E->T[m][j] + E->data.surf_temp)
* E->control.disptn_number;
}
- temp2 = temp2 / ends;
- temp3 = temp3 / ends;
- heating_adi[e] += temp2;
- heating_latent[e] += temp3;
+ heating_adi[e] += temp2 * temp1;
+ heating_latent[e] += temp3 * temp1;
}
return;
}
Modified: mc/3D/CitcomS/trunk/lib/Checkpoints.c
===================================================================
--- mc/3D/CitcomS/trunk/lib/Checkpoints.c 2007-08-27 04:43:01 UTC (rev 7893)
+++ mc/3D/CitcomS/trunk/lib/Checkpoints.c 2007-08-27 19:34:08 UTC (rev 7894)
@@ -27,6 +27,7 @@
*/
#include <sys/file.h>
+#include <unistd.h>
#include "element_definitions.h"
#include "global_defs.h"
Modified: mc/3D/CitcomS/trunk/lib/Construct_arrays.c
===================================================================
--- mc/3D/CitcomS/trunk/lib/Construct_arrays.c 2007-08-27 04:43:01 UTC (rev 7893)
+++ mc/3D/CitcomS/trunk/lib/Construct_arrays.c 2007-08-27 19:34:08 UTC (rev 7894)
@@ -30,7 +30,6 @@
#include "element_definitions.h"
#include "global_defs.h"
-int layers_r(struct All_variables *,float );
/*========================================================
Function to make the IEN array for a mesh of given
@@ -741,13 +740,46 @@
return;
}
+/* took this apart to allow call from other subroutines */
+int layers_r(E,r)
+ struct All_variables *E;
+ float r;
+{
+ float zlith, z410, zlm;
+
+ int llayers = 0;
+ zlith = E->viscosity.zlith;
+ z410 = E->viscosity.z410;
+ zlm = E->viscosity.zlm;
+
+ if (r > (E->sphere.ro-zlith))
+ llayers = 1;
+ else if ((r > (E->sphere.ro-z410))&&
+ (r <= (E->sphere.ro-zlith)))
+ llayers = 2;
+ else if ((r > (E->sphere.ro-zlm)) &&
+ (r <= (E->sphere.ro-z410)))
+ llayers = 3;
+ else
+ llayers = 4;
+ return (llayers);
+}
+
+
+int layers(E,m,node)
+ struct All_variables *E;
+ int m,node;
+{
+ return(layers_r(E,E->sx[m][3][node]));
+}
+
+
/* ==============================================================
construct array mat
============================================================== */
void construct_mat_group(E)
struct All_variables *E;
{
-
int m,i,j,k,kk,el,lev,a,nodea,els,llayer;
const int dims=E->mesh.nsd,dofs=E->mesh.dof;
@@ -768,33 +800,3 @@
}
-int layers(E,m,node)
- struct All_variables *E;
- int m,node;
-{
- return(layers_r(E,E->sx[m][3][node]));
-}
-/* took this apart to allow call from other subroutines */
-int layers_r(E,r)
- struct All_variables *E;
- float r;
-{
- float zlith, z410, zlm;
-
- int llayers = 0;
- zlith = E->viscosity.zlith;
- z410 = E->viscosity.z410;
- zlm = E->viscosity.zlm;
-
- if (r > (E->sphere.ro-zlith))
- llayers = 1;
- else if ((r > (E->sphere.ro-z410))&&
- (r <= (E->sphere.ro-zlith)))
- llayers = 2;
- else if ((r > (E->sphere.ro-zlm)) &&
- (r <= (E->sphere.ro-z410)))
- llayers = 3;
- else
- llayers = 4;
- return (llayers);
-}
Modified: mc/3D/CitcomS/trunk/lib/Determine_net_rotation.c
===================================================================
--- mc/3D/CitcomS/trunk/lib/Determine_net_rotation.c 2007-08-27 04:43:01 UTC (rev 7893)
+++ mc/3D/CitcomS/trunk/lib/Determine_net_rotation.c 2007-08-27 19:34:08 UTC (rev 7894)
@@ -26,7 +26,7 @@
*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
*/
-/*
+/*
routines to determine the net rotation velocity of the whole model
@@ -40,6 +40,7 @@
#include <math.h>
#include "element_definitions.h"
#include "global_defs.h"
+#include "parallel_related.h"
#include "parsing.h"
#include "output.h"
@@ -51,12 +52,12 @@
void *safe_malloc (size_t );
double determine_model_net_rotation(struct All_variables *,double *);
-/*
+/*
determine the mean net rotation of the velocities at all layers
-modeled after horizontal layer average routines
+modeled after horizontal layer average routines
*/
double determine_model_net_rotation(struct All_variables *E,double *omega)
@@ -73,17 +74,17 @@
elz = E->lmesh.elz;elx = E->lmesh.elx;ely = E->lmesh.ely;
elz9 = elz*9;
-
+
acoef = (double *)safe_malloc(elz9*sizeof(double));
coef = (double *)safe_malloc(elz9*sizeof(double));
lomega = (double *)safe_malloc(3*elz*sizeof(double));
for (i=1;i <= elz;i++) { /* loop through depths */
-
+
/* zero out coef for init */
determine_netr_tp(ddummy,ddummy,ddummy,ddummy,ddummy,0,(coef+(i-1)*9),&ddummy);
-
- if (i==elz)
+
+ if (i==elz)
top = 1;
else
top = 0;
@@ -118,7 +119,7 @@
lnode[2] = E->ien[m][el].node[6];
lnode[3] = E->ien[m][el].node[7];
lnode[4] = E->ien[m][el].node[8];
-
+
for(nint=1;nint<=onedvpoints[E->mesh.nsd];nint++) {
for(d=1;d<=onedvpoints[E->mesh.nsd];d++){
vtmp = E->M.vpt[GMVINDEX(d,nint)] * dGamma.vpt[GMVGAMMA(1,nint)];
@@ -137,10 +138,10 @@
/* add */
determine_netr_tp(xp[0],xp[1],xp[2],v[0],v[1],1,(coef+(i-1)*9),&ddummy);
} /* end of j and k, and m */
-
+
} /* Done for i */
- /*
- sum it all up
+ /*
+ sum it all up
*/
MPI_Allreduce(coef,acoef,elz9,MPI_DOUBLE,MPI_SUM,E->parallel.horizontal_comm);
@@ -164,9 +165,9 @@
// fprintf(stderr,"NR layer %5i (%11g - %11g, %11g): |%11g %11g %11g| = %11g\n",
// i+1,r1,r2,vtmp,lomega[i*3+0],lomega[i*3+1],lomega[i*3+2],lamp);
/* */
- for(i1=0;i1<3;i1++)
+ for(i1=0;i1<3;i1++)
omega[i1] += lomega[i*3+i1] * vtmp;
- vw += vtmp;
+ vw += vtmp;
}
for(i1=0;i1 < 3;i1++)
omega[i1] /= vw;
@@ -175,12 +176,12 @@
free ((void *) coef);
free ((void *) lomega);
-
+
oamp = sqrt(omega[0]*omega[0] + omega[1]*omega[1] + omega[2]*omega[2]);
return oamp;
}
-/*
+/*
@@ -220,11 +221,11 @@
coslon=cos(phi);
sinlat=cos(theta);
sinlon=sin(phi);
-
+
rx=coslat*coslon*r;
ry=coslat*sinlon*r;
rz=sinlat*r;
-
+
rzu=sinlat;
a = -rz*rzu*sinlon-ry*coslat;
@@ -233,7 +234,7 @@
d = -rz*sinlon;
e = -ry*rzu*coslon+rx*rzu*sinlon;
f = ry*sinlon+rx*coslon;
-
+
c9[0] += a*a+b*b;
c9[1] += a*c+b*d;
c9[2] += a*e+b*f;
@@ -275,9 +276,9 @@
}
//
-// subtract a net rotation component from a velocity
-// field given as v_theta (velt) and v_phi (velp) on
-//
+// subtract a net rotation component from a velocity
+// field given as v_theta (velt) and v_phi (velp) on
+//
void sub_netr(float r,float theta,float phi,float *velt,float *velp, double *omega)
{
@@ -294,11 +295,11 @@
ry = coslat*sinlon*r;
rz = sinlat*r;
-
+
vx = omega[1]*rz - omega[2]*ry;
vy = omega[2]*rx - omega[0]*rz;
vz = omega[0]*ry - omega[1]*rx;
-
+
tx = sinlat*coslon; /* theta basis vectors */
ty = sinlat*sinlon;
tz = -coslat;
@@ -316,7 +317,7 @@
}
-
+
//
// PROGRAM -OrbScore-: COMPARES OUTPUT FROM -SHELLS-
// WITH DATA FROM GEODETI// NETWORKS,
@@ -353,11 +354,11 @@
// OR REMOVES THIS MESSAGE OR THE COPYRIGHT MESSAGE.
// IT MAY NOT BE RESOLD FOR MORE THAN THE COST OF REPRODUCTION
// AND MAILING.
-//
+//
-/*
+/*
matrix solvers from numerical recipes
@@ -369,11 +370,11 @@
int i,imax=0,j,k;
double big,dum,sum,temp;
double vv[3];
-
+
for (i=0;i < 3;i++) {
big=0.0;
for (j=0;j < 3;j++)
- if ((temp = fabs(a[i][j])) > big)
+ if ((temp = fabs(a[i][j])) > big)
big=temp;
if (fabs(big) < 5e-15) {
fprintf(stderr,"hc_ludcmp_3x3: singular matrix in routine, big: %g\n",
@@ -388,7 +389,7 @@
for (j=0;j < 3;j++) {
for (i=0;i < j;i++) {
sum = a[i][j];
- for (k=0;k < i;k++)
+ for (k=0;k < i;k++)
sum -= a[i][k] * a[k][j];
a[i][j]=sum;
}
@@ -412,11 +413,11 @@
vv[imax]=vv[j];
}
indx[j]=imax;
- if (fabs(a[j][j]) < 5e-15)
+ if (fabs(a[j][j]) < 5e-15)
a[j][j] = NR_TINY;
if (j != 2) {
dum=1.0/(a[j][j]);
- for (i=j+1;i < 3;i++)
+ for (i=j+1;i < 3;i++)
a[i][j] *= dum;
}
}
@@ -431,15 +432,15 @@
sum = b[ip];
b[ip]=b[i];
if (ii)
- for (j=ii-1;j <= i-1;j++)
+ for (j=ii-1;j <= i-1;j++)
sum -= a[i][j]*b[j];
- else if (fabs(sum) > 5e-15)
+ else if (fabs(sum) > 5e-15)
ii = i+1;
b[i]=sum;
}
for (i=2;i>=0;i--) {
sum=b[i];
- for (j=i+1;j < 3;j++)
+ for (j=i+1;j < 3;j++)
sum -= a[i][j]*b[j];
b[i] = sum/a[i][i];
}
Modified: mc/3D/CitcomS/trunk/lib/Drive_solvers.c
===================================================================
--- mc/3D/CitcomS/trunk/lib/Drive_solvers.c 2007-08-27 04:43:01 UTC (rev 7893)
+++ mc/3D/CitcomS/trunk/lib/Drive_solvers.c 2007-08-27 19:34:08 UTC (rev 7894)
@@ -40,6 +40,7 @@
void general_stokes_solver_setup(struct All_variables *E)
{
int i, m;
+ void construct_node_maps();
if (E->control.NMULTIGRID || E->control.NASSEMBLE)
construct_node_maps(E);
Modified: mc/3D/CitcomS/trunk/lib/Full_geometry_cartesian.c
===================================================================
--- mc/3D/CitcomS/trunk/lib/Full_geometry_cartesian.c 2007-08-27 04:43:01 UTC (rev 7893)
+++ mc/3D/CitcomS/trunk/lib/Full_geometry_cartesian.c 2007-08-27 19:34:08 UTC (rev 7894)
@@ -28,9 +28,9 @@
#include <math.h>
#include "element_definitions.h"
#include "global_defs.h"
+#include "parsing.h"
-
void full_set_2dc_defaults(E)
struct All_variables *E;
{
Modified: mc/3D/CitcomS/trunk/lib/Full_lith_age_read_files.c
===================================================================
--- mc/3D/CitcomS/trunk/lib/Full_lith_age_read_files.c 2007-08-27 04:43:01 UTC (rev 7893)
+++ mc/3D/CitcomS/trunk/lib/Full_lith_age_read_files.c 2007-08-27 19:34:08 UTC (rev 7894)
@@ -1,6 +1,6 @@
/*
*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- *
+ *
*<LicenseText>
*
* CitcomS by Louis Moresi, Shijie Zhong, Lijie Han, Eh Tan,
@@ -22,7 +22,7 @@
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
*</LicenseText>
- *
+ *
*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
*/
@@ -32,6 +32,7 @@
void full_lith_age_read_files(struct All_variables *E, int output)
{
+ void full_read_input_files_for_timesteps();
full_read_input_files_for_timesteps(E,2,output); /*2 (=action) is for lith_age*/
return;
}
Modified: mc/3D/CitcomS/trunk/lib/Full_tracer_advection.c
===================================================================
--- mc/3D/CitcomS/trunk/lib/Full_tracer_advection.c 2007-08-27 04:43:01 UTC (rev 7893)
+++ mc/3D/CitcomS/trunk/lib/Full_tracer_advection.c 2007-08-27 19:34:08 UTC (rev 7894)
@@ -89,6 +89,8 @@
static void full_put_lost_tracers(struct All_variables *E,
int isend[13][13], double *send[13][13]);
void pdebug(struct All_variables *E, int i);
+int full_icheck_cap(struct All_variables *E, int icap,
+ double x, double y, double z, double rad);
@@ -392,7 +394,7 @@
isource_proc=E->parallel.me;
else
isource_proc=E->parallel.PROCESSOR[lev][j].pass[kk];
-
+
fprintf(E->trace.fpt,"%d send %d to proc %d\n",
E->parallel.me,isend[j][kk],isource_proc);
fprintf(E->trace.fpt,"%d recv %d from proc %d\n",
@@ -2497,7 +2499,7 @@
double x, double y, double z,
double theta, double phi, double rad)
{
-
+ int icheck_processor_shell();
int iregel;
int iel;
int ntheta,nphi;
Modified: mc/3D/CitcomS/trunk/lib/General_matrix_functions.c
===================================================================
--- mc/3D/CitcomS/trunk/lib/General_matrix_functions.c 2007-08-27 04:43:01 UTC (rev 7893)
+++ mc/3D/CitcomS/trunk/lib/General_matrix_functions.c 2007-08-27 19:34:08 UTC (rev 7894)
@@ -204,6 +204,8 @@
double conj_grad();
double multi_grid();
double global_vdot();
+ void record();
+ void report();
int count,counts,cycles,convergent,valid;
int i, neq, gneq,m;
Modified: mc/3D/CitcomS/trunk/lib/Instructions.c
===================================================================
--- mc/3D/CitcomS/trunk/lib/Instructions.c 2007-08-27 04:43:01 UTC (rev 7893)
+++ mc/3D/CitcomS/trunk/lib/Instructions.c 2007-08-27 19:34:08 UTC (rev 7894)
@@ -74,7 +74,10 @@
void set_sphere_harmonics (struct All_variables*);
void set_starting_age(struct All_variables*);
void tracer_initial_settings(struct All_variables*);
+void tracer_input(struct All_variables*);
+void viscosity_input(struct All_variables*);
void get_vtk_filename(char *,int,struct All_variables *,int);
+void myerror(struct All_variables *,char *);
void initial_mesh_solver_setup(struct All_variables *E)
{
Modified: mc/3D/CitcomS/trunk/lib/Lith_age.c
===================================================================
--- mc/3D/CitcomS/trunk/lib/Lith_age.c 2007-08-27 04:43:01 UTC (rev 7893)
+++ mc/3D/CitcomS/trunk/lib/Lith_age.c 2007-08-27 19:34:08 UTC (rev 7894)
@@ -110,6 +110,7 @@
int nox, noy, noz, gnox, gnoy, gnoz;
double r1, temp;
float age;
+ void temperatures_conform_bcs();
noy=E->lmesh.noy;
nox=E->lmesh.nox;
Modified: mc/3D/CitcomS/trunk/lib/Pan_problem_misc_functions.c
===================================================================
--- mc/3D/CitcomS/trunk/lib/Pan_problem_misc_functions.c 2007-08-27 04:43:01 UTC (rev 7893)
+++ mc/3D/CitcomS/trunk/lib/Pan_problem_misc_functions.c 2007-08-27 19:34:08 UTC (rev 7894)
@@ -434,6 +434,8 @@
void myerror(struct All_variables *E,char *message)
{
+ void record();
+
E->control.verbose = 1;
record(E,message);
fprintf(stderr,"node %3i: error: %s\n",
Modified: mc/3D/CitcomS/trunk/lib/Parsing.c
===================================================================
--- mc/3D/CitcomS/trunk/lib/Parsing.c 2007-08-27 04:43:01 UTC (rev 7893)
+++ mc/3D/CitcomS/trunk/lib/Parsing.c 2007-08-27 19:34:08 UTC (rev 7894)
@@ -1,6 +1,6 @@
/*
*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- *
+ *
*<LicenseText>
*
* CitcomS by Louis Moresi, Shijie Zhong, Lijie Han, Eh Tan,
@@ -22,7 +22,7 @@
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
*</LicenseText>
- *
+ *
*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
*/
/* Routines which read filenames from the command line and
@@ -36,6 +36,7 @@
#include <string.h>
#endif
#include "global_defs.h"
+#include "parsing.h"
#define MAXLINE 1024 /* max length of line in input file */
#define MAXNAME 64 /* max length of name */
@@ -85,11 +86,15 @@
int DESCRIBE = 0;
int BEGINNER = 0;
+int interpret_control_string();
+
+
void setup_parser(E,filename)
struct All_variables *E;
char *filename;
{
void unique_copy_file();
+ void add_to_parameter_list();
FILE * fp;
char *pl,*pn,*pv;
@@ -114,8 +119,8 @@
exit(11);
}
-
+
/* now the parameter file is open, read into memory */
while( fgets(line,MAXLINE,fp) != NULL )
@@ -187,12 +192,14 @@
}
-add_to_parameter_list(name,value) /* add an entry to arglist, expanding memory */
+/* add an entry to arglist, expanding memory */
+void add_to_parameter_list(name,value)
char *name, *value; /* if necessary */
{
struct arglist *alptr;
int len;
char *ptr;
+ int compute_parameter_hash_table();
/* check arglist memory */
if(NLIST >= LISTMAX)
@@ -256,7 +263,6 @@
int m;
{
- int interpret_control_string();
struct arglist *alptr;
int h, found;
char *str;
@@ -325,7 +331,7 @@
char *Default;
int m;
{
- char *sptr;
+ char *sptr;
struct arglist *alptr;
int h, hno, hyes, found;
char line[MAXLINE], *str, *noname;
@@ -378,7 +384,8 @@
int *value;
char *interpret;
int m;
-{ char *sptr;
+{
+ char *sptr;
struct arglist *alptr;
int h, hno, hyes, found;
char line[MAXLINE], *str, *noname;
Modified: mc/3D/CitcomS/trunk/lib/Regional_lith_age_read_files.c
===================================================================
--- mc/3D/CitcomS/trunk/lib/Regional_lith_age_read_files.c 2007-08-27 04:43:01 UTC (rev 7893)
+++ mc/3D/CitcomS/trunk/lib/Regional_lith_age_read_files.c 2007-08-27 19:34:08 UTC (rev 7894)
@@ -1,6 +1,6 @@
/*
*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- *
+ *
*<LicenseText>
*
* CitcomS by Louis Moresi, Shijie Zhong, Lijie Han, Eh Tan,
@@ -22,7 +22,7 @@
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
*</LicenseText>
- *
+ *
*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
*/
@@ -32,6 +32,7 @@
void regional_lith_age_read_files(struct All_variables *E, int output)
{
+ void regional_read_input_files_for_timesteps();
regional_read_input_files_for_timesteps(E,2,output); /*2 (=action) is for lith_age*/
return;
}
Modified: mc/3D/CitcomS/trunk/lib/Regional_sphere_related.c
===================================================================
--- mc/3D/CitcomS/trunk/lib/Regional_sphere_related.c 2007-08-27 04:43:01 UTC (rev 7893)
+++ mc/3D/CitcomS/trunk/lib/Regional_sphere_related.c 2007-08-27 19:34:08 UTC (rev 7894)
@@ -1,6 +1,6 @@
/*
*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- *
+ *
*<LicenseText>
*
* CitcomS by Louis Moresi, Shijie Zhong, Lijie Han, Eh Tan,
@@ -22,7 +22,7 @@
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
*</LicenseText>
- *
+ *
*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
*/
/* Functions relating to the building and use of mesh locations ... */
@@ -52,6 +52,7 @@
double dt,df;
double myatan();
void parallel_process_termination();
+ void myerror();
void even_divide_arc12();
Modified: mc/3D/CitcomS/trunk/lib/Regional_tracer_advection.c
===================================================================
--- mc/3D/CitcomS/trunk/lib/Regional_tracer_advection.c 2007-08-27 04:43:01 UTC (rev 7893)
+++ mc/3D/CitcomS/trunk/lib/Regional_tracer_advection.c 2007-08-27 19:34:08 UTC (rev 7894)
@@ -42,6 +42,7 @@
#include "element_definitions.h"
#include "global_defs.h"
#include "composition_related.h"
+#include "parallel_related.h"
static void write_trace_instructions(struct All_variables *E);
@@ -52,12 +53,16 @@
static void put_found_tracers(struct All_variables *E,
int recv_size, double *recv,
int j);
+int isearch_neighbors(double *array, int nsize,
+ double a, int hint);
+int isearch_all(double *array, int nsize, double a);
void regional_tracer_setup(struct All_variables *E)
{
char output_file[255];
+ void get_neighboring_caps();
/* Some error control */
Modified: mc/3D/CitcomS/trunk/lib/Regional_version_dependent.c
===================================================================
--- mc/3D/CitcomS/trunk/lib/Regional_version_dependent.c 2007-08-27 04:43:01 UTC (rev 7893)
+++ mc/3D/CitcomS/trunk/lib/Regional_version_dependent.c 2007-08-27 19:34:08 UTC (rev 7894)
@@ -146,6 +146,7 @@
void rotate_mesh ();
void compute_angle_surf_area ();
void parallel_process_termination();
+ void myerror();
rr = (double *) malloc((E->mesh.noz+1)*sizeof(double));
RR = (double *) malloc((E->mesh.noz+1)*sizeof(double));
@@ -161,15 +162,15 @@
fprintf(E->fp,"(Nodal_mesh.c #1) Cannot open %s\n",output_file);
exit(8);
}
-
+
fscanf(fp1,"%s %d",a,&i);
for(i=1;i<=nox;i++)
fscanf(fp1,"%d %f",&nn,&tt1);
-
+
fscanf(fp1,"%s %d",a,&i);
for(i=1;i<=noy;i++)
fscanf(fp1,"%d %f",&nn,&tt1);
-
+
fscanf(fp1,"%s %d",a,&i);
for (k=1;k<=E->mesh.noz;k++) {
fscanf(fp1,"%d %f",&nn,&tt1);
@@ -177,10 +178,10 @@
}
E->sphere.ri = rr[1];
E->sphere.ro = rr[E->mesh.noz];
-
+
fclose(fp1);
-
- } else if(E->control.coor==0) {
+
+ } else if(E->control.coor==0) {
/* default: regular node spacing */
dr = (E->sphere.ro-E->sphere.ri)/(E->mesh.noz-1);
for (k=1;k<=E->mesh.noz;k++) {
Modified: mc/3D/CitcomS/trunk/lib/Tracer_setup.c
===================================================================
--- mc/3D/CitcomS/trunk/lib/Tracer_setup.c 2007-08-27 04:43:01 UTC (rev 7893)
+++ mc/3D/CitcomS/trunk/lib/Tracer_setup.c 2007-08-27 19:34:08 UTC (rev 7894)
@@ -61,6 +61,10 @@
void allocate_tracer_arrays(struct All_variables *E,
int j, int number_of_tracers);
+int full_icheck_cap(struct All_variables *E, int icap,
+ double x, double y, double z, double rad);
+int regional_icheck_cap(struct All_variables *E, int icap,
+ double x, double y, double z, double rad);
static void find_tracers(struct All_variables *E);
static void count_tracers_of_flavors(struct All_variables *E);
@@ -82,6 +86,8 @@
void tracer_input(struct All_variables *E)
{
void full_tracer_input();
+ void myerror();
+ void report();
char message[100];
int m=E->parallel.me;
int i;
@@ -99,7 +105,7 @@
E->control.Q0,E->control.Q0ER);
report(E,message);
//
- // this check doesn't work at this point in the code, and we didn't want to put it into every call to
+ // this check doesn't work at this point in the code, and we didn't want to put it into every call to
// Advection diffusion
//
//if(E->composition.ncomp != 1)
@@ -729,7 +735,6 @@
int tracers_cap, int j)
{
void cart_to_sphere();
-
int kk;
int ival;
int number_of_tries=0;
Modified: mc/3D/CitcomS/trunk/lib/Viscosity_structures.c
===================================================================
--- mc/3D/CitcomS/trunk/lib/Viscosity_structures.c 2007-08-27 04:43:01 UTC (rev 7893)
+++ mc/3D/CitcomS/trunk/lib/Viscosity_structures.c 2007-08-27 19:34:08 UTC (rev 7894)
@@ -36,6 +36,9 @@
#include "global_defs.h"
#include "parsing.h"
+
+void myerror(struct All_variables *,char *);
+
static void apply_low_visc_wedge_channel(struct All_variables *E, float **evisc);
static void low_viscosity_channel_factor(struct All_variables *E, float *F);
static void low_viscosity_wedge_factor(struct All_variables *E, float *F);
@@ -169,8 +172,6 @@
void visc_from_C();
void apply_viscosity_smoother();
- void visc_to_node_interpolate();
- void visc_from_nodes_to_gint();
void visc_from_gint_to_nodes();
@@ -658,7 +659,7 @@
myerror(E,"sorry, CDEPV only supports two flavors");
if(E->composition.ncomp != 1)
myerror(E,"CDEPV only supports one composition yet");
-
+
for(m=1;m <= E->sphere.caps_per_proc;m++) {
for(i = 1; i <= nel; i++){
/* determine composition of each of the nodes of the
@@ -673,7 +674,7 @@
cc_loc = 0.0;
for(kk = 1; kk <= ends; kk++)
cc_loc += CC[kk] * E->N.vpt[GNVINDEX(kk, jj)];
-
+
/* geometric mean of viscosity */
vmean = exp(cc_loc * E->viscosity.cdepv_ff[1] +
(1.0-cc_loc) * E->viscosity.cdepv_ff[0]);
@@ -691,6 +692,7 @@
{
void get_global_shape_fn();
void velo_from_element();
+ void construct_c3x3matrix_el();
void get_ba_p();
struct Shape_function GN;
@@ -829,76 +831,6 @@
}
-
-void visc_to_node_interpolate(E,evisc,visc)
- struct All_variables *E;
- float **evisc,**visc;
-{
-
- /* void exchange_node_f(); */
- /* void get_global_shape_fn(); */
- /* void return_horiz_ave_f(); */
- /* void sphere_interpolate(); */
- /* void print_interpolated(); */
- /* void gather_TG_to_me0(); */
- /* void parallel_process_termination(); */
- /* int i,j,k,e,node,snode,m,nel2; */
- /* FILE *fp; */
- /* char output_file[255]; */
-
- /* float *TG,t,f,rad, Szz; */
-
- /* double time1,CPU_time0(),tww[9],rtf[4][9]; */
-
- /* struct Shape_function GN; */
- /* struct Shape_function_dA dOmega; */
- /* struct Shape_function_dx GNx; */
-
- /* const int dims=E->mesh.nsd,dofs=E->mesh.dof; */
- /* const int vpts=vpoints[dims]; */
- /* const int ppts=ppoints[dims]; */
- /* const int ends=enodes[dims]; */
- /* const int nno=E->lmesh.nno; */
- /* const int lev=E->mesh.levmax; */
-
-
- /* TG =(float *)malloc((E->sphere.nsf+1)*sizeof(float)); */
- /* for (i=E->sphere.nox;i>=1;i--) */
- /* for (j=1;j<=E->sphere.noy;j++) { */
- /* node = i + (j-1)*E->sphere.nox; */
- /* TG[node] = 0.0; */
- /* m = E->sphere.int_cap[node]; */
- /* e = E->sphere.int_ele[node]; */
-
- /* if (m>0 && e>0) { */
- /* e=e+E->lmesh.elz-1; */
- /* TG[node] = log10(evisc[m][(e-1)*vpts+1]); */
- /* } */
- /* } */
-
- /* gather_TG_to_me0(E,TG); */
-
- /* if (E->parallel.me==E->parallel.nprocz-1) { */
- /* sprintf(output_file,"%s.evisc_intp",E->control.data_file); */
- /* fp=fopen(output_file,"w"); */
-
- /* rad = 180/M_PI; */
- /* for (i=E->sphere.nox;i>=1;i--) */
- /* for (j=1;j<=E->sphere.noy;j++) { */
- /* node = i + (j-1)*E->sphere.nox; */
- /* t = 90-E->sphere.sx[1][node]*rad; */
- /* f = E->sphere.sx[2][node]*rad; */
- /* fprintf (fp,"%.3e %.3e %.4e\n",f,t,TG[node]); */
- /* } */
- /* fclose(fp); */
- /* } */
-
- /* free((void *)TG); */
-
- return;
-}
-
-
static void apply_low_visc_wedge_channel(struct All_variables *E, float **evisc)
{
void parallel_process_termination();
Modified: mc/3D/CitcomS/trunk/lib/output.h
===================================================================
--- mc/3D/CitcomS/trunk/lib/output.h 2007-08-27 04:43:01 UTC (rev 7893)
+++ mc/3D/CitcomS/trunk/lib/output.h 2007-08-27 19:34:08 UTC (rev 7894)
@@ -36,6 +36,7 @@
void output_common_input(struct All_variables *);
void output(struct All_variables *, int);
void output_time(struct All_variables *, int);
+void output_checkpoint(struct All_variables *);
FILE* output_open(char *);
Modified: mc/3D/CitcomS/trunk/module/setProperties.c
===================================================================
--- mc/3D/CitcomS/trunk/module/setProperties.c 2007-08-27 04:43:01 UTC (rev 7893)
+++ mc/3D/CitcomS/trunk/module/setProperties.c 2007-08-27 19:34:08 UTC (rev 7894)
@@ -488,6 +488,7 @@
PyObject * pyCitcom_Sphere_set_properties(PyObject *self, PyObject *args)
{
void full_set_3dsphere_defaults2(struct All_variables *);
+ void regional_set_3dsphere_defaults2(struct All_variables *);
PyObject *obj, *properties, *out;
struct All_variables *E;
@@ -575,6 +576,7 @@
struct All_variables *E;
FILE *fp;
double tmp;
+ void parallel_process_termination();
if (!PyArg_ParseTuple(args, "OOO:Tracer_set_properties",
&obj, &properties, &out))
More information about the cig-commits
mailing list