Lably
Skip to content

OceanParcels

Set of python packages for Langragian ocean analysis

  • 6 min read
  • 4 chapters

Related on Lably

Through Python (programming language), Temperature and Salinity

Concept

OceanParcels takes a flow field given through Eulerian methods or experimental data (e.g. provided through land-based measurements, satellite imagery or Doppler currents) as input. This data can be given on various grid structures. To obtain data at an arbitrary point, interpolation is used. Lagrangian modelling uses the data given by the flow field and interpolation to simulate the dynamics of an object.

Grid structure

In the horizontal plane, i.e. in the x-y-plane, OceanParcels allows for rectilinear and curvilinear data grids (see Fig. 1 a and b respectively). In the vertical plane, i.e. the x-z-plane, z-levels and s-levels are supported (see Fig. 1 c and d respectively). All four combinations of these grids are supported in three-dimensional space.

OceanParcels also supports so-called staggered A, B and C grids, which are common in ocean modelling. These take into account that the different variables can be measured at different grid points. The relevant variables in Ocean analysis are the meriodial velocity (v), the zonal velocity (u) and the Tracers (q). In an A grid all of these are evaluated at the same grid points. In a B grid, u and v are evaluated at the grid point in the center between the grid point where T is being evaluated, that is there are two overlying grids. In a C grid all variables are evaluated on their own grid, that is there are three overlying grids. See Figure 2 for a visualization.

Interpolation methods

To obtain field data at a point that is not on a grid node, interpolation methods are used. OceanParcels supports several different such methods:

Lagrangian modelling

The Lagrangian trajectory of a particle can be calculated by numerically integrating over its position X as a function of time, given by X(t2)=X(t1)+∫t1t2v(x,τ)dτ+ΔXb(t1). Here t1 is the starting time and t2 is the time at which the position of the particle is evaluated. v(x,τ) is the velocity of the particle at time τ. ΔXb(t) captures the movement of the particle caused by its specific characteristics (e.g. an ice-berg moves differently in the ocean than a non-frozen water mass). Unless otherwise specified, OceanParcels uses a fourth-order Runge-Kutta scheme for the integration of this function. As alternatives, OceanParcels supports Euler-forward integration or adaptive Runge-Kutta-Fehlberg integration.

OceanParcels provides the option to model individual behavior of a particle. Individual behavior is behavior that is defined by characteristics of a particle, for example icebergs melt and fish swims, leading to different dynamics. OceanParcels implements this using short pieces of code that are executed whenever a ParticleSet (class defining the particles used) is executed. Those pieces of code are called kernels. Some commonly used kernels are predefined in OceanParcels, such as kernels modeling Brownian motion. However, the user may also define problem specific kernels. This allows for modeling various objects, examples of which are given in the section "Applications". For implementing these customized kernels the user can choose between using Python with a possibility to automatically translate to C or using a C-library.

Sign in to keep reading

3 more chapters are free with a Lably account.

More in Computing and communication