Index: /anuga_work/production/dampier_2006/build_dampier.py
===================================================================
--- /anuga_work/production/dampier_2006/build_dampier.py	(revision 3876)
+++ /anuga_work/production/dampier_2006/build_dampier.py	(revision 3877)
@@ -152,13 +152,14 @@
 if access(project.boundaries_time_dir,F_OK) == 0:
     mkdir (project.boundaries_time_dir)
-#urs2sww(boundaries_in_dir_name,basename_out= project.boundaries_time_dir_name,
-#        minlat=project.south_boundary, maxlat=project.north_boundary,
-#        minlon= project.west_boundary, maxlon=project.east_boundary,
-#        mint=0, maxt= 35000,
-#        verbose='true')
-        
+urs2sww(boundaries_in_dir_name,basename_out= project.boundaries_time_dir_name,
+        minlat=project.south_boundary, maxlat=project.north_boundary,
+        minlon= project.west_boundary, maxlon=project.east_boundary,
+        mint=0, maxt= 35000,
+        verbose='true')
+'''
+from caching import cache
 cache(urs2sww,
       (boundaries_in_dir_name,
-       basename_out= project.boundaries_time_dir_name), 
+       project.boundaries_time_dir_name), 
       {'verbose': True,
        'minlat': project.south_boundary,
@@ -167,13 +168,12 @@
        'maxlon': project.east_boundary,
        'mint': 0, 'maxt': 35000,
-       'origin': domain.geo_reference.get_origin(),
+#       'origin': domain.geo_reference.get_origin(),
        'mean_stage': project.tide,
 #       'zscale': 1,                 #Enhance tsunami
-       'fail_on_NaN': False,
-       'inverted_bathymetry': True},
+       'fail_on_NaN': False},
        verbose = True,
        )
 #       dependencies = source_dir + project.boundary_basename + '.sww')
-        
+'''        
 
 
Index: /anuga_work/production/dampier_2006/project.py
===================================================================
--- /anuga_work/production/dampier_2006/project.py	(revision 3876)
+++ /anuga_work/production/dampier_2006/project.py	(revision 3877)
@@ -36,7 +36,7 @@
 #mesh_name = 'elevation50m'
 boundaries_name = 'dampier'
-boundaries_source = 'test'
-
-tide = 0.0
+boundaries_source = 'mag_9_corrected'
+
+tide = 2.4
 
 # topography file names
@@ -133,8 +133,8 @@
 
 #only used to clip boundary condition
-north_boundary = north + 0.04
-south_boundary = south - 0.04
-west_boundary = west - 0.04
-east_boundary = east + 0.04
+north_boundary = north + 0.02
+south_boundary = south - 0.02
+west_boundary = west - 0.02
+east_boundary = east + 0.02
 
 
Index: /anuga_work/production/dampier_2006/run_dampier.py
===================================================================
--- /anuga_work/production/dampier_2006/run_dampier.py	(revision 3876)
+++ /anuga_work/production/dampier_2006/run_dampier.py	(revision 3877)
@@ -34,4 +34,5 @@
 from anuga.geospatial_data.geospatial_data import *
 from anuga.abstract_2d_finite_volumes.util import Screen_Catcher
+from anuga_parallel.parallel_api import distribute, numprocs, myid
 
 # Application specific imports
@@ -53,72 +54,4 @@
 boundaries_time_dir_name = project.boundaries_dir + build_time + sep + boundaries_name
 
-#from anuga.shallow_water.data_manager import urs2sww
-
-# creates copy of code in output dir if dir doesn't exist
-if access(project.output_run_time_dir,F_OK) == 0:
-    print 'project.output_run_time_dir',dirname(project.output_run_time_dir)
-    mkdir (project.output_run_time_dir,0777)
-copy (dirname(project.__file__) +sep+ project.__name__+'.py',
-      project.output_run_time_dir + project.__name__+'.py')
-copy (__file__, project.output_run_time_dir + basename(__file__))
-print 'project.output_run_time_dir',project.output_run_time_dir
-
-#normal screen output is stored in 
-screen_output_name = project.output_run_time_dir + "screen_output.txt"
-screen_error_name = project.output_run_time_dir + "screen_error.txt"
-
-#used to catch screen output to file
-sys.stdout = Screen_Catcher(screen_output_name)
-sys.stderr = Screen_Catcher(screen_error_name)
-
-print 'USER:    ', project.user
-
-#--------------------------------------------------------------------------
-# Create the triangular mesh based on overall clipping polygon with a
-# tagged
-# boundary and interior regions defined in project.py along with
-# resolutions (maximal area of per triangle) for each polygon
-#--------------------------------------------------------------------------
-
-interior_regions = [#[project.karratha_polygon, 25000],
-                    #[project.dampier_polygon, 2000],
-                    #[project.refinery_polygon, 2000],
-                    #[project.point_polygon, 2000]]
-                    #[project.cipma_polygon, 20000]]
-                    [project.cipma_polygon, 50000]]    # Caused memory error?
-
-#---------------------------
-# this is check that no interior polygon is outside the bounding poly
-#------------------------------
-
-"""
-count = 0
-for i in range(len(interior_regions)):
-    region = interior_regions[i]
-    interior_polygon = region[0]
-    if len(inside_polygon(interior_polygon, bounding_polygon,
-                   closed = True, verbose = False)) <> len(interior_polygon):
-        print 'WARNING: interior polygon %d is outside bounding polygon' %(i)
-        count += 1
-
-if count == 0:
-    print 'interior regions OK'
-else:
-    print 'check out your interior polygons'
-    print 'check %s in production directory' %figname
-    import sys; sys.exit()
-"""
-#-------------------------------------
-
-print 'start create mesh from regions'
-meshes_dir_name = project.meshes_dir_name + '.msh'
-create_mesh_from_regions(project.bounding_polygon,
-                         boundary_tags={'back': [7, 8], 'side': [0, 6],
-                                        'ocean': [1, 2, 3, 4, 5]},
-                         maximum_triangle_area=300000,
-                         interior_regions=interior_regions,
-                         filename=meshes_dir_name,
-                         use_cache=True,
-                         verbose=True)
 
 #-------------------------------------------------------------------------
@@ -128,9 +61,4 @@
 domain = Domain(meshes_dir_name, use_cache=True, verbose=True)
 print domain.statistics()
-domain.set_name(project.scenario_name)
-domain.set_datadir(project.output_run_time_dir)
-domain.set_default_order(2)
-domain.set_minimum_storable_height(0.01) # Don't store anything less than 1cm
-
 
 
@@ -149,4 +77,22 @@
 
 
+#------------------------------------------------------
+# Distribute domain to implement parallelism !!!
+#------------------------------------------------------
+
+if numprocs > 1:
+    domain=distribute(domain)
+
+
+#------------------------------------------------------
+# Set domain parameters
+#------------------------------------------------------
+
+domain.set_name(project.scenario_name)
+domain.set_datadir(project.output_run_time_dir)
+domain.set_default_order(2) #associate to the spatial order of the triangle
+domain.set_minimum_storable_height(0.01) # Don't store anything less than 1cm
+
+
 #-------------------------------------------------------------------------
 # Setup boundary conditions 
@@ -159,6 +105,4 @@
 Bf = File_boundary(boundaries_time_dir_name + '.sww',
                    domain, verbose = True)
-#Bf = File_boundary(source_dir + project.boundary_scenario_name + '.sww',
-#                   domain, verbose = True)
 Br = Reflective_boundary(domain)
 Bd = Dirichlet_boundary([tide,0,0])
