gridforce — Ladim Module for Grid and Forcing

This module describes the grid used for particle tracking and interfaces the forcing from the ocean model. This is the only module in LADiM that depends on the model. Interfacing other models is done by adding an alternative gridforce module. The module gridforce_ROMS implements a ROMS interface. The obstacle example shows how to make a simple gridforce module in idealized cases.

Coordinate system in LADiM

The coordinate system should be orthogonal, and may be curvilinear. Grids as used by ROMS for instance are suitable.

The grid spacing is given by horizontal arrays of metric coefficients \(\Delta x\) and \(\Delta y\).

The vertical coordinate system is simply the depth in meters, with positive values downwards.

Grid

class gridforce.Grid(config)

The argument config is a Configuration object

The grid is defined by the Grid class having the following public attributes:

imax

The number of grid cells in X-direction.

jmax

The number of grid cells in Y direction.

And a set of methods, taking the particle positions as input:

metric(X, Y)

Returns \(\Delta x\) and \(\Delta y\) at the positions.

sample_depth(X, Y)

Returns the bottom depth at the positions.

lonlat(X, Y)

Returns longitude and latitude at the positions [degrees].

ingrid(X, Y)

Check if the particles are inside the grid.

atsea(X, Y)

Check if the particles are at sea (not on land).

Forcing

The Forcing class provides the current from the ocean model simulation that drives the particle tracking. It also includes extra fields necessary for the (biological) behaviour (the IBMs).

class gridforce.Forcing(config, grid)

The arguments config and grid are Configuration and Grid objects.

A forcing object should have the following public attributes and methods:

step

List of timesteps where forcing is available

velocity(X, Y, Z, tstep=0)

Returns velocity (U, V) in the particle positions. tstep is a fraction of the time step ahead, 0 for present, 1 for next timestep, 0.5 for half way between.

field(X, Y, Z, name)

Sample a field, name is the name of the field in the state and ibm modules Examples: ‘temp’, ‘salt’, …

W(X, Y, Z)

Vertical velocity at particle positions [Not implemented yet]