[cig-commits] r7954 - in mc/3D/CitcomS/trunk: CitcomS/Components lib module

tan2 at geodynamics.org tan2 at geodynamics.org
Wed Sep 12 12:22:06 PDT 2007


Author: tan2
Date: 2007-09-12 12:22:05 -0700 (Wed, 12 Sep 2007)
New Revision: 7954

Modified:
   mc/3D/CitcomS/trunk/CitcomS/Components/Tracer.py
   mc/3D/CitcomS/trunk/lib/Composition_related.c
   mc/3D/CitcomS/trunk/lib/Full_tracer_advection.c
   mc/3D/CitcomS/trunk/lib/Regional_tracer_advection.c
   mc/3D/CitcomS/trunk/lib/Tracer_setup.c
   mc/3D/CitcomS/trunk/module/setProperties.c
Log:
Add new input boolean parameter 'itracer_warnings'. Default to on. When it is off, the exit condition of tracer is relaxed.

Modified: mc/3D/CitcomS/trunk/CitcomS/Components/Tracer.py
===================================================================
--- mc/3D/CitcomS/trunk/CitcomS/Components/Tracer.py	2007-09-12 19:19:50 UTC (rev 7953)
+++ mc/3D/CitcomS/trunk/CitcomS/Components/Tracer.py	2007-09-12 19:22:05 UTC (rev 7954)
@@ -89,6 +89,9 @@
         ictracer_grd_file = inv.str("ictracer_grd_file", default="")
         ictracer_grd_layers = inv.int("ictracer_grd_layers", default=2)
 
+        # Warning level
+        itracer_warnings = inv.bool("itracer_warnings", default=True)
+
         # Enriched internal heat production
         tracer_enriched = inv.bool("tracer_enriched", default=False)
         Q0_enriched = inv.float("Q0_enriched", default=0.0)

Modified: mc/3D/CitcomS/trunk/lib/Composition_related.c
===================================================================
--- mc/3D/CitcomS/trunk/lib/Composition_related.c	2007-09-12 19:19:50 UTC (rev 7953)
+++ mc/3D/CitcomS/trunk/lib/Composition_related.c	2007-09-12 19:22:05 UTC (rev 7954)
@@ -250,7 +250,7 @@
             fprintf(E->trace.fpt,"WARNING(check_initial_composition)-number of tracers is REALLY LOW\n");
             fflush(E->trace.fpt);
             fprintf(stderr,"WARNING(check_initial_composition)-number of tracers is REALLY LOW\n");
-	    if (E->trace.itracer_warnings==1) exit(10);	/* made this consistent with tracer advection */
+	    if (E->trace.itracer_warnings) exit(10);	/* made this consistent with tracer advection */
         }
     }
 
@@ -299,7 +299,7 @@
             if ((1.0*iempty/E->lmesh.nel)>0.80) {
                 fprintf(E->trace.fpt,"WARNING(compute_elemental...)-number of tracers is REALLY LOW\n");
                 fflush(E->trace.fpt);
-                if (E->trace.itracer_warnings==1) exit(10);
+                if (E->trace.itracer_warnings) exit(10);
             }
         }
 

Modified: mc/3D/CitcomS/trunk/lib/Full_tracer_advection.c
===================================================================
--- mc/3D/CitcomS/trunk/lib/Full_tracer_advection.c	2007-09-12 19:19:50 UTC (rev 7953)
+++ mc/3D/CitcomS/trunk/lib/Full_tracer_advection.c	2007-09-12 19:22:05 UTC (rev 7954)
@@ -156,9 +156,6 @@
     /* This parameter specifies how close a tracer can get to the boundary */
     E->trace.box_cushion=0.00001;
 
-    /* AKMA turn this back on after debugging */
-    input_boolean("itracer_warnings",&(E->trace.itracer_warnings),"on",E->parallel.me);
-
     /* Determine number of tracer quantities */
 
     /* advection_quantites - those needed for advection */
@@ -1265,7 +1262,6 @@
     start_time=CPU_time0();
 
     if (E->parallel.me==0) fprintf(stderr,"Generating Regular Grid\n");
-    fflush(stderr);
 
 
     /* for each cap, determine theta and phi bounds, watch out near poles  */
@@ -1346,8 +1342,7 @@
                             ((1.0*numregel)/(1.0*E->lmesh.nel)) );
                     fprintf(stderr," Should reduce size of regular mesh\n");
                     fflush(E->trace.fpt);
-                    fflush(stderr);
-                    if (E->trace.itracer_warnings==1) exit(10);
+                    if (E->trace.itracer_warnings) exit(10);
                 }
 
             /* print some output */
@@ -1388,7 +1383,6 @@
 
             parallel_process_sync(E);
             if (E->parallel.me==0) fprintf(stderr,"Beginning Mapping\n");
-            fflush(stderr);
 
             /* Generate temporary arrays of max and min values for each surface element */
 
@@ -1597,7 +1591,6 @@
 
 
     if (E->parallel.me==0) fprintf(stderr,"Beginning Regtoel submapping \n");
-    fflush(stderr);
 
     /* AKMA decided it would be more efficient to have reg element choice array */
     /* rather than reg node array as used before          */
@@ -1808,7 +1801,6 @@
     parallel_process_sync(E);
 
     if (E->parallel.me==0) fprintf(stderr,"Mapping completed (%f seconds)\n",CPU_time0()-start_time);
-    fflush(stderr);
 
     /* Print out information regarding regular/real element coverage */
 
@@ -1820,8 +1812,7 @@
             fprintf(E->trace.fpt,"\n\nInformation regarding number of real elements per regular elements\n");
             fprintf(E->trace.fpt," (stats done on regular elements that were used)\n");
             fprintf(E->trace.fpt,"Ichoice is number of real elements touched by a regular element\n");
-            fprintf(E->trace.fpt,"  (ichoice=1 is optimal)\n");
-            fprintf(E->trace.fpt,"  (if ichoice=0, no elements are touched by regular element)\n");
+            fprintf(E->trace.fpt,"  (ichoice=0 is optimal)\n");
             fprintf(E->trace.fpt,"Ichoice=0: %f percent\n",(100.0*istat_ichoice[j][0])/(1.0*isum));
             fprintf(E->trace.fpt,"Ichoice=1: %f percent\n",(100.0*istat_ichoice[j][1])/(1.0*isum));
             fprintf(E->trace.fpt,"Ichoice=2: %f percent\n",(100.0*istat_ichoice[j][2])/(1.0*isum));
@@ -1931,7 +1922,6 @@
             fprintf(E->trace.fpt,"\n WARNING EXITS ARE TURNED OFF! TURN THEM ON!\n");
             fprintf(stderr,"\n WARNING EXITS ARE TURNED OFF! TURN THEM ON!\n");
             fflush(E->trace.fpt);
-            fflush(stderr);
         }
 
     write_composition_instructions(E);
@@ -2490,7 +2480,7 @@
 /********** IGET ELEMENT *****************************************/
 /*                                                               */
 /* This function returns the the real element for a given point. */
-/* Returns -99 in not in this cap.                               */
+/* Returns -99 if not in this cap.                               */
 /* iprevious_element, if known, is the last known element. If    */
 /* it is not known, input a negative number.                     */
 
@@ -2527,8 +2517,6 @@
             if (ival!=1) return -99;
         }
 
-    /* First check previous element */
-
     /* do quick search to see if element can be easily found. */
     /* note that element may still be out of this cap, but    */
     /* it is probably fast to do a quick search before        */
@@ -2662,7 +2650,7 @@
       fprintf(E->trace.fpt,"  PREVIOUS ELEMENT: %d \n",iprevious_element);
       fprintf(E->trace.fpt,"  x,y,z,theta,phi,rad: %f %f %f   %f %f %f\n",x,y,z,theta,phi,rad);
       fflush(E->trace.fpt);
-      if (E->trace.itracer_warnings==1) exit(10);
+      if (E->trace.itracer_warnings) exit(10);
     */
 
     if (E->trace.istat1%100==0)
@@ -2670,7 +2658,6 @@
             fprintf(E->trace.fpt,"Checked all elements %d times already this turn\n",E->trace.istat1);
             fprintf(stderr,"Checked all elements %d times already this turn\n",E->trace.istat1);
             fflush(E->trace.fpt);
-            fflush(stderr);
         }
     if (iel>0)
         {
@@ -2681,7 +2668,7 @@
     /* if still here, there is a problem */
 
     fprintf(E->trace.fpt,"Error(full_iget_element) - element not found\n");
-    fprintf(E->trace.fpt,"x,y,z,theta,phi,iregel %f %f %f %f %f %d\n",
+    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);
@@ -2810,7 +2797,6 @@
     double theta_f,phi_f;
 
     if (E->parallel.me==0) fprintf(stderr,"Setting up UV space\n");
-    fflush(stderr);
 
     numnodes=E->lmesh.nno;
 
@@ -2899,7 +2885,6 @@
     /* for simplicity, it is done for every element              */
 
     if (E->parallel.me==0) fprintf(stderr," Determining Shape Coefficients\n");
-    fflush(stderr);
 
     for (j=1;j<=E->sphere.caps_per_proc;j++)
         {
@@ -3063,7 +3048,6 @@
     fprintf(E->trace.fpt,"Starting Analytical Test\n");
     if (E->parallel.me==0) fprintf(stderr,"Starting Analytical Test\n");
     fflush(E->trace.fpt);
-    fflush(stderr);
 
     /* Reset Box cushion to 0 */
 
@@ -3112,7 +3096,7 @@
                 {
                     fprintf(E->trace.fpt,"Warning(analytical)-too many tracers to print!\n");
                     fflush(E->trace.fpt);
-                    if (E->trace.itracer_warnings==1) exit(10);
+                    if (E->trace.itracer_warnings) exit(10);
                 }
         }
 
@@ -3177,7 +3161,6 @@
     /* Get ready for comparison to Runge-Kutte (only works for one tracer) */
 
     fflush(E->trace.fpt);
-    fflush(stderr);
     parallel_process_sync(E);
 
     fprintf(E->trace.fpt,"\n\nComparison to Runge-Kutte\n");
@@ -3200,7 +3183,6 @@
             fprintf(E->trace.fpt,"(Note: RK comparison only appropriate for one tracing particle (%d here) \n",number);
             if (E->parallel.me==0) fprintf(stderr,"(Note: RK comparison only appropriate for one tracing particle (%d here) \n",number);
             fflush(E->trace.fpt);
-            fflush(stderr);
             parallel_process_termination();
         }
 
@@ -3278,7 +3260,6 @@
         }
 
     fflush(E->trace.fpt);
-    fflush(stderr);
 #endif
     return;
 }

Modified: mc/3D/CitcomS/trunk/lib/Regional_tracer_advection.c
===================================================================
--- mc/3D/CitcomS/trunk/lib/Regional_tracer_advection.c	2007-09-12 19:19:50 UTC (rev 7953)
+++ mc/3D/CitcomS/trunk/lib/Regional_tracer_advection.c	2007-09-12 19:22:05 UTC (rev 7954)
@@ -90,9 +90,6 @@
     /* This parameter specifies how close a tracer can get to the boundary */
     E->trace.box_cushion=0.00001;
 
-    /* AKMA turn this back on after debugging */
-    E->trace.itracer_warnings=1;
-
     /* Determine number of tracer quantities */
 
     /* advection_quantites - those needed for advection */
@@ -209,7 +206,6 @@
         fprintf(E->trace.fpt,"\n WARNING EXITS ARE TURNED OFF! TURN THEM ON!\n");
         fprintf(stderr,"\n WARNING EXITS ARE TURNED OFF! TURN THEM ON!\n");
         fflush(E->trace.fpt);
-        fflush(stderr);
     }
 
     write_composition_instructions(E);

Modified: mc/3D/CitcomS/trunk/lib/Tracer_setup.c
===================================================================
--- mc/3D/CitcomS/trunk/lib/Tracer_setup.c	2007-09-12 19:19:50 UTC (rev 7953)
+++ mc/3D/CitcomS/trunk/lib/Tracer_setup.c	2007-09-12 19:22:05 UTC (rev 7954)
@@ -100,6 +100,7 @@
 				   with only one if statement in
 				   Advection_diffusion */
 	myerror(E,"need to switch on tracers for tracer_enriched");
+
       input_float("Q0_enriched",&(E->control.Q0ER),"0.0",m);
       snprintf(message,100,"using compositionally enriched heating: C = 0: %g C = 1: %g (only one composition!)",
 	       E->control.Q0,E->control.Q0ER);
@@ -130,7 +131,6 @@
         }
         else {
             fprintf(stderr,"Sorry, tracer_ic_method only 0, 1 and 2 available\n");
-            fflush(stderr);
             parallel_process_termination();
         }
 
@@ -169,6 +169,8 @@
             }
         }
 
+        /* Warning level */
+        input_boolean("itracer_warnings",&(E->trace.itracer_warnings),"on",m);
 
 
         if(E->parallel.nprocxy == 12)
@@ -699,9 +701,7 @@
     void init_tracer_flavors();
 
     if (E->parallel.me==0) fprintf(stderr,"Making Tracer Array\n");
-    fflush(stderr);
 
-
     for (j=1;j<=E->sphere.caps_per_proc;j++) {
 
         processor_fraction=E->lmesh.volume/E->mesh.volume;
@@ -722,10 +722,6 @@
     /* Initialize tracer flavors */
     if (E->trace.nflavors) init_tracer_flavors(E);
 
-
-    fprintf(stderr,"DONE Making Tracer Array (%d)\n",E->parallel.me);
-    fflush(stderr);
-
     return;
 }
 
@@ -1014,7 +1010,6 @@
 #endif
 
     fprintf(stderr,"Read old tracers from %s\n",output_file);
-    fflush(stderr);
 
 
     for(j=1;j<=E->sphere.caps_per_proc;j++) {
@@ -1103,7 +1098,8 @@
         fprintf(E->trace.fpt,"ERROR(check_sum)-break in conservation %d %d\n",
                 number,iold_number);
         fflush(E->trace.fpt);
-        parallel_process_termination();
+        if (E->trace.itracer_warnings)
+            parallel_process_termination();
     }
 
     E->trace.ilast_tracer_count = number;

Modified: mc/3D/CitcomS/trunk/module/setProperties.c
===================================================================
--- mc/3D/CitcomS/trunk/module/setProperties.c	2007-09-12 19:19:50 UTC (rev 7953)
+++ mc/3D/CitcomS/trunk/module/setProperties.c	2007-09-12 19:22:05 UTC (rev 7954)
@@ -653,6 +653,8 @@
         }
     }
 
+    getIntProperty(properties, "itracer_warnings", E->trace.itracer_warnings, fp);
+
     getIntProperty(properties, "chemical_buoyancy",
                    E->composition.ichemical_buoyancy, fp);
 



More information about the cig-commits mailing list