Skip to content

Commit

Permalink
Finalizing reader for datamesh tide cons grid
Browse files Browse the repository at this point in the history
  • Loading branch information
simonweppe committed Mar 28, 2024
1 parent 57a76c4 commit 6bf4413
Show file tree
Hide file tree
Showing 4 changed files with 103 additions and 1,272 deletions.
11 changes: 3 additions & 8 deletions examples/example_tide_reader_datamesh_structured.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,31 +17,26 @@
datamesh_regular_cons = reader_datamesh_regular_cons.Reader(
filename = '/home/simon/calypso_science/tide_grids/oceanum_2km.zarr',) # native coordinate system is lon/lat

# this will include the mesh boundary polygons and interior islands

# >> see how we can use it as land_bindary_mask
# schism_native.plot_mesh()
o.add_reader([reader_landmask,datamesh_regular_cons]) #
o.set_config('general:use_auto_landmask', False) # prevent opendrift from making a new dynamical landmask with global_landmask
o.set_config('general:coastline_action', 'previous') # prevent particles stranding
o.set_config('drift:horizontal_diffusivity', 0.0) # Switch on horizontal diffusivity. Set this at 0.1 m2/s (https://journals.ametsoc.org/view/journals/atot/22/9/jtech1794_1.xml)

# time_run = [datetime.utcnow(), datetime.utcnow() + timedelta(hours=12)]
time_run = [datetime(2024,1,1), datetime(2024,1,1) + timedelta(hours=24)]

# Seed elements at defined positions, depth and time
#
# in Cook Strait
o.seed_elements(lon=174.518665,
lat=-41.200639,
o.seed_elements(lon=174.572107,
lat=-41.499003,
radius=500, # 1km radius
number=1000,
z=np.linspace(0,-10, 1000),
time=time_run) # this will be a continuous release over that time vector

# Running model
o.run(stop_on_error = True,
time_step=600,
time_step=900,
end_time = time_run[-1],
time_step_output = 1800.)
# outfile='schism_native_output.nc')
Expand Down
11 changes: 3 additions & 8 deletions examples/example_tide_reader_datamesh_unstructured.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,16 +12,13 @@
# READERS
###############################

reader_landmask = reader_global_landmask.Reader()

# reader_landmask = reader_global_landmask.Reader()
schism_datamesh_cons = reader_datamesh_schism_cons.Reader(
filename = 'calypso-tidalcons-hauraki-v1',) # native coordinate system is lon/lat
# this will include the mesh boundary polygons and interior islands

# >> see how we can use it as land_bindary_mask
import pdb;pdb.set_trace()
# schism_native.plot_mesh()
o.add_reader([reader_landmask,schism_datamesh_cons]) #
o.add_reader([schism_datamesh_cons]) #
o.set_config('general:use_auto_landmask', False) # prevent opendrift from making a new dynamical landmask with global_landmask
o.set_config('general:coastline_action', 'previous') # prevent particles stranding
o.set_config('drift:horizontal_diffusivity', 0.1) # Switch on horizontal diffusivity. Set this at 0.1 m2/s (https://journals.ametsoc.org/view/journals/atot/22/9/jtech1794_1.xml)
Expand Down Expand Up @@ -53,6 +50,4 @@
# outfile='schism_native_output.nc')
import pdb;pdb.set_trace()
o.plot(fast=True,filename='test_schism_datamesh_cons.png')
o.animation(fast=True,filename='test_schism_datamesh_cons.gif')

# >> need to find a way to use the land_binary mask information from the cons grid
o.animation(fast=True,filename='test_schism_datamesh_cons.gif')
Loading

0 comments on commit 6bf4413

Please sign in to comment.