opendrift.models.openberg ========================= .. py:module:: opendrift.models.openberg .. autoapi-nested-parse:: This code is initiated from the following reference with posterior modifications. Reference: Keghouche, I., F. Counillon, and L. Bertino (2010), Modeling dynamics and thermodynamics of icebergs in the Barents Sea from 1987 to 2005, J. Geophys. Res., 115, C12062, doi:10.1029/2010JC006165. Attributes ---------- .. autoapisummary:: opendrift.models.openberg.logger opendrift.models.openberg.rho_water opendrift.models.openberg.rho_air opendrift.models.openberg.rho_ice opendrift.models.openberg.rho_iceb opendrift.models.openberg.g opendrift.models.openberg.omega opendrift.models.openberg.csi opendrift.models.openberg.wave_drag_coef Classes ------- .. autoapisummary:: opendrift.models.openberg.IcebergObj opendrift.models.openberg.OpenBerg Functions --------- .. autoapisummary:: opendrift.models.openberg.ocean_force opendrift.models.openberg.wind_force opendrift.models.openberg.wave_radiation_force opendrift.models.openberg.advect_iceberg_no_acc opendrift.models.openberg.sea_ice_force opendrift.models.openberg.coriolis_force opendrift.models.openberg.sea_surface_slope_force opendrift.models.openberg.melwav opendrift.models.openberg.mellat opendrift.models.openberg.melbas Module Contents --------------- .. py:data:: logger .. py:data:: rho_water :value: 1027 .. py:data:: rho_air :value: 1.293 .. py:data:: rho_ice :value: 917 .. py:data:: rho_iceb :value: 900 .. py:data:: g :value: 9.81 .. py:data:: omega :value: 7.2921e-05 .. py:data:: csi :value: 1 .. py:data:: wave_drag_coef :value: 0.3 .. py:class:: IcebergObj(**kwargs) Bases: :py:obj:`opendrift.elements.LagrangianArray` Extending LagrangianArray with relevant properties for an Iceberg 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. .. py:attribute:: variables .. py:function:: ocean_force(iceb_vel, water_vel, Ao, rho_water, water_drag_coef) Ocean force Args: iceb_vel : Iceberg's velocity at time t water_vel : Ocean current velocity Ao : Iceberg's area in contact with ocean (length x draft) rho_water : Water density water_drag_coef : Co is the drag coefficient applied on the iceberg's draft .. py:function:: wind_force(iceb_vel, wind_vel, Aa, wind_drag_coef) Wind force Args: iceb_vel : Iceberg's velocity at time t wind_vel : Wind velocity Aa : Iceberg's area in contact with wind (length x sail) wind_drag_coef : Ca is the drag coefficient applied on the iceberg's sail .. py:function:: wave_radiation_force(rho_water, wave_height, wave_direction, iceb_length) Wave radiation force Args: rho_water : Water density wave_height : Wave significant height wave_direction : Wave direction iceb_length : Iceberg's length .. py:function:: advect_iceberg_no_acc(f, water_vel, wind_vel) Advect iceberg without acceleration Args: f : Wind drift factor water_vel : Ocean current velocity wind_vel : Wind velocity Returns: Iceberg's velocity without acceleration .. py:function:: sea_ice_force(iceb_vel, sea_ice_conc, Ai, sea_ice_vel, sum_force) Sea ice force Args: iceb_vel : Iceberg velocity at time t sea_ice_conc : Sea ice concentration Ai : Iceberg's area in contact with ice (sea_ice_thickness x length) # (Alternatively: Test half length and half width) sea_ice_vel : Sea ice velocity sum_force : Effect of all other forces exerted on the iceberg (apart from the sea ice force) .. py:function:: coriolis_force(iceb_vel, mass, lat) Coriolis force Args: iceb_vel : Iceberg velocity at time t mass: Mass of the iceberg lat : Latitude of the iceberg's location in degrees .. py:function:: sea_surface_slope_force(sea_slope_x, sea_slope_y, mass) This functions assumes you provide the sea surface slope from an external file .. py:function:: melwav(iceb_length, iceb_width, x_wind, y_wind, sst, sea_ice_conc, dt) Update the iceberg's dimensions (length and width) due to wave erosion Args: iceb_length : Iceberg's length iceb_width : Iceberg's width x_wind : Wind speed in the x-direction y_wind : Wind speed in the y-direction sst : Sea surface temperature sea_ice_conc : Sea ice concentration dt : Timestep of the simulation .. py:function:: mellat(iceb_length, iceb_width, tempib, salnib, dt) Update the iceberg's dimensions (length and width) due to lateral melting Args: iceb_length : Iceberg's length iceb_width : Iceberg's width tempib : Water temperature salnib : Water salinity dt : Timestep of the simulation .. py:function:: melbas(iceb_draft, iceb_sail, iceb_length, salnib, tempib, x_water_vel, y_water_vel, x_iceb_vel, y_iceb_vel, dt) Update the iceberg's dimensions (draft and sail) due to forced convection .. py:class:: OpenBerg(*args, **kwargs) Bases: :py:obj:`opendrift.models.basemodel.OpenDriftSimulation` Generic trajectory model class, to be extended (subclassed). This as an Abstract Base Class, meaning that only subclasses can be initiated and used. Any specific subclass ('model') must contain its own (or shared) specific type of particles (ElementType), whose properties are updated at each time_step using method update() on basis of model physics/chemistry/biology and 'required_variables' (environment) which are provided by one or more Reader objects. Attributes: ElementType: the type (class) of particles to be used by this model elements: object of the class ElementType, storing the specific particle properties (ndarrays and scalars) of all active particles as named attributes. Elements are added by seeding-functions (presently only one implemented: seed_elements). elements_deactivated: ElementType object containing particles which have been deactivated (and removed from 'elements') elements_scheduled: ElementType object containing particles which have been scheduled, but not yet activated required_variables: list of strings of CF standard_names which is needed by this model (update function) to update properties of particles ('elements') at each time_step. This core class has no required_elements, this is implemented by subclasses/modules. environment: recarray storing environment variables (wind, waves, current etc) as named attributes. Attribute names follow standard_name from CF-convention, allowing any OpenDriftSimulation module/subclass using environment data from any readers which can provide the requested variables. Used in method 'update' to update properties of elements every time_step. time_step: timedelta object, time interval at which element properties are updated (including advection). time_step_output: timedelta object, time interval at which element properties are stored in memory and eventually written to file readers: Dictionary where values are Reader objects, and names are unique reference keywords used to access a given reader (typically filename or URL) priority_list: OrderedDict where names are variable names, and values are lists of names (kewywords) of the reader, in the order of priority (user defined) of which the readers shall be called to retrieve environmental data. 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 :py:mod:`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. 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') logfile: None (default) to send output to console. A string to send output to logfile. Or to get output to both terminal and file: [, logging.StreamHandler(sys.stdout)] .. py:attribute:: ElementType Any trajectory model implementation must define an ElementType. .. py:attribute:: required_variables Any trajectory model implementation must list needed variables. .. py:method:: get_profile_masked(variable) Apply a mask to extract data from the surface down to the iceberg's draft. .. py:method:: get_basal_env(variable) Get the basal layer of the variable for the icebergs .. py:method:: advect_iceberg() .. py:method:: melt() Enable melting .. py:method:: roll_over() Iceberg's stability criterium .. py:method:: update() Update positions and properties of particles