Skip to content

Commit 23fa4d2

Browse files
authored
Merge pull request #1709 from knutfrode/dev
Dev
2 parents 7797bfe + 4457663 commit 23fa4d2

5 files changed

Lines changed: 9 additions & 4 deletions

File tree

examples/example_oilspill_seafloor_biodegradation.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@
4444

4545
#%%
4646
# Running model
47-
o.run(duration=timedelta(days=5), time_step=3600)
47+
o.run(duration=timedelta(days=2), time_step=3600)
4848

4949
#%%
5050
# Plot and animate results

examples/example_openberg.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,7 @@
1212

1313
#%%
1414
# Currents and wind forcing
15-
forcing = ['https://thredds.met.no/thredds/dodsC/fou-hi/barents_eps_zdepth_be',
16-
'https://pae-paha.pacioos.hawaii.edu/thredds/dodsC/ncep_global/NCEP_Global_Atmospheric_Model_best.ncd']
15+
forcing = ['https://thredds.met.no/thredds/dodsC/fou-hi/barents_eps_zdepth_be']
1716

1817
#%%
1918
# A permutation of iceberg sizes/dimensions

examples/example_river_runoff.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222
o = OceanDrift(loglevel=20)
2323
o.set_config('drift:horizontal_diffusivity', 300)
2424
o.set_config('general:coastline_action', 'previous')
25+
o.set_config('general:coastline_approximation_precision', None) # Faster to go back to previous
2526
t1 = datetime.now()
2627
t2 = t1 + timedelta(hours=48)
2728
reader_x = reader_oscillating.Reader('x_sea_water_velocity', period=timedelta(hours=24),

opendrift/models/basemodel/__init__.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -981,6 +981,10 @@ def closest_ocean_points(self, lon, lat):
981981
landlats = lat[land_indices]
982982
longrid = np.arange(lonmin, lonmax, deltalon)
983983
latgrid = np.arange(latmin, latmax, deltalat)
984+
if len(longrid) > 1000 or len(latgrid) > 1000:
985+
logger.warning(f'Particles cover large area - using coarser resolution for closest ocean point')
986+
longrid = np.linspace(lonmin, lonmax, 1000)
987+
latgrid = np.linspace(latmin, latmax, 1000)
984988
longrid, latgrid = np.meshgrid(longrid, latgrid)
985989
longrid = longrid.ravel()
986990
latgrid = latgrid.ravel()
@@ -2865,6 +2869,8 @@ def plot_timestep(i):
28652869

28662870
if color is False:
28672871
cargs = {'c': None, 'color': markercolor, 'cmap': None}
2872+
vmin=None
2873+
vmax=None
28682874
else:
28692875
cargs = {'c': [], 'color': None, 'cmap': cmap}
28702876

tests/readers/test_interpolation.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,6 @@ def test_dateline(self):
126126
lons = np.arange(-180, 181, 20)
127127
lats = np.arange(-80, 81, 20)
128128
lons, lats = np.meshgrid(lons, lats)
129-
o.set_config('seed:ocean_only', False)
130129
o.seed_elements(lon=lons, lat=lats, time=start_time, wind_drift_factor=.1)
131130
o.run(steps=2, time_step=3600*12)
132131
# Check expected drift direction for each quadrant

0 commit comments

Comments
 (0)