Index: /trunk/anuga_core/source/anuga/abstract_2d_finite_volumes/file_function.py
===================================================================
--- /trunk/anuga_core/source/anuga/abstract_2d_finite_volumes/file_function.py	(revision 8779)
+++ /trunk/anuga_core/source/anuga/abstract_2d_finite_volumes/file_function.py	(revision 8780)
@@ -16,5 +16,5 @@
 
 from anuga.geospatial_data.geospatial_data import ensure_absolute
-from Scientific.IO.NetCDF import NetCDFFile
+from anuga.file.netcdf import NetCDFFile
 from anuga.config import netcdf_mode_r, netcdf_mode_w, netcdf_mode_a
 from anuga.utilities.numerical_tools import ensure_numeric
@@ -297,8 +297,9 @@
     # Get first timestep
     try:
-        starttime = fid.starttime
+        starttime = float(fid.starttime)
     except ValueError:
         msg = 'Could not read starttime from file %s' % filename
         raise Exception(msg)
+
 
     # Get variables
Index: /trunk/anuga_core/source/anuga/abstract_2d_finite_volumes/gauge.py
===================================================================
--- /trunk/anuga_core/source/anuga/abstract_2d_finite_volumes/gauge.py	(revision 8779)
+++ /trunk/anuga_core/source/anuga/abstract_2d_finite_volumes/gauge.py	(revision 8780)
@@ -163,4 +163,5 @@
                 if value.strip()=='elevation':elevation=j
         else:
+            #points.append([float(row[easting]),float(row[northing])])
             points.append([float(row[easting]),float(row[northing])])
             point_name.append(row[name])
@@ -170,4 +171,6 @@
         
     points_array = ensure_absolute(points_array)
+
+    #print 'points_array', points_array
 
     dir_name, base = os.path.split(sww_file)    
@@ -223,5 +226,5 @@
 
         if quake_offset_time is None:
-            quake_offset_time = callable_sww.starttime[0]
+            quake_offset_time = callable_sww.starttime
 
         for point_i, point in enumerate(points_array):
@@ -241,4 +244,5 @@
                         points_writer = writer(file(dir_name + sep + gauge_file
                                                     + point_name[point_i] + '.csv', "ab"))
+
 
                     points_list = [quake_time, quake_time/3600.] +  _quantities2csv(quantities, point_quantities, callable_sww.centroids, point_i)
Index: /trunk/anuga_core/source/anuga/abstract_2d_finite_volumes/test_gauge.py
===================================================================
--- /trunk/anuga_core/source/anuga/abstract_2d_finite_volumes/test_gauge.py	(revision 8779)
+++ /trunk/anuga_core/source/anuga/abstract_2d_finite_volumes/test_gauge.py	(revision 8780)
@@ -9,5 +9,5 @@
 import anuga
 #from anuga.abstract_2d_finite_volumes.util import *
-from anuga.abstract_2d_finite_volumes.gauge import *
+from anuga.abstract_2d_finite_volumes.gauge import sww2csv_gauges
 from anuga.config import epsilon
 
@@ -94,5 +94,5 @@
         
         
-    def test_sww2csv(self):
+    def test_sww2csv_0(self):
 
         """Most of this test was copied from test_interpolate
@@ -109,5 +109,5 @@
         points = [[5.0,1.],[0.5,2.]]
 
-        points_file = tempfile.mktemp(".csv")
+        points_file = tempfile.mktemp(".csv") 
 #        points_file = 'test_point.csv'
         file_id = open(points_file,"w")
@@ -155,7 +155,7 @@
         point1_handle.close()
         point2_handle.close()
-        os.remove(points_file)
-        os.remove(point1_filename)
-        os.remove(point2_filename)
+        #os.remove(points_file)
+        #os.remove(point1_filename)
+        #os.remove(point2_filename)
 
 
@@ -544,5 +544,5 @@
 
 if __name__ == "__main__":
-    suite = unittest.makeSuite(Test_Gauge, 'test')
+    suite = unittest.makeSuite(Test_Gauge, 'test_')
 #    runner = unittest.TextTestRunner(verbosity=2)
     runner = unittest.TextTestRunner(verbosity=1)
Index: /trunk/anuga_core/source/anuga/abstract_2d_finite_volumes/test_util.py
===================================================================
--- /trunk/anuga_core/source/anuga/abstract_2d_finite_volumes/test_util.py	(revision 8779)
+++ /trunk/anuga_core/source/anuga/abstract_2d_finite_volumes/test_util.py	(revision 8780)
@@ -173,5 +173,5 @@
 
         #Now read data from sww and check
-        from Scientific.IO.NetCDF import NetCDFFile
+        from anuga.file.netcdf import NetCDFFile
         filename = domain1.get_name() + '.sww'
         fid = NetCDFFile(filename)
@@ -375,5 +375,5 @@
 
         #Now read data from sww and check
-        from Scientific.IO.NetCDF import NetCDFFile
+        from anuga.file.netcdf import NetCDFFile
         filename = domain1.get_name() + '.sww'
         fid = NetCDFFile(filename)
Index: /trunk/anuga_core/source/anuga/config.py
===================================================================
--- /trunk/anuga_core/source/anuga/config.py	(revision 8779)
+++ /trunk/anuga_core/source/anuga/config.py	(revision 8780)
@@ -228,5 +228,5 @@
 s = """
 import os, tempfile
-from Scientific.IO.NetCDF import NetCDFFile
+from anuga.file.netcdf import NetCDFFile
 
 filename = tempfile.mktemp('.nc')
@@ -237,4 +237,5 @@
 """
 
+"""
 # Need to run in a separate process due an
 # error with older versions of Scientific.IO
@@ -265,3 +266,3 @@
         #netcdf_mode_w = 'w'   # Old style NetCDF used by OSG viewer
 
-
+"""
Index: /trunk/anuga_core/source/anuga/coordinate_transforms/test_geo_reference.py
===================================================================
--- /trunk/anuga_core/source/anuga/coordinate_transforms/test_geo_reference.py	(revision 8779)
+++ /trunk/anuga_core/source/anuga/coordinate_transforms/test_geo_reference.py	(revision 8780)
@@ -30,5 +30,5 @@
         
     def test_read_write_NetCDF(self):
-        from Scientific.IO.NetCDF import NetCDFFile
+        from anuga.file.netcdf import NetCDFFile
         g = Geo_reference(56,1.9,1.9)
         file_name = tempfile.mktemp(".geo_referenceTest")
@@ -47,5 +47,5 @@
     def test_read_NetCDFI(self):
         # test if read_NetCDF
-        from Scientific.IO.NetCDF import NetCDFFile
+        from anuga.file.netcdf import NetCDFFile
         g = Geo_reference(56,1.9,1.9)
         file_name = tempfile.mktemp(".geo_referenceTest")
@@ -65,5 +65,5 @@
         
     def test_read_write_ASCII(self):
-        from Scientific.IO.NetCDF import NetCDFFile
+        from anuga.file.netcdf import NetCDFFile
         g = Geo_reference(56,1.9,1.9)
         file_name = tempfile.mktemp(".geo_referenceTest")
@@ -80,5 +80,5 @@
     
     def test_read_write_ASCII2(self):
-        from Scientific.IO.NetCDF import NetCDFFile
+        from anuga.file.netcdf import NetCDFFile
         g = Geo_reference(56,1.9,1.9)
         file_name = tempfile.mktemp(".geo_referenceTest")
@@ -95,5 +95,5 @@
         
     def test_read_write_ASCII3(self):
-        from Scientific.IO.NetCDF import NetCDFFile
+        from anuga.file.netcdf import NetCDFFile
         g = Geo_reference(56,1.9,1.9)
         file_name = tempfile.mktemp(".geo_referenceTest")
@@ -498,5 +498,5 @@
 
     def test_read_write_ASCII_test_and_fail(self):
-        from Scientific.IO.NetCDF import NetCDFFile
+        from anuga.file.netcdf import NetCDFFile
 
         # This is to test a fail
@@ -631,5 +631,5 @@
         '''
 
-        from Scientific.IO.NetCDF import NetCDFFile
+        from anuga.file.netcdf import NetCDFFile
 
         # ensure that basic instance attributes are correct
Index: /trunk/anuga_core/source/anuga/file/netcdf.py
===================================================================
--- /trunk/anuga_core/source/anuga/file/netcdf.py	(revision 8779)
+++ /trunk/anuga_core/source/anuga/file/netcdf.py	(revision 8780)
@@ -3,6 +3,4 @@
 
 import numpy as num
-
-from Scientific.IO.NetCDF import NetCDFFile
 
 from anuga.coordinate_transforms.redfearn import \
@@ -22,4 +20,42 @@
 time_name = 'TIME'
 precision = netcdf_float # So if we want to change the precision its done here
+
+
+
+def NetCDFFile(file_name, netcdf_mode=netcdf_mode_r):
+    """Wrapper to isolate changes of the netcdf libray.
+
+    In theory we should be able to change over to NetCDF4 via this
+    wrapper, by ensuring the interface to the NetCDF library isthe same as the
+    the old Scientific.IO.NetCDF library.
+
+    There is a difference between extracting dimensions. We have used the following
+    to cover netcdf4 and scientific python
+
+    try: # works with netcdf4
+        number_of_timesteps = len(fid.dimensions['number_of_timesteps'])
+        number_of_points = len(fid.dimensions['number_of_points'])
+    except: # works with scientific.io.netcdf
+        number_of_timesteps = fid.dimensions['number_of_timesteps']
+        number_of_points = fid.dimensions['number_of_points']
+    
+    """
+
+    #from Scientific.IO.NetCDF import NetCDFFile
+    #return NetCDFFile(file_name, netcdf_mode)
+
+    from netCDF4 import Dataset
+    return Dataset(file_name, netcdf_mode, format='NETCDF3_64BIT')
+
+    #return Dataset(file_name, netcdf_mode, format='NETCDF3_CLASSIC')
+
+
+    # COMMENT SR; Can't use scipy.io.netcdf as we can't append to
+    # a file as of 2013/03/26
+    #from scipy.io.netcdf import netcdf_file
+    #return netcdf_file(file_name, netcdf_mode, version=2)
+
+
+
 
 class Write_nc:
Index: /trunk/anuga_core/source/anuga/file/sts.py
===================================================================
--- /trunk/anuga_core/source/anuga/file/sts.py	(revision 8779)
+++ /trunk/anuga_core/source/anuga/file/sts.py	(revision 8780)
@@ -1,5 +1,5 @@
 import numpy as num
 import anuga.utilities.log as log
-from Scientific.IO.NetCDF import NetCDFFile
+from anuga.file.netcdf import NetCDFFile
 
 from anuga.config import max_float
@@ -275,6 +275,6 @@
         raise IOError(msg)
 
-    xllcorner = fid.xllcorner[0]
-    yllcorner = fid.yllcorner[0]
+    xllcorner = fid.xllcorner
+    yllcorner = fid.yllcorner
 
     #Points stored in sts file are normalised to [xllcorner,yllcorner] but
Index: /trunk/anuga_core/source/anuga/file/sww.py
===================================================================
--- /trunk/anuga_core/source/anuga/file/sww.py	(revision 8779)
+++ /trunk/anuga_core/source/anuga/file/sww.py	(revision 8780)
@@ -17,5 +17,5 @@
 from anuga.utilities.numerical_tools import ensure_numeric
 import anuga.utilities.log as log
-from Scientific.IO.NetCDF import NetCDFFile
+from anuga.file.netcdf import NetCDFFile
 
 from sts import Write_sts
@@ -67,5 +67,4 @@
     def __init__(self, domain, 
                  mode=netcdf_mode_w, max_size=2000000000, recursion=False):
-        from Scientific.IO.NetCDF import NetCDFFile
 
         self.precision = netcdf_float32 # Use single precision for quantities
@@ -103,5 +102,5 @@
         fid = NetCDFFile(self.filename, mode)
         if mode[0] == 'w':
-            description = 'Output from anuga.file.sww' \
+            description = 'Output from anuga.file.sww ' \
                           'suitable for plotting'
                           
@@ -165,5 +164,4 @@
         # stores both connectivity (triangulation) and static quantities
         
-        from Scientific.IO.NetCDF import NetCDFFile
 
         domain = self.domain
@@ -211,5 +209,4 @@
         """
 
-        from Scientific.IO.NetCDF import NetCDFFile
         import types
         from time import sleep
@@ -566,5 +563,5 @@
         outfile.createVariable('y', sww_precision, ('number_of_points',))
 
-        outfile.createVariable('volumes', netcdf_int, ('number_of_volumes',
+        outfile.createVariable('volumes', netcdf_int , ('number_of_volumes',
                                                        'number_of_vertices'))
 
@@ -588,4 +585,7 @@
 
 
+        outfile.sync()
+
+
 
     def store_triangulation(self,
@@ -639,5 +639,7 @@
 
         number_of_points = len(points_utm)
-        volumes = num.array(volumes)
+        volumes = num.array(volumes,num.int32).reshape(-1,3)
+
+
         points_utm = num.array(points_utm)
 
@@ -668,6 +670,6 @@
         y =  points[:,1]
 
-        x = x.astype(netcdf_float32)
-        y = y.astype(netcdf_float32)
+        #x = x.astype(netcdf_float32)
+        #y = y.astype(netcdf_float32)
         
 
@@ -688,5 +690,12 @@
         outfile.variables['x'][:] = x #- geo_ref.get_xllcorner()
         outfile.variables['y'][:] = y #- geo_ref.get_yllcorner()
-        outfile.variables['volumes'][:] = volumes.astype(num.int32) #On Opteron 64
+
+
+        msg = 'Mismatch between shape of volumes array and (number_of_volumes , 3)'
+        assert volumes.shape == outfile.variables['volumes'].shape, msg
+
+        outfile.variables['volumes'][:] = volumes
+
+        outfile.sync()
 
 
@@ -733,4 +742,7 @@
 
         outfile.variables['tri_full_flag'][:] = tri_full_flag.astype(num.int32)
+
+
+        outfile.sync()
 
 
@@ -782,5 +794,5 @@
 
                     
-                    
+        outfile.sync()
         
         
@@ -851,4 +863,9 @@
                     outfile.variables[q + Write_sww.RANGE][1] = q_values_max
 
+
+        outfile.sync()
+
+        
+
     def verbose_quantities(self, outfile):
         log.critical('------------------------------------------------')
@@ -873,5 +890,4 @@
     """
 
-    from Scientific.IO.NetCDF import NetCDFFile
 
     #Get NetCDF
@@ -903,5 +919,4 @@
     """
     
-    from Scientific.IO.NetCDF import NetCDFFile
     from anuga.shallow_water.shallow_water_domain import Domain
 
@@ -920,10 +935,11 @@
     x = fid.variables['x'][:]                   # x-coordinates of vertices
     y = fid.variables['y'][:]                   # y-coordinates of vertices
-    elevation = fid.variables['elevation']      # Elevation
-    stage = fid.variables['stage']              # Water level
-    xmomentum = fid.variables['xmomentum']      # Momentum in the x-direction
-    ymomentum = fid.variables['ymomentum']      # Momentum in the y-direction
-
-    starttime = fid.starttime[0]
+    #elevation = fid.variables['elevation']      # Elevation
+    #stage = fid.variables['stage']              # Water level
+    #xmomentum = fid.variables['xmomentum']      # Momentum in the x-direction
+    #ymomentum = fid.variables['ymomentum']      # Momentum in the y-direction
+
+    starttime = fid.starttime
+    #starttime = fid.starttime[0]
     volumes = fid.variables['volumes'][:]       # Connectivity
     coordinates = num.transpose(num.asarray([x.tolist(), y.tolist()]))
@@ -1078,5 +1094,4 @@
 
     import types
-    from Scientific.IO.NetCDF import NetCDFFile
     from anuga.abstract_2d_finite_volumes.neighbour_mesh import Mesh
 
@@ -1085,9 +1100,12 @@
     fid = NetCDFFile(filename, netcdf_mode_r)    # Open existing file for read
     time = fid.variables['time'][:]    # Time vector
-    time += fid.starttime[0]
+    #time += fid.starttime[0]
+    time += fid.starttime
 
     # Get the variables as numeric arrays
     x = fid.variables['x'][:]                   # x-coordinates of nodes
     y = fid.variables['y'][:]                   # y-coordinates of nodes
+
+
     elevation = fid.variables['elevation'][:]   # Elevation
     stage = fid.variables['stage'][:]           # Water level
@@ -1095,7 +1113,9 @@
     ymomentum = fid.variables['ymomentum'][:]   # Momentum in the y-direction
 
+
+
     # Mesh (nodes (Mx2), triangles (Nx3))
     nodes = num.concatenate((x[:,num.newaxis], y[:,num.newaxis]), axis=1)
-    triangles = fid.variables['volumes'][:]
+    triangles = fid.variables['volumes']
 
     # Get geo_reference
Index: /trunk/anuga_core/source/anuga/file/test_mux.py
===================================================================
--- /trunk/anuga_core/source/anuga/file/test_mux.py	(revision 8779)
+++ /trunk/anuga_core/source/anuga/file/test_mux.py	(revision 8780)
@@ -4,5 +4,5 @@
 import os
 from struct import pack, unpack
-from Scientific.IO.NetCDF import NetCDFFile
+from anuga.file.netcdf import NetCDFFile
 
 from anuga.utilities.numerical_tools import ensure_numeric
Index: /trunk/anuga_core/source/anuga/file/test_sww.py
===================================================================
--- /trunk/anuga_core/source/anuga/file/test_sww.py	(revision 8779)
+++ /trunk/anuga_core/source/anuga/file/test_sww.py	(revision 8780)
@@ -10,5 +10,5 @@
 from sww import load_sww_as_domain, weed, get_mesh_and_quantities_from_file, \
                 Write_sww
-from Scientific.IO.NetCDF import NetCDFFile
+from anuga.file.netcdf import NetCDFFile
 
 from anuga.config import netcdf_mode_w, netcdf_float
@@ -184,5 +184,4 @@
         
         import time, os
-        from Scientific.IO.NetCDF import NetCDFFile
 
         # Setup
@@ -199,5 +198,5 @@
                         geo_reference = Geo_reference(56,308500,6189000))
 
-        domain.set_name('flowtest')
+        domain.set_name('test_get_mesh_and_quantities_from_sww_file')
         swwfile = domain.get_name() + '.sww'
         domain.set_datadir('.')
@@ -247,5 +246,5 @@
             
         # Cleanup
-        os.remove(swwfile)
+        #os.remove(swwfile)
         
         
@@ -277,6 +276,6 @@
         filename = tempfile.mktemp("_data_manager.sww")
         outfile = NetCDFFile(filename, netcdf_mode_w)
-        points_utm = num.array([[0.,0.],[1.,1.], [0.,1.]])
-        volumes = (0,1,2)
+        points_utm = num.array([[0.,0.],[1.,1.],[0.,1.]])
+        volumes = [[0,1,2]]
         elevation = [0,1,2]
         new_origin = None
@@ -312,5 +311,5 @@
         outfile = NetCDFFile(filename, netcdf_mode_w)
         points_utm = num.array([[0.,0.],[1.,1.], [0.,1.]])
-        volumes = (0,1,2)
+        volumes = [[0,1,2]]
         elevation = [0,1,2]
         new_origin = None
@@ -349,5 +348,5 @@
         outfile = NetCDFFile(filename, netcdf_mode_w)
         points_utm = num.array([[0.,0.],[1.,1.], [0.,1.]])
-        volumes = (0,1,2)
+        volumes = [[0,1,2]]
         elevation = [0,1,2]
         new_origin = None
@@ -388,5 +387,5 @@
         outfile = NetCDFFile(filename, netcdf_mode_w)
         points_utm = num.array([[0.,0.],[1.,1.], [0.,1.]])
-        volumes = (0,1,2)
+        volumes = [[0,1,2]]
         elevation = [0,1,2]
         new_origin = None
@@ -424,5 +423,5 @@
         outfile = NetCDFFile(filename, netcdf_mode_w)
         points_utm = num.array([[0.,0.],[1.,1.], [0.,1.]])
-        volumes = (0,1,2)
+        volumes = [[0,1,2]]
         elevation = [0,1,2]
         new_origin = Geo_reference(56, 1, 1)
Index: /trunk/anuga_core/source/anuga/file_conversion/asc2dem.py
===================================================================
--- /trunk/anuga_core/source/anuga/file_conversion/asc2dem.py	(revision 8779)
+++ /trunk/anuga_core/source/anuga/file_conversion/asc2dem.py	(revision 8780)
@@ -64,5 +64,5 @@
 
     import os
-    from Scientific.IO.NetCDF import NetCDFFile
+    from anuga.file.netcdf import NetCDFFile
 
     root = name_in[:-4]
Index: /trunk/anuga_core/source/anuga/file_conversion/csv2sts.py
===================================================================
--- /trunk/anuga_core/source/anuga/file_conversion/csv2sts.py	(revision 8779)
+++ /trunk/anuga_core/source/anuga/file_conversion/csv2sts.py	(revision 8780)
@@ -57,5 +57,5 @@
 import getopt
 from anuga.utilities import log
-from Scientific.IO.NetCDF import NetCDFFile
+from anuga.file.netcdf import NetCDFFile
 from anuga.file.csv_file import load_csv_as_dict
 from anuga.config import netcdf_mode_w, netcdf_float
@@ -98,5 +98,5 @@
         fid.createVariable(col, netcdf_float, ('number_of_timesteps',))
         
-        fid.variables[col].assignValue(timeseries_data[col])
+        fid.variables[col][:] = timeseries_data[col]
 
     fid.close()
Index: /trunk/anuga_core/source/anuga/file_conversion/dem2dem.py
===================================================================
--- /trunk/anuga_core/source/anuga/file_conversion/dem2dem.py	(revision 8779)
+++ /trunk/anuga_core/source/anuga/file_conversion/dem2dem.py	(revision 8780)
@@ -24,5 +24,5 @@
 
     import os
-    from Scientific.IO.NetCDF import NetCDFFile
+    from anuga.file.netcdf import NetCDFFile
 
     if name_in[-4:] != '.dem':
@@ -38,13 +38,13 @@
 
     # Read metadata (convert from numpy.int32 to int where appropriate)
-    ncols = int(infile.ncols[0])
-    nrows = int(infile.nrows[0])
-    xllcorner = infile.xllcorner[0]
-    yllcorner = infile.yllcorner[0]
-    cellsize = int(infile.cellsize[0])
-    NODATA_value = int(infile.NODATA_value[0])
-    zone = int(infile.zone[0])
-    false_easting = infile.false_easting[0]
-    false_northing = infile.false_northing[0]
+    ncols = int(infile.ncols)
+    nrows = int(infile.nrows)
+    xllcorner = infile.xllcorner
+    yllcorner = infile.yllcorner
+    cellsize = int(infile.cellsize)
+    NODATA_value = int(infile.NODATA_value)
+    zone = int(infile.zone)
+    false_easting = infile.false_easting
+    false_northing = infile.false_northing
     projection = infile.projection
     datum = infile.datum
Index: /trunk/anuga_core/source/anuga/file_conversion/dem2pts.py
===================================================================
--- /trunk/anuga_core/source/anuga/file_conversion/dem2pts.py	(revision 8779)
+++ /trunk/anuga_core/source/anuga/file_conversion/dem2pts.py	(revision 8780)
@@ -64,5 +64,5 @@
 
     import os
-    from Scientific.IO.NetCDF import NetCDFFile
+    from anuga.file.netcdf import NetCDFFile
 
     root = name_in[:-4]
@@ -86,15 +86,15 @@
     if verbose: log.critical('Reading DEM from %s' % (name_in))
 
-    ncols = infile.ncols[0]
-    nrows = infile.nrows[0]
-    xllcorner = infile.xllcorner[0]  # Easting of lower left corner
-    yllcorner = infile.yllcorner[0]  # Northing of lower left corner
-    cellsize = infile.cellsize[0]
-    NODATA_value = infile.NODATA_value[0]
+    ncols = infile.ncols
+    nrows = infile.nrows
+    xllcorner = infile.xllcorner  # Easting of lower left corner
+    yllcorner = infile.yllcorner  # Northing of lower left corner
+    cellsize = infile.cellsize
+    NODATA_value = infile.NODATA_value
     dem_elevation = infile.variables['elevation']
 
-    zone = infile.zone[0]
-    false_easting = infile.false_easting[0]
-    false_northing = infile.false_northing[0]
+    zone = infile.zone
+    false_easting = infile.false_easting
+    false_northing = infile.false_northing
 
     # Text strings
Index: /trunk/anuga_core/source/anuga/file_conversion/esri2sww.py
===================================================================
--- /trunk/anuga_core/source/anuga/file_conversion/esri2sww.py	(revision 8779)
+++ /trunk/anuga_core/source/anuga/file_conversion/esri2sww.py	(revision 8780)
@@ -37,5 +37,5 @@
     """
 
-    from Scientific.IO.NetCDF import NetCDFFile
+    from anuga.file.netcdf import NetCDFFile
 
     from anuga.coordinate_transforms.redfearn import redfearn
Index: /trunk/anuga_core/source/anuga/file_conversion/ferret2sww.py
===================================================================
--- /trunk/anuga_core/source/anuga/file_conversion/ferret2sww.py	(revision 8779)
+++ /trunk/anuga_core/source/anuga/file_conversion/ferret2sww.py	(revision 8780)
@@ -60,5 +60,5 @@
     """
 
-    from Scientific.IO.NetCDF import NetCDFFile
+    from anuga.file.netcdf import NetCDFFile
 
     _assert_lat_long(minlat, maxlat, minlon, maxlon)
@@ -176,9 +176,9 @@
 
     # Get missing values
-    nan_ha = file_h.variables['HA'].missing_value[0]
-    nan_ua = file_u.variables['UA'].missing_value[0]
-    nan_va = file_v.variables['VA'].missing_value[0]
+    nan_ha = file_h.variables['HA'].missing_value
+    nan_ua = file_u.variables['UA'].missing_value
+    nan_va = file_v.variables['VA'].missing_value
     if hasattr(file_e.variables[zname],'missing_value'):
-        nan_e  = file_e.variables[zname].missing_value[0]
+        nan_e  = file_e.variables[zname].missing_value
     else:
         nan_e = None
Index: /trunk/anuga_core/source/anuga/file_conversion/file_conversion.py
===================================================================
--- /trunk/anuga_core/source/anuga/file_conversion/file_conversion.py	(revision 8779)
+++ /trunk/anuga_core/source/anuga/file_conversion/file_conversion.py	(revision 8780)
@@ -8,5 +8,5 @@
 
 #non ANUGA imports
-from Scientific.IO.NetCDF import NetCDFFile
+from anuga.file.netcdf import NetCDFFile
 import numpy as num
 import os.path
@@ -39,6 +39,4 @@
     """
 
-    from Scientific.IO.NetCDF import NetCDFFile
-
     if filename[-4:] != '.sww':
         raise IOError('Output file %s should be of type .sww.' % sww_file)
@@ -186,6 +184,4 @@
 
     #Create NetCDF file
-    from Scientific.IO.NetCDF import NetCDFFile
-
     fid = NetCDFFile(file_out, netcdf_mode_w)
 
Index: /trunk/anuga_core/source/anuga/file_conversion/sdf2pts.py
===================================================================
--- /trunk/anuga_core/source/anuga/file_conversion/sdf2pts.py	(revision 8779)
+++ /trunk/anuga_core/source/anuga/file_conversion/sdf2pts.py	(revision 8780)
@@ -92,5 +92,5 @@
 
     import os
-    from Scientific.IO.NetCDF import NetCDFFile
+    from anuga.file.netcdf import NetCDFFile
 
     if name_in[-4:] != '.sdf':
Index: /trunk/anuga_core/source/anuga/file_conversion/sts2sww_mesh.py
===================================================================
--- /trunk/anuga_core/source/anuga/file_conversion/sts2sww_mesh.py	(revision 8779)
+++ /trunk/anuga_core/source/anuga/file_conversion/sts2sww_mesh.py	(revision 8780)
@@ -1,5 +1,5 @@
 import os
 import numpy as num
-from Scientific.IO.NetCDF import NetCDFFile
+from anuga.file.netcdf import NetCDFFile
 import pylab as P
 
@@ -37,5 +37,5 @@
     x_origin = infile.xllcorner
     y_origin = infile.yllcorner
-    origin = num.array([x_origin[0], y_origin[0]])
+    origin = num.array([x_origin, y_origin])
     x = infile.variables['x'][:]
     y = infile.variables['y'][:]
Index: /trunk/anuga_core/source/anuga/file_conversion/sww2array.py
===================================================================
--- /trunk/anuga_core/source/anuga/file_conversion/sww2array.py	(revision 8779)
+++ /trunk/anuga_core/source/anuga/file_conversion/sww2array.py	(revision 8780)
@@ -100,5 +100,5 @@
 
 
-    from Scientific.IO.NetCDF import NetCDFFile
+    from anuga.file.netcdf import NetCDFFile
     fid = NetCDFFile(name_in)
 
Index: /trunk/anuga_core/source/anuga/file_conversion/sww2dem.py
===================================================================
--- /trunk/anuga_core/source/anuga/file_conversion/sww2dem.py	(revision 8779)
+++ /trunk/anuga_core/source/anuga/file_conversion/sww2dem.py	(revision 8780)
@@ -131,5 +131,5 @@
         log.critical('Output directory is %s' % name_out)
 
-    from Scientific.IO.NetCDF import NetCDFFile
+    from anuga.file.netcdf import NetCDFFile
     fid = NetCDFFile(name_in)
 
@@ -143,6 +143,12 @@
         times = fid.variables['time'][:]
 
-    number_of_timesteps = fid.dimensions['number_of_timesteps']
-    number_of_points = fid.dimensions['number_of_points']
+    try: # works with netcdf4
+        number_of_timesteps = len(fid.dimensions['number_of_timesteps'])
+        number_of_points = len(fid.dimensions['number_of_points'])
+    except: #works with scientific.io.netcdf
+        number_of_timesteps = fid.dimensions['number_of_timesteps']
+        number_of_points = fid.dimensions['number_of_points']
+
+
 
     if origin is None:
@@ -216,4 +222,6 @@
 
     # Create result array and start filling, block by block.
+
+
     result = num.zeros(number_of_points, num.float)
 
Index: /trunk/anuga_core/source/anuga/file_conversion/sww2dem_new.py
===================================================================
--- /trunk/anuga_core/source/anuga/file_conversion/sww2dem_new.py	(revision 8779)
+++ /trunk/anuga_core/source/anuga/file_conversion/sww2dem_new.py	(revision 8780)
@@ -132,5 +132,5 @@
         log.critical('Output directory is %s' % name_out)
 
-    from Scientific.IO.NetCDF import NetCDFFile
+    from anuga.file.netcdf import NetCDFFile
     fid = NetCDFFile(name_in)
 
Index: /trunk/anuga_core/source/anuga/file_conversion/sww2pts.py
===================================================================
--- /trunk/anuga_core/source/anuga/file_conversion/sww2pts.py	(revision 8779)
+++ /trunk/anuga_core/source/anuga/file_conversion/sww2pts.py	(revision 8780)
@@ -56,5 +56,5 @@
     # Read sww file
     if verbose: log.critical('Reading from %s' % name_in)
-    from Scientific.IO.NetCDF import NetCDFFile
+    from anuga.file.netcdf import NetCDFFile
     fid = NetCDFFile(name_in)
 
@@ -64,6 +64,13 @@
     volumes = fid.variables['volumes'][:]
 
-    number_of_timesteps = fid.dimensions['number_of_timesteps']
-    number_of_points = fid.dimensions['number_of_points']
+
+    try: # works with netcdf4
+        number_of_timesteps = len(fid.dimensions['number_of_timesteps'])
+        number_of_points = len(fid.dimensions['number_of_points'])
+    except: #works with scientific.io.netcdf
+        number_of_timesteps = fid.dimensions['number_of_timesteps']
+        number_of_points = fid.dimensions['number_of_points']
+
+        
     if origin is None:
         # Get geo_reference
Index: /trunk/anuga_core/source/anuga/file_conversion/test_2pts.py
===================================================================
--- /trunk/anuga_core/source/anuga/file_conversion/test_2pts.py	(revision 8779)
+++ /trunk/anuga_core/source/anuga/file_conversion/test_2pts.py	(revision 8780)
@@ -29,5 +29,5 @@
 
         import time, os
-        from Scientific.IO.NetCDF import NetCDFFile
+        from anuga.file.netcdf import NetCDFFile
 
         #Write test asc file
@@ -160,5 +160,5 @@
 
         import time, os
-        from Scientific.IO.NetCDF import NetCDFFile
+        from anuga.file.netcdf import NetCDFFile
         # Used for points that lie outside mesh
         NODATA_value = 1758323
Index: /trunk/anuga_core/source/anuga/file_conversion/test_csv2sts.py
===================================================================
--- /trunk/anuga_core/source/anuga/file_conversion/test_csv2sts.py	(revision 8779)
+++ /trunk/anuga_core/source/anuga/file_conversion/test_csv2sts.py	(revision 8780)
@@ -4,5 +4,5 @@
 import unittest
 import numpy as num
-from Scientific.IO.NetCDF import NetCDFFile
+from anuga.file.netcdf import NetCDFFile
 
 # ANUGA modules
Index: /trunk/anuga_core/source/anuga/file_conversion/test_dem2dem.py
===================================================================
--- /trunk/anuga_core/source/anuga/file_conversion/test_dem2dem.py	(revision 8779)
+++ /trunk/anuga_core/source/anuga/file_conversion/test_dem2dem.py	(revision 8780)
@@ -39,5 +39,5 @@
 
         import os
-        from Scientific.IO.NetCDF import NetCDFFile
+        from anuga.file.netcdf import NetCDFFile
 
         #Write test dem file
@@ -121,5 +121,5 @@
 
         import os
-        from Scientific.IO.NetCDF import NetCDFFile
+        from anuga.file.netcdf import NetCDFFile
 
         # Write test dem file
Index: /trunk/anuga_core/source/anuga/file_conversion/test_dem2pts.py
===================================================================
--- /trunk/anuga_core/source/anuga/file_conversion/test_dem2pts.py	(revision 8779)
+++ /trunk/anuga_core/source/anuga/file_conversion/test_dem2pts.py	(revision 8780)
@@ -8,4 +8,6 @@
 from anuga.config import netcdf_mode_r, netcdf_mode_w, netcdf_mode_a, \
                             netcdf_float
+
+from anuga.file.netcdf import NetCDFFile
 
 from dem2pts import dem2pts
@@ -24,5 +26,5 @@
 
         import time, os
-        from Scientific.IO.NetCDF import NetCDFFile
+
 
         #Write test asc file
@@ -93,6 +95,6 @@
 
         #Check values
-        assert fid.xllcorner[0] == 2002.0
-        assert fid.yllcorner[0] == 3003.0
+        assert fid.xllcorner == 2002.0
+        assert fid.yllcorner == 3003.0
 
         #create new reference points
@@ -136,5 +138,4 @@
 
         import time, os
-        from Scientific.IO.NetCDF import NetCDFFile
 
         #Write test asc file
@@ -211,6 +212,6 @@
 
         #Check values
-        assert fid.xllcorner[0] == 2002.0
-        assert fid.yllcorner[0] == 3003.0
+        assert fid.xllcorner == 2002.0
+        assert fid.yllcorner == 3003.0
 
         #create new reference points
@@ -264,5 +265,4 @@
 
         import time, os
-        from Scientific.IO.NetCDF import NetCDFFile
 
         #Write test asc file
@@ -339,6 +339,6 @@
 
         #Check values
-        assert fid.xllcorner[0] == 2002.0
-        assert fid.yllcorner[0] == 3003.0
+        assert fid.xllcorner == 2002.0
+        assert fid.yllcorner == 3003.0
 
         #create new reference points
Index: /trunk/anuga_core/source/anuga/file_conversion/test_file_conversion.py
===================================================================
--- /trunk/anuga_core/source/anuga/file_conversion/test_file_conversion.py	(revision 8779)
+++ /trunk/anuga_core/source/anuga/file_conversion/test_file_conversion.py	(revision 8780)
@@ -11,5 +11,5 @@
 from anuga.file_conversion.urs2nc import lon_lat2grid
 from anuga.config import netcdf_float, epsilon, g
-from Scientific.IO.NetCDF import NetCDFFile
+from anuga.file.netcdf import NetCDFFile
 
 from anuga.file_conversion.file_conversion import tsh2sww
@@ -108,5 +108,5 @@
             fid.variables[long_name].point_spacing='uneven'
             fid.variables[long_name].units='degrees_east'
-            fid.variables[long_name].assignValue(longitudes)
+            fid.variables[long_name][:] = longitudes
 
             fid.createDimension(lat_name,ny)
@@ -114,5 +114,5 @@
             fid.variables[lat_name].point_spacing='uneven'
             fid.variables[lat_name].units='degrees_north'
-            fid.variables[lat_name].assignValue(latitudes)
+            fid.variables[lat_name][:] = latitudes
 
             fid.createDimension('TIME',six)
@@ -120,5 +120,5 @@
             fid.variables['TIME'].point_spacing='uneven'
             fid.variables['TIME'].units='seconds'
-            fid.variables['TIME'].assignValue([0.0, 0.1, 0.6, 1.1, 1.6, 2.1])
+            fid.variables['TIME'][:] = [0.0, 0.1, 0.6, 1.1, 1.6, 2.1]
 
 
@@ -129,5 +129,5 @@
             fid.variables[name].missing_value=-1.e+034
 
-            fid.variables[name].assignValue([[[0.3400644, 0, -46.63519, -6.50198],
+            fid.variables[name][:] = [[[0.3400644, 0, -46.63519, -6.50198],
                                               [-0.1214216, 0, 0, 0],
                                               [0, 0, 0, 0],
@@ -152,5 +152,5 @@
                                               [-0.1209405, 0.0009771062, 0.02527271, 2.617787e-005],
                                               [0.0004811212, 0.0009622425, 0.0009599366, 8.152277e-007],
-                                              [0, 0.0004811212, 0.0004811212, 0]]])
+                                              [0, 0.0004811212, 0.0004811212, 0]]]
 
 
@@ -170,5 +170,4 @@
         ferret format (lat/lon) to sww format (UTM)
         """
-        from Scientific.IO.NetCDF import NetCDFFile
         import os, sys
 
@@ -236,5 +235,4 @@
         """Test that zscale workse
         """
-        from Scientific.IO.NetCDF import NetCDFFile
         import os, sys
 
@@ -326,5 +324,4 @@
         ferret format (lat/lon) to sww format (UTM)
         """
-        from Scientific.IO.NetCDF import NetCDFFile
 
         #The test file has
@@ -469,5 +466,4 @@
         """Elevation included
         """
-        from Scientific.IO.NetCDF import NetCDFFile
 
         #The test file has
@@ -506,5 +502,5 @@
             fid.variables[long_name].point_spacing='uneven'
             fid.variables[long_name].units='degrees_east'
-            fid.variables[long_name].assignValue(h1_list)
+            fid.variables[long_name][:] = h1_list
 
             fid.createDimension(lat_name,ny)
@@ -512,5 +508,5 @@
             fid.variables[lat_name].point_spacing='uneven'
             fid.variables[lat_name].units='degrees_north'
-            fid.variables[lat_name].assignValue(h2_list)
+            fid.variables[lat_name][:] = h2_list
 
             fid.createDimension(time_name,2)
@@ -518,5 +514,5 @@
             fid.variables[time_name].point_spacing='uneven'
             fid.variables[time_name].units='seconds'
-            fid.variables[time_name].assignValue([0.,1.])
+            fid.variables[time_name][:] = [0.,1.]
             #if fid == fid3: break
 
@@ -527,5 +523,5 @@
             fid.variables[long_name].point_spacing='uneven'
             fid.variables[long_name].units='degrees_east'
-            fid.variables[long_name].assignValue(h1_list)
+            fid.variables[long_name][:] = h1_list
 
             fid.createDimension(lat_name,ny)
@@ -533,5 +529,5 @@
             fid.variables[lat_name].point_spacing='uneven'
             fid.variables[lat_name].units='degrees_north'
-            fid.variables[lat_name].assignValue(h2_list)
+            fid.variables[lat_name][:] = h2_list
 
         name = {}
@@ -557,5 +553,5 @@
           fid.variables[name[fid]].point_spacing='uneven'
           fid.variables[name[fid]].units=units[fid]
-          fid.variables[name[fid]].assignValue(values[fid])
+          fid.variables[name[fid]][:] = values[fid]
           fid.variables[name[fid]].missing_value = -99999999.
           #if fid == fid3: break
@@ -565,5 +561,5 @@
             fid.variables[name[fid]].point_spacing='uneven'
             fid.variables[name[fid]].units=units[fid]
-            fid.variables[name[fid]].assignValue(values[fid])
+            fid.variables[name[fid]][:] = values[fid]
             fid.variables[name[fid]].missing_value = -99999999.
 
@@ -629,5 +625,4 @@
         in files produced by ferret as opposed to MOST
         """
-        from Scientific.IO.NetCDF import NetCDFFile
 
         #The test file has
@@ -670,5 +665,5 @@
             fid.variables[long_name].point_spacing='uneven'
             fid.variables[long_name].units='degrees_east'
-            fid.variables[long_name].assignValue(h1_list)
+            fid.variables[long_name][:] = h1_list
 
             fid.createDimension(lat_name,ny)
@@ -676,5 +671,5 @@
             fid.variables[lat_name].point_spacing='uneven'
             fid.variables[lat_name].units='degrees_north'
-            fid.variables[lat_name].assignValue(h2_list)
+            fid.variables[lat_name][:] = h2_list
 
             fid.createDimension(time_name,2)
@@ -682,5 +677,5 @@
             fid.variables[time_name].point_spacing='uneven'
             fid.variables[time_name].units='seconds'
-            fid.variables[time_name].assignValue([0.,1.])
+            fid.variables[time_name][:] = [0.,1.]
             #if fid == fid3: break
 
@@ -691,5 +686,5 @@
             fid.variables[long_name].point_spacing='uneven'
             fid.variables[long_name].units='degrees_east'
-            fid.variables[long_name].assignValue(h1_list)
+            fid.variables[long_name][:] = h1_list
 
             fid.createDimension(lat_name,ny)
@@ -697,5 +692,5 @@
             fid.variables[lat_name].point_spacing='uneven'
             fid.variables[lat_name].units='degrees_north'
-            fid.variables[lat_name].assignValue(h2_list)
+            fid.variables[lat_name][:] = h2_list
 
         name = {}
@@ -721,5 +716,5 @@
           fid.variables[name[fid]].point_spacing='uneven'
           fid.variables[name[fid]].units=units[fid]
-          fid.variables[name[fid]].assignValue(values[fid])
+          fid.variables[name[fid]][:] = values[fid]
           fid.variables[name[fid]].missing_value = -99999999.
           #if fid == fid3: break
@@ -729,5 +724,5 @@
             fid.variables[name[fid]].point_spacing='uneven'
             fid.variables[name[fid]].units=units[fid]
-            fid.variables[name[fid]].assignValue(values[fid])
+            fid.variables[name[fid]][:] = values[fid]
             fid.variables[name[fid]].missing_value = -99999999.
 
@@ -791,5 +786,4 @@
 
     def test_ferret2sww_nz_origin(self):
-        from Scientific.IO.NetCDF import NetCDFFile
         from anuga.coordinate_transforms.redfearn import redfearn
 
@@ -850,5 +844,5 @@
 
         import time, os
-        from Scientific.IO.NetCDF import NetCDFFile
+
 
         self.domain.set_name('datatest' + str(id(self)))
Index: /trunk/anuga_core/source/anuga/file_conversion/test_sww2dem.py
===================================================================
--- /trunk/anuga_core/source/anuga/file_conversion/test_sww2dem.py	(revision 8779)
+++ /trunk/anuga_core/source/anuga/file_conversion/test_sww2dem.py	(revision 8780)
@@ -5,4 +5,5 @@
 from anuga.shallow_water.shallow_water_domain import Domain
 from anuga.config import netcdf_mode_r
+from anuga.file.netcdf import NetCDFFile
 
 from anuga.coordinate_transforms.geo_reference import Geo_reference, \
@@ -85,5 +86,4 @@
 
         import time, os
-        from Scientific.IO.NetCDF import NetCDFFile
 
         # Setup
@@ -124,7 +124,7 @@
         
         # Check georeferencig: zone, xllcorner and yllcorner
-        assert fid.zone[0] == 56
-        assert fid.xllcorner[0] == 308500
-        assert fid.yllcorner[0] == 6189000
+        assert fid.zone == 56
+        assert fid.xllcorner == 308500
+        assert fid.yllcorner == 6189000
                 
 
@@ -300,5 +300,4 @@
 
         import time, os
-        from Scientific.IO.NetCDF import NetCDFFile
 
         #Create basic mesh (100m x 100m)
@@ -466,5 +465,4 @@
 
         import time, os
-        from Scientific.IO.NetCDF import NetCDFFile
 
         #Setup
@@ -660,5 +658,4 @@
 
         import time, os
-        from Scientific.IO.NetCDF import NetCDFFile
 
         #Setup
@@ -825,5 +822,4 @@
 
         import time, os
-        from Scientific.IO.NetCDF import NetCDFFile
 
         #Setup
@@ -933,5 +929,4 @@
 
         import time, os
-        from Scientific.IO.NetCDF import NetCDFFile
 
         #Setup
@@ -1038,5 +1033,4 @@
 
         import time, os
-        from Scientific.IO.NetCDF import NetCDFFile
 
         #Setup
@@ -1152,5 +1146,4 @@
 
         import time, os
-        from Scientific.IO.NetCDF import NetCDFFile
 
         #Setup mesh not coinciding with rectangle.
@@ -1298,5 +1291,4 @@
 
         import time, os
-        from Scientific.IO.NetCDF import NetCDFFile
 
 
@@ -1396,5 +1388,4 @@
 
         import time, os
-        from Scientific.IO.NetCDF import NetCDFFile
 
         base_name = 'tegp'
@@ -1527,5 +1518,4 @@
 
         import time, os
-        from Scientific.IO.NetCDF import NetCDFFile
 
         try:
@@ -1611,5 +1601,4 @@
 
         import time, os
-        from Scientific.IO.NetCDF import NetCDFFile
 
         try:
@@ -1747,5 +1736,4 @@
 
         import time, os
-        from Scientific.IO.NetCDF import NetCDFFile
 
         try:
Index: /trunk/anuga_core/source/anuga/file_conversion/test_urs2sts.py
===================================================================
--- /trunk/anuga_core/source/anuga/file_conversion/test_urs2sts.py	(revision 8779)
+++ /trunk/anuga_core/source/anuga/file_conversion/test_urs2sts.py	(revision 8780)
@@ -4,5 +4,5 @@
 import os
 import sys
-from Scientific.IO.NetCDF import NetCDFFile
+from anuga.file.netcdf import NetCDFFile
 
 from anuga.utilities.system_tools import get_pathname_from_package
@@ -276,5 +276,5 @@
             #print k, time_start_z[k,:]
             starttime = min(time_start_z[k, :])
-            sts_starttime = fid.starttime[0]
+            sts_starttime = fid.starttime
             msg = 'sts starttime for source %d was %f. Should have been %f'\
                 %(source_number, sts_starttime, starttime)
@@ -440,5 +440,5 @@
         # across all stations (for this source)
         starttime = min(time_start_z[:])
-        sts_starttime = fid.starttime[0]
+        sts_starttime = fid.starttime
         msg = 'sts starttime was %f. Should have been %f'\
             %(sts_starttime, starttime)
@@ -2031,5 +2031,5 @@
         # Check the time vector
         times = fid.variables['time'][:]
-        starttime = fid.starttime[0]
+        starttime = fid.starttime
         #print times
         #print starttime
Index: /trunk/anuga_core/source/anuga/file_conversion/test_urs2sww.py
===================================================================
--- /trunk/anuga_core/source/anuga/file_conversion/test_urs2sww.py	(revision 8779)
+++ /trunk/anuga_core/source/anuga/file_conversion/test_urs2sww.py	(revision 8780)
@@ -1,5 +1,5 @@
 
 # External modules
-from Scientific.IO.NetCDF import NetCDFFile
+from anuga.file.netcdf import NetCDFFile
 import sys
 import unittest
Index: /trunk/anuga_core/source/anuga/file_conversion/urs2sts.py
===================================================================
--- /trunk/anuga_core/source/anuga/file_conversion/urs2sts.py	(revision 8779)
+++ /trunk/anuga_core/source/anuga/file_conversion/urs2sts.py	(revision 8780)
@@ -68,5 +68,5 @@
 
     import os
-    from Scientific.IO.NetCDF import NetCDFFile
+    from anuga.file.netcdf import NetCDFFile
     from operator import __and__
 
Index: /trunk/anuga_core/source/anuga/file_conversion/urs2sww.py
===================================================================
--- /trunk/anuga_core/source/anuga/file_conversion/urs2sww.py	(revision 8779)
+++ /trunk/anuga_core/source/anuga/file_conversion/urs2sww.py	(revision 8780)
@@ -1,5 +1,5 @@
 import os
 import numpy as num
-from Scientific.IO.NetCDF import NetCDFFile
+from anuga.file.netcdf import NetCDFFile
 
 from anuga.file.urs import Read_urs
Index: /trunk/anuga_core/source/anuga/fit_interpolate/test_interpolate.py
===================================================================
--- /trunk/anuga_core/source/anuga/fit_interpolate/test_interpolate.py	(revision 8779)
+++ /trunk/anuga_core/source/anuga/fit_interpolate/test_interpolate.py	(revision 8780)
@@ -13,5 +13,5 @@
 import csv
 
-from Scientific.IO.NetCDF import NetCDFFile
+from anuga.file.netcdf import NetCDFFile
 
 import numpy as num
Index: /trunk/anuga_core/source/anuga/geospatial_data/geospatial_data.py
===================================================================
--- /trunk/anuga_core/source/anuga/geospatial_data/geospatial_data.py	(revision 8779)
+++ /trunk/anuga_core/source/anuga/geospatial_data/geospatial_data.py	(revision 8780)
@@ -12,5 +12,5 @@
 import copy
 
-from Scientific.IO.NetCDF import NetCDFFile
+from anuga.file.netcdf import NetCDFFile
 import numpy as num
 from numpy.random import randint, seed
@@ -1049,5 +1049,10 @@
         geo_reference = None
 
-    return geo_reference, keys, fid.dimensions['number_of_points']
+    try: # netcdf4
+        number_of_points = len(fid.dimensions['number_of_points'])
+    except: #scientific python
+        number_of_points = fid.dimensions['number_of_points']
+        
+    return geo_reference, keys, number_of_points
 
 
Index: /trunk/anuga_core/source/anuga/geospatial_data/test_geospatial_data.py
===================================================================
--- /trunk/anuga_core/source/anuga/geospatial_data/test_geospatial_data.py	(revision 8779)
+++ /trunk/anuga_core/source/anuga/geospatial_data/test_geospatial_data.py	(revision 8780)
@@ -1042,5 +1042,5 @@
 
     def test_loadpts(self):
-        from Scientific.IO.NetCDF import NetCDFFile
+        from anuga.file.netcdf import NetCDFFile
 
         fileName = tempfile.mktemp('.pts')
@@ -1200,5 +1200,5 @@
 
     def test_create_from_pts_file(self):
-        from Scientific.IO.NetCDF import NetCDFFile
+        from anuga.file.netcdf import NetCDFFile
 
         # NetCDF file definition
@@ -1240,5 +1240,5 @@
         '''Test if Geospatial data is correctly instantiated from a pts file.'''
 
-        from Scientific.IO.NetCDF import NetCDFFile
+        from anuga.file.netcdf import NetCDFFile
 
         # NetCDF file definition
Index: /trunk/anuga_core/source/anuga/load_mesh/loadASCII.py
===================================================================
--- /trunk/anuga_core/source/anuga/load_mesh/loadASCII.py	(revision 8779)
+++ /trunk/anuga_core/source/anuga/load_mesh/loadASCII.py	(revision 8780)
@@ -69,5 +69,5 @@
 import anuga.utilities.log as log
 
-from Scientific.IO.NetCDF import NetCDFFile
+from anuga.file.netcdf import NetCDFFile
 
 import numpy as num
Index: /trunk/anuga_core/source/anuga/shallow_water/forcing.py
===================================================================
--- /trunk/anuga_core/source/anuga/shallow_water/forcing.py	(revision 8779)
+++ /trunk/anuga_core/source/anuga/shallow_water/forcing.py	(revision 8780)
@@ -20,5 +20,5 @@
 from warnings import warn
 import numpy as num
-from Scientific.IO.NetCDF import NetCDFFile
+from anuga.file.netcdf import NetCDFFile
 from anuga.config import netcdf_mode_r, netcdf_mode_w, netcdf_mode_a
 from copy import copy
Index: /trunk/anuga_core/source/anuga/shallow_water/most2nc.py
===================================================================
--- /trunk/anuga_core/source/anuga/shallow_water/most2nc.py	(revision 8779)
+++ /trunk/anuga_core/source/anuga/shallow_water/most2nc.py	(revision 8780)
@@ -8,5 +8,5 @@
 
 import sys
-from Scientific.IO.NetCDF import NetCDFFile
+from anuga.file.netcdf import NetCDFFile
 from anuga.config import netcdf_mode_r, netcdf_mode_w, netcdf_mode_a
 import anuga.utilities.log as log
@@ -86,5 +86,5 @@
     out_file.variables[long_name].point_spacing='uneven'
     out_file.variables[long_name].units='degrees_east'
-    out_file.variables[long_name].assignValue(h1_list)
+    out_file.variables[long_name][:] = h1_list
 
     out_file.createDimension(lat_name,ny)
@@ -92,10 +92,10 @@
     out_file.variables[lat_name].point_spacing='uneven'
     out_file.variables[lat_name].units='degrees_north'
-    out_file.variables[lat_name].assignValue(h2_list)
+    out_file.variables[lat_name][:] = h2_list
 
     out_file.createVariable(elev_name,'d',(lat_name,long_name))
     out_file.variables[elev_name].point_spacing='uneven'
     out_file.variables[elev_name].units='meters'
-    out_file.variables[elev_name].assignValue(depth_list)
+    out_file.variables[elev_name][:] = depth_list
 
     out_file.close()
Index: /trunk/anuga_core/source/anuga/shallow_water/sww_interrogate.py
===================================================================
--- /trunk/anuga_core/source/anuga/shallow_water/sww_interrogate.py	(revision 8779)
+++ /trunk/anuga_core/source/anuga/shallow_water/sww_interrogate.py	(revision 8780)
@@ -323,5 +323,5 @@
     from anuga.geometry.polygon import inside_polygon
     from anuga.config import minimum_allowed_height
-    from Scientific.IO.NetCDF import NetCDFFile
+    from anuga.file.netcdf import NetCDFFile
 
     dir, base = os.path.split(filename)
Index: /trunk/anuga_core/source/anuga/shallow_water/test_data_manager.py
===================================================================
--- /trunk/anuga_core/source/anuga/shallow_water/test_data_manager.py	(revision 8779)
+++ /trunk/anuga_core/source/anuga/shallow_water/test_data_manager.py	(revision 8780)
@@ -18,5 +18,5 @@
 from struct import pack, unpack
 
-from Scientific.IO.NetCDF import NetCDFFile
+from anuga.file.netcdf import NetCDFFile
 
 
@@ -142,5 +142,5 @@
             fid.variables[long_name].point_spacing='uneven'
             fid.variables[long_name].units='degrees_east'
-            fid.variables[long_name].assignValue(longitudes)
+            fid.variables[long_name][:] = longitudes
 
             fid.createDimension(lat_name,ny)
@@ -148,5 +148,5 @@
             fid.variables[lat_name].point_spacing='uneven'
             fid.variables[lat_name].units='degrees_north'
-            fid.variables[lat_name].assignValue(latitudes)
+            fid.variables[lat_name][:] = latitudes
 
             fid.createDimension('TIME',six)
@@ -154,5 +154,5 @@
             fid.variables['TIME'].point_spacing='uneven'
             fid.variables['TIME'].units='seconds'
-            fid.variables['TIME'].assignValue([0.0, 0.1, 0.6, 1.1, 1.6, 2.1])
+            fid.variables['TIME'][:] = [0.0, 0.1, 0.6, 1.1, 1.6, 2.1]
 
 
@@ -163,5 +163,5 @@
             fid.variables[name].missing_value=-1.e+034
 
-            fid.variables[name].assignValue([[[0.3400644, 0, -46.63519, -6.50198],
+            fid.variables[name][:] = [[[0.3400644, 0, -46.63519, -6.50198],
                                               [-0.1214216, 0, 0, 0],
                                               [0, 0, 0, 0],
@@ -186,5 +186,5 @@
                                               [-0.1209405, 0.0009771062, 0.02527271, 2.617787e-005],
                                               [0.0004811212, 0.0009622425, 0.0009599366, 8.152277e-007],
-                                              [0, 0.0004811212, 0.0004811212, 0]]])
+                                              [0, 0.0004811212, 0.0004811212, 0]]]
 
 
@@ -495,5 +495,4 @@
 
         import time, os
-        from Scientific.IO.NetCDF import NetCDFFile
 
         self.domain.set_name('datatest' + str(id(self)))
@@ -549,5 +548,4 @@
 
         import time, os, config
-        from Scientific.IO.NetCDF import NetCDFFile
 
         self.domain.set_name('synctest')
@@ -596,5 +594,4 @@
 
         import time, os
-        from Scientific.IO.NetCDF import NetCDFFile
 
         self.domain.set_name('datatest' + str(id(self)))
Index: /trunk/anuga_core/source/anuga/shallow_water/test_loadsave.py
===================================================================
--- /trunk/anuga_core/source/anuga/shallow_water/test_loadsave.py	(revision 8779)
+++ /trunk/anuga_core/source/anuga/shallow_water/test_loadsave.py	(revision 8780)
@@ -6,5 +6,5 @@
 import tempfile
 
-from Scientific.IO.NetCDF import NetCDFFile
+from anuga.file.netcdf import NetCDFFile
 from anuga.file.sww import extent_sww
 
Index: /trunk/anuga_core/source/anuga/shallow_water/test_most2nc.py
===================================================================
--- /trunk/anuga_core/source/anuga/shallow_water/test_most2nc.py	(revision 8779)
+++ /trunk/anuga_core/source/anuga/shallow_water/test_most2nc.py	(revision 8780)
@@ -1,5 +1,5 @@
 import unittest
 import numpy as num
-from Scientific.IO.NetCDF import NetCDFFile
+from anuga.file.netcdf import NetCDFFile
 import most2nc
 import os
Index: /trunk/anuga_core/source/anuga/shallow_water/test_shallow_water_domain.py
===================================================================
--- /trunk/anuga_core/source/anuga/shallow_water/test_shallow_water_domain.py	(revision 8779)
+++ /trunk/anuga_core/source/anuga/shallow_water/test_shallow_water_domain.py	(revision 8780)
@@ -6,5 +6,5 @@
 import tempfile
 
-from Scientific.IO.NetCDF import NetCDFFile
+from anuga.file.netcdf import NetCDFFile
 from anuga.file.sww import extent_sww
 
@@ -1825,5 +1825,4 @@
 
         import time, os
-        from Scientific.IO.NetCDF import NetCDFFile
         from mesh_factory import rectangular
 
@@ -1916,5 +1915,4 @@
 
         import time, os
-        from Scientific.IO.NetCDF import NetCDFFile
         from mesh_factory import rectangular
 
@@ -6039,5 +6037,4 @@
 
         # Read results for specific timesteps t=1 and t=2
-        from Scientific.IO.NetCDF import NetCDFFile
         fid = NetCDFFile(domain1.get_name() + '.sww')
 
@@ -6212,5 +6209,4 @@
 
         # Read results for specific timesteps t=1 and t=2
-        from Scientific.IO.NetCDF import NetCDFFile
         fid = NetCDFFile(domain1.get_name() + '.sww')
 
@@ -6388,5 +6384,4 @@
 
         # Read results for specific timesteps t=1 and t=2
-        from Scientific.IO.NetCDF import NetCDFFile
         fid = NetCDFFile(domain1.get_name() + '.sww')
 
@@ -7584,5 +7579,4 @@
             
         # Check that quantities have been stored correctly    
-        from Scientific.IO.NetCDF import NetCDFFile
         sww_file = domain.get_name() + '.sww'
         fid = NetCDFFile(sww_file)
Index: /trunk/anuga_core/source/anuga/shallow_water/test_sww_interrogate.py
===================================================================
--- /trunk/anuga_core/source/anuga/shallow_water/test_sww_interrogate.py	(revision 8779)
+++ /trunk/anuga_core/source/anuga/shallow_water/test_sww_interrogate.py	(revision 8780)
@@ -40,5 +40,5 @@
 
         import time, os
-        from Scientific.IO.NetCDF import NetCDFFile
+        from anuga.file.netcdf import NetCDFFile
 
         #Setup
@@ -200,5 +200,5 @@
 
         import time, os
-        from Scientific.IO.NetCDF import NetCDFFile
+        from anuga.file.netcdf import NetCDFFile
 
         # Setup
@@ -326,5 +326,5 @@
 
         import time, os
-        from Scientific.IO.NetCDF import NetCDFFile
+        from anuga.file.netcdf import NetCDFFile
 
         # Setup
@@ -428,5 +428,5 @@
 
         import time, os
-        from Scientific.IO.NetCDF import NetCDFFile
+        from anuga.file.netcdf import NetCDFFile
 
         # Setup
Index: /trunk/anuga_core/source/anuga/shallow_water/test_system.py
===================================================================
--- /trunk/anuga_core/source/anuga/shallow_water/test_system.py	(revision 8779)
+++ /trunk/anuga_core/source/anuga/shallow_water/test_system.py	(revision 8780)
@@ -6,5 +6,5 @@
 import os
 
-from Scientific.IO.NetCDF import NetCDFFile
+from anuga.file.netcdf import NetCDFFile
 import numpy as num
 
Index: /trunk/anuga_core/source/anuga/utilities/plot_utils.py
===================================================================
--- /trunk/anuga_core/source/anuga/utilities/plot_utils.py	(revision 8779)
+++ /trunk/anuga_core/source/anuga/utilities/plot_utils.py	(revision 8780)
@@ -36,5 +36,5 @@
 
 """
-from Scientific.IO.NetCDF import NetCDFFile
+from anuga.file.netcdf import NetCDFFile
 import numpy
 
Index: /trunk/anuga_core/source/anuga/utilities/sww_merge.py
===================================================================
--- /trunk/anuga_core/source/anuga/utilities/sww_merge.py	(revision 8779)
+++ /trunk/anuga_core/source/anuga/utilities/sww_merge.py	(revision 8780)
@@ -6,5 +6,5 @@
 from anuga.utilities.numerical_tools import ensure_numeric
 
-from Scientific.IO.NetCDF import NetCDFFile
+from anuga.file.netcdf import NetCDFFile
 from anuga.config import netcdf_mode_r, netcdf_mode_w, netcdf_mode_a
 from anuga.config import netcdf_float, netcdf_float32, netcdf_int
@@ -26,6 +26,10 @@
     fid = NetCDFFile(swwfiles[0], netcdf_mode_r)
 
-    number_of_volumes = fid.dimensions['number_of_volumes']
-    number_of_points =  fid.dimensions['number_of_points']
+    try: # works with netcdf4
+        number_of_volumes = len(fid.dimensions['number_of_volumes'])
+        number_of_points = len(fid.dimensions['number_of_points'])
+    except: # works with scientific.io.netcdf
+        number_of_volumes = len(fid.dimensions['number_of_volumes'])
+        number_of_points = fid.dimensions['number_of_points']
 
     fid.close()
@@ -111,5 +115,11 @@
                 out_tris.append(verts)
 
-        num_pts = fid.dimensions['number_of_points']
+
+
+        try: # works with netcdf4
+            num_pts = len(fid.dimensions['number_of_points'])
+        except: # works with scientific.io.netcdf
+            num_pts = fid.dimensions['number_of_points']
+
         tri_offset += num_pts
         
Index: /trunk/anuga_core/source/anuga/utilities/test_system_tools.py
===================================================================
--- /trunk/anuga_core/source/anuga/utilities/test_system_tools.py	(revision 8779)
+++ /trunk/anuga_core/source/anuga/utilities/test_system_tools.py	(revision 8780)
@@ -9,5 +9,5 @@
 import os
 from os.path import join, split, sep
-from Scientific.IO.NetCDF import NetCDFFile
+from anuga.file.netcdf import NetCDFFile
 from anuga.config import netcdf_mode_r, netcdf_mode_w, netcdf_mode_a
 from anuga.config import netcdf_float, netcdf_char, netcdf_int
@@ -82,5 +82,5 @@
 
         try:
-            from Scientific.IO.NetCDF import NetCDFFile
+            from anuga.file.netcdf import NetCDFFile
         except ImportError:
             # This code is also used by EQRM which does not require NetCDF
Index: /trunk/anuga_core/source/anuga/visualiser/offline.py
===================================================================
--- /trunk/anuga_core/source/anuga/visualiser/offline.py	(revision 8779)
+++ /trunk/anuga_core/source/anuga/visualiser/offline.py	(revision 8780)
@@ -1,5 +1,5 @@
 #from Numeric import array, Float, ravel, zeros
 import numpy as num
-from Scientific.IO.NetCDF import NetCDFFile
+from anuga.file.netcdf import NetCDFFile
 from Tkinter import Button, E, Tk, W, Label, StringVar, Scale, HORIZONTAL
 from visualiser import Visualiser
Index: /trunk/anuga_core/source/anuga/visualiser_new/sww_visualiser.py
===================================================================
--- /trunk/anuga_core/source/anuga/visualiser_new/sww_visualiser.py	(revision 8779)
+++ /trunk/anuga_core/source/anuga/visualiser_new/sww_visualiser.py	(revision 8780)
@@ -1,4 +1,4 @@
 from Numeric import array, Float
-from Scientific.IO.NetCDF import NetCDFFile
+from anuga.file.netcdf import NetCDFFile
 from visualiser import Visualiser
 from vtk import vtkCellArray
Index: /trunk/anuga_core/source/anuga_parallel/test_parallel_file_boundary.py
===================================================================
--- /trunk/anuga_core/source/anuga_parallel/test_parallel_file_boundary.py	(revision 8779)
+++ /trunk/anuga_core/source/anuga_parallel/test_parallel_file_boundary.py	(revision 8780)
@@ -24,5 +24,5 @@
 import tempfile
 from struct import pack, unpack
-from Scientific.IO.NetCDF import NetCDFFile
+from anuga.file.netcdf import NetCDFFile
 import copy
 
Index: /trunk/anuga_core/source/anuga_validation_tests/Case_studies/Okushiri/compare_timeseries_with_measures.py
===================================================================
--- /trunk/anuga_core/source/anuga_validation_tests/Case_studies/Okushiri/compare_timeseries_with_measures.py	(revision 8779)
+++ /trunk/anuga_core/source/anuga_validation_tests/Case_studies/Okushiri/compare_timeseries_with_measures.py	(revision 8780)
@@ -9,5 +9,5 @@
 
 import numpy as num
-from Scientific.IO.NetCDF import NetCDFFile
+from anuga.file.netcdf import NetCDFFile
 
 import project
Index: /trunk/anuga_core/source/anuga_validation_tests/Case_studies/Okushiri/create_okushiri.py
===================================================================
--- /trunk/anuga_core/source/anuga_validation_tests/Case_studies/Okushiri/create_okushiri.py	(revision 8779)
+++ /trunk/anuga_core/source/anuga_validation_tests/Case_studies/Okushiri/create_okushiri.py	(revision 8780)
@@ -107,5 +107,5 @@
     """
 
-    from Scientific.IO.NetCDF import NetCDFFile
+    from anuga.file.netcdf import NetCDFFile
 
     print 'Creating', filename
