opendrift.models.openhns

OpenHNS is a 3D HNS drift module bundled within the OpenDrift framework.

Module Contents

Classes

HNS

Extending LagrangianArray with variables relevant for HNS particles.

OpenHNS

Open source HNS drift model based on the OpenDrift framework.

Attributes

logger

opendrift.models.openhns.logger
class opendrift.models.openhns.HNS(**kwargs)[source]

Bases: opendrift.models.oceandrift.Lagrangian3DArray

Extending LagrangianArray with variables relevant for HNS particles.

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.openhns.OpenHNS(*args, **kwargs)[source]

Bases: opendrift.models.oceandrift.OceanDrift

Open source HNS drift model based on the OpenDrift framework.

Developed at MET Norway based on parameterisations found in open/published litterature.

Under construction.

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
required_variables
hns_types
status_colors
seed_elements(hns_type=None, *args, **kwargs)[source]

Seed elements with given position(s), time and properties.

Arguments:
lon: scalar or array

central longitude(s).

lat: scalar or array

central latitude(s).

radius: scalar or array

radius in meters around each lon-lat pair, within which particles will be randomly seeded.

number: integer, total number of particles to be seeded

If number is None, the number of elements is the length of lon/lat or time if these are arrays. Otherwise the number of elements are obtained from the config-default.

time: datenum or list

The time at which particles are seeded/released. If time is a list with two elements, elements are seeded continously from start/first to end/last time. If time is a list with more than two elements, the number of elements is equal to len(time) and are seeded as a time series.

radius_type: string

If ‘gaussian’ (default), the radius is the standard deviation in x-y-directions. If ‘uniform’, elements are spread evenly and always inside a circle with the given radius.

kwargs:

keyword arguments containing properties/attributes and values corresponding to the actual particle type (ElementType). These are forwarded to the ElementType class. All properties for which there are no default value must be specified.

evaporation()[source]
dissolution()[source]
update()[source]

Update positions and properties of elements.