Ensemble

from datetime import timedelta
import numpy as np
from opendrift.models.oceandrift import OceanDrift
from opendrift.readers import reader_netCDF_CF_generic

Drift simulation using 30 member ensemble wind data from MEPS model of MET Norway

o = OceanDrift(loglevel=20)
o.set_config('drift:vertical_mixing', False)
r = reader_netCDF_CF_generic.Reader('https://thredds.met.no/thredds/dodsC/mepslatest/meps_lagged_6_h_latest_2_5km_latest.nc')
o.add_reader(r)

o.seed_elements(lat=60, lon=4.9, time=r.start_time,
                radius=1000, number=10000)

o.run(duration=timedelta(hours=50), time_step=600, time_step_output=3600)
15:35:30 INFO    opendrift:569: OpenDriftSimulation initialised (version 1.14.11 / v1.14.12-32-g22db1c0)
15:35:30 INFO    opendrift.readers:67: Opening file with xr.open_dataset
15:35:31 INFO    opendrift.readers.reader_netCDF_CF_generic:340: Detected dimensions: {'time': 'time', 'x': 'x', 'y': 'y'}
15:35:31 INFO    opendrift.models.basemodel.environment:203: Adding a global landmask from GSHHG
15:35:37 INFO    opendrift.models.basemodel.environment:227: Fallback values will be used for the following variables which have no readers:
15:35:37 INFO    opendrift.models.basemodel.environment:230:    x_sea_water_velocity: 0.000000
15:35:37 INFO    opendrift.models.basemodel.environment:230:    y_sea_water_velocity: 0.000000
15:35:37 INFO    opendrift.models.basemodel.environment:230:    sea_surface_height: 0.000000
15:35:37 INFO    opendrift.models.basemodel.environment:230:    upward_sea_water_velocity: 0.000000
15:35:37 INFO    opendrift.models.basemodel.environment:230:    ocean_vertical_diffusivity: 0.000000
15:35:37 INFO    opendrift.models.basemodel.environment:230:    horizontal_diffusivity: 0.000000
15:35:37 INFO    opendrift.models.basemodel.environment:230:    sea_surface_wave_significant_height: 0.000000
15:35:37 INFO    opendrift.models.basemodel.environment:230:    sea_surface_wave_stokes_drift_x_velocity: 0.000000
15:35:37 INFO    opendrift.models.basemodel.environment:230:    sea_surface_wave_stokes_drift_y_velocity: 0.000000
15:35:37 INFO    opendrift.models.basemodel.environment:230:    ocean_mixed_layer_thickness: 50.000000
15:35:37 INFO    opendrift.models.basemodel.environment:230:    sea_floor_depth_below_sea_level: 10000.000000
15:35:37 INFO    opendrift:1910: Skipping environment variable ocean_vertical_diffusivity because of condition ['drift:vertical_mixing', 'is', False]
15:35:37 INFO    opendrift:1910: Skipping environment variable ocean_mixed_layer_thickness because of condition ['drift:vertical_mixing', 'is', False]
15:35:37 INFO    opendrift:1921: Storing previous values of element property lon because of condition (('general:coastline_action', 'in', ['stranding', 'previous']), 'or', ('general:seafloor_action', 'in', ['previous']))
15:35:37 INFO    opendrift:1921: Storing previous values of element property lat because of condition (('general:coastline_action', 'in', ['stranding', 'previous']), 'or', ('general:seafloor_action', 'in', ['previous']))
15:35:37 INFO    opendrift:1929: Storing previous values of environment variable sea_surface_height because of condition ['drift:vertical_advection', 'is', True]
15:35:37 INFO    opendrift:958: Using existing reader for land_binary_mask to move elements to ocean
15:35:37 INFO    opendrift:989: All points are in ocean
15:35:37 INFO    opendrift:2237: 2026-10-05 13:00:00 - step 1 of 300 - 10000 active elements (0 deactivated)
15:35:37 WARNING opendrift.readers.interpolation.structured:63: Ensemble data currently not extrapolated towards seafloor
15:35:37 WARNING opendrift.readers.interpolation.structured:63: Ensemble data currently not extrapolated towards seafloor
15:35:37 INFO    opendrift:2237: 2026-10-05 13:10:00 - step 2 of 300 - 10000 active elements (0 deactivated)
15:35:38 WARNING opendrift.readers.interpolation.structured:63: Ensemble data currently not extrapolated towards seafloor
15:35:38 WARNING opendrift.readers.interpolation.structured:63: Ensemble data currently not extrapolated towards seafloor
15:35:38 INFO    opendrift:2237: 2026-10-05 13:20:00 - step 3 of 300 - 10000 active elements (0 deactivated)
15:35:38 INFO    opendrift:2237: 2026-10-05 13:30:00 - step 4 of 300 - 10000 active elements (0 deactivated)
15:35:38 INFO    opendrift:2237: 2026-10-05 13:40:00 - step 5 of 300 - 10000 active elements (0 deactivated)
15:35:38 INFO    opendrift:2237: 2026-10-05 13:50:00 - step 6 of 300 - 10000 active elements (0 deactivated)
15:35:38 INFO    opendrift:2237: 2026-10-05 14:00:00 - step 7 of 300 - 10000 active elements (0 deactivated)
15:35:39 INFO    opendrift:2237: 2026-10-05 14:10:00 - step 8 of 300 - 10000 active elements (0 deactivated)
15:35:39 WARNING opendrift.readers.interpolation.structured:63: Ensemble data currently not extrapolated towards seafloor
15:35:39 WARNING opendrift.readers.interpolation.structured:63: Ensemble data currently not extrapolated towards seafloor
15:35:39 INFO    opendrift:2237: 2026-10-05 14:20:00 - step 9 of 300 - 10000 active elements (0 deactivated)
15:35:39 INFO    opendrift:2237: 2026-10-05 14:30:00 - step 10 of 300 - 10000 active elements (0 deactivated)
15:35:39 INFO    opendrift:2237: 2026-10-05 14:40:00 - step 11 of 300 - 10000 active elements (0 deactivated)
15:35:39 INFO    opendrift:2237: 2026-10-05 14:50:00 - step 12 of 300 - 10000 active elements (0 deactivated)
15:35:40 INFO    opendrift:2237: 2026-10-05 15:00:00 - step 13 of 300 - 10000 active elements (0 deactivated)
15:35:40 INFO    opendrift:2237: 2026-10-05 15:10:00 - step 14 of 300 - 10000 active elements (0 deactivated)
15:35:40 WARNING opendrift.readers.interpolation.structured:63: Ensemble data currently not extrapolated towards seafloor
15:35:40 WARNING opendrift.readers.interpolation.structured:63: Ensemble data currently not extrapolated towards seafloor
15:35:40 INFO    opendrift:2237: 2026-10-05 15:20:00 - step 15 of 300 - 10000 active elements (0 deactivated)
15:35:40 INFO    opendrift:2237: 2026-10-05 15:30:00 - step 16 of 300 - 10000 active elements (0 deactivated)
15:35:41 INFO    opendrift:2237: 2026-10-05 15:40:00 - step 17 of 300 - 10000 active elements (0 deactivated)
15:35:41 INFO    opendrift:2237: 2026-10-05 15:50:00 - step 18 of 300 - 9999 active elements (1 deactivated)
15:35:41 INFO    opendrift:2237: 2026-10-05 16:00:00 - step 19 of 300 - 9999 active elements (1 deactivated)
15:35:41 INFO    opendrift:2237: 2026-10-05 16:10:00 - step 20 of 300 - 9999 active elements (1 deactivated)
15:35:41 WARNING opendrift.readers.interpolation.structured:63: Ensemble data currently not extrapolated towards seafloor
15:35:41 WARNING opendrift.readers.interpolation.structured:63: Ensemble data currently not extrapolated towards seafloor
15:35:41 INFO    opendrift:2237: 2026-10-05 16:20:00 - step 21 of 300 - 9999 active elements (1 deactivated)
15:35:42 INFO    opendrift:2237: 2026-10-05 16:30:00 - step 22 of 300 - 9999 active elements (1 deactivated)
15:35:42 INFO    opendrift:2237: 2026-10-05 16:40:00 - step 23 of 300 - 9998 active elements (2 deactivated)
15:35:42 INFO    opendrift:2237: 2026-10-05 16:50:00 - step 24 of 300 - 9997 active elements (3 deactivated)
15:35:42 INFO    opendrift:2237: 2026-10-05 17:00:00 - step 25 of 300 - 9997 active elements (3 deactivated)
15:35:42 INFO    opendrift:2237: 2026-10-05 17:10:00 - step 26 of 300 - 9994 active elements (6 deactivated)
15:35:43 WARNING opendrift.readers.interpolation.structured:63: Ensemble data currently not extrapolated towards seafloor
15:35:43 WARNING opendrift.readers.interpolation.structured:63: Ensemble data currently not extrapolated towards seafloor
15:35:43 INFO    opendrift:2237: 2026-10-05 17:20:00 - step 27 of 300 - 9989 active elements (11 deactivated)
15:35:43 INFO    opendrift:2237: 2026-10-05 17:30:00 - step 28 of 300 - 9981 active elements (19 deactivated)
15:35:43 INFO    opendrift:2237: 2026-10-05 17:40:00 - step 29 of 300 - 9966 active elements (34 deactivated)
15:35:43 INFO    opendrift:2237: 2026-10-05 17:50:00 - step 30 of 300 - 9947 active elements (53 deactivated)
15:35:43 INFO    opendrift:2237: 2026-10-05 18:00:00 - step 31 of 300 - 9931 active elements (69 deactivated)
15:35:43 INFO    opendrift:2237: 2026-10-05 18:10:00 - step 32 of 300 - 9894 active elements (106 deactivated)
15:35:44 WARNING opendrift.readers.interpolation.structured:63: Ensemble data currently not extrapolated towards seafloor
15:35:44 WARNING opendrift.readers.interpolation.structured:63: Ensemble data currently not extrapolated towards seafloor
15:35:44 INFO    opendrift:2237: 2026-10-05 18:20:00 - step 33 of 300 - 9835 active elements (165 deactivated)
15:35:44 INFO    opendrift:2237: 2026-10-05 18:30:00 - step 34 of 300 - 9777 active elements (223 deactivated)
15:35:44 INFO    opendrift:2237: 2026-10-05 18:40:00 - step 35 of 300 - 9702 active elements (298 deactivated)
15:35:44 INFO    opendrift:2237: 2026-10-05 18:50:00 - step 36 of 300 - 9606 active elements (394 deactivated)
15:35:44 INFO    opendrift:2237: 2026-10-05 19:00:00 - step 37 of 300 - 9475 active elements (525 deactivated)
15:35:45 INFO    opendrift:2237: 2026-10-05 19:10:00 - step 38 of 300 - 9314 active elements (686 deactivated)
15:35:45 WARNING opendrift.readers.interpolation.structured:63: Ensemble data currently not extrapolated towards seafloor
15:35:45 WARNING opendrift.readers.interpolation.structured:63: Ensemble data currently not extrapolated towards seafloor
15:35:45 INFO    opendrift:2237: 2026-10-05 19:20:00 - step 39 of 300 - 9117 active elements (883 deactivated)
15:35:45 INFO    opendrift:2237: 2026-10-05 19:30:00 - step 40 of 300 - 8926 active elements (1074 deactivated)
15:35:45 INFO    opendrift:2237: 2026-10-05 19:40:00 - step 41 of 300 - 8679 active elements (1321 deactivated)
15:35:46 INFO    opendrift:2237: 2026-10-05 19:50:00 - step 42 of 300 - 8403 active elements (1597 deactivated)
15:35:46 INFO    opendrift:2237: 2026-10-05 20:00:00 - step 43 of 300 - 8091 active elements (1909 deactivated)
15:35:46 INFO    opendrift:2237: 2026-10-05 20:10:00 - step 44 of 300 - 7738 active elements (2262 deactivated)
15:35:46 WARNING opendrift.readers.interpolation.structured:63: Ensemble data currently not extrapolated towards seafloor
15:35:46 WARNING opendrift.readers.interpolation.structured:63: Ensemble data currently not extrapolated towards seafloor
15:35:46 INFO    opendrift:2237: 2026-10-05 20:20:00 - step 45 of 300 - 7343 active elements (2657 deactivated)
15:35:47 INFO    opendrift:2237: 2026-10-05 20:30:00 - step 46 of 300 - 7004 active elements (2996 deactivated)
15:35:47 INFO    opendrift:2237: 2026-10-05 20:40:00 - step 47 of 300 - 6599 active elements (3401 deactivated)
15:35:47 INFO    opendrift:2237: 2026-10-05 20:50:00 - step 48 of 300 - 6193 active elements (3807 deactivated)
15:35:47 INFO    opendrift:2237: 2026-10-05 21:00:00 - step 49 of 300 - 5797 active elements (4203 deactivated)
15:35:47 INFO    opendrift:2237: 2026-10-05 21:10:00 - step 50 of 300 - 5418 active elements (4582 deactivated)
15:35:48 WARNING opendrift.readers.interpolation.structured:63: Ensemble data currently not extrapolated towards seafloor
15:35:48 WARNING opendrift.readers.interpolation.structured:63: Ensemble data currently not extrapolated towards seafloor
15:35:48 INFO    opendrift:2237: 2026-10-05 21:20:00 - step 51 of 300 - 5092 active elements (4908 deactivated)
15:35:48 INFO    opendrift:2237: 2026-10-05 21:30:00 - step 52 of 300 - 4758 active elements (5242 deactivated)
15:35:48 INFO    opendrift:2237: 2026-10-05 21:40:00 - step 53 of 300 - 4437 active elements (5563 deactivated)
15:35:48 INFO    opendrift:2237: 2026-10-05 21:50:00 - step 54 of 300 - 4122 active elements (5878 deactivated)
15:35:48 INFO    opendrift:2237: 2026-10-05 22:00:00 - step 55 of 300 - 3848 active elements (6152 deactivated)
15:35:48 INFO    opendrift:2237: 2026-10-05 22:10:00 - step 56 of 300 - 3616 active elements (6384 deactivated)
15:35:49 WARNING opendrift.readers.interpolation.structured:63: Ensemble data currently not extrapolated towards seafloor
15:35:49 WARNING opendrift.readers.interpolation.structured:63: Ensemble data currently not extrapolated towards seafloor
15:35:49 INFO    opendrift:2237: 2026-10-05 22:20:00 - step 57 of 300 - 3343 active elements (6657 deactivated)
15:35:49 INFO    opendrift:2237: 2026-10-05 22:30:00 - step 58 of 300 - 3129 active elements (6871 deactivated)
15:35:49 INFO    opendrift:2237: 2026-10-05 22:40:00 - step 59 of 300 - 2943 active elements (7057 deactivated)
15:35:49 INFO    opendrift:2237: 2026-10-05 22:50:00 - step 60 of 300 - 2780 active elements (7220 deactivated)
15:35:49 INFO    opendrift:2237: 2026-10-05 23:00:00 - step 61 of 300 - 2605 active elements (7395 deactivated)
15:35:49 INFO    opendrift:2237: 2026-10-05 23:10:00 - step 62 of 300 - 2440 active elements (7560 deactivated)
15:35:50 WARNING opendrift.readers.interpolation.structured:63: Ensemble data currently not extrapolated towards seafloor
15:35:50 WARNING opendrift.readers.interpolation.structured:63: Ensemble data currently not extrapolated towards seafloor
15:35:50 INFO    opendrift:2237: 2026-10-05 23:20:00 - step 63 of 300 - 2292 active elements (7708 deactivated)
15:35:50 INFO    opendrift:2237: 2026-10-05 23:30:00 - step 64 of 300 - 2129 active elements (7871 deactivated)
15:35:50 INFO    opendrift:2237: 2026-10-05 23:40:00 - step 65 of 300 - 1971 active elements (8029 deactivated)
15:35:50 INFO    opendrift:2237: 2026-10-05 23:50:00 - step 66 of 300 - 1801 active elements (8199 deactivated)
15:35:50 INFO    opendrift:2237: 2026-10-06 00:00:00 - step 67 of 300 - 1618 active elements (8382 deactivated)
15:35:50 INFO    opendrift:2237: 2026-10-06 00:10:00 - step 68 of 300 - 1463 active elements (8537 deactivated)
15:35:50 WARNING opendrift.readers.interpolation.structured:63: Ensemble data currently not extrapolated towards seafloor
15:35:50 WARNING opendrift.readers.interpolation.structured:63: Ensemble data currently not extrapolated towards seafloor
15:35:50 INFO    opendrift:2237: 2026-10-06 00:20:00 - step 69 of 300 - 1313 active elements (8687 deactivated)
15:35:50 INFO    opendrift:2237: 2026-10-06 00:30:00 - step 70 of 300 - 1161 active elements (8839 deactivated)
15:35:51 INFO    opendrift:2237: 2026-10-06 00:40:00 - step 71 of 300 - 1013 active elements (8987 deactivated)
15:35:51 INFO    opendrift:2237: 2026-10-06 00:50:00 - step 72 of 300 - 857 active elements (9143 deactivated)
15:35:51 INFO    opendrift:2237: 2026-10-06 01:00:00 - step 73 of 300 - 726 active elements (9274 deactivated)
15:35:51 INFO    opendrift:2237: 2026-10-06 01:10:00 - step 74 of 300 - 615 active elements (9385 deactivated)
15:35:51 WARNING opendrift.readers.interpolation.structured:63: Ensemble data currently not extrapolated towards seafloor
15:35:51 WARNING opendrift.readers.interpolation.structured:63: Ensemble data currently not extrapolated towards seafloor
15:35:51 INFO    opendrift:2237: 2026-10-06 01:20:00 - step 75 of 300 - 510 active elements (9490 deactivated)
15:35:51 INFO    opendrift:2237: 2026-10-06 01:30:00 - step 76 of 300 - 405 active elements (9595 deactivated)
15:35:51 INFO    opendrift:2237: 2026-10-06 01:40:00 - step 77 of 300 - 333 active elements (9667 deactivated)
15:35:51 INFO    opendrift:2237: 2026-10-06 01:50:00 - step 78 of 300 - 260 active elements (9740 deactivated)
15:35:51 INFO    opendrift:2237: 2026-10-06 02:00:00 - step 79 of 300 - 206 active elements (9794 deactivated)
15:35:51 INFO    opendrift:2237: 2026-10-06 02:10:00 - step 80 of 300 - 159 active elements (9841 deactivated)
15:35:52 WARNING opendrift.readers.interpolation.structured:63: Ensemble data currently not extrapolated towards seafloor
15:35:52 WARNING opendrift.readers.interpolation.structured:63: Ensemble data currently not extrapolated towards seafloor
15:35:52 INFO    opendrift:2237: 2026-10-06 02:20:00 - step 81 of 300 - 123 active elements (9877 deactivated)
15:35:52 INFO    opendrift:2237: 2026-10-06 02:30:00 - step 82 of 300 - 96 active elements (9904 deactivated)
15:35:52 INFO    opendrift:2237: 2026-10-06 02:40:00 - step 83 of 300 - 74 active elements (9926 deactivated)
15:35:52 INFO    opendrift:2237: 2026-10-06 02:50:00 - step 84 of 300 - 63 active elements (9937 deactivated)
15:35:52 INFO    opendrift:2237: 2026-10-06 03:00:00 - step 85 of 300 - 57 active elements (9943 deactivated)
15:35:52 INFO    opendrift:2237: 2026-10-06 03:10:00 - step 86 of 300 - 46 active elements (9954 deactivated)
15:35:52 WARNING opendrift.readers.interpolation.structured:63: Ensemble data currently not extrapolated towards seafloor
15:35:52 WARNING opendrift.readers.interpolation.structured:63: Ensemble data currently not extrapolated towards seafloor
15:35:52 INFO    opendrift:2237: 2026-10-06 03:20:00 - step 87 of 300 - 39 active elements (9961 deactivated)
15:35:52 INFO    opendrift:2237: 2026-10-06 03:30:00 - step 88 of 300 - 32 active elements (9968 deactivated)
15:35:52 INFO    opendrift:2237: 2026-10-06 03:40:00 - step 89 of 300 - 30 active elements (9970 deactivated)
15:35:52 INFO    opendrift:2237: 2026-10-06 03:50:00 - step 90 of 300 - 28 active elements (9972 deactivated)
15:35:52 INFO    opendrift:2237: 2026-10-06 04:00:00 - step 91 of 300 - 28 active elements (9972 deactivated)
15:35:52 INFO    opendrift:2237: 2026-10-06 04:10:00 - step 92 of 300 - 26 active elements (9974 deactivated)
15:35:53 WARNING opendrift.readers.interpolation.structured:63: Ensemble data currently not extrapolated towards seafloor
15:35:53 WARNING opendrift.readers.interpolation.structured:63: Ensemble data currently not extrapolated towards seafloor
15:35:53 INFO    opendrift:2237: 2026-10-06 04:20:00 - step 93 of 300 - 24 active elements (9976 deactivated)
15:35:53 INFO    opendrift:2237: 2026-10-06 04:30:00 - step 94 of 300 - 23 active elements (9977 deactivated)
15:35:53 INFO    opendrift:2237: 2026-10-06 04:40:00 - step 95 of 300 - 23 active elements (9977 deactivated)
15:35:53 INFO    opendrift:2237: 2026-10-06 04:50:00 - step 96 of 300 - 20 active elements (9980 deactivated)
15:35:53 INFO    opendrift:2237: 2026-10-06 05:00:00 - step 97 of 300 - 20 active elements (9980 deactivated)
15:35:53 INFO    opendrift:2237: 2026-10-06 05:10:00 - step 98 of 300 - 19 active elements (9981 deactivated)
15:35:53 WARNING opendrift.readers.interpolation.structured:63: Ensemble data currently not extrapolated towards seafloor
15:35:53 WARNING opendrift.readers.interpolation.structured:63: Ensemble data currently not extrapolated towards seafloor
15:35:53 INFO    opendrift:2237: 2026-10-06 05:20:00 - step 99 of 300 - 18 active elements (9982 deactivated)
15:35:53 INFO    opendrift:2237: 2026-10-06 05:30:00 - step 100 of 300 - 16 active elements (9984 deactivated)
15:35:53 INFO    opendrift:2237: 2026-10-06 05:40:00 - step 101 of 300 - 14 active elements (9986 deactivated)
15:35:53 INFO    opendrift:2237: 2026-10-06 05:50:00 - step 102 of 300 - 12 active elements (9988 deactivated)
15:35:53 INFO    opendrift:2237: 2026-10-06 06:00:00 - step 103 of 300 - 10 active elements (9990 deactivated)
15:35:53 INFO    opendrift:2237: 2026-10-06 06:10:00 - step 104 of 300 - 9 active elements (9991 deactivated)
15:35:54 WARNING opendrift.readers.interpolation.structured:63: Ensemble data currently not extrapolated towards seafloor
15:35:54 WARNING opendrift.readers.interpolation.structured:63: Ensemble data currently not extrapolated towards seafloor
15:35:54 INFO    opendrift:2237: 2026-10-06 06:20:00 - step 105 of 300 - 9 active elements (9991 deactivated)
15:35:54 INFO    opendrift:2237: 2026-10-06 06:30:00 - step 106 of 300 - 9 active elements (9991 deactivated)
15:35:54 INFO    opendrift:2237: 2026-10-06 06:40:00 - step 107 of 300 - 9 active elements (9991 deactivated)
15:35:54 INFO    opendrift:2237: 2026-10-06 06:50:00 - step 108 of 300 - 7 active elements (9993 deactivated)
15:35:54 INFO    opendrift:2237: 2026-10-06 07:00:00 - step 109 of 300 - 7 active elements (9993 deactivated)
15:35:54 INFO    opendrift:2237: 2026-10-06 07:10:00 - step 110 of 300 - 6 active elements (9994 deactivated)
15:35:54 WARNING opendrift.readers.interpolation.structured:63: Ensemble data currently not extrapolated towards seafloor
15:35:54 WARNING opendrift.readers.interpolation.structured:63: Ensemble data currently not extrapolated towards seafloor
15:35:54 INFO    opendrift:2237: 2026-10-06 07:20:00 - step 111 of 300 - 5 active elements (9995 deactivated)
15:35:54 INFO    opendrift:2237: 2026-10-06 07:30:00 - step 112 of 300 - 4 active elements (9996 deactivated)
15:35:54 INFO    opendrift:2237: 2026-10-06 07:40:00 - step 113 of 300 - 4 active elements (9996 deactivated)
15:35:54 INFO    opendrift:2237: 2026-10-06 07:50:00 - step 114 of 300 - 2 active elements (9998 deactivated)
15:35:54 INFO    opendrift:2237: 2026-10-06 08:00:00 - step 115 of 300 - 2 active elements (9998 deactivated)
15:35:54 INFO    opendrift:2237: 2026-10-06 08:10:00 - step 116 of 300 - 2 active elements (9998 deactivated)
15:35:55 WARNING opendrift.readers.interpolation.structured:63: Ensemble data currently not extrapolated towards seafloor
15:35:55 WARNING opendrift.readers.interpolation.structured:63: Ensemble data currently not extrapolated towards seafloor
15:35:55 INFO    opendrift:2237: 2026-10-06 08:20:00 - step 117 of 300 - 2 active elements (9998 deactivated)
15:35:55 INFO    opendrift:2237: 2026-10-06 08:30:00 - step 118 of 300 - 2 active elements (9998 deactivated)
15:35:55 INFO    opendrift:2237: 2026-10-06 08:40:00 - step 119 of 300 - 2 active elements (9998 deactivated)
15:35:55 INFO    opendrift:2237: 2026-10-06 08:50:00 - step 120 of 300 - 2 active elements (9998 deactivated)
15:35:55 INFO    opendrift:2237: 2026-10-06 09:00:00 - step 121 of 300 - 2 active elements (9998 deactivated)
15:35:55 INFO    opendrift:2237: 2026-10-06 09:10:00 - step 122 of 300 - 2 active elements (9998 deactivated)
15:35:55 WARNING opendrift.readers.interpolation.structured:63: Ensemble data currently not extrapolated towards seafloor
15:35:55 WARNING opendrift.readers.interpolation.structured:63: Ensemble data currently not extrapolated towards seafloor
15:35:55 INFO    opendrift:2237: 2026-10-06 09:20:00 - step 123 of 300 - 2 active elements (9998 deactivated)
15:35:55 INFO    opendrift:2237: 2026-10-06 09:30:00 - step 124 of 300 - 2 active elements (9998 deactivated)
15:35:55 INFO    opendrift:2237: 2026-10-06 09:40:00 - step 125 of 300 - 2 active elements (9998 deactivated)
15:35:55 INFO    opendrift:2237: 2026-10-06 09:50:00 - step 126 of 300 - 2 active elements (9998 deactivated)
15:35:55 INFO    opendrift:2237: 2026-10-06 10:00:00 - step 127 of 300 - 2 active elements (9998 deactivated)
15:35:55 INFO    opendrift:2237: 2026-10-06 10:10:00 - step 128 of 300 - 2 active elements (9998 deactivated)
15:35:55 WARNING opendrift.readers.interpolation.structured:63: Ensemble data currently not extrapolated towards seafloor
15:35:55 WARNING opendrift.readers.interpolation.structured:63: Ensemble data currently not extrapolated towards seafloor
15:35:55 INFO    opendrift:2237: 2026-10-06 10:20:00 - step 129 of 300 - 2 active elements (9998 deactivated)
15:35:55 INFO    opendrift:2237: 2026-10-06 10:30:00 - step 130 of 300 - 2 active elements (9998 deactivated)
15:35:55 INFO    opendrift:2237: 2026-10-06 10:40:00 - step 131 of 300 - 2 active elements (9998 deactivated)
15:35:55 INFO    opendrift:2237: 2026-10-06 10:50:00 - step 132 of 300 - 2 active elements (9998 deactivated)
15:35:55 INFO    opendrift:2237: 2026-10-06 11:00:00 - step 133 of 300 - 2 active elements (9998 deactivated)
15:35:55 INFO    opendrift:2237: 2026-10-06 11:10:00 - step 134 of 300 - 2 active elements (9998 deactivated)
15:35:56 WARNING opendrift.readers.interpolation.structured:63: Ensemble data currently not extrapolated towards seafloor
15:35:56 WARNING opendrift.readers.interpolation.structured:63: Ensemble data currently not extrapolated towards seafloor
15:35:56 INFO    opendrift:2237: 2026-10-06 11:20:00 - step 135 of 300 - 2 active elements (9998 deactivated)
15:35:56 INFO    opendrift:2237: 2026-10-06 11:30:00 - step 136 of 300 - 2 active elements (9998 deactivated)
15:35:56 INFO    opendrift:2237: 2026-10-06 11:40:00 - step 137 of 300 - 2 active elements (9998 deactivated)
15:35:56 INFO    opendrift:2237: 2026-10-06 11:50:00 - step 138 of 300 - 2 active elements (9998 deactivated)
15:35:56 INFO    opendrift:2237: 2026-10-06 12:00:00 - step 139 of 300 - 2 active elements (9998 deactivated)
15:35:56 INFO    opendrift:2237: 2026-10-06 12:10:00 - step 140 of 300 - 2 active elements (9998 deactivated)
15:35:56 WARNING opendrift.readers.interpolation.structured:63: Ensemble data currently not extrapolated towards seafloor
15:35:56 WARNING opendrift.readers.interpolation.structured:63: Ensemble data currently not extrapolated towards seafloor
15:35:56 INFO    opendrift:2237: 2026-10-06 12:20:00 - step 141 of 300 - 2 active elements (9998 deactivated)
15:35:56 INFO    opendrift:2237: 2026-10-06 12:30:00 - step 142 of 300 - 1 active elements (9999 deactivated)
15:35:56 INFO    opendrift:2237: 2026-10-06 12:40:00 - step 143 of 300 - 1 active elements (9999 deactivated)
15:35:56 INFO    opendrift:2237: 2026-10-06 12:50:00 - step 144 of 300 - 1 active elements (9999 deactivated)
15:35:56 INFO    opendrift:2237: 2026-10-06 13:00:00 - step 145 of 300 - 1 active elements (9999 deactivated)
15:35:56 INFO    opendrift:2237: 2026-10-06 13:10:00 - step 146 of 300 - 1 active elements (9999 deactivated)
15:35:57 WARNING opendrift.readers.interpolation.structured:63: Ensemble data currently not extrapolated towards seafloor
15:35:57 WARNING opendrift.readers.interpolation.structured:63: Ensemble data currently not extrapolated towards seafloor
15:35:57 INFO    opendrift:2237: 2026-10-06 13:20:00 - step 147 of 300 - 1 active elements (9999 deactivated)
15:35:57 INFO    opendrift:2237: 2026-10-06 13:30:00 - step 148 of 300 - 1 active elements (9999 deactivated)
15:35:57 INFO    opendrift:2237: 2026-10-06 13:40:00 - step 149 of 300 - 1 active elements (9999 deactivated)
15:35:57 INFO    opendrift:2237: 2026-10-06 13:50:00 - step 150 of 300 - 1 active elements (9999 deactivated)
15:35:57 INFO    opendrift:2237: 2026-10-06 14:00:00 - step 151 of 300 - 1 active elements (9999 deactivated)
15:35:57 INFO    opendrift:2237: 2026-10-06 14:10:00 - step 152 of 300 - 1 active elements (9999 deactivated)
15:35:57 WARNING opendrift.readers.interpolation.structured:63: Ensemble data currently not extrapolated towards seafloor
15:35:57 WARNING opendrift.readers.interpolation.structured:63: Ensemble data currently not extrapolated towards seafloor
15:35:57 INFO    opendrift:2237: 2026-10-06 14:20:00 - step 153 of 300 - 1 active elements (9999 deactivated)
15:35:57 INFO    opendrift:2237: 2026-10-06 14:30:00 - step 154 of 300 - 1 active elements (9999 deactivated)
15:35:57 WARNING opendrift:2313: The simulation stopped before requested end time was reached.
15:35:57 INFO    opendrift:2315: ========================
15:35:57 INFO    opendrift:2316: End of simulation:
15:35:57 INFO    opendrift:2317: No more active or scheduled elements, quitting.
15:35:57 INFO    opendrift:2318: Traceback (most recent call last):
  File "/root/project/opendrift/models/basemodel/__init__.py", line 2300, in run
    raise ValueError('No more active or scheduled elements, quitting.')
ValueError: No more active or scheduled elements, quitting.

15:35:57 INFO    opendrift:2319: 'The simulation stopped before requested end time was reached.'

15:35:57 INFO    opendrift:2322: ========================
<xarray.Dataset> Size: 23MB
Dimensions:                                   (trajectory: 10000, time: 26)
Coordinates:
  * trajectory                                (trajectory) int64 80kB 0 ... 9999
  * time                                      (time) datetime64[ns] 208B 2026...
Data variables: (12/22)
    status                                    (trajectory, time) float32 1MB ...
    moving                                    (trajectory, time) float32 1MB ...
    age_seconds                               (trajectory, time) float32 1MB ...
    origin_marker                             (trajectory, time) float32 1MB ...
    lon                                       (trajectory, time) float32 1MB ...
    lat                                       (trajectory, time) float32 1MB ...
    ...                                        ...
    horizontal_diffusivity                    (trajectory, time) float32 1MB ...
    sea_surface_wave_significant_height       (trajectory, time) float32 1MB ...
    sea_surface_wave_stokes_drift_x_velocity  (trajectory, time) float32 1MB ...
    sea_surface_wave_stokes_drift_y_velocity  (trajectory, time) float32 1MB ...
    sea_floor_depth_below_sea_level           (trajectory, time) float32 1MB ...
    land_binary_mask                          (trajectory, time) float32 1MB ...
Attributes: (12/121)
    Conventions:                                                           CF...
    standard_name_vocabulary:                                              CF...
    featureType:                                                           tr...
    title:                                                                 Op...
    summary:                                                               Ou...
    keywords:                                                              tr...
    ...                                                                    ...
    geospatial_lon_units:                                                  de...
    geospatial_lon_resolution:                                             point
    runtime:                                                               0:...
    geospatial_vertical_min:                                               0.0
    geospatial_vertical_max:                                               0.0
    geospatial_vertical_positive:                                          up


Ensemble members are recycled among the 10000 particles

ensemble_number = np.remainder(np.arange(o.num_elements_total()), len(r.realizations)) + 1
o.animation(fast=True, color=ensemble_number, legend=['Member ' + str(i) for i in r.realizations], colorbar=False)
15:35:57 WARNING opendrift:2613: Plotting fast. This will make your plots less accurate.
15:35:59 INFO    opendrift:4823: Saving animation to /root/project/docs/source/gallery/animations/example_ensemble_0.gif...
15:36:19 INFO    opendrift:3241: Time to make animation: 0:00:21.477158

We see that elements forced by different wind ensemble members move differently

../_images/example_ensemble_0.gif example ensemble

Total running time of the script: (0 minutes 56.705 seconds)

Gallery generated by Sphinx-Gallery