Ignore:
Timestamp:
Jul 4, 2007, 5:22:18 PM (17 years ago)
Author:
nick
Message:

update model scripts

File:
1 edited

Legend:

Unmodified
Added
Removed
  • anuga_work/production/pt_hedland_2006/run_pt_hedland_urs.py

    r4544 r4587  
    3838from anuga.caching import myhash
    3939from anuga.damage_modelling.inundation_damage import add_depth_and_momentum2csv, inundation_damage
     40from anuga.fit_interpolate.benchmark_least_squares import mem_usage
    4041# Application specific imports
    4142import project_urs                 # Definition of file names and polygons
     
    5354   
    5455    kwargs['output_dir']=project_urs.output_run_time_dir
    55     kwargs['bathy_file']=project_urs.combined_dir_name + '.txt'
     56    kwargs['bathy_file']=project_urs.combined_dir_name + '.pts'
    5657    kwargs['boundary_file']=project_urs.boundaries_in_dir_name + '.sww'
    5758
     
    6162    #------------------------------------------------------------------------------
    6263
    63     start_screen_catcher(kwargs['output_dir'], myid, numprocs)
    64 
    6564    print 'output_dir',kwargs['output_dir']
    6665    if myid == 0:
     
    7170
    7271    barrier()
     72   
     73    start_screen_catcher(kwargs['output_dir'], myid, numprocs)
     74   
    7375
    7476    print "Processor Name:",get_processor_name()
     
    124126        from polygon import Polygon_function
    125127        #following sets the stage/water to be offcoast only
    126         IC = Polygon_function( [(project_urs.poly_mainland, -1.0)], default = kwargs['tide'],
    127                                  geo_reference = domain.geo_reference)
    128         domain.set_quantity('stage', IC)
     128        #IC = Polygon_function( [(project_urs.poly_mainland, -50.0)], default = kwargs['tide'],
     129        #                         geo_reference = domain.geo_reference)
     130        #domain.set_quantity('stage', IC)
     131        domain.set_quantity('stage', kwargs['tide'])
    129132        domain.set_quantity('friction', kwargs['friction'])
    130133       
    131         print 'Start Set quantity'
    132 
     134        print 'Start Set quantity', kwargs['bathy_file'],kwargs['alpha']
     135       
    133136        domain.set_quantity('elevation',
    134137                            filename = kwargs['bathy_file'],
     
    217220    if myid == 0:
    218221        store_parameters(**kwargs)
    219 
    220     swwfile = kwargs['output_dir']+kwargs['aa_scenario_name']
    221     export_grid(swwfile, extra_name_out = 'town',
    222                 quantities = ['elevation','depth','stage','speed'], # '(xmomentum**2 + ymomentum**2)**0.5' defaults to elevation
    223                 timestep = None,
    224                 reduction = max,
    225                 cellsize = 25,
    226                 NODATA_value = -9999,
    227                 easting_min = project_urs.eastingmin,
    228                 easting_max = project_urs.eastingmax,
    229                 northing_min = project_urs.northingmin,
    230                 northing_max = project_urs.northingmax,
    231                 verbose = True,
    232                 origin = None,
    233                 datum = 'WGS84',
    234                 format = 'asc')
    235    
    236     buildings_filename = project_urs.buildings_filename
    237     buildings_filename_out = project_urs.buildings_filename_out
    238                
    239     inundation_damage(swwfile+'.sww', buildings_filename, buildings_filename_out)
    240     print '\n Augmented building file written to %s \n' %buildings_filename_out
     222       
     223        print 'memory usage before del domain',mem_usage()
     224        del domain
     225        print 'memory usage after del domain',mem_usage()
     226   
     227        swwfile = kwargs['output_dir']+kwargs['aa_scenario_name']
     228        print'swwfile',swwfile
     229
     230        export_grid(swwfile, extra_name_out = 'town',
     231                    quantities = ['speed','depth','stage','elevation'], # '(xmomentum**2 + ymomentum**2)**0.5' defaults to elevation
     232                    timestep = None,
     233                    reduction = max,
     234                    cellsize = 25,
     235                    NODATA_value = -9999,
     236                    easting_min = project_urs.eastingmin,
     237                    easting_max = project_urs.eastingmax,
     238                    northing_min = project_urs.northingmin,
     239                    northing_max = project_urs.northingmax,
     240                    verbose = True,
     241                    origin = None,
     242                    datum = 'WGS84',
     243                    format = 'asc')
     244       
     245        buildings_filename = project_urs.buildings_filename
     246        buildings_filename_out = project_urs.buildings_filename_out
     247                   
     248        inundation_damage(swwfile+'.sww', buildings_filename, buildings_filename_out)
     249        print '\n Augmented building file written to %s \n' %buildings_filename_out
    241250   
    242251    barrier()
Note: See TracChangeset for help on using the changeset viewer.