Ignore:
Timestamp:
Aug 13, 2008, 8:21:21 AM (16 years ago)
Author:
kristy
Message:

Updated evolve in run file so that a tide wave takes over when the sts file finishes

File:
1 edited

Legend:

Unmodified
Added
Removed
  • anuga_work/production/onslow_2008/run_onslow.py

    r5635 r5645  
    4242from anuga.utilities.polygon import read_polygon, plot_polygons, polygon_area, is_inside_polygon
    4343from anuga.geospatial_data.geospatial_data import find_optimal_smoothing_parameter
    44 
     44from Scientific.IO.NetCDF import NetCDFFile
    4545# Application specific imports
    4646import project                 # Definition of file names and polygons
     
    8383    # Reading the landward defined points, this incorporates the original clipping
    8484    # polygon minus the 100m contour
    85     landward_bounding_polygon = read_polygon(project.polygons_dir+'landward_bounding_polygon.txt')
     85    landward_bounding_polygon = read_polygon(project.boundaries_dir+'landward_bounding_polygon.txt')
    8686
    8787    # Combine sts polyline with landward points
     
    216216    Bd = Dirichlet_boundary([kwargs['tide'],0,0])
    217217
    218     print dir(Bf)
    219     print 'start reading boundary file'
    220    
    221 
     218    fid = NetCDFFile(boundary_urs_out+'.sts', 'r')    #Open existing file for read
     219    sts_time=fid.variables['time'][:]+fid.starttime
     220    tmin=min(sts_time)
     221    tmax=max(sts_time)
     222    fid.close()
     223
     224    print 'Boundary end time ', tmax-tmin
     225     
    222226##    Bf = Field_boundary(kwargs['boundary_file'],
    223227##                domain, time_thinning=kwargs['time_thinning'], mean_stage=kwargs['tide'],
     
    241245        domain.write_time()
    242246        domain.write_boundary_statistics(tags = 'ocean')
     247
     248        if t >= tmax-tmin:
     249            print 'changed to tide boundary condition at ocean'
     250            domain.set_boundary({'ocean': Bd})
    243251           
    244252    x, y = domain.get_maximum_inundation_location()
Note: See TracChangeset for help on using the changeset viewer.