Ignore:
Timestamp:
May 15, 2007, 4:13:58 PM (17 years ago)
Author:
nick
Message:

update broome

File:
1 edited

Legend:

Unmodified
Added
Removed
  • anuga_work/production/broome_2006/export_results.py

    r4347 r4429  
    55from os import sep
    66
    7 time_dir = '20061113_040953'
     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
    813
    9 directory = project.outputdir
    10 name = directory + time_dir +sep + 'source'
     14is_parallel = True
     15if is_parallel == True: nodes = 4
     16print 'output dir:', name
    1117
    12 print 'output dir:', name
    13 which_var = 4
     18which_var = 2
    1419if which_var == 0:  # Stage
    1520    outname = name + '_stage'
     
    1722
    1823if which_var == 1:  # Absolute Momentum
    19     outname = name + '_momentum'
    20     quantityname = '(xmomentum**2 + ymomentum**2)**0.5'  #Absolute momentum
     24    outname = name + '_momentum_i1'
     25    quantityname = '(xmomentum**2 + ymomentum**2)**0.5' 
    2126
    2227if which_var == 2:  # Depth
    2328    outname = name + '_depth'
    24     quantityname = 'stage-elevation'  #Depth
     29    quantityname = 'stage-elevation' 
    2530
    2631if which_var == 3:  # Speed
    27     outname = name + '_speed'
     32    outname = name + '_speed_i0'
    2833    quantityname = '(xmomentum**2 + ymomentum**2)**0.5/(stage-elevation+1.e-6/(stage-elevation))'  #Speed
    2934
     
    3237    quantityname = 'elevation'  #Elevation
    3338
    34 print 'start sww2dem'
    3539
    36 sww2dem(name, basename_out = outname,
    37             quantity = quantityname,
    38             cellsize = 25,      # would prefer this at 25
    39             # define region for viz purposes
    40             easting_min = project.eastingmin,
    41             easting_max = project.eastingmax,
    42             northing_min = project.northingmin,
    43             northing_max = project.northingmax,       
    44             reduction = max, #this is because we want max quantityname
    45             verbose = True,
    46             format = 'asc')
    4740
     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 TracChangeset for help on using the changeset viewer.