Index: /inundation/pyvolution/data_manager.py
===================================================================
--- /inundation/pyvolution/data_manager.py	(revision 1796)
+++ /inundation/pyvolution/data_manager.py	(revision 1797)
@@ -1421,4 +1421,6 @@
 
 
+
+
 def convert_dem_from_ascii2netcdf(basename_in, basename_out = None,
                                   verbose=False):
@@ -1578,4 +1580,6 @@
 
     fid.close()
+
+
 
 
@@ -1646,4 +1650,20 @@
     longitudes = file_h.variables['LON']
 
+
+    e_lat = file_e.variables['LAT'][:]
+
+
+    #Check that files are compatible
+    from Numeric import allclose
+    assert allclose(latitudes, file_u.variables['LAT'])
+    assert allclose(latitudes, file_v.variables['LAT'])    
+    assert allclose(latitudes, file_e.variables['LAT'])
+
+    assert allclose(longitudes, file_u.variables['LON'])
+    assert allclose(longitudes, file_v.variables['LON'])
+    assert allclose(longitudes, file_e.variables['LON'])    
+
+
+
     if mint == None:
         jmin = 0
@@ -1684,8 +1704,11 @@
 
     if verbose: print 'cropping'
+    zname = 'ELEVATION'
+
+    
     amplitudes = file_h.variables['HA'][jmin:jmax, kmin:kmax, lmin:lmax]
     uspeed = file_u.variables['UA'][jmin:jmax, kmin:kmax, lmin:lmax] #Lon
     vspeed = file_v.variables['VA'][jmin:jmax, kmin:kmax, lmin:lmax] #Lat
-    elevations = file_e.variables['ELEVATION'][kmin:kmax, lmin:lmax]
+    elevations = file_e.variables[zname][kmin:kmax, lmin:lmax]
 
 #    if latitudes2[0]==latitudes[0] and latitudes2[-1]==latitudes[-1]:
@@ -1709,6 +1732,6 @@
     nan_ua = file_u.variables['UA'].missing_value[0]
     nan_va = file_v.variables['VA'].missing_value[0]
-    if hasattr(file_e.variables['ELEVATION'],'missing_value'):
-        nan_e  = file_e.variables['ELEVATION'].missing_value[0]
+    if hasattr(file_e.variables[zname],'missing_value'):
+        nan_e  = file_e.variables[zname].missing_value[0]
     else:
         nan_e = None
@@ -1979,6 +2002,6 @@
               %(min(times), max(times), len(times))
         print '  Quantities [SI units]:'
-        for name in ['stage', 'xmomentum', 'ymomentum']:
-            q = outfile.variables[name][:].flferret2swwat
+        for name in ['stage', 'xmomentum', 'ymomentum', 'elevation']:
+            q = outfile.variables[name][:].flat
             print '    %s in [%f, %f]' %(name, min(q), max(q))
 
Index: /inundation/pyvolution/test_data_manager.py
===================================================================
--- /inundation/pyvolution/test_data_manager.py	(revision 1796)
+++ /inundation/pyvolution/test_data_manager.py	(revision 1797)
@@ -1256,5 +1256,5 @@
 
     def test_ferret2sww3(self):
-        """
+        """Elevation included
         """
         from Scientific.IO.NetCDF import NetCDFFile
@@ -1414,4 +1414,34 @@
 
 
+    def test_ferret2sww_nz_origin(self):
+        from Scientific.IO.NetCDF import NetCDFFile
+        from coordinate_transforms.redfearn import redfearn
+
+        #Call conversion (with nonzero origin)
+        ferret2sww('small', verbose=False,
+                   origin = (56, 100000, 200000))
+
+
+        #Work out the UTM coordinates for first point
+        zone, e, n = redfearn(-34.5, 150.66667)
+
+        #Read output file 'small.sww'
+        fid = NetCDFFile('small.sww', 'r')
+
+        x = fid.variables['x'][:]
+        y = fid.variables['y'][:]
+
+        #Check that first coordinate is correctly represented
+        assert allclose(x[0], e-100000)
+        assert allclose(y[0], n-200000)
+
+        fid.close()
+
+        #Cleanup
+        import os
+        os.remove('small.sww')
+
+
+
     def test_sww_extent(self):
         """Not a test, rather a look at the sww format
@@ -1457,31 +1487,4 @@
 
 
-    def test_ferret2sww_nz_origin(self):
-        from Scientific.IO.NetCDF import NetCDFFile
-        from coordinate_transforms.redfearn import redfearn
-
-        #Call conversion (with nonzero origin)
-        ferret2sww('small', verbose=False,
-                   origin = (56, 100000, 200000))
-
-
-        #Work out the UTM coordinates for first point
-        zone, e, n = redfearn(-34.5, 150.66667)
-
-        #Read output file 'small.sww'
-        fid = NetCDFFile('small.sww', 'r')
-
-        x = fid.variables['x'][:]
-        y = fid.variables['y'][:]
-
-        #Check that first coordinate is correctly represented
-        assert allclose(x[0], e-100000)
-        assert allclose(y[0], n-200000)
-
-        fid.close()
-
-        #Cleanup
-        import os
-        os.remove('small.sww')
 
     def test_sww2domain(self):
