opendrift.models.oceandrift
Attributes
Classes
Extending LagrangianArray for elements moving in 3 dimensions |
|
Open source buoyant particle trajectory model based on OpenDrift. |
Module Contents
- opendrift.models.oceandrift.logger
- class opendrift.models.oceandrift.Lagrangian3DArray(**kwargs)[source]
Bases:
opendrift.elements.LagrangianArray
Extending LagrangianArray for elements moving in 3 dimensions The Particle may be buoyant and/or subject to vertical mixing buoyant bahaviour is described by terminal velocity
Initialises a LagrangianArray with given properties.
- Args:
Keyword arguments (kwargs) with names corresponding to the OrderedDict ‘variables’ of the class, and corresponding values. The values must be ndarrays of equal length, or scalars. All (or none) variables must be given, unless a default value is specified in the OrderedDict ‘variables’ An empty object may be created by giving no input.
- variables
- class opendrift.models.oceandrift.OceanDrift(*args, **kwargs)[source]
Bases:
opendrift.models.basemodel.OpenDriftSimulation
Open source buoyant particle trajectory model based on OpenDrift.
Developed at MET Norway
Generic module for particles that move in 3 dimensions and may be to vertical turbulent mixing with the possibility for positive or negative buoyancy
Particles could be e.g. oil droplets, plankton, nutrients or sediments, Model may be subclassed for more specific behaviour.
Initialise OpenDriftSimulation
- Args:
- seed: integer or None. A given integer will yield identical
random numbers drawn each simulation. Random numbers are e.g. used to distribute particles spatially when seeding, and may be used by modules (subclasses) for e.g. diffusion. Specifying a fixed value (default: 0) is useful for sensitivity tests. With seed = None, different random numbers will be drawn for subsequent runs, even with identical configuration/input.
- iomodule: name of module used to export data
default: netcdf, see
opendrift.io
for more alternatives. iomodule is module/filename without preceeding io_- loglevel: set to 0 (default) to retrieve all debug information.
Provide a higher value (e.g. 20) to receive less output. Use the string ‘custom’ to configure logging from outside.
- logtime: if True, a time stamp is given for each logging line.
logtime can also be given as a python time specifier (e.g. ‘%H:%M:%S’)
- ElementType
Any trajectory model implementation must define an ElementType.
- required_variables
Any trajectory model implementation must list needed variables.
- simulate_trajectories(outfile, trajectories, number=1, wind_drift_factors=None, current_drift_factors=None, time_step=None, time_step_output=None, simulation_duration=None, simulation_interval=None)[source]
- wind_drift_factor_from_trajectory_lw(drifters, wind_drift_factors, simulation_length, simulation_interval)[source]
Perform simulations and use skillscore to optimize wind_drift_factor
- drifters: list of dictionaries with numpy arrays of ‘lon’ and ‘lat’
and list of datetimes
wind_drift_factors: the wind_drift_factors to use for simulations/optimalizations
- update_terminal_velocity(Tprofiles=None, Sprofiles=None, z_index=None)[source]
Calculate terminal velocity due to bouyancy from own properties and environmental variables. Sub-modules should overload this method for particle-specific behaviour
- vertical_advection()[source]
Move particles vertically according to vertical ocean current
Vertical advection by ocean currents is normally small compared to termical velocity
- bottom_interaction(Zmin=None)[source]
To be overloaded by subclasses, e.g. radionuclides in sediments
- surface_wave_mixing(time_step_seconds)[source]
To be overloaded by subclasses, e.g. downward mixing of oil
- vertical_mixing(store_depths=False)[source]
Mix particles vertically according to eddy diffusivity and buoyancy
Buoyancy is expressed as terminal velocity, which is the steady-state vertical velocity due to positive or negative buoyant behaviour. It is usually a function of particle density, diameter, and shape.
Vertical particle displacemend du to turbulent mixing is calculated using a random walk scheme” (Visser et al. 1996)
- animate_vertical_distribution(depths=None, maxdepth=None, bins=50, filename=None, subsamplingstep=1)[source]
Function to animate vertical distribution of particles bins: number of bins in the histogram maxdepth: maximum depth subsamplingstep: speed-up the generation of the animation reducing the number of output frames fasterwriter: speed-up the writing to outpute file