source: anuga_work/production/exmouth_2006/run_store.py @ 4509

Last change on this file since 4509 was 4509, checked in by nick, 17 years ago

updates to exmouth

File size: 3.5 KB
Line 
1"""Script for running tsunami inundation scenario for Dampier, WA, Australia.
2
3Source data such as elevation and boundary data is assumed to be available in
4directories specified by project.py
5The output sww file is stored in project.output_run_time_dir
6
7The scenario is defined by a triangular mesh created from project.polygon,
8the elevation data and a simulated tsunami generated with URS code.
9
10Ole Nielsen and Duncan Gray, GA - 2005 and Jane Sexton, Nick Bartzis, GA - 2006
11"""
12
13#------------------------------------------------------------------------------
14# Import necessary modules
15#------------------------------------------------------------------------------
16
17# Standard modules
18from os import sep
19from os.path import dirname, basename
20from os import mkdir, access, F_OK
21from shutil import copy
22import time
23import sys
24
25# Related major packages
26from anuga.shallow_water import Domain
27from anuga.shallow_water import Dirichlet_boundary
28from anuga.shallow_water import File_boundary
29from anuga.shallow_water import Reflective_boundary
30from anuga.shallow_water import Field_boundary
31from Numeric import allclose
32
33from anuga.pmesh.mesh_interface import create_mesh_from_regions
34from anuga.abstract_2d_finite_volumes.util import start_screen_catcher, copy_code_files,store_parameters
35from anuga_parallel.parallel_api import distribute, numprocs, myid, barrier
36from anuga_parallel.parallel_abstraction import get_processor_name
37from anuga.caching import myhash
38# Application specific imports
39import project                 # Definition of file names and polygons
40
41def run_model(**kwargs):
42   
43#    tide = kwargs['tide']
44#    alpha = kwargs['alpha']
45#    friction = kwargs['friction']
46#    time_thinning = kwargs['time_thinning']
47    scenario_name = kwargs['aa_scenario_name']
48   
49    #------------------------------------------------------------------------------
50    # Copy scripts to time stamped output directory and capture screen
51    # output to file
52    #------------------------------------------------------------------------------
53    '''
54    #copy script must be before screen_catcher
55    print 'tide',tide
56    kwargs['est_num_trigs']=444444
57    kwargs['num_cpu']=numprocs
58    kwargs['host']=project.host
59    kwargs['res_factor']=project.res_factor
60    kwargs['starttime']=project.starttime
61    kwargs['yieldstep']=project.yieldstep
62    kwargs['finaltime']=project.finaltime
63'''   
64    kwargs['output_dir']=project.output_run_time_dir
65    kwargs['bathy_file']=project.combined_dir_name+'.txt'
66    kwargs['boundary_file']=project.boundaries_dir_name + '.sww'
67   
68    print 'output_dir',kwargs['output_dir']
69    if myid == 0:
70        copy_code_files(kwargs['output_dir'],__file__, 
71                 dirname(project.__file__)+sep+ project.__name__+'.py' )
72
73        store_parameters(**kwargs)
74
75    barrier()
76
77    start_screen_catcher(kwargs['output_dir'], myid, numprocs)
78    '''
79 
80    kwargs['act_num_trigs']=7777777
81
82    kwargs['input_start_time']=666
83    #kwargs 'completed' must be added to write the final parameters to file
84    '''   
85    kwargs['completed']=6
86    if myid == 0:
87        store_parameters(**kwargs)
88    barrier()
89
90
91#-------------------------------------------------------------
92if __name__ == "__main__":
93
94    run_model(file_name=project.home+'detail_test.csv', aa_scenario_name='test_store_parameters',
95              ab_time=project.time, res_factor= project.res_factor,
96#               tide=project.tide, user=project.user,
97#              alpha = project.alpha, friction=project.friction,
98#              time_thinning = project.time_thinning,
99              dir_comment=project.dir_comment)
100
101
Note: See TracBrowser for help on using the repository browser.