Index: anuga_work/production/dampier_2006/build_dampier.py
===================================================================
--- anuga_work/production/dampier_2006/build_dampier.py	(revision 3841)
+++ anuga_work/production/dampier_2006/build_dampier.py	(revision 3851)
@@ -30,7 +30,5 @@
 from anuga.shallow_water import Reflective_boundary
 from anuga.shallow_water.data_manager import convert_dem_from_ascii2netcdf, dem2pts
-
 from anuga.pmesh.mesh_interface import create_mesh_from_regions
-
 from anuga.geospatial_data.geospatial_data import *
 
@@ -38,40 +36,23 @@
 import project   # Definition of file names and polygons
 
-
-
 #------------------------------------------------------------------------------
 # Copy scripts to time stamped output directory and capture screen
 # output to file
 #------------------------------------------------------------------------------
+#print 'project.build_time', project.build_time
+#print 'project.output_build_time_dir',project.output_build_time_dir
+#print '__file__, project.output_time_dir + basename(__file__)', __file__, project.output_build_time_dir + basename(__file__)
+#print 'dirname(project.__file__) +sep+ project.__name__', dirname(project.__file__) +sep+ project.__name__+'.py'
+#print'project.topographies_time_dir',project.topographies_time_dir, project.combined_time_dir_name + '.pts'
+#print project.boundaries_time_dir, project.boundaries_time_dir_name
+#import sys; sys.exit()
+if access(project.output_build_time_dir,F_OK) == 0:
+    mkdir (project.output_build_time_dir)
+copy (dirname(project.__file__) +sep+ project.__name__+'.py',
+      project.output_build_time_dir + project.__name__+'.py')     #copies project.py
+copy (__file__, project.output_build_time_dir + basename(__file__))
+print 'files '+ project.__name__+'.py and '+ basename(__file__)+' copied to '+ project.output_build_time_dir       #copies this file
+#import sys; sys.exit()
 
-
-
-# creates copy of code in output dir if dir doesn't exist
-if access(project.output_time_dir,F_OK) == 0:
-    mkdir (project.output_time_dir)
-copy (dirname(project.__file__) +sep+ project.__name__+'.py',
-      project.output_time_dir + project.__name__+'.py')     #copies project.py
-copy (__file__, project.output_time_dir + basename(__file__))
-print 'project.output_time_dir',project.output_time_dir       #copies this file
-
-
-
-
-boundary_dir_name = project.boundary_dir_name
-
-
-from anuga.shallow_water.data_manager import urs2sww
-
-print 'minlat=project.north_boundary, maxlat=project.south_boundary',project.north_boundary, project.south_boundary
-print 'minlon= project.west_boundary, maxlon=project.east_boundary',project.west_boundary, project.east_boundary
-
-#import sys; sys.exit()
-urs2sww(boundary_dir_name,
-#        minlat=project.south, maxlat=project.north,
-#        minlon= project.west, maxlon=project.east,
-#        mint=0, maxt= 35000,
-        verbose='true')
-        
-import sys; sys.exit()
 #-------------------------------------------------------------------------------
 # Preparation of topographic data
@@ -102,9 +83,4 @@
 offshore_dir_name14 = project.offshore_dir_name14
 
-
-
-# files to be used
-#file_used = []
-
 # creates DEM from asc data
 convert_dem_from_ascii2netcdf(onshore_dir_name, use_cache=True, verbose=True)
@@ -120,10 +96,8 @@
         verbose=True)
 
-
 #creates pts file for islands DEM
 dem2pts(islands_dir_name, use_cache=True, verbose=True)
 
-
-print'create G1'
+print'create Geospatial data objects from topographies'
 G1 = Geospatial_data(file_name = project.onshore_dir_name + '.pts')
 G2 = Geospatial_data(file_name = project.coast_dir_name + '.xya')
@@ -145,35 +119,37 @@
 G_off14 = Geospatial_data(file_name = project.offshore_dir_name14 + '.xya')
 
-print'add G1+G2+G3+all offshore data'
+print'add all geospatial objects'
 G = G1 + G2 + G3 + G_off + G_off1 + G_off2 + G_off3 + G_off4 + G_off5 \
     + G_off6 + G_off7 + G_off8 + G_off9 + G_off10 + G_off11 + G_off12 \
     + G_off13 + G_off14
 
+print'clip combined geospatial object by bounding polygon'
 G.clip(project.bounding_polygon)
 #FIXME: add a clip function to pts
 
-print'export G'
-G.export_points_file(project.combined_dir_name + '.pts')
-import sys; sys.exit()
-
-
+print'export combined DEM file'
+if access(project.topographies_time_dir,F_OK) == 0:
+    mkdir (project.topographies_time_dir)
+G.export_points_file(project.combined_time_dir_name + '.pts')
 
 #-------------------------------------------------------------------------
 # Convert URS to SWW file for boundary conditions 
 #-------------------------------------------------------------------------
-
-# filenames
-meshname = project.mesh_name+'.msh'
-source_dir = project.boundarydir
-boundary_file = project.boundaryname
-
-print 'Available boundary tags', domain.get_boundary_tags()
+print 'starting to create boundary conditions'
+boundaries_dir_name = project.boundaries_dir_name
 
 from anuga.shallow_water.data_manager import urs2sww
 
-urs2sww(boundary_file,
-        minlat=project.north_boundary, maxlat=project.south_boundary,
+print 'minlat=project.north_boundary, maxlat=project.south_boundary',project.north_boundary, project.south_boundary
+print 'minlon= project.west_boundary, maxlon=project.east_boundary',project.west_boundary, project.east_boundary
+
+if access(project.boundaries_time_dir,F_OK) == 0:
+    mkdir (project.boundaries_time_dir)
+urs2sww(boundaries_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')
+        
 
 
@@ -182,2 +158,4 @@
 
 
+
+
Index: anuga_work/production/dampier_2006/project.py
===================================================================
--- anuga_work/production/dampier_2006/project.py	(revision 3841)
+++ anuga_work/production/dampier_2006/project.py	(revision 3851)
@@ -35,6 +35,6 @@
 
 #mesh_name = 'elevation50m'
-boundary_name = 'dampier'
-boundary_source = 'test'
+boundaries_name = 'dampier'
+boundaries_source = 'mag_9_corrected'
 
 # topography file names
@@ -68,14 +68,20 @@
 gauges_dir = home+sep+state+sep+scenario_datas_name+sep+'anuga'+sep+'gauges'+sep
 polygons_dir = home+sep+state+sep+scenario_datas_name+sep+'anuga'+sep+'polygons'+sep
-boundaries_dir = home+sep+state+sep+scenario_datas_name+sep+'anuga'+sep+'boundaries'+sep+'urs'+sep+boundary_source+sep
+boundaries_in_dir = home+sep+state+sep+scenario_datas_name+sep+'anuga'+sep+'boundaries'+sep+'urs'+sep+boundaries_source+sep
 #outputdir = home+sep+state+sep+scenario_datas_name+sep+'anuga'+sep+'output'+sep
 tide_dir = home+sep+state+sep+scenario_datas_name+sep+'anuga'+sep+'tide_data'+sep
 
 time = strftime('%Y%m%d_%H%M%S',localtime()) #gets time for new dir
-
-output_time_dir = home+sep+state+sep+scenario_datas_name+sep+'anuga'+sep+'outputs'+sep+time+sep
-topographies_time_dir = home+sep+state+sep+scenario_datas_name+sep+'anuga'+sep+'topographies'+sep+time+sep
-boundaries_time_dir = home+sep+state+sep+scenario_datas_name+sep+'anuga'+sep+'boundaries'+sep+time+sep
-
+build_time = time+'_build'
+run_time = time+'_run'
+
+output_build_time_dir = home+sep+state+sep+scenario_datas_name+sep+'anuga'+sep+'outputs'+sep+build_time+sep
+output_run_time_dir = home+sep+state+sep+scenario_datas_name+sep+'anuga'+sep+'outputs'+sep+run_time+sep
+topographies_time_dir = topographies_dir+build_time+sep
+boundaries_dir = home+sep+state+sep+scenario_datas_name+sep+'anuga'+sep+'boundaries'+sep
+boundaries_time_dir = home+sep+state+sep+scenario_datas_name+sep+'anuga'+sep+'boundaries'+sep+build_time+sep
+
+#ideas
+#boundaries_time_dir = boundaries_in_dir+'urs'+sep+boundaries_source+sep
 
 
@@ -101,9 +107,16 @@
 offshore_dir_name14 = topographies_dir + offshore_name14
 
+#output dir
 combined_dir_name = topographies_dir + combined_name
-
-mesh_dir_name = meshes_dir + scenario_name
-output_dir_name = output_time_dir + scenario_name  #Used by post processing
-boundary_dir_name = boundaries_dir + boundary_name  #Used by post processing
+combined_time_dir_name = topographies_time_dir + combined_name
+
+meshes_dir_name = meshes_dir + scenario_name
+
+#output_build_time_dir_name = output_build_time_dir + scenario_name  #Used by post processing
+output_run_time_dir_name = output_run_time_dir + scenario_name  #Used by post processing
+boundaries_in_dir_name = boundaries_in_dir + boundaries_name
+boundaries_time_dir_name = boundaries_time_dir + boundaries_name  #Used by post processing
+
+
 
 
@@ -113,12 +126,13 @@
 south = degminsec2decimal_degrees(-20,55,0)
 north = degminsec2decimal_degrees(-20,15,0)
+#north = degminsec2decimal_degrees(-19,15,0)
 west = degminsec2decimal_degrees(116,17,0)
 east = degminsec2decimal_degrees(117,10,0)
 
 #only used to clip boundary condition
-north_boundary = north + 0.05
-south_boundary = south - 0.05
-west_boundary = west - 0.05
-east_boundary = east + 0.05
+north_boundary = north + 0.04
+south_boundary = south - 0.04
+west_boundary = west - 0.04
+east_boundary = east + 0.04
 
 
Index: anuga_work/production/dampier_2006/run_dampier.py
===================================================================
--- anuga_work/production/dampier_2006/run_dampier.py	(revision 3841)
+++ anuga_work/production/dampier_2006/run_dampier.py	(revision 3851)
@@ -3,5 +3,5 @@
 Source data such as elevation and boundary data is assumed to be available in
 directories specified by project.py
-The output sww file is stored in project.outputtimedir 
+The output sww file is stored in project.output_run_time_dir 
 
 The scenario is defined by a triangular mesh created from project.polygon,
@@ -45,22 +45,21 @@
 
 # filenames
-meshname = project.meshname+'.msh'
-source_dir = project.boundarydir
-boundary_file = project.boundaryname
 
-from anuga.shallow_water.data_manager import urs2sww
+build_time = '20061025_113524_build'
+boundaries_name = project.boundaries_name
+meshes_dir_name = project.meshes_dir_name+'.msh'
+#source_dir = project.boundarydir
+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.outputtimedir,F_OK) == 0:
-    print 'project.outputtimedir',dirname(project.outputtimedir)
-    mkdir (project.outputtimedir,0777)
+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.outputtimedir + project.__name__+'.py')
-copy (__file__, project.outputtimedir + basename(__file__))
-print 'project.outputtimedir',project.outputtimedir
-
-
+      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
 
 #--------------------------------------------------------------------------
@@ -71,5 +70,4 @@
 #--------------------------------------------------------------------------
 
-
 interior_regions = [#[project.karratha_polygon, 25000],
                     #[project.dampier_polygon, 2000],
@@ -77,5 +75,5 @@
                     #[project.point_polygon, 2000]]
                     #[project.cipma_polygon, 20000]]
-                    [project.cipma_polygon, 40000]]    # Caused memory error?
+                    [project.cipma_polygon, 50000]]    # Caused memory error?
 
 #---------------------------
@@ -103,22 +101,22 @@
 
 print 'start create mesh from regions'
-meshname = project.meshname + '.msh'
+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=200000,
+                         maximum_triangle_area=300000,
                          interior_regions=interior_regions,
-                         filename=meshname,
+                         filename=meshes_dir_name,
                          use_cache=True,
                          verbose=True)
-
 
 #-------------------------------------------------------------------------
 # Setup computational domain
 #-------------------------------------------------------------------------
-domain = Domain(meshname, use_cache=True, verbose=True)
+print 'Setup computational domain'
+domain = Domain(meshes_dir_name, use_cache=True, verbose=True)
 print domain.statistics()
-domain.set_name(project.basename)
-domain.set_datadir(project.outputtimedir)
+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
@@ -129,10 +127,11 @@
 # Setup initial conditions
 #-------------------------------------------------------------------------
-tide = 0.
+tide = 2.4
 domain.set_quantity('stage', tide)
 domain.set_quantity('friction', 0.0) 
+#combined_time_dir_name = project.topographies_dir+build_time+project.combined_name
 domain.set_quantity('elevation', 
-                    filename = project.datadir + project.basename + '.pts',
-                    use_cache = False,
+                    filename = project.topographies_dir + build_time + sep + project.combined_name + '.pts',
+                    use_cache = True,
                     verbose = True,
                     alpha = 0.1)
@@ -146,10 +145,9 @@
 print 'Available boundary tags', domain.get_boundary_tags()
 
-from anuga.shallow_water.data_manager import urs2sww
 
-urs2sww(boundary_file, verbose='true')
-
-Bf = File_boundary(source_dir + project.boundary_basename + '.sww',
+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])
