Changeset 2902 for production/pt_hedland_2006/run_pt_hedland.py
- Timestamp:
- May 18, 2006, 10:01:58 AM (19 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
production/pt_hedland_2006/run_pt_hedland.py
r2855 r2902 16 16 17 17 # Standard modules 18 import os 18 import os 19 20 from os import sep 21 from os.path import dirname, basename 22 19 23 import time 20 24 … … 47 51 48 52 # filenames 53 print 'run home', project.home 49 54 onshore_dem_name = project.onshore_dem_name 50 55 offshore_points1 = project.offshore_dem_name1 … … 54 59 55 60 61 62 63 #import sys; sys.exit() 64 56 65 # creates copy of code in output dir if dir doesn't exist 57 66 if access(project.outputtimedir,F_OK) == 0 : 58 67 mkdir (project.outputtimedir) 59 copy ( project.codedirname, project.outputtimedir + project.codename)60 copy ( project.codedir + 'run_pt_hedland.py', project.outputtimedir + 'run_pt_hedland.py')61 print'output dir', project.outputtimedir 68 copy (dirname(project.__file__) +sep+ project.__name__+'.py', project.outputtimedir + project.__name__+'.py') 69 copy (__file__, project.outputtimedir + basename(__file__)) 70 62 71 63 72 #normal screen output is stored in … … 67 76 #used to catch screen output to file 68 77 sys.stdout = Screen_Catcher(screen_output_name) 69 #sys.stderr = Screen_Catcher(screen_output_name) 70 #sys.stderr = Screen_Catcher(screen_error_name) 71 72 ''' 73 copied_files = False 74 75 # files to be used 76 files_used = [onshore_dem_name, offshore_points,] 77 78 if sys.platform != 'win32': 79 copied_files = True 80 for name in file_list: 81 copy(name, ) 82 ''' 83 #print' most file', project.MOST_dir + project.boundary_basename+'_ha.nc' 84 #if access(project.MOST_dir + project.boundary_basename+'_ha.nc',F_OK) == 1 : 85 # print' most file', project.MOST_dir + project.boundary_basename 86 87 78 sys.stderr = Screen_Catcher(screen_error_name) 79 80 81 ''' 88 82 # fine data (clipping the points file to smaller area) 89 83 # creates DEM from asc data … … 114 108 G.export_points_file(project.combined_dem_name + '.pts') 115 109 116 110 ''' 117 111 #------------------------------------------------------------------------------- 118 112 # Create the triangular mesh based on overall clipping polygon with a tagged … … 123 117 from pmesh.mesh_interface import create_mesh_from_regions 124 118 125 region_res = 25000119 region_res = 50000 126 120 coast_res = 2500 127 pt_hedland_res = 25000121 pt_hedland_res = 5000 128 122 # derive poly_coast from project.coast_name using alpha_shape 129 interior_regions = []#[[project.poly_pt_hedland, pt_hedland_res]]#, 130 #[project.poly_coast, coast_res], 131 #[project.poly_region, region_res]] 123 interior_regions = [[project.poly_pt_hedland, pt_hedland_res], 124 [project.poly_region, region_res]] 132 125 133 126 print 'number of interior regions', len(interior_regions) … … 136 129 _ = cache(create_mesh_from_regions, 137 130 project.polyAll, 138 {'boundary_tags': {'right': [0], 'bottomright': [1], 139 'bottomleft': [2], 'left': [3], 'top': [4]}, 140 'maximum_triangle_area': 250000, 131 # {'boundary_tags': {'right': [0], 'bottomright': [1], 132 # 'bottomleft': [2], 'left': [3], 'top': [4]}, 133 {'boundary_tags': {'top': [0], 'left': [1], 134 'bottomleft': [2], 'bottomright': [3], 'right': [4]}, 135 'maximum_triangle_area': 400000, 141 136 'filename': meshname, 142 137 'interior_regions': interior_regions}, … … 147 142 # Setup computational domain 148 143 #------------------------------------------------------------------------------- 149 144 ''' 150 145 domain = pmesh_to_domain_instance(meshname, Domain, 151 146 use_cache = False, 152 147 verbose = True) 148 ''' 149 150 domain = Domain(meshname, use_cache = False, verbose = True) 153 151 154 152 print 'Number of triangles = ', len(domain) … … 171 169 172 170 domain.set_quantity('elevation', 173 # filename = project.onshore_dem_name + '.pts',174 171 filename = project.combined_dem_name + '.pts', 175 # filename = project.offshore_dem_name1 + '.xya',176 # filename = project.offshore_dem_name2 + '.xya',177 172 use_cache = True, 178 173 verbose = True, … … 181 176 182 177 print 'hi1' 183 print 'have sent quantities OK - now exiting'184 import sys; sys.exit()178 #print 'have sent quantities OK - now exiting' 179 #import sys; sys.exit() 185 180 186 181 #------------------------------------------------------------------------------- … … 188 183 #------------------------------------------------------------------------------- 189 184 print 'start ferret2sww' 185 # skipped as results in file SU-AU_clipped is correct for all WA 186 190 187 from pyvolution.data_manager import ferret2sww 191 188 … … 199 196 (source_dir + project.boundary_basename, 200 197 source_dir + project.boundary_basename), 201 # (project.MOST_dir + project.boundary_basename,202 # source_dir + project.boundary_basename),203 198 {'verbose': True, 204 # note didn't work with the below205 # 'minlat': south - 1,206 # 'maxlat': north + 1,207 # 'minlon': west - 1,208 # 'maxlon': east + 1,209 199 'minlat': south, 210 200 'maxlat': north, … … 228 218 Bd = Dirichlet_boundary([tide,0,0]) 229 219 230 231 220 # 7 min square wave starting at 1 min, 6m high 232 221 Bw = Time_boundary(domain = domain, 233 222 f=lambda t: [(60<t<480)*6, 0, 0]) 234 223 235 domain.set_boundary( {'right': Br, 'bottomright': Br, 236 'bottomleft': Br, 'left': Br, 'top': Bf} ) 224 #domain.set_boundary( {'right': Br, 'bottomright': Br, 225 # 'bottomleft': Br, 'left': Br, 'top': Bf} ) 226 domain.set_boundary( {'top': Bf, 'left': Br, 'bottomleft': Br, 'bottomright': Br, 'right': Br} ) 237 227 238 228 #------------------------------------------------------------------------------- … … 242 232 t0 = time.time() 243 233 244 for t in domain.evolve(yieldstep = 240, finaltime = 720 1):245 domain.write_time() 246 domain.write_boundary_statistics(tags = 'top') 247 248 for t in domain.evolve(yieldstep = 120, finaltime = 12601249 ,skip_initial_step = True): 250 domain.write_time() 251 domain.write_boundary_statistics(tags = 'top') 252 253 for t in domain.evolve(yieldstep = 60, finaltime = 19801234 for t in domain.evolve(yieldstep = 240, finaltime = 7200): 235 domain.write_time() 236 domain.write_boundary_statistics(tags = 'top') 237 238 for t in domain.evolve(yieldstep = 240, finaltime = 12600 239 ,skip_initial_step = True): 240 domain.write_time() 241 domain.write_boundary_statistics(tags = 'top') 242 243 for t in domain.evolve(yieldstep = 240, finaltime = 19800 254 244 ,skip_initial_step = True): 255 245 domain.write_time() 256 246 domain.write_boundary_statistics(tags = 'top') 257 247 258 for t in domain.evolve(yieldstep = 120, finaltime = 25201259 ,skip_initial_step = True): 260 domain.write_time() 261 domain.write_boundary_statistics(tags = 'top') 262 263 for t in domain.evolve(yieldstep = 240, finaltime = 3600 1248 for t in domain.evolve(yieldstep = 240, finaltime = 25200 249 ,skip_initial_step = True): 250 domain.write_time() 251 domain.write_boundary_statistics(tags = 'top') 252 253 for t in domain.evolve(yieldstep = 240, finaltime = 36000 264 254 ,skip_initial_step = True): 265 255 domain.write_time()
Note: See TracChangeset
for help on using the changeset viewer.