<p><b>dwj07@fsu.edu</b> 2012-03-24 09:03:07 -0600 (Sat, 24 Mar 2012)</p><p><br>
        -- BRANCH COMMIT --<br>
<br>
        Cleaning up some missing_value functionality.<br>
</p><hr noshade><pre><font color="gray">Modified: branches/tools/mpas_draw/constants.h
===================================================================
--- branches/tools/mpas_draw/constants.h        2012-03-23 21:02:31 UTC (rev 1706)
+++ branches/tools/mpas_draw/constants.h        2012-03-24 15:03:07 UTC (rev 1707)
@@ -109,5 +109,3 @@
 #define REG_B                        0.0
 
 #define PI_DP                        3.141592653589793
-
-#define missing_value -1e34

Modified: branches/tools/mpas_draw/mpas_draw.cpp
===================================================================
--- branches/tools/mpas_draw/mpas_draw.cpp        2012-03-23 21:02:31 UTC (rev 1706)
+++ branches/tools/mpas_draw/mpas_draw.cpp        2012-03-24 15:03:07 UTC (rev 1707)
@@ -75,6 +75,7 @@
 bool on_sphere;
 double sphere_radius;
 int color_bar = 0;
+double missing_value = -1e34;
 
 double line_factor = 1.002;
 double region_line_factor = 1.006;
@@ -703,12 +704,12 @@
         n_heptagons = 0;
         n_bigagons = 0;
 
-        r8vec_min_max(ncells, xcell, xcell_min, xcell_max);
-        r8vec_min_max(ncells, ycell, ycell_min, ycell_max);
-        r8vec_min_max(ncells, zcell, zcell_min, zcell_max);
-        r8vec_min_max(nvertices, xvertex, xvertex_min, xvertex_max);
-        r8vec_min_max(nvertices, yvertex, yvertex_min, yvertex_max);
-        r8vec_min_max(nvertices, zvertex, zvertex_min, zvertex_max);
+        r8vec_min_max(ncells, xcell, xcell_min, xcell_max, missing_value);
+        r8vec_min_max(ncells, ycell, ycell_min, ycell_max, missing_value);
+        r8vec_min_max(ncells, zcell, zcell_min, zcell_max, missing_value);
+        r8vec_min_max(nvertices, xvertex, xvertex_min, xvertex_max, missing_value);
+        r8vec_min_max(nvertices, yvertex, yvertex_min, yvertex_max, missing_value);
+        r8vec_min_max(nvertices, zvertex, zvertex_min, zvertex_max, missing_value);
 
         xcell_range = (xcell_max - xcell_min);
         ycell_range = (ycell_max - ycell_min);
@@ -1138,7 +1139,7 @@
 
                         netcdf_mpas_read_full_field(filename, id, &amp;temp_data[0]);
 
-                        r8vec_min_max(num_items, &amp;temp_data[0], min, max);
+                        r8vec_min_max(num_items, &amp;temp_data[0], min, max, missing_value);
 
                         ranges[id].push_back(min);
                         ranges[id].push_back(max);
@@ -1190,12 +1191,12 @@
         int i;
         int cell;
         double norm;
-        xyz_min[0] = r8vec_min ( ncells, xcell );
-        xyz_max[0] = r8vec_max ( ncells, xcell );
-        xyz_min[1] = r8vec_min ( ncells, ycell );
-        xyz_max[1] = r8vec_max ( ncells, ycell );
-        xyz_min[2] = r8vec_min ( ncells, zcell );
-        xyz_max[2] = r8vec_max ( ncells, zcell );
+        xyz_min[0] = r8vec_min ( ncells, xcell, missing_value);
+        xyz_max[0] = r8vec_max ( ncells, xcell, missing_value);
+        xyz_min[1] = r8vec_min ( ncells, ycell, missing_value);
+        xyz_max[1] = r8vec_max ( ncells, ycell, missing_value);
+        xyz_min[2] = r8vec_min ( ncells, zcell, missing_value);
+        xyz_max[2] = r8vec_max ( ncells, zcell, missing_value);
 
         xyz_range[0] = xyz_max[0] - xyz_min[0];
         xyz_range[1] = xyz_max[1] - xyz_min[1];
@@ -1275,12 +1276,12 @@
         int i;
         int vertex;
         double norm;
-        xyz_min[0] = r8vec_min ( nvertices, xvertex );
-        xyz_max[0] = r8vec_max ( nvertices, xvertex );
-        xyz_min[1] = r8vec_min ( nvertices, yvertex );
-        xyz_max[1] = r8vec_max ( nvertices, yvertex );
-        xyz_min[2] = r8vec_min ( nvertices, zvertex );
-        xyz_max[2] = r8vec_max ( nvertices, zvertex );
+        xyz_min[0] = r8vec_min ( nvertices, xvertex, missing_value );
+        xyz_max[0] = r8vec_max ( nvertices, xvertex, missing_value );
+        xyz_min[1] = r8vec_min ( nvertices, yvertex, missing_value );
+        xyz_max[1] = r8vec_max ( nvertices, yvertex, missing_value );
+        xyz_min[2] = r8vec_min ( nvertices, zvertex, missing_value );
+        xyz_max[2] = r8vec_max ( nvertices, zvertex, missing_value );
 
         xyz_range[0] = xyz_max[0] - xyz_min[0];
         xyz_range[1] = xyz_max[1] - xyz_min[1];
@@ -1674,7 +1675,7 @@
                         min = ranges[cell_field].at(0);
                         max = ranges[cell_field].at(1);
                 } else {
-                        r8vec_min_max(ncells, cell_values, min, max);
+                        r8vec_min_max(ncells, cell_values, min, max, missing_value);
                 }
 
                 cout &lt;&lt; &quot;Min: &quot; &lt;&lt; min &lt;&lt; &quot; Max: &quot; &lt;&lt; max &lt;&lt; endl;
@@ -1752,7 +1753,7 @@
                         max = ranges[vertex_field][0];
                         min = ranges[vertex_field][1];
                 } else {
-                        r8vec_min_max(nvertices, triangle_values, min, max);
+                        r8vec_min_max(nvertices, triangle_values, min, max, missing_value);
                 }
 
                 cout &lt;&lt; &quot;Min: &quot; &lt;&lt; min &lt;&lt; &quot; Max: &quot; &lt;&lt; max &lt;&lt; endl;
@@ -1825,7 +1826,7 @@
                         min = ranges[edge_field][0];
                         max = ranges[edge_field][1];
                 } else {
-                        r8vec_min_max(nedges, edge_values, min, max);
+                        r8vec_min_max(nedges, edge_values, min, max, missing_value);
                 }
 
                 cout &lt;&lt; &quot;Min: &quot; &lt;&lt; min &lt;&lt; &quot; Max: &quot; &lt;&lt; max &lt;&lt; endl;
@@ -2286,8 +2287,10 @@
 
                         glNormal3f(x * zr0, y * zr0, z0);
                         glVertex3f(r * x * zr0, r * y * zr0, r * (z0+z_c));
+                        glColor3f(0.5, 0.5, 0.5);
                         glNormal3f(x * zr1, y * zr1, z1);
                         glVertex3f(r * x * zr1, r * y * zr1, r * (z1+z_c));
+                        glColor3f(0.5, 0.5, 0.5);
                 }
                 glEnd();
         }

Modified: branches/tools/mpas_draw/vec_utils.cpp
===================================================================
--- branches/tools/mpas_draw/vec_utils.cpp        2012-03-23 21:02:31 UTC (rev 1706)
+++ branches/tools/mpas_draw/vec_utils.cpp        2012-03-24 15:03:07 UTC (rev 1707)
@@ -2,8 +2,6 @@
 
 using namespace std;
 
-double missing_value = -1e34;
-
 double r8_huge ( ){/*{{{*/
 
         //****************************************************************************80
@@ -42,90 +40,12 @@
         return value;
 }/*}}}*/
 //****************************************************************************80
-double r8_max ( double x, double y ){/*{{{*/
+double r8vec_max ( int n, double r8vec[] , double missing_value){/*{{{*/
 
         //****************************************************************************80
         //
         //  Purpose:
         //
-        //    R8_MAX returns the maximum of two R8's.
-        //
-        //  Licensing:
-        //
-        //    This code is distributed under the GNU LGPL license.
-        //
-        //  Modified:
-        //
-        //    18 August 2004
-        //
-        //  Author:
-        //
-        //    John Burkardt
-        //
-        //  Parameters:
-        //
-        //    Input, double X, Y, the quantities to compare.
-        //
-        //    Output, double R8_MAX, the maximum of X and Y.
-        //
-        double value;
-
-        if ( y &lt; x )
-        {
-                value = x;
-        }
-        else
-        {
-                value = y;
-        }
-        return value;
-}/*}}}*/
-//****************************************************************************80
-double r8_min ( double x, double y ){/*{{{*/
-
-        //****************************************************************************80
-        //
-        //  Purpose:
-        //
-        //    R8_MIN returns the minimum of two R8's.
-        //
-        //  Licensing:
-        //
-        //    This code is distributed under the GNU LGPL license.
-        //
-        //  Modified:
-        //
-        //    18 August 2004
-        //
-        //  Author:
-        //
-        //    John Burkardt
-        //
-        //  Parameters:
-        //
-        //    Input, double X, Y, the quantities to compare.
-        //
-        //    Output, double R8_MIN, the minimum of X and Y.
-        //
-        double value;
-
-        if ( y &gt; x )
-        {
-                value = x;
-        }
-        else
-        {
-                value = y;
-        }
-        return value;
-}/*}}}*/
-//****************************************************************************80
-double r8vec_max ( int n, double r8vec[] ){/*{{{*/
-
-        //****************************************************************************80
-        //
-        //  Purpose:
-        //
         //    R8VEC_MAX returns the value of the maximum element in an R8VEC.
         //
         //  Discussion:
@@ -161,17 +81,17 @@
                 value = 0.0;
         }
 
-        value = r8vec[0];
+        value = -1.0e34;
 
-        for ( i = 1; i &lt; n; i++ )
+        for ( i = 0; i &lt; n; i++ )
         {
-                if(r8vec[i] &gt; value &amp;&amp; r8vec[i] != missing_value)
-                        value = r8vec[i];
+                if(r8vec[i] != missing_value)
+                        value = max(value, r8vec[i]);
         }
         return value;
 }/*}}}*/
 //****************************************************************************80
-double r8vec_min ( int n, double r8vec[] ){/*{{{*/
+double r8vec_min ( int n, double r8vec[] , double missing_value){/*{{{*/
 
         //****************************************************************************80
         //
@@ -215,13 +135,13 @@
 
         for ( i = 0; i &lt; n; i++ )
         {
-                if(r8vec[i] &lt; value &amp;&amp; r8vec[i] != missing_value)
-                        value = r8vec[i];
+                if(r8vec[i] != missing_value)
+                        value = min(value, r8vec[i]);
         }
         return value;
 }/*}}}*/
 //****************************************************************************80
-void r8vec_min_max ( int n, double r8vec[], double &amp;min, double&amp;max ){/*{{{*/
+void r8vec_min_max ( int n, double r8vec[], double &amp;min, double&amp;max, double missing_value ){/*{{{*/
 
         //****************************************************************************80
         //
@@ -263,10 +183,10 @@
                 return;
         }
 
-        min = r8vec[0];
-        max = r8vec[0];
+        min = r8_huge();
+        max = -1e34;
 
-        for ( i = 1; i &lt; n; i++ )
+        for ( i = 0; i &lt; n; i++ )
         {
                 if(r8vec[i] != missing_value){
                         min = std::min(r8vec[i], min);

Modified: branches/tools/mpas_draw/vec_utils.h
===================================================================
--- branches/tools/mpas_draw/vec_utils.h        2012-03-23 21:02:31 UTC (rev 1706)
+++ branches/tools/mpas_draw/vec_utils.h        2012-03-24 15:03:07 UTC (rev 1707)
@@ -1,8 +1,6 @@
 using namespace std;
 
 double r8_huge ( );
-double r8_max ( double x, double y );
-double r8_min ( double x, double y );
-double r8vec_max ( int n, double r8vec[] );
-double r8vec_min ( int n, double r8vec[] );
-void r8vec_min_max ( int n, double r8vec[], double &amp;min, double&amp;max );
+double r8vec_max ( int n, double r8vec[], double missing_value );
+double r8vec_min ( int n, double r8vec[], double missing_value );
+void r8vec_min_max ( int n, double r8vec[], double &amp;min, double&amp;max, double missing_value );

</font>
</pre>