source: anuga_work/production/broome_2006/export_results.py @ 4429

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

update broome

File size: 2.3 KB
Line 
1import project, os
2import sys
3
4from anuga.shallow_water.data_manager import sww2dem
5from os import sep
6
7time_dir = '20070423_040235_run' #
8cellsize = 25
9timestep = None
10directory = project.output_dir
11#name = directory + time_dir + sep + project.scenario_name
12name = directory+time_dir+sep+project.scenario_name
13
14is_parallel = True
15if is_parallel == True: nodes = 4
16print 'output dir:', name
17
18which_var = 2
19if which_var == 0:  # Stage
20    outname = name + '_stage'
21    quantityname = 'stage'
22
23if which_var == 1:  # Absolute Momentum
24    outname = name + '_momentum_i1'
25    quantityname = '(xmomentum**2 + ymomentum**2)**0.5' 
26
27if which_var == 2:  # Depth
28    outname = name + '_depth'
29    quantityname = 'stage-elevation' 
30
31if which_var == 3:  # Speed
32    outname = name + '_speed_i0'
33    quantityname = '(xmomentum**2 + ymomentum**2)**0.5/(stage-elevation+1.e-6/(stage-elevation))'  #Speed
34
35if which_var == 4:  # Elevation
36    outname = name + '_elevation'
37    quantityname = 'elevation'  #Elevation
38
39
40
41if is_parallel == True:
42#    print 'is_parallel',is_parallel
43    for i in range(0,nodes):
44        namei = name + '_P%d_%d' %(i,nodes)
45        outnamei = outname + '_P%d_%d' %(i,nodes)
46        print 'start sww2dem for sww file %d' %(i)
47        sww2dem(namei, basename_out = outnamei,
48                    quantity = quantityname,
49                    timestep = timestep,
50                    cellsize = cellsize,     
51                    easting_min = project.e_min_area,
52                    easting_max = project.e_max_area,
53                    northing_min = project.n_min_area,
54                    northing_max = project.n_max_area,       
55                    reduction = max, 
56                    verbose = True,
57                    format = 'asc')
58else:
59    print 'start sww2dem'
60    sww2dem(name, basename_out = outname,
61                quantity = quantityname,
62                timestep = timestep,
63                cellsize = cellsize,     
64                easting_min = project.e_min_area,
65                easting_max = project.e_max_area,
66                northing_min = project.n_min_area,
67                northing_max = project.n_max_area,       
68                reduction = max, 
69                verbose = True,
70                format = 'asc')
Note: See TracBrowser for help on using the repository browser.