[cig-commits] r15447 - mc/3D/CitcomS/trunk/lib
danb at geodynamics.org
danb at geodynamics.org
Thu Jul 9 13:40:10 PDT 2009
Author: danb
Date: 2009-07-09 13:40:10 -0700 (Thu, 09 Jul 2009)
New Revision: 15447
Modified:
mc/3D/CitcomS/trunk/lib/Regional_read_input_from_files.c
Log:
Second material element file only read in and processed when (pos_age) criteria met (i.e. consistent with vel b.c. approach).
Modified: mc/3D/CitcomS/trunk/lib/Regional_read_input_from_files.c
===================================================================
--- mc/3D/CitcomS/trunk/lib/Regional_read_input_from_files.c 2009-07-09 18:20:51 UTC (rev 15446)
+++ mc/3D/CitcomS/trunk/lib/Regional_read_input_from_files.c 2009-07-09 20:40:10 UTC (rev 15447)
@@ -338,22 +338,29 @@
fprintf(stderr,"Error while reading file '%s'\n",output_file1);
exit(8);
}
- if(fscanf(fp2,"%d %d %f", &nn,&(LL2[i]),&(VIP2[i])) != 3) {
- fprintf(stderr,"Error while reading file '%s'\n",output_file2);
- exit(8);
+ if (pos_age) {
+ if(fscanf(fp2,"%d %d %f", &nn,&(LL2[i]),&(VIP2[i])) != 3) {
+ fprintf(stderr,"Error while reading file '%s'\n",output_file2);
+ exit(8);
+ }
}
}
fclose(fp1);
- fclose(fp2);
+ if (pos_age) fclose(fp2);
for (k=1;k<=ely;k++) {
for (i=1;i<=elx;i++) {
for (j=1;j<=elz;j++) {
el = j + (i-1)*E->lmesh.elz + (k-1)*E->lmesh.elz*E->lmesh.elx;
elg = E->lmesh.ezs+j + (E->lmesh.exs+i-1)*E->mesh.elz + (E->lmesh.eys+k-1)*E->mesh.elz*E->mesh.elx;
+ if (pos_age) { /* positive ages - we must interpolate */
+ E->VIP[1][el] = VIP1[elg]+(VIP2[elg]-VIP1[elg])/(newage2-newage1)*(age-newage1);
+ }
+ else { /* negative ages - don't do the interpolation */
+ E->VIP[1][el] = VIP1[elg];
+ }
- E->VIP[1][el] = VIP1[elg]+(VIP2[elg]-VIP1[elg])/(newage2-newage1)*(age-newage1);
/* E->mat[1][el] = LL1[elg]; */ /*use the mat numbers base on radius*/
} /* end for j */
More information about the CIG-COMMITS
mailing list