Skip to content

Commit

Permalink
Merge branch 'dev_kc' into dev
Browse files Browse the repository at this point in the history
  • Loading branch information
bjorkqvi committed Jun 17, 2022
2 parents 5e7dee8 + 3e1f118 commit 2ebda09
Showing 1 changed file with 38 additions and 0 deletions.
38 changes: 38 additions & 0 deletions examples/example_mdl_swash_Vietnam.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
# =============================================================================
# IMPORT dnora
# =============================================================================
from dnora import grd, mdl, inp, bnd
# =============================================================================
# DEFINE GRID OBJECT
# =============================================================================
# Set grid definitions
grid = grd.Grid(lon=(109.150, 109.6), lat=(12.430, 12.815), name='Vietnam')

# Set spacing and boundary points
grid.set_spacing(dm=400)
grid.set_boundary(grd.boundary.MidPointAsBoundary(edges='E'))
# Import topography and mesh it down to the grid definitions
grid.import_topo(topo_reader=grd.read.GEBCO2021(tile='Vietnam',
folder='/home/konstantinosc/bathy'))
grid.mesh_grid()

# =============================================================================
# DEFINE MODEL OBJECT
# =============================================================================
model = mdl.SWASH(grid, start_time='2018-08-25T00:00',
end_time='2018-08-25T05:00')

# =============================================================================
# PLOT GRID, FORCING AND BOUNDARIES
# =============================================================================
model.plot_grid(save_fig=True, show_fig=False)
# =============================================================================
# WRITE OUTPUT FOR SWASH RUN
# =============================================================================
model.export_grid()
model.write_input_file(input_file_writer=inp.SWASH(
bound_side_command='BOU SIDE S CCW CON REG 0.5 20 180 ')) # Vietnam
# =============================================================================
# SWASH RUN
# =============================================================================
model.run_model(dry_run=False, mat_to_nc=True)

0 comments on commit 2ebda09

Please sign in to comment.