Index: /anuga_core/source/anuga/shallow_water/data_manager.py
===================================================================
--- /anuga_core/source/anuga/shallow_water/data_manager.py	(revision 4861)
+++ /anuga_core/source/anuga/shallow_water/data_manager.py	(revision 4862)
@@ -70,5 +70,5 @@
 from Numeric import concatenate, array, Float, Int, Int32, resize, sometrue, \
      searchsorted, zeros, allclose, around, reshape, transpose, sort, \
-     NewAxis, ArrayType, compress, take, arange, argmax, alltrue,shape,Float
+     NewAxis, ArrayType, compress, take, arange, argmax, alltrue,shape,Float32
 
 import string
@@ -337,5 +337,6 @@
                                      description=description,
                                      smoothing=domain.smooth,
-                                     order=domain.default_order)
+                                     order=domain.default_order,
+                                     sww_precision=self.precision)
 
             # Extra optional information
@@ -542,5 +543,5 @@
                 self.writer.store_quantities(fid, 
                                              time=self.domain.time,
-                                             precision=self.precision,
+                                             sww_precision=self.precision,
                                              stage=stage,
                                              xmomentum=xmomentum,
@@ -2898,8 +2899,9 @@
     # Create new file
     starttime = times[0]
+    
     sww = Write_sww()
     sww.store_header(outfile, times, number_of_volumes,
                      number_of_points, description=description,
-                     verbose=verbose)
+                     verbose=verbose,sww_precision=Float)
 
     # Store
@@ -2957,4 +2959,5 @@
     #FIXME: z should be obtained from MOST and passed in here
 
+    #FIXME use the Write_sww instance(sww) to write this info
     from Numeric import resize
     z = resize(z,outfile.variables['z'][:].shape)
@@ -4742,5 +4745,5 @@
     sww = Write_sww()
     sww.store_header(outfile, times, len(volumes), len(points_utm),
-                     verbose=verbose)
+                     verbose=verbose,sww_precision=Float)
     outfile.mean_stage = mean_stage
     outfile.zscale = zscale
@@ -4764,5 +4767,6 @@
                                  stage=stage,
                                  xmomentum=xmomentum,
-                                 ymomentum=ymomentum)
+                                 ymomentum=ymomentum,
+                                 sww_precision=Float)
         j += 1
     if verbose: sww.verbose_quantities(outfile)
@@ -4818,5 +4822,7 @@
                      description='Converted from XXX',
                      smoothing=True,
-                     order=1, verbose=False):
+                     order=1,
+                     sww_precision=Float32,
+                     verbose=False):
         """
         outfile - the name of the file that will be written
@@ -4885,9 +4891,9 @@
 
         # variable definitions
-        outfile.createVariable('x', precision, ('number_of_points',))
-        outfile.createVariable('y', precision, ('number_of_points',))
-        outfile.createVariable('elevation', precision, ('number_of_points',))
+        outfile.createVariable('x', sww_precision, ('number_of_points',))
+        outfile.createVariable('y', sww_precision, ('number_of_points',))
+        outfile.createVariable('elevation', sww_precision, ('number_of_points',))
         q = 'elevation'
-        outfile.createVariable(q+Write_sww.RANGE, precision,
+        outfile.createVariable(q+Write_sww.RANGE, sww_precision,
                                ('numbers_in_range',))
 
@@ -4895,27 +4901,27 @@
         # Initialise ranges with small and large sentinels.
         # If this was in pure Python we could have used None sensibly
-        outfile.variables[q+Write_sww.RANGE][0] = max_float  # Min               
+        outfile.variables[q+Write_sww.RANGE][0] = max_float  # Min 
         outfile.variables[q+Write_sww.RANGE][1] = -max_float # Max
 
         # FIXME: Backwards compatibility
-        outfile.createVariable('z', precision, ('number_of_points',))
+        outfile.createVariable('z', sww_precision, ('number_of_points',))
         #################################
 
         outfile.createVariable('volumes', Int, ('number_of_volumes',
                                                 'number_of_vertices'))
-
-        outfile.createVariable('time', precision,
+        # Doing sww_precision instead of Float gives cast errors.
+        outfile.createVariable('time', Float,
                                ('number_of_timesteps',))
         
         for q in Write_sww.sww_quantities:
-            outfile.createVariable(q, precision,
+            outfile.createVariable(q, sww_precision,
                                    ('number_of_timesteps',
                                     'number_of_points'))  
-            outfile.createVariable(q+Write_sww.RANGE, precision,
+            outfile.createVariable(q+Write_sww.RANGE, sww_precision,
                                    ('numbers_in_range',))
 
             # Initialise ranges with small and large sentinels.
             # If this was in pure Python we could have used None sensibly
-            outfile.variables[q+Write_sww.RANGE][0] = max_float  # Min               
+            outfile.variables[q+Write_sww.RANGE][0] = max_float  # Min
             outfile.variables[q+Write_sww.RANGE][1] = -max_float # Max
             
@@ -5016,4 +5022,5 @@
             
         #z = resize(bath_grid,outfile.variables['z'][:].shape)
+        #print "points[:,0]", points[:,0]
         outfile.variables['x'][:] = points[:,0] #- geo_ref.get_xllcorner()
         outfile.variables['y'][:] = points[:,1] #- geo_ref.get_yllcorner()
@@ -5028,5 +5035,5 @@
 
 
-    def store_quantities(self, outfile, precision=Float,
+    def store_quantities(self, outfile, sww_precision=Float32,
                          slice_index=None, time=None,
                          verbose=False, **quant):
@@ -5064,5 +5071,6 @@
             else:
                 q_values = quant[q]
-                outfile.variables[q][slice_index] = q_values.astype(precision)
+                outfile.variables[q][slice_index] = \
+                                q_values.astype(sww_precision)
 
                 # This updates the _range values
@@ -5713,5 +5721,8 @@
                 runup_index = argmax(wet_elevation)
                 runup = max(wet_elevation)
-                assert wet_elevation[runup_index] == runup # Must always be True
+                assert wet_elevation[runup_index] == runup # Must be True
+            #print "runup", runup
+            #print "maximal_runup", maximal_runup
+            
             if runup > maximal_runup:
                 maximal_runup = runup      # This works even if maximal_runups is None
Index: /anuga_core/source/anuga/shallow_water/test_data_manager.py
===================================================================
--- /anuga_core/source/anuga/shallow_water/test_data_manager.py	(revision 4861)
+++ /anuga_core/source/anuga/shallow_water/test_data_manager.py	(revision 4862)
@@ -6770,5 +6770,5 @@
         sww.store_header(outfile, times, number_of_volumes,
                          number_of_points, description='fully sick testing',
-                         verbose=self.verbose)
+                         verbose=self.verbose,sww_precision=Float)
         sww.store_triangulation(outfile, points_utm, volumes,
                                 elevation,  new_origin=new_origin,
@@ -6802,8 +6802,8 @@
         sww.store_header(outfile, times, number_of_volumes,
                          number_of_points, description='fully sick testing',
-                         verbose=self.verbose)
+                         verbose=self.verbose,sww_precision=Float)
         sww.store_triangulation(outfile, points_utm, volumes,
                                 elevation,  new_origin=new_origin,
-                                verbose=self.verbose)       
+                                verbose=self.verbose)
         outfile.close()
         fid = NetCDFFile(filename)
@@ -6838,8 +6838,8 @@
         sww.store_header(outfile, times, number_of_volumes,
                          number_of_points, description='fully sick testing',
-                         verbose=self.verbose)
+                         verbose=self.verbose,sww_precision=Float)
         sww.store_triangulation(outfile, points_utm, volumes,
                                 elevation,  new_origin=new_origin,
-                                verbose=self.verbose)       
+                                verbose=self.verbose)
         outfile.close()
         fid = NetCDFFile(filename)
@@ -6877,5 +6877,5 @@
         sww.store_header(outfile, times, number_of_volumes,
                          number_of_points, description='fully sick testing',
-                         verbose=self.verbose)
+                         verbose=self.verbose,sww_precision=Float)
         sww.store_triangulation(outfile, points_utm, volumes,
                                 elevation,  new_origin=new_origin,
@@ -6913,5 +6913,5 @@
         sww.store_header(outfile, times, number_of_volumes,
                          number_of_points, description='fully sick testing',
-                         verbose=self.verbose)
+                         verbose=self.verbose,sww_precision=Float)
         sww.store_triangulation(outfile, points_utm, volumes,
                                 elevation,  new_origin=new_origin,
@@ -7327,9 +7327,8 @@
 #-------------------------------------------------------------
 if __name__ == "__main__":
-    #suite = unittest.makeSuite(Test_Data_Manager,'test_get_maximum_inundation')
     #suite = unittest.makeSuite(Test_Data_Manager,'test_sww_header')
-    #suite = unittest.makeSuite(Test_Data_Manager,'test_export_grid_parallel')
     suite = unittest.makeSuite(Test_Data_Manager,'test')
-    #suite = unittest.makeSuite(Test_Data_Manager,'test_sww_extrema')
+    #suite = unittest.makeSuite(Test_Data_Manager,'test_urs_ungridded_holeII')
+    #suite = unittest.makeSuite(Test_Data_Manager,'test_sww_range')
 
     
Index: /anuga_work/development/cairns_demo/runcairns.py
===================================================================
--- /anuga_work/development/cairns_demo/runcairns.py	(revision 4861)
+++ /anuga_work/development/cairns_demo/runcairns.py	(revision 4862)
@@ -139,5 +139,5 @@
 domain.set_quantity('elevation', 
                     filename=dem_name + '.pts',
-                    use_cache=True,
+                    use_cache=False,
                     verbose=True,
                     alpha=0.1)
