Index: /anuga_work/development/dam_2006/create_mesh.py
===================================================================
--- /anuga_work/development/dam_2006/create_mesh.py	(revision 4006)
+++ /anuga_work/development/dam_2006/create_mesh.py	(revision 4007)
@@ -1,3 +1,3 @@
-"""Create mesh for lwru2 validation of the Oshiri island tsunami
+"""Create mesh for University of Queensland dam break flume
 """
 
@@ -8,4 +8,10 @@
 
 def generate(mesh_filename, gate_position, is_course = False):
+    """
+    Generate mesh for University of Queensland dam break flume.
+    The gate position is the distance from the right wall of the wave tank
+    to the gate. 
+    
+    """
     #Basic geometry
     
Index: /anuga_work/development/dam_2006/project.py
===================================================================
--- /anuga_work/development/dam_2006/project.py	(revision 4006)
+++ /anuga_work/development/dam_2006/project.py	(revision 4007)
@@ -7,7 +7,7 @@
 from time import localtime, strftime
 from os import mkdir, access, F_OK
-                
-#Making assumptions about the location of scenario data
-scenario_dir_name = 'dam_2006'
+from anuga.abstract_2d_finite_volumes.util import add_directories, \
+     copy_code_files
+
 
 #swollen/ all data output
@@ -16,7 +16,9 @@
 if sys.platform == 'win32':
     try:
-        home = environ['INUNDATIONHOME']     #Sandpit's parent dir
+        home = environ['INUNDATIONHOME']   
+        user = getenv('USERPROFILE')
     except:
-        home = '.'
+        home = '.'    
+        user = getenv('LOGNAME')
 else:    
     home = getenv('INUNDATIONHOME', sep+'d'+sep+'cit'+sep+'1'+sep+'cit'+sep+'risk_assessment_methods_project'+sep+'inundation')     
@@ -26,10 +28,17 @@
     home = '.'
     
+# Create the structure of where the output will go
+create_scenario_dir = ['data','flumes','dam_2006']
+
+scenariodir=add_directories(home, create_scenario_dir)
+
+
 #Derive subdirectories and filenames
 time = strftime('%Y%m%d_%H%M%S',localtime()) #gets time for new dir
-scenariodir =  home+sep+scenario_dir_name
 outputdir = scenariodir+sep+'output'+sep
 outputtimedir = outputdir+time+sep
 meshdir = scenariodir+sep+'meshes'+sep
+
+
 
 depth_filename = outputtimedir + "depth.csv"
@@ -39,7 +48,4 @@
 
 # creates copy of output dir structure, if it doesn't exist
-if not access(scenariodir,F_OK):
-    mkdir (scenariodir)
-
 if not access(meshdir,F_OK):
     mkdir (meshdir)
@@ -51,6 +57,5 @@
     mkdir (outputtimedir)
 
-codedir = getcwd()+sep
-                                
+codedir = getcwd()+sep                               
 codedirname = codedir + 'project.py'
 
Index: /anuga_work/development/dam_2006/run_dam.py
===================================================================
--- /anuga_work/development/dam_2006/run_dam.py	(revision 4006)
+++ /anuga_work/development/dam_2006/run_dam.py	(revision 4007)
@@ -14,43 +14,49 @@
 import sys
 from shutil import copy
-from os import path
+from os import path, sep
+from os.path import dirname  #, basename
 
 # Related major packages
 from anuga.shallow_water import Domain, Reflective_boundary, \
                             Dirichlet_boundary, Time_boundary, File_boundary
-from anuga.abstract_2d_finite_volumes.util import Screen_Catcher
 from anuga.abstract_2d_finite_volumes.region import Set_region 
 from anuga.fit_interpolate.interpolate import interpolate_sww2csv
+from anuga.abstract_2d_finite_volumes.util import start_screen_catcher, \
+     copy_code_files
+
+
+# Scenario specific imports
+import project                 # Definition of file names and polygons
 import create_mesh
-
-# Application specific imports
-import project                 # Definition of file names and polygons
 
 
 def main():
-    #-------------------------------------------------------------------------
-    # Setup archiving of simulations
-    #-------------------------------------------------------------------------
 
-    copy (project.codedirname, project.outputtimedir + 'project.py')
-    copy (project.codedir + 'run_dam.py', project.outputtimedir + 'run_dam.py')
+    #--------------------------------------------------------------------------
+    # Copy scripts to time stamped output directory and capture screen
+    # output to file
+    #--------------------------------------------------------------------------
+
+    # creates copy of code in output dir
+
+    print "The output dir is", project.outputtimedir
+    copy_code_files(project.outputtimedir,__file__,
+                    dirname(project.__file__)+sep+ project.__name__+'.py' )
     copy (project.codedir + 'create_mesh.py',
           project.outputtimedir + 'create_mesh.py')
-    print'output dir', project.outputtimedir
+    myid = 0
+    numprocs = 1
+    start_screen_catcher(project.outputtimedir, myid, numprocs)
 
-    #FIXME this isn't working
-    #normal screen output is stored in 
-    screen_output_name = project.outputtimedir + "screen_output.txt"
-    screen_error_name = project.outputtimedir + "screen_error.txt"
-
+    print 'USER:    ', project.user
     #-------------------------------------------------------------------------
     # Create the triangular mesh
     #-------------------------------------------------------------------------
 
-    gate_position = 0.85
+    gate_position = 2.0
     create_mesh.generate(project.mesh_filename,
                          gate_position,
-                         #is_course=True) # this creates the mesh
-                         is_course=False) # this creates the mesh
+                         is_course=True) # this creates the mesh
+                         #is_course=False) # this creates the mesh
 
     head,tail = path.split(project.mesh_filename)
@@ -88,5 +94,5 @@
 
     print 'Available boundary tags', domain.get_boundary_tags()
-    domain.set_region('dam','stage',0.2,
+    domain.set_region('dam','stage',0.15,
                                  location = 'unique vertices') 
     #domain.set_region(Set_region('dam','stage',0.2,
@@ -102,5 +108,5 @@
     t0 = time.time()
 
-    for t in domain.evolve(yieldstep = 0.1, finaltime = 25):
+    for t in domain.evolve(yieldstep = 0.05, finaltime = 10):
         domain.write_time()
     
