<p><b>dwj07@fsu.edu</b> 2012-03-15 11:18:06 -0600 (Thu, 15 Mar 2012)</p><p><br>
        -- BRANCH COMMIT --<br>
<br>
        Changing the total simulation time for test case.<br>
        Adding a visualization script.<br>
</p><hr noshade><pre><font color="gray">Modified: branches/ocean_projects/ocean_test_cases_staging/ocean/advective_transport/makeMeshes.sh
===================================================================
--- branches/ocean_projects/ocean_test_cases_staging/ocean/advective_transport/makeMeshes.sh        2012-03-15 17:12:52 UTC (rev 1647)
+++ branches/ocean_projects/ocean_test_cases_staging/ocean/advective_transport/makeMeshes.sh        2012-03-15 17:18:06 UTC (rev 1648)
@@ -11,7 +11,7 @@
###############################################################
## Change reference spacing, time_step, and viscosities here ##
###############################################################
-REF_TIME_STEP="15"
+REF_TIME_STEP="5"
REF_VISC_H="0.0"
REF_VISC_V="0.0"
REF_SPACING="10.0"
@@ -35,17 +35,17 @@
#######################################################
ADVECTION_ROUTINES="std2 std3 std4 fct2 fct3 fct4"
TIME_STEPPERS="rk4 se1 se20 use"
-TIME_STEPS="15"
+TIME_STEPS="5"
############################################################
## Setup Default namelist keys and values to update later ##
############################################################
i=0
-KEYS[$i]="config_run_duration"; VALUES[$i]="'0000_00:02:40'"; i=$i+1;
+KEYS[$i]="config_run_duration"; VALUES[$i]="'0000_02:00:00'"; i=$i+1;
KEYS[$i]="config_input_name"; VALUES[$i]="'grid.nc'"; i=$i+1;
KEYS[$i]="config_output_name"; VALUES[$i]="'output.nc'"; i=$i+1;
KEYS[$i]="config_restart_name"; VALUES[$i]="'restart.nc'"; i=$i+1;
-KEYS[$i]="config_output_interval"; VALUES[$i]="'00_00:02:40'"; i=$i+1;
+KEYS[$i]="config_output_interval"; VALUES[$i]="'00_02:00:00'"; i=$i+1;
KEYS[$i]="config_do_restart"; VALUES[$i]=".false."; i=$i+1;
KEYS[$i]="config_vert_grid_type"; VALUES[$i]="'zstar'"; i=$i+1;
KEYS[$i]="config_rho0"; VALUES[$i]="1000"; i=$i+1;
@@ -197,11 +197,13 @@
                do
                        if [ ${TIME_STEPPER} == 'rk4' ]; then
                                TIME_INTEGRATOR="'RK4'"
+                                SUB_CYCLES=20
                        elif [ ${TIME_STEPPER:0:2} == "se" ]; then
                                TIME_INTEGRATOR="'split_explicit'"
                                SUB_CYCLES=${TIME_STEPPER:2}
                        elif [ ${TIME_STEPPER} == 'use' ]; then
                                TIME_INTEGRATOR="'unsplit_explicit'"
+                                SUB_CYCLES=20
                        fi
                        for TIME_STEP in ${TIME_STEPS}
Added: branches/ocean_projects/ocean_test_cases_staging/ocean/advective_transport/visualize_transport.py
===================================================================
--- branches/ocean_projects/ocean_test_cases_staging/ocean/advective_transport/visualize_transport.py         (rev 0)
+++ branches/ocean_projects/ocean_test_cases_staging/ocean/advective_transport/visualize_transport.py        2012-03-15 17:18:06 UTC (rev 1648)
@@ -0,0 +1,124 @@
+#!/usr/bin/python
+import sys, os, glob, shutil, numpy
+
+sys.path.append('/home/douglasj/softwares/python/lib/python2.7/site-packages')
+
+from netCDF4 import *
+from netCDF4 import Dataset as NetCDFFile
+from pylab import *
+
+from optparse import OptionParser
+
+import time
+import matplotlib
+import matplotlib.pyplot as plt
+from scipy.interpolate import griddata
+
+parser = OptionParser()
+parser.add_option("-f", "--file", dest="filename", help="file to visualize", metavar="FILE")
+parser.add_option("-v", "--var", dest="variable", help="variable to visualize", metavar="VAR")
+parser.add_option("--max", dest="maximum", help="maximum for color bar", metavar="MAX")
+parser.add_option("--min", dest="minimum", help="minimum for color bar", metavar="MIN")
+
+options, args = parser.parse_args()
+
+if not options.filename:
+        parser.error("Filename is a required input.")
+
+if not options.variable:
+        parser.error("Variable is a required input.")
+
+if not options.maximum:
+        color_max = 0.0
+else:
+        color_max = float(options.maximum)
+
+if not options.minimum:
+        color_min = 0.0
+else:
+        color_min = float(options.minimum)
+
+f = NetCDFFile(options.filename,'r')
+
+times = f.variables['xtime']
+field = f.variables[options.variable]
+
+dim = field.dimensions[1]
+if dim == "nCells":
+        x = f.variables['xCell'][:]
+        y = f.variables['yCell'][:]
+elif dim == "nEdges":
+        x = f.variables['xEdge'][:]
+        y = f.variables['yEdge'][:]
+elif dim == "nVertices":
+        x = f.variables['xVertex'][:]
+        y = f.variables['yVertex'][:]
+
+dcedge = f.variables['dcEdge']
+vert_levs = len(f.dimensions['nVertLevels'])
+
+junk = dcedge[:]
+resolution = junk.max()
+
+del dcedge
+del junk
+
+nx = int((x.max() - x.min())/resolution - 1)
+ny = int((y.max() - y.min())/resolution)
+
+time_length = times.shape[0]
+
+del times
+
+print "nx = ", nx, " ny = ", ny
+print "vert_levs = ", vert_levs, " time_length = ", time_length
+
+print "Computing global max and min"
+junk = field[:,:,0]
+maxval = junk.max()
+minval = junk.min()
+
+del junk
+
+junk = field[:,:,:]
+global_max = junk.max()
+global_min = junk.min()
+
+del junk
+
+print "Global max = ", global_max, " Global min = ", global_min
+print "Surface max = ", maxval, " Surface min = ", minval
+
+if color_max == color_min:
+        color_max = global_max
+        color_min = global_min
+
+steps = 30
+step = (color_max - color_min) / steps
+color_bar_levels = arange(color_min-step, color_max+step, step)
+
+xi = linspace(x.min(), x.max(), nx*2)
+yi = linspace(y.min(), y.max(), ny*2)
+
+zi = griddata((x, y), field[0,:,0], (xi[None,:], yi[:,None]), method='linear')
+
+plt.ion()
+fig = plt.figure(1)
+ax = fig.add_subplot(111)
+
+plt.contourf(xi, yi, zi, levels=color_bar_levels)
+plt.colorbar()
+plt.draw()
+
+for t in range(1, time_length):
+         ax.cla()
+        zi = griddata((x, y), field[t,:,0], (xi[None,:], yi[:,None]), method='linear')
+
+        plt.contourf(xi, yi, zi, levels=color_bar_levels)
+        plt.draw()
+         time.sleep(0.05)
+
+plt.ioff()
+
+plt.show()
+f.close()
Property changes on: branches/ocean_projects/ocean_test_cases_staging/ocean/advective_transport/visualize_transport.py
___________________________________________________________________
Added: svn:executable
+ *
</font>
</pre>