[cig-commits] r11176 - in mc/1D/hc/trunk: . hcplates
becker at geodynamics.org
becker at geodynamics.org
Sat Feb 16 16:11:30 PST 2008
Author: becker
Date: 2008-02-16 16:11:30 -0800 (Sat, 16 Feb 2008)
New Revision: 11176
Modified:
mc/1D/hc/trunk/ggrd_grdtrack_util.c
mc/1D/hc/trunk/ggrd_grdtrack_util.h
mc/1D/hc/trunk/ggrd_struc.h
mc/1D/hc/trunk/hcplates/Makefile
mc/1D/hc/trunk/hcplates/README
Log:
Internal modifications to structure naming definitions and such.
Modified: mc/1D/hc/trunk/ggrd_grdtrack_util.c
===================================================================
--- mc/1D/hc/trunk/ggrd_grdtrack_util.c 2008-02-16 19:45:45 UTC (rev 11175)
+++ mc/1D/hc/trunk/ggrd_grdtrack_util.c 2008-02-17 00:11:30 UTC (rev 11176)
@@ -21,6 +21,16 @@
#include <string.h>
+void ggrd_init_master(struct ggrd_master *ggrd)
+{
+ ggrd->mat_control = ggrd->mat_control_init = 0;
+ ggrd->vel_control = ggrd->vel_control_init = 0;
+ ggrd->time_hist.init = 0;
+ ggrd->temp_init.init = 0;
+ ggrd->time_hist.vstage_transition = 0.1; /* in Ma, transition */
+}
+
+
/*
wrapper
@@ -294,10 +304,8 @@
x[0] = xin;
x[1] = yin;
x[2] = 0.0;
- result = ggrd_grdtrack_interpolate(x,FALSE,g->grd,g->f,
- g->edgeinfo,
- g->mm,g->z,g->nz,
- value,verbose,
+ result = ggrd_grdtrack_interpolate(x,FALSE,g->grd,g->f,g->edgeinfo,
+ g->mm,g->z,g->nz,value,verbose,
g->loc_bcr);
return result;
}
@@ -819,19 +827,25 @@
{
FILE *in;
double ta,tb;
+ ggrd_boolean opened_file = FALSE;
if(thist->init){
fprintf(stderr,"ggrd_read_time_intervals: error: already initialized\n");
return 1;
}
ggrd_vecalloc(&thist->vtimes,3,"rti: 1");
-
+
if(read_thistory){
in = fopen(input_file,"r");
if(!in){
- fprintf(stderr,"ggrd_read_time_intervals: error: could not open file %s\n",
- input_file);
- return 2;
+ if(verbose)
+ fprintf(stderr,"ggrd_read_time_intervals: WARNING: could not open file %s\n",
+ input_file);
+ opened_file = FALSE;
+ }else{
+ opened_file = TRUE;
}
+ }
+ if(opened_file){
thist->nvtimes = thist->nvtimes3 = 0;
while(fscanf(in,"%lf %lf",&ta,&tb) == 2){
thist->vtimes[thist->nvtimes3] = ta;
@@ -870,14 +884,14 @@
}else{
/*
- only one time step
+ only one time step, or no file
*/
thist->nvtimes = 1;
thist->nvtimes3 = thist->nvtimes * 3;
*(thist->vtimes+0) = *(thist->vtimes+1) =
*(thist->vtimes+2) = thist->tmin = thist->tmax= 0.0;
if(verbose)
- fprintf(stderr,"ggrd_read_time_intervals: only one timestep\n");
+ fprintf(stderr,"ggrd_read_time_intervals: only one timestep / constant fields\n");
}
thist->called = FALSE;
thist->init = TRUE;
@@ -942,8 +956,7 @@
// not recalculate the weights
//
void ggrd_interpol_time(GGRD_CPREC time,struct ggrd_t *thist,
- int *i1,int *i2,GGRD_CPREC *f1,
- GGRD_CPREC *f2,
+ int *i1,int *i2,GGRD_CPREC *f1,GGRD_CPREC *f2,
GGRD_CPREC dxlimit)
{
@@ -1075,8 +1088,7 @@
*/
int interpolate_seafloor_ages(GGRD_CPREC xt, GGRD_CPREC xp,
- GGRD_CPREC age,
- struct ggrd_vel *v,
+ GGRD_CPREC age,struct ggrd_vel *v,
GGRD_CPREC *seafloor_age)
{
int left, right,i;
@@ -1100,7 +1112,7 @@
return -3;
}
v->sf_old_age = v->age_time[0] - 1000; /* so that we get interpolation
- factors */
+ factors */
v->sf_init = TRUE;
}
Modified: mc/1D/hc/trunk/ggrd_grdtrack_util.h
===================================================================
--- mc/1D/hc/trunk/ggrd_grdtrack_util.h 2008-02-16 19:45:45 UTC (rev 11175)
+++ mc/1D/hc/trunk/ggrd_grdtrack_util.h 2008-02-17 00:11:30 UTC (rev 11176)
@@ -52,6 +52,8 @@
moderately external
*/
+void ggrd_init_master(struct ggrd_master *);
+
int ggrd_init_thist_from_file(struct ggrd_t *,char *,ggrd_boolean ,ggrd_boolean);
int ggrd_read_vel_grids(struct ggrd_vel *, double, unsigned short, unsigned short, char *);
Modified: mc/1D/hc/trunk/ggrd_struc.h
===================================================================
--- mc/1D/hc/trunk/ggrd_struc.h 2008-02-16 19:45:45 UTC (rev 11175)
+++ mc/1D/hc/trunk/ggrd_struc.h 2008-02-17 00:11:30 UTC (rev 11176)
@@ -13,21 +13,23 @@
#endif
+#include "prem.h"
-
/*
plate tectonic stages interpolation structure
*/
-
-
struct ggrd_t{
- GGRD_CPREC *vtimes; /* times at which velocities
+ char file[1000]; /* filename */
+ GGRD_CPREC *vtimes; /* times at which velocities or materials
are specified. this will hold
+
t_left t_mid t_right
+
....
+
*/
int nvtimes,nvtimes3; /* number of times where specified,
@@ -39,6 +41,9 @@
GGRD_CPREC xllimit,xrlimit;
GGRD_CPREC f1_loc,f2_loc,time_old;
int ileft_loc,iright_loc,ntlim;
+
+ GGRD_CPREC vstage_transition;
+
unsigned char called;
};
@@ -120,5 +125,42 @@
GGRD_CPREC sf_old_age,sf_old_f1,sf_old_f2;
int sf_old_left,sf_old_right,sf_ntlim;
};
+
+
+
+struct ggrd_temp_init{
+ /*
+ for temperature init from grd files
+ */
+ int init,scale_with_prem;
+ int override_tbc,limit_trange;
+ double scale,offset;
+ char gfile[1000];
+ char dfile[1000];
+ struct ggrd_gt d[1]; /* grid structure */
+ struct prem_model prem; /* PREM model */
+};
+
+struct ggrd_master{ /* master structure */
+
+ int mat_control,mat_control_init;
+ int vel_control,vel_control_init;
+
+ char mat_file[1000];
+ char vel_file[1000];
+
+ /* grid structures */
+ struct ggrd_gt *mat; /* material grids */
+
+ /* different for velocities */
+ struct ggrd_vel *ggrd_v; /* velocity grids */
+ struct ggrd_t time_hist; /* time history structure */
+
+ /* temperature init */
+ struct ggrd_temp_init temp_init;
+};
+
+
+
#define __GGRD_STRUC_INIT__
#endif
Modified: mc/1D/hc/trunk/hcplates/Makefile
===================================================================
--- mc/1D/hc/trunk/hcplates/Makefile 2008-02-16 19:45:45 UTC (rev 11175)
+++ mc/1D/hc/trunk/hcplates/Makefile 2008-02-17 00:11:30 UTC (rev 11176)
@@ -55,10 +55,10 @@
$(CC) -o $(BDIR)/hcplates $(LIST) $(LIBS)
$(BDIR)/hc_findplate: $(LIST2)
- $(CC) -o $(BDIR)/hc_findplate $(LIST2)
+ $(CC) -o $(BDIR)/hc_findplate $(LIST2) $(LIBS)
$(BDIR)/hc_ptrot: $(INCS2) $(LIST3)
- $(CC) -o $(BDIR)/hc_ptrot $(LIST3)
+ $(CC) -o $(BDIR)/hc_ptrot $(LIST3) $(LIBS)
$(ODIR)/%.o: %.c $(INCS)
$(CC) $(CFLAGS) $(INC_FLAGS) $(DEFINES) -c $< -o $(ODIR)/$*.o
Modified: mc/1D/hc/trunk/hcplates/README
===================================================================
--- mc/1D/hc/trunk/hcplates/README 2008-02-16 19:45:45 UTC (rev 11175)
+++ mc/1D/hc/trunk/hcplates/README 2008-02-17 00:11:30 UTC (rev 11176)
@@ -1,11 +1,13 @@
-Routines for calculating plate velocities based on mantle flow, given pre-existing plate configurations.
-From the fortran routines of Lithgow-Bertelloni. C written by O'Neill.
-contact coneill at els.mq.edu.au with any queries.
+Routines for calculating plate velocities based on mantle flow, given
+pre-existing plate configurations. From the fortran routines of
+Lithgow-Bertelloni. C written by O'Neill. contact
+coneill at els.mq.edu.au with any queries.
To compile the code type
make all
The essential data files are:
+
-enes (contains no. plates, and no, boundary points on each plate)
-data (contains plate boundary info described by enes)
-point.j (contains the load data, ie. internal density anomalies).
@@ -13,9 +15,16 @@
All other data can be created by the routines.
The programs provided are
- hc_findplate - create a plates id file containing plate id info for each lat/long
- hc_ptrot - calculate unit rotation coefficients for use in calculating plate vels (see CRLB's papers for details)
- hcplates - calculates stage poles and surface lat/long velocity fields based flow from internal density anomalies
-Try running run_examples.mk to see if they are working ok, and for an examples on parameter usage.
-Use the -h option for details on input parameters (eg. hcplates -h)
+ hc_findplate - create a plates id file containing plate id
+ info for each lat/long
+
+ hc_ptrot - calculate unit rotation coefficients for use in
+ calculating plate vels (see CRLB's papers for details)
+
+ hcplates - calculates stage poles and surface lat/long
+ velocity fields based flow from internal density anomalies
+
+Try running run_examples.mk to see if they are working ok, and for an
+examples on parameter usage. Use the -h option for details on input
+parameters (eg. hcplates -h)
More information about the cig-commits
mailing list