Index: /development/dam_2006/project.py
===================================================================
--- /development/dam_2006/project.py	(revision 3455)
+++ /development/dam_2006/project.py	(revision 3456)
@@ -39,5 +39,6 @@
 #gaugetimeseries = gaugedir + 'onslow'
 depth_filename = outputtimedir + "depth.csv"
-velocity_filename = outputtimedir + "velocity.csv"
+velocity_x_filename = outputtimedir + "velocity_x.csv"
+velocity_y_filename = outputtimedir + "velocity_y.csv"
 
 
Index: /development/dam_2006/run_dam.py
===================================================================
--- /development/dam_2006/run_dam.py	(revision 3455)
+++ /development/dam_2006/run_dam.py	(revision 3456)
@@ -126,5 +126,6 @@
                         points,
                         project.depth_filename,
-                        project.velocity_filename)
+                        project.velocity_x_filename,
+                        project.velocity_y_filename)
 
 #-------------------------------------------------------------
Index: /inundation/fit_interpolate/interpolate.py
===================================================================
--- /inundation/fit_interpolate/interpolate.py	(revision 3455)
+++ /inundation/fit_interpolate/interpolate.py	(revision 3456)
@@ -281,5 +281,6 @@
                         points,
                         depth_file,
-                        velocity_file,
+                        velocity_x_file,
+                        velocity_y_file,
                         #quantities = ['depth', 'velocity'],
                         verbose=True,
@@ -309,15 +310,17 @@
     
     depth_writer = writer(file(depth_file, "wb"))
-    velocity_writer = writer(file(velocity_file, "wb"))
+    velocity_x_writer = writer(file(velocity_x_file, "wb"))
+    velocity_y_writer = writer(file(velocity_y_file, "wb"))
     # Write heading
     heading = [str(x[0])+ ':' + str(x[1]) for x in points]
     heading.insert(0, "time")
     depth_writer.writerow(heading)
-    velocity_writer.writerow(heading)
-    #for row in someiterable:
-        #csvwriter.writerow(row)
+    velocity_x_writer.writerow(heading)
+    velocity_y_writer.writerow(heading)
+    
     for time in callable_sww.get_time():
         depths = [time]
-        velocitys = [time]
+        velocity_xs = [time]
+        velocity_ys = [time]
         for point_i, point in enumerate(points):
             quantities = callable_sww(time,point_i)
@@ -326,20 +329,28 @@
             w = quantities[0]
             z = quantities[1]
-            uh = quantities[2]
-            vh = quantities[3]
+            momentum_x = quantities[2]
+            momentum_y = quantities[3]
             depth = w - z 
               
-            if w == NAN or z == NAN or uh == NAN or vh == NAN:
-                velocity = NAN
+            if w == NAN or z == NAN or momentum_x == NAN:
+                velocity_x = NAN
             else:
-                momentum = sqrt(uh*uh + vh*vh)
                 if depth > 1.e-30: # use epsilon
-                    velocity = momentum / depth  #Absolute velocity
+                    velocity_x = momentum_x / depth  #Absolute velocity
                 else:
-                    velocity = 0
+                    velocity_x = 0
+            if w == NAN or z == NAN or momentum_y == NAN:
+                velocity_y = NAN
+            else:
+                if depth > 1.e-30: # use epsilon
+                    velocity_y = momentum_y / depth  #Absolute velocity
+                else:
+                    velocity_y = 0
             depths.append(depth)
-            velocitys.append(velocity)
+            velocity_xs.append(velocity_x)
+            velocity_ys.append(velocity_y)
         depth_writer.writerow(depths)
-        velocity_writer.writerow(velocitys)
+        velocity_x_writer.writerow(velocity_xs)
+        velocity_y_writer.writerow(velocity_ys)
 
 class Interpolation_function:
Index: /inundation/fit_interpolate/test_interpolate.py
===================================================================
--- /inundation/fit_interpolate/test_interpolate.py	(revision 3455)
+++ /inundation/fit_interpolate/test_interpolate.py	(revision 3456)
@@ -1409,21 +1409,27 @@
         points = [[5.0,1.],[0.5,2.]]
         depth_file = tempfile.mktemp(".csv") 
-        velocity_file = tempfile.mktemp(".csv") 
-        interpolate_sww2csv(sww.filename, points, depth_file, velocity_file,
+        velocity_x_file = tempfile.mktemp(".csv") 
+        velocity_y_file = tempfile.mktemp(".csv") 
+        interpolate_sww2csv(sww.filename, points, depth_file,
+                            velocity_x_file,
+                            velocity_y_file,
                             verbose=False)
 
         depth_answers_array = [[0.0, 6.0, 1.5], [2.0, 15., 10.5]] 
-        velocity_answers_array = [[0.0, 5./6.0, 5./1.5], [2.0, 5./15.,5./10.5]]
+        velocity_x_answers_array = [[0.0, 3./6.0, 3./1.5],
+                                    [2.0, 3./15., 3/10.5]]
+        velocity_y_answers_array = [[0.0, 4./6.0, 4./1.5],
+                                    [2.0, 4./15., 4./10.5]]
         depth_file_handle = file(depth_file)
         depth_reader = csv.reader(depth_file_handle)
         depth_reader.next()
-        velocity_file_handle = file(velocity_file)
-        velocity_reader = csv.reader(velocity_file_handle)
-        velocity_reader.next()
+        velocity_x_file_handle = file(velocity_x_file)
+        velocity_x_reader = csv.reader(velocity_x_file_handle)
+        velocity_x_reader.next()
         for depths, velocitys, depth_answers, velocity_answers in map(None,
                                               depth_reader,
-                                              velocity_reader,
+                                              velocity_x_reader,
                                               depth_answers_array,
-                                              velocity_answers_array):
+                                              velocity_x_answers_array):
             for i in range(len(depths)):
                 #print "depths",depths[i] 
@@ -1435,11 +1441,28 @@
                 assert allclose(float(velocitys[i]), velocity_answers[i]), msg
 
+        velocity_y_file_handle = file(velocity_y_file)
+        velocity_y_reader = csv.reader(velocity_y_file_handle)
+        velocity_y_reader.next()
+        for velocitys, velocity_answers in map(None,
+                                              velocity_y_reader,
+                                              velocity_y_answers_array):
+            for i in range(len(depths)):
+                #print "depths",depths[i] 
+                #print "depth_answers",depth_answers[i]
+                #print "velocitys",velocitys[i] 
+                #print "velocity_answers_array", velocity_answers[i]
+                msg = 'Interpolation failed'
+                assert allclose(float(depths[i]), depth_answers[i]), msg
+                assert allclose(float(velocitys[i]), velocity_answers[i]), msg
+                
         # clean up
         depth_file_handle.close()
-        velocity_file_handle.close()
+        velocity_y_file_handle.close()
+        velocity_x_file_handle.close()
         #print "sww.filename",sww.filename 
         os.remove(sww.filename)
         os.remove(depth_file)
-        os.remove(velocity_file)
+        os.remove(velocity_x_file)
+        os.remove(velocity_y_file)
 #-------------------------------------------------------------
 if __name__ == "__main__":
