[cig-commits] r18789 - mc/1D/hc/trunk
becker at geodynamics.org
becker at geodynamics.org
Wed Jul 20 16:04:59 PDT 2011
Author: becker
Date: 2011-07-20 16:04:58 -0700 (Wed, 20 Jul 2011)
New Revision: 18789
Modified:
mc/1D/hc/trunk/hc_init.c
mc/1D/hc/trunk/main.c
mc/1D/hc/trunk/make_tar
mc/1D/hc/trunk/sh_exp.c
Log:
Fixed plate velocity bug, introduced by half-finished plate velocity over time implementation.
Modified: mc/1D/hc/trunk/hc_init.c
===================================================================
--- mc/1D/hc/trunk/hc_init.c 2011-07-20 21:36:27 UTC (rev 18788)
+++ mc/1D/hc/trunk/hc_init.c 2011-07-20 23:04:58 UTC (rev 18789)
@@ -1340,6 +1340,8 @@
void hc_select_pvel(HC_PREC time, struct pvels *pvel,
struct sh_lms *p, hc_boolean verbose)
{
+ int i;
+ hc_boolean hit;
if(pvel->n == 1){
if(verbose){
fprintf(stderr,"hc_select_pvel: only one plate velocity loadeed, disregarding time argument\n");
@@ -1352,8 +1354,20 @@
sh_copy_lms((pvel->p+1),(p+1));
}else{
-
-
+ /* this wasn't implemented fully, a bit odd. i just put in some
+ simple stuff for now */
+ for(hit = FALSE,i=0;i < pvel->n;i++){
+ if(fabs(pvel->t[i]-time) < HC_EPS_PREC){
+ sh_copy_lms(pvel->p+i*2,p);
+ sh_copy_lms((pvel->p+i*2+1),(p+1));
+ hit=TRUE;
+ }
+ }
+ if(!hit){
+ fprintf(stderr,"hc_select_pvel: was searching for time %g amongs ",time);
+ for(i=0;i < pvel->n;i++)fprintf(stderr,"%g ",pvel->t[i]);
+ fprintf(stderr,"\n");
+ HC_ERROR("hc_select_pvel","interpolation not implemented yet");
+ }
}
-
}
Modified: mc/1D/hc/trunk/main.c
===================================================================
--- mc/1D/hc/trunk/main.c 2011-07-20 21:36:27 UTC (rev 18788)
+++ mc/1D/hc/trunk/main.c 2011-07-20 23:04:58 UTC (rev 18789)
@@ -52,7 +52,7 @@
struct hcs *model; /* main structure, make sure to initialize with
zeroes */
struct sh_lms *sol_spectral=NULL, *geoid = NULL; /* solution expansions */
- struct sh_lms pvel[2];
+ struct sh_lms *pvel=NULL; /* local plate velocity expansion */
int nsol,lmax,solved,i;
FILE *out;
struct hc_parameters p[1]; /* parameters */
@@ -130,6 +130,10 @@
else /* max degree is determined by the
plate velocities */
lmax = model->pvel.p[0].lmax; /* shouldn't be larger than that*/
+ /*
+ make sure we have room for the plate velocities
+ */
+ sh_allocate_and_init(&pvel,2,lmax,model->sh_type,1,p->verbose,FALSE);
/* init done */
@@ -331,6 +335,9 @@
*/
sh_free_expansion(sol_spectral,nsol);
+ /* local copies of plate velocities */
+ sh_free_expansion(pvel,2);
+ /* */
if(p->compute_geoid == 1) /* only one layer */
sh_free_expansion(geoid,1);
else if(p->compute_geoid == 2) /* all layers */
Modified: mc/1D/hc/trunk/make_tar
===================================================================
--- mc/1D/hc/trunk/make_tar 2011-07-20 21:36:27 UTC (rev 18788)
+++ mc/1D/hc/trunk/make_tar 2011-07-20 23:04:58 UTC (rev 18789)
@@ -2,7 +2,7 @@
#
# create a tar file
#
-ver=${1-1.0}
+ver=${1-1.0.1}
date=`date '+%m%d%y'`
tf=$HOME/tmp/hc-$ver.$date.tgz
Modified: mc/1D/hc/trunk/sh_exp.c
===================================================================
--- mc/1D/hc/trunk/sh_exp.c 2011-07-20 21:36:27 UTC (rev 18788)
+++ mc/1D/hc/trunk/sh_exp.c 2011-07-20 23:04:58 UTC (rev 18789)
@@ -1987,7 +1987,6 @@
/* this still needs to be fixed */
b->rick.nlat = a->rick.nlat;
b->rick.nlon = a->rick.nlon;
-
sh_aexp_equals_bexp_coeff(b,a);
}
More information about the CIG-COMMITS
mailing list