Skip to content

Commit 2ebda09

Browse files
committed
Merge branch 'dev_kc' into dev
2 parents 5e7dee8 + 3e1f118 commit 2ebda09

File tree

1 file changed

+38
-0
lines changed

1 file changed

+38
-0
lines changed

examples/example_mdl_swash_Vietnam.py

+38
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
# =============================================================================
2+
# IMPORT dnora
3+
# =============================================================================
4+
from dnora import grd, mdl, inp, bnd
5+
# =============================================================================
6+
# DEFINE GRID OBJECT
7+
# =============================================================================
8+
# Set grid definitions
9+
grid = grd.Grid(lon=(109.150, 109.6), lat=(12.430, 12.815), name='Vietnam')
10+
11+
# Set spacing and boundary points
12+
grid.set_spacing(dm=400)
13+
grid.set_boundary(grd.boundary.MidPointAsBoundary(edges='E'))
14+
# Import topography and mesh it down to the grid definitions
15+
grid.import_topo(topo_reader=grd.read.GEBCO2021(tile='Vietnam',
16+
folder='/home/konstantinosc/bathy'))
17+
grid.mesh_grid()
18+
19+
# =============================================================================
20+
# DEFINE MODEL OBJECT
21+
# =============================================================================
22+
model = mdl.SWASH(grid, start_time='2018-08-25T00:00',
23+
end_time='2018-08-25T05:00')
24+
25+
# =============================================================================
26+
# PLOT GRID, FORCING AND BOUNDARIES
27+
# =============================================================================
28+
model.plot_grid(save_fig=True, show_fig=False)
29+
# =============================================================================
30+
# WRITE OUTPUT FOR SWASH RUN
31+
# =============================================================================
32+
model.export_grid()
33+
model.write_input_file(input_file_writer=inp.SWASH(
34+
bound_side_command='BOU SIDE S CCW CON REG 0.5 20 180 ')) # Vietnam
35+
# =============================================================================
36+
# SWASH RUN
37+
# =============================================================================
38+
model.run_model(dry_run=False, mat_to_nc=True)

0 commit comments

Comments
 (0)