1 | """ |
---|
2 | This file contains all your file and directory definitions |
---|
3 | for elevation, meshes and outputs. |
---|
4 | """ |
---|
5 | |
---|
6 | import os |
---|
7 | import sys |
---|
8 | import glob |
---|
9 | import anuga |
---|
10 | from os.path import join, exists |
---|
11 | from time import localtime, strftime, gmtime |
---|
12 | from anuga.utilities.system_tools import get_user_name, get_host_name |
---|
13 | |
---|
14 | event = 'BP3Hydro' |
---|
15 | |
---|
16 | SLR = 0.9 |
---|
17 | ARI = 0.0 |
---|
18 | |
---|
19 | stsName = "CutDownWorst.sts" |
---|
20 | scenario_name = 'Busselton' |
---|
21 | |
---|
22 | setup = 'final' # This can be one of three values (defined in setup.py) |
---|
23 | # trial - coarsest mesh, fast |
---|
24 | # basic - coarse mesh |
---|
25 | # final - fine mesh, slowest |
---|
26 | |
---|
27 | UseCheckRestore = True |
---|
28 | UseFlooding = False |
---|
29 | |
---|
30 | np = [8] |
---|
31 | home = '/home/547/sfm547/Busselton' # Absolute path for data folder |
---|
32 | ParScript = join(home,event,'run_model_parallel.py') |
---|
33 | outFolder = r'/short/w85/Shane/Output' |
---|
34 | |
---|
35 | if UseCheckRestore: |
---|
36 | restoreFolderName = 'RestorePts_' + setup + "_" + event |
---|
37 | |
---|
38 | #------------------------------------------------------------------------------ |
---|
39 | # Initial Conditions and Internal Variables |
---|
40 | #------------------------------------------------------------------------------ |
---|
41 | |
---|
42 | bounding_polygon_maxarea = 10 # Mesh size (m2) within the hydraulic boundary i.e. model domain |
---|
43 | minimum_storable_height = 0.10 # Minimum water depth (m) which is stored for visualisation |
---|
44 | tide = SLR # Mean Sea Level = 0. GEMS model includes tide. # Busselton Chart Datum is 0.786m below AHD (Section 3.3 "Locke Estate Busselton Investigation of Beach Stabilisation - Department for Planning and Infrastructure 2004.pdf" in the original reference/reports folder) |
---|
45 | friction = 0.03 # 0.01: Very Low 0.025-0.04: "Standard" natural channel 0.04-0.06: Pretty rough |
---|
46 | alpha = 0.1 # Smoothing of mesh; 1 is smoothest |
---|
47 | zone = 50 # Specify UTM zone of model |
---|
48 | |
---|
49 | starttime= 0 # Start time for simulation |
---|
50 | yieldstep = 720 # 12 minute timesteps |
---|
51 | finaltime = 140400 # Final time for simulation |
---|
52 | |
---|
53 | if UseCheckRestore: |
---|
54 | restPtInt = 12*yieldstep # Save a restore point every x timesteps, must be an even number |
---|
55 | |
---|
56 | #------------------------------------------------------------------------------- |
---|
57 | # Input Filenames |
---|
58 | #------------------------------------------------------------------------------- |
---|
59 | |
---|
60 | # ELEVATION DATA |
---|
61 | # Used in build_elevation.py |
---|
62 | # Format for points: easting,northing, elevation (AHD) Header: x,y |
---|
63 | ascii_grid_filenames = [] |
---|
64 | |
---|
65 | #point_filenames = ['busselton25mpoints.csv',"Busselton1mDEM_VDD_Pts.csv"] |
---|
66 | #point_filenames = ['busselton25mpoints.csv',"Busselton1mDEM_VDD_Pts.csv",\ |
---|
67 | # "Busselton1mDEM_Sab_Pts.csv","Busselton1mDEM_Abb_Pts.csv"] |
---|
68 | point_filenames = ['busselton25mpoints.csv'] |
---|
69 | |
---|
70 | # Output filename for elevation |
---|
71 | # this is a combination of all the data generated in build_elevation.py |
---|
72 | combined_elevation_basename = scenario_name + '_combined_elevation' |
---|
73 | |
---|
74 | # BOUNDING POLYGON - for data clipping and estimate of triangles in mesh |
---|
75 | # Used in build_elevation.py |
---|
76 | # Format for points: easting,northing (no header) |
---|
77 | bounding_polygon_filename = 'ANUGA_Domain2.xyz' # Maximum size of area modelled |
---|
78 | bounding_polygon_maxarea = 10000 # Max area (m2) in any one triangle |
---|
79 | |
---|
80 | # INTERIOR REGIONS - for designing the mesh |
---|
81 | # Used in run_model.py |
---|
82 | # Format for points: easting,northing (no header) |
---|
83 | |
---|
84 | interior_regions_data = [['CoastPoly.xyz', 100]]#, # Areas (polygons) which have been refined, max area of triangles inside polygon) ['Vasse_River_1.xyz', 2], |
---|
85 | # ['Vasse_River.xyz', 2], |
---|
86 | # ['Sabina_River.xyz', 50], |
---|
87 | # ['Abba_River.xyz', 50]] |
---|
88 | |
---|
89 | # LAND - used to set the initial stage/water to be offcoast only |
---|
90 | # Used in run_model.py. Format for points easting,northing (no header) |
---|
91 | Land = 'ANUGA_Land.xyz' |
---|
92 | |
---|
93 | InitialStages = [[Land, 0.0], |
---|
94 | ['The_Broadwater.csv', 0.4], #Values from JDA's Busselton Regional Flood Study Review Volume 2 Appendices |
---|
95 | ['New_River.csv', 0.2], |
---|
96 | ['Vasse_Estuary.csv', 0.4], |
---|
97 | ['Wonnerup_Estuary.csv', 0.4]] |
---|
98 | |
---|
99 | VasseDDLine = [[347893.7127, 6271596.0586], [347901.9453, 6271603.7542]] |
---|
100 | SabinaLine = [[353132.7757,6274869.5972], [353137.009,6274871.2906]] |
---|
101 | AbbaLine = [[354860.7323,6276575.6181], [354864.4365,6276577.4172]] |
---|
102 | |
---|
103 | if ARI == 25: |
---|
104 | VasseDD = 'VasseDD25_2.tms' #From Vasse July 97 prelim report |
---|
105 | Sab = "Sabina25_2.tms" #Constructed from 29.0 peak: From Busselton Regional Flood Study Review 1998 DA |
---|
106 | Abb = "Abba25_2.tms" #Constructed from 67.0 peak: From Busselton Regional Flood Study Review 1998 DA |
---|
107 | |
---|
108 | if ARI == 100: |
---|
109 | VasseDD ="VasseDD100_2.tms" #Constructed from 190.0 peak: From Busselton Regional Flood Study Review 1998 DA |
---|
110 | Sab = "Sabina100_2.tms" #Constructed from 35.0 peak: From Busselton Regional Flood Study Review 1998 DA |
---|
111 | Abb = "Abba100_2.tms" #Constructed from 86.0 peak: From Busselton Regional Flood Study Review 1998 DA |
---|
112 | |
---|
113 | if UseFlooding: |
---|
114 | riversHydro = [[VasseDD,VasseDDLine],[Sab,SabinaLine],[Abb,AbbaLine]] |
---|
115 | else: |
---|
116 | riversHydro = [] |
---|
117 | |
---|
118 | |
---|
119 | PriorityArea_filename = None |
---|
120 | |
---|
121 | # GEMS order filename - should be in same direction as landward boundary points ie clockwise or anti-clockwise |
---|
122 | # Format is northing, easting (without header) |
---|
123 | gems_order_filename = 'GEMS_Boundary_pts.xyz' |
---|
124 | |
---|
125 | # GAUGES - for creating timeseries at a specific point |
---|
126 | # Used in get_timeseries.py. |
---|
127 | # Format easting,northing,name,elevation (with header) |
---|
128 | gauges_filename = 'gauges.csv' #'tsunamipointsMGA.csv' |
---|
129 | |
---|
130 | #------------------------------------------------------------------------------- |
---|
131 | # Locations for extracting time series (for outputs) |
---|
132 | #------------------------------------------------------------------------------- |
---|
133 | #gauges=["Marina,351040,6277403", 'Jetty,345960,6277593', "Hospital,344131,6274965"] |
---|
134 | # Order of gauges is Marina, Jetty, Hospital |
---|
135 | |
---|
136 | # BUILDINGS EXPOSURE - for identifying inundated houses |
---|
137 | # Used in run_building_inundation.py |
---|
138 | # Format latitude,longitude etc (geographic) |
---|
139 | building_exposure_filename = '' # from NEXIS |
---|
140 | |
---|
141 | # AREA OF IMAGES - Extent of each image to find out highest runup |
---|
142 | # Header - easting,northing,id,value |
---|
143 | # Used in get_runup.py |
---|
144 | images_filename = '' |
---|
145 | |
---|
146 | # Landward bounding points |
---|
147 | # Format easting,northing (no header) |
---|
148 | landward_boundary_filename = 'ANUGA_Land_pts.xyz' |
---|
149 | |
---|
150 | #------------------------------------------------------------------------------ |
---|
151 | # ADD ROUGHNESS INFORMATION HERE |
---|
152 | #------------------------------------------------------------------------------ |
---|
153 | |
---|
154 | # mannings value for different landuses, defined by polygons. Have replicated order of materials applied in TUFLOW. |
---|
155 | # Set the default materials value to 208 (sugarcane). |
---|
156 | # i.e. the area of the whole hydraulic model is sugarcane unless stated otherwise below. |
---|
157 | # Does not make sense though why TUFLOW model still defined some areas as 208! |
---|
158 | # NEED TO CHECK THAT THIS ACTUALLY WORKS IN ANUGA |
---|
159 | # i.e. THAT ROUHGNESS IN LATER SMALLER POLYGONS OVERRIDES THE DEFAULT ROUGHNESS APPLIED HERE TO THE WHOLE HYDRAULIC MODEL |
---|
160 | # IF NOT, THEN THIS WON'T WORK PROPERLY!!!!!! |
---|
161 | #ManningDictionary = {join(polygons_folder, 'mannings', 'historical', 'bounding_polygon.csv'): 0.150, |
---|
162 | # # Read materials values taken from 2d_mat_tw_422.mif |
---|
163 | # join(polygons_folder, 'mannings', 'historical', '201_0.csv'): 0.03, #2D river/waterways |
---|
164 | # join(polygons_folder, 'mannings', 'historical', '202_1.csv'): 0.026, # 2D tidal waterways |
---|
165 | # join(polygons_folder, 'mannings', 'historical', '203_0.csv'): 0.090, # 2D river banks |
---|
166 | # join(polygon:xs_folder, 'mannings', 'historical', '204_1.csv'): 0.100, # 2D dense forest |
---|
167 | # join(polygons_folder, 'mannings', 'historical', '205_0.csv'): 0.080, # 2D vegetated islands in river |
---|
168 | # join(polygons_folder, 'mannings', 'historical', '206_25.csv'): 0.060, # 2D cleared / grazing / bare land |
---|
169 | # join(polygons_folder, 'mannings', 'historical', '207_0.csv'): 0.040, # 2D parks |
---|
170 | # join(polygons_folder, 'mannings', 'historical', '208_0a.csv'): 0.150, # 2D sugarcane |
---|
171 | # join(polygons_folder, 'mannings', 'historical', '209_0.csv'): 1.000, # 2D urban |
---|
172 | # join(polygons_folder, 'mannings', 'historical', '210_0a.csv'): 0.025} # 2D highway/roads |
---|
173 | |
---|
174 | |
---|
175 | ################################################################################ |
---|
176 | ################################################################################ |
---|
177 | #### NOTE: NOTHING WOULD NORMALLY CHANGE BELOW THIS POINT. #### |
---|
178 | ################################################################################ |
---|
179 | ################################################################################ |
---|
180 | |
---|
181 | # Get system user and host names. |
---|
182 | # These values can be used to distinguish between two similar runs by two |
---|
183 | # different users or runs by the same user on two different machines. |
---|
184 | user = anuga.get_user_name() |
---|
185 | host = anuga.get_host_name() |
---|
186 | |
---|
187 | # Environment variable names. |
---|
188 | # The inundation directory, not the data directory. |
---|
189 | #ENV_INUNDATIONHOME = 'INUNDATIONHOME' |
---|
190 | |
---|
191 | #------------------------------------------------------------------------------- |
---|
192 | # Output Elevation Data |
---|
193 | #------------------------------------------------------------------------------- |
---|
194 | |
---|
195 | ## Output filename for elevation |
---|
196 | ## this is a combination of all the data generated in build_elevation.py |
---|
197 | #combined_elevation_basename = scenario_name_init + '_combined_elevation' |
---|
198 | |
---|
199 | # Output filename for elevation |
---|
200 | # this is a combination of all the data generated in build_elevation.py |
---|
201 | combined_elevation_basename = scenario_name + '_combined_elevation' |
---|
202 | |
---|
203 | #------------------------------------------------------------------------------- |
---|
204 | # Directory Structure |
---|
205 | #------------------------------------------------------------------------------- |
---|
206 | |
---|
207 | # determines time for setting up output directories |
---|
208 | time = strftime('%Y%m%d_%H%M%S', localtime()) |
---|
209 | gtime = strftime('%Y%m%d_%H%M%S', gmtime()) |
---|
210 | build_time = time + '_build' |
---|
211 | run_time = time + '_run_' |
---|
212 | |
---|
213 | # check various directories/files that must exist |
---|
214 | anuga_folder = join(home, 'anuga') |
---|
215 | topographies_folder = join(anuga_folder, 'topographies') |
---|
216 | polygons_folder = join(anuga_folder, 'polygons') |
---|
217 | boundaries_folder = join(anuga_folder, 'boundaries') |
---|
218 | gauges_folder = join(anuga_folder, 'gauges') |
---|
219 | event_folder = join(boundaries_folder, str(event)) |
---|
220 | hydrographs_folder = join(anuga_folder, 'hydrographs') |
---|
221 | meshes_folder = join(anuga_folder, 'meshes') |
---|
222 | |
---|
223 | output_folder = join(outFolder,event) |
---|
224 | |
---|
225 | if UseCheckRestore: |
---|
226 | restore_folder = join(output_folder,restoreFolderName) |
---|
227 | |
---|
228 | #if not os.path.exists(output_folder): |
---|
229 | # os.makedirs(output_folder) |
---|
230 | |
---|
231 | #------------------------------------------------------------------------------- |
---|
232 | # Location of input and output data |
---|
233 | #------------------------------------------------------------------------------- |
---|
234 | |
---|
235 | # OCEAN INPUT |
---|
236 | # The absolute pathname for the .sts file. |
---|
237 | event_sts = join(boundaries_folder, stsName) |
---|
238 | |
---|
239 | #------------------------------------------------------------------------------- |
---|
240 | # Output filename |
---|
241 | # |
---|
242 | # Your output filename should be unique between different runs on different data. |
---|
243 | # The list of items below will be used to create a file in your output directory. |
---|
244 | # Your user name and time+date will be automatically added. For example,20101017_090339_run_storm_surge_final_worse_case_0408_current20m_gate_0.0_sextoj |
---|
245 | |
---|
246 | # [setup, event, which_elevation, gate, SLR] |
---|
247 | # will result in a filename like |
---|
248 | # 20090212_091046_run_final_20100527_gcom_12min_current_gate_0_jsexton |
---|
249 | #------------------------------------------------------------------------------- |
---|
250 | |
---|
251 | output_comment = [setup, event] |
---|
252 | |
---|
253 | # Convert the user output_comment to a string for run_model.py |
---|
254 | output_comment = ('_'.join([str(x) for x in output_comment if x != user]) |
---|
255 | + '_' + user) |
---|
256 | |
---|
257 | # The absolute pathname of the all elevation, generated in build_elevation.py |
---|
258 | combined_elevation = join(topographies_folder, combined_elevation_basename) |
---|
259 | |
---|
260 | # The pathname for the GEMS order points |
---|
261 | if gems_order_filename: |
---|
262 | gems_order = join(boundaries_folder, gems_order_filename) |
---|
263 | |
---|
264 | # The absolute pathname for the landward points of the bounding polygon, |
---|
265 | # Used within run_model.py) |
---|
266 | if landward_boundary_filename: |
---|
267 | landward_boundary = join(boundaries_folder, landward_boundary_filename) |
---|
268 | |
---|
269 | # The absolute pathname for the output folder names |
---|
270 | # Used for build_elevation.py |
---|
271 | output_build = join(output_folder, build_time) + '_' + str(user) |
---|
272 | # Used for run_model.py |
---|
273 | output_run = join(output_folder, output_comment) |
---|
274 | # Used by post processing |
---|
275 | output_run_time = join(output_run, scenario_name) |
---|
276 | |
---|
277 | # The absolute pathname of the mesh, generated in run_model.py |
---|
278 | #meshes = join(output_run, scenario_name + "_" + setup) + '.msh' |
---|
279 | meshes = join(output_run, scenario_name) + '.msh' |
---|
280 | |
---|
281 | # Log file name |
---|
282 | #log.log_filename = join(output_run, scenario_name) + '.log' |
---|
283 | |
---|
284 | ## The absolute pathname for the storm gate file |
---|
285 | ## Used for run_model.py |
---|
286 | #if storm_gate_filename: |
---|
287 | # storm_gate = join(polygons_folder, storm_gate_filename) |
---|
288 | |
---|
289 | # The absolute pathname for the gauges file |
---|
290 | # Used for get_timeseries.py |
---|
291 | if gauges_filename: |
---|
292 | gauges = join(gauges_folder, gauges_filename) |
---|
293 | |
---|
294 | # The absolute pathname for the building file |
---|
295 | # Used for run_building_inundation.py |
---|
296 | if building_exposure_filename: |
---|
297 | building_exposure = join(gauges_folder, building_exposure_filename) |
---|
298 | |
---|
299 | ## Areas for export of results |
---|
300 | ## Used in export_results_max.py |
---|
301 | #xminBunbury = 371838 |
---|
302 | #xmaxBunbury = 379640 |
---|
303 | #yminBunbury = 6309741 |
---|
304 | #ymaxBunbury = 6316293 |
---|
305 | # |
---|
306 | ## Storm gate area: |
---|
307 | #xminStorm_gate=373515 |
---|
308 | #xmaxStorm_gate=373582 |
---|
309 | #yminStorm_gate=6312314 |
---|
310 | #ymaxStorm_gate=6312358 |
---|
311 | |
---|
312 | # |
---|
313 | ##------------------------------------------------------------------------------- |
---|
314 | ## Absolute Path Definitions. (This should not change) |
---|
315 | ##------------------------------------------------------------------------------- |
---|
316 | # |
---|
317 | ## determines time for setting up output directories |
---|
318 | #time = strftime('%Y%m%d_%H%M%S', localtime()) |
---|
319 | #gtime = strftime('%Y%m%d_%H%M%S', gmtime()) |
---|
320 | #build_time = time + '_build' |
---|
321 | #run_time = time + '_run_' |
---|
322 | # |
---|
323 | ##------------------------------------------------------------------------------- |
---|
324 | ## Output filename |
---|
325 | ## |
---|
326 | ## Your output filename should be unique between different runs on different data. |
---|
327 | ## The list of items below will be used to create a file in your output directory. |
---|
328 | ## Your user name and time+date will be automatically added. For example, |
---|
329 | ## [setup, tide, event_number] |
---|
330 | ## will result in a filename like |
---|
331 | ## 20090212_091046_run_final_0_27283_rwilson |
---|
332 | ##------------------------------------------------------------------------------- |
---|
333 | # |
---|
334 | #output_comment = [setup, tide, radius, event] |
---|
335 | #output_comment = ('_'.join([str(x) for x in output_comment if x != user]) |
---|
336 | # + '_' + user) |
---|
337 | # |
---|
338 | ## The absolute pathname for the output folder names |
---|
339 | ## Used for build_elevation.py |
---|
340 | #output_build = join(output_folder, build_time) + '_' + str(user) |
---|
341 | ## Used for run_model.py |
---|
342 | #output_run = join(output_folder, run_time) + output_comment |
---|
343 | ## Used by post processing |
---|
344 | #output_run_time = join(output_run, scenario_name) |
---|
345 | # |
---|
346 | # |
---|
347 | ## The absolute pathname of the mesh, generated in run_model.py |
---|
348 | ##meshes = join(output_run, scenario_name) + '.msh' |
---|
349 | #meshes = join(os.getcwd(), scenario_name) + '.msh' |
---|
350 | # |
---|
351 | ## The absolute pathname for the gauges file |
---|
352 | ## Used for get_timeseries.py |
---|
353 | #if gauges_filename: |
---|
354 | # gauges = join(gauges_folder, gauges_filename) |
---|
355 | # |
---|
356 | ## The absolute pathname for the building file |
---|
357 | ## Used for run_building_inundation.py |
---|
358 | #if building_exposure_filename: |
---|
359 | # building_exposure = join(gauges_folder, building_exposure_filename) |
---|
360 | # |
---|
361 | ## The absolute pathname for the image file |
---|
362 | ## Used for get_runup.py |
---|
363 | #if images_filename: |
---|
364 | # images = join(polygons_folder, images_filename) |
---|
365 | # |
---|
366 | # |
---|
367 | ## full path to where MUX files (or meta-files) live |
---|
368 | ##mux_input = join(event_folder, mux_input_filename) |
---|
369 | # |
---|
370 | ##Multiple polygons in one CSV file to make internal polygons |
---|
371 | #if not PriorityArea_filename == None: |
---|
372 | # PriorityAreas = join(polygons_folder, PriorityArea_filename) |
---|
373 | # |
---|
374 | ##friction_list = read_polygon_dir(ManningDictionary, join(polygons_folder,'mannings','historical')) |
---|
375 | # |
---|
376 | ##interior_regions = read_polygon_dir(CatchmentDictionary, join(polygons_folder,'bdy')) |
---|
377 | # |
---|
378 | ## The absolute pathname of the all elevation, generated in build_elevation.py |
---|
379 | #combined_elevation = join(topographies_folder, combined_elevation_basename) |
---|
380 | # |
---|
381 | ## The pathname for the urs order points, used within build_urs_boundary.py |
---|
382 | ##if urs_order_filename: |
---|
383 | ## urs_order = join(boundaries_folder, urs_order_filename) |
---|
384 | # |
---|
385 | ## The absolute pathname for the landward points of the bounding polygon, |
---|
386 | ## Used within run_model.py) |
---|
387 | ##if landward_boundary_filename: |
---|
388 | ## landward_boundary = join(boundaries_folder, landward_boundary_filename) |
---|
389 | # |
---|
390 | ## The absolute pathname for the .sts file, generated in build_boundary.py |
---|
391 | ##event_sts = join(event_folder, scenario_name) |
---|
392 | # |
---|
393 | ##elevation_name = join(topographies_folder, elevation_filename) # directory location and DEM name. This has been triangulated using 2d_zpts_tw_803.mid as the base. |
---|
394 | #meshname = join(output_run, scenario_name) + '.msh' |
---|
395 | # |
---|
396 | ##ocean_hydrograph_filename=join(ocean_folder, ocean_hydrograph_basename) |
---|