Introduction to OpenDrift

OpenDrift is a software package for modeling the trajectories and fate of objects or substances drifting in the ocean, or even in the atmosphere.

OpenDrift is open source (available on GitHub), and is programmed in Python. As the software is very generic, it is rather a “framework” than a “trajectory model” in the traditional sense. Trajectory models for specific purposes (e.g. oil drift, search and rescue, larvae drift etc) may reuse all common functionality from the core model, and need only implement a Python Class describing the purpose-specific processes (physics/biology etc). See Specifications and background requirements and Data model for more detailed information.

ex1

Drift at different depths

ex2

Buoyancy and turbulence

ex3

Oil budget

ex4

Search and Rescue

Some key features of OpenDrift are:

  • Open source (GPLv2): providing full transparency.

  • Fast: optimised and vectorised Python code. Reading forcing data from disk/internet is normally the bottleneck.

  • Modular: may simulate transport and fate of any kind of particles (oil, ships, persons, icebergs, micro plastics…)

  • May use input forcing data (current, wind and waves) from any model, in many file formats and any map projection.

  • May use backup data sources if first choice is temporarily unavailable.

  • Can simulate backwards in time (specify a negative time step).

  • Output is saved to CF-compliant netCDF files.

  • Basic graphical user interface.

  • Can use input from ensemble models.

Running a simulation can be as simple as:

>>> from datetime import datetime, timedelta
>>> from opendrift.models.oceandrift import OceanDrift
>>>
>>> o = OceanDrift()
>>> o.add_readers_from_list(
>>>     ['https://thredds.met.no/thredds/dodsC/sea/norkyst800m/1h/aggregate_be'])
>>> o.disable_vertical_motion()
>>> o.seed_elements(lon=4.85, lat=60, time=datetime.now(), number=10000, radius=1000)
>>>
>>> o.run(duration=timedelta(hours=24))
>>> o.animation(filename='animation.mp4')
_images/example_plot_0.gif

Once you have OpenDrift installed, take a look at the Tutorial on how to get started, or check out the gallery for some examples. The details and physics of each model is documented in the reference, along with specific examples for that model. Models can be configured in nuanced ways which are important for more realistic simulation (e.g. diffusion for oil drift simulations). These should also be documented under the reference for the particular model. See opendrift.models for an overview.

Note

If you found OpenDrift useful for your study, please cite it as:

For the oil spill module, please cite in addition to the above:

Contents

Indices and tables