[cig-commits] r15742 - mc/3D/CitcomS/trunk/lib
tan2 at geodynamics.org
tan2 at geodynamics.org
Mon Oct 5 12:05:04 PDT 2009
Author: tan2
Date: 2009-10-05 12:05:04 -0700 (Mon, 05 Oct 2009)
New Revision: 15742
Modified:
mc/3D/CitcomS/trunk/lib/Full_tracer_advection.c
mc/3D/CitcomS/trunk/lib/Tracer_setup.c
Log:
Dealing with tracers that belong to the current processor but cannot find its element.
When itracer_warning is off, the code will ignore the lost tracers. When itracer_warning is on (default), the code will abort.
Modified: mc/3D/CitcomS/trunk/lib/Full_tracer_advection.c
===================================================================
--- mc/3D/CitcomS/trunk/lib/Full_tracer_advection.c 2009-10-05 01:36:14 UTC (rev 15741)
+++ mc/3D/CitcomS/trunk/lib/Full_tracer_advection.c 2009-10-05 19:05:04 UTC (rev 15742)
@@ -2551,6 +2551,7 @@
/* */
/* This function returns the the real element for a given point. */
/* Returns -99 if not in this cap. */
+/* Returns -1 if in this cap but cannot find the element. */
/* iprevious_element, if known, is the last known element. If */
/* it is not known, input a negative number. */
@@ -2740,7 +2741,7 @@
fprintf(E->trace.fpt,"x,y,z,theta,phi,iregel %.15e %.15e %.15e %.15e %.15e %d\n",
x,y,z,theta,phi,iregel);
fflush(E->trace.fpt);
- exit(10);
+ return -1;
foundit:
Modified: mc/3D/CitcomS/trunk/lib/Tracer_setup.c
===================================================================
--- mc/3D/CitcomS/trunk/lib/Tracer_setup.c 2009-10-05 01:36:14 UTC (rev 15741)
+++ mc/3D/CitcomS/trunk/lib/Tracer_setup.c 2009-10-05 19:05:04 UTC (rev 15742)
@@ -605,10 +605,21 @@
E->trace.ielement[j][it]=iel;
- if (iel<0) {
+ if (iel == -99) {
+ /* tracer is inside other processors */
put_away_later(E,j,it);
eject_tracer(E,j,it);
it--;
+ } else if (iel == -1) {
+ /* tracer is inside this processor,
+ * but cannot find its element.
+ * Throw away the tracer. */
+
+ if (E->trace.itracer_warnings) exit(10);
+
+
+ eject_tracer(E,j,it);
+ it--;
}
} /* end tracers */
More information about the CIG-COMMITS
mailing list