Basic Model Interface#

landlab.bmi.bmi_bridge module#

Wrap landlab component with the Basic Modeling Interface (landlab.bmi.bmi_bridge)#

Section author: Eric Hutton

Function reference#

The wrap_as_bmi function wraps a landlab component class so that it exposes a Basic Modelling Interface.

class TimeStepper(start=0.0, stop=None, step=1.0, units='s')[source]#

Bases: object

Step through time.

Parameters:
  • start (float, optional) – Clock start time.

  • stop (float, optional) – Stop time.

  • step (float, optional) – Time step.

Examples

>>> from landlab.bmi import TimeStepper
>>> time_stepper = TimeStepper()
>>> time_stepper.start
0.0
>>> time_stepper.stop is None
True
>>> time_stepper.step
1.0
>>> time_stepper.time
0.0
>>> for _ in range(10):
...     time_stepper.advance()
...
>>> time_stepper.time
10.0
>>> time_stepper = TimeStepper(1.0, 13.0, 2.0)
>>> [time for time in time_stepper]
[1.0, 3.0, 5.0, 7.0, 9.0, 11.0]
advance()[source]#

Advance the time stepper by one time step.

property start#

Start time.

property step#

Time Step.

property stop#

Stop time.

property time#

Current time.

property units#

Time units.

wrap_as_bmi(cls)[source]#

Wrap a landlab class so it exposes a BMI.

Give a landlab component a Basic Model Interface (BMI). Since landlab components have an interface that is already in the style of BMI, this function adds just a light wrapping to landlab components. There are a number of differences that may cause some confusion to landlab users.

  1. Because BMI doesn’t have a concept of a dual grid, it only defines nodes (points), edges (vectors), and faces (areas). The dual-graph of landlab is considered as two separate grids by BMI.

  2. It is important to note that BMI has only three grid elements (node, edge, and face) while landlab has 6. The names used by landlab and BMI are also different.

    Thus, a BMI-wrapped landlab component will always have two grids with grid identifiers 0, and 1. Grid 0 will contain the landlab nodes, links, and patches while grid 1 will contain corners, faces, and cells.landlab and BMI refer to grid elements by different names. The mapping from landlab to BMI nomenclature is the following:

    Grid 0: * node: node * link: edge * patch: face

    Grid 1: * corner: node * face: edge * cell: face

  3. In BMI, the initialize method requires an input file that is used to create and setup the model for time-stepping. landlab components generally do not have anything like this; instead this task is usually done programmatically. Thus, the input file that is used by the BMI initialize method is a standard landlab input file as used by the landlab create_grid function.

Parameters:

cls (class) – A landlab class that inherits from Component.

Returns:

A wrapped class that exposes a BMI.

Return type:

class

Examples

>>> from landlab.bmi import wrap_as_bmi
>>> from landlab.components.flexure import Flexure
>>> BmiFlexure = wrap_as_bmi(Flexure)
>>> flexure = BmiFlexure()
>>> sorted(flexure.get_input_var_names())
['boundary_condition_flag', 'lithosphere__overlying_pressure_increment']
>>> flexure.get_var_units("lithosphere__overlying_pressure_increment")
'Pa'
>>> config = '''
... flexure:
...     eet: 10.e+3
...     method: flexure
... clock:
...     start: 0.
...     stop: 10.
...     step: 2.
... grid:
...     RasterModelGrid:
...     - [20, 40]
...     - xy_spacing: [2000., 1000.]
...     - fields:
...        node:
...          lithosphere__overlying_pressure_increment:
...            constant:
...              - value: 0.0
... '''
>>> flexure.initialize(config)
>>> sorted(flexure.get_output_var_names())
['boundary_condition_flag', 'lithosphere_surface__elevation_increment']
>>> flexure.get_var_grid("lithosphere_surface__elevation_increment")
0
>>> flexure.get_grid_shape(0, np.empty(flexure.get_grid_rank(0), dtype=int))
array([20, 40])
>>> dz = np.empty(flexure.get_grid_size(0))
>>> _ = flexure.get_value("lithosphere_surface__elevation_increment", dz)
>>> np.all(dz == 0.0)
True
>>> flexure.get_current_time()
0.0
>>> sorted(flexure.get_input_var_names())
['boundary_condition_flag', 'lithosphere__overlying_pressure_increment']
>>> load = np.zeros((20, 40), dtype=float)
>>> load[0, 0] = 1.0
>>> flexure.set_value("lithosphere__overlying_pressure_increment", load)
>>> flexure.update()
>>> flexure.get_current_time()
2.0
>>> _ = flexure.get_value("lithosphere_surface__elevation_increment", dz)
>>> np.all(dz == 0.0)
False

landlab.bmi.components module#

class AdvectionSolverTVDBMI#

Bases: Bmi

Basic Modeling Interface for the AdvectionSolverTVD component.

finalize()#

Clean-up the component.

get_component_name()#

Name of the component.

get_current_time()#

Current component time.

get_end_time()#

Stop time for the component.

get_grid_edge_count(grid)#

Get the number of edges in the grid.

Parameters:

grid (int) – A grid identifier.

Returns:

The total number of grid edges.

Return type:

int

get_grid_edge_nodes(grid, edge_nodes)#

Get the edge-node connectivity.

Parameters:
  • grid (int) – A grid identifier.

  • edge_nodes (ndarray of int, shape (2 x nnodes,)) – A numpy array to place the edge-node connectivity. For each edge, connectivity is given as node at edge tail, followed by node at edge head.

Returns:

The input numpy array that holds the edge-node connectivity.

Return type:

ndarray of int

get_grid_face_count(grid)#

Get the number of faces in the grid.

Parameters:

grid (int) – A grid identifier.

Returns:

The total number of grid faces.

Return type:

int

get_grid_face_edges(grid)#

Get the face-edge connectivity.

Parameters:
  • grid (int) – A grid identifier.

  • face_edges (ndarray of int) – A numpy array to place the face-edge connectivity.

Returns:

The input numpy array that holds the face-edge connectivity.

Return type:

ndarray of int

get_grid_face_nodes(grid, face_nodes)#

Get the face-node connectivity.

Parameters:
  • grid (int) – A grid identifier.

  • face_nodes (ndarray of int) – A numpy array to place the face-node connectivity. For each face, the nodes (listed in a counter-clockwise direction) that form the boundary of the face.

Returns:

The input numpy array that holds the face-node connectivity.

Return type:

ndarray of int

get_grid_node_count(grid)#

Get the number of nodes in the grid.

Parameters:

grid (int) – A grid identifier.

Returns:

The total number of grid nodes.

Return type:

int

get_grid_nodes_per_face(grid, nodes_per_face)#

Get the number of nodes for each face.

Parameters:
  • grid (int) – A grid identifier.

  • nodes_per_face (ndarray of int, shape (nfaces,)) – A numpy array to place the number of nodes per face.

Returns:

The input numpy array that holds the number of nodes per face.

Return type:

ndarray of int

get_grid_origin(grid, origin)#

Get the origin for a structured grid.

get_grid_rank(grid)#

Get the number of dimensions of a grid.

get_grid_shape(grid, shape)#

Get the shape of a structured grid.

get_grid_size(grid)#

Get the total number of elements in the computational grid.

Parameters:

grid (int) – A grid identifier.

Returns:

Size of the grid.

Return type:

int

get_grid_spacing(grid, spacing)#

Get the row and column spacing of a structured grid.

get_grid_type(grid)#

Get the type of grid.

get_grid_x(grid, x)#

Get coordinates of grid nodes in the x direction.

Parameters:
  • grid (int) – A grid identifier.

  • x (ndarray of float, shape (nrows,)) – A numpy array to hold the x-coordinates of the grid node columns.

Returns:

The input numpy array that holds the grid’s column x-coordinates.

Return type:

ndarray of float

get_grid_y(grid, y)#

Get coordinates of grid nodes in the y direction.

Parameters:
  • grid (int) – A grid identifier.

  • y (ndarray of float, shape (ncols,)) – A numpy array to hold the y-coordinates of the grid node rows.

Returns:

The input numpy array that holds the grid’s row y-coordinates.

Return type:

ndarray of float

get_grid_z(grid, z)#

Get coordinates of grid nodes in the z direction.

Parameters:
  • grid (int) – A grid identifier.

  • z (ndarray of float, shape (nlayers,)) – A numpy array to hold the z-coordinates of the grid nodes layers.

Returns:

The input numpy array that holds the grid’s layer z-coordinates.

Return type:

ndarray of float

get_input_item_count()#

Count of a model’s input variables.

Returns:

The number of input variables.

Return type:

int

get_input_var_names()#

Names of the input exchange items.

get_output_item_count()#

Count of a model’s output variables.

Returns:

The number of output variables.

Return type:

int

get_output_var_names()#

Names of the output exchange items.

get_start_time()#

Start time of the component.

get_time_step()#

Component time step.

get_time_units()#

Time units used by the component.

get_value(name, dest)#

Get a copy of a variable’s data.

get_value_at_indices(name, dest, inds)#

Get values at particular indices.

Parameters:
  • name (str) – An input or output variable name, a CSDMS Standard Name.

  • dest (ndarray) – A numpy array into which to place the values.

  • inds (array_like) – The indices into the variable array.

Returns:

Value of the model variable at the given location.

Return type:

array_like

get_value_ptr(name)#

Get a reference to values of the given variable.

This is a getter for the model, used to access the model’s current state. It returns a reference to a model variable, with the return type, size and rank dependent on the variable.

Parameters:

name (str) – An input or output variable name, a CSDMS Standard Name.

Returns:

A reference to a model variable.

Return type:

array_like

get_value_ref(name)#

Get a reference to a variable’s data.

get_var_grid(name)#

Get the grid id for a variable.

get_var_itemsize(name)#

Get the size of elements of a variable.

get_var_location(name)#

Get the grid element type that the a given variable is defined on.

The grid topology can be composed of nodes, edges, and faces.

node

A point that has a coordinate pair or triplet: the most basic element of the topology.

edge

A line or curve bounded by two nodes.

face

A plane or surface enclosed by a set of edges. In a 2D horizontal application one may consider the word “polygon”, but in the hierarchy of elements the word “face” is most common.

Parameters:

name (str) – An input or output variable name, a CSDMS Standard Name.

Returns:

The grid location on which the variable is defined. Must be one of “node”, “edge”, or “face”.

Return type:

str

Notes

CSDMS uses the ugrid conventions to define unstructured grids.

get_var_nbytes(name)#

Get the total number of bytes used by a variable.

get_var_type(name)#

Get the data type for a variable.

get_var_units(name)#

Get the unit used by a variable.

initialize(config_file)#

Initialize the component from a file.

BMI-wrapped Landlab components use input files in YAML format. Component-specific parameters are listed at the top level, followed by grid and then time information. An example input file looks like:

flexure:
    eet: 15.e+3
clock:
    start: 0
    stop: 100.
    step: 2.
grid:
    type: raster
    shape: [20, 40]
    spacing: [1000., 2000.]

In this case, a RasterModelGrid is created (with the given shape and spacing) and passed to the underlying landlab component. The eet=15000. is also given to the component but as a keyword parameter. The BMI clock is initialized with the given parameters.

Parameters:

config_file (str or file_like) – YAML-formatted input file for the component.

set_value(name, values)#

Set the values of a variable.

set_value_at_indices(name, inds, src)#

Specify a new value for a model variable at particular indices.

Parameters:
  • name (str) – An input or output variable name, a CSDMS Standard Name.

  • inds (array_like) – The indices into the variable array.

  • src (array_like) – The new value for the specified variable.

update()#

Update the component one time step.

update_frac(frac)#

Update the component a fraction of a time step.

update_until(then)#

Update the component until a given time.

class AreaSlopeTransporterBMI#

Bases: Bmi

Basic Modeling Interface for the AreaSlopeTransporter component.

finalize()#

Clean-up the component.

get_component_name()#

Name of the component.

get_current_time()#

Current component time.

get_end_time()#

Stop time for the component.

get_grid_edge_count(grid)#

Get the number of edges in the grid.

Parameters:

grid (int) – A grid identifier.

Returns:

The total number of grid edges.

Return type:

int

get_grid_edge_nodes(grid, edge_nodes)#

Get the edge-node connectivity.

Parameters:
  • grid (int) – A grid identifier.

  • edge_nodes (ndarray of int, shape (2 x nnodes,)) – A numpy array to place the edge-node connectivity. For each edge, connectivity is given as node at edge tail, followed by node at edge head.

Returns:

The input numpy array that holds the edge-node connectivity.

Return type:

ndarray of int

get_grid_face_count(grid)#

Get the number of faces in the grid.

Parameters:

grid (int) – A grid identifier.

Returns:

The total number of grid faces.

Return type:

int

get_grid_face_edges(grid)#

Get the face-edge connectivity.

Parameters:
  • grid (int) – A grid identifier.

  • face_edges (ndarray of int) – A numpy array to place the face-edge connectivity.

Returns:

The input numpy array that holds the face-edge connectivity.

Return type:

ndarray of int

get_grid_face_nodes(grid, face_nodes)#

Get the face-node connectivity.

Parameters:
  • grid (int) – A grid identifier.

  • face_nodes (ndarray of int) – A numpy array to place the face-node connectivity. For each face, the nodes (listed in a counter-clockwise direction) that form the boundary of the face.

Returns:

The input numpy array that holds the face-node connectivity.

Return type:

ndarray of int

get_grid_node_count(grid)#

Get the number of nodes in the grid.

Parameters:

grid (int) – A grid identifier.

Returns:

The total number of grid nodes.

Return type:

int

get_grid_nodes_per_face(grid, nodes_per_face)#

Get the number of nodes for each face.

Parameters:
  • grid (int) – A grid identifier.

  • nodes_per_face (ndarray of int, shape (nfaces,)) – A numpy array to place the number of nodes per face.

Returns:

The input numpy array that holds the number of nodes per face.

Return type:

ndarray of int

get_grid_origin(grid, origin)#

Get the origin for a structured grid.

get_grid_rank(grid)#

Get the number of dimensions of a grid.

get_grid_shape(grid, shape)#

Get the shape of a structured grid.

get_grid_size(grid)#

Get the total number of elements in the computational grid.

Parameters:

grid (int) – A grid identifier.

Returns:

Size of the grid.

Return type:

int

get_grid_spacing(grid, spacing)#

Get the row and column spacing of a structured grid.

get_grid_type(grid)#

Get the type of grid.

get_grid_x(grid, x)#

Get coordinates of grid nodes in the x direction.

Parameters:
  • grid (int) – A grid identifier.

  • x (ndarray of float, shape (nrows,)) – A numpy array to hold the x-coordinates of the grid node columns.

Returns:

The input numpy array that holds the grid’s column x-coordinates.

Return type:

ndarray of float

get_grid_y(grid, y)#

Get coordinates of grid nodes in the y direction.

Parameters:
  • grid (int) – A grid identifier.

  • y (ndarray of float, shape (ncols,)) – A numpy array to hold the y-coordinates of the grid node rows.

Returns:

The input numpy array that holds the grid’s row y-coordinates.

Return type:

ndarray of float

get_grid_z(grid, z)#

Get coordinates of grid nodes in the z direction.

Parameters:
  • grid (int) – A grid identifier.

  • z (ndarray of float, shape (nlayers,)) – A numpy array to hold the z-coordinates of the grid nodes layers.

Returns:

The input numpy array that holds the grid’s layer z-coordinates.

Return type:

ndarray of float

get_input_item_count()#

Count of a model’s input variables.

Returns:

The number of input variables.

Return type:

int

get_input_var_names()#

Names of the input exchange items.

get_output_item_count()#

Count of a model’s output variables.

Returns:

The number of output variables.

Return type:

int

get_output_var_names()#

Names of the output exchange items.

get_start_time()#

Start time of the component.

get_time_step()#

Component time step.

get_time_units()#

Time units used by the component.

get_value(name, dest)#

Get a copy of a variable’s data.

get_value_at_indices(name, dest, inds)#

Get values at particular indices.

Parameters:
  • name (str) – An input or output variable name, a CSDMS Standard Name.

  • dest (ndarray) – A numpy array into which to place the values.

  • inds (array_like) – The indices into the variable array.

Returns:

Value of the model variable at the given location.

Return type:

array_like

get_value_ptr(name)#

Get a reference to values of the given variable.

This is a getter for the model, used to access the model’s current state. It returns a reference to a model variable, with the return type, size and rank dependent on the variable.

Parameters:

name (str) – An input or output variable name, a CSDMS Standard Name.

Returns:

A reference to a model variable.

Return type:

array_like

get_value_ref(name)#

Get a reference to a variable’s data.

get_var_grid(name)#

Get the grid id for a variable.

get_var_itemsize(name)#

Get the size of elements of a variable.

get_var_location(name)#

Get the grid element type that the a given variable is defined on.

The grid topology can be composed of nodes, edges, and faces.

node

A point that has a coordinate pair or triplet: the most basic element of the topology.

edge

A line or curve bounded by two nodes.

face

A plane or surface enclosed by a set of edges. In a 2D horizontal application one may consider the word “polygon”, but in the hierarchy of elements the word “face” is most common.

Parameters:

name (str) – An input or output variable name, a CSDMS Standard Name.

Returns:

The grid location on which the variable is defined. Must be one of “node”, “edge”, or “face”.

Return type:

str

Notes

CSDMS uses the ugrid conventions to define unstructured grids.

get_var_nbytes(name)#

Get the total number of bytes used by a variable.

get_var_type(name)#

Get the data type for a variable.

get_var_units(name)#

Get the unit used by a variable.

initialize(config_file)#

Initialize the component from a file.

BMI-wrapped Landlab components use input files in YAML format. Component-specific parameters are listed at the top level, followed by grid and then time information. An example input file looks like:

flexure:
    eet: 15.e+3
clock:
    start: 0
    stop: 100.
    step: 2.
grid:
    type: raster
    shape: [20, 40]
    spacing: [1000., 2000.]

In this case, a RasterModelGrid is created (with the given shape and spacing) and passed to the underlying landlab component. The eet=15000. is also given to the component but as a keyword parameter. The BMI clock is initialized with the given parameters.

Parameters:

config_file (str or file_like) – YAML-formatted input file for the component.

set_value(name, values)#

Set the values of a variable.

set_value_at_indices(name, inds, src)#

Specify a new value for a model variable at particular indices.

Parameters:
  • name (str) – An input or output variable name, a CSDMS Standard Name.

  • inds (array_like) – The indices into the variable array.

  • src (array_like) – The new value for the specified variable.

update()#

Update the component one time step.

update_frac(frac)#

Update the component a fraction of a time step.

update_until(then)#

Update the component until a given time.

class BedParcelInitializerAreaBMI#

Bases: Bmi

Basic Modeling Interface for the BedParcelInitializerArea component.

finalize()#

Clean-up the component.

get_component_name()#

Name of the component.

get_current_time()#

Current component time.

get_end_time()#

Stop time for the component.

get_grid_edge_count(grid)#

Get the number of edges in the grid.

Parameters:

grid (int) – A grid identifier.

Returns:

The total number of grid edges.

Return type:

int

get_grid_edge_nodes(grid, edge_nodes)#

Get the edge-node connectivity.

Parameters:
  • grid (int) – A grid identifier.

  • edge_nodes (ndarray of int, shape (2 x nnodes,)) – A numpy array to place the edge-node connectivity. For each edge, connectivity is given as node at edge tail, followed by node at edge head.

Returns:

The input numpy array that holds the edge-node connectivity.

Return type:

ndarray of int

get_grid_face_count(grid)#

Get the number of faces in the grid.

Parameters:

grid (int) – A grid identifier.

Returns:

The total number of grid faces.

Return type:

int

get_grid_face_edges(grid)#

Get the face-edge connectivity.

Parameters:
  • grid (int) – A grid identifier.

  • face_edges (ndarray of int) – A numpy array to place the face-edge connectivity.

Returns:

The input numpy array that holds the face-edge connectivity.

Return type:

ndarray of int

get_grid_face_nodes(grid, face_nodes)#

Get the face-node connectivity.

Parameters:
  • grid (int) – A grid identifier.

  • face_nodes (ndarray of int) – A numpy array to place the face-node connectivity. For each face, the nodes (listed in a counter-clockwise direction) that form the boundary of the face.

Returns:

The input numpy array that holds the face-node connectivity.

Return type:

ndarray of int

get_grid_node_count(grid)#

Get the number of nodes in the grid.

Parameters:

grid (int) – A grid identifier.

Returns:

The total number of grid nodes.

Return type:

int

get_grid_nodes_per_face(grid, nodes_per_face)#

Get the number of nodes for each face.

Parameters:
  • grid (int) – A grid identifier.

  • nodes_per_face (ndarray of int, shape (nfaces,)) – A numpy array to place the number of nodes per face.

Returns:

The input numpy array that holds the number of nodes per face.

Return type:

ndarray of int

get_grid_origin(grid, origin)#

Get the origin for a structured grid.

get_grid_rank(grid)#

Get the number of dimensions of a grid.

get_grid_shape(grid, shape)#

Get the shape of a structured grid.

get_grid_size(grid)#

Get the total number of elements in the computational grid.

Parameters:

grid (int) – A grid identifier.

Returns:

Size of the grid.

Return type:

int

get_grid_spacing(grid, spacing)#

Get the row and column spacing of a structured grid.

get_grid_type(grid)#

Get the type of grid.

get_grid_x(grid, x)#

Get coordinates of grid nodes in the x direction.

Parameters:
  • grid (int) – A grid identifier.

  • x (ndarray of float, shape (nrows,)) – A numpy array to hold the x-coordinates of the grid node columns.

Returns:

The input numpy array that holds the grid’s column x-coordinates.

Return type:

ndarray of float

get_grid_y(grid, y)#

Get coordinates of grid nodes in the y direction.

Parameters:
  • grid (int) – A grid identifier.

  • y (ndarray of float, shape (ncols,)) – A numpy array to hold the y-coordinates of the grid node rows.

Returns:

The input numpy array that holds the grid’s row y-coordinates.

Return type:

ndarray of float

get_grid_z(grid, z)#

Get coordinates of grid nodes in the z direction.

Parameters:
  • grid (int) – A grid identifier.

  • z (ndarray of float, shape (nlayers,)) – A numpy array to hold the z-coordinates of the grid nodes layers.

Returns:

The input numpy array that holds the grid’s layer z-coordinates.

Return type:

ndarray of float

get_input_item_count()#

Count of a model’s input variables.

Returns:

The number of input variables.

Return type:

int

get_input_var_names()#

Names of the input exchange items.

get_output_item_count()#

Count of a model’s output variables.

Returns:

The number of output variables.

Return type:

int

get_output_var_names()#

Names of the output exchange items.

get_start_time()#

Start time of the component.

get_time_step()#

Component time step.

get_time_units()#

Time units used by the component.

get_value(name, dest)#

Get a copy of a variable’s data.

get_value_at_indices(name, dest, inds)#

Get values at particular indices.

Parameters:
  • name (str) – An input or output variable name, a CSDMS Standard Name.

  • dest (ndarray) – A numpy array into which to place the values.

  • inds (array_like) – The indices into the variable array.

Returns:

Value of the model variable at the given location.

Return type:

array_like

get_value_ptr(name)#

Get a reference to values of the given variable.

This is a getter for the model, used to access the model’s current state. It returns a reference to a model variable, with the return type, size and rank dependent on the variable.

Parameters:

name (str) – An input or output variable name, a CSDMS Standard Name.

Returns:

A reference to a model variable.

Return type:

array_like

get_value_ref(name)#

Get a reference to a variable’s data.

get_var_grid(name)#

Get the grid id for a variable.

get_var_itemsize(name)#

Get the size of elements of a variable.

get_var_location(name)#

Get the grid element type that the a given variable is defined on.

The grid topology can be composed of nodes, edges, and faces.

node

A point that has a coordinate pair or triplet: the most basic element of the topology.

edge

A line or curve bounded by two nodes.

face

A plane or surface enclosed by a set of edges. In a 2D horizontal application one may consider the word “polygon”, but in the hierarchy of elements the word “face” is most common.

Parameters:

name (str) – An input or output variable name, a CSDMS Standard Name.

Returns:

The grid location on which the variable is defined. Must be one of “node”, “edge”, or “face”.

Return type:

str

Notes

CSDMS uses the ugrid conventions to define unstructured grids.

get_var_nbytes(name)#

Get the total number of bytes used by a variable.

get_var_type(name)#

Get the data type for a variable.

get_var_units(name)#

Get the unit used by a variable.

initialize(config_file)#

Initialize the component from a file.

BMI-wrapped Landlab components use input files in YAML format. Component-specific parameters are listed at the top level, followed by grid and then time information. An example input file looks like:

flexure:
    eet: 15.e+3
clock:
    start: 0
    stop: 100.
    step: 2.
grid:
    type: raster
    shape: [20, 40]
    spacing: [1000., 2000.]

In this case, a RasterModelGrid is created (with the given shape and spacing) and passed to the underlying landlab component. The eet=15000. is also given to the component but as a keyword parameter. The BMI clock is initialized with the given parameters.

Parameters:

config_file (str or file_like) – YAML-formatted input file for the component.

set_value(name, values)#

Set the values of a variable.

set_value_at_indices(name, inds, src)#

Specify a new value for a model variable at particular indices.

Parameters:
  • name (str) – An input or output variable name, a CSDMS Standard Name.

  • inds (array_like) – The indices into the variable array.

  • src (array_like) – The new value for the specified variable.

update()#

Update the component one time step.

update_frac(frac)#

Update the component a fraction of a time step.

update_until(then)#

Update the component until a given time.

class BedParcelInitializerDepthBMI#

Bases: Bmi

Basic Modeling Interface for the BedParcelInitializerDepth component.

finalize()#

Clean-up the component.

get_component_name()#

Name of the component.

get_current_time()#

Current component time.

get_end_time()#

Stop time for the component.

get_grid_edge_count(grid)#

Get the number of edges in the grid.

Parameters:

grid (int) – A grid identifier.

Returns:

The total number of grid edges.

Return type:

int

get_grid_edge_nodes(grid, edge_nodes)#

Get the edge-node connectivity.

Parameters:
  • grid (int) – A grid identifier.

  • edge_nodes (ndarray of int, shape (2 x nnodes,)) – A numpy array to place the edge-node connectivity. For each edge, connectivity is given as node at edge tail, followed by node at edge head.

Returns:

The input numpy array that holds the edge-node connectivity.

Return type:

ndarray of int

get_grid_face_count(grid)#

Get the number of faces in the grid.

Parameters:

grid (int) – A grid identifier.

Returns:

The total number of grid faces.

Return type:

int

get_grid_face_edges(grid)#

Get the face-edge connectivity.

Parameters:
  • grid (int) – A grid identifier.

  • face_edges (ndarray of int) – A numpy array to place the face-edge connectivity.

Returns:

The input numpy array that holds the face-edge connectivity.

Return type:

ndarray of int

get_grid_face_nodes(grid, face_nodes)#

Get the face-node connectivity.

Parameters:
  • grid (int) – A grid identifier.

  • face_nodes (ndarray of int) – A numpy array to place the face-node connectivity. For each face, the nodes (listed in a counter-clockwise direction) that form the boundary of the face.

Returns:

The input numpy array that holds the face-node connectivity.

Return type:

ndarray of int

get_grid_node_count(grid)#

Get the number of nodes in the grid.

Parameters:

grid (int) – A grid identifier.

Returns:

The total number of grid nodes.

Return type:

int

get_grid_nodes_per_face(grid, nodes_per_face)#

Get the number of nodes for each face.

Parameters:
  • grid (int) – A grid identifier.

  • nodes_per_face (ndarray of int, shape (nfaces,)) – A numpy array to place the number of nodes per face.

Returns:

The input numpy array that holds the number of nodes per face.

Return type:

ndarray of int

get_grid_origin(grid, origin)#

Get the origin for a structured grid.

get_grid_rank(grid)#

Get the number of dimensions of a grid.

get_grid_shape(grid, shape)#

Get the shape of a structured grid.

get_grid_size(grid)#

Get the total number of elements in the computational grid.

Parameters:

grid (int) – A grid identifier.

Returns:

Size of the grid.

Return type:

int

get_grid_spacing(grid, spacing)#

Get the row and column spacing of a structured grid.

get_grid_type(grid)#

Get the type of grid.

get_grid_x(grid, x)#

Get coordinates of grid nodes in the x direction.

Parameters:
  • grid (int) – A grid identifier.

  • x (ndarray of float, shape (nrows,)) – A numpy array to hold the x-coordinates of the grid node columns.

Returns:

The input numpy array that holds the grid’s column x-coordinates.

Return type:

ndarray of float

get_grid_y(grid, y)#

Get coordinates of grid nodes in the y direction.

Parameters:
  • grid (int) – A grid identifier.

  • y (ndarray of float, shape (ncols,)) – A numpy array to hold the y-coordinates of the grid node rows.

Returns:

The input numpy array that holds the grid’s row y-coordinates.

Return type:

ndarray of float

get_grid_z(grid, z)#

Get coordinates of grid nodes in the z direction.

Parameters:
  • grid (int) – A grid identifier.

  • z (ndarray of float, shape (nlayers,)) – A numpy array to hold the z-coordinates of the grid nodes layers.

Returns:

The input numpy array that holds the grid’s layer z-coordinates.

Return type:

ndarray of float

get_input_item_count()#

Count of a model’s input variables.

Returns:

The number of input variables.

Return type:

int

get_input_var_names()#

Names of the input exchange items.

get_output_item_count()#

Count of a model’s output variables.

Returns:

The number of output variables.

Return type:

int

get_output_var_names()#

Names of the output exchange items.

get_start_time()#

Start time of the component.

get_time_step()#

Component time step.

get_time_units()#

Time units used by the component.

get_value(name, dest)#

Get a copy of a variable’s data.

get_value_at_indices(name, dest, inds)#

Get values at particular indices.

Parameters:
  • name (str) – An input or output variable name, a CSDMS Standard Name.

  • dest (ndarray) – A numpy array into which to place the values.

  • inds (array_like) – The indices into the variable array.

Returns:

Value of the model variable at the given location.

Return type:

array_like

get_value_ptr(name)#

Get a reference to values of the given variable.

This is a getter for the model, used to access the model’s current state. It returns a reference to a model variable, with the return type, size and rank dependent on the variable.

Parameters:

name (str) – An input or output variable name, a CSDMS Standard Name.

Returns:

A reference to a model variable.

Return type:

array_like

get_value_ref(name)#

Get a reference to a variable’s data.

get_var_grid(name)#

Get the grid id for a variable.

get_var_itemsize(name)#

Get the size of elements of a variable.

get_var_location(name)#

Get the grid element type that the a given variable is defined on.

The grid topology can be composed of nodes, edges, and faces.

node

A point that has a coordinate pair or triplet: the most basic element of the topology.

edge

A line or curve bounded by two nodes.

face

A plane or surface enclosed by a set of edges. In a 2D horizontal application one may consider the word “polygon”, but in the hierarchy of elements the word “face” is most common.

Parameters:

name (str) – An input or output variable name, a CSDMS Standard Name.

Returns:

The grid location on which the variable is defined. Must be one of “node”, “edge”, or “face”.

Return type:

str

Notes

CSDMS uses the ugrid conventions to define unstructured grids.

get_var_nbytes(name)#

Get the total number of bytes used by a variable.

get_var_type(name)#

Get the data type for a variable.

get_var_units(name)#

Get the unit used by a variable.

initialize(config_file)#

Initialize the component from a file.

BMI-wrapped Landlab components use input files in YAML format. Component-specific parameters are listed at the top level, followed by grid and then time information. An example input file looks like:

flexure:
    eet: 15.e+3
clock:
    start: 0
    stop: 100.
    step: 2.
grid:
    type: raster
    shape: [20, 40]
    spacing: [1000., 2000.]

In this case, a RasterModelGrid is created (with the given shape and spacing) and passed to the underlying landlab component. The eet=15000. is also given to the component but as a keyword parameter. The BMI clock is initialized with the given parameters.

Parameters:

config_file (str or file_like) – YAML-formatted input file for the component.

set_value(name, values)#

Set the values of a variable.

set_value_at_indices(name, inds, src)#

Specify a new value for a model variable at particular indices.

Parameters:
  • name (str) – An input or output variable name, a CSDMS Standard Name.

  • inds (array_like) – The indices into the variable array.

  • src (array_like) – The new value for the specified variable.

update()#

Update the component one time step.

update_frac(frac)#

Update the component a fraction of a time step.

update_until(then)#

Update the component until a given time.

class BedParcelInitializerDischargeBMI#

Bases: Bmi

Basic Modeling Interface for the BedParcelInitializerDischarge component.

finalize()#

Clean-up the component.

get_component_name()#

Name of the component.

get_current_time()#

Current component time.

get_end_time()#

Stop time for the component.

get_grid_edge_count(grid)#

Get the number of edges in the grid.

Parameters:

grid (int) – A grid identifier.

Returns:

The total number of grid edges.

Return type:

int

get_grid_edge_nodes(grid, edge_nodes)#

Get the edge-node connectivity.

Parameters:
  • grid (int) – A grid identifier.

  • edge_nodes (ndarray of int, shape (2 x nnodes,)) – A numpy array to place the edge-node connectivity. For each edge, connectivity is given as node at edge tail, followed by node at edge head.

Returns:

The input numpy array that holds the edge-node connectivity.

Return type:

ndarray of int

get_grid_face_count(grid)#

Get the number of faces in the grid.

Parameters:

grid (int) – A grid identifier.

Returns:

The total number of grid faces.

Return type:

int

get_grid_face_edges(grid)#

Get the face-edge connectivity.

Parameters:
  • grid (int) – A grid identifier.

  • face_edges (ndarray of int) – A numpy array to place the face-edge connectivity.

Returns:

The input numpy array that holds the face-edge connectivity.

Return type:

ndarray of int

get_grid_face_nodes(grid, face_nodes)#

Get the face-node connectivity.

Parameters:
  • grid (int) – A grid identifier.

  • face_nodes (ndarray of int) – A numpy array to place the face-node connectivity. For each face, the nodes (listed in a counter-clockwise direction) that form the boundary of the face.

Returns:

The input numpy array that holds the face-node connectivity.

Return type:

ndarray of int

get_grid_node_count(grid)#

Get the number of nodes in the grid.

Parameters:

grid (int) – A grid identifier.

Returns:

The total number of grid nodes.

Return type:

int

get_grid_nodes_per_face(grid, nodes_per_face)#

Get the number of nodes for each face.

Parameters:
  • grid (int) – A grid identifier.

  • nodes_per_face (ndarray of int, shape (nfaces,)) – A numpy array to place the number of nodes per face.

Returns:

The input numpy array that holds the number of nodes per face.

Return type:

ndarray of int

get_grid_origin(grid, origin)#

Get the origin for a structured grid.

get_grid_rank(grid)#

Get the number of dimensions of a grid.

get_grid_shape(grid, shape)#

Get the shape of a structured grid.

get_grid_size(grid)#

Get the total number of elements in the computational grid.

Parameters:

grid (int) – A grid identifier.

Returns:

Size of the grid.

Return type:

int

get_grid_spacing(grid, spacing)#

Get the row and column spacing of a structured grid.

get_grid_type(grid)#

Get the type of grid.

get_grid_x(grid, x)#

Get coordinates of grid nodes in the x direction.

Parameters:
  • grid (int) – A grid identifier.

  • x (ndarray of float, shape (nrows,)) – A numpy array to hold the x-coordinates of the grid node columns.

Returns:

The input numpy array that holds the grid’s column x-coordinates.

Return type:

ndarray of float

get_grid_y(grid, y)#

Get coordinates of grid nodes in the y direction.

Parameters:
  • grid (int) – A grid identifier.

  • y (ndarray of float, shape (ncols,)) – A numpy array to hold the y-coordinates of the grid node rows.

Returns:

The input numpy array that holds the grid’s row y-coordinates.

Return type:

ndarray of float

get_grid_z(grid, z)#

Get coordinates of grid nodes in the z direction.

Parameters:
  • grid (int) – A grid identifier.

  • z (ndarray of float, shape (nlayers,)) – A numpy array to hold the z-coordinates of the grid nodes layers.

Returns:

The input numpy array that holds the grid’s layer z-coordinates.

Return type:

ndarray of float

get_input_item_count()#

Count of a model’s input variables.

Returns:

The number of input variables.

Return type:

int

get_input_var_names()#

Names of the input exchange items.

get_output_item_count()#

Count of a model’s output variables.

Returns:

The number of output variables.

Return type:

int

get_output_var_names()#

Names of the output exchange items.

get_start_time()#

Start time of the component.

get_time_step()#

Component time step.

get_time_units()#

Time units used by the component.

get_value(name, dest)#

Get a copy of a variable’s data.

get_value_at_indices(name, dest, inds)#

Get values at particular indices.

Parameters:
  • name (str) – An input or output variable name, a CSDMS Standard Name.

  • dest (ndarray) – A numpy array into which to place the values.

  • inds (array_like) – The indices into the variable array.

Returns:

Value of the model variable at the given location.

Return type:

array_like

get_value_ptr(name)#

Get a reference to values of the given variable.

This is a getter for the model, used to access the model’s current state. It returns a reference to a model variable, with the return type, size and rank dependent on the variable.

Parameters:

name (str) – An input or output variable name, a CSDMS Standard Name.

Returns:

A reference to a model variable.

Return type:

array_like

get_value_ref(name)#

Get a reference to a variable’s data.

get_var_grid(name)#

Get the grid id for a variable.

get_var_itemsize(name)#

Get the size of elements of a variable.

get_var_location(name)#

Get the grid element type that the a given variable is defined on.

The grid topology can be composed of nodes, edges, and faces.

node

A point that has a coordinate pair or triplet: the most basic element of the topology.

edge

A line or curve bounded by two nodes.

face

A plane or surface enclosed by a set of edges. In a 2D horizontal application one may consider the word “polygon”, but in the hierarchy of elements the word “face” is most common.

Parameters:

name (str) – An input or output variable name, a CSDMS Standard Name.

Returns:

The grid location on which the variable is defined. Must be one of “node”, “edge”, or “face”.

Return type:

str

Notes

CSDMS uses the ugrid conventions to define unstructured grids.

get_var_nbytes(name)#

Get the total number of bytes used by a variable.

get_var_type(name)#

Get the data type for a variable.

get_var_units(name)#

Get the unit used by a variable.

initialize(config_file)#

Initialize the component from a file.

BMI-wrapped Landlab components use input files in YAML format. Component-specific parameters are listed at the top level, followed by grid and then time information. An example input file looks like:

flexure:
    eet: 15.e+3
clock:
    start: 0
    stop: 100.
    step: 2.
grid:
    type: raster
    shape: [20, 40]
    spacing: [1000., 2000.]

In this case, a RasterModelGrid is created (with the given shape and spacing) and passed to the underlying landlab component. The eet=15000. is also given to the component but as a keyword parameter. The BMI clock is initialized with the given parameters.

Parameters:

config_file (str or file_like) – YAML-formatted input file for the component.

set_value(name, values)#

Set the values of a variable.

set_value_at_indices(name, inds, src)#

Specify a new value for a model variable at particular indices.

Parameters:
  • name (str) – An input or output variable name, a CSDMS Standard Name.

  • inds (array_like) – The indices into the variable array.

  • src (array_like) – The new value for the specified variable.

update()#

Update the component one time step.

update_frac(frac)#

Update the component a fraction of a time step.

update_until(then)#

Update the component until a given time.

class BedParcelInitializerUserD50BMI#

Bases: Bmi

Basic Modeling Interface for the BedParcelInitializerUserD50 component.

finalize()#

Clean-up the component.

get_component_name()#

Name of the component.

get_current_time()#

Current component time.

get_end_time()#

Stop time for the component.

get_grid_edge_count(grid)#

Get the number of edges in the grid.

Parameters:

grid (int) – A grid identifier.

Returns:

The total number of grid edges.

Return type:

int

get_grid_edge_nodes(grid, edge_nodes)#

Get the edge-node connectivity.

Parameters:
  • grid (int) – A grid identifier.

  • edge_nodes (ndarray of int, shape (2 x nnodes,)) – A numpy array to place the edge-node connectivity. For each edge, connectivity is given as node at edge tail, followed by node at edge head.

Returns:

The input numpy array that holds the edge-node connectivity.

Return type:

ndarray of int

get_grid_face_count(grid)#

Get the number of faces in the grid.

Parameters:

grid (int) – A grid identifier.

Returns:

The total number of grid faces.

Return type:

int

get_grid_face_edges(grid)#

Get the face-edge connectivity.

Parameters:
  • grid (int) – A grid identifier.

  • face_edges (ndarray of int) – A numpy array to place the face-edge connectivity.

Returns:

The input numpy array that holds the face-edge connectivity.

Return type:

ndarray of int

get_grid_face_nodes(grid, face_nodes)#

Get the face-node connectivity.

Parameters:
  • grid (int) – A grid identifier.

  • face_nodes (ndarray of int) – A numpy array to place the face-node connectivity. For each face, the nodes (listed in a counter-clockwise direction) that form the boundary of the face.

Returns:

The input numpy array that holds the face-node connectivity.

Return type:

ndarray of int

get_grid_node_count(grid)#

Get the number of nodes in the grid.

Parameters:

grid (int) – A grid identifier.

Returns:

The total number of grid nodes.

Return type:

int

get_grid_nodes_per_face(grid, nodes_per_face)#

Get the number of nodes for each face.

Parameters:
  • grid (int) – A grid identifier.

  • nodes_per_face (ndarray of int, shape (nfaces,)) – A numpy array to place the number of nodes per face.

Returns:

The input numpy array that holds the number of nodes per face.

Return type:

ndarray of int

get_grid_origin(grid, origin)#

Get the origin for a structured grid.

get_grid_rank(grid)#

Get the number of dimensions of a grid.

get_grid_shape(grid, shape)#

Get the shape of a structured grid.

get_grid_size(grid)#

Get the total number of elements in the computational grid.

Parameters:

grid (int) – A grid identifier.

Returns:

Size of the grid.

Return type:

int

get_grid_spacing(grid, spacing)#

Get the row and column spacing of a structured grid.

get_grid_type(grid)#

Get the type of grid.

get_grid_x(grid, x)#

Get coordinates of grid nodes in the x direction.

Parameters:
  • grid (int) – A grid identifier.

  • x (ndarray of float, shape (nrows,)) – A numpy array to hold the x-coordinates of the grid node columns.

Returns:

The input numpy array that holds the grid’s column x-coordinates.

Return type:

ndarray of float

get_grid_y(grid, y)#

Get coordinates of grid nodes in the y direction.

Parameters:
  • grid (int) – A grid identifier.

  • y (ndarray of float, shape (ncols,)) – A numpy array to hold the y-coordinates of the grid node rows.

Returns:

The input numpy array that holds the grid’s row y-coordinates.

Return type:

ndarray of float

get_grid_z(grid, z)#

Get coordinates of grid nodes in the z direction.

Parameters:
  • grid (int) – A grid identifier.

  • z (ndarray of float, shape (nlayers,)) – A numpy array to hold the z-coordinates of the grid nodes layers.

Returns:

The input numpy array that holds the grid’s layer z-coordinates.

Return type:

ndarray of float

get_input_item_count()#

Count of a model’s input variables.

Returns:

The number of input variables.

Return type:

int

get_input_var_names()#

Names of the input exchange items.

get_output_item_count()#

Count of a model’s output variables.

Returns:

The number of output variables.

Return type:

int

get_output_var_names()#

Names of the output exchange items.

get_start_time()#

Start time of the component.

get_time_step()#

Component time step.

get_time_units()#

Time units used by the component.

get_value(name, dest)#

Get a copy of a variable’s data.

get_value_at_indices(name, dest, inds)#

Get values at particular indices.

Parameters:
  • name (str) – An input or output variable name, a CSDMS Standard Name.

  • dest (ndarray) – A numpy array into which to place the values.

  • inds (array_like) – The indices into the variable array.

Returns:

Value of the model variable at the given location.

Return type:

array_like

get_value_ptr(name)#

Get a reference to values of the given variable.

This is a getter for the model, used to access the model’s current state. It returns a reference to a model variable, with the return type, size and rank dependent on the variable.

Parameters:

name (str) – An input or output variable name, a CSDMS Standard Name.

Returns:

A reference to a model variable.

Return type:

array_like

get_value_ref(name)#

Get a reference to a variable’s data.

get_var_grid(name)#

Get the grid id for a variable.

get_var_itemsize(name)#

Get the size of elements of a variable.

get_var_location(name)#

Get the grid element type that the a given variable is defined on.

The grid topology can be composed of nodes, edges, and faces.

node

A point that has a coordinate pair or triplet: the most basic element of the topology.

edge

A line or curve bounded by two nodes.

face

A plane or surface enclosed by a set of edges. In a 2D horizontal application one may consider the word “polygon”, but in the hierarchy of elements the word “face” is most common.

Parameters:

name (str) – An input or output variable name, a CSDMS Standard Name.

Returns:

The grid location on which the variable is defined. Must be one of “node”, “edge”, or “face”.

Return type:

str

Notes

CSDMS uses the ugrid conventions to define unstructured grids.

get_var_nbytes(name)#

Get the total number of bytes used by a variable.

get_var_type(name)#

Get the data type for a variable.

get_var_units(name)#

Get the unit used by a variable.

initialize(config_file)#

Initialize the component from a file.

BMI-wrapped Landlab components use input files in YAML format. Component-specific parameters are listed at the top level, followed by grid and then time information. An example input file looks like:

flexure:
    eet: 15.e+3
clock:
    start: 0
    stop: 100.
    step: 2.
grid:
    type: raster
    shape: [20, 40]
    spacing: [1000., 2000.]

In this case, a RasterModelGrid is created (with the given shape and spacing) and passed to the underlying landlab component. The eet=15000. is also given to the component but as a keyword parameter. The BMI clock is initialized with the given parameters.

Parameters:

config_file (str or file_like) – YAML-formatted input file for the component.

set_value(name, values)#

Set the values of a variable.

set_value_at_indices(name, inds, src)#

Specify a new value for a model variable at particular indices.

Parameters:
  • name (str) – An input or output variable name, a CSDMS Standard Name.

  • inds (array_like) – The indices into the variable array.

  • src (array_like) – The new value for the specified variable.

update()#

Update the component one time step.

update_frac(frac)#

Update the component a fraction of a time step.

update_until(then)#

Update the component until a given time.

class BedrockLandsliderBMI#

Bases: Bmi

Basic Modeling Interface for the BedrockLandslider component.

finalize()#

Clean-up the component.

get_component_name()#

Name of the component.

get_current_time()#

Current component time.

get_end_time()#

Stop time for the component.

get_grid_edge_count(grid)#

Get the number of edges in the grid.

Parameters:

grid (int) – A grid identifier.

Returns:

The total number of grid edges.

Return type:

int

get_grid_edge_nodes(grid, edge_nodes)#

Get the edge-node connectivity.

Parameters:
  • grid (int) – A grid identifier.

  • edge_nodes (ndarray of int, shape (2 x nnodes,)) – A numpy array to place the edge-node connectivity. For each edge, connectivity is given as node at edge tail, followed by node at edge head.

Returns:

The input numpy array that holds the edge-node connectivity.

Return type:

ndarray of int

get_grid_face_count(grid)#

Get the number of faces in the grid.

Parameters:

grid (int) – A grid identifier.

Returns:

The total number of grid faces.

Return type:

int

get_grid_face_edges(grid)#

Get the face-edge connectivity.

Parameters:
  • grid (int) – A grid identifier.

  • face_edges (ndarray of int) – A numpy array to place the face-edge connectivity.

Returns:

The input numpy array that holds the face-edge connectivity.

Return type:

ndarray of int

get_grid_face_nodes(grid, face_nodes)#

Get the face-node connectivity.

Parameters:
  • grid (int) – A grid identifier.

  • face_nodes (ndarray of int) – A numpy array to place the face-node connectivity. For each face, the nodes (listed in a counter-clockwise direction) that form the boundary of the face.

Returns:

The input numpy array that holds the face-node connectivity.

Return type:

ndarray of int

get_grid_node_count(grid)#

Get the number of nodes in the grid.

Parameters:

grid (int) – A grid identifier.

Returns:

The total number of grid nodes.

Return type:

int

get_grid_nodes_per_face(grid, nodes_per_face)#

Get the number of nodes for each face.

Parameters:
  • grid (int) – A grid identifier.

  • nodes_per_face (ndarray of int, shape (nfaces,)) – A numpy array to place the number of nodes per face.

Returns:

The input numpy array that holds the number of nodes per face.

Return type:

ndarray of int

get_grid_origin(grid, origin)#

Get the origin for a structured grid.

get_grid_rank(grid)#

Get the number of dimensions of a grid.

get_grid_shape(grid, shape)#

Get the shape of a structured grid.

get_grid_size(grid)#

Get the total number of elements in the computational grid.

Parameters:

grid (int) – A grid identifier.

Returns:

Size of the grid.

Return type:

int

get_grid_spacing(grid, spacing)#

Get the row and column spacing of a structured grid.

get_grid_type(grid)#

Get the type of grid.

get_grid_x(grid, x)#

Get coordinates of grid nodes in the x direction.

Parameters:
  • grid (int) – A grid identifier.

  • x (ndarray of float, shape (nrows,)) – A numpy array to hold the x-coordinates of the grid node columns.

Returns:

The input numpy array that holds the grid’s column x-coordinates.

Return type:

ndarray of float

get_grid_y(grid, y)#

Get coordinates of grid nodes in the y direction.

Parameters:
  • grid (int) – A grid identifier.

  • y (ndarray of float, shape (ncols,)) – A numpy array to hold the y-coordinates of the grid node rows.

Returns:

The input numpy array that holds the grid’s row y-coordinates.

Return type:

ndarray of float

get_grid_z(grid, z)#

Get coordinates of grid nodes in the z direction.

Parameters:
  • grid (int) – A grid identifier.

  • z (ndarray of float, shape (nlayers,)) – A numpy array to hold the z-coordinates of the grid nodes layers.

Returns:

The input numpy array that holds the grid’s layer z-coordinates.

Return type:

ndarray of float

get_input_item_count()#

Count of a model’s input variables.

Returns:

The number of input variables.

Return type:

int

get_input_var_names()#

Names of the input exchange items.

get_output_item_count()#

Count of a model’s output variables.

Returns:

The number of output variables.

Return type:

int

get_output_var_names()#

Names of the output exchange items.

get_start_time()#

Start time of the component.

get_time_step()#

Component time step.

get_time_units()#

Time units used by the component.

get_value(name, dest)#

Get a copy of a variable’s data.

get_value_at_indices(name, dest, inds)#

Get values at particular indices.

Parameters:
  • name (str) – An input or output variable name, a CSDMS Standard Name.

  • dest (ndarray) – A numpy array into which to place the values.

  • inds (array_like) – The indices into the variable array.

Returns:

Value of the model variable at the given location.

Return type:

array_like

get_value_ptr(name)#

Get a reference to values of the given variable.

This is a getter for the model, used to access the model’s current state. It returns a reference to a model variable, with the return type, size and rank dependent on the variable.

Parameters:

name (str) – An input or output variable name, a CSDMS Standard Name.

Returns:

A reference to a model variable.

Return type:

array_like

get_value_ref(name)#

Get a reference to a variable’s data.

get_var_grid(name)#

Get the grid id for a variable.

get_var_itemsize(name)#

Get the size of elements of a variable.

get_var_location(name)#

Get the grid element type that the a given variable is defined on.

The grid topology can be composed of nodes, edges, and faces.

node

A point that has a coordinate pair or triplet: the most basic element of the topology.

edge

A line or curve bounded by two nodes.

face

A plane or surface enclosed by a set of edges. In a 2D horizontal application one may consider the word “polygon”, but in the hierarchy of elements the word “face” is most common.

Parameters:

name (str) – An input or output variable name, a CSDMS Standard Name.

Returns:

The grid location on which the variable is defined. Must be one of “node”, “edge”, or “face”.

Return type:

str

Notes

CSDMS uses the ugrid conventions to define unstructured grids.

get_var_nbytes(name)#

Get the total number of bytes used by a variable.

get_var_type(name)#

Get the data type for a variable.

get_var_units(name)#

Get the unit used by a variable.

initialize(config_file)#

Initialize the component from a file.

BMI-wrapped Landlab components use input files in YAML format. Component-specific parameters are listed at the top level, followed by grid and then time information. An example input file looks like:

flexure:
    eet: 15.e+3
clock:
    start: 0
    stop: 100.
    step: 2.
grid:
    type: raster
    shape: [20, 40]
    spacing: [1000., 2000.]

In this case, a RasterModelGrid is created (with the given shape and spacing) and passed to the underlying landlab component. The eet=15000. is also given to the component but as a keyword parameter. The BMI clock is initialized with the given parameters.

Parameters:

config_file (str or file_like) – YAML-formatted input file for the component.

set_value(name, values)#

Set the values of a variable.

set_value_at_indices(name, inds, src)#

Specify a new value for a model variable at particular indices.

Parameters:
  • name (str) – An input or output variable name, a CSDMS Standard Name.

  • inds (array_like) – The indices into the variable array.

  • src (array_like) – The new value for the specified variable.

update()#

Update the component one time step.

update_frac(frac)#

Update the component a fraction of a time step.

update_until(then)#

Update the component until a given time.

class CarbonateProducerBMI#

Bases: Bmi

Basic Modeling Interface for the CarbonateProducer component.

finalize()#

Clean-up the component.

get_component_name()#

Name of the component.

get_current_time()#

Current component time.

get_end_time()#

Stop time for the component.

get_grid_edge_count(grid)#

Get the number of edges in the grid.

Parameters:

grid (int) – A grid identifier.

Returns:

The total number of grid edges.

Return type:

int

get_grid_edge_nodes(grid, edge_nodes)#

Get the edge-node connectivity.

Parameters:
  • grid (int) – A grid identifier.

  • edge_nodes (ndarray of int, shape (2 x nnodes,)) – A numpy array to place the edge-node connectivity. For each edge, connectivity is given as node at edge tail, followed by node at edge head.

Returns:

The input numpy array that holds the edge-node connectivity.

Return type:

ndarray of int

get_grid_face_count(grid)#

Get the number of faces in the grid.

Parameters:

grid (int) – A grid identifier.

Returns:

The total number of grid faces.

Return type:

int

get_grid_face_edges(grid)#

Get the face-edge connectivity.

Parameters:
  • grid (int) – A grid identifier.

  • face_edges (ndarray of int) – A numpy array to place the face-edge connectivity.

Returns:

The input numpy array that holds the face-edge connectivity.

Return type:

ndarray of int

get_grid_face_nodes(grid, face_nodes)#

Get the face-node connectivity.

Parameters:
  • grid (int) – A grid identifier.

  • face_nodes (ndarray of int) – A numpy array to place the face-node connectivity. For each face, the nodes (listed in a counter-clockwise direction) that form the boundary of the face.

Returns:

The input numpy array that holds the face-node connectivity.

Return type:

ndarray of int

get_grid_node_count(grid)#

Get the number of nodes in the grid.

Parameters:

grid (int) – A grid identifier.

Returns:

The total number of grid nodes.

Return type:

int

get_grid_nodes_per_face(grid, nodes_per_face)#

Get the number of nodes for each face.

Parameters:
  • grid (int) – A grid identifier.

  • nodes_per_face (ndarray of int, shape (nfaces,)) – A numpy array to place the number of nodes per face.

Returns:

The input numpy array that holds the number of nodes per face.

Return type:

ndarray of int

get_grid_origin(grid, origin)#

Get the origin for a structured grid.

get_grid_rank(grid)#

Get the number of dimensions of a grid.

get_grid_shape(grid, shape)#

Get the shape of a structured grid.

get_grid_size(grid)#

Get the total number of elements in the computational grid.

Parameters:

grid (int) – A grid identifier.

Returns:

Size of the grid.

Return type:

int

get_grid_spacing(grid, spacing)#

Get the row and column spacing of a structured grid.

get_grid_type(grid)#

Get the type of grid.

get_grid_x(grid, x)#

Get coordinates of grid nodes in the x direction.

Parameters:
  • grid (int) – A grid identifier.

  • x (ndarray of float, shape (nrows,)) – A numpy array to hold the x-coordinates of the grid node columns.

Returns:

The input numpy array that holds the grid’s column x-coordinates.

Return type:

ndarray of float

get_grid_y(grid, y)#

Get coordinates of grid nodes in the y direction.

Parameters:
  • grid (int) – A grid identifier.

  • y (ndarray of float, shape (ncols,)) – A numpy array to hold the y-coordinates of the grid node rows.

Returns:

The input numpy array that holds the grid’s row y-coordinates.

Return type:

ndarray of float

get_grid_z(grid, z)#

Get coordinates of grid nodes in the z direction.

Parameters:
  • grid (int) – A grid identifier.

  • z (ndarray of float, shape (nlayers,)) – A numpy array to hold the z-coordinates of the grid nodes layers.

Returns:

The input numpy array that holds the grid’s layer z-coordinates.

Return type:

ndarray of float

get_input_item_count()#

Count of a model’s input variables.

Returns:

The number of input variables.

Return type:

int

get_input_var_names()#

Names of the input exchange items.

get_output_item_count()#

Count of a model’s output variables.

Returns:

The number of output variables.

Return type:

int

get_output_var_names()#

Names of the output exchange items.

get_start_time()#

Start time of the component.

get_time_step()#

Component time step.

get_time_units()#

Time units used by the component.

get_value(name, dest)#

Get a copy of a variable’s data.

get_value_at_indices(name, dest, inds)#

Get values at particular indices.

Parameters:
  • name (str) – An input or output variable name, a CSDMS Standard Name.

  • dest (ndarray) – A numpy array into which to place the values.

  • inds (array_like) – The indices into the variable array.

Returns:

Value of the model variable at the given location.

Return type:

array_like

get_value_ptr(name)#

Get a reference to values of the given variable.

This is a getter for the model, used to access the model’s current state. It returns a reference to a model variable, with the return type, size and rank dependent on the variable.

Parameters:

name (str) – An input or output variable name, a CSDMS Standard Name.

Returns:

A reference to a model variable.

Return type:

array_like

get_value_ref(name)#

Get a reference to a variable’s data.

get_var_grid(name)#

Get the grid id for a variable.

get_var_itemsize(name)#

Get the size of elements of a variable.

get_var_location(name)#

Get the grid element type that the a given variable is defined on.

The grid topology can be composed of nodes, edges, and faces.

node

A point that has a coordinate pair or triplet: the most basic element of the topology.

edge

A line or curve bounded by two nodes.

face

A plane or surface enclosed by a set of edges. In a 2D horizontal application one may consider the word “polygon”, but in the hierarchy of elements the word “face” is most common.

Parameters:

name (str) – An input or output variable name, a CSDMS Standard Name.

Returns:

The grid location on which the variable is defined. Must be one of “node”, “edge”, or “face”.

Return type:

str

Notes

CSDMS uses the ugrid conventions to define unstructured grids.

get_var_nbytes(name)#

Get the total number of bytes used by a variable.

get_var_type(name)#

Get the data type for a variable.

get_var_units(name)#

Get the unit used by a variable.

initialize(config_file)#

Initialize the component from a file.

BMI-wrapped Landlab components use input files in YAML format. Component-specific parameters are listed at the top level, followed by grid and then time information. An example input file looks like:

flexure:
    eet: 15.e+3
clock:
    start: 0
    stop: 100.
    step: 2.
grid:
    type: raster
    shape: [20, 40]
    spacing: [1000., 2000.]

In this case, a RasterModelGrid is created (with the given shape and spacing) and passed to the underlying landlab component. The eet=15000. is also given to the component but as a keyword parameter. The BMI clock is initialized with the given parameters.

Parameters:

config_file (str or file_like) – YAML-formatted input file for the component.

set_value(name, values)#

Set the values of a variable.

set_value_at_indices(name, inds, src)#

Specify a new value for a model variable at particular indices.

Parameters:
  • name (str) – An input or output variable name, a CSDMS Standard Name.

  • inds (array_like) – The indices into the variable array.

  • src (array_like) – The new value for the specified variable.

update()#

Update the component one time step.

update_frac(frac)#

Update the component a fraction of a time step.

update_until(then)#

Update the component until a given time.

class ChannelProfilerBMI#

Bases: Bmi

Basic Modeling Interface for the ChannelProfiler component.

finalize()#

Clean-up the component.

get_component_name()#

Name of the component.

get_current_time()#

Current component time.

get_end_time()#

Stop time for the component.

get_grid_edge_count(grid)#

Get the number of edges in the grid.

Parameters:

grid (int) – A grid identifier.

Returns:

The total number of grid edges.

Return type:

int

get_grid_edge_nodes(grid, edge_nodes)#

Get the edge-node connectivity.

Parameters:
  • grid (int) – A grid identifier.

  • edge_nodes (ndarray of int, shape (2 x nnodes,)) – A numpy array to place the edge-node connectivity. For each edge, connectivity is given as node at edge tail, followed by node at edge head.

Returns:

The input numpy array that holds the edge-node connectivity.

Return type:

ndarray of int

get_grid_face_count(grid)#

Get the number of faces in the grid.

Parameters:

grid (int) – A grid identifier.

Returns:

The total number of grid faces.

Return type:

int

get_grid_face_edges(grid)#

Get the face-edge connectivity.

Parameters:
  • grid (int) – A grid identifier.

  • face_edges (ndarray of int) – A numpy array to place the face-edge connectivity.

Returns:

The input numpy array that holds the face-edge connectivity.

Return type:

ndarray of int

get_grid_face_nodes(grid, face_nodes)#

Get the face-node connectivity.

Parameters:
  • grid (int) – A grid identifier.

  • face_nodes (ndarray of int) – A numpy array to place the face-node connectivity. For each face, the nodes (listed in a counter-clockwise direction) that form the boundary of the face.

Returns:

The input numpy array that holds the face-node connectivity.

Return type:

ndarray of int

get_grid_node_count(grid)#

Get the number of nodes in the grid.

Parameters:

grid (int) – A grid identifier.

Returns:

The total number of grid nodes.

Return type:

int

get_grid_nodes_per_face(grid, nodes_per_face)#

Get the number of nodes for each face.

Parameters:
  • grid (int) – A grid identifier.

  • nodes_per_face (ndarray of int, shape (nfaces,)) – A numpy array to place the number of nodes per face.

Returns:

The input numpy array that holds the number of nodes per face.

Return type:

ndarray of int

get_grid_origin(grid, origin)#

Get the origin for a structured grid.

get_grid_rank(grid)#

Get the number of dimensions of a grid.

get_grid_shape(grid, shape)#

Get the shape of a structured grid.

get_grid_size(grid)#

Get the total number of elements in the computational grid.

Parameters:

grid (int) – A grid identifier.

Returns:

Size of the grid.

Return type:

int

get_grid_spacing(grid, spacing)#

Get the row and column spacing of a structured grid.

get_grid_type(grid)#

Get the type of grid.

get_grid_x(grid, x)#

Get coordinates of grid nodes in the x direction.

Parameters:
  • grid (int) – A grid identifier.

  • x (ndarray of float, shape (nrows,)) – A numpy array to hold the x-coordinates of the grid node columns.

Returns:

The input numpy array that holds the grid’s column x-coordinates.

Return type:

ndarray of float

get_grid_y(grid, y)#

Get coordinates of grid nodes in the y direction.

Parameters:
  • grid (int) – A grid identifier.

  • y (ndarray of float, shape (ncols,)) – A numpy array to hold the y-coordinates of the grid node rows.

Returns:

The input numpy array that holds the grid’s row y-coordinates.

Return type:

ndarray of float

get_grid_z(grid, z)#

Get coordinates of grid nodes in the z direction.

Parameters:
  • grid (int) – A grid identifier.

  • z (ndarray of float, shape (nlayers,)) – A numpy array to hold the z-coordinates of the grid nodes layers.

Returns:

The input numpy array that holds the grid’s layer z-coordinates.

Return type:

ndarray of float

get_input_item_count()#

Count of a model’s input variables.

Returns:

The number of input variables.

Return type:

int

get_input_var_names()#

Names of the input exchange items.

get_output_item_count()#

Count of a model’s output variables.

Returns:

The number of output variables.

Return type:

int

get_output_var_names()#

Names of the output exchange items.

get_start_time()#

Start time of the component.

get_time_step()#

Component time step.

get_time_units()#

Time units used by the component.

get_value(name, dest)#

Get a copy of a variable’s data.

get_value_at_indices(name, dest, inds)#

Get values at particular indices.

Parameters:
  • name (str) – An input or output variable name, a CSDMS Standard Name.

  • dest (ndarray) – A numpy array into which to place the values.

  • inds (array_like) – The indices into the variable array.

Returns:

Value of the model variable at the given location.

Return type:

array_like

get_value_ptr(name)#

Get a reference to values of the given variable.

This is a getter for the model, used to access the model’s current state. It returns a reference to a model variable, with the return type, size and rank dependent on the variable.

Parameters:

name (str) – An input or output variable name, a CSDMS Standard Name.

Returns:

A reference to a model variable.

Return type:

array_like

get_value_ref(name)#

Get a reference to a variable’s data.

get_var_grid(name)#

Get the grid id for a variable.

get_var_itemsize(name)#

Get the size of elements of a variable.

get_var_location(name)#

Get the grid element type that the a given variable is defined on.

The grid topology can be composed of nodes, edges, and faces.

node

A point that has a coordinate pair or triplet: the most basic element of the topology.

edge

A line or curve bounded by two nodes.

face

A plane or surface enclosed by a set of edges. In a 2D horizontal application one may consider the word “polygon”, but in the hierarchy of elements the word “face” is most common.

Parameters:

name (str) – An input or output variable name, a CSDMS Standard Name.

Returns:

The grid location on which the variable is defined. Must be one of “node”, “edge”, or “face”.

Return type:

str

Notes

CSDMS uses the ugrid conventions to define unstructured grids.

get_var_nbytes(name)#

Get the total number of bytes used by a variable.

get_var_type(name)#

Get the data type for a variable.

get_var_units(name)#

Get the unit used by a variable.

initialize(config_file)#

Initialize the component from a file.

BMI-wrapped Landlab components use input files in YAML format. Component-specific parameters are listed at the top level, followed by grid and then time information. An example input file looks like:

flexure:
    eet: 15.e+3
clock:
    start: 0
    stop: 100.
    step: 2.
grid:
    type: raster
    shape: [20, 40]
    spacing: [1000., 2000.]

In this case, a RasterModelGrid is created (with the given shape and spacing) and passed to the underlying landlab component. The eet=15000. is also given to the component but as a keyword parameter. The BMI clock is initialized with the given parameters.

Parameters:

config_file (str or file_like) – YAML-formatted input file for the component.

set_value(name, values)#

Set the values of a variable.

set_value_at_indices(name, inds, src)#

Specify a new value for a model variable at particular indices.

Parameters:
  • name (str) – An input or output variable name, a CSDMS Standard Name.

  • inds (array_like) – The indices into the variable array.

  • src (array_like) – The new value for the specified variable.

update()#

Update the component one time step.

update_frac(frac)#

Update the component a fraction of a time step.

update_until(then)#

Update the component until a given time.

class ChiFinderBMI#

Bases: Bmi

Basic Modeling Interface for the ChiFinder component.

finalize()#

Clean-up the component.

get_component_name()#

Name of the component.

get_current_time()#

Current component time.

get_end_time()#

Stop time for the component.

get_grid_edge_count(grid)#

Get the number of edges in the grid.

Parameters:

grid (int) – A grid identifier.

Returns:

The total number of grid edges.

Return type:

int

get_grid_edge_nodes(grid, edge_nodes)#

Get the edge-node connectivity.

Parameters:
  • grid (int) – A grid identifier.

  • edge_nodes (ndarray of int, shape (2 x nnodes,)) – A numpy array to place the edge-node connectivity. For each edge, connectivity is given as node at edge tail, followed by node at edge head.

Returns:

The input numpy array that holds the edge-node connectivity.

Return type:

ndarray of int

get_grid_face_count(grid)#

Get the number of faces in the grid.

Parameters:

grid (int) – A grid identifier.

Returns:

The total number of grid faces.

Return type:

int

get_grid_face_edges(grid)#

Get the face-edge connectivity.

Parameters:
  • grid (int) – A grid identifier.

  • face_edges (ndarray of int) – A numpy array to place the face-edge connectivity.

Returns:

The input numpy array that holds the face-edge connectivity.

Return type:

ndarray of int

get_grid_face_nodes(grid, face_nodes)#

Get the face-node connectivity.

Parameters:
  • grid (int) – A grid identifier.

  • face_nodes (ndarray of int) – A numpy array to place the face-node connectivity. For each face, the nodes (listed in a counter-clockwise direction) that form the boundary of the face.

Returns:

The input numpy array that holds the face-node connectivity.

Return type:

ndarray of int

get_grid_node_count(grid)#

Get the number of nodes in the grid.

Parameters:

grid (int) – A grid identifier.

Returns:

The total number of grid nodes.

Return type:

int

get_grid_nodes_per_face(grid, nodes_per_face)#

Get the number of nodes for each face.

Parameters:
  • grid (int) – A grid identifier.

  • nodes_per_face (ndarray of int, shape (nfaces,)) – A numpy array to place the number of nodes per face.

Returns:

The input numpy array that holds the number of nodes per face.

Return type:

ndarray of int

get_grid_origin(grid, origin)#

Get the origin for a structured grid.

get_grid_rank(grid)#

Get the number of dimensions of a grid.

get_grid_shape(grid, shape)#

Get the shape of a structured grid.

get_grid_size(grid)#

Get the total number of elements in the computational grid.

Parameters:

grid (int) – A grid identifier.

Returns:

Size of the grid.

Return type:

int

get_grid_spacing(grid, spacing)#

Get the row and column spacing of a structured grid.

get_grid_type(grid)#

Get the type of grid.

get_grid_x(grid, x)#

Get coordinates of grid nodes in the x direction.

Parameters:
  • grid (int) – A grid identifier.

  • x (ndarray of float, shape (nrows,)) – A numpy array to hold the x-coordinates of the grid node columns.

Returns:

The input numpy array that holds the grid’s column x-coordinates.

Return type:

ndarray of float

get_grid_y(grid, y)#

Get coordinates of grid nodes in the y direction.

Parameters:
  • grid (int) – A grid identifier.

  • y (ndarray of float, shape (ncols,)) – A numpy array to hold the y-coordinates of the grid node rows.

Returns:

The input numpy array that holds the grid’s row y-coordinates.

Return type:

ndarray of float

get_grid_z(grid, z)#

Get coordinates of grid nodes in the z direction.

Parameters:
  • grid (int) – A grid identifier.

  • z (ndarray of float, shape (nlayers,)) – A numpy array to hold the z-coordinates of the grid nodes layers.

Returns:

The input numpy array that holds the grid’s layer z-coordinates.

Return type:

ndarray of float

get_input_item_count()#

Count of a model’s input variables.

Returns:

The number of input variables.

Return type:

int

get_input_var_names()#

Names of the input exchange items.

get_output_item_count()#

Count of a model’s output variables.

Returns:

The number of output variables.

Return type:

int

get_output_var_names()#

Names of the output exchange items.

get_start_time()#

Start time of the component.

get_time_step()#

Component time step.

get_time_units()#

Time units used by the component.

get_value(name, dest)#

Get a copy of a variable’s data.

get_value_at_indices(name, dest, inds)#

Get values at particular indices.

Parameters:
  • name (str) – An input or output variable name, a CSDMS Standard Name.

  • dest (ndarray) – A numpy array into which to place the values.

  • inds (array_like) – The indices into the variable array.

Returns:

Value of the model variable at the given location.

Return type:

array_like

get_value_ptr(name)#

Get a reference to values of the given variable.

This is a getter for the model, used to access the model’s current state. It returns a reference to a model variable, with the return type, size and rank dependent on the variable.

Parameters:

name (str) – An input or output variable name, a CSDMS Standard Name.

Returns:

A reference to a model variable.

Return type:

array_like

get_value_ref(name)#

Get a reference to a variable’s data.

get_var_grid(name)#

Get the grid id for a variable.

get_var_itemsize(name)#

Get the size of elements of a variable.

get_var_location(name)#

Get the grid element type that the a given variable is defined on.

The grid topology can be composed of nodes, edges, and faces.

node

A point that has a coordinate pair or triplet: the most basic element of the topology.

edge

A line or curve bounded by two nodes.

face

A plane or surface enclosed by a set of edges. In a 2D horizontal application one may consider the word “polygon”, but in the hierarchy of elements the word “face” is most common.

Parameters:

name (str) – An input or output variable name, a CSDMS Standard Name.

Returns:

The grid location on which the variable is defined. Must be one of “node”, “edge”, or “face”.

Return type:

str

Notes

CSDMS uses the ugrid conventions to define unstructured grids.

get_var_nbytes(name)#

Get the total number of bytes used by a variable.

get_var_type(name)#

Get the data type for a variable.

get_var_units(name)#

Get the unit used by a variable.

initialize(config_file)#

Initialize the component from a file.

BMI-wrapped Landlab components use input files in YAML format. Component-specific parameters are listed at the top level, followed by grid and then time information. An example input file looks like:

flexure:
    eet: 15.e+3
clock:
    start: 0
    stop: 100.
    step: 2.
grid:
    type: raster
    shape: [20, 40]
    spacing: [1000., 2000.]

In this case, a RasterModelGrid is created (with the given shape and spacing) and passed to the underlying landlab component. The eet=15000. is also given to the component but as a keyword parameter. The BMI clock is initialized with the given parameters.

Parameters:

config_file (str or file_like) – YAML-formatted input file for the component.

set_value(name, values)#

Set the values of a variable.

set_value_at_indices(name, inds, src)#

Specify a new value for a model variable at particular indices.

Parameters:
  • name (str) – An input or output variable name, a CSDMS Standard Name.

  • inds (array_like) – The indices into the variable array.

  • src (array_like) – The new value for the specified variable.

update()#

Update the component one time step.

update_frac(frac)#

Update the component a fraction of a time step.

update_until(then)#

Update the component until a given time.

class ConcentrationTrackerForDiffusionBMI#

Bases: Bmi

Basic Modeling Interface for the ConcentrationTrackerForDiffusion component.

finalize()#

Clean-up the component.

get_component_name()#

Name of the component.

get_current_time()#

Current component time.

get_end_time()#

Stop time for the component.

get_grid_edge_count(grid)#

Get the number of edges in the grid.

Parameters:

grid (int) – A grid identifier.

Returns:

The total number of grid edges.

Return type:

int

get_grid_edge_nodes(grid, edge_nodes)#

Get the edge-node connectivity.

Parameters:
  • grid (int) – A grid identifier.

  • edge_nodes (ndarray of int, shape (2 x nnodes,)) – A numpy array to place the edge-node connectivity. For each edge, connectivity is given as node at edge tail, followed by node at edge head.

Returns:

The input numpy array that holds the edge-node connectivity.

Return type:

ndarray of int

get_grid_face_count(grid)#

Get the number of faces in the grid.

Parameters:

grid (int) – A grid identifier.

Returns:

The total number of grid faces.

Return type:

int

get_grid_face_edges(grid)#

Get the face-edge connectivity.

Parameters:
  • grid (int) – A grid identifier.

  • face_edges (ndarray of int) – A numpy array to place the face-edge connectivity.

Returns:

The input numpy array that holds the face-edge connectivity.

Return type:

ndarray of int

get_grid_face_nodes(grid, face_nodes)#

Get the face-node connectivity.

Parameters:
  • grid (int) – A grid identifier.

  • face_nodes (ndarray of int) – A numpy array to place the face-node connectivity. For each face, the nodes (listed in a counter-clockwise direction) that form the boundary of the face.

Returns:

The input numpy array that holds the face-node connectivity.

Return type:

ndarray of int

get_grid_node_count(grid)#

Get the number of nodes in the grid.

Parameters:

grid (int) – A grid identifier.

Returns:

The total number of grid nodes.

Return type:

int

get_grid_nodes_per_face(grid, nodes_per_face)#

Get the number of nodes for each face.

Parameters:
  • grid (int) – A grid identifier.

  • nodes_per_face (ndarray of int, shape (nfaces,)) – A numpy array to place the number of nodes per face.

Returns:

The input numpy array that holds the number of nodes per face.

Return type:

ndarray of int

get_grid_origin(grid, origin)#

Get the origin for a structured grid.

get_grid_rank(grid)#

Get the number of dimensions of a grid.

get_grid_shape(grid, shape)#

Get the shape of a structured grid.

get_grid_size(grid)#

Get the total number of elements in the computational grid.

Parameters:

grid (int) – A grid identifier.

Returns:

Size of the grid.

Return type:

int

get_grid_spacing(grid, spacing)#

Get the row and column spacing of a structured grid.

get_grid_type(grid)#

Get the type of grid.

get_grid_x(grid, x)#

Get coordinates of grid nodes in the x direction.

Parameters:
  • grid (int) – A grid identifier.

  • x (ndarray of float, shape (nrows,)) – A numpy array to hold the x-coordinates of the grid node columns.

Returns:

The input numpy array that holds the grid’s column x-coordinates.

Return type:

ndarray of float

get_grid_y(grid, y)#

Get coordinates of grid nodes in the y direction.

Parameters:
  • grid (int) – A grid identifier.

  • y (ndarray of float, shape (ncols,)) – A numpy array to hold the y-coordinates of the grid node rows.

Returns:

The input numpy array that holds the grid’s row y-coordinates.

Return type:

ndarray of float

get_grid_z(grid, z)#

Get coordinates of grid nodes in the z direction.

Parameters:
  • grid (int) – A grid identifier.

  • z (ndarray of float, shape (nlayers,)) – A numpy array to hold the z-coordinates of the grid nodes layers.

Returns:

The input numpy array that holds the grid’s layer z-coordinates.

Return type:

ndarray of float

get_input_item_count()#

Count of a model’s input variables.

Returns:

The number of input variables.

Return type:

int

get_input_var_names()#

Names of the input exchange items.

get_output_item_count()#

Count of a model’s output variables.

Returns:

The number of output variables.

Return type:

int

get_output_var_names()#

Names of the output exchange items.

get_start_time()#

Start time of the component.

get_time_step()#

Component time step.

get_time_units()#

Time units used by the component.

get_value(name, dest)#

Get a copy of a variable’s data.

get_value_at_indices(name, dest, inds)#

Get values at particular indices.

Parameters:
  • name (str) – An input or output variable name, a CSDMS Standard Name.

  • dest (ndarray) – A numpy array into which to place the values.

  • inds (array_like) – The indices into the variable array.

Returns:

Value of the model variable at the given location.

Return type:

array_like

get_value_ptr(name)#

Get a reference to values of the given variable.

This is a getter for the model, used to access the model’s current state. It returns a reference to a model variable, with the return type, size and rank dependent on the variable.

Parameters:

name (str) – An input or output variable name, a CSDMS Standard Name.

Returns:

A reference to a model variable.

Return type:

array_like

get_value_ref(name)#

Get a reference to a variable’s data.

get_var_grid(name)#

Get the grid id for a variable.

get_var_itemsize(name)#

Get the size of elements of a variable.

get_var_location(name)#

Get the grid element type that the a given variable is defined on.

The grid topology can be composed of nodes, edges, and faces.

node

A point that has a coordinate pair or triplet: the most basic element of the topology.

edge

A line or curve bounded by two nodes.

face

A plane or surface enclosed by a set of edges. In a 2D horizontal application one may consider the word “polygon”, but in the hierarchy of elements the word “face” is most common.

Parameters:

name (str) – An input or output variable name, a CSDMS Standard Name.

Returns:

The grid location on which the variable is defined. Must be one of “node”, “edge”, or “face”.

Return type:

str

Notes

CSDMS uses the ugrid conventions to define unstructured grids.

get_var_nbytes(name)#

Get the total number of bytes used by a variable.

get_var_type(name)#

Get the data type for a variable.

get_var_units(name)#

Get the unit used by a variable.

initialize(config_file)#

Initialize the component from a file.

BMI-wrapped Landlab components use input files in YAML format. Component-specific parameters are listed at the top level, followed by grid and then time information. An example input file looks like:

flexure:
    eet: 15.e+3
clock:
    start: 0
    stop: 100.
    step: 2.
grid:
    type: raster
    shape: [20, 40]
    spacing: [1000., 2000.]

In this case, a RasterModelGrid is created (with the given shape and spacing) and passed to the underlying landlab component. The eet=15000. is also given to the component but as a keyword parameter. The BMI clock is initialized with the given parameters.

Parameters:

config_file (str or file_like) – YAML-formatted input file for the component.

set_value(name, values)#

Set the values of a variable.

set_value_at_indices(name, inds, src)#

Specify a new value for a model variable at particular indices.

Parameters:
  • name (str) – An input or output variable name, a CSDMS Standard Name.

  • inds (array_like) – The indices into the variable array.

  • src (array_like) – The new value for the specified variable.

update()#

Update the component one time step.

update_frac(frac)#

Update the component a fraction of a time step.

update_until(then)#

Update the component until a given time.

class DepressionFinderAndRouterBMI#

Bases: Bmi

Basic Modeling Interface for the DepressionFinderAndRouter component.

finalize()#

Clean-up the component.

get_component_name()#

Name of the component.

get_current_time()#

Current component time.

get_end_time()#

Stop time for the component.

get_grid_edge_count(grid)#

Get the number of edges in the grid.

Parameters:

grid (int) – A grid identifier.

Returns:

The total number of grid edges.

Return type:

int

get_grid_edge_nodes(grid, edge_nodes)#

Get the edge-node connectivity.

Parameters:
  • grid (int) – A grid identifier.

  • edge_nodes (ndarray of int, shape (2 x nnodes,)) – A numpy array to place the edge-node connectivity. For each edge, connectivity is given as node at edge tail, followed by node at edge head.

Returns:

The input numpy array that holds the edge-node connectivity.

Return type:

ndarray of int

get_grid_face_count(grid)#

Get the number of faces in the grid.

Parameters:

grid (int) – A grid identifier.

Returns:

The total number of grid faces.

Return type:

int

get_grid_face_edges(grid)#

Get the face-edge connectivity.

Parameters:
  • grid (int) – A grid identifier.

  • face_edges (ndarray of int) – A numpy array to place the face-edge connectivity.

Returns:

The input numpy array that holds the face-edge connectivity.

Return type:

ndarray of int

get_grid_face_nodes(grid, face_nodes)#

Get the face-node connectivity.

Parameters:
  • grid (int) – A grid identifier.

  • face_nodes (ndarray of int) – A numpy array to place the face-node connectivity. For each face, the nodes (listed in a counter-clockwise direction) that form the boundary of the face.

Returns:

The input numpy array that holds the face-node connectivity.

Return type:

ndarray of int

get_grid_node_count(grid)#

Get the number of nodes in the grid.

Parameters:

grid (int) – A grid identifier.

Returns:

The total number of grid nodes.

Return type:

int

get_grid_nodes_per_face(grid, nodes_per_face)#

Get the number of nodes for each face.

Parameters:
  • grid (int) – A grid identifier.

  • nodes_per_face (ndarray of int, shape (nfaces,)) – A numpy array to place the number of nodes per face.

Returns:

The input numpy array that holds the number of nodes per face.

Return type:

ndarray of int

get_grid_origin(grid, origin)#

Get the origin for a structured grid.

get_grid_rank(grid)#

Get the number of dimensions of a grid.

get_grid_shape(grid, shape)#

Get the shape of a structured grid.

get_grid_size(grid)#

Get the total number of elements in the computational grid.

Parameters:

grid (int) – A grid identifier.

Returns:

Size of the grid.

Return type:

int

get_grid_spacing(grid, spacing)#

Get the row and column spacing of a structured grid.

get_grid_type(grid)#

Get the type of grid.

get_grid_x(grid, x)#

Get coordinates of grid nodes in the x direction.

Parameters:
  • grid (int) – A grid identifier.

  • x (ndarray of float, shape (nrows,)) – A numpy array to hold the x-coordinates of the grid node columns.

Returns:

The input numpy array that holds the grid’s column x-coordinates.

Return type:

ndarray of float

get_grid_y(grid, y)#

Get coordinates of grid nodes in the y direction.

Parameters:
  • grid (int) – A grid identifier.

  • y (ndarray of float, shape (ncols,)) – A numpy array to hold the y-coordinates of the grid node rows.

Returns:

The input numpy array that holds the grid’s row y-coordinates.

Return type:

ndarray of float

get_grid_z(grid, z)#

Get coordinates of grid nodes in the z direction.

Parameters:
  • grid (int) – A grid identifier.

  • z (ndarray of float, shape (nlayers,)) – A numpy array to hold the z-coordinates of the grid nodes layers.

Returns:

The input numpy array that holds the grid’s layer z-coordinates.

Return type:

ndarray of float

get_input_item_count()#

Count of a model’s input variables.

Returns:

The number of input variables.

Return type:

int

get_input_var_names()#

Names of the input exchange items.

get_output_item_count()#

Count of a model’s output variables.

Returns:

The number of output variables.

Return type:

int

get_output_var_names()#

Names of the output exchange items.

get_start_time()#

Start time of the component.

get_time_step()#

Component time step.

get_time_units()#

Time units used by the component.

get_value(name, dest)#

Get a copy of a variable’s data.

get_value_at_indices(name, dest, inds)#

Get values at particular indices.

Parameters:
  • name (str) – An input or output variable name, a CSDMS Standard Name.

  • dest (ndarray) – A numpy array into which to place the values.

  • inds (array_like) – The indices into the variable array.

Returns:

Value of the model variable at the given location.

Return type:

array_like

get_value_ptr(name)#

Get a reference to values of the given variable.

This is a getter for the model, used to access the model’s current state. It returns a reference to a model variable, with the return type, size and rank dependent on the variable.

Parameters:

name (str) – An input or output variable name, a CSDMS Standard Name.

Returns:

A reference to a model variable.

Return type:

array_like

get_value_ref(name)#

Get a reference to a variable’s data.

get_var_grid(name)#

Get the grid id for a variable.

get_var_itemsize(name)#

Get the size of elements of a variable.

get_var_location(name)#

Get the grid element type that the a given variable is defined on.

The grid topology can be composed of nodes, edges, and faces.

node

A point that has a coordinate pair or triplet: the most basic element of the topology.

edge

A line or curve bounded by two nodes.

face

A plane or surface enclosed by a set of edges. In a 2D horizontal application one may consider the word “polygon”, but in the hierarchy of elements the word “face” is most common.

Parameters:

name (str) – An input or output variable name, a CSDMS Standard Name.

Returns:

The grid location on which the variable is defined. Must be one of “node”, “edge”, or “face”.

Return type:

str

Notes

CSDMS uses the ugrid conventions to define unstructured grids.

get_var_nbytes(name)#

Get the total number of bytes used by a variable.

get_var_type(name)#

Get the data type for a variable.

get_var_units(name)#

Get the unit used by a variable.

initialize(config_file)#

Initialize the component from a file.

BMI-wrapped Landlab components use input files in YAML format. Component-specific parameters are listed at the top level, followed by grid and then time information. An example input file looks like:

flexure:
    eet: 15.e+3
clock:
    start: 0
    stop: 100.
    step: 2.
grid:
    type: raster
    shape: [20, 40]
    spacing: [1000., 2000.]

In this case, a RasterModelGrid is created (with the given shape and spacing) and passed to the underlying landlab component. The eet=15000. is also given to the component but as a keyword parameter. The BMI clock is initialized with the given parameters.

Parameters:

config_file (str or file_like) – YAML-formatted input file for the component.

set_value(name, values)#

Set the values of a variable.

set_value_at_indices(name, inds, src)#

Specify a new value for a model variable at particular indices.

Parameters:
  • name (str) – An input or output variable name, a CSDMS Standard Name.

  • inds (array_like) – The indices into the variable array.

  • src (array_like) – The new value for the specified variable.

update()#

Update the component one time step.

update_frac(frac)#

Update the component a fraction of a time step.

update_until(then)#

Update the component until a given time.

class DepthDependentDiffuserBMI#

Bases: Bmi

Basic Modeling Interface for the DepthDependentDiffuser component.

finalize()#

Clean-up the component.

get_component_name()#

Name of the component.

get_current_time()#

Current component time.

get_end_time()#

Stop time for the component.

get_grid_edge_count(grid)#

Get the number of edges in the grid.

Parameters:

grid (int) – A grid identifier.

Returns:

The total number of grid edges.

Return type:

int

get_grid_edge_nodes(grid, edge_nodes)#

Get the edge-node connectivity.

Parameters:
  • grid (int) – A grid identifier.

  • edge_nodes (ndarray of int, shape (2 x nnodes,)) – A numpy array to place the edge-node connectivity. For each edge, connectivity is given as node at edge tail, followed by node at edge head.

Returns:

The input numpy array that holds the edge-node connectivity.

Return type:

ndarray of int

get_grid_face_count(grid)#

Get the number of faces in the grid.

Parameters:

grid (int) – A grid identifier.

Returns:

The total number of grid faces.

Return type:

int

get_grid_face_edges(grid)#

Get the face-edge connectivity.

Parameters:
  • grid (int) – A grid identifier.

  • face_edges (ndarray of int) – A numpy array to place the face-edge connectivity.

Returns:

The input numpy array that holds the face-edge connectivity.

Return type:

ndarray of int

get_grid_face_nodes(grid, face_nodes)#

Get the face-node connectivity.

Parameters:
  • grid (int) – A grid identifier.

  • face_nodes (ndarray of int) – A numpy array to place the face-node connectivity. For each face, the nodes (listed in a counter-clockwise direction) that form the boundary of the face.

Returns:

The input numpy array that holds the face-node connectivity.

Return type:

ndarray of int

get_grid_node_count(grid)#

Get the number of nodes in the grid.

Parameters:

grid (int) – A grid identifier.

Returns:

The total number of grid nodes.

Return type:

int

get_grid_nodes_per_face(grid, nodes_per_face)#

Get the number of nodes for each face.

Parameters:
  • grid (int) – A grid identifier.

  • nodes_per_face (ndarray of int, shape (nfaces,)) – A numpy array to place the number of nodes per face.

Returns:

The input numpy array that holds the number of nodes per face.

Return type:

ndarray of int

get_grid_origin(grid, origin)#

Get the origin for a structured grid.

get_grid_rank(grid)#

Get the number of dimensions of a grid.

get_grid_shape(grid, shape)#

Get the shape of a structured grid.

get_grid_size(grid)#

Get the total number of elements in the computational grid.

Parameters:

grid (int) – A grid identifier.

Returns:

Size of the grid.

Return type:

int

get_grid_spacing(grid, spacing)#

Get the row and column spacing of a structured grid.

get_grid_type(grid)#

Get the type of grid.

get_grid_x(grid, x)#

Get coordinates of grid nodes in the x direction.

Parameters:
  • grid (int) – A grid identifier.

  • x (ndarray of float, shape (nrows,)) – A numpy array to hold the x-coordinates of the grid node columns.

Returns:

The input numpy array that holds the grid’s column x-coordinates.

Return type:

ndarray of float

get_grid_y(grid, y)#

Get coordinates of grid nodes in the y direction.

Parameters:
  • grid (int) – A grid identifier.

  • y (ndarray of float, shape (ncols,)) – A numpy array to hold the y-coordinates of the grid node rows.

Returns:

The input numpy array that holds the grid’s row y-coordinates.

Return type:

ndarray of float

get_grid_z(grid, z)#

Get coordinates of grid nodes in the z direction.

Parameters:
  • grid (int) – A grid identifier.

  • z (ndarray of float, shape (nlayers,)) – A numpy array to hold the z-coordinates of the grid nodes layers.

Returns:

The input numpy array that holds the grid’s layer z-coordinates.

Return type:

ndarray of float

get_input_item_count()#

Count of a model’s input variables.

Returns:

The number of input variables.

Return type:

int

get_input_var_names()#

Names of the input exchange items.

get_output_item_count()#

Count of a model’s output variables.

Returns:

The number of output variables.

Return type:

int

get_output_var_names()#

Names of the output exchange items.

get_start_time()#

Start time of the component.

get_time_step()#

Component time step.

get_time_units()#

Time units used by the component.

get_value(name, dest)#

Get a copy of a variable’s data.

get_value_at_indices(name, dest, inds)#

Get values at particular indices.

Parameters:
  • name (str) – An input or output variable name, a CSDMS Standard Name.

  • dest (ndarray) – A numpy array into which to place the values.

  • inds (array_like) – The indices into the variable array.

Returns:

Value of the model variable at the given location.

Return type:

array_like

get_value_ptr(name)#

Get a reference to values of the given variable.

This is a getter for the model, used to access the model’s current state. It returns a reference to a model variable, with the return type, size and rank dependent on the variable.

Parameters:

name (str) – An input or output variable name, a CSDMS Standard Name.

Returns:

A reference to a model variable.

Return type:

array_like

get_value_ref(name)#

Get a reference to a variable’s data.

get_var_grid(name)#

Get the grid id for a variable.

get_var_itemsize(name)#

Get the size of elements of a variable.

get_var_location(name)#

Get the grid element type that the a given variable is defined on.

The grid topology can be composed of nodes, edges, and faces.

node

A point that has a coordinate pair or triplet: the most basic element of the topology.

edge

A line or curve bounded by two nodes.

face

A plane or surface enclosed by a set of edges. In a 2D horizontal application one may consider the word “polygon”, but in the hierarchy of elements the word “face” is most common.

Parameters:

name (str) – An input or output variable name, a CSDMS Standard Name.

Returns:

The grid location on which the variable is defined. Must be one of “node”, “edge”, or “face”.

Return type:

str

Notes

CSDMS uses the ugrid conventions to define unstructured grids.

get_var_nbytes(name)#

Get the total number of bytes used by a variable.

get_var_type(name)#

Get the data type for a variable.

get_var_units(name)#

Get the unit used by a variable.

initialize(config_file)#

Initialize the component from a file.

BMI-wrapped Landlab components use input files in YAML format. Component-specific parameters are listed at the top level, followed by grid and then time information. An example input file looks like:

flexure:
    eet: 15.e+3
clock:
    start: 0
    stop: 100.
    step: 2.
grid:
    type: raster
    shape: [20, 40]
    spacing: [1000., 2000.]

In this case, a RasterModelGrid is created (with the given shape and spacing) and passed to the underlying landlab component. The eet=15000. is also given to the component but as a keyword parameter. The BMI clock is initialized with the given parameters.

Parameters:

config_file (str or file_like) – YAML-formatted input file for the component.

set_value(name, values)#

Set the values of a variable.

set_value_at_indices(name, inds, src)#

Specify a new value for a model variable at particular indices.

Parameters:
  • name (str) – An input or output variable name, a CSDMS Standard Name.

  • inds (array_like) – The indices into the variable array.

  • src (array_like) – The new value for the specified variable.

update()#

Update the component one time step.

update_frac(frac)#

Update the component a fraction of a time step.

update_until(then)#

Update the component until a given time.

class DepthDependentTaylorDiffuserBMI#

Bases: Bmi

Basic Modeling Interface for the DepthDependentTaylorDiffuser component.

finalize()#

Clean-up the component.

get_component_name()#

Name of the component.

get_current_time()#

Current component time.

get_end_time()#

Stop time for the component.

get_grid_edge_count(grid)#

Get the number of edges in the grid.

Parameters:

grid (int) – A grid identifier.

Returns:

The total number of grid edges.

Return type:

int

get_grid_edge_nodes(grid, edge_nodes)#

Get the edge-node connectivity.

Parameters:
  • grid (int) – A grid identifier.

  • edge_nodes (ndarray of int, shape (2 x nnodes,)) – A numpy array to place the edge-node connectivity. For each edge, connectivity is given as node at edge tail, followed by node at edge head.

Returns:

The input numpy array that holds the edge-node connectivity.

Return type:

ndarray of int

get_grid_face_count(grid)#

Get the number of faces in the grid.

Parameters:

grid (int) – A grid identifier.

Returns:

The total number of grid faces.

Return type:

int

get_grid_face_edges(grid)#

Get the face-edge connectivity.

Parameters:
  • grid (int) – A grid identifier.

  • face_edges (ndarray of int) – A numpy array to place the face-edge connectivity.

Returns:

The input numpy array that holds the face-edge connectivity.

Return type:

ndarray of int

get_grid_face_nodes(grid, face_nodes)#

Get the face-node connectivity.

Parameters:
  • grid (int) – A grid identifier.

  • face_nodes (ndarray of int) – A numpy array to place the face-node connectivity. For each face, the nodes (listed in a counter-clockwise direction) that form the boundary of the face.

Returns:

The input numpy array that holds the face-node connectivity.

Return type:

ndarray of int

get_grid_node_count(grid)#

Get the number of nodes in the grid.

Parameters:

grid (int) – A grid identifier.

Returns:

The total number of grid nodes.

Return type:

int

get_grid_nodes_per_face(grid, nodes_per_face)#

Get the number of nodes for each face.

Parameters:
  • grid (int) – A grid identifier.

  • nodes_per_face (ndarray of int, shape (nfaces,)) – A numpy array to place the number of nodes per face.

Returns:

The input numpy array that holds the number of nodes per face.

Return type:

ndarray of int

get_grid_origin(grid, origin)#

Get the origin for a structured grid.

get_grid_rank(grid)#

Get the number of dimensions of a grid.

get_grid_shape(grid, shape)#

Get the shape of a structured grid.

get_grid_size(grid)#

Get the total number of elements in the computational grid.

Parameters:

grid (int) – A grid identifier.

Returns:

Size of the grid.

Return type:

int

get_grid_spacing(grid, spacing)#

Get the row and column spacing of a structured grid.

get_grid_type(grid)#

Get the type of grid.

get_grid_x(grid, x)#

Get coordinates of grid nodes in the x direction.

Parameters:
  • grid (int) – A grid identifier.

  • x (ndarray of float, shape (nrows,)) – A numpy array to hold the x-coordinates of the grid node columns.

Returns:

The input numpy array that holds the grid’s column x-coordinates.

Return type:

ndarray of float

get_grid_y(grid, y)#

Get coordinates of grid nodes in the y direction.

Parameters:
  • grid (int) – A grid identifier.

  • y (ndarray of float, shape (ncols,)) – A numpy array to hold the y-coordinates of the grid node rows.

Returns:

The input numpy array that holds the grid’s row y-coordinates.

Return type:

ndarray of float

get_grid_z(grid, z)#

Get coordinates of grid nodes in the z direction.

Parameters:
  • grid (int) – A grid identifier.

  • z (ndarray of float, shape (nlayers,)) – A numpy array to hold the z-coordinates of the grid nodes layers.

Returns:

The input numpy array that holds the grid’s layer z-coordinates.

Return type:

ndarray of float

get_input_item_count()#

Count of a model’s input variables.

Returns:

The number of input variables.

Return type:

int

get_input_var_names()#

Names of the input exchange items.

get_output_item_count()#

Count of a model’s output variables.

Returns:

The number of output variables.

Return type:

int

get_output_var_names()#

Names of the output exchange items.

get_start_time()#

Start time of the component.

get_time_step()#

Component time step.

get_time_units()#

Time units used by the component.

get_value(name, dest)#

Get a copy of a variable’s data.

get_value_at_indices(name, dest, inds)#

Get values at particular indices.

Parameters:
  • name (str) – An input or output variable name, a CSDMS Standard Name.

  • dest (ndarray) – A numpy array into which to place the values.

  • inds (array_like) – The indices into the variable array.

Returns:

Value of the model variable at the given location.

Return type:

array_like

get_value_ptr(name)#

Get a reference to values of the given variable.

This is a getter for the model, used to access the model’s current state. It returns a reference to a model variable, with the return type, size and rank dependent on the variable.

Parameters:

name (str) – An input or output variable name, a CSDMS Standard Name.

Returns:

A reference to a model variable.

Return type:

array_like

get_value_ref(name)#

Get a reference to a variable’s data.

get_var_grid(name)#

Get the grid id for a variable.

get_var_itemsize(name)#

Get the size of elements of a variable.

get_var_location(name)#

Get the grid element type that the a given variable is defined on.

The grid topology can be composed of nodes, edges, and faces.

node

A point that has a coordinate pair or triplet: the most basic element of the topology.

edge

A line or curve bounded by two nodes.

face

A plane or surface enclosed by a set of edges. In a 2D horizontal application one may consider the word “polygon”, but in the hierarchy of elements the word “face” is most common.

Parameters:

name (str) – An input or output variable name, a CSDMS Standard Name.

Returns:

The grid location on which the variable is defined. Must be one of “node”, “edge”, or “face”.

Return type:

str

Notes

CSDMS uses the ugrid conventions to define unstructured grids.

get_var_nbytes(name)#

Get the total number of bytes used by a variable.

get_var_type(name)#

Get the data type for a variable.

get_var_units(name)#

Get the unit used by a variable.

initialize(config_file)#

Initialize the component from a file.

BMI-wrapped Landlab components use input files in YAML format. Component-specific parameters are listed at the top level, followed by grid and then time information. An example input file looks like:

flexure:
    eet: 15.e+3
clock:
    start: 0
    stop: 100.
    step: 2.
grid:
    type: raster
    shape: [20, 40]
    spacing: [1000., 2000.]

In this case, a RasterModelGrid is created (with the given shape and spacing) and passed to the underlying landlab component. The eet=15000. is also given to the component but as a keyword parameter. The BMI clock is initialized with the given parameters.

Parameters:

config_file (str or file_like) – YAML-formatted input file for the component.

set_value(name, values)#

Set the values of a variable.

set_value_at_indices(name, inds, src)#

Specify a new value for a model variable at particular indices.

Parameters:
  • name (str) – An input or output variable name, a CSDMS Standard Name.

  • inds (array_like) – The indices into the variable array.

  • src (array_like) – The new value for the specified variable.

update()#

Update the component one time step.

update_frac(frac)#

Update the component a fraction of a time step.

update_until(then)#

Update the component until a given time.

class DepthSlopeProductErosionBMI#

Bases: Bmi

Basic Modeling Interface for the DepthSlopeProductErosion component.

finalize()#

Clean-up the component.

get_component_name()#

Name of the component.

get_current_time()#

Current component time.

get_end_time()#

Stop time for the component.

get_grid_edge_count(grid)#

Get the number of edges in the grid.

Parameters:

grid (int) – A grid identifier.

Returns:

The total number of grid edges.

Return type:

int

get_grid_edge_nodes(grid, edge_nodes)#

Get the edge-node connectivity.

Parameters:
  • grid (int) – A grid identifier.

  • edge_nodes (ndarray of int, shape (2 x nnodes,)) – A numpy array to place the edge-node connectivity. For each edge, connectivity is given as node at edge tail, followed by node at edge head.

Returns:

The input numpy array that holds the edge-node connectivity.

Return type:

ndarray of int

get_grid_face_count(grid)#

Get the number of faces in the grid.

Parameters:

grid (int) – A grid identifier.

Returns:

The total number of grid faces.

Return type:

int

get_grid_face_edges(grid)#

Get the face-edge connectivity.

Parameters:
  • grid (int) – A grid identifier.

  • face_edges (ndarray of int) – A numpy array to place the face-edge connectivity.

Returns:

The input numpy array that holds the face-edge connectivity.

Return type:

ndarray of int

get_grid_face_nodes(grid, face_nodes)#

Get the face-node connectivity.

Parameters:
  • grid (int) – A grid identifier.

  • face_nodes (ndarray of int) – A numpy array to place the face-node connectivity. For each face, the nodes (listed in a counter-clockwise direction) that form the boundary of the face.

Returns:

The input numpy array that holds the face-node connectivity.

Return type:

ndarray of int

get_grid_node_count(grid)#

Get the number of nodes in the grid.

Parameters:

grid (int) – A grid identifier.

Returns:

The total number of grid nodes.

Return type:

int

get_grid_nodes_per_face(grid, nodes_per_face)#

Get the number of nodes for each face.

Parameters:
  • grid (int) – A grid identifier.

  • nodes_per_face (ndarray of int, shape (nfaces,)) – A numpy array to place the number of nodes per face.

Returns:

The input numpy array that holds the number of nodes per face.

Return type:

ndarray of int

get_grid_origin(grid, origin)#

Get the origin for a structured grid.

get_grid_rank(grid)#

Get the number of dimensions of a grid.

get_grid_shape(grid, shape)#

Get the shape of a structured grid.

get_grid_size(grid)#

Get the total number of elements in the computational grid.

Parameters:

grid (int) – A grid identifier.

Returns:

Size of the grid.

Return type:

int

get_grid_spacing(grid, spacing)#

Get the row and column spacing of a structured grid.

get_grid_type(grid)#

Get the type of grid.

get_grid_x(grid, x)#

Get coordinates of grid nodes in the x direction.

Parameters:
  • grid (int) – A grid identifier.

  • x (ndarray of float, shape (nrows,)) – A numpy array to hold the x-coordinates of the grid node columns.

Returns:

The input numpy array that holds the grid’s column x-coordinates.

Return type:

ndarray of float

get_grid_y(grid, y)#

Get coordinates of grid nodes in the y direction.

Parameters:
  • grid (int) – A grid identifier.

  • y (ndarray of float, shape (ncols,)) – A numpy array to hold the y-coordinates of the grid node rows.

Returns:

The input numpy array that holds the grid’s row y-coordinates.

Return type:

ndarray of float

get_grid_z(grid, z)#

Get coordinates of grid nodes in the z direction.

Parameters:
  • grid (int) – A grid identifier.

  • z (ndarray of float, shape (nlayers,)) – A numpy array to hold the z-coordinates of the grid nodes layers.

Returns:

The input numpy array that holds the grid’s layer z-coordinates.

Return type:

ndarray of float

get_input_item_count()#

Count of a model’s input variables.

Returns:

The number of input variables.

Return type:

int

get_input_var_names()#

Names of the input exchange items.

get_output_item_count()#

Count of a model’s output variables.

Returns:

The number of output variables.

Return type:

int

get_output_var_names()#

Names of the output exchange items.

get_start_time()#

Start time of the component.

get_time_step()#

Component time step.

get_time_units()#

Time units used by the component.

get_value(name, dest)#

Get a copy of a variable’s data.

get_value_at_indices(name, dest, inds)#

Get values at particular indices.

Parameters:
  • name (str) – An input or output variable name, a CSDMS Standard Name.

  • dest (ndarray) – A numpy array into which to place the values.

  • inds (array_like) – The indices into the variable array.

Returns:

Value of the model variable at the given location.

Return type:

array_like

get_value_ptr(name)#

Get a reference to values of the given variable.

This is a getter for the model, used to access the model’s current state. It returns a reference to a model variable, with the return type, size and rank dependent on the variable.

Parameters:

name (str) – An input or output variable name, a CSDMS Standard Name.

Returns:

A reference to a model variable.

Return type:

array_like

get_value_ref(name)#

Get a reference to a variable’s data.

get_var_grid(name)#

Get the grid id for a variable.

get_var_itemsize(name)#

Get the size of elements of a variable.

get_var_location(name)#

Get the grid element type that the a given variable is defined on.

The grid topology can be composed of nodes, edges, and faces.

node

A point that has a coordinate pair or triplet: the most basic element of the topology.

edge

A line or curve bounded by two nodes.

face

A plane or surface enclosed by a set of edges. In a 2D horizontal application one may consider the word “polygon”, but in the hierarchy of elements the word “face” is most common.

Parameters:

name (str) – An input or output variable name, a CSDMS Standard Name.

Returns:

The grid location on which the variable is defined. Must be one of “node”, “edge”, or “face”.

Return type:

str

Notes

CSDMS uses the ugrid conventions to define unstructured grids.

get_var_nbytes(name)#

Get the total number of bytes used by a variable.

get_var_type(name)#

Get the data type for a variable.

get_var_units(name)#

Get the unit used by a variable.

initialize(config_file)#

Initialize the component from a file.

BMI-wrapped Landlab components use input files in YAML format. Component-specific parameters are listed at the top level, followed by grid and then time information. An example input file looks like:

flexure:
    eet: 15.e+3
clock:
    start: 0
    stop: 100.
    step: 2.
grid:
    type: raster
    shape: [20, 40]
    spacing: [1000., 2000.]

In this case, a RasterModelGrid is created (with the given shape and spacing) and passed to the underlying landlab component. The eet=15000. is also given to the component but as a keyword parameter. The BMI clock is initialized with the given parameters.

Parameters:

config_file (str or file_like) – YAML-formatted input file for the component.

set_value(name, values)#

Set the values of a variable.

set_value_at_indices(name, inds, src)#

Specify a new value for a model variable at particular indices.

Parameters:
  • name (str) – An input or output variable name, a CSDMS Standard Name.

  • inds (array_like) – The indices into the variable array.

  • src (array_like) – The new value for the specified variable.

update()#

Update the component one time step.

update_frac(frac)#

Update the component a fraction of a time step.

update_until(then)#

Update the component until a given time.

class DetachmentLtdErosionBMI#

Bases: Bmi

Basic Modeling Interface for the DetachmentLtdErosion component.

finalize()#

Clean-up the component.

get_component_name()#

Name of the component.

get_current_time()#

Current component time.

get_end_time()#

Stop time for the component.

get_grid_edge_count(grid)#

Get the number of edges in the grid.

Parameters:

grid (int) – A grid identifier.

Returns:

The total number of grid edges.

Return type:

int

get_grid_edge_nodes(grid, edge_nodes)#

Get the edge-node connectivity.

Parameters:
  • grid (int) – A grid identifier.

  • edge_nodes (ndarray of int, shape (2 x nnodes,)) – A numpy array to place the edge-node connectivity. For each edge, connectivity is given as node at edge tail, followed by node at edge head.

Returns:

The input numpy array that holds the edge-node connectivity.

Return type:

ndarray of int

get_grid_face_count(grid)#

Get the number of faces in the grid.

Parameters:

grid (int) – A grid identifier.

Returns:

The total number of grid faces.

Return type:

int

get_grid_face_edges(grid)#

Get the face-edge connectivity.

Parameters:
  • grid (int) – A grid identifier.

  • face_edges (ndarray of int) – A numpy array to place the face-edge connectivity.

Returns:

The input numpy array that holds the face-edge connectivity.

Return type:

ndarray of int

get_grid_face_nodes(grid, face_nodes)#

Get the face-node connectivity.

Parameters:
  • grid (int) – A grid identifier.

  • face_nodes (ndarray of int) – A numpy array to place the face-node connectivity. For each face, the nodes (listed in a counter-clockwise direction) that form the boundary of the face.

Returns:

The input numpy array that holds the face-node connectivity.

Return type:

ndarray of int

get_grid_node_count(grid)#

Get the number of nodes in the grid.

Parameters:

grid (int) – A grid identifier.

Returns:

The total number of grid nodes.

Return type:

int

get_grid_nodes_per_face(grid, nodes_per_face)#

Get the number of nodes for each face.

Parameters:
  • grid (int) – A grid identifier.

  • nodes_per_face (ndarray of int, shape (nfaces,)) – A numpy array to place the number of nodes per face.

Returns:

The input numpy array that holds the number of nodes per face.

Return type:

ndarray of int

get_grid_origin(grid, origin)#

Get the origin for a structured grid.

get_grid_rank(grid)#

Get the number of dimensions of a grid.

get_grid_shape(grid, shape)#

Get the shape of a structured grid.

get_grid_size(grid)#

Get the total number of elements in the computational grid.

Parameters:

grid (int) – A grid identifier.

Returns:

Size of the grid.

Return type:

int

get_grid_spacing(grid, spacing)#

Get the row and column spacing of a structured grid.

get_grid_type(grid)#

Get the type of grid.

get_grid_x(grid, x)#

Get coordinates of grid nodes in the x direction.

Parameters:
  • grid (int) – A grid identifier.

  • x (ndarray of float, shape (nrows,)) – A numpy array to hold the x-coordinates of the grid node columns.

Returns:

The input numpy array that holds the grid’s column x-coordinates.

Return type:

ndarray of float

get_grid_y(grid, y)#

Get coordinates of grid nodes in the y direction.

Parameters:
  • grid (int) – A grid identifier.

  • y (ndarray of float, shape (ncols,)) – A numpy array to hold the y-coordinates of the grid node rows.

Returns:

The input numpy array that holds the grid’s row y-coordinates.

Return type:

ndarray of float

get_grid_z(grid, z)#

Get coordinates of grid nodes in the z direction.

Parameters:
  • grid (int) – A grid identifier.

  • z (ndarray of float, shape (nlayers,)) – A numpy array to hold the z-coordinates of the grid nodes layers.

Returns:

The input numpy array that holds the grid’s layer z-coordinates.

Return type:

ndarray of float

get_input_item_count()#

Count of a model’s input variables.

Returns:

The number of input variables.

Return type:

int

get_input_var_names()#

Names of the input exchange items.

get_output_item_count()#

Count of a model’s output variables.

Returns:

The number of output variables.

Return type:

int

get_output_var_names()#

Names of the output exchange items.

get_start_time()#

Start time of the component.

get_time_step()#

Component time step.

get_time_units()#

Time units used by the component.

get_value(name, dest)#

Get a copy of a variable’s data.

get_value_at_indices(name, dest, inds)#

Get values at particular indices.

Parameters:
  • name (str) – An input or output variable name, a CSDMS Standard Name.

  • dest (ndarray) – A numpy array into which to place the values.

  • inds (array_like) – The indices into the variable array.

Returns:

Value of the model variable at the given location.

Return type:

array_like

get_value_ptr(name)#

Get a reference to values of the given variable.

This is a getter for the model, used to access the model’s current state. It returns a reference to a model variable, with the return type, size and rank dependent on the variable.

Parameters:

name (str) – An input or output variable name, a CSDMS Standard Name.

Returns:

A reference to a model variable.

Return type:

array_like

get_value_ref(name)#

Get a reference to a variable’s data.

get_var_grid(name)#

Get the grid id for a variable.

get_var_itemsize(name)#

Get the size of elements of a variable.

get_var_location(name)#

Get the grid element type that the a given variable is defined on.

The grid topology can be composed of nodes, edges, and faces.

node

A point that has a coordinate pair or triplet: the most basic element of the topology.

edge

A line or curve bounded by two nodes.

face

A plane or surface enclosed by a set of edges. In a 2D horizontal application one may consider the word “polygon”, but in the hierarchy of elements the word “face” is most common.

Parameters:

name (str) – An input or output variable name, a CSDMS Standard Name.

Returns:

The grid location on which the variable is defined. Must be one of “node”, “edge”, or “face”.

Return type:

str

Notes

CSDMS uses the ugrid conventions to define unstructured grids.

get_var_nbytes(name)#

Get the total number of bytes used by a variable.

get_var_type(name)#

Get the data type for a variable.

get_var_units(name)#

Get the unit used by a variable.

initialize(config_file)#

Initialize the component from a file.

BMI-wrapped Landlab components use input files in YAML format. Component-specific parameters are listed at the top level, followed by grid and then time information. An example input file looks like:

flexure:
    eet: 15.e+3
clock:
    start: 0
    stop: 100.
    step: 2.
grid:
    type: raster
    shape: [20, 40]
    spacing: [1000., 2000.]

In this case, a RasterModelGrid is created (with the given shape and spacing) and passed to the underlying landlab component. The eet=15000. is also given to the component but as a keyword parameter. The BMI clock is initialized with the given parameters.

Parameters:

config_file (str or file_like) – YAML-formatted input file for the component.

set_value(name, values)#

Set the values of a variable.

set_value_at_indices(name, inds, src)#

Specify a new value for a model variable at particular indices.

Parameters:
  • name (str) – An input or output variable name, a CSDMS Standard Name.

  • inds (array_like) – The indices into the variable array.

  • src (array_like) – The new value for the specified variable.

update()#

Update the component one time step.

update_frac(frac)#

Update the component a fraction of a time step.

update_until(then)#

Update the component until a given time.

class DimensionlessDischargeBMI#

Bases: Bmi

Basic Modeling Interface for the DimensionlessDischarge component.

finalize()#

Clean-up the component.

get_component_name()#

Name of the component.

get_current_time()#

Current component time.

get_end_time()#

Stop time for the component.

get_grid_edge_count(grid)#

Get the number of edges in the grid.

Parameters:

grid (int) – A grid identifier.

Returns:

The total number of grid edges.

Return type:

int

get_grid_edge_nodes(grid, edge_nodes)#

Get the edge-node connectivity.

Parameters:
  • grid (int) – A grid identifier.

  • edge_nodes (ndarray of int, shape (2 x nnodes,)) – A numpy array to place the edge-node connectivity. For each edge, connectivity is given as node at edge tail, followed by node at edge head.

Returns:

The input numpy array that holds the edge-node connectivity.

Return type:

ndarray of int

get_grid_face_count(grid)#

Get the number of faces in the grid.

Parameters:

grid (int) – A grid identifier.

Returns:

The total number of grid faces.

Return type:

int

get_grid_face_edges(grid)#

Get the face-edge connectivity.

Parameters:
  • grid (int) – A grid identifier.

  • face_edges (ndarray of int) – A numpy array to place the face-edge connectivity.

Returns:

The input numpy array that holds the face-edge connectivity.

Return type:

ndarray of int

get_grid_face_nodes(grid, face_nodes)#

Get the face-node connectivity.

Parameters:
  • grid (int) – A grid identifier.

  • face_nodes (ndarray of int) – A numpy array to place the face-node connectivity. For each face, the nodes (listed in a counter-clockwise direction) that form the boundary of the face.

Returns:

The input numpy array that holds the face-node connectivity.

Return type:

ndarray of int

get_grid_node_count(grid)#

Get the number of nodes in the grid.

Parameters:

grid (int) – A grid identifier.

Returns:

The total number of grid nodes.

Return type:

int

get_grid_nodes_per_face(grid, nodes_per_face)#

Get the number of nodes for each face.

Parameters:
  • grid (int) – A grid identifier.

  • nodes_per_face (ndarray of int, shape (nfaces,)) – A numpy array to place the number of nodes per face.

Returns:

The input numpy array that holds the number of nodes per face.

Return type:

ndarray of int

get_grid_origin(grid, origin)#

Get the origin for a structured grid.

get_grid_rank(grid)#

Get the number of dimensions of a grid.

get_grid_shape(grid, shape)#

Get the shape of a structured grid.

get_grid_size(grid)#

Get the total number of elements in the computational grid.

Parameters:

grid (int) – A grid identifier.

Returns:

Size of the grid.

Return type:

int

get_grid_spacing(grid, spacing)#

Get the row and column spacing of a structured grid.

get_grid_type(grid)#

Get the type of grid.

get_grid_x(grid, x)#

Get coordinates of grid nodes in the x direction.

Parameters:
  • grid (int) – A grid identifier.

  • x (ndarray of float, shape (nrows,)) – A numpy array to hold the x-coordinates of the grid node columns.

Returns:

The input numpy array that holds the grid’s column x-coordinates.

Return type:

ndarray of float

get_grid_y(grid, y)#

Get coordinates of grid nodes in the y direction.

Parameters:
  • grid (int) – A grid identifier.

  • y (ndarray of float, shape (ncols,)) – A numpy array to hold the y-coordinates of the grid node rows.

Returns:

The input numpy array that holds the grid’s row y-coordinates.

Return type:

ndarray of float

get_grid_z(grid, z)#

Get coordinates of grid nodes in the z direction.

Parameters:
  • grid (int) – A grid identifier.

  • z (ndarray of float, shape (nlayers,)) – A numpy array to hold the z-coordinates of the grid nodes layers.

Returns:

The input numpy array that holds the grid’s layer z-coordinates.

Return type:

ndarray of float

get_input_item_count()#

Count of a model’s input variables.

Returns:

The number of input variables.

Return type:

int

get_input_var_names()#

Names of the input exchange items.

get_output_item_count()#

Count of a model’s output variables.

Returns:

The number of output variables.

Return type:

int

get_output_var_names()#

Names of the output exchange items.

get_start_time()#

Start time of the component.

get_time_step()#

Component time step.

get_time_units()#

Time units used by the component.

get_value(name, dest)#

Get a copy of a variable’s data.

get_value_at_indices(name, dest, inds)#

Get values at particular indices.

Parameters:
  • name (str) – An input or output variable name, a CSDMS Standard Name.

  • dest (ndarray) – A numpy array into which to place the values.

  • inds (array_like) – The indices into the variable array.

Returns:

Value of the model variable at the given location.

Return type:

array_like

get_value_ptr(name)#

Get a reference to values of the given variable.

This is a getter for the model, used to access the model’s current state. It returns a reference to a model variable, with the return type, size and rank dependent on the variable.

Parameters:

name (str) – An input or output variable name, a CSDMS Standard Name.

Returns:

A reference to a model variable.

Return type:

array_like

get_value_ref(name)#

Get a reference to a variable’s data.

get_var_grid(name)#

Get the grid id for a variable.

get_var_itemsize(name)#

Get the size of elements of a variable.

get_var_location(name)#

Get the grid element type that the a given variable is defined on.

The grid topology can be composed of nodes, edges, and faces.

node

A point that has a coordinate pair or triplet: the most basic element of the topology.

edge

A line or curve bounded by two nodes.

face

A plane or surface enclosed by a set of edges. In a 2D horizontal application one may consider the word “polygon”, but in the hierarchy of elements the word “face” is most common.

Parameters:

name (str) – An input or output variable name, a CSDMS Standard Name.

Returns:

The grid location on which the variable is defined. Must be one of “node”, “edge”, or “face”.

Return type:

str

Notes

CSDMS uses the ugrid conventions to define unstructured grids.

get_var_nbytes(name)#

Get the total number of bytes used by a variable.

get_var_type(name)#

Get the data type for a variable.

get_var_units(name)#

Get the unit used by a variable.

initialize(config_file)#

Initialize the component from a file.

BMI-wrapped Landlab components use input files in YAML format. Component-specific parameters are listed at the top level, followed by grid and then time information. An example input file looks like:

flexure:
    eet: 15.e+3
clock:
    start: 0
    stop: 100.
    step: 2.
grid:
    type: raster
    shape: [20, 40]
    spacing: [1000., 2000.]

In this case, a RasterModelGrid is created (with the given shape and spacing) and passed to the underlying landlab component. The eet=15000. is also given to the component but as a keyword parameter. The BMI clock is initialized with the given parameters.

Parameters:

config_file (str or file_like) – YAML-formatted input file for the component.

set_value(name, values)#

Set the values of a variable.

set_value_at_indices(name, inds, src)#

Specify a new value for a model variable at particular indices.

Parameters:
  • name (str) – An input or output variable name, a CSDMS Standard Name.

  • inds (array_like) – The indices into the variable array.

  • src (array_like) – The new value for the specified variable.

update()#

Update the component one time step.

update_frac(frac)#

Update the component a fraction of a time step.

update_until(then)#

Update the component until a given time.

class DischargeDiffuserBMI#

Bases: Bmi

Basic Modeling Interface for the DischargeDiffuser component.

finalize()#

Clean-up the component.

get_component_name()#

Name of the component.

get_current_time()#

Current component time.

get_end_time()#

Stop time for the component.

get_grid_edge_count(grid)#

Get the number of edges in the grid.

Parameters:

grid (int) – A grid identifier.

Returns:

The total number of grid edges.

Return type:

int

get_grid_edge_nodes(grid, edge_nodes)#

Get the edge-node connectivity.

Parameters:
  • grid (int) – A grid identifier.

  • edge_nodes (ndarray of int, shape (2 x nnodes,)) – A numpy array to place the edge-node connectivity. For each edge, connectivity is given as node at edge tail, followed by node at edge head.

Returns:

The input numpy array that holds the edge-node connectivity.

Return type:

ndarray of int

get_grid_face_count(grid)#

Get the number of faces in the grid.

Parameters:

grid (int) – A grid identifier.

Returns:

The total number of grid faces.

Return type:

int

get_grid_face_edges(grid)#

Get the face-edge connectivity.

Parameters:
  • grid (int) – A grid identifier.

  • face_edges (ndarray of int) – A numpy array to place the face-edge connectivity.

Returns:

The input numpy array that holds the face-edge connectivity.

Return type:

ndarray of int

get_grid_face_nodes(grid, face_nodes)#

Get the face-node connectivity.

Parameters:
  • grid (int) – A grid identifier.

  • face_nodes (ndarray of int) – A numpy array to place the face-node connectivity. For each face, the nodes (listed in a counter-clockwise direction) that form the boundary of the face.

Returns:

The input numpy array that holds the face-node connectivity.

Return type:

ndarray of int

get_grid_node_count(grid)#

Get the number of nodes in the grid.

Parameters:

grid (int) – A grid identifier.

Returns:

The total number of grid nodes.

Return type:

int

get_grid_nodes_per_face(grid, nodes_per_face)#

Get the number of nodes for each face.

Parameters:
  • grid (int) – A grid identifier.

  • nodes_per_face (ndarray of int, shape (nfaces,)) – A numpy array to place the number of nodes per face.

Returns:

The input numpy array that holds the number of nodes per face.

Return type:

ndarray of int

get_grid_origin(grid, origin)#

Get the origin for a structured grid.

get_grid_rank(grid)#

Get the number of dimensions of a grid.

get_grid_shape(grid, shape)#

Get the shape of a structured grid.

get_grid_size(grid)#

Get the total number of elements in the computational grid.

Parameters:

grid (int) – A grid identifier.

Returns:

Size of the grid.

Return type:

int

get_grid_spacing(grid, spacing)#

Get the row and column spacing of a structured grid.

get_grid_type(grid)#

Get the type of grid.

get_grid_x(grid, x)#

Get coordinates of grid nodes in the x direction.

Parameters:
  • grid (int) – A grid identifier.

  • x (ndarray of float, shape (nrows,)) – A numpy array to hold the x-coordinates of the grid node columns.

Returns:

The input numpy array that holds the grid’s column x-coordinates.

Return type:

ndarray of float

get_grid_y(grid, y)#

Get coordinates of grid nodes in the y direction.

Parameters:
  • grid (int) – A grid identifier.

  • y (ndarray of float, shape (ncols,)) – A numpy array to hold the y-coordinates of the grid node rows.

Returns:

The input numpy array that holds the grid’s row y-coordinates.

Return type:

ndarray of float

get_grid_z(grid, z)#

Get coordinates of grid nodes in the z direction.

Parameters:
  • grid (int) – A grid identifier.

  • z (ndarray of float, shape (nlayers,)) – A numpy array to hold the z-coordinates of the grid nodes layers.

Returns:

The input numpy array that holds the grid’s layer z-coordinates.

Return type:

ndarray of float

get_input_item_count()#

Count of a model’s input variables.

Returns:

The number of input variables.

Return type:

int

get_input_var_names()#

Names of the input exchange items.

get_output_item_count()#

Count of a model’s output variables.

Returns:

The number of output variables.

Return type:

int

get_output_var_names()#

Names of the output exchange items.

get_start_time()#

Start time of the component.

get_time_step()#

Component time step.

get_time_units()#

Time units used by the component.

get_value(name, dest)#

Get a copy of a variable’s data.

get_value_at_indices(name, dest, inds)#

Get values at particular indices.

Parameters:
  • name (str) – An input or output variable name, a CSDMS Standard Name.

  • dest (ndarray) – A numpy array into which to place the values.

  • inds (array_like) – The indices into the variable array.

Returns:

Value of the model variable at the given location.

Return type:

array_like

get_value_ptr(name)#

Get a reference to values of the given variable.

This is a getter for the model, used to access the model’s current state. It returns a reference to a model variable, with the return type, size and rank dependent on the variable.

Parameters:

name (str) – An input or output variable name, a CSDMS Standard Name.

Returns:

A reference to a model variable.

Return type:

array_like

get_value_ref(name)#

Get a reference to a variable’s data.

get_var_grid(name)#

Get the grid id for a variable.

get_var_itemsize(name)#

Get the size of elements of a variable.

get_var_location(name)#

Get the grid element type that the a given variable is defined on.

The grid topology can be composed of nodes, edges, and faces.

node

A point that has a coordinate pair or triplet: the most basic element of the topology.

edge

A line or curve bounded by two nodes.

face

A plane or surface enclosed by a set of edges. In a 2D horizontal application one may consider the word “polygon”, but in the hierarchy of elements the word “face” is most common.

Parameters:

name (str) – An input or output variable name, a CSDMS Standard Name.

Returns:

The grid location on which the variable is defined. Must be one of “node”, “edge”, or “face”.

Return type:

str

Notes

CSDMS uses the ugrid conventions to define unstructured grids.

get_var_nbytes(name)#

Get the total number of bytes used by a variable.

get_var_type(name)#

Get the data type for a variable.

get_var_units(name)#

Get the unit used by a variable.

initialize(config_file)#

Initialize the component from a file.

BMI-wrapped Landlab components use input files in YAML format. Component-specific parameters are listed at the top level, followed by grid and then time information. An example input file looks like:

flexure:
    eet: 15.e+3
clock:
    start: 0
    stop: 100.
    step: 2.
grid:
    type: raster
    shape: [20, 40]
    spacing: [1000., 2000.]

In this case, a RasterModelGrid is created (with the given shape and spacing) and passed to the underlying landlab component. The eet=15000. is also given to the component but as a keyword parameter. The BMI clock is initialized with the given parameters.

Parameters:

config_file (str or file_like) – YAML-formatted input file for the component.

set_value(name, values)#

Set the values of a variable.

set_value_at_indices(name, inds, src)#

Specify a new value for a model variable at particular indices.

Parameters:
  • name (str) – An input or output variable name, a CSDMS Standard Name.

  • inds (array_like) – The indices into the variable array.

  • src (array_like) – The new value for the specified variable.

update()#

Update the component one time step.

update_frac(frac)#

Update the component a fraction of a time step.

update_until(then)#

Update the component until a given time.

class DrainageDensityBMI#

Bases: Bmi

Basic Modeling Interface for the DrainageDensity component.

finalize()#

Clean-up the component.

get_component_name()#

Name of the component.

get_current_time()#

Current component time.

get_end_time()#

Stop time for the component.

get_grid_edge_count(grid)#

Get the number of edges in the grid.

Parameters:

grid (int) – A grid identifier.

Returns:

The total number of grid edges.

Return type:

int

get_grid_edge_nodes(grid, edge_nodes)#

Get the edge-node connectivity.

Parameters:
  • grid (int) – A grid identifier.

  • edge_nodes (ndarray of int, shape (2 x nnodes,)) – A numpy array to place the edge-node connectivity. For each edge, connectivity is given as node at edge tail, followed by node at edge head.

Returns:

The input numpy array that holds the edge-node connectivity.

Return type:

ndarray of int

get_grid_face_count(grid)#

Get the number of faces in the grid.

Parameters:

grid (int) – A grid identifier.

Returns:

The total number of grid faces.

Return type:

int

get_grid_face_edges(grid)#

Get the face-edge connectivity.

Parameters:
  • grid (int) – A grid identifier.

  • face_edges (ndarray of int) – A numpy array to place the face-edge connectivity.

Returns:

The input numpy array that holds the face-edge connectivity.

Return type:

ndarray of int

get_grid_face_nodes(grid, face_nodes)#

Get the face-node connectivity.

Parameters:
  • grid (int) – A grid identifier.

  • face_nodes (ndarray of int) – A numpy array to place the face-node connectivity. For each face, the nodes (listed in a counter-clockwise direction) that form the boundary of the face.

Returns:

The input numpy array that holds the face-node connectivity.

Return type:

ndarray of int

get_grid_node_count(grid)#

Get the number of nodes in the grid.

Parameters:

grid (int) – A grid identifier.

Returns:

The total number of grid nodes.

Return type:

int

get_grid_nodes_per_face(grid, nodes_per_face)#

Get the number of nodes for each face.

Parameters:
  • grid (int) – A grid identifier.

  • nodes_per_face (ndarray of int, shape (nfaces,)) – A numpy array to place the number of nodes per face.

Returns:

The input numpy array that holds the number of nodes per face.

Return type:

ndarray of int

get_grid_origin(grid, origin)#

Get the origin for a structured grid.

get_grid_rank(grid)#

Get the number of dimensions of a grid.

get_grid_shape(grid, shape)#

Get the shape of a structured grid.

get_grid_size(grid)#

Get the total number of elements in the computational grid.

Parameters:

grid (int) – A grid identifier.

Returns:

Size of the grid.

Return type:

int

get_grid_spacing(grid, spacing)#

Get the row and column spacing of a structured grid.

get_grid_type(grid)#

Get the type of grid.

get_grid_x(grid, x)#

Get coordinates of grid nodes in the x direction.

Parameters:
  • grid (int) – A grid identifier.

  • x (ndarray of float, shape (nrows,)) – A numpy array to hold the x-coordinates of the grid node columns.

Returns:

The input numpy array that holds the grid’s column x-coordinates.

Return type:

ndarray of float

get_grid_y(grid, y)#

Get coordinates of grid nodes in the y direction.

Parameters:
  • grid (int) – A grid identifier.

  • y (ndarray of float, shape (ncols,)) – A numpy array to hold the y-coordinates of the grid node rows.

Returns:

The input numpy array that holds the grid’s row y-coordinates.

Return type:

ndarray of float

get_grid_z(grid, z)#

Get coordinates of grid nodes in the z direction.

Parameters:
  • grid (int) – A grid identifier.

  • z (ndarray of float, shape (nlayers,)) – A numpy array to hold the z-coordinates of the grid nodes layers.

Returns:

The input numpy array that holds the grid’s layer z-coordinates.

Return type:

ndarray of float

get_input_item_count()#

Count of a model’s input variables.

Returns:

The number of input variables.

Return type:

int

get_input_var_names()#

Names of the input exchange items.

get_output_item_count()#

Count of a model’s output variables.

Returns:

The number of output variables.

Return type:

int

get_output_var_names()#

Names of the output exchange items.

get_start_time()#

Start time of the component.

get_time_step()#

Component time step.

get_time_units()#

Time units used by the component.

get_value(name, dest)#

Get a copy of a variable’s data.

get_value_at_indices(name, dest, inds)#

Get values at particular indices.

Parameters:
  • name (str) – An input or output variable name, a CSDMS Standard Name.

  • dest (ndarray) – A numpy array into which to place the values.

  • inds (array_like) – The indices into the variable array.

Returns:

Value of the model variable at the given location.

Return type:

array_like

get_value_ptr(name)#

Get a reference to values of the given variable.

This is a getter for the model, used to access the model’s current state. It returns a reference to a model variable, with the return type, size and rank dependent on the variable.

Parameters:

name (str) – An input or output variable name, a CSDMS Standard Name.

Returns:

A reference to a model variable.

Return type:

array_like

get_value_ref(name)#

Get a reference to a variable’s data.

get_var_grid(name)#

Get the grid id for a variable.

get_var_itemsize(name)#

Get the size of elements of a variable.

get_var_location(name)#

Get the grid element type that the a given variable is defined on.

The grid topology can be composed of nodes, edges, and faces.

node

A point that has a coordinate pair or triplet: the most basic element of the topology.

edge

A line or curve bounded by two nodes.

face

A plane or surface enclosed by a set of edges. In a 2D horizontal application one may consider the word “polygon”, but in the hierarchy of elements the word “face” is most common.

Parameters:

name (str) – An input or output variable name, a CSDMS Standard Name.

Returns:

The grid location on which the variable is defined. Must be one of “node”, “edge”, or “face”.

Return type:

str

Notes

CSDMS uses the ugrid conventions to define unstructured grids.

get_var_nbytes(name)#

Get the total number of bytes used by a variable.

get_var_type(name)#

Get the data type for a variable.

get_var_units(name)#

Get the unit used by a variable.

initialize(config_file)#

Initialize the component from a file.

BMI-wrapped Landlab components use input files in YAML format. Component-specific parameters are listed at the top level, followed by grid and then time information. An example input file looks like:

flexure:
    eet: 15.e+3
clock:
    start: 0
    stop: 100.
    step: 2.
grid:
    type: raster
    shape: [20, 40]
    spacing: [1000., 2000.]

In this case, a RasterModelGrid is created (with the given shape and spacing) and passed to the underlying landlab component. The eet=15000. is also given to the component but as a keyword parameter. The BMI clock is initialized with the given parameters.

Parameters:

config_file (str or file_like) – YAML-formatted input file for the component.

set_value(name, values)#

Set the values of a variable.

set_value_at_indices(name, inds, src)#

Specify a new value for a model variable at particular indices.

Parameters:
  • name (str) – An input or output variable name, a CSDMS Standard Name.

  • inds (array_like) – The indices into the variable array.

  • src (array_like) – The new value for the specified variable.

update()#

Update the component one time step.

update_frac(frac)#

Update the component a fraction of a time step.

update_until(then)#

Update the component until a given time.

class ErosionDepositionBMI#

Bases: Bmi

Basic Modeling Interface for the ErosionDeposition component.

finalize()#

Clean-up the component.

get_component_name()#

Name of the component.

get_current_time()#

Current component time.

get_end_time()#

Stop time for the component.

get_grid_edge_count(grid)#

Get the number of edges in the grid.

Parameters:

grid (int) – A grid identifier.

Returns:

The total number of grid edges.

Return type:

int

get_grid_edge_nodes(grid, edge_nodes)#

Get the edge-node connectivity.

Parameters:
  • grid (int) – A grid identifier.

  • edge_nodes (ndarray of int, shape (2 x nnodes,)) – A numpy array to place the edge-node connectivity. For each edge, connectivity is given as node at edge tail, followed by node at edge head.

Returns:

The input numpy array that holds the edge-node connectivity.

Return type:

ndarray of int

get_grid_face_count(grid)#

Get the number of faces in the grid.

Parameters:

grid (int) – A grid identifier.

Returns:

The total number of grid faces.

Return type:

int

get_grid_face_edges(grid)#

Get the face-edge connectivity.

Parameters:
  • grid (int) – A grid identifier.

  • face_edges (ndarray of int) – A numpy array to place the face-edge connectivity.

Returns:

The input numpy array that holds the face-edge connectivity.

Return type:

ndarray of int

get_grid_face_nodes(grid, face_nodes)#

Get the face-node connectivity.

Parameters:
  • grid (int) – A grid identifier.

  • face_nodes (ndarray of int) – A numpy array to place the face-node connectivity. For each face, the nodes (listed in a counter-clockwise direction) that form the boundary of the face.

Returns:

The input numpy array that holds the face-node connectivity.

Return type:

ndarray of int

get_grid_node_count(grid)#

Get the number of nodes in the grid.

Parameters:

grid (int) – A grid identifier.

Returns:

The total number of grid nodes.

Return type:

int

get_grid_nodes_per_face(grid, nodes_per_face)#

Get the number of nodes for each face.

Parameters:
  • grid (int) – A grid identifier.

  • nodes_per_face (ndarray of int, shape (nfaces,)) – A numpy array to place the number of nodes per face.

Returns:

The input numpy array that holds the number of nodes per face.

Return type:

ndarray of int

get_grid_origin(grid, origin)#

Get the origin for a structured grid.

get_grid_rank(grid)#

Get the number of dimensions of a grid.

get_grid_shape(grid, shape)#

Get the shape of a structured grid.

get_grid_size(grid)#

Get the total number of elements in the computational grid.

Parameters:

grid (int) – A grid identifier.

Returns:

Size of the grid.

Return type:

int

get_grid_spacing(grid, spacing)#

Get the row and column spacing of a structured grid.

get_grid_type(grid)#

Get the type of grid.

get_grid_x(grid, x)#

Get coordinates of grid nodes in the x direction.

Parameters:
  • grid (int) – A grid identifier.

  • x (ndarray of float, shape (nrows,)) – A numpy array to hold the x-coordinates of the grid node columns.

Returns:

The input numpy array that holds the grid’s column x-coordinates.

Return type:

ndarray of float

get_grid_y(grid, y)#

Get coordinates of grid nodes in the y direction.

Parameters:
  • grid (int) – A grid identifier.

  • y (ndarray of float, shape (ncols,)) – A numpy array to hold the y-coordinates of the grid node rows.

Returns:

The input numpy array that holds the grid’s row y-coordinates.

Return type:

ndarray of float

get_grid_z(grid, z)#

Get coordinates of grid nodes in the z direction.

Parameters:
  • grid (int) – A grid identifier.

  • z (ndarray of float, shape (nlayers,)) – A numpy array to hold the z-coordinates of the grid nodes layers.

Returns:

The input numpy array that holds the grid’s layer z-coordinates.

Return type:

ndarray of float

get_input_item_count()#

Count of a model’s input variables.

Returns:

The number of input variables.

Return type:

int

get_input_var_names()#

Names of the input exchange items.

get_output_item_count()#

Count of a model’s output variables.

Returns:

The number of output variables.

Return type:

int

get_output_var_names()#

Names of the output exchange items.

get_start_time()#

Start time of the component.

get_time_step()#

Component time step.

get_time_units()#

Time units used by the component.

get_value(name, dest)#

Get a copy of a variable’s data.

get_value_at_indices(name, dest, inds)#

Get values at particular indices.

Parameters:
  • name (str) – An input or output variable name, a CSDMS Standard Name.

  • dest (ndarray) – A numpy array into which to place the values.

  • inds (array_like) – The indices into the variable array.

Returns:

Value of the model variable at the given location.

Return type:

array_like

get_value_ptr(name)#

Get a reference to values of the given variable.

This is a getter for the model, used to access the model’s current state. It returns a reference to a model variable, with the return type, size and rank dependent on the variable.

Parameters:

name (str) – An input or output variable name, a CSDMS Standard Name.

Returns:

A reference to a model variable.

Return type:

array_like

get_value_ref(name)#

Get a reference to a variable’s data.

get_var_grid(name)#

Get the grid id for a variable.

get_var_itemsize(name)#

Get the size of elements of a variable.

get_var_location(name)#

Get the grid element type that the a given variable is defined on.

The grid topology can be composed of nodes, edges, and faces.

node

A point that has a coordinate pair or triplet: the most basic element of the topology.

edge

A line or curve bounded by two nodes.

face

A plane or surface enclosed by a set of edges. In a 2D horizontal application one may consider the word “polygon”, but in the hierarchy of elements the word “face” is most common.

Parameters:

name (str) – An input or output variable name, a CSDMS Standard Name.

Returns:

The grid location on which the variable is defined. Must be one of “node”, “edge”, or “face”.

Return type:

str

Notes

CSDMS uses the ugrid conventions to define unstructured grids.

get_var_nbytes(name)#

Get the total number of bytes used by a variable.

get_var_type(name)#

Get the data type for a variable.

get_var_units(name)#

Get the unit used by a variable.

initialize(config_file)#

Initialize the component from a file.

BMI-wrapped Landlab components use input files in YAML format. Component-specific parameters are listed at the top level, followed by grid and then time information. An example input file looks like:

flexure:
    eet: 15.e+3
clock:
    start: 0
    stop: 100.
    step: 2.
grid:
    type: raster
    shape: [20, 40]
    spacing: [1000., 2000.]

In this case, a RasterModelGrid is created (with the given shape and spacing) and passed to the underlying landlab component. The eet=15000. is also given to the component but as a keyword parameter. The BMI clock is initialized with the given parameters.

Parameters:

config_file (str or file_like) – YAML-formatted input file for the component.

set_value(name, values)#

Set the values of a variable.

set_value_at_indices(name, inds, src)#

Specify a new value for a model variable at particular indices.

Parameters:
  • name (str) – An input or output variable name, a CSDMS Standard Name.

  • inds (array_like) – The indices into the variable array.

  • src (array_like) – The new value for the specified variable.

update()#

Update the component one time step.

update_frac(frac)#

Update the component a fraction of a time step.

update_until(then)#

Update the component until a given time.

class ExponentialWeathererBMI#

Bases: Bmi

Basic Modeling Interface for the ExponentialWeatherer component.

finalize()#

Clean-up the component.

get_component_name()#

Name of the component.

get_current_time()#

Current component time.

get_end_time()#

Stop time for the component.

get_grid_edge_count(grid)#

Get the number of edges in the grid.

Parameters:

grid (int) – A grid identifier.

Returns:

The total number of grid edges.

Return type:

int

get_grid_edge_nodes(grid, edge_nodes)#

Get the edge-node connectivity.

Parameters:
  • grid (int) – A grid identifier.

  • edge_nodes (ndarray of int, shape (2 x nnodes,)) – A numpy array to place the edge-node connectivity. For each edge, connectivity is given as node at edge tail, followed by node at edge head.

Returns:

The input numpy array that holds the edge-node connectivity.

Return type:

ndarray of int

get_grid_face_count(grid)#

Get the number of faces in the grid.

Parameters:

grid (int) – A grid identifier.

Returns:

The total number of grid faces.

Return type:

int

get_grid_face_edges(grid)#

Get the face-edge connectivity.

Parameters:
  • grid (int) – A grid identifier.

  • face_edges (ndarray of int) – A numpy array to place the face-edge connectivity.

Returns:

The input numpy array that holds the face-edge connectivity.

Return type:

ndarray of int

get_grid_face_nodes(grid, face_nodes)#

Get the face-node connectivity.

Parameters:
  • grid (int) – A grid identifier.

  • face_nodes (ndarray of int) – A numpy array to place the face-node connectivity. For each face, the nodes (listed in a counter-clockwise direction) that form the boundary of the face.

Returns:

The input numpy array that holds the face-node connectivity.

Return type:

ndarray of int

get_grid_node_count(grid)#

Get the number of nodes in the grid.

Parameters:

grid (int) – A grid identifier.

Returns:

The total number of grid nodes.

Return type:

int

get_grid_nodes_per_face(grid, nodes_per_face)#

Get the number of nodes for each face.

Parameters:
  • grid (int) – A grid identifier.

  • nodes_per_face (ndarray of int, shape (nfaces,)) – A numpy array to place the number of nodes per face.

Returns:

The input numpy array that holds the number of nodes per face.

Return type:

ndarray of int

get_grid_origin(grid, origin)#

Get the origin for a structured grid.

get_grid_rank(grid)#

Get the number of dimensions of a grid.

get_grid_shape(grid, shape)#

Get the shape of a structured grid.

get_grid_size(grid)#

Get the total number of elements in the computational grid.

Parameters:

grid (int) – A grid identifier.

Returns:

Size of the grid.

Return type:

int

get_grid_spacing(grid, spacing)#

Get the row and column spacing of a structured grid.

get_grid_type(grid)#

Get the type of grid.

get_grid_x(grid, x)#

Get coordinates of grid nodes in the x direction.

Parameters:
  • grid (int) – A grid identifier.

  • x (ndarray of float, shape (nrows,)) – A numpy array to hold the x-coordinates of the grid node columns.

Returns:

The input numpy array that holds the grid’s column x-coordinates.

Return type:

ndarray of float

get_grid_y(grid, y)#

Get coordinates of grid nodes in the y direction.

Parameters:
  • grid (int) – A grid identifier.

  • y (ndarray of float, shape (ncols,)) – A numpy array to hold the y-coordinates of the grid node rows.

Returns:

The input numpy array that holds the grid’s row y-coordinates.

Return type:

ndarray of float

get_grid_z(grid, z)#

Get coordinates of grid nodes in the z direction.

Parameters:
  • grid (int) – A grid identifier.

  • z (ndarray of float, shape (nlayers,)) – A numpy array to hold the z-coordinates of the grid nodes layers.

Returns:

The input numpy array that holds the grid’s layer z-coordinates.

Return type:

ndarray of float

get_input_item_count()#

Count of a model’s input variables.

Returns:

The number of input variables.

Return type:

int

get_input_var_names()#

Names of the input exchange items.

get_output_item_count()#

Count of a model’s output variables.

Returns:

The number of output variables.

Return type:

int

get_output_var_names()#

Names of the output exchange items.

get_start_time()#

Start time of the component.

get_time_step()#

Component time step.

get_time_units()#

Time units used by the component.

get_value(name, dest)#

Get a copy of a variable’s data.

get_value_at_indices(name, dest, inds)#

Get values at particular indices.

Parameters:
  • name (str) – An input or output variable name, a CSDMS Standard Name.

  • dest (ndarray) – A numpy array into which to place the values.

  • inds (array_like) – The indices into the variable array.

Returns:

Value of the model variable at the given location.

Return type:

array_like

get_value_ptr(name)#

Get a reference to values of the given variable.

This is a getter for the model, used to access the model’s current state. It returns a reference to a model variable, with the return type, size and rank dependent on the variable.

Parameters:

name (str) – An input or output variable name, a CSDMS Standard Name.

Returns:

A reference to a model variable.

Return type:

array_like

get_value_ref(name)#

Get a reference to a variable’s data.

get_var_grid(name)#

Get the grid id for a variable.

get_var_itemsize(name)#

Get the size of elements of a variable.

get_var_location(name)#

Get the grid element type that the a given variable is defined on.

The grid topology can be composed of nodes, edges, and faces.

node

A point that has a coordinate pair or triplet: the most basic element of the topology.

edge

A line or curve bounded by two nodes.

face

A plane or surface enclosed by a set of edges. In a 2D horizontal application one may consider the word “polygon”, but in the hierarchy of elements the word “face” is most common.

Parameters:

name (str) – An input or output variable name, a CSDMS Standard Name.

Returns:

The grid location on which the variable is defined. Must be one of “node”, “edge”, or “face”.

Return type:

str

Notes

CSDMS uses the ugrid conventions to define unstructured grids.

get_var_nbytes(name)#

Get the total number of bytes used by a variable.

get_var_type(name)#

Get the data type for a variable.

get_var_units(name)#

Get the unit used by a variable.

initialize(config_file)#

Initialize the component from a file.

BMI-wrapped Landlab components use input files in YAML format. Component-specific parameters are listed at the top level, followed by grid and then time information. An example input file looks like:

flexure:
    eet: 15.e+3
clock:
    start: 0
    stop: 100.
    step: 2.
grid:
    type: raster
    shape: [20, 40]
    spacing: [1000., 2000.]

In this case, a RasterModelGrid is created (with the given shape and spacing) and passed to the underlying landlab component. The eet=15000. is also given to the component but as a keyword parameter. The BMI clock is initialized with the given parameters.

Parameters:

config_file (str or file_like) – YAML-formatted input file for the component.

set_value(name, values)#

Set the values of a variable.

set_value_at_indices(name, inds, src)#

Specify a new value for a model variable at particular indices.

Parameters:
  • name (str) – An input or output variable name, a CSDMS Standard Name.

  • inds (array_like) – The indices into the variable array.

  • src (array_like) – The new value for the specified variable.

update()#

Update the component one time step.

update_frac(frac)#

Update the component a fraction of a time step.

update_until(then)#

Update the component until a given time.

class ExponentialWeathererIntegratedBMI#

Bases: Bmi

Basic Modeling Interface for the ExponentialWeathererIntegrated component.

finalize()#

Clean-up the component.

get_component_name()#

Name of the component.

get_current_time()#

Current component time.

get_end_time()#

Stop time for the component.

get_grid_edge_count(grid)#

Get the number of edges in the grid.

Parameters:

grid (int) – A grid identifier.

Returns:

The total number of grid edges.

Return type:

int

get_grid_edge_nodes(grid, edge_nodes)#

Get the edge-node connectivity.

Parameters:
  • grid (int) – A grid identifier.

  • edge_nodes (ndarray of int, shape (2 x nnodes,)) – A numpy array to place the edge-node connectivity. For each edge, connectivity is given as node at edge tail, followed by node at edge head.

Returns:

The input numpy array that holds the edge-node connectivity.

Return type:

ndarray of int

get_grid_face_count(grid)#

Get the number of faces in the grid.

Parameters:

grid (int) – A grid identifier.

Returns:

The total number of grid faces.

Return type:

int

get_grid_face_edges(grid)#

Get the face-edge connectivity.

Parameters:
  • grid (int) – A grid identifier.

  • face_edges (ndarray of int) – A numpy array to place the face-edge connectivity.

Returns:

The input numpy array that holds the face-edge connectivity.

Return type:

ndarray of int

get_grid_face_nodes(grid, face_nodes)#

Get the face-node connectivity.

Parameters:
  • grid (int) – A grid identifier.

  • face_nodes (ndarray of int) – A numpy array to place the face-node connectivity. For each face, the nodes (listed in a counter-clockwise direction) that form the boundary of the face.

Returns:

The input numpy array that holds the face-node connectivity.

Return type:

ndarray of int

get_grid_node_count(grid)#

Get the number of nodes in the grid.

Parameters:

grid (int) – A grid identifier.

Returns:

The total number of grid nodes.

Return type:

int

get_grid_nodes_per_face(grid, nodes_per_face)#

Get the number of nodes for each face.

Parameters:
  • grid (int) – A grid identifier.

  • nodes_per_face (ndarray of int, shape (nfaces,)) – A numpy array to place the number of nodes per face.

Returns:

The input numpy array that holds the number of nodes per face.

Return type:

ndarray of int

get_grid_origin(grid, origin)#

Get the origin for a structured grid.

get_grid_rank(grid)#

Get the number of dimensions of a grid.

get_grid_shape(grid, shape)#

Get the shape of a structured grid.

get_grid_size(grid)#

Get the total number of elements in the computational grid.

Parameters:

grid (int) – A grid identifier.

Returns:

Size of the grid.

Return type:

int

get_grid_spacing(grid, spacing)#

Get the row and column spacing of a structured grid.

get_grid_type(grid)#

Get the type of grid.

get_grid_x(grid, x)#

Get coordinates of grid nodes in the x direction.

Parameters:
  • grid (int) – A grid identifier.

  • x (ndarray of float, shape (nrows,)) – A numpy array to hold the x-coordinates of the grid node columns.

Returns:

The input numpy array that holds the grid’s column x-coordinates.

Return type:

ndarray of float

get_grid_y(grid, y)#

Get coordinates of grid nodes in the y direction.

Parameters:
  • grid (int) – A grid identifier.

  • y (ndarray of float, shape (ncols,)) – A numpy array to hold the y-coordinates of the grid node rows.

Returns:

The input numpy array that holds the grid’s row y-coordinates.

Return type:

ndarray of float

get_grid_z(grid, z)#

Get coordinates of grid nodes in the z direction.

Parameters:
  • grid (int) – A grid identifier.

  • z (ndarray of float, shape (nlayers,)) – A numpy array to hold the z-coordinates of the grid nodes layers.

Returns:

The input numpy array that holds the grid’s layer z-coordinates.

Return type:

ndarray of float

get_input_item_count()#

Count of a model’s input variables.

Returns:

The number of input variables.

Return type:

int

get_input_var_names()#

Names of the input exchange items.

get_output_item_count()#

Count of a model’s output variables.

Returns:

The number of output variables.

Return type:

int

get_output_var_names()#

Names of the output exchange items.

get_start_time()#

Start time of the component.

get_time_step()#

Component time step.

get_time_units()#

Time units used by the component.

get_value(name, dest)#

Get a copy of a variable’s data.

get_value_at_indices(name, dest, inds)#

Get values at particular indices.

Parameters:
  • name (str) – An input or output variable name, a CSDMS Standard Name.

  • dest (ndarray) – A numpy array into which to place the values.

  • inds (array_like) – The indices into the variable array.

Returns:

Value of the model variable at the given location.

Return type:

array_like

get_value_ptr(name)#

Get a reference to values of the given variable.

This is a getter for the model, used to access the model’s current state. It returns a reference to a model variable, with the return type, size and rank dependent on the variable.

Parameters:

name (str) – An input or output variable name, a CSDMS Standard Name.

Returns:

A reference to a model variable.

Return type:

array_like

get_value_ref(name)#

Get a reference to a variable’s data.

get_var_grid(name)#

Get the grid id for a variable.

get_var_itemsize(name)#

Get the size of elements of a variable.

get_var_location(name)#

Get the grid element type that the a given variable is defined on.

The grid topology can be composed of nodes, edges, and faces.

node

A point that has a coordinate pair or triplet: the most basic element of the topology.

edge

A line or curve bounded by two nodes.

face

A plane or surface enclosed by a set of edges. In a 2D horizontal application one may consider the word “polygon”, but in the hierarchy of elements the word “face” is most common.

Parameters:

name (str) – An input or output variable name, a CSDMS Standard Name.

Returns:

The grid location on which the variable is defined. Must be one of “node”, “edge”, or “face”.

Return type:

str

Notes

CSDMS uses the ugrid conventions to define unstructured grids.

get_var_nbytes(name)#

Get the total number of bytes used by a variable.

get_var_type(name)#

Get the data type for a variable.

get_var_units(name)#

Get the unit used by a variable.

initialize(config_file)#

Initialize the component from a file.

BMI-wrapped Landlab components use input files in YAML format. Component-specific parameters are listed at the top level, followed by grid and then time information. An example input file looks like:

flexure:
    eet: 15.e+3
clock:
    start: 0
    stop: 100.
    step: 2.
grid:
    type: raster
    shape: [20, 40]
    spacing: [1000., 2000.]

In this case, a RasterModelGrid is created (with the given shape and spacing) and passed to the underlying landlab component. The eet=15000. is also given to the component but as a keyword parameter. The BMI clock is initialized with the given parameters.

Parameters:

config_file (str or file_like) – YAML-formatted input file for the component.

set_value(name, values)#

Set the values of a variable.

set_value_at_indices(name, inds, src)#

Specify a new value for a model variable at particular indices.

Parameters:
  • name (str) – An input or output variable name, a CSDMS Standard Name.

  • inds (array_like) – The indices into the variable array.

  • src (array_like) – The new value for the specified variable.

update()#

Update the component one time step.

update_frac(frac)#

Update the component a fraction of a time step.

update_until(then)#

Update the component until a given time.

class FastscapeEroderBMI#

Bases: Bmi

Basic Modeling Interface for the FastscapeEroder component.

finalize()#

Clean-up the component.

get_component_name()#

Name of the component.

get_current_time()#

Current component time.

get_end_time()#

Stop time for the component.

get_grid_edge_count(grid)#

Get the number of edges in the grid.

Parameters:

grid (int) – A grid identifier.

Returns:

The total number of grid edges.

Return type:

int

get_grid_edge_nodes(grid, edge_nodes)#

Get the edge-node connectivity.

Parameters:
  • grid (int) – A grid identifier.

  • edge_nodes (ndarray of int, shape (2 x nnodes,)) – A numpy array to place the edge-node connectivity. For each edge, connectivity is given as node at edge tail, followed by node at edge head.

Returns:

The input numpy array that holds the edge-node connectivity.

Return type:

ndarray of int

get_grid_face_count(grid)#

Get the number of faces in the grid.

Parameters:

grid (int) – A grid identifier.

Returns:

The total number of grid faces.

Return type:

int

get_grid_face_edges(grid)#

Get the face-edge connectivity.

Parameters:
  • grid (int) – A grid identifier.

  • face_edges (ndarray of int) – A numpy array to place the face-edge connectivity.

Returns:

The input numpy array that holds the face-edge connectivity.

Return type:

ndarray of int

get_grid_face_nodes(grid, face_nodes)#

Get the face-node connectivity.

Parameters:
  • grid (int) – A grid identifier.

  • face_nodes (ndarray of int) – A numpy array to place the face-node connectivity. For each face, the nodes (listed in a counter-clockwise direction) that form the boundary of the face.

Returns:

The input numpy array that holds the face-node connectivity.

Return type:

ndarray of int

get_grid_node_count(grid)#

Get the number of nodes in the grid.

Parameters:

grid (int) – A grid identifier.

Returns:

The total number of grid nodes.

Return type:

int

get_grid_nodes_per_face(grid, nodes_per_face)#

Get the number of nodes for each face.

Parameters:
  • grid (int) – A grid identifier.

  • nodes_per_face (ndarray of int, shape (nfaces,)) – A numpy array to place the number of nodes per face.

Returns:

The input numpy array that holds the number of nodes per face.

Return type:

ndarray of int

get_grid_origin(grid, origin)#

Get the origin for a structured grid.

get_grid_rank(grid)#

Get the number of dimensions of a grid.

get_grid_shape(grid, shape)#

Get the shape of a structured grid.

get_grid_size(grid)#

Get the total number of elements in the computational grid.

Parameters:

grid (int) – A grid identifier.

Returns:

Size of the grid.

Return type:

int

get_grid_spacing(grid, spacing)#

Get the row and column spacing of a structured grid.

get_grid_type(grid)#

Get the type of grid.

get_grid_x(grid, x)#

Get coordinates of grid nodes in the x direction.

Parameters:
  • grid (int) – A grid identifier.

  • x (ndarray of float, shape (nrows,)) – A numpy array to hold the x-coordinates of the grid node columns.

Returns:

The input numpy array that holds the grid’s column x-coordinates.

Return type:

ndarray of float

get_grid_y(grid, y)#

Get coordinates of grid nodes in the y direction.

Parameters:
  • grid (int) – A grid identifier.

  • y (ndarray of float, shape (ncols,)) – A numpy array to hold the y-coordinates of the grid node rows.

Returns:

The input numpy array that holds the grid’s row y-coordinates.

Return type:

ndarray of float

get_grid_z(grid, z)#

Get coordinates of grid nodes in the z direction.

Parameters:
  • grid (int) – A grid identifier.

  • z (ndarray of float, shape (nlayers,)) – A numpy array to hold the z-coordinates of the grid nodes layers.

Returns:

The input numpy array that holds the grid’s layer z-coordinates.

Return type:

ndarray of float

get_input_item_count()#

Count of a model’s input variables.

Returns:

The number of input variables.

Return type:

int

get_input_var_names()#

Names of the input exchange items.

get_output_item_count()#

Count of a model’s output variables.

Returns:

The number of output variables.

Return type:

int

get_output_var_names()#

Names of the output exchange items.

get_start_time()#

Start time of the component.

get_time_step()#

Component time step.

get_time_units()#

Time units used by the component.

get_value(name, dest)#

Get a copy of a variable’s data.

get_value_at_indices(name, dest, inds)#

Get values at particular indices.

Parameters:
  • name (str) – An input or output variable name, a CSDMS Standard Name.

  • dest (ndarray) – A numpy array into which to place the values.

  • inds (array_like) – The indices into the variable array.

Returns:

Value of the model variable at the given location.

Return type:

array_like

get_value_ptr(name)#

Get a reference to values of the given variable.

This is a getter for the model, used to access the model’s current state. It returns a reference to a model variable, with the return type, size and rank dependent on the variable.

Parameters:

name (str) – An input or output variable name, a CSDMS Standard Name.

Returns:

A reference to a model variable.

Return type:

array_like

get_value_ref(name)#

Get a reference to a variable’s data.

get_var_grid(name)#

Get the grid id for a variable.

get_var_itemsize(name)#

Get the size of elements of a variable.

get_var_location(name)#

Get the grid element type that the a given variable is defined on.

The grid topology can be composed of nodes, edges, and faces.

node

A point that has a coordinate pair or triplet: the most basic element of the topology.

edge

A line or curve bounded by two nodes.

face

A plane or surface enclosed by a set of edges. In a 2D horizontal application one may consider the word “polygon”, but in the hierarchy of elements the word “face” is most common.

Parameters:

name (str) – An input or output variable name, a CSDMS Standard Name.

Returns:

The grid location on which the variable is defined. Must be one of “node”, “edge”, or “face”.

Return type:

str

Notes

CSDMS uses the ugrid conventions to define unstructured grids.

get_var_nbytes(name)#

Get the total number of bytes used by a variable.

get_var_type(name)#

Get the data type for a variable.

get_var_units(name)#

Get the unit used by a variable.

initialize(config_file)#

Initialize the component from a file.

BMI-wrapped Landlab components use input files in YAML format. Component-specific parameters are listed at the top level, followed by grid and then time information. An example input file looks like:

flexure:
    eet: 15.e+3
clock:
    start: 0
    stop: 100.
    step: 2.
grid:
    type: raster
    shape: [20, 40]
    spacing: [1000., 2000.]

In this case, a RasterModelGrid is created (with the given shape and spacing) and passed to the underlying landlab component. The eet=15000. is also given to the component but as a keyword parameter. The BMI clock is initialized with the given parameters.

Parameters:

config_file (str or file_like) – YAML-formatted input file for the component.

set_value(name, values)#

Set the values of a variable.

set_value_at_indices(name, inds, src)#

Specify a new value for a model variable at particular indices.

Parameters:
  • name (str) – An input or output variable name, a CSDMS Standard Name.

  • inds (array_like) – The indices into the variable array.

  • src (array_like) – The new value for the specified variable.

update()#

Update the component one time step.

update_frac(frac)#

Update the component a fraction of a time step.

update_until(then)#

Update the component until a given time.

class FireGeneratorBMI#

Bases: Bmi

Basic Modeling Interface for the FireGenerator component.

finalize()#

Clean-up the component.

get_component_name()#

Name of the component.

get_current_time()#

Current component time.

get_end_time()#

Stop time for the component.

get_grid_edge_count(grid)#

Get the number of edges in the grid.

Parameters:

grid (int) – A grid identifier.

Returns:

The total number of grid edges.

Return type:

int

get_grid_edge_nodes(grid, edge_nodes)#

Get the edge-node connectivity.

Parameters:
  • grid (int) – A grid identifier.

  • edge_nodes (ndarray of int, shape (2 x nnodes,)) – A numpy array to place the edge-node connectivity. For each edge, connectivity is given as node at edge tail, followed by node at edge head.

Returns:

The input numpy array that holds the edge-node connectivity.

Return type:

ndarray of int

get_grid_face_count(grid)#

Get the number of faces in the grid.

Parameters:

grid (int) – A grid identifier.

Returns:

The total number of grid faces.

Return type:

int

get_grid_face_edges(grid)#

Get the face-edge connectivity.

Parameters:
  • grid (int) – A grid identifier.

  • face_edges (ndarray of int) – A numpy array to place the face-edge connectivity.

Returns:

The input numpy array that holds the face-edge connectivity.

Return type:

ndarray of int

get_grid_face_nodes(grid, face_nodes)#

Get the face-node connectivity.

Parameters:
  • grid (int) – A grid identifier.

  • face_nodes (ndarray of int) – A numpy array to place the face-node connectivity. For each face, the nodes (listed in a counter-clockwise direction) that form the boundary of the face.

Returns:

The input numpy array that holds the face-node connectivity.

Return type:

ndarray of int

get_grid_node_count(grid)#

Get the number of nodes in the grid.

Parameters:

grid (int) – A grid identifier.

Returns:

The total number of grid nodes.

Return type:

int

get_grid_nodes_per_face(grid, nodes_per_face)#

Get the number of nodes for each face.

Parameters:
  • grid (int) – A grid identifier.

  • nodes_per_face (ndarray of int, shape (nfaces,)) – A numpy array to place the number of nodes per face.

Returns:

The input numpy array that holds the number of nodes per face.

Return type:

ndarray of int

get_grid_origin(grid, origin)#

Get the origin for a structured grid.

get_grid_rank(grid)#

Get the number of dimensions of a grid.

get_grid_shape(grid, shape)#

Get the shape of a structured grid.

get_grid_size(grid)#

Get the total number of elements in the computational grid.

Parameters:

grid (int) – A grid identifier.

Returns:

Size of the grid.

Return type:

int

get_grid_spacing(grid, spacing)#

Get the row and column spacing of a structured grid.

get_grid_type(grid)#

Get the type of grid.

get_grid_x(grid, x)#

Get coordinates of grid nodes in the x direction.

Parameters:
  • grid (int) – A grid identifier.

  • x (ndarray of float, shape (nrows,)) – A numpy array to hold the x-coordinates of the grid node columns.

Returns:

The input numpy array that holds the grid’s column x-coordinates.

Return type:

ndarray of float

get_grid_y(grid, y)#

Get coordinates of grid nodes in the y direction.

Parameters:
  • grid (int) – A grid identifier.

  • y (ndarray of float, shape (ncols,)) – A numpy array to hold the y-coordinates of the grid node rows.

Returns:

The input numpy array that holds the grid’s row y-coordinates.

Return type:

ndarray of float

get_grid_z(grid, z)#

Get coordinates of grid nodes in the z direction.

Parameters:
  • grid (int) – A grid identifier.

  • z (ndarray of float, shape (nlayers,)) – A numpy array to hold the z-coordinates of the grid nodes layers.

Returns:

The input numpy array that holds the grid’s layer z-coordinates.

Return type:

ndarray of float

get_input_item_count()#

Count of a model’s input variables.

Returns:

The number of input variables.

Return type:

int

get_input_var_names()#

Names of the input exchange items.

get_output_item_count()#

Count of a model’s output variables.

Returns:

The number of output variables.

Return type:

int

get_output_var_names()#

Names of the output exchange items.

get_start_time()#

Start time of the component.

get_time_step()#

Component time step.

get_time_units()#

Time units used by the component.

get_value(name, dest)#

Get a copy of a variable’s data.

get_value_at_indices(name, dest, inds)#

Get values at particular indices.

Parameters:
  • name (str) – An input or output variable name, a CSDMS Standard Name.

  • dest (ndarray) – A numpy array into which to place the values.

  • inds (array_like) – The indices into the variable array.

Returns:

Value of the model variable at the given location.

Return type:

array_like

get_value_ptr(name)#

Get a reference to values of the given variable.

This is a getter for the model, used to access the model’s current state. It returns a reference to a model variable, with the return type, size and rank dependent on the variable.

Parameters:

name (str) – An input or output variable name, a CSDMS Standard Name.

Returns:

A reference to a model variable.

Return type:

array_like

get_value_ref(name)#

Get a reference to a variable’s data.

get_var_grid(name)#

Get the grid id for a variable.

get_var_itemsize(name)#

Get the size of elements of a variable.

get_var_location(name)#

Get the grid element type that the a given variable is defined on.

The grid topology can be composed of nodes, edges, and faces.

node

A point that has a coordinate pair or triplet: the most basic element of the topology.

edge

A line or curve bounded by two nodes.

face

A plane or surface enclosed by a set of edges. In a 2D horizontal application one may consider the word “polygon”, but in the hierarchy of elements the word “face” is most common.

Parameters:

name (str) – An input or output variable name, a CSDMS Standard Name.

Returns:

The grid location on which the variable is defined. Must be one of “node”, “edge”, or “face”.

Return type:

str

Notes

CSDMS uses the ugrid conventions to define unstructured grids.

get_var_nbytes(name)#

Get the total number of bytes used by a variable.

get_var_type(name)#

Get the data type for a variable.

get_var_units(name)#

Get the unit used by a variable.

initialize(config_file)#

Initialize the component from a file.

BMI-wrapped Landlab components use input files in YAML format. Component-specific parameters are listed at the top level, followed by grid and then time information. An example input file looks like:

flexure:
    eet: 15.e+3
clock:
    start: 0
    stop: 100.
    step: 2.
grid:
    type: raster
    shape: [20, 40]
    spacing: [1000., 2000.]

In this case, a RasterModelGrid is created (with the given shape and spacing) and passed to the underlying landlab component. The eet=15000. is also given to the component but as a keyword parameter. The BMI clock is initialized with the given parameters.

Parameters:

config_file (str or file_like) – YAML-formatted input file for the component.

set_value(name, values)#

Set the values of a variable.

set_value_at_indices(name, inds, src)#

Specify a new value for a model variable at particular indices.

Parameters:
  • name (str) – An input or output variable name, a CSDMS Standard Name.

  • inds (array_like) – The indices into the variable array.

  • src (array_like) – The new value for the specified variable.

update()#

Update the component one time step.

update_frac(frac)#

Update the component a fraction of a time step.

update_until(then)#

Update the component until a given time.

class Flexure1DBMI#

Bases: Bmi

Basic Modeling Interface for the Flexure1D component.

finalize()#

Clean-up the component.

get_component_name()#

Name of the component.

get_current_time()#

Current component time.

get_end_time()#

Stop time for the component.

get_grid_edge_count(grid)#

Get the number of edges in the grid.

Parameters:

grid (int) – A grid identifier.

Returns:

The total number of grid edges.

Return type:

int

get_grid_edge_nodes(grid, edge_nodes)#

Get the edge-node connectivity.

Parameters:
  • grid (int) – A grid identifier.

  • edge_nodes (ndarray of int, shape (2 x nnodes,)) – A numpy array to place the edge-node connectivity. For each edge, connectivity is given as node at edge tail, followed by node at edge head.

Returns:

The input numpy array that holds the edge-node connectivity.

Return type:

ndarray of int

get_grid_face_count(grid)#

Get the number of faces in the grid.

Parameters:

grid (int) – A grid identifier.

Returns:

The total number of grid faces.

Return type:

int

get_grid_face_edges(grid)#

Get the face-edge connectivity.

Parameters:
  • grid (int) – A grid identifier.

  • face_edges (ndarray of int) – A numpy array to place the face-edge connectivity.

Returns:

The input numpy array that holds the face-edge connectivity.

Return type:

ndarray of int

get_grid_face_nodes(grid, face_nodes)#

Get the face-node connectivity.

Parameters:
  • grid (int) – A grid identifier.

  • face_nodes (ndarray of int) – A numpy array to place the face-node connectivity. For each face, the nodes (listed in a counter-clockwise direction) that form the boundary of the face.

Returns:

The input numpy array that holds the face-node connectivity.

Return type:

ndarray of int

get_grid_node_count(grid)#

Get the number of nodes in the grid.

Parameters:

grid (int) – A grid identifier.

Returns:

The total number of grid nodes.

Return type:

int

get_grid_nodes_per_face(grid, nodes_per_face)#

Get the number of nodes for each face.

Parameters:
  • grid (int) – A grid identifier.

  • nodes_per_face (ndarray of int, shape (nfaces,)) – A numpy array to place the number of nodes per face.

Returns:

The input numpy array that holds the number of nodes per face.

Return type:

ndarray of int

get_grid_origin(grid, origin)#

Get the origin for a structured grid.

get_grid_rank(grid)#

Get the number of dimensions of a grid.

get_grid_shape(grid, shape)#

Get the shape of a structured grid.

get_grid_size(grid)#

Get the total number of elements in the computational grid.

Parameters:

grid (int) – A grid identifier.

Returns:

Size of the grid.

Return type:

int

get_grid_spacing(grid, spacing)#

Get the row and column spacing of a structured grid.

get_grid_type(grid)#

Get the type of grid.

get_grid_x(grid, x)#

Get coordinates of grid nodes in the x direction.

Parameters:
  • grid (int) – A grid identifier.

  • x (ndarray of float, shape (nrows,)) – A numpy array to hold the x-coordinates of the grid node columns.

Returns:

The input numpy array that holds the grid’s column x-coordinates.

Return type:

ndarray of float

get_grid_y(grid, y)#

Get coordinates of grid nodes in the y direction.

Parameters:
  • grid (int) – A grid identifier.

  • y (ndarray of float, shape (ncols,)) – A numpy array to hold the y-coordinates of the grid node rows.

Returns:

The input numpy array that holds the grid’s row y-coordinates.

Return type:

ndarray of float

get_grid_z(grid, z)#

Get coordinates of grid nodes in the z direction.

Parameters:
  • grid (int) – A grid identifier.

  • z (ndarray of float, shape (nlayers,)) – A numpy array to hold the z-coordinates of the grid nodes layers.

Returns:

The input numpy array that holds the grid’s layer z-coordinates.

Return type:

ndarray of float

get_input_item_count()#

Count of a model’s input variables.

Returns:

The number of input variables.

Return type:

int

get_input_var_names()#

Names of the input exchange items.

get_output_item_count()#

Count of a model’s output variables.

Returns:

The number of output variables.

Return type:

int

get_output_var_names()#

Names of the output exchange items.

get_start_time()#

Start time of the component.

get_time_step()#

Component time step.

get_time_units()#

Time units used by the component.

get_value(name, dest)#

Get a copy of a variable’s data.

get_value_at_indices(name, dest, inds)#

Get values at particular indices.

Parameters:
  • name (str) – An input or output variable name, a CSDMS Standard Name.

  • dest (ndarray) – A numpy array into which to place the values.

  • inds (array_like) – The indices into the variable array.

Returns:

Value of the model variable at the given location.

Return type:

array_like

get_value_ptr(name)#

Get a reference to values of the given variable.

This is a getter for the model, used to access the model’s current state. It returns a reference to a model variable, with the return type, size and rank dependent on the variable.

Parameters:

name (str) – An input or output variable name, a CSDMS Standard Name.

Returns:

A reference to a model variable.

Return type:

array_like

get_value_ref(name)#

Get a reference to a variable’s data.

get_var_grid(name)#

Get the grid id for a variable.

get_var_itemsize(name)#

Get the size of elements of a variable.

get_var_location(name)#

Get the grid element type that the a given variable is defined on.

The grid topology can be composed of nodes, edges, and faces.

node

A point that has a coordinate pair or triplet: the most basic element of the topology.

edge

A line or curve bounded by two nodes.

face

A plane or surface enclosed by a set of edges. In a 2D horizontal application one may consider the word “polygon”, but in the hierarchy of elements the word “face” is most common.

Parameters:

name (str) – An input or output variable name, a CSDMS Standard Name.

Returns:

The grid location on which the variable is defined. Must be one of “node”, “edge”, or “face”.

Return type:

str

Notes

CSDMS uses the ugrid conventions to define unstructured grids.

get_var_nbytes(name)#

Get the total number of bytes used by a variable.

get_var_type(name)#

Get the data type for a variable.

get_var_units(name)#

Get the unit used by a variable.

initialize(config_file)#

Initialize the component from a file.

BMI-wrapped Landlab components use input files in YAML format. Component-specific parameters are listed at the top level, followed by grid and then time information. An example input file looks like:

flexure:
    eet: 15.e+3
clock:
    start: 0
    stop: 100.
    step: 2.
grid:
    type: raster
    shape: [20, 40]
    spacing: [1000., 2000.]

In this case, a RasterModelGrid is created (with the given shape and spacing) and passed to the underlying landlab component. The eet=15000. is also given to the component but as a keyword parameter. The BMI clock is initialized with the given parameters.

Parameters:

config_file (str or file_like) – YAML-formatted input file for the component.

set_value(name, values)#

Set the values of a variable.

set_value_at_indices(name, inds, src)#

Specify a new value for a model variable at particular indices.

Parameters:
  • name (str) – An input or output variable name, a CSDMS Standard Name.

  • inds (array_like) – The indices into the variable array.

  • src (array_like) – The new value for the specified variable.

update()#

Update the component one time step.

update_frac(frac)#

Update the component a fraction of a time step.

update_until(then)#

Update the component until a given time.

class FlexureBMI#

Bases: Bmi

Basic Modeling Interface for the Flexure component.

finalize()#

Clean-up the component.

get_component_name()#

Name of the component.

get_current_time()#

Current component time.

get_end_time()#

Stop time for the component.

get_grid_edge_count(grid)#

Get the number of edges in the grid.

Parameters:

grid (int) – A grid identifier.

Returns:

The total number of grid edges.

Return type:

int

get_grid_edge_nodes(grid, edge_nodes)#

Get the edge-node connectivity.

Parameters:
  • grid (int) – A grid identifier.

  • edge_nodes (ndarray of int, shape (2 x nnodes,)) – A numpy array to place the edge-node connectivity. For each edge, connectivity is given as node at edge tail, followed by node at edge head.

Returns:

The input numpy array that holds the edge-node connectivity.

Return type:

ndarray of int

get_grid_face_count(grid)#

Get the number of faces in the grid.

Parameters:

grid (int) – A grid identifier.

Returns:

The total number of grid faces.

Return type:

int

get_grid_face_edges(grid)#

Get the face-edge connectivity.

Parameters:
  • grid (int) – A grid identifier.

  • face_edges (ndarray of int) – A numpy array to place the face-edge connectivity.

Returns:

The input numpy array that holds the face-edge connectivity.

Return type:

ndarray of int

get_grid_face_nodes(grid, face_nodes)#

Get the face-node connectivity.

Parameters:
  • grid (int) – A grid identifier.

  • face_nodes (ndarray of int) – A numpy array to place the face-node connectivity. For each face, the nodes (listed in a counter-clockwise direction) that form the boundary of the face.

Returns:

The input numpy array that holds the face-node connectivity.

Return type:

ndarray of int

get_grid_node_count(grid)#

Get the number of nodes in the grid.

Parameters:

grid (int) – A grid identifier.

Returns:

The total number of grid nodes.

Return type:

int

get_grid_nodes_per_face(grid, nodes_per_face)#

Get the number of nodes for each face.

Parameters:
  • grid (int) – A grid identifier.

  • nodes_per_face (ndarray of int, shape (nfaces,)) – A numpy array to place the number of nodes per face.

Returns:

The input numpy array that holds the number of nodes per face.

Return type:

ndarray of int

get_grid_origin(grid, origin)#

Get the origin for a structured grid.

get_grid_rank(grid)#

Get the number of dimensions of a grid.

get_grid_shape(grid, shape)#

Get the shape of a structured grid.

get_grid_size(grid)#

Get the total number of elements in the computational grid.

Parameters:

grid (int) – A grid identifier.

Returns:

Size of the grid.

Return type:

int

get_grid_spacing(grid, spacing)#

Get the row and column spacing of a structured grid.

get_grid_type(grid)#

Get the type of grid.

get_grid_x(grid, x)#

Get coordinates of grid nodes in the x direction.

Parameters:
  • grid (int) – A grid identifier.

  • x (ndarray of float, shape (nrows,)) – A numpy array to hold the x-coordinates of the grid node columns.

Returns:

The input numpy array that holds the grid’s column x-coordinates.

Return type:

ndarray of float

get_grid_y(grid, y)#

Get coordinates of grid nodes in the y direction.

Parameters:
  • grid (int) – A grid identifier.

  • y (ndarray of float, shape (ncols,)) – A numpy array to hold the y-coordinates of the grid node rows.

Returns:

The input numpy array that holds the grid’s row y-coordinates.

Return type:

ndarray of float

get_grid_z(grid, z)#

Get coordinates of grid nodes in the z direction.

Parameters:
  • grid (int) – A grid identifier.

  • z (ndarray of float, shape (nlayers,)) – A numpy array to hold the z-coordinates of the grid nodes layers.

Returns:

The input numpy array that holds the grid’s layer z-coordinates.

Return type:

ndarray of float

get_input_item_count()#

Count of a model’s input variables.

Returns:

The number of input variables.

Return type:

int

get_input_var_names()#

Names of the input exchange items.

get_output_item_count()#

Count of a model’s output variables.

Returns:

The number of output variables.

Return type:

int

get_output_var_names()#

Names of the output exchange items.

get_start_time()#

Start time of the component.

get_time_step()#

Component time step.

get_time_units()#

Time units used by the component.

get_value(name, dest)#

Get a copy of a variable’s data.

get_value_at_indices(name, dest, inds)#

Get values at particular indices.

Parameters:
  • name (str) – An input or output variable name, a CSDMS Standard Name.

  • dest (ndarray) – A numpy array into which to place the values.

  • inds (array_like) – The indices into the variable array.

Returns:

Value of the model variable at the given location.

Return type:

array_like

get_value_ptr(name)#

Get a reference to values of the given variable.

This is a getter for the model, used to access the model’s current state. It returns a reference to a model variable, with the return type, size and rank dependent on the variable.

Parameters:

name (str) – An input or output variable name, a CSDMS Standard Name.

Returns:

A reference to a model variable.

Return type:

array_like

get_value_ref(name)#

Get a reference to a variable’s data.

get_var_grid(name)#

Get the grid id for a variable.

get_var_itemsize(name)#

Get the size of elements of a variable.

get_var_location(name)#

Get the grid element type that the a given variable is defined on.

The grid topology can be composed of nodes, edges, and faces.

node

A point that has a coordinate pair or triplet: the most basic element of the topology.

edge

A line or curve bounded by two nodes.

face

A plane or surface enclosed by a set of edges. In a 2D horizontal application one may consider the word “polygon”, but in the hierarchy of elements the word “face” is most common.

Parameters:

name (str) – An input or output variable name, a CSDMS Standard Name.

Returns:

The grid location on which the variable is defined. Must be one of “node”, “edge”, or “face”.

Return type:

str

Notes

CSDMS uses the ugrid conventions to define unstructured grids.

get_var_nbytes(name)#

Get the total number of bytes used by a variable.

get_var_type(name)#

Get the data type for a variable.

get_var_units(name)#

Get the unit used by a variable.

initialize(config_file)#

Initialize the component from a file.

BMI-wrapped Landlab components use input files in YAML format. Component-specific parameters are listed at the top level, followed by grid and then time information. An example input file looks like:

flexure:
    eet: 15.e+3
clock:
    start: 0
    stop: 100.
    step: 2.
grid:
    type: raster
    shape: [20, 40]
    spacing: [1000., 2000.]

In this case, a RasterModelGrid is created (with the given shape and spacing) and passed to the underlying landlab component. The eet=15000. is also given to the component but as a keyword parameter. The BMI clock is initialized with the given parameters.

Parameters:

config_file (str or file_like) – YAML-formatted input file for the component.

set_value(name, values)#

Set the values of a variable.

set_value_at_indices(name, inds, src)#

Specify a new value for a model variable at particular indices.

Parameters:
  • name (str) – An input or output variable name, a CSDMS Standard Name.

  • inds (array_like) – The indices into the variable array.

  • src (array_like) – The new value for the specified variable.

update()#

Update the component one time step.

update_frac(frac)#

Update the component a fraction of a time step.

update_until(then)#

Update the component until a given time.

class FlowAccumulatorBMI#

Bases: Bmi

Basic Modeling Interface for the FlowAccumulator component.

finalize()#

Clean-up the component.

get_component_name()#

Name of the component.

get_current_time()#

Current component time.

get_end_time()#

Stop time for the component.

get_grid_edge_count(grid)#

Get the number of edges in the grid.

Parameters:

grid (int) – A grid identifier.

Returns:

The total number of grid edges.

Return type:

int

get_grid_edge_nodes(grid, edge_nodes)#

Get the edge-node connectivity.

Parameters:
  • grid (int) – A grid identifier.

  • edge_nodes (ndarray of int, shape (2 x nnodes,)) – A numpy array to place the edge-node connectivity. For each edge, connectivity is given as node at edge tail, followed by node at edge head.

Returns:

The input numpy array that holds the edge-node connectivity.

Return type:

ndarray of int

get_grid_face_count(grid)#

Get the number of faces in the grid.

Parameters:

grid (int) – A grid identifier.

Returns:

The total number of grid faces.

Return type:

int

get_grid_face_edges(grid)#

Get the face-edge connectivity.

Parameters:
  • grid (int) – A grid identifier.

  • face_edges (ndarray of int) – A numpy array to place the face-edge connectivity.

Returns:

The input numpy array that holds the face-edge connectivity.

Return type:

ndarray of int

get_grid_face_nodes(grid, face_nodes)#

Get the face-node connectivity.

Parameters:
  • grid (int) – A grid identifier.

  • face_nodes (ndarray of int) – A numpy array to place the face-node connectivity. For each face, the nodes (listed in a counter-clockwise direction) that form the boundary of the face.

Returns:

The input numpy array that holds the face-node connectivity.

Return type:

ndarray of int

get_grid_node_count(grid)#

Get the number of nodes in the grid.

Parameters:

grid (int) – A grid identifier.

Returns:

The total number of grid nodes.

Return type:

int

get_grid_nodes_per_face(grid, nodes_per_face)#

Get the number of nodes for each face.

Parameters:
  • grid (int) – A grid identifier.

  • nodes_per_face (ndarray of int, shape (nfaces,)) – A numpy array to place the number of nodes per face.

Returns:

The input numpy array that holds the number of nodes per face.

Return type:

ndarray of int

get_grid_origin(grid, origin)#

Get the origin for a structured grid.

get_grid_rank(grid)#

Get the number of dimensions of a grid.

get_grid_shape(grid, shape)#

Get the shape of a structured grid.

get_grid_size(grid)#

Get the total number of elements in the computational grid.

Parameters:

grid (int) – A grid identifier.

Returns:

Size of the grid.

Return type:

int

get_grid_spacing(grid, spacing)#

Get the row and column spacing of a structured grid.

get_grid_type(grid)#

Get the type of grid.

get_grid_x(grid, x)#

Get coordinates of grid nodes in the x direction.

Parameters:
  • grid (int) – A grid identifier.

  • x (ndarray of float, shape (nrows,)) – A numpy array to hold the x-coordinates of the grid node columns.

Returns:

The input numpy array that holds the grid’s column x-coordinates.

Return type:

ndarray of float

get_grid_y(grid, y)#

Get coordinates of grid nodes in the y direction.

Parameters:
  • grid (int) – A grid identifier.

  • y (ndarray of float, shape (ncols,)) – A numpy array to hold the y-coordinates of the grid node rows.

Returns:

The input numpy array that holds the grid’s row y-coordinates.

Return type:

ndarray of float

get_grid_z(grid, z)#

Get coordinates of grid nodes in the z direction.

Parameters:
  • grid (int) – A grid identifier.

  • z (ndarray of float, shape (nlayers,)) – A numpy array to hold the z-coordinates of the grid nodes layers.

Returns:

The input numpy array that holds the grid’s layer z-coordinates.

Return type:

ndarray of float

get_input_item_count()#

Count of a model’s input variables.

Returns:

The number of input variables.

Return type:

int

get_input_var_names()#

Names of the input exchange items.

get_output_item_count()#

Count of a model’s output variables.

Returns:

The number of output variables.

Return type:

int

get_output_var_names()#

Names of the output exchange items.

get_start_time()#

Start time of the component.

get_time_step()#

Component time step.

get_time_units()#

Time units used by the component.

get_value(name, dest)#

Get a copy of a variable’s data.

get_value_at_indices(name, dest, inds)#

Get values at particular indices.

Parameters:
  • name (str) – An input or output variable name, a CSDMS Standard Name.

  • dest (ndarray) – A numpy array into which to place the values.

  • inds (array_like) – The indices into the variable array.

Returns:

Value of the model variable at the given location.

Return type:

array_like

get_value_ptr(name)#

Get a reference to values of the given variable.

This is a getter for the model, used to access the model’s current state. It returns a reference to a model variable, with the return type, size and rank dependent on the variable.

Parameters:

name (str) – An input or output variable name, a CSDMS Standard Name.

Returns:

A reference to a model variable.

Return type:

array_like

get_value_ref(name)#

Get a reference to a variable’s data.

get_var_grid(name)#

Get the grid id for a variable.

get_var_itemsize(name)#

Get the size of elements of a variable.

get_var_location(name)#

Get the grid element type that the a given variable is defined on.

The grid topology can be composed of nodes, edges, and faces.

node

A point that has a coordinate pair or triplet: the most basic element of the topology.

edge

A line or curve bounded by two nodes.

face

A plane or surface enclosed by a set of edges. In a 2D horizontal application one may consider the word “polygon”, but in the hierarchy of elements the word “face” is most common.

Parameters:

name (str) – An input or output variable name, a CSDMS Standard Name.

Returns:

The grid location on which the variable is defined. Must be one of “node”, “edge”, or “face”.

Return type:

str

Notes

CSDMS uses the ugrid conventions to define unstructured grids.

get_var_nbytes(name)#

Get the total number of bytes used by a variable.

get_var_type(name)#

Get the data type for a variable.

get_var_units(name)#

Get the unit used by a variable.

initialize(config_file)#

Initialize the component from a file.

BMI-wrapped Landlab components use input files in YAML format. Component-specific parameters are listed at the top level, followed by grid and then time information. An example input file looks like:

flexure:
    eet: 15.e+3
clock:
    start: 0
    stop: 100.
    step: 2.
grid:
    type: raster
    shape: [20, 40]
    spacing: [1000., 2000.]

In this case, a RasterModelGrid is created (with the given shape and spacing) and passed to the underlying landlab component. The eet=15000. is also given to the component but as a keyword parameter. The BMI clock is initialized with the given parameters.

Parameters:

config_file (str or file_like) – YAML-formatted input file for the component.

set_value(name, values)#

Set the values of a variable.

set_value_at_indices(name, inds, src)#

Specify a new value for a model variable at particular indices.

Parameters:
  • name (str) – An input or output variable name, a CSDMS Standard Name.

  • inds (array_like) – The indices into the variable array.

  • src (array_like) – The new value for the specified variable.

update()#

Update the component one time step.

update_frac(frac)#

Update the component a fraction of a time step.

update_until(then)#

Update the component until a given time.

class FlowDirectorD8BMI#

Bases: Bmi

Basic Modeling Interface for the FlowDirectorD8 component.

finalize()#

Clean-up the component.

get_component_name()#

Name of the component.

get_current_time()#

Current component time.

get_end_time()#

Stop time for the component.

get_grid_edge_count(grid)#

Get the number of edges in the grid.

Parameters:

grid (int) – A grid identifier.

Returns:

The total number of grid edges.

Return type:

int

get_grid_edge_nodes(grid, edge_nodes)#

Get the edge-node connectivity.

Parameters:
  • grid (int) – A grid identifier.

  • edge_nodes (ndarray of int, shape (2 x nnodes,)) – A numpy array to place the edge-node connectivity. For each edge, connectivity is given as node at edge tail, followed by node at edge head.

Returns:

The input numpy array that holds the edge-node connectivity.

Return type:

ndarray of int

get_grid_face_count(grid)#

Get the number of faces in the grid.

Parameters:

grid (int) – A grid identifier.

Returns:

The total number of grid faces.

Return type:

int

get_grid_face_edges(grid)#

Get the face-edge connectivity.

Parameters:
  • grid (int) – A grid identifier.

  • face_edges (ndarray of int) – A numpy array to place the face-edge connectivity.

Returns:

The input numpy array that holds the face-edge connectivity.

Return type:

ndarray of int

get_grid_face_nodes(grid, face_nodes)#

Get the face-node connectivity.

Parameters:
  • grid (int) – A grid identifier.

  • face_nodes (ndarray of int) – A numpy array to place the face-node connectivity. For each face, the nodes (listed in a counter-clockwise direction) that form the boundary of the face.

Returns:

The input numpy array that holds the face-node connectivity.

Return type:

ndarray of int

get_grid_node_count(grid)#

Get the number of nodes in the grid.

Parameters:

grid (int) – A grid identifier.

Returns:

The total number of grid nodes.

Return type:

int

get_grid_nodes_per_face(grid, nodes_per_face)#

Get the number of nodes for each face.

Parameters:
  • grid (int) – A grid identifier.

  • nodes_per_face (ndarray of int, shape (nfaces,)) – A numpy array to place the number of nodes per face.

Returns:

The input numpy array that holds the number of nodes per face.

Return type:

ndarray of int

get_grid_origin(grid, origin)#

Get the origin for a structured grid.

get_grid_rank(grid)#

Get the number of dimensions of a grid.

get_grid_shape(grid, shape)#

Get the shape of a structured grid.

get_grid_size(grid)#

Get the total number of elements in the computational grid.

Parameters:

grid (int) – A grid identifier.

Returns:

Size of the grid.

Return type:

int

get_grid_spacing(grid, spacing)#

Get the row and column spacing of a structured grid.

get_grid_type(grid)#

Get the type of grid.

get_grid_x(grid, x)#

Get coordinates of grid nodes in the x direction.

Parameters:
  • grid (int) – A grid identifier.

  • x (ndarray of float, shape (nrows,)) – A numpy array to hold the x-coordinates of the grid node columns.

Returns:

The input numpy array that holds the grid’s column x-coordinates.

Return type:

ndarray of float

get_grid_y(grid, y)#

Get coordinates of grid nodes in the y direction.

Parameters:
  • grid (int) – A grid identifier.

  • y (ndarray of float, shape (ncols,)) – A numpy array to hold the y-coordinates of the grid node rows.

Returns:

The input numpy array that holds the grid’s row y-coordinates.

Return type:

ndarray of float

get_grid_z(grid, z)#

Get coordinates of grid nodes in the z direction.

Parameters:
  • grid (int) – A grid identifier.

  • z (ndarray of float, shape (nlayers,)) – A numpy array to hold the z-coordinates of the grid nodes layers.

Returns:

The input numpy array that holds the grid’s layer z-coordinates.

Return type:

ndarray of float

get_input_item_count()#

Count of a model’s input variables.

Returns:

The number of input variables.

Return type:

int

get_input_var_names()#

Names of the input exchange items.

get_output_item_count()#

Count of a model’s output variables.

Returns:

The number of output variables.

Return type:

int

get_output_var_names()#

Names of the output exchange items.

get_start_time()#

Start time of the component.

get_time_step()#

Component time step.

get_time_units()#

Time units used by the component.

get_value(name, dest)#

Get a copy of a variable’s data.

get_value_at_indices(name, dest, inds)#

Get values at particular indices.

Parameters:
  • name (str) – An input or output variable name, a CSDMS Standard Name.

  • dest (ndarray) – A numpy array into which to place the values.

  • inds (array_like) – The indices into the variable array.

Returns:

Value of the model variable at the given location.

Return type:

array_like

get_value_ptr(name)#

Get a reference to values of the given variable.

This is a getter for the model, used to access the model’s current state. It returns a reference to a model variable, with the return type, size and rank dependent on the variable.

Parameters:

name (str) – An input or output variable name, a CSDMS Standard Name.

Returns:

A reference to a model variable.

Return type:

array_like

get_value_ref(name)#

Get a reference to a variable’s data.

get_var_grid(name)#

Get the grid id for a variable.

get_var_itemsize(name)#

Get the size of elements of a variable.

get_var_location(name)#

Get the grid element type that the a given variable is defined on.

The grid topology can be composed of nodes, edges, and faces.

node

A point that has a coordinate pair or triplet: the most basic element of the topology.

edge

A line or curve bounded by two nodes.

face

A plane or surface enclosed by a set of edges. In a 2D horizontal application one may consider the word “polygon”, but in the hierarchy of elements the word “face” is most common.

Parameters:

name (str) – An input or output variable name, a CSDMS Standard Name.

Returns:

The grid location on which the variable is defined. Must be one of “node”, “edge”, or “face”.

Return type:

str

Notes

CSDMS uses the ugrid conventions to define unstructured grids.

get_var_nbytes(name)#

Get the total number of bytes used by a variable.

get_var_type(name)#

Get the data type for a variable.

get_var_units(name)#

Get the unit used by a variable.

initialize(config_file)#

Initialize the component from a file.

BMI-wrapped Landlab components use input files in YAML format. Component-specific parameters are listed at the top level, followed by grid and then time information. An example input file looks like:

flexure:
    eet: 15.e+3
clock:
    start: 0
    stop: 100.
    step: 2.
grid:
    type: raster
    shape: [20, 40]
    spacing: [1000., 2000.]

In this case, a RasterModelGrid is created (with the given shape and spacing) and passed to the underlying landlab component. The eet=15000. is also given to the component but as a keyword parameter. The BMI clock is initialized with the given parameters.

Parameters:

config_file (str or file_like) – YAML-formatted input file for the component.

set_value(name, values)#

Set the values of a variable.

set_value_at_indices(name, inds, src)#

Specify a new value for a model variable at particular indices.

Parameters:
  • name (str) – An input or output variable name, a CSDMS Standard Name.

  • inds (array_like) – The indices into the variable array.

  • src (array_like) – The new value for the specified variable.

update()#

Update the component one time step.

update_frac(frac)#

Update the component a fraction of a time step.

update_until(then)#

Update the component until a given time.

class FlowDirectorDINFBMI#

Bases: Bmi

Basic Modeling Interface for the FlowDirectorDINF component.

finalize()#

Clean-up the component.

get_component_name()#

Name of the component.

get_current_time()#

Current component time.

get_end_time()#

Stop time for the component.

get_grid_edge_count(grid)#

Get the number of edges in the grid.

Parameters:

grid (int) – A grid identifier.

Returns:

The total number of grid edges.

Return type:

int

get_grid_edge_nodes(grid, edge_nodes)#

Get the edge-node connectivity.

Parameters:
  • grid (int) – A grid identifier.

  • edge_nodes (ndarray of int, shape (2 x nnodes,)) – A numpy array to place the edge-node connectivity. For each edge, connectivity is given as node at edge tail, followed by node at edge head.

Returns:

The input numpy array that holds the edge-node connectivity.

Return type:

ndarray of int

get_grid_face_count(grid)#

Get the number of faces in the grid.

Parameters:

grid (int) – A grid identifier.

Returns:

The total number of grid faces.

Return type:

int

get_grid_face_edges(grid)#

Get the face-edge connectivity.

Parameters:
  • grid (int) – A grid identifier.

  • face_edges (ndarray of int) – A numpy array to place the face-edge connectivity.

Returns:

The input numpy array that holds the face-edge connectivity.

Return type:

ndarray of int

get_grid_face_nodes(grid, face_nodes)#

Get the face-node connectivity.

Parameters:
  • grid (int) – A grid identifier.

  • face_nodes (ndarray of int) – A numpy array to place the face-node connectivity. For each face, the nodes (listed in a counter-clockwise direction) that form the boundary of the face.

Returns:

The input numpy array that holds the face-node connectivity.

Return type:

ndarray of int

get_grid_node_count(grid)#

Get the number of nodes in the grid.

Parameters:

grid (int) – A grid identifier.

Returns:

The total number of grid nodes.

Return type:

int

get_grid_nodes_per_face(grid, nodes_per_face)#

Get the number of nodes for each face.

Parameters:
  • grid (int) – A grid identifier.

  • nodes_per_face (ndarray of int, shape (nfaces,)) – A numpy array to place the number of nodes per face.

Returns:

The input numpy array that holds the number of nodes per face.

Return type:

ndarray of int

get_grid_origin(grid, origin)#

Get the origin for a structured grid.

get_grid_rank(grid)#

Get the number of dimensions of a grid.

get_grid_shape(grid, shape)#

Get the shape of a structured grid.

get_grid_size(grid)#

Get the total number of elements in the computational grid.

Parameters:

grid (int) – A grid identifier.

Returns:

Size of the grid.

Return type:

int

get_grid_spacing(grid, spacing)#

Get the row and column spacing of a structured grid.

get_grid_type(grid)#

Get the type of grid.

get_grid_x(grid, x)#

Get coordinates of grid nodes in the x direction.

Parameters:
  • grid (int) – A grid identifier.

  • x (ndarray of float, shape (nrows,)) – A numpy array to hold the x-coordinates of the grid node columns.

Returns:

The input numpy array that holds the grid’s column x-coordinates.

Return type:

ndarray of float

get_grid_y(grid, y)#

Get coordinates of grid nodes in the y direction.

Parameters:
  • grid (int) – A grid identifier.

  • y (ndarray of float, shape (ncols,)) – A numpy array to hold the y-coordinates of the grid node rows.

Returns:

The input numpy array that holds the grid’s row y-coordinates.

Return type:

ndarray of float

get_grid_z(grid, z)#

Get coordinates of grid nodes in the z direction.

Parameters:
  • grid (int) – A grid identifier.

  • z (ndarray of float, shape (nlayers,)) – A numpy array to hold the z-coordinates of the grid nodes layers.

Returns:

The input numpy array that holds the grid’s layer z-coordinates.

Return type:

ndarray of float

get_input_item_count()#

Count of a model’s input variables.

Returns:

The number of input variables.

Return type:

int

get_input_var_names()#

Names of the input exchange items.

get_output_item_count()#

Count of a model’s output variables.

Returns:

The number of output variables.

Return type:

int

get_output_var_names()#

Names of the output exchange items.

get_start_time()#

Start time of the component.

get_time_step()#

Component time step.

get_time_units()#

Time units used by the component.

get_value(name, dest)#

Get a copy of a variable’s data.

get_value_at_indices(name, dest, inds)#

Get values at particular indices.

Parameters:
  • name (str) – An input or output variable name, a CSDMS Standard Name.

  • dest (ndarray) – A numpy array into which to place the values.

  • inds (array_like) – The indices into the variable array.

Returns:

Value of the model variable at the given location.

Return type:

array_like

get_value_ptr(name)#

Get a reference to values of the given variable.

This is a getter for the model, used to access the model’s current state. It returns a reference to a model variable, with the return type, size and rank dependent on the variable.

Parameters:

name (str) – An input or output variable name, a CSDMS Standard Name.

Returns:

A reference to a model variable.

Return type:

array_like

get_value_ref(name)#

Get a reference to a variable’s data.

get_var_grid(name)#

Get the grid id for a variable.

get_var_itemsize(name)#

Get the size of elements of a variable.

get_var_location(name)#

Get the grid element type that the a given variable is defined on.

The grid topology can be composed of nodes, edges, and faces.

node

A point that has a coordinate pair or triplet: the most basic element of the topology.

edge

A line or curve bounded by two nodes.

face

A plane or surface enclosed by a set of edges. In a 2D horizontal application one may consider the word “polygon”, but in the hierarchy of elements the word “face” is most common.

Parameters:

name (str) – An input or output variable name, a CSDMS Standard Name.

Returns:

The grid location on which the variable is defined. Must be one of “node”, “edge”, or “face”.

Return type:

str

Notes

CSDMS uses the ugrid conventions to define unstructured grids.

get_var_nbytes(name)#

Get the total number of bytes used by a variable.

get_var_type(name)#

Get the data type for a variable.

get_var_units(name)#

Get the unit used by a variable.

initialize(config_file)#

Initialize the component from a file.

BMI-wrapped Landlab components use input files in YAML format. Component-specific parameters are listed at the top level, followed by grid and then time information. An example input file looks like:

flexure:
    eet: 15.e+3
clock:
    start: 0
    stop: 100.
    step: 2.
grid:
    type: raster
    shape: [20, 40]
    spacing: [1000., 2000.]

In this case, a RasterModelGrid is created (with the given shape and spacing) and passed to the underlying landlab component. The eet=15000. is also given to the component but as a keyword parameter. The BMI clock is initialized with the given parameters.

Parameters:

config_file (str or file_like) – YAML-formatted input file for the component.

set_value(name, values)#

Set the values of a variable.

set_value_at_indices(name, inds, src)#

Specify a new value for a model variable at particular indices.

Parameters:
  • name (str) – An input or output variable name, a CSDMS Standard Name.

  • inds (array_like) – The indices into the variable array.

  • src (array_like) – The new value for the specified variable.

update()#

Update the component one time step.

update_frac(frac)#

Update the component a fraction of a time step.

update_until(then)#

Update the component until a given time.

class FlowDirectorMFDBMI#

Bases: Bmi

Basic Modeling Interface for the FlowDirectorMFD component.

finalize()#

Clean-up the component.

get_component_name()#

Name of the component.

get_current_time()#

Current component time.

get_end_time()#

Stop time for the component.

get_grid_edge_count(grid)#

Get the number of edges in the grid.

Parameters:

grid (int) – A grid identifier.

Returns:

The total number of grid edges.

Return type:

int

get_grid_edge_nodes(grid, edge_nodes)#

Get the edge-node connectivity.

Parameters:
  • grid (int) – A grid identifier.

  • edge_nodes (ndarray of int, shape (2 x nnodes,)) – A numpy array to place the edge-node connectivity. For each edge, connectivity is given as node at edge tail, followed by node at edge head.

Returns:

The input numpy array that holds the edge-node connectivity.

Return type:

ndarray of int

get_grid_face_count(grid)#

Get the number of faces in the grid.

Parameters:

grid (int) – A grid identifier.

Returns:

The total number of grid faces.

Return type:

int

get_grid_face_edges(grid)#

Get the face-edge connectivity.

Parameters:
  • grid (int) – A grid identifier.

  • face_edges (ndarray of int) – A numpy array to place the face-edge connectivity.

Returns:

The input numpy array that holds the face-edge connectivity.

Return type:

ndarray of int

get_grid_face_nodes(grid, face_nodes)#

Get the face-node connectivity.

Parameters:
  • grid (int) – A grid identifier.

  • face_nodes (ndarray of int) – A numpy array to place the face-node connectivity. For each face, the nodes (listed in a counter-clockwise direction) that form the boundary of the face.

Returns:

The input numpy array that holds the face-node connectivity.

Return type:

ndarray of int

get_grid_node_count(grid)#

Get the number of nodes in the grid.

Parameters:

grid (int) – A grid identifier.

Returns:

The total number of grid nodes.

Return type:

int

get_grid_nodes_per_face(grid, nodes_per_face)#

Get the number of nodes for each face.

Parameters:
  • grid (int) – A grid identifier.

  • nodes_per_face (ndarray of int, shape (nfaces,)) – A numpy array to place the number of nodes per face.

Returns:

The input numpy array that holds the number of nodes per face.

Return type:

ndarray of int

get_grid_origin(grid, origin)#

Get the origin for a structured grid.

get_grid_rank(grid)#

Get the number of dimensions of a grid.

get_grid_shape(grid, shape)#

Get the shape of a structured grid.

get_grid_size(grid)#

Get the total number of elements in the computational grid.

Parameters:

grid (int) – A grid identifier.

Returns:

Size of the grid.

Return type:

int

get_grid_spacing(grid, spacing)#

Get the row and column spacing of a structured grid.

get_grid_type(grid)#

Get the type of grid.

get_grid_x(grid, x)#

Get coordinates of grid nodes in the x direction.

Parameters:
  • grid (int) – A grid identifier.

  • x (ndarray of float, shape (nrows,)) – A numpy array to hold the x-coordinates of the grid node columns.

Returns:

The input numpy array that holds the grid’s column x-coordinates.

Return type:

ndarray of float

get_grid_y(grid, y)#

Get coordinates of grid nodes in the y direction.

Parameters:
  • grid (int) – A grid identifier.

  • y (ndarray of float, shape (ncols,)) – A numpy array to hold the y-coordinates of the grid node rows.

Returns:

The input numpy array that holds the grid’s row y-coordinates.

Return type:

ndarray of float

get_grid_z(grid, z)#

Get coordinates of grid nodes in the z direction.

Parameters:
  • grid (int) – A grid identifier.

  • z (ndarray of float, shape (nlayers,)) – A numpy array to hold the z-coordinates of the grid nodes layers.

Returns:

The input numpy array that holds the grid’s layer z-coordinates.

Return type:

ndarray of float

get_input_item_count()#

Count of a model’s input variables.

Returns:

The number of input variables.

Return type:

int

get_input_var_names()#

Names of the input exchange items.

get_output_item_count()#

Count of a model’s output variables.

Returns:

The number of output variables.

Return type:

int

get_output_var_names()#

Names of the output exchange items.

get_start_time()#

Start time of the component.

get_time_step()#

Component time step.

get_time_units()#

Time units used by the component.

get_value(name, dest)#

Get a copy of a variable’s data.

get_value_at_indices(name, dest, inds)#

Get values at particular indices.

Parameters:
  • name (str) – An input or output variable name, a CSDMS Standard Name.

  • dest (ndarray) – A numpy array into which to place the values.

  • inds (array_like) – The indices into the variable array.

Returns:

Value of the model variable at the given location.

Return type:

array_like

get_value_ptr(name)#

Get a reference to values of the given variable.

This is a getter for the model, used to access the model’s current state. It returns a reference to a model variable, with the return type, size and rank dependent on the variable.

Parameters:

name (str) – An input or output variable name, a CSDMS Standard Name.

Returns:

A reference to a model variable.

Return type:

array_like

get_value_ref(name)#

Get a reference to a variable’s data.

get_var_grid(name)#

Get the grid id for a variable.

get_var_itemsize(name)#

Get the size of elements of a variable.

get_var_location(name)#

Get the grid element type that the a given variable is defined on.

The grid topology can be composed of nodes, edges, and faces.

node

A point that has a coordinate pair or triplet: the most basic element of the topology.

edge

A line or curve bounded by two nodes.

face

A plane or surface enclosed by a set of edges. In a 2D horizontal application one may consider the word “polygon”, but in the hierarchy of elements the word “face” is most common.

Parameters:

name (str) – An input or output variable name, a CSDMS Standard Name.

Returns:

The grid location on which the variable is defined. Must be one of “node”, “edge”, or “face”.

Return type:

str

Notes

CSDMS uses the ugrid conventions to define unstructured grids.

get_var_nbytes(name)#

Get the total number of bytes used by a variable.

get_var_type(name)#

Get the data type for a variable.

get_var_units(name)#

Get the unit used by a variable.

initialize(config_file)#

Initialize the component from a file.

BMI-wrapped Landlab components use input files in YAML format. Component-specific parameters are listed at the top level, followed by grid and then time information. An example input file looks like:

flexure:
    eet: 15.e+3
clock:
    start: 0
    stop: 100.
    step: 2.
grid:
    type: raster
    shape: [20, 40]
    spacing: [1000., 2000.]

In this case, a RasterModelGrid is created (with the given shape and spacing) and passed to the underlying landlab component. The eet=15000. is also given to the component but as a keyword parameter. The BMI clock is initialized with the given parameters.

Parameters:

config_file (str or file_like) – YAML-formatted input file for the component.

set_value(name, values)#

Set the values of a variable.

set_value_at_indices(name, inds, src)#

Specify a new value for a model variable at particular indices.

Parameters:
  • name (str) – An input or output variable name, a CSDMS Standard Name.

  • inds (array_like) – The indices into the variable array.

  • src (array_like) – The new value for the specified variable.

update()#

Update the component one time step.

update_frac(frac)#

Update the component a fraction of a time step.

update_until(then)#

Update the component until a given time.

class FlowDirectorSteepestBMI#

Bases: Bmi

Basic Modeling Interface for the FlowDirectorSteepest component.

finalize()#

Clean-up the component.

get_component_name()#

Name of the component.

get_current_time()#

Current component time.

get_end_time()#

Stop time for the component.

get_grid_edge_count(grid)#

Get the number of edges in the grid.

Parameters:

grid (int) – A grid identifier.

Returns:

The total number of grid edges.

Return type:

int

get_grid_edge_nodes(grid, edge_nodes)#

Get the edge-node connectivity.

Parameters:
  • grid (int) – A grid identifier.

  • edge_nodes (ndarray of int, shape (2 x nnodes,)) – A numpy array to place the edge-node connectivity. For each edge, connectivity is given as node at edge tail, followed by node at edge head.

Returns:

The input numpy array that holds the edge-node connectivity.

Return type:

ndarray of int

get_grid_face_count(grid)#

Get the number of faces in the grid.

Parameters:

grid (int) – A grid identifier.

Returns:

The total number of grid faces.

Return type:

int

get_grid_face_edges(grid)#

Get the face-edge connectivity.

Parameters:
  • grid (int) – A grid identifier.

  • face_edges (ndarray of int) – A numpy array to place the face-edge connectivity.

Returns:

The input numpy array that holds the face-edge connectivity.

Return type:

ndarray of int

get_grid_face_nodes(grid, face_nodes)#

Get the face-node connectivity.

Parameters:
  • grid (int) – A grid identifier.

  • face_nodes (ndarray of int) – A numpy array to place the face-node connectivity. For each face, the nodes (listed in a counter-clockwise direction) that form the boundary of the face.

Returns:

The input numpy array that holds the face-node connectivity.

Return type:

ndarray of int

get_grid_node_count(grid)#

Get the number of nodes in the grid.

Parameters:

grid (int) – A grid identifier.

Returns:

The total number of grid nodes.

Return type:

int

get_grid_nodes_per_face(grid, nodes_per_face)#

Get the number of nodes for each face.

Parameters:
  • grid (int) – A grid identifier.

  • nodes_per_face (ndarray of int, shape (nfaces,)) – A numpy array to place the number of nodes per face.

Returns:

The input numpy array that holds the number of nodes per face.

Return type:

ndarray of int

get_grid_origin(grid, origin)#

Get the origin for a structured grid.

get_grid_rank(grid)#

Get the number of dimensions of a grid.

get_grid_shape(grid, shape)#

Get the shape of a structured grid.

get_grid_size(grid)#

Get the total number of elements in the computational grid.

Parameters:

grid (int) – A grid identifier.

Returns:

Size of the grid.

Return type:

int

get_grid_spacing(grid, spacing)#

Get the row and column spacing of a structured grid.

get_grid_type(grid)#

Get the type of grid.

get_grid_x(grid, x)#

Get coordinates of grid nodes in the x direction.

Parameters:
  • grid (int) – A grid identifier.

  • x (ndarray of float, shape (nrows,)) – A numpy array to hold the x-coordinates of the grid node columns.

Returns:

The input numpy array that holds the grid’s column x-coordinates.

Return type:

ndarray of float

get_grid_y(grid, y)#

Get coordinates of grid nodes in the y direction.

Parameters:
  • grid (int) – A grid identifier.

  • y (ndarray of float, shape (ncols,)) – A numpy array to hold the y-coordinates of the grid node rows.

Returns:

The input numpy array that holds the grid’s row y-coordinates.

Return type:

ndarray of float

get_grid_z(grid, z)#

Get coordinates of grid nodes in the z direction.

Parameters:
  • grid (int) – A grid identifier.

  • z (ndarray of float, shape (nlayers,)) – A numpy array to hold the z-coordinates of the grid nodes layers.

Returns:

The input numpy array that holds the grid’s layer z-coordinates.

Return type:

ndarray of float

get_input_item_count()#

Count of a model’s input variables.

Returns:

The number of input variables.

Return type:

int

get_input_var_names()#

Names of the input exchange items.

get_output_item_count()#

Count of a model’s output variables.

Returns:

The number of output variables.

Return type:

int

get_output_var_names()#

Names of the output exchange items.

get_start_time()#

Start time of the component.

get_time_step()#

Component time step.

get_time_units()#

Time units used by the component.

get_value(name, dest)#

Get a copy of a variable’s data.

get_value_at_indices(name, dest, inds)#

Get values at particular indices.

Parameters:
  • name (str) – An input or output variable name, a CSDMS Standard Name.

  • dest (ndarray) – A numpy array into which to place the values.

  • inds (array_like) – The indices into the variable array.

Returns:

Value of the model variable at the given location.

Return type:

array_like

get_value_ptr(name)#

Get a reference to values of the given variable.

This is a getter for the model, used to access the model’s current state. It returns a reference to a model variable, with the return type, size and rank dependent on the variable.

Parameters:

name (str) – An input or output variable name, a CSDMS Standard Name.

Returns:

A reference to a model variable.

Return type:

array_like

get_value_ref(name)#

Get a reference to a variable’s data.

get_var_grid(name)#

Get the grid id for a variable.

get_var_itemsize(name)#

Get the size of elements of a variable.

get_var_location(name)#

Get the grid element type that the a given variable is defined on.

The grid topology can be composed of nodes, edges, and faces.

node

A point that has a coordinate pair or triplet: the most basic element of the topology.

edge

A line or curve bounded by two nodes.

face

A plane or surface enclosed by a set of edges. In a 2D horizontal application one may consider the word “polygon”, but in the hierarchy of elements the word “face” is most common.

Parameters:

name (str) – An input or output variable name, a CSDMS Standard Name.

Returns:

The grid location on which the variable is defined. Must be one of “node”, “edge”, or “face”.

Return type:

str

Notes

CSDMS uses the ugrid conventions to define unstructured grids.

get_var_nbytes(name)#

Get the total number of bytes used by a variable.

get_var_type(name)#

Get the data type for a variable.

get_var_units(name)#

Get the unit used by a variable.

initialize(config_file)#

Initialize the component from a file.

BMI-wrapped Landlab components use input files in YAML format. Component-specific parameters are listed at the top level, followed by grid and then time information. An example input file looks like:

flexure:
    eet: 15.e+3
clock:
    start: 0
    stop: 100.
    step: 2.
grid:
    type: raster
    shape: [20, 40]
    spacing: [1000., 2000.]

In this case, a RasterModelGrid is created (with the given shape and spacing) and passed to the underlying landlab component. The eet=15000. is also given to the component but as a keyword parameter. The BMI clock is initialized with the given parameters.

Parameters:

config_file (str or file_like) – YAML-formatted input file for the component.

set_value(name, values)#

Set the values of a variable.

set_value_at_indices(name, inds, src)#

Specify a new value for a model variable at particular indices.

Parameters:
  • name (str) – An input or output variable name, a CSDMS Standard Name.

  • inds (array_like) – The indices into the variable array.

  • src (array_like) – The new value for the specified variable.

update()#

Update the component one time step.

update_frac(frac)#

Update the component a fraction of a time step.

update_until(then)#

Update the component until a given time.

class FractureGridGeneratorBMI#

Bases: Bmi

Basic Modeling Interface for the FractureGridGenerator component.

finalize()#

Clean-up the component.

get_component_name()#

Name of the component.

get_current_time()#

Current component time.

get_end_time()#

Stop time for the component.

get_grid_edge_count(grid)#

Get the number of edges in the grid.

Parameters:

grid (int) – A grid identifier.

Returns:

The total number of grid edges.

Return type:

int

get_grid_edge_nodes(grid, edge_nodes)#

Get the edge-node connectivity.

Parameters:
  • grid (int) – A grid identifier.

  • edge_nodes (ndarray of int, shape (2 x nnodes,)) – A numpy array to place the edge-node connectivity. For each edge, connectivity is given as node at edge tail, followed by node at edge head.

Returns:

The input numpy array that holds the edge-node connectivity.

Return type:

ndarray of int

get_grid_face_count(grid)#

Get the number of faces in the grid.

Parameters:

grid (int) – A grid identifier.

Returns:

The total number of grid faces.

Return type:

int

get_grid_face_edges(grid)#

Get the face-edge connectivity.

Parameters:
  • grid (int) – A grid identifier.

  • face_edges (ndarray of int) – A numpy array to place the face-edge connectivity.

Returns:

The input numpy array that holds the face-edge connectivity.

Return type:

ndarray of int

get_grid_face_nodes(grid, face_nodes)#

Get the face-node connectivity.

Parameters:
  • grid (int) – A grid identifier.

  • face_nodes (ndarray of int) – A numpy array to place the face-node connectivity. For each face, the nodes (listed in a counter-clockwise direction) that form the boundary of the face.

Returns:

The input numpy array that holds the face-node connectivity.

Return type:

ndarray of int

get_grid_node_count(grid)#

Get the number of nodes in the grid.

Parameters:

grid (int) – A grid identifier.

Returns:

The total number of grid nodes.

Return type:

int

get_grid_nodes_per_face(grid, nodes_per_face)#

Get the number of nodes for each face.

Parameters:
  • grid (int) – A grid identifier.

  • nodes_per_face (ndarray of int, shape (nfaces,)) – A numpy array to place the number of nodes per face.

Returns:

The input numpy array that holds the number of nodes per face.

Return type:

ndarray of int

get_grid_origin(grid, origin)#

Get the origin for a structured grid.

get_grid_rank(grid)#

Get the number of dimensions of a grid.

get_grid_shape(grid, shape)#

Get the shape of a structured grid.

get_grid_size(grid)#

Get the total number of elements in the computational grid.

Parameters:

grid (int) – A grid identifier.

Returns:

Size of the grid.

Return type:

int

get_grid_spacing(grid, spacing)#

Get the row and column spacing of a structured grid.

get_grid_type(grid)#

Get the type of grid.

get_grid_x(grid, x)#

Get coordinates of grid nodes in the x direction.

Parameters:
  • grid (int) – A grid identifier.

  • x (ndarray of float, shape (nrows,)) – A numpy array to hold the x-coordinates of the grid node columns.

Returns:

The input numpy array that holds the grid’s column x-coordinates.

Return type:

ndarray of float

get_grid_y(grid, y)#

Get coordinates of grid nodes in the y direction.

Parameters:
  • grid (int) – A grid identifier.

  • y (ndarray of float, shape (ncols,)) – A numpy array to hold the y-coordinates of the grid node rows.

Returns:

The input numpy array that holds the grid’s row y-coordinates.

Return type:

ndarray of float

get_grid_z(grid, z)#

Get coordinates of grid nodes in the z direction.

Parameters:
  • grid (int) – A grid identifier.

  • z (ndarray of float, shape (nlayers,)) – A numpy array to hold the z-coordinates of the grid nodes layers.

Returns:

The input numpy array that holds the grid’s layer z-coordinates.

Return type:

ndarray of float

get_input_item_count()#

Count of a model’s input variables.

Returns:

The number of input variables.

Return type:

int

get_input_var_names()#

Names of the input exchange items.

get_output_item_count()#

Count of a model’s output variables.

Returns:

The number of output variables.

Return type:

int

get_output_var_names()#

Names of the output exchange items.

get_start_time()#

Start time of the component.

get_time_step()#

Component time step.

get_time_units()#

Time units used by the component.

get_value(name, dest)#

Get a copy of a variable’s data.

get_value_at_indices(name, dest, inds)#

Get values at particular indices.

Parameters:
  • name (str) – An input or output variable name, a CSDMS Standard Name.

  • dest (ndarray) – A numpy array into which to place the values.

  • inds (array_like) – The indices into the variable array.

Returns:

Value of the model variable at the given location.

Return type:

array_like

get_value_ptr(name)#

Get a reference to values of the given variable.

This is a getter for the model, used to access the model’s current state. It returns a reference to a model variable, with the return type, size and rank dependent on the variable.

Parameters:

name (str) – An input or output variable name, a CSDMS Standard Name.

Returns:

A reference to a model variable.

Return type:

array_like

get_value_ref(name)#

Get a reference to a variable’s data.

get_var_grid(name)#

Get the grid id for a variable.

get_var_itemsize(name)#

Get the size of elements of a variable.

get_var_location(name)#

Get the grid element type that the a given variable is defined on.

The grid topology can be composed of nodes, edges, and faces.

node

A point that has a coordinate pair or triplet: the most basic element of the topology.

edge

A line or curve bounded by two nodes.

face

A plane or surface enclosed by a set of edges. In a 2D horizontal application one may consider the word “polygon”, but in the hierarchy of elements the word “face” is most common.

Parameters:

name (str) – An input or output variable name, a CSDMS Standard Name.

Returns:

The grid location on which the variable is defined. Must be one of “node”, “edge”, or “face”.

Return type:

str

Notes

CSDMS uses the ugrid conventions to define unstructured grids.

get_var_nbytes(name)#

Get the total number of bytes used by a variable.

get_var_type(name)#

Get the data type for a variable.

get_var_units(name)#

Get the unit used by a variable.

initialize(config_file)#

Initialize the component from a file.

BMI-wrapped Landlab components use input files in YAML format. Component-specific parameters are listed at the top level, followed by grid and then time information. An example input file looks like:

flexure:
    eet: 15.e+3
clock:
    start: 0
    stop: 100.
    step: 2.
grid:
    type: raster
    shape: [20, 40]
    spacing: [1000., 2000.]

In this case, a RasterModelGrid is created (with the given shape and spacing) and passed to the underlying landlab component. The eet=15000. is also given to the component but as a keyword parameter. The BMI clock is initialized with the given parameters.

Parameters:

config_file (str or file_like) – YAML-formatted input file for the component.

set_value(name, values)#

Set the values of a variable.

set_value_at_indices(name, inds, src)#

Specify a new value for a model variable at particular indices.

Parameters:
  • name (str) – An input or output variable name, a CSDMS Standard Name.

  • inds (array_like) – The indices into the variable array.

  • src (array_like) – The new value for the specified variable.

update()#

Update the component one time step.

update_frac(frac)#

Update the component a fraction of a time step.

update_until(then)#

Update the component until a given time.

class GravelBedrockEroderBMI#

Bases: Bmi

Basic Modeling Interface for the GravelBedrockEroder component.

finalize()#

Clean-up the component.

get_component_name()#

Name of the component.

get_current_time()#

Current component time.

get_end_time()#

Stop time for the component.

get_grid_edge_count(grid)#

Get the number of edges in the grid.

Parameters:

grid (int) – A grid identifier.

Returns:

The total number of grid edges.

Return type:

int

get_grid_edge_nodes(grid, edge_nodes)#

Get the edge-node connectivity.

Parameters:
  • grid (int) – A grid identifier.

  • edge_nodes (ndarray of int, shape (2 x nnodes,)) – A numpy array to place the edge-node connectivity. For each edge, connectivity is given as node at edge tail, followed by node at edge head.

Returns:

The input numpy array that holds the edge-node connectivity.

Return type:

ndarray of int

get_grid_face_count(grid)#

Get the number of faces in the grid.

Parameters:

grid (int) – A grid identifier.

Returns:

The total number of grid faces.

Return type:

int

get_grid_face_edges(grid)#

Get the face-edge connectivity.

Parameters:
  • grid (int) – A grid identifier.

  • face_edges (ndarray of int) – A numpy array to place the face-edge connectivity.

Returns:

The input numpy array that holds the face-edge connectivity.

Return type:

ndarray of int

get_grid_face_nodes(grid, face_nodes)#

Get the face-node connectivity.

Parameters:
  • grid (int) – A grid identifier.

  • face_nodes (ndarray of int) – A numpy array to place the face-node connectivity. For each face, the nodes (listed in a counter-clockwise direction) that form the boundary of the face.

Returns:

The input numpy array that holds the face-node connectivity.

Return type:

ndarray of int

get_grid_node_count(grid)#

Get the number of nodes in the grid.

Parameters:

grid (int) – A grid identifier.

Returns:

The total number of grid nodes.

Return type:

int

get_grid_nodes_per_face(grid, nodes_per_face)#

Get the number of nodes for each face.

Parameters:
  • grid (int) – A grid identifier.

  • nodes_per_face (ndarray of int, shape (nfaces,)) – A numpy array to place the number of nodes per face.

Returns:

The input numpy array that holds the number of nodes per face.

Return type:

ndarray of int

get_grid_origin(grid, origin)#

Get the origin for a structured grid.

get_grid_rank(grid)#

Get the number of dimensions of a grid.

get_grid_shape(grid, shape)#

Get the shape of a structured grid.

get_grid_size(grid)#

Get the total number of elements in the computational grid.

Parameters:

grid (int) – A grid identifier.

Returns:

Size of the grid.

Return type:

int

get_grid_spacing(grid, spacing)#

Get the row and column spacing of a structured grid.

get_grid_type(grid)#

Get the type of grid.

get_grid_x(grid, x)#

Get coordinates of grid nodes in the x direction.

Parameters:
  • grid (int) – A grid identifier.

  • x (ndarray of float, shape (nrows,)) – A numpy array to hold the x-coordinates of the grid node columns.

Returns:

The input numpy array that holds the grid’s column x-coordinates.

Return type:

ndarray of float

get_grid_y(grid, y)#

Get coordinates of grid nodes in the y direction.

Parameters:
  • grid (int) – A grid identifier.

  • y (ndarray of float, shape (ncols,)) – A numpy array to hold the y-coordinates of the grid node rows.

Returns:

The input numpy array that holds the grid’s row y-coordinates.

Return type:

ndarray of float

get_grid_z(grid, z)#

Get coordinates of grid nodes in the z direction.

Parameters:
  • grid (int) – A grid identifier.

  • z (ndarray of float, shape (nlayers,)) – A numpy array to hold the z-coordinates of the grid nodes layers.

Returns:

The input numpy array that holds the grid’s layer z-coordinates.

Return type:

ndarray of float

get_input_item_count()#

Count of a model’s input variables.

Returns:

The number of input variables.

Return type:

int

get_input_var_names()#

Names of the input exchange items.

get_output_item_count()#

Count of a model’s output variables.

Returns:

The number of output variables.

Return type:

int

get_output_var_names()#

Names of the output exchange items.

get_start_time()#

Start time of the component.

get_time_step()#

Component time step.

get_time_units()#

Time units used by the component.

get_value(name, dest)#

Get a copy of a variable’s data.

get_value_at_indices(name, dest, inds)#

Get values at particular indices.

Parameters:
  • name (str) – An input or output variable name, a CSDMS Standard Name.

  • dest (ndarray) – A numpy array into which to place the values.

  • inds (array_like) – The indices into the variable array.

Returns:

Value of the model variable at the given location.

Return type:

array_like

get_value_ptr(name)#

Get a reference to values of the given variable.

This is a getter for the model, used to access the model’s current state. It returns a reference to a model variable, with the return type, size and rank dependent on the variable.

Parameters:

name (str) – An input or output variable name, a CSDMS Standard Name.

Returns:

A reference to a model variable.

Return type:

array_like

get_value_ref(name)#

Get a reference to a variable’s data.

get_var_grid(name)#

Get the grid id for a variable.

get_var_itemsize(name)#

Get the size of elements of a variable.

get_var_location(name)#

Get the grid element type that the a given variable is defined on.

The grid topology can be composed of nodes, edges, and faces.

node

A point that has a coordinate pair or triplet: the most basic element of the topology.

edge

A line or curve bounded by two nodes.

face

A plane or surface enclosed by a set of edges. In a 2D horizontal application one may consider the word “polygon”, but in the hierarchy of elements the word “face” is most common.

Parameters:

name (str) – An input or output variable name, a CSDMS Standard Name.

Returns:

The grid location on which the variable is defined. Must be one of “node”, “edge”, or “face”.

Return type:

str

Notes

CSDMS uses the ugrid conventions to define unstructured grids.

get_var_nbytes(name)#

Get the total number of bytes used by a variable.

get_var_type(name)#

Get the data type for a variable.

get_var_units(name)#

Get the unit used by a variable.

initialize(config_file)#

Initialize the component from a file.

BMI-wrapped Landlab components use input files in YAML format. Component-specific parameters are listed at the top level, followed by grid and then time information. An example input file looks like:

flexure:
    eet: 15.e+3
clock:
    start: 0
    stop: 100.
    step: 2.
grid:
    type: raster
    shape: [20, 40]
    spacing: [1000., 2000.]

In this case, a RasterModelGrid is created (with the given shape and spacing) and passed to the underlying landlab component. The eet=15000. is also given to the component but as a keyword parameter. The BMI clock is initialized with the given parameters.

Parameters:

config_file (str or file_like) – YAML-formatted input file for the component.

set_value(name, values)#

Set the values of a variable.

set_value_at_indices(name, inds, src)#

Specify a new value for a model variable at particular indices.

Parameters:
  • name (str) – An input or output variable name, a CSDMS Standard Name.

  • inds (array_like) – The indices into the variable array.

  • src (array_like) – The new value for the specified variable.

update()#

Update the component one time step.

update_frac(frac)#

Update the component a fraction of a time step.

update_until(then)#

Update the component until a given time.

class GravelRiverTransporterBMI#

Bases: Bmi

Basic Modeling Interface for the GravelRiverTransporter component.

finalize()#

Clean-up the component.

get_component_name()#

Name of the component.

get_current_time()#

Current component time.

get_end_time()#

Stop time for the component.

get_grid_edge_count(grid)#

Get the number of edges in the grid.

Parameters:

grid (int) – A grid identifier.

Returns:

The total number of grid edges.

Return type:

int

get_grid_edge_nodes(grid, edge_nodes)#

Get the edge-node connectivity.

Parameters:
  • grid (int) – A grid identifier.

  • edge_nodes (ndarray of int, shape (2 x nnodes,)) – A numpy array to place the edge-node connectivity. For each edge, connectivity is given as node at edge tail, followed by node at edge head.

Returns:

The input numpy array that holds the edge-node connectivity.

Return type:

ndarray of int

get_grid_face_count(grid)#

Get the number of faces in the grid.

Parameters:

grid (int) – A grid identifier.

Returns:

The total number of grid faces.

Return type:

int

get_grid_face_edges(grid)#

Get the face-edge connectivity.

Parameters:
  • grid (int) – A grid identifier.

  • face_edges (ndarray of int) – A numpy array to place the face-edge connectivity.

Returns:

The input numpy array that holds the face-edge connectivity.

Return type:

ndarray of int

get_grid_face_nodes(grid, face_nodes)#

Get the face-node connectivity.

Parameters:
  • grid (int) – A grid identifier.

  • face_nodes (ndarray of int) – A numpy array to place the face-node connectivity. For each face, the nodes (listed in a counter-clockwise direction) that form the boundary of the face.

Returns:

The input numpy array that holds the face-node connectivity.

Return type:

ndarray of int

get_grid_node_count(grid)#

Get the number of nodes in the grid.

Parameters:

grid (int) – A grid identifier.

Returns:

The total number of grid nodes.

Return type:

int

get_grid_nodes_per_face(grid, nodes_per_face)#

Get the number of nodes for each face.

Parameters:
  • grid (int) – A grid identifier.

  • nodes_per_face (ndarray of int, shape (nfaces,)) – A numpy array to place the number of nodes per face.

Returns:

The input numpy array that holds the number of nodes per face.

Return type:

ndarray of int

get_grid_origin(grid, origin)#

Get the origin for a structured grid.

get_grid_rank(grid)#

Get the number of dimensions of a grid.

get_grid_shape(grid, shape)#

Get the shape of a structured grid.

get_grid_size(grid)#

Get the total number of elements in the computational grid.

Parameters:

grid (int) – A grid identifier.

Returns:

Size of the grid.

Return type:

int

get_grid_spacing(grid, spacing)#

Get the row and column spacing of a structured grid.

get_grid_type(grid)#

Get the type of grid.

get_grid_x(grid, x)#

Get coordinates of grid nodes in the x direction.

Parameters:
  • grid (int) – A grid identifier.

  • x (ndarray of float, shape (nrows,)) – A numpy array to hold the x-coordinates of the grid node columns.

Returns:

The input numpy array that holds the grid’s column x-coordinates.

Return type:

ndarray of float

get_grid_y(grid, y)#

Get coordinates of grid nodes in the y direction.

Parameters:
  • grid (int) – A grid identifier.

  • y (ndarray of float, shape (ncols,)) – A numpy array to hold the y-coordinates of the grid node rows.

Returns:

The input numpy array that holds the grid’s row y-coordinates.

Return type:

ndarray of float

get_grid_z(grid, z)#

Get coordinates of grid nodes in the z direction.

Parameters:
  • grid (int) – A grid identifier.

  • z (ndarray of float, shape (nlayers,)) – A numpy array to hold the z-coordinates of the grid nodes layers.

Returns:

The input numpy array that holds the grid’s layer z-coordinates.

Return type:

ndarray of float

get_input_item_count()#

Count of a model’s input variables.

Returns:

The number of input variables.

Return type:

int

get_input_var_names()#

Names of the input exchange items.

get_output_item_count()#

Count of a model’s output variables.

Returns:

The number of output variables.

Return type:

int

get_output_var_names()#

Names of the output exchange items.

get_start_time()#

Start time of the component.

get_time_step()#

Component time step.

get_time_units()#

Time units used by the component.

get_value(name, dest)#

Get a copy of a variable’s data.

get_value_at_indices(name, dest, inds)#

Get values at particular indices.

Parameters:
  • name (str) – An input or output variable name, a CSDMS Standard Name.

  • dest (ndarray) – A numpy array into which to place the values.

  • inds (array_like) – The indices into the variable array.

Returns:

Value of the model variable at the given location.

Return type:

array_like

get_value_ptr(name)#

Get a reference to values of the given variable.

This is a getter for the model, used to access the model’s current state. It returns a reference to a model variable, with the return type, size and rank dependent on the variable.

Parameters:

name (str) – An input or output variable name, a CSDMS Standard Name.

Returns:

A reference to a model variable.

Return type:

array_like

get_value_ref(name)#

Get a reference to a variable’s data.

get_var_grid(name)#

Get the grid id for a variable.

get_var_itemsize(name)#

Get the size of elements of a variable.

get_var_location(name)#

Get the grid element type that the a given variable is defined on.

The grid topology can be composed of nodes, edges, and faces.

node

A point that has a coordinate pair or triplet: the most basic element of the topology.

edge

A line or curve bounded by two nodes.

face

A plane or surface enclosed by a set of edges. In a 2D horizontal application one may consider the word “polygon”, but in the hierarchy of elements the word “face” is most common.

Parameters:

name (str) – An input or output variable name, a CSDMS Standard Name.

Returns:

The grid location on which the variable is defined. Must be one of “node”, “edge”, or “face”.

Return type:

str

Notes

CSDMS uses the ugrid conventions to define unstructured grids.

get_var_nbytes(name)#

Get the total number of bytes used by a variable.

get_var_type(name)#

Get the data type for a variable.

get_var_units(name)#

Get the unit used by a variable.

initialize(config_file)#

Initialize the component from a file.

BMI-wrapped Landlab components use input files in YAML format. Component-specific parameters are listed at the top level, followed by grid and then time information. An example input file looks like:

flexure:
    eet: 15.e+3
clock:
    start: 0
    stop: 100.
    step: 2.
grid:
    type: raster
    shape: [20, 40]
    spacing: [1000., 2000.]

In this case, a RasterModelGrid is created (with the given shape and spacing) and passed to the underlying landlab component. The eet=15000. is also given to the component but as a keyword parameter. The BMI clock is initialized with the given parameters.

Parameters:

config_file (str or file_like) – YAML-formatted input file for the component.

set_value(name, values)#

Set the values of a variable.

set_value_at_indices(name, inds, src)#

Specify a new value for a model variable at particular indices.

Parameters:
  • name (str) – An input or output variable name, a CSDMS Standard Name.

  • inds (array_like) – The indices into the variable array.

  • src (array_like) – The new value for the specified variable.

update()#

Update the component one time step.

update_frac(frac)#

Update the component a fraction of a time step.

update_until(then)#

Update the component until a given time.

class GroundwaterDupuitPercolatorBMI#

Bases: Bmi

Basic Modeling Interface for the GroundwaterDupuitPercolator component.

finalize()#

Clean-up the component.

get_component_name()#

Name of the component.

get_current_time()#

Current component time.

get_end_time()#

Stop time for the component.

get_grid_edge_count(grid)#

Get the number of edges in the grid.

Parameters:

grid (int) – A grid identifier.

Returns:

The total number of grid edges.

Return type:

int

get_grid_edge_nodes(grid, edge_nodes)#

Get the edge-node connectivity.

Parameters:
  • grid (int) – A grid identifier.

  • edge_nodes (ndarray of int, shape (2 x nnodes,)) – A numpy array to place the edge-node connectivity. For each edge, connectivity is given as node at edge tail, followed by node at edge head.

Returns:

The input numpy array that holds the edge-node connectivity.

Return type:

ndarray of int

get_grid_face_count(grid)#

Get the number of faces in the grid.

Parameters:

grid (int) – A grid identifier.

Returns:

The total number of grid faces.

Return type:

int

get_grid_face_edges(grid)#

Get the face-edge connectivity.

Parameters:
  • grid (int) – A grid identifier.

  • face_edges (ndarray of int) – A numpy array to place the face-edge connectivity.

Returns:

The input numpy array that holds the face-edge connectivity.

Return type:

ndarray of int

get_grid_face_nodes(grid, face_nodes)#

Get the face-node connectivity.

Parameters:
  • grid (int) – A grid identifier.

  • face_nodes (ndarray of int) – A numpy array to place the face-node connectivity. For each face, the nodes (listed in a counter-clockwise direction) that form the boundary of the face.

Returns:

The input numpy array that holds the face-node connectivity.

Return type:

ndarray of int

get_grid_node_count(grid)#

Get the number of nodes in the grid.

Parameters:

grid (int) – A grid identifier.

Returns:

The total number of grid nodes.

Return type:

int

get_grid_nodes_per_face(grid, nodes_per_face)#

Get the number of nodes for each face.

Parameters:
  • grid (int) – A grid identifier.

  • nodes_per_face (ndarray of int, shape (nfaces,)) – A numpy array to place the number of nodes per face.

Returns:

The input numpy array that holds the number of nodes per face.

Return type:

ndarray of int

get_grid_origin(grid, origin)#

Get the origin for a structured grid.

get_grid_rank(grid)#

Get the number of dimensions of a grid.

get_grid_shape(grid, shape)#

Get the shape of a structured grid.

get_grid_size(grid)#

Get the total number of elements in the computational grid.

Parameters:

grid (int) – A grid identifier.

Returns:

Size of the grid.

Return type:

int

get_grid_spacing(grid, spacing)#

Get the row and column spacing of a structured grid.

get_grid_type(grid)#

Get the type of grid.

get_grid_x(grid, x)#

Get coordinates of grid nodes in the x direction.

Parameters:
  • grid (int) – A grid identifier.

  • x (ndarray of float, shape (nrows,)) – A numpy array to hold the x-coordinates of the grid node columns.

Returns:

The input numpy array that holds the grid’s column x-coordinates.

Return type:

ndarray of float

get_grid_y(grid, y)#

Get coordinates of grid nodes in the y direction.

Parameters:
  • grid (int) – A grid identifier.

  • y (ndarray of float, shape (ncols,)) – A numpy array to hold the y-coordinates of the grid node rows.

Returns:

The input numpy array that holds the grid’s row y-coordinates.

Return type:

ndarray of float

get_grid_z(grid, z)#

Get coordinates of grid nodes in the z direction.

Parameters:
  • grid (int) – A grid identifier.

  • z (ndarray of float, shape (nlayers,)) – A numpy array to hold the z-coordinates of the grid nodes layers.

Returns:

The input numpy array that holds the grid’s layer z-coordinates.

Return type:

ndarray of float

get_input_item_count()#

Count of a model’s input variables.

Returns:

The number of input variables.

Return type:

int

get_input_var_names()#

Names of the input exchange items.

get_output_item_count()#

Count of a model’s output variables.

Returns:

The number of output variables.

Return type:

int

get_output_var_names()#

Names of the output exchange items.

get_start_time()#

Start time of the component.

get_time_step()#

Component time step.

get_time_units()#

Time units used by the component.

get_value(name, dest)#

Get a copy of a variable’s data.

get_value_at_indices(name, dest, inds)#

Get values at particular indices.

Parameters:
  • name (str) – An input or output variable name, a CSDMS Standard Name.

  • dest (ndarray) – A numpy array into which to place the values.

  • inds (array_like) – The indices into the variable array.

Returns:

Value of the model variable at the given location.

Return type:

array_like

get_value_ptr(name)#

Get a reference to values of the given variable.

This is a getter for the model, used to access the model’s current state. It returns a reference to a model variable, with the return type, size and rank dependent on the variable.

Parameters:

name (str) – An input or output variable name, a CSDMS Standard Name.

Returns:

A reference to a model variable.

Return type:

array_like

get_value_ref(name)#

Get a reference to a variable’s data.

get_var_grid(name)#

Get the grid id for a variable.

get_var_itemsize(name)#

Get the size of elements of a variable.

get_var_location(name)#

Get the grid element type that the a given variable is defined on.

The grid topology can be composed of nodes, edges, and faces.

node

A point that has a coordinate pair or triplet: the most basic element of the topology.

edge

A line or curve bounded by two nodes.

face

A plane or surface enclosed by a set of edges. In a 2D horizontal application one may consider the word “polygon”, but in the hierarchy of elements the word “face” is most common.

Parameters:

name (str) – An input or output variable name, a CSDMS Standard Name.

Returns:

The grid location on which the variable is defined. Must be one of “node”, “edge”, or “face”.

Return type:

str

Notes

CSDMS uses the ugrid conventions to define unstructured grids.

get_var_nbytes(name)#

Get the total number of bytes used by a variable.

get_var_type(name)#

Get the data type for a variable.

get_var_units(name)#

Get the unit used by a variable.

initialize(config_file)#

Initialize the component from a file.

BMI-wrapped Landlab components use input files in YAML format. Component-specific parameters are listed at the top level, followed by grid and then time information. An example input file looks like:

flexure:
    eet: 15.e+3
clock:
    start: 0
    stop: 100.
    step: 2.
grid:
    type: raster
    shape: [20, 40]
    spacing: [1000., 2000.]

In this case, a RasterModelGrid is created (with the given shape and spacing) and passed to the underlying landlab component. The eet=15000. is also given to the component but as a keyword parameter. The BMI clock is initialized with the given parameters.

Parameters:

config_file (str or file_like) – YAML-formatted input file for the component.

set_value(name, values)#

Set the values of a variable.

set_value_at_indices(name, inds, src)#

Specify a new value for a model variable at particular indices.

Parameters:
  • name (str) – An input or output variable name, a CSDMS Standard Name.

  • inds (array_like) – The indices into the variable array.

  • src (array_like) – The new value for the specified variable.

update()#

Update the component one time step.

update_frac(frac)#

Update the component a fraction of a time step.

update_until(then)#

Update the component until a given time.

class HackCalculatorBMI#

Bases: Bmi

Basic Modeling Interface for the HackCalculator component.

finalize()#

Clean-up the component.

get_component_name()#

Name of the component.

get_current_time()#

Current component time.

get_end_time()#

Stop time for the component.

get_grid_edge_count(grid)#

Get the number of edges in the grid.

Parameters:

grid (int) – A grid identifier.

Returns:

The total number of grid edges.

Return type:

int

get_grid_edge_nodes(grid, edge_nodes)#

Get the edge-node connectivity.

Parameters:
  • grid (int) – A grid identifier.

  • edge_nodes (ndarray of int, shape (2 x nnodes,)) – A numpy array to place the edge-node connectivity. For each edge, connectivity is given as node at edge tail, followed by node at edge head.

Returns:

The input numpy array that holds the edge-node connectivity.

Return type:

ndarray of int

get_grid_face_count(grid)#

Get the number of faces in the grid.

Parameters:

grid (int) – A grid identifier.

Returns:

The total number of grid faces.

Return type:

int

get_grid_face_edges(grid)#

Get the face-edge connectivity.

Parameters:
  • grid (int) – A grid identifier.

  • face_edges (ndarray of int) – A numpy array to place the face-edge connectivity.

Returns:

The input numpy array that holds the face-edge connectivity.

Return type:

ndarray of int

get_grid_face_nodes(grid, face_nodes)#

Get the face-node connectivity.

Parameters:
  • grid (int) – A grid identifier.

  • face_nodes (ndarray of int) – A numpy array to place the face-node connectivity. For each face, the nodes (listed in a counter-clockwise direction) that form the boundary of the face.

Returns:

The input numpy array that holds the face-node connectivity.

Return type:

ndarray of int

get_grid_node_count(grid)#

Get the number of nodes in the grid.

Parameters:

grid (int) – A grid identifier.

Returns:

The total number of grid nodes.

Return type:

int

get_grid_nodes_per_face(grid, nodes_per_face)#

Get the number of nodes for each face.

Parameters:
  • grid (int) – A grid identifier.

  • nodes_per_face (ndarray of int, shape (nfaces,)) – A numpy array to place the number of nodes per face.

Returns:

The input numpy array that holds the number of nodes per face.

Return type:

ndarray of int

get_grid_origin(grid, origin)#

Get the origin for a structured grid.

get_grid_rank(grid)#

Get the number of dimensions of a grid.

get_grid_shape(grid, shape)#

Get the shape of a structured grid.

get_grid_size(grid)#

Get the total number of elements in the computational grid.

Parameters:

grid (int) – A grid identifier.

Returns:

Size of the grid.

Return type:

int

get_grid_spacing(grid, spacing)#

Get the row and column spacing of a structured grid.

get_grid_type(grid)#

Get the type of grid.

get_grid_x(grid, x)#

Get coordinates of grid nodes in the x direction.

Parameters:
  • grid (int) – A grid identifier.

  • x (ndarray of float, shape (nrows,)) – A numpy array to hold the x-coordinates of the grid node columns.

Returns:

The input numpy array that holds the grid’s column x-coordinates.

Return type:

ndarray of float

get_grid_y(grid, y)#

Get coordinates of grid nodes in the y direction.

Parameters:
  • grid (int) – A grid identifier.

  • y (ndarray of float, shape (ncols,)) – A numpy array to hold the y-coordinates of the grid node rows.

Returns:

The input numpy array that holds the grid’s row y-coordinates.

Return type:

ndarray of float

get_grid_z(grid, z)#

Get coordinates of grid nodes in the z direction.

Parameters:
  • grid (int) – A grid identifier.

  • z (ndarray of float, shape (nlayers,)) – A numpy array to hold the z-coordinates of the grid nodes layers.

Returns:

The input numpy array that holds the grid’s layer z-coordinates.

Return type:

ndarray of float

get_input_item_count()#

Count of a model’s input variables.

Returns:

The number of input variables.

Return type:

int

get_input_var_names()#

Names of the input exchange items.

get_output_item_count()#

Count of a model’s output variables.

Returns:

The number of output variables.

Return type:

int

get_output_var_names()#

Names of the output exchange items.

get_start_time()#

Start time of the component.

get_time_step()#

Component time step.

get_time_units()#

Time units used by the component.

get_value(name, dest)#

Get a copy of a variable’s data.

get_value_at_indices(name, dest, inds)#

Get values at particular indices.

Parameters:
  • name (str) – An input or output variable name, a CSDMS Standard Name.

  • dest (ndarray) – A numpy array into which to place the values.

  • inds (array_like) – The indices into the variable array.

Returns:

Value of the model variable at the given location.

Return type:

array_like

get_value_ptr(name)#

Get a reference to values of the given variable.

This is a getter for the model, used to access the model’s current state. It returns a reference to a model variable, with the return type, size and rank dependent on the variable.

Parameters:

name (str) – An input or output variable name, a CSDMS Standard Name.

Returns:

A reference to a model variable.

Return type:

array_like

get_value_ref(name)#

Get a reference to a variable’s data.

get_var_grid(name)#

Get the grid id for a variable.

get_var_itemsize(name)#

Get the size of elements of a variable.

get_var_location(name)#

Get the grid element type that the a given variable is defined on.

The grid topology can be composed of nodes, edges, and faces.

node

A point that has a coordinate pair or triplet: the most basic element of the topology.

edge

A line or curve bounded by two nodes.

face

A plane or surface enclosed by a set of edges. In a 2D horizontal application one may consider the word “polygon”, but in the hierarchy of elements the word “face” is most common.

Parameters:

name (str) – An input or output variable name, a CSDMS Standard Name.

Returns:

The grid location on which the variable is defined. Must be one of “node”, “edge”, or “face”.

Return type:

str

Notes

CSDMS uses the ugrid conventions to define unstructured grids.

get_var_nbytes(name)#

Get the total number of bytes used by a variable.

get_var_type(name)#

Get the data type for a variable.

get_var_units(name)#

Get the unit used by a variable.

initialize(config_file)#

Initialize the component from a file.

BMI-wrapped Landlab components use input files in YAML format. Component-specific parameters are listed at the top level, followed by grid and then time information. An example input file looks like:

flexure:
    eet: 15.e+3
clock:
    start: 0
    stop: 100.
    step: 2.
grid:
    type: raster
    shape: [20, 40]
    spacing: [1000., 2000.]

In this case, a RasterModelGrid is created (with the given shape and spacing) and passed to the underlying landlab component. The eet=15000. is also given to the component but as a keyword parameter. The BMI clock is initialized with the given parameters.

Parameters:

config_file (str or file_like) – YAML-formatted input file for the component.

set_value(name, values)#

Set the values of a variable.

set_value_at_indices(name, inds, src)#

Specify a new value for a model variable at particular indices.

Parameters:
  • name (str) – An input or output variable name, a CSDMS Standard Name.

  • inds (array_like) – The indices into the variable array.

  • src (array_like) – The new value for the specified variable.

update()#

Update the component one time step.

update_frac(frac)#

Update the component a fraction of a time step.

update_until(then)#

Update the component until a given time.

class HeightAboveDrainageCalculatorBMI#

Bases: Bmi

Basic Modeling Interface for the HeightAboveDrainageCalculator component.

finalize()#

Clean-up the component.

get_component_name()#

Name of the component.

get_current_time()#

Current component time.

get_end_time()#

Stop time for the component.

get_grid_edge_count(grid)#

Get the number of edges in the grid.

Parameters:

grid (int) – A grid identifier.

Returns:

The total number of grid edges.

Return type:

int

get_grid_edge_nodes(grid, edge_nodes)#

Get the edge-node connectivity.

Parameters:
  • grid (int) – A grid identifier.

  • edge_nodes (ndarray of int, shape (2 x nnodes,)) – A numpy array to place the edge-node connectivity. For each edge, connectivity is given as node at edge tail, followed by node at edge head.

Returns:

The input numpy array that holds the edge-node connectivity.

Return type:

ndarray of int

get_grid_face_count(grid)#

Get the number of faces in the grid.

Parameters:

grid (int) – A grid identifier.

Returns:

The total number of grid faces.

Return type:

int

get_grid_face_edges(grid)#

Get the face-edge connectivity.

Parameters:
  • grid (int) – A grid identifier.

  • face_edges (ndarray of int) – A numpy array to place the face-edge connectivity.

Returns:

The input numpy array that holds the face-edge connectivity.

Return type:

ndarray of int

get_grid_face_nodes(grid, face_nodes)#

Get the face-node connectivity.

Parameters:
  • grid (int) – A grid identifier.

  • face_nodes (ndarray of int) – A numpy array to place the face-node connectivity. For each face, the nodes (listed in a counter-clockwise direction) that form the boundary of the face.

Returns:

The input numpy array that holds the face-node connectivity.

Return type:

ndarray of int

get_grid_node_count(grid)#

Get the number of nodes in the grid.

Parameters:

grid (int) – A grid identifier.

Returns:

The total number of grid nodes.

Return type:

int

get_grid_nodes_per_face(grid, nodes_per_face)#

Get the number of nodes for each face.

Parameters:
  • grid (int) – A grid identifier.

  • nodes_per_face (ndarray of int, shape (nfaces,)) – A numpy array to place the number of nodes per face.

Returns:

The input numpy array that holds the number of nodes per face.

Return type:

ndarray of int

get_grid_origin(grid, origin)#

Get the origin for a structured grid.

get_grid_rank(grid)#

Get the number of dimensions of a grid.

get_grid_shape(grid, shape)#

Get the shape of a structured grid.

get_grid_size(grid)#

Get the total number of elements in the computational grid.

Parameters:

grid (int) – A grid identifier.

Returns:

Size of the grid.

Return type:

int

get_grid_spacing(grid, spacing)#

Get the row and column spacing of a structured grid.

get_grid_type(grid)#

Get the type of grid.

get_grid_x(grid, x)#

Get coordinates of grid nodes in the x direction.

Parameters:
  • grid (int) – A grid identifier.

  • x (ndarray of float, shape (nrows,)) – A numpy array to hold the x-coordinates of the grid node columns.

Returns:

The input numpy array that holds the grid’s column x-coordinates.

Return type:

ndarray of float

get_grid_y(grid, y)#

Get coordinates of grid nodes in the y direction.

Parameters:
  • grid (int) – A grid identifier.

  • y (ndarray of float, shape (ncols,)) – A numpy array to hold the y-coordinates of the grid node rows.

Returns:

The input numpy array that holds the grid’s row y-coordinates.

Return type:

ndarray of float

get_grid_z(grid, z)#

Get coordinates of grid nodes in the z direction.

Parameters:
  • grid (int) – A grid identifier.

  • z (ndarray of float, shape (nlayers,)) – A numpy array to hold the z-coordinates of the grid nodes layers.

Returns:

The input numpy array that holds the grid’s layer z-coordinates.

Return type:

ndarray of float

get_input_item_count()#

Count of a model’s input variables.

Returns:

The number of input variables.

Return type:

int

get_input_var_names()#

Names of the input exchange items.

get_output_item_count()#

Count of a model’s output variables.

Returns:

The number of output variables.

Return type:

int

get_output_var_names()#

Names of the output exchange items.

get_start_time()#

Start time of the component.

get_time_step()#

Component time step.

get_time_units()#

Time units used by the component.

get_value(name, dest)#

Get a copy of a variable’s data.

get_value_at_indices(name, dest, inds)#

Get values at particular indices.

Parameters:
  • name (str) – An input or output variable name, a CSDMS Standard Name.

  • dest (ndarray) – A numpy array into which to place the values.

  • inds (array_like) – The indices into the variable array.

Returns:

Value of the model variable at the given location.

Return type:

array_like

get_value_ptr(name)#

Get a reference to values of the given variable.

This is a getter for the model, used to access the model’s current state. It returns a reference to a model variable, with the return type, size and rank dependent on the variable.

Parameters:

name (str) – An input or output variable name, a CSDMS Standard Name.

Returns:

A reference to a model variable.

Return type:

array_like

get_value_ref(name)#

Get a reference to a variable’s data.

get_var_grid(name)#

Get the grid id for a variable.

get_var_itemsize(name)#

Get the size of elements of a variable.

get_var_location(name)#

Get the grid element type that the a given variable is defined on.

The grid topology can be composed of nodes, edges, and faces.

node

A point that has a coordinate pair or triplet: the most basic element of the topology.

edge

A line or curve bounded by two nodes.

face

A plane or surface enclosed by a set of edges. In a 2D horizontal application one may consider the word “polygon”, but in the hierarchy of elements the word “face” is most common.

Parameters:

name (str) – An input or output variable name, a CSDMS Standard Name.

Returns:

The grid location on which the variable is defined. Must be one of “node”, “edge”, or “face”.

Return type:

str

Notes

CSDMS uses the ugrid conventions to define unstructured grids.

get_var_nbytes(name)#

Get the total number of bytes used by a variable.

get_var_type(name)#

Get the data type for a variable.

get_var_units(name)#

Get the unit used by a variable.

initialize(config_file)#

Initialize the component from a file.

BMI-wrapped Landlab components use input files in YAML format. Component-specific parameters are listed at the top level, followed by grid and then time information. An example input file looks like:

flexure:
    eet: 15.e+3
clock:
    start: 0
    stop: 100.
    step: 2.
grid:
    type: raster
    shape: [20, 40]
    spacing: [1000., 2000.]

In this case, a RasterModelGrid is created (with the given shape and spacing) and passed to the underlying landlab component. The eet=15000. is also given to the component but as a keyword parameter. The BMI clock is initialized with the given parameters.

Parameters:

config_file (str or file_like) – YAML-formatted input file for the component.

set_value(name, values)#

Set the values of a variable.

set_value_at_indices(name, inds, src)#

Specify a new value for a model variable at particular indices.

Parameters:
  • name (str) – An input or output variable name, a CSDMS Standard Name.

  • inds (array_like) – The indices into the variable array.

  • src (array_like) – The new value for the specified variable.

update()#

Update the component one time step.

update_frac(frac)#

Update the component a fraction of a time step.

update_until(then)#

Update the component until a given time.

class KinematicWaveRengersBMI#

Bases: Bmi

Basic Modeling Interface for the KinematicWaveRengers component.

finalize()#

Clean-up the component.

get_component_name()#

Name of the component.

get_current_time()#

Current component time.

get_end_time()#

Stop time for the component.

get_grid_edge_count(grid)#

Get the number of edges in the grid.

Parameters:

grid (int) – A grid identifier.

Returns:

The total number of grid edges.

Return type:

int

get_grid_edge_nodes(grid, edge_nodes)#

Get the edge-node connectivity.

Parameters:
  • grid (int) – A grid identifier.

  • edge_nodes (ndarray of int, shape (2 x nnodes,)) – A numpy array to place the edge-node connectivity. For each edge, connectivity is given as node at edge tail, followed by node at edge head.

Returns:

The input numpy array that holds the edge-node connectivity.

Return type:

ndarray of int

get_grid_face_count(grid)#

Get the number of faces in the grid.

Parameters:

grid (int) – A grid identifier.

Returns:

The total number of grid faces.

Return type:

int

get_grid_face_edges(grid)#

Get the face-edge connectivity.

Parameters:
  • grid (int) – A grid identifier.

  • face_edges (ndarray of int) – A numpy array to place the face-edge connectivity.

Returns:

The input numpy array that holds the face-edge connectivity.

Return type:

ndarray of int

get_grid_face_nodes(grid, face_nodes)#

Get the face-node connectivity.

Parameters:
  • grid (int) – A grid identifier.

  • face_nodes (ndarray of int) – A numpy array to place the face-node connectivity. For each face, the nodes (listed in a counter-clockwise direction) that form the boundary of the face.

Returns:

The input numpy array that holds the face-node connectivity.

Return type:

ndarray of int

get_grid_node_count(grid)#

Get the number of nodes in the grid.

Parameters:

grid (int) – A grid identifier.

Returns:

The total number of grid nodes.

Return type:

int

get_grid_nodes_per_face(grid, nodes_per_face)#

Get the number of nodes for each face.

Parameters:
  • grid (int) – A grid identifier.

  • nodes_per_face (ndarray of int, shape (nfaces,)) – A numpy array to place the number of nodes per face.

Returns:

The input numpy array that holds the number of nodes per face.

Return type:

ndarray of int

get_grid_origin(grid, origin)#

Get the origin for a structured grid.

get_grid_rank(grid)#

Get the number of dimensions of a grid.

get_grid_shape(grid, shape)#

Get the shape of a structured grid.

get_grid_size(grid)#

Get the total number of elements in the computational grid.

Parameters:

grid (int) – A grid identifier.

Returns:

Size of the grid.

Return type:

int

get_grid_spacing(grid, spacing)#

Get the row and column spacing of a structured grid.

get_grid_type(grid)#

Get the type of grid.

get_grid_x(grid, x)#

Get coordinates of grid nodes in the x direction.

Parameters:
  • grid (int) – A grid identifier.

  • x (ndarray of float, shape (nrows,)) – A numpy array to hold the x-coordinates of the grid node columns.

Returns:

The input numpy array that holds the grid’s column x-coordinates.

Return type:

ndarray of float

get_grid_y(grid, y)#

Get coordinates of grid nodes in the y direction.

Parameters:
  • grid (int) – A grid identifier.

  • y (ndarray of float, shape (ncols,)) – A numpy array to hold the y-coordinates of the grid node rows.

Returns:

The input numpy array that holds the grid’s row y-coordinates.

Return type:

ndarray of float

get_grid_z(grid, z)#

Get coordinates of grid nodes in the z direction.

Parameters:
  • grid (int) – A grid identifier.

  • z (ndarray of float, shape (nlayers,)) – A numpy array to hold the z-coordinates of the grid nodes layers.

Returns:

The input numpy array that holds the grid’s layer z-coordinates.

Return type:

ndarray of float

get_input_item_count()#

Count of a model’s input variables.

Returns:

The number of input variables.

Return type:

int

get_input_var_names()#

Names of the input exchange items.

get_output_item_count()#

Count of a model’s output variables.

Returns:

The number of output variables.

Return type:

int

get_output_var_names()#

Names of the output exchange items.

get_start_time()#

Start time of the component.

get_time_step()#

Component time step.

get_time_units()#

Time units used by the component.

get_value(name, dest)#

Get a copy of a variable’s data.

get_value_at_indices(name, dest, inds)#

Get values at particular indices.

Parameters:
  • name (str) – An input or output variable name, a CSDMS Standard Name.

  • dest (ndarray) – A numpy array into which to place the values.

  • inds (array_like) – The indices into the variable array.

Returns:

Value of the model variable at the given location.

Return type:

array_like

get_value_ptr(name)#

Get a reference to values of the given variable.

This is a getter for the model, used to access the model’s current state. It returns a reference to a model variable, with the return type, size and rank dependent on the variable.

Parameters:

name (str) – An input or output variable name, a CSDMS Standard Name.

Returns:

A reference to a model variable.

Return type:

array_like

get_value_ref(name)#

Get a reference to a variable’s data.

get_var_grid(name)#

Get the grid id for a variable.

get_var_itemsize(name)#

Get the size of elements of a variable.

get_var_location(name)#

Get the grid element type that the a given variable is defined on.

The grid topology can be composed of nodes, edges, and faces.

node

A point that has a coordinate pair or triplet: the most basic element of the topology.

edge

A line or curve bounded by two nodes.

face

A plane or surface enclosed by a set of edges. In a 2D horizontal application one may consider the word “polygon”, but in the hierarchy of elements the word “face” is most common.

Parameters:

name (str) – An input or output variable name, a CSDMS Standard Name.

Returns:

The grid location on which the variable is defined. Must be one of “node”, “edge”, or “face”.

Return type:

str

Notes

CSDMS uses the ugrid conventions to define unstructured grids.

get_var_nbytes(name)#

Get the total number of bytes used by a variable.

get_var_type(name)#

Get the data type for a variable.

get_var_units(name)#

Get the unit used by a variable.

initialize(config_file)#

Initialize the component from a file.

BMI-wrapped Landlab components use input files in YAML format. Component-specific parameters are listed at the top level, followed by grid and then time information. An example input file looks like:

flexure:
    eet: 15.e+3
clock:
    start: 0
    stop: 100.
    step: 2.
grid:
    type: raster
    shape: [20, 40]
    spacing: [1000., 2000.]

In this case, a RasterModelGrid is created (with the given shape and spacing) and passed to the underlying landlab component. The eet=15000. is also given to the component but as a keyword parameter. The BMI clock is initialized with the given parameters.

Parameters:

config_file (str or file_like) – YAML-formatted input file for the component.

set_value(name, values)#

Set the values of a variable.

set_value_at_indices(name, inds, src)#

Specify a new value for a model variable at particular indices.

Parameters:
  • name (str) – An input or output variable name, a CSDMS Standard Name.

  • inds (array_like) – The indices into the variable array.

  • src (array_like) – The new value for the specified variable.

update()#

Update the component one time step.

update_frac(frac)#

Update the component a fraction of a time step.

update_until(then)#

Update the component until a given time.

class KinwaveImplicitOverlandFlowBMI#

Bases: Bmi

Basic Modeling Interface for the KinwaveImplicitOverlandFlow component.

finalize()#

Clean-up the component.

get_component_name()#

Name of the component.

get_current_time()#

Current component time.

get_end_time()#

Stop time for the component.

get_grid_edge_count(grid)#

Get the number of edges in the grid.

Parameters:

grid (int) – A grid identifier.

Returns:

The total number of grid edges.

Return type:

int

get_grid_edge_nodes(grid, edge_nodes)#

Get the edge-node connectivity.

Parameters:
  • grid (int) – A grid identifier.

  • edge_nodes (ndarray of int, shape (2 x nnodes,)) – A numpy array to place the edge-node connectivity. For each edge, connectivity is given as node at edge tail, followed by node at edge head.

Returns:

The input numpy array that holds the edge-node connectivity.

Return type:

ndarray of int

get_grid_face_count(grid)#

Get the number of faces in the grid.

Parameters:

grid (int) – A grid identifier.

Returns:

The total number of grid faces.

Return type:

int

get_grid_face_edges(grid)#

Get the face-edge connectivity.

Parameters:
  • grid (int) – A grid identifier.

  • face_edges (ndarray of int) – A numpy array to place the face-edge connectivity.

Returns:

The input numpy array that holds the face-edge connectivity.

Return type:

ndarray of int

get_grid_face_nodes(grid, face_nodes)#

Get the face-node connectivity.

Parameters:
  • grid (int) – A grid identifier.

  • face_nodes (ndarray of int) – A numpy array to place the face-node connectivity. For each face, the nodes (listed in a counter-clockwise direction) that form the boundary of the face.

Returns:

The input numpy array that holds the face-node connectivity.

Return type:

ndarray of int

get_grid_node_count(grid)#

Get the number of nodes in the grid.

Parameters:

grid (int) – A grid identifier.

Returns:

The total number of grid nodes.

Return type:

int

get_grid_nodes_per_face(grid, nodes_per_face)#

Get the number of nodes for each face.

Parameters:
  • grid (int) – A grid identifier.

  • nodes_per_face (ndarray of int, shape (nfaces,)) – A numpy array to place the number of nodes per face.

Returns:

The input numpy array that holds the number of nodes per face.

Return type:

ndarray of int

get_grid_origin(grid, origin)#

Get the origin for a structured grid.

get_grid_rank(grid)#

Get the number of dimensions of a grid.

get_grid_shape(grid, shape)#

Get the shape of a structured grid.

get_grid_size(grid)#

Get the total number of elements in the computational grid.

Parameters:

grid (int) – A grid identifier.

Returns:

Size of the grid.

Return type:

int

get_grid_spacing(grid, spacing)#

Get the row and column spacing of a structured grid.

get_grid_type(grid)#

Get the type of grid.

get_grid_x(grid, x)#

Get coordinates of grid nodes in the x direction.

Parameters:
  • grid (int) – A grid identifier.

  • x (ndarray of float, shape (nrows,)) – A numpy array to hold the x-coordinates of the grid node columns.

Returns:

The input numpy array that holds the grid’s column x-coordinates.

Return type:

ndarray of float

get_grid_y(grid, y)#

Get coordinates of grid nodes in the y direction.

Parameters:
  • grid (int) – A grid identifier.

  • y (ndarray of float, shape (ncols,)) – A numpy array to hold the y-coordinates of the grid node rows.

Returns:

The input numpy array that holds the grid’s row y-coordinates.

Return type:

ndarray of float

get_grid_z(grid, z)#

Get coordinates of grid nodes in the z direction.

Parameters:
  • grid (int) – A grid identifier.

  • z (ndarray of float, shape (nlayers,)) – A numpy array to hold the z-coordinates of the grid nodes layers.

Returns:

The input numpy array that holds the grid’s layer z-coordinates.

Return type:

ndarray of float

get_input_item_count()#

Count of a model’s input variables.

Returns:

The number of input variables.

Return type:

int

get_input_var_names()#

Names of the input exchange items.

get_output_item_count()#

Count of a model’s output variables.

Returns:

The number of output variables.

Return type:

int

get_output_var_names()#

Names of the output exchange items.

get_start_time()#

Start time of the component.

get_time_step()#

Component time step.

get_time_units()#

Time units used by the component.

get_value(name, dest)#

Get a copy of a variable’s data.

get_value_at_indices(name, dest, inds)#

Get values at particular indices.

Parameters:
  • name (str) – An input or output variable name, a CSDMS Standard Name.

  • dest (ndarray) – A numpy array into which to place the values.

  • inds (array_like) – The indices into the variable array.

Returns:

Value of the model variable at the given location.

Return type:

array_like

get_value_ptr(name)#

Get a reference to values of the given variable.

This is a getter for the model, used to access the model’s current state. It returns a reference to a model variable, with the return type, size and rank dependent on the variable.

Parameters:

name (str) – An input or output variable name, a CSDMS Standard Name.

Returns:

A reference to a model variable.

Return type:

array_like

get_value_ref(name)#

Get a reference to a variable’s data.

get_var_grid(name)#

Get the grid id for a variable.

get_var_itemsize(name)#

Get the size of elements of a variable.

get_var_location(name)#

Get the grid element type that the a given variable is defined on.

The grid topology can be composed of nodes, edges, and faces.

node

A point that has a coordinate pair or triplet: the most basic element of the topology.

edge

A line or curve bounded by two nodes.

face

A plane or surface enclosed by a set of edges. In a 2D horizontal application one may consider the word “polygon”, but in the hierarchy of elements the word “face” is most common.

Parameters:

name (str) – An input or output variable name, a CSDMS Standard Name.

Returns:

The grid location on which the variable is defined. Must be one of “node”, “edge”, or “face”.

Return type:

str

Notes

CSDMS uses the ugrid conventions to define unstructured grids.

get_var_nbytes(name)#

Get the total number of bytes used by a variable.

get_var_type(name)#

Get the data type for a variable.

get_var_units(name)#

Get the unit used by a variable.

initialize(config_file)#

Initialize the component from a file.

BMI-wrapped Landlab components use input files in YAML format. Component-specific parameters are listed at the top level, followed by grid and then time information. An example input file looks like:

flexure:
    eet: 15.e+3
clock:
    start: 0
    stop: 100.
    step: 2.
grid:
    type: raster
    shape: [20, 40]
    spacing: [1000., 2000.]

In this case, a RasterModelGrid is created (with the given shape and spacing) and passed to the underlying landlab component. The eet=15000. is also given to the component but as a keyword parameter. The BMI clock is initialized with the given parameters.

Parameters:

config_file (str or file_like) – YAML-formatted input file for the component.

set_value(name, values)#

Set the values of a variable.

set_value_at_indices(name, inds, src)#

Specify a new value for a model variable at particular indices.

Parameters:
  • name (str) – An input or output variable name, a CSDMS Standard Name.

  • inds (array_like) – The indices into the variable array.

  • src (array_like) – The new value for the specified variable.

update()#

Update the component one time step.

update_frac(frac)#

Update the component a fraction of a time step.

update_until(then)#

Update the component until a given time.

class KinwaveOverlandFlowModelBMI#

Bases: Bmi

Basic Modeling Interface for the KinwaveOverlandFlowModel component.

finalize()#

Clean-up the component.

get_component_name()#

Name of the component.

get_current_time()#

Current component time.

get_end_time()#

Stop time for the component.

get_grid_edge_count(grid)#

Get the number of edges in the grid.

Parameters:

grid (int) – A grid identifier.

Returns:

The total number of grid edges.

Return type:

int

get_grid_edge_nodes(grid, edge_nodes)#

Get the edge-node connectivity.

Parameters:
  • grid (int) – A grid identifier.

  • edge_nodes (ndarray of int, shape (2 x nnodes,)) – A numpy array to place the edge-node connectivity. For each edge, connectivity is given as node at edge tail, followed by node at edge head.

Returns:

The input numpy array that holds the edge-node connectivity.

Return type:

ndarray of int

get_grid_face_count(grid)#

Get the number of faces in the grid.

Parameters:

grid (int) – A grid identifier.

Returns:

The total number of grid faces.

Return type:

int

get_grid_face_edges(grid)#

Get the face-edge connectivity.

Parameters:
  • grid (int) – A grid identifier.

  • face_edges (ndarray of int) – A numpy array to place the face-edge connectivity.

Returns:

The input numpy array that holds the face-edge connectivity.

Return type:

ndarray of int

get_grid_face_nodes(grid, face_nodes)#

Get the face-node connectivity.

Parameters:
  • grid (int) – A grid identifier.

  • face_nodes (ndarray of int) – A numpy array to place the face-node connectivity. For each face, the nodes (listed in a counter-clockwise direction) that form the boundary of the face.

Returns:

The input numpy array that holds the face-node connectivity.

Return type:

ndarray of int

get_grid_node_count(grid)#

Get the number of nodes in the grid.

Parameters:

grid (int) – A grid identifier.

Returns:

The total number of grid nodes.

Return type:

int

get_grid_nodes_per_face(grid, nodes_per_face)#

Get the number of nodes for each face.

Parameters:
  • grid (int) – A grid identifier.

  • nodes_per_face (ndarray of int, shape (nfaces,)) – A numpy array to place the number of nodes per face.

Returns:

The input numpy array that holds the number of nodes per face.

Return type:

ndarray of int

get_grid_origin(grid, origin)#

Get the origin for a structured grid.

get_grid_rank(grid)#

Get the number of dimensions of a grid.

get_grid_shape(grid, shape)#

Get the shape of a structured grid.

get_grid_size(grid)#

Get the total number of elements in the computational grid.

Parameters:

grid (int) – A grid identifier.

Returns:

Size of the grid.

Return type:

int

get_grid_spacing(grid, spacing)#

Get the row and column spacing of a structured grid.

get_grid_type(grid)#

Get the type of grid.

get_grid_x(grid, x)#

Get coordinates of grid nodes in the x direction.

Parameters:
  • grid (int) – A grid identifier.

  • x (ndarray of float, shape (nrows,)) – A numpy array to hold the x-coordinates of the grid node columns.

Returns:

The input numpy array that holds the grid’s column x-coordinates.

Return type:

ndarray of float

get_grid_y(grid, y)#

Get coordinates of grid nodes in the y direction.

Parameters:
  • grid (int) – A grid identifier.

  • y (ndarray of float, shape (ncols,)) – A numpy array to hold the y-coordinates of the grid node rows.

Returns:

The input numpy array that holds the grid’s row y-coordinates.

Return type:

ndarray of float

get_grid_z(grid, z)#

Get coordinates of grid nodes in the z direction.

Parameters:
  • grid (int) – A grid identifier.

  • z (ndarray of float, shape (nlayers,)) – A numpy array to hold the z-coordinates of the grid nodes layers.

Returns:

The input numpy array that holds the grid’s layer z-coordinates.

Return type:

ndarray of float

get_input_item_count()#

Count of a model’s input variables.

Returns:

The number of input variables.

Return type:

int

get_input_var_names()#

Names of the input exchange items.

get_output_item_count()#

Count of a model’s output variables.

Returns:

The number of output variables.

Return type:

int

get_output_var_names()#

Names of the output exchange items.

get_start_time()#

Start time of the component.

get_time_step()#

Component time step.

get_time_units()#

Time units used by the component.

get_value(name, dest)#

Get a copy of a variable’s data.

get_value_at_indices(name, dest, inds)#

Get values at particular indices.

Parameters:
  • name (str) – An input or output variable name, a CSDMS Standard Name.

  • dest (ndarray) – A numpy array into which to place the values.

  • inds (array_like) – The indices into the variable array.

Returns:

Value of the model variable at the given location.

Return type:

array_like

get_value_ptr(name)#

Get a reference to values of the given variable.

This is a getter for the model, used to access the model’s current state. It returns a reference to a model variable, with the return type, size and rank dependent on the variable.

Parameters:

name (str) – An input or output variable name, a CSDMS Standard Name.

Returns:

A reference to a model variable.

Return type:

array_like

get_value_ref(name)#

Get a reference to a variable’s data.

get_var_grid(name)#

Get the grid id for a variable.

get_var_itemsize(name)#

Get the size of elements of a variable.

get_var_location(name)#

Get the grid element type that the a given variable is defined on.

The grid topology can be composed of nodes, edges, and faces.

node

A point that has a coordinate pair or triplet: the most basic element of the topology.

edge

A line or curve bounded by two nodes.

face

A plane or surface enclosed by a set of edges. In a 2D horizontal application one may consider the word “polygon”, but in the hierarchy of elements the word “face” is most common.

Parameters:

name (str) – An input or output variable name, a CSDMS Standard Name.

Returns:

The grid location on which the variable is defined. Must be one of “node”, “edge”, or “face”.

Return type:

str

Notes

CSDMS uses the ugrid conventions to define unstructured grids.

get_var_nbytes(name)#

Get the total number of bytes used by a variable.

get_var_type(name)#

Get the data type for a variable.

get_var_units(name)#

Get the unit used by a variable.

initialize(config_file)#

Initialize the component from a file.

BMI-wrapped Landlab components use input files in YAML format. Component-specific parameters are listed at the top level, followed by grid and then time information. An example input file looks like:

flexure:
    eet: 15.e+3
clock:
    start: 0
    stop: 100.
    step: 2.
grid:
    type: raster
    shape: [20, 40]
    spacing: [1000., 2000.]

In this case, a RasterModelGrid is created (with the given shape and spacing) and passed to the underlying landlab component. The eet=15000. is also given to the component but as a keyword parameter. The BMI clock is initialized with the given parameters.

Parameters:

config_file (str or file_like) – YAML-formatted input file for the component.

set_value(name, values)#

Set the values of a variable.

set_value_at_indices(name, inds, src)#

Specify a new value for a model variable at particular indices.

Parameters:
  • name (str) – An input or output variable name, a CSDMS Standard Name.

  • inds (array_like) – The indices into the variable array.

  • src (array_like) – The new value for the specified variable.

update()#

Update the component one time step.

update_frac(frac)#

Update the component a fraction of a time step.

update_until(then)#

Update the component until a given time.

class LakeMapperBarnesBMI#

Bases: Bmi

Basic Modeling Interface for the LakeMapperBarnes component.

finalize()#

Clean-up the component.

get_component_name()#

Name of the component.

get_current_time()#

Current component time.

get_end_time()#

Stop time for the component.

get_grid_edge_count(grid)#

Get the number of edges in the grid.

Parameters:

grid (int) – A grid identifier.

Returns:

The total number of grid edges.

Return type:

int

get_grid_edge_nodes(grid, edge_nodes)#

Get the edge-node connectivity.

Parameters:
  • grid (int) – A grid identifier.

  • edge_nodes (ndarray of int, shape (2 x nnodes,)) – A numpy array to place the edge-node connectivity. For each edge, connectivity is given as node at edge tail, followed by node at edge head.

Returns:

The input numpy array that holds the edge-node connectivity.

Return type:

ndarray of int

get_grid_face_count(grid)#

Get the number of faces in the grid.

Parameters:

grid (int) – A grid identifier.

Returns:

The total number of grid faces.

Return type:

int

get_grid_face_edges(grid)#

Get the face-edge connectivity.

Parameters:
  • grid (int) – A grid identifier.

  • face_edges (ndarray of int) – A numpy array to place the face-edge connectivity.

Returns:

The input numpy array that holds the face-edge connectivity.

Return type:

ndarray of int

get_grid_face_nodes(grid, face_nodes)#

Get the face-node connectivity.

Parameters:
  • grid (int) – A grid identifier.

  • face_nodes (ndarray of int) – A numpy array to place the face-node connectivity. For each face, the nodes (listed in a counter-clockwise direction) that form the boundary of the face.

Returns:

The input numpy array that holds the face-node connectivity.

Return type:

ndarray of int

get_grid_node_count(grid)#

Get the number of nodes in the grid.

Parameters:

grid (int) – A grid identifier.

Returns:

The total number of grid nodes.

Return type:

int

get_grid_nodes_per_face(grid, nodes_per_face)#

Get the number of nodes for each face.

Parameters:
  • grid (int) – A grid identifier.

  • nodes_per_face (ndarray of int, shape (nfaces,)) – A numpy array to place the number of nodes per face.

Returns:

The input numpy array that holds the number of nodes per face.

Return type:

ndarray of int

get_grid_origin(grid, origin)#

Get the origin for a structured grid.

get_grid_rank(grid)#

Get the number of dimensions of a grid.

get_grid_shape(grid, shape)#

Get the shape of a structured grid.

get_grid_size(grid)#

Get the total number of elements in the computational grid.

Parameters:

grid (int) – A grid identifier.

Returns:

Size of the grid.

Return type:

int

get_grid_spacing(grid, spacing)#

Get the row and column spacing of a structured grid.

get_grid_type(grid)#

Get the type of grid.

get_grid_x(grid, x)#

Get coordinates of grid nodes in the x direction.

Parameters:
  • grid (int) – A grid identifier.

  • x (ndarray of float, shape (nrows,)) – A numpy array to hold the x-coordinates of the grid node columns.

Returns:

The input numpy array that holds the grid’s column x-coordinates.

Return type:

ndarray of float

get_grid_y(grid, y)#

Get coordinates of grid nodes in the y direction.

Parameters:
  • grid (int) – A grid identifier.

  • y (ndarray of float, shape (ncols,)) – A numpy array to hold the y-coordinates of the grid node rows.

Returns:

The input numpy array that holds the grid’s row y-coordinates.

Return type:

ndarray of float

get_grid_z(grid, z)#

Get coordinates of grid nodes in the z direction.

Parameters:
  • grid (int) – A grid identifier.

  • z (ndarray of float, shape (nlayers,)) – A numpy array to hold the z-coordinates of the grid nodes layers.

Returns:

The input numpy array that holds the grid’s layer z-coordinates.

Return type:

ndarray of float

get_input_item_count()#

Count of a model’s input variables.

Returns:

The number of input variables.

Return type:

int

get_input_var_names()#

Names of the input exchange items.

get_output_item_count()#

Count of a model’s output variables.

Returns:

The number of output variables.

Return type:

int

get_output_var_names()#

Names of the output exchange items.

get_start_time()#

Start time of the component.

get_time_step()#

Component time step.

get_time_units()#

Time units used by the component.

get_value(name, dest)#

Get a copy of a variable’s data.

get_value_at_indices(name, dest, inds)#

Get values at particular indices.

Parameters:
  • name (str) – An input or output variable name, a CSDMS Standard Name.

  • dest (ndarray) – A numpy array into which to place the values.

  • inds (array_like) – The indices into the variable array.

Returns:

Value of the model variable at the given location.

Return type:

array_like

get_value_ptr(name)#

Get a reference to values of the given variable.

This is a getter for the model, used to access the model’s current state. It returns a reference to a model variable, with the return type, size and rank dependent on the variable.

Parameters:

name (str) – An input or output variable name, a CSDMS Standard Name.

Returns:

A reference to a model variable.

Return type:

array_like

get_value_ref(name)#

Get a reference to a variable’s data.

get_var_grid(name)#

Get the grid id for a variable.

get_var_itemsize(name)#

Get the size of elements of a variable.

get_var_location(name)#

Get the grid element type that the a given variable is defined on.

The grid topology can be composed of nodes, edges, and faces.

node

A point that has a coordinate pair or triplet: the most basic element of the topology.

edge

A line or curve bounded by two nodes.

face

A plane or surface enclosed by a set of edges. In a 2D horizontal application one may consider the word “polygon”, but in the hierarchy of elements the word “face” is most common.

Parameters:

name (str) – An input or output variable name, a CSDMS Standard Name.

Returns:

The grid location on which the variable is defined. Must be one of “node”, “edge”, or “face”.

Return type:

str

Notes

CSDMS uses the ugrid conventions to define unstructured grids.

get_var_nbytes(name)#

Get the total number of bytes used by a variable.

get_var_type(name)#

Get the data type for a variable.

get_var_units(name)#

Get the unit used by a variable.

initialize(config_file)#

Initialize the component from a file.

BMI-wrapped Landlab components use input files in YAML format. Component-specific parameters are listed at the top level, followed by grid and then time information. An example input file looks like:

flexure:
    eet: 15.e+3
clock:
    start: 0
    stop: 100.
    step: 2.
grid:
    type: raster
    shape: [20, 40]
    spacing: [1000., 2000.]

In this case, a RasterModelGrid is created (with the given shape and spacing) and passed to the underlying landlab component. The eet=15000. is also given to the component but as a keyword parameter. The BMI clock is initialized with the given parameters.

Parameters:

config_file (str or file_like) – YAML-formatted input file for the component.

set_value(name, values)#

Set the values of a variable.

set_value_at_indices(name, inds, src)#

Specify a new value for a model variable at particular indices.

Parameters:
  • name (str) – An input or output variable name, a CSDMS Standard Name.

  • inds (array_like) – The indices into the variable array.

  • src (array_like) – The new value for the specified variable.

update()#

Update the component one time step.

update_frac(frac)#

Update the component a fraction of a time step.

update_until(then)#

Update the component until a given time.

class LandslideProbabilityBMI#

Bases: Bmi

Basic Modeling Interface for the LandslideProbability component.

finalize()#

Clean-up the component.

get_component_name()#

Name of the component.

get_current_time()#

Current component time.

get_end_time()#

Stop time for the component.

get_grid_edge_count(grid)#

Get the number of edges in the grid.

Parameters:

grid (int) – A grid identifier.

Returns:

The total number of grid edges.

Return type:

int

get_grid_edge_nodes(grid, edge_nodes)#

Get the edge-node connectivity.

Parameters:
  • grid (int) – A grid identifier.

  • edge_nodes (ndarray of int, shape (2 x nnodes,)) – A numpy array to place the edge-node connectivity. For each edge, connectivity is given as node at edge tail, followed by node at edge head.

Returns:

The input numpy array that holds the edge-node connectivity.

Return type:

ndarray of int

get_grid_face_count(grid)#

Get the number of faces in the grid.

Parameters:

grid (int) – A grid identifier.

Returns:

The total number of grid faces.

Return type:

int

get_grid_face_edges(grid)#

Get the face-edge connectivity.

Parameters:
  • grid (int) – A grid identifier.

  • face_edges (ndarray of int) – A numpy array to place the face-edge connectivity.

Returns:

The input numpy array that holds the face-edge connectivity.

Return type:

ndarray of int

get_grid_face_nodes(grid, face_nodes)#

Get the face-node connectivity.

Parameters:
  • grid (int) – A grid identifier.

  • face_nodes (ndarray of int) – A numpy array to place the face-node connectivity. For each face, the nodes (listed in a counter-clockwise direction) that form the boundary of the face.

Returns:

The input numpy array that holds the face-node connectivity.

Return type:

ndarray of int

get_grid_node_count(grid)#

Get the number of nodes in the grid.

Parameters:

grid (int) – A grid identifier.

Returns:

The total number of grid nodes.

Return type:

int

get_grid_nodes_per_face(grid, nodes_per_face)#

Get the number of nodes for each face.

Parameters:
  • grid (int) – A grid identifier.

  • nodes_per_face (ndarray of int, shape (nfaces,)) – A numpy array to place the number of nodes per face.

Returns:

The input numpy array that holds the number of nodes per face.

Return type:

ndarray of int

get_grid_origin(grid, origin)#

Get the origin for a structured grid.

get_grid_rank(grid)#

Get the number of dimensions of a grid.

get_grid_shape(grid, shape)#

Get the shape of a structured grid.

get_grid_size(grid)#

Get the total number of elements in the computational grid.

Parameters:

grid (int) – A grid identifier.

Returns:

Size of the grid.

Return type:

int

get_grid_spacing(grid, spacing)#

Get the row and column spacing of a structured grid.

get_grid_type(grid)#

Get the type of grid.

get_grid_x(grid, x)#

Get coordinates of grid nodes in the x direction.

Parameters:
  • grid (int) – A grid identifier.

  • x (ndarray of float, shape (nrows,)) – A numpy array to hold the x-coordinates of the grid node columns.

Returns:

The input numpy array that holds the grid’s column x-coordinates.

Return type:

ndarray of float

get_grid_y(grid, y)#

Get coordinates of grid nodes in the y direction.

Parameters:
  • grid (int) – A grid identifier.

  • y (ndarray of float, shape (ncols,)) – A numpy array to hold the y-coordinates of the grid node rows.

Returns:

The input numpy array that holds the grid’s row y-coordinates.

Return type:

ndarray of float

get_grid_z(grid, z)#

Get coordinates of grid nodes in the z direction.

Parameters:
  • grid (int) – A grid identifier.

  • z (ndarray of float, shape (nlayers,)) – A numpy array to hold the z-coordinates of the grid nodes layers.

Returns:

The input numpy array that holds the grid’s layer z-coordinates.

Return type:

ndarray of float

get_input_item_count()#

Count of a model’s input variables.

Returns:

The number of input variables.

Return type:

int

get_input_var_names()#

Names of the input exchange items.

get_output_item_count()#

Count of a model’s output variables.

Returns:

The number of output variables.

Return type:

int

get_output_var_names()#

Names of the output exchange items.

get_start_time()#

Start time of the component.

get_time_step()#

Component time step.

get_time_units()#

Time units used by the component.

get_value(name, dest)#

Get a copy of a variable’s data.

get_value_at_indices(name, dest, inds)#

Get values at particular indices.

Parameters:
  • name (str) – An input or output variable name, a CSDMS Standard Name.

  • dest (ndarray) – A numpy array into which to place the values.

  • inds (array_like) – The indices into the variable array.

Returns:

Value of the model variable at the given location.

Return type:

array_like

get_value_ptr(name)#

Get a reference to values of the given variable.

This is a getter for the model, used to access the model’s current state. It returns a reference to a model variable, with the return type, size and rank dependent on the variable.

Parameters:

name (str) – An input or output variable name, a CSDMS Standard Name.

Returns:

A reference to a model variable.

Return type:

array_like

get_value_ref(name)#

Get a reference to a variable’s data.

get_var_grid(name)#

Get the grid id for a variable.

get_var_itemsize(name)#

Get the size of elements of a variable.

get_var_location(name)#

Get the grid element type that the a given variable is defined on.

The grid topology can be composed of nodes, edges, and faces.

node

A point that has a coordinate pair or triplet: the most basic element of the topology.

edge

A line or curve bounded by two nodes.

face

A plane or surface enclosed by a set of edges. In a 2D horizontal application one may consider the word “polygon”, but in the hierarchy of elements the word “face” is most common.

Parameters:

name (str) – An input or output variable name, a CSDMS Standard Name.

Returns:

The grid location on which the variable is defined. Must be one of “node”, “edge”, or “face”.

Return type:

str

Notes

CSDMS uses the ugrid conventions to define unstructured grids.

get_var_nbytes(name)#

Get the total number of bytes used by a variable.

get_var_type(name)#

Get the data type for a variable.

get_var_units(name)#

Get the unit used by a variable.

initialize(config_file)#

Initialize the component from a file.

BMI-wrapped Landlab components use input files in YAML format. Component-specific parameters are listed at the top level, followed by grid and then time information. An example input file looks like:

flexure:
    eet: 15.e+3
clock:
    start: 0
    stop: 100.
    step: 2.
grid:
    type: raster
    shape: [20, 40]
    spacing: [1000., 2000.]

In this case, a RasterModelGrid is created (with the given shape and spacing) and passed to the underlying landlab component. The eet=15000. is also given to the component but as a keyword parameter. The BMI clock is initialized with the given parameters.

Parameters:

config_file (str or file_like) – YAML-formatted input file for the component.

set_value(name, values)#

Set the values of a variable.

set_value_at_indices(name, inds, src)#

Specify a new value for a model variable at particular indices.

Parameters:
  • name (str) – An input or output variable name, a CSDMS Standard Name.

  • inds (array_like) – The indices into the variable array.

  • src (array_like) – The new value for the specified variable.

update()#

Update the component one time step.

update_frac(frac)#

Update the component a fraction of a time step.

update_until(then)#

Update the component until a given time.

class LateralEroderBMI#

Bases: Bmi

Basic Modeling Interface for the LateralEroder component.

finalize()#

Clean-up the component.

get_component_name()#

Name of the component.

get_current_time()#

Current component time.

get_end_time()#

Stop time for the component.

get_grid_edge_count(grid)#

Get the number of edges in the grid.

Parameters:

grid (int) – A grid identifier.

Returns:

The total number of grid edges.

Return type:

int

get_grid_edge_nodes(grid, edge_nodes)#

Get the edge-node connectivity.

Parameters:
  • grid (int) – A grid identifier.

  • edge_nodes (ndarray of int, shape (2 x nnodes,)) – A numpy array to place the edge-node connectivity. For each edge, connectivity is given as node at edge tail, followed by node at edge head.

Returns:

The input numpy array that holds the edge-node connectivity.

Return type:

ndarray of int

get_grid_face_count(grid)#

Get the number of faces in the grid.

Parameters:

grid (int) – A grid identifier.

Returns:

The total number of grid faces.

Return type:

int

get_grid_face_edges(grid)#

Get the face-edge connectivity.

Parameters:
  • grid (int) – A grid identifier.

  • face_edges (ndarray of int) – A numpy array to place the face-edge connectivity.

Returns:

The input numpy array that holds the face-edge connectivity.

Return type:

ndarray of int

get_grid_face_nodes(grid, face_nodes)#

Get the face-node connectivity.

Parameters:
  • grid (int) – A grid identifier.

  • face_nodes (ndarray of int) – A numpy array to place the face-node connectivity. For each face, the nodes (listed in a counter-clockwise direction) that form the boundary of the face.

Returns:

The input numpy array that holds the face-node connectivity.

Return type:

ndarray of int

get_grid_node_count(grid)#

Get the number of nodes in the grid.

Parameters:

grid (int) – A grid identifier.

Returns:

The total number of grid nodes.

Return type:

int

get_grid_nodes_per_face(grid, nodes_per_face)#

Get the number of nodes for each face.

Parameters:
  • grid (int) – A grid identifier.

  • nodes_per_face (ndarray of int, shape (nfaces,)) – A numpy array to place the number of nodes per face.

Returns:

The input numpy array that holds the number of nodes per face.

Return type:

ndarray of int

get_grid_origin(grid, origin)#

Get the origin for a structured grid.

get_grid_rank(grid)#

Get the number of dimensions of a grid.

get_grid_shape(grid, shape)#

Get the shape of a structured grid.

get_grid_size(grid)#

Get the total number of elements in the computational grid.

Parameters:

grid (int) – A grid identifier.

Returns:

Size of the grid.

Return type:

int

get_grid_spacing(grid, spacing)#

Get the row and column spacing of a structured grid.

get_grid_type(grid)#

Get the type of grid.

get_grid_x(grid, x)#

Get coordinates of grid nodes in the x direction.

Parameters:
  • grid (int) – A grid identifier.

  • x (ndarray of float, shape (nrows,)) – A numpy array to hold the x-coordinates of the grid node columns.

Returns:

The input numpy array that holds the grid’s column x-coordinates.

Return type:

ndarray of float

get_grid_y(grid, y)#

Get coordinates of grid nodes in the y direction.

Parameters:
  • grid (int) – A grid identifier.

  • y (ndarray of float, shape (ncols,)) – A numpy array to hold the y-coordinates of the grid node rows.

Returns:

The input numpy array that holds the grid’s row y-coordinates.

Return type:

ndarray of float

get_grid_z(grid, z)#

Get coordinates of grid nodes in the z direction.

Parameters:
  • grid (int) – A grid identifier.

  • z (ndarray of float, shape (nlayers,)) – A numpy array to hold the z-coordinates of the grid nodes layers.

Returns:

The input numpy array that holds the grid’s layer z-coordinates.

Return type:

ndarray of float

get_input_item_count()#

Count of a model’s input variables.

Returns:

The number of input variables.

Return type:

int

get_input_var_names()#

Names of the input exchange items.

get_output_item_count()#

Count of a model’s output variables.

Returns:

The number of output variables.

Return type:

int

get_output_var_names()#

Names of the output exchange items.

get_start_time()#

Start time of the component.

get_time_step()#

Component time step.

get_time_units()#

Time units used by the component.

get_value(name, dest)#

Get a copy of a variable’s data.

get_value_at_indices(name, dest, inds)#

Get values at particular indices.

Parameters:
  • name (str) – An input or output variable name, a CSDMS Standard Name.

  • dest (ndarray) – A numpy array into which to place the values.

  • inds (array_like) – The indices into the variable array.

Returns:

Value of the model variable at the given location.

Return type:

array_like

get_value_ptr(name)#

Get a reference to values of the given variable.

This is a getter for the model, used to access the model’s current state. It returns a reference to a model variable, with the return type, size and rank dependent on the variable.

Parameters:

name (str) – An input or output variable name, a CSDMS Standard Name.

Returns:

A reference to a model variable.

Return type:

array_like

get_value_ref(name)#

Get a reference to a variable’s data.

get_var_grid(name)#

Get the grid id for a variable.

get_var_itemsize(name)#

Get the size of elements of a variable.

get_var_location(name)#

Get the grid element type that the a given variable is defined on.

The grid topology can be composed of nodes, edges, and faces.

node

A point that has a coordinate pair or triplet: the most basic element of the topology.

edge

A line or curve bounded by two nodes.

face

A plane or surface enclosed by a set of edges. In a 2D horizontal application one may consider the word “polygon”, but in the hierarchy of elements the word “face” is most common.

Parameters:

name (str) – An input or output variable name, a CSDMS Standard Name.

Returns:

The grid location on which the variable is defined. Must be one of “node”, “edge”, or “face”.

Return type:

str

Notes

CSDMS uses the ugrid conventions to define unstructured grids.

get_var_nbytes(name)#

Get the total number of bytes used by a variable.

get_var_type(name)#

Get the data type for a variable.

get_var_units(name)#

Get the unit used by a variable.

initialize(config_file)#

Initialize the component from a file.

BMI-wrapped Landlab components use input files in YAML format. Component-specific parameters are listed at the top level, followed by grid and then time information. An example input file looks like:

flexure:
    eet: 15.e+3
clock:
    start: 0
    stop: 100.
    step: 2.
grid:
    type: raster
    shape: [20, 40]
    spacing: [1000., 2000.]

In this case, a RasterModelGrid is created (with the given shape and spacing) and passed to the underlying landlab component. The eet=15000. is also given to the component but as a keyword parameter. The BMI clock is initialized with the given parameters.

Parameters:

config_file (str or file_like) – YAML-formatted input file for the component.

set_value(name, values)#

Set the values of a variable.

set_value_at_indices(name, inds, src)#

Specify a new value for a model variable at particular indices.

Parameters:
  • name (str) – An input or output variable name, a CSDMS Standard Name.

  • inds (array_like) – The indices into the variable array.

  • src (array_like) – The new value for the specified variable.

update()#

Update the component one time step.

update_frac(frac)#

Update the component a fraction of a time step.

update_until(then)#

Update the component until a given time.

class LinearDiffuserBMI#

Bases: Bmi

Basic Modeling Interface for the LinearDiffuser component.

finalize()#

Clean-up the component.

get_component_name()#

Name of the component.

get_current_time()#

Current component time.

get_end_time()#

Stop time for the component.

get_grid_edge_count(grid)#

Get the number of edges in the grid.

Parameters:

grid (int) – A grid identifier.

Returns:

The total number of grid edges.

Return type:

int

get_grid_edge_nodes(grid, edge_nodes)#

Get the edge-node connectivity.

Parameters:
  • grid (int) – A grid identifier.

  • edge_nodes (ndarray of int, shape (2 x nnodes,)) – A numpy array to place the edge-node connectivity. For each edge, connectivity is given as node at edge tail, followed by node at edge head.

Returns:

The input numpy array that holds the edge-node connectivity.

Return type:

ndarray of int

get_grid_face_count(grid)#

Get the number of faces in the grid.

Parameters:

grid (int) – A grid identifier.

Returns:

The total number of grid faces.

Return type:

int

get_grid_face_edges(grid)#

Get the face-edge connectivity.

Parameters:
  • grid (int) – A grid identifier.

  • face_edges (ndarray of int) – A numpy array to place the face-edge connectivity.

Returns:

The input numpy array that holds the face-edge connectivity.

Return type:

ndarray of int

get_grid_face_nodes(grid, face_nodes)#

Get the face-node connectivity.

Parameters:
  • grid (int) – A grid identifier.

  • face_nodes (ndarray of int) – A numpy array to place the face-node connectivity. For each face, the nodes (listed in a counter-clockwise direction) that form the boundary of the face.

Returns:

The input numpy array that holds the face-node connectivity.

Return type:

ndarray of int

get_grid_node_count(grid)#

Get the number of nodes in the grid.

Parameters:

grid (int) – A grid identifier.

Returns:

The total number of grid nodes.

Return type:

int

get_grid_nodes_per_face(grid, nodes_per_face)#

Get the number of nodes for each face.

Parameters:
  • grid (int) – A grid identifier.

  • nodes_per_face (ndarray of int, shape (nfaces,)) – A numpy array to place the number of nodes per face.

Returns:

The input numpy array that holds the number of nodes per face.

Return type:

ndarray of int

get_grid_origin(grid, origin)#

Get the origin for a structured grid.

get_grid_rank(grid)#

Get the number of dimensions of a grid.

get_grid_shape(grid, shape)#

Get the shape of a structured grid.

get_grid_size(grid)#

Get the total number of elements in the computational grid.

Parameters:

grid (int) – A grid identifier.

Returns:

Size of the grid.

Return type:

int

get_grid_spacing(grid, spacing)#

Get the row and column spacing of a structured grid.

get_grid_type(grid)#

Get the type of grid.

get_grid_x(grid, x)#

Get coordinates of grid nodes in the x direction.

Parameters:
  • grid (int) – A grid identifier.

  • x (ndarray of float, shape (nrows,)) – A numpy array to hold the x-coordinates of the grid node columns.

Returns:

The input numpy array that holds the grid’s column x-coordinates.

Return type:

ndarray of float

get_grid_y(grid, y)#

Get coordinates of grid nodes in the y direction.

Parameters:
  • grid (int) – A grid identifier.

  • y (ndarray of float, shape (ncols,)) – A numpy array to hold the y-coordinates of the grid node rows.

Returns:

The input numpy array that holds the grid’s row y-coordinates.

Return type:

ndarray of float

get_grid_z(grid, z)#

Get coordinates of grid nodes in the z direction.

Parameters:
  • grid (int) – A grid identifier.

  • z (ndarray of float, shape (nlayers,)) – A numpy array to hold the z-coordinates of the grid nodes layers.

Returns:

The input numpy array that holds the grid’s layer z-coordinates.

Return type:

ndarray of float

get_input_item_count()#

Count of a model’s input variables.

Returns:

The number of input variables.

Return type:

int

get_input_var_names()#

Names of the input exchange items.

get_output_item_count()#

Count of a model’s output variables.

Returns:

The number of output variables.

Return type:

int

get_output_var_names()#

Names of the output exchange items.

get_start_time()#

Start time of the component.

get_time_step()#

Component time step.

get_time_units()#

Time units used by the component.

get_value(name, dest)#

Get a copy of a variable’s data.

get_value_at_indices(name, dest, inds)#

Get values at particular indices.

Parameters:
  • name (str) – An input or output variable name, a CSDMS Standard Name.

  • dest (ndarray) – A numpy array into which to place the values.

  • inds (array_like) – The indices into the variable array.

Returns:

Value of the model variable at the given location.

Return type:

array_like

get_value_ptr(name)#

Get a reference to values of the given variable.

This is a getter for the model, used to access the model’s current state. It returns a reference to a model variable, with the return type, size and rank dependent on the variable.

Parameters:

name (str) – An input or output variable name, a CSDMS Standard Name.

Returns:

A reference to a model variable.

Return type:

array_like

get_value_ref(name)#

Get a reference to a variable’s data.

get_var_grid(name)#

Get the grid id for a variable.

get_var_itemsize(name)#

Get the size of elements of a variable.

get_var_location(name)#

Get the grid element type that the a given variable is defined on.

The grid topology can be composed of nodes, edges, and faces.

node

A point that has a coordinate pair or triplet: the most basic element of the topology.

edge

A line or curve bounded by two nodes.

face

A plane or surface enclosed by a set of edges. In a 2D horizontal application one may consider the word “polygon”, but in the hierarchy of elements the word “face” is most common.

Parameters:

name (str) – An input or output variable name, a CSDMS Standard Name.

Returns:

The grid location on which the variable is defined. Must be one of “node”, “edge”, or “face”.

Return type:

str

Notes

CSDMS uses the ugrid conventions to define unstructured grids.

get_var_nbytes(name)#

Get the total number of bytes used by a variable.

get_var_type(name)#

Get the data type for a variable.

get_var_units(name)#

Get the unit used by a variable.

initialize(config_file)#

Initialize the component from a file.

BMI-wrapped Landlab components use input files in YAML format. Component-specific parameters are listed at the top level, followed by grid and then time information. An example input file looks like:

flexure:
    eet: 15.e+3
clock:
    start: 0
    stop: 100.
    step: 2.
grid:
    type: raster
    shape: [20, 40]
    spacing: [1000., 2000.]

In this case, a RasterModelGrid is created (with the given shape and spacing) and passed to the underlying landlab component. The eet=15000. is also given to the component but as a keyword parameter. The BMI clock is initialized with the given parameters.

Parameters:

config_file (str or file_like) – YAML-formatted input file for the component.

set_value(name, values)#

Set the values of a variable.

set_value_at_indices(name, inds, src)#

Specify a new value for a model variable at particular indices.

Parameters:
  • name (str) – An input or output variable name, a CSDMS Standard Name.

  • inds (array_like) – The indices into the variable array.

  • src (array_like) – The new value for the specified variable.

update()#

Update the component one time step.

update_frac(frac)#

Update the component a fraction of a time step.

update_until(then)#

Update the component until a given time.

class LinearDiffusionOverlandFlowRouterBMI#

Bases: Bmi

Basic Modeling Interface for the LinearDiffusionOverlandFlowRouter component.

finalize()#

Clean-up the component.

get_component_name()#

Name of the component.

get_current_time()#

Current component time.

get_end_time()#

Stop time for the component.

get_grid_edge_count(grid)#

Get the number of edges in the grid.

Parameters:

grid (int) – A grid identifier.

Returns:

The total number of grid edges.

Return type:

int

get_grid_edge_nodes(grid, edge_nodes)#

Get the edge-node connectivity.

Parameters:
  • grid (int) – A grid identifier.

  • edge_nodes (ndarray of int, shape (2 x nnodes,)) – A numpy array to place the edge-node connectivity. For each edge, connectivity is given as node at edge tail, followed by node at edge head.

Returns:

The input numpy array that holds the edge-node connectivity.

Return type:

ndarray of int

get_grid_face_count(grid)#

Get the number of faces in the grid.

Parameters:

grid (int) – A grid identifier.

Returns:

The total number of grid faces.

Return type:

int

get_grid_face_edges(grid)#

Get the face-edge connectivity.

Parameters:
  • grid (int) – A grid identifier.

  • face_edges (ndarray of int) – A numpy array to place the face-edge connectivity.

Returns:

The input numpy array that holds the face-edge connectivity.

Return type:

ndarray of int

get_grid_face_nodes(grid, face_nodes)#

Get the face-node connectivity.

Parameters:
  • grid (int) – A grid identifier.

  • face_nodes (ndarray of int) – A numpy array to place the face-node connectivity. For each face, the nodes (listed in a counter-clockwise direction) that form the boundary of the face.

Returns:

The input numpy array that holds the face-node connectivity.

Return type:

ndarray of int

get_grid_node_count(grid)#

Get the number of nodes in the grid.

Parameters:

grid (int) – A grid identifier.

Returns:

The total number of grid nodes.

Return type:

int

get_grid_nodes_per_face(grid, nodes_per_face)#

Get the number of nodes for each face.

Parameters:
  • grid (int) – A grid identifier.

  • nodes_per_face (ndarray of int, shape (nfaces,)) – A numpy array to place the number of nodes per face.

Returns:

The input numpy array that holds the number of nodes per face.

Return type:

ndarray of int

get_grid_origin(grid, origin)#

Get the origin for a structured grid.

get_grid_rank(grid)#

Get the number of dimensions of a grid.

get_grid_shape(grid, shape)#

Get the shape of a structured grid.

get_grid_size(grid)#

Get the total number of elements in the computational grid.

Parameters:

grid (int) – A grid identifier.

Returns:

Size of the grid.

Return type:

int

get_grid_spacing(grid, spacing)#

Get the row and column spacing of a structured grid.

get_grid_type(grid)#

Get the type of grid.

get_grid_x(grid, x)#

Get coordinates of grid nodes in the x direction.

Parameters:
  • grid (int) – A grid identifier.

  • x (ndarray of float, shape (nrows,)) – A numpy array to hold the x-coordinates of the grid node columns.

Returns:

The input numpy array that holds the grid’s column x-coordinates.

Return type:

ndarray of float

get_grid_y(grid, y)#

Get coordinates of grid nodes in the y direction.

Parameters:
  • grid (int) – A grid identifier.

  • y (ndarray of float, shape (ncols,)) – A numpy array to hold the y-coordinates of the grid node rows.

Returns:

The input numpy array that holds the grid’s row y-coordinates.

Return type:

ndarray of float

get_grid_z(grid, z)#

Get coordinates of grid nodes in the z direction.

Parameters:
  • grid (int) – A grid identifier.

  • z (ndarray of float, shape (nlayers,)) – A numpy array to hold the z-coordinates of the grid nodes layers.

Returns:

The input numpy array that holds the grid’s layer z-coordinates.

Return type:

ndarray of float

get_input_item_count()#

Count of a model’s input variables.

Returns:

The number of input variables.

Return type:

int

get_input_var_names()#

Names of the input exchange items.

get_output_item_count()#

Count of a model’s output variables.

Returns:

The number of output variables.

Return type:

int

get_output_var_names()#

Names of the output exchange items.

get_start_time()#

Start time of the component.

get_time_step()#

Component time step.

get_time_units()#

Time units used by the component.

get_value(name, dest)#

Get a copy of a variable’s data.

get_value_at_indices(name, dest, inds)#

Get values at particular indices.

Parameters:
  • name (str) – An input or output variable name, a CSDMS Standard Name.

  • dest (ndarray) – A numpy array into which to place the values.

  • inds (array_like) – The indices into the variable array.

Returns:

Value of the model variable at the given location.

Return type:

array_like

get_value_ptr(name)#

Get a reference to values of the given variable.

This is a getter for the model, used to access the model’s current state. It returns a reference to a model variable, with the return type, size and rank dependent on the variable.

Parameters:

name (str) – An input or output variable name, a CSDMS Standard Name.

Returns:

A reference to a model variable.

Return type:

array_like

get_value_ref(name)#

Get a reference to a variable’s data.

get_var_grid(name)#

Get the grid id for a variable.

get_var_itemsize(name)#

Get the size of elements of a variable.

get_var_location(name)#

Get the grid element type that the a given variable is defined on.

The grid topology can be composed of nodes, edges, and faces.

node

A point that has a coordinate pair or triplet: the most basic element of the topology.

edge

A line or curve bounded by two nodes.

face

A plane or surface enclosed by a set of edges. In a 2D horizontal application one may consider the word “polygon”, but in the hierarchy of elements the word “face” is most common.

Parameters:

name (str) – An input or output variable name, a CSDMS Standard Name.

Returns:

The grid location on which the variable is defined. Must be one of “node”, “edge”, or “face”.

Return type:

str

Notes

CSDMS uses the ugrid conventions to define unstructured grids.

get_var_nbytes(name)#

Get the total number of bytes used by a variable.

get_var_type(name)#

Get the data type for a variable.

get_var_units(name)#

Get the unit used by a variable.

initialize(config_file)#

Initialize the component from a file.

BMI-wrapped Landlab components use input files in YAML format. Component-specific parameters are listed at the top level, followed by grid and then time information. An example input file looks like:

flexure:
    eet: 15.e+3
clock:
    start: 0
    stop: 100.
    step: 2.
grid:
    type: raster
    shape: [20, 40]
    spacing: [1000., 2000.]

In this case, a RasterModelGrid is created (with the given shape and spacing) and passed to the underlying landlab component. The eet=15000. is also given to the component but as a keyword parameter. The BMI clock is initialized with the given parameters.

Parameters:

config_file (str or file_like) – YAML-formatted input file for the component.

set_value(name, values)#

Set the values of a variable.

set_value_at_indices(name, inds, src)#

Specify a new value for a model variable at particular indices.

Parameters:
  • name (str) – An input or output variable name, a CSDMS Standard Name.

  • inds (array_like) – The indices into the variable array.

  • src (array_like) – The new value for the specified variable.

update()#

Update the component one time step.

update_frac(frac)#

Update the component a fraction of a time step.

update_until(then)#

Update the component until a given time.

class ListricKinematicExtenderBMI#

Bases: Bmi

Basic Modeling Interface for the ListricKinematicExtender component.

finalize()#

Clean-up the component.

get_component_name()#

Name of the component.

get_current_time()#

Current component time.

get_end_time()#

Stop time for the component.

get_grid_edge_count(grid)#

Get the number of edges in the grid.

Parameters:

grid (int) – A grid identifier.

Returns:

The total number of grid edges.

Return type:

int

get_grid_edge_nodes(grid, edge_nodes)#

Get the edge-node connectivity.

Parameters:
  • grid (int) – A grid identifier.

  • edge_nodes (ndarray of int, shape (2 x nnodes,)) – A numpy array to place the edge-node connectivity. For each edge, connectivity is given as node at edge tail, followed by node at edge head.

Returns:

The input numpy array that holds the edge-node connectivity.

Return type:

ndarray of int

get_grid_face_count(grid)#

Get the number of faces in the grid.

Parameters:

grid (int) – A grid identifier.

Returns:

The total number of grid faces.

Return type:

int

get_grid_face_edges(grid)#

Get the face-edge connectivity.

Parameters:
  • grid (int) – A grid identifier.

  • face_edges (ndarray of int) – A numpy array to place the face-edge connectivity.

Returns:

The input numpy array that holds the face-edge connectivity.

Return type:

ndarray of int

get_grid_face_nodes(grid, face_nodes)#

Get the face-node connectivity.

Parameters:
  • grid (int) – A grid identifier.

  • face_nodes (ndarray of int) – A numpy array to place the face-node connectivity. For each face, the nodes (listed in a counter-clockwise direction) that form the boundary of the face.

Returns:

The input numpy array that holds the face-node connectivity.

Return type:

ndarray of int

get_grid_node_count(grid)#

Get the number of nodes in the grid.

Parameters:

grid (int) – A grid identifier.

Returns:

The total number of grid nodes.

Return type:

int

get_grid_nodes_per_face(grid, nodes_per_face)#

Get the number of nodes for each face.

Parameters:
  • grid (int) – A grid identifier.

  • nodes_per_face (ndarray of int, shape (nfaces,)) – A numpy array to place the number of nodes per face.

Returns:

The input numpy array that holds the number of nodes per face.

Return type:

ndarray of int

get_grid_origin(grid, origin)#

Get the origin for a structured grid.

get_grid_rank(grid)#

Get the number of dimensions of a grid.

get_grid_shape(grid, shape)#

Get the shape of a structured grid.

get_grid_size(grid)#

Get the total number of elements in the computational grid.

Parameters:

grid (int) – A grid identifier.

Returns:

Size of the grid.

Return type:

int

get_grid_spacing(grid, spacing)#

Get the row and column spacing of a structured grid.

get_grid_type(grid)#

Get the type of grid.

get_grid_x(grid, x)#

Get coordinates of grid nodes in the x direction.

Parameters:
  • grid (int) – A grid identifier.

  • x (ndarray of float, shape (nrows,)) – A numpy array to hold the x-coordinates of the grid node columns.

Returns:

The input numpy array that holds the grid’s column x-coordinates.

Return type:

ndarray of float

get_grid_y(grid, y)#

Get coordinates of grid nodes in the y direction.

Parameters:
  • grid (int) – A grid identifier.

  • y (ndarray of float, shape (ncols,)) – A numpy array to hold the y-coordinates of the grid node rows.

Returns:

The input numpy array that holds the grid’s row y-coordinates.

Return type:

ndarray of float

get_grid_z(grid, z)#

Get coordinates of grid nodes in the z direction.

Parameters:
  • grid (int) – A grid identifier.

  • z (ndarray of float, shape (nlayers,)) – A numpy array to hold the z-coordinates of the grid nodes layers.

Returns:

The input numpy array that holds the grid’s layer z-coordinates.

Return type:

ndarray of float

get_input_item_count()#

Count of a model’s input variables.

Returns:

The number of input variables.

Return type:

int

get_input_var_names()#

Names of the input exchange items.

get_output_item_count()#

Count of a model’s output variables.

Returns:

The number of output variables.

Return type:

int

get_output_var_names()#

Names of the output exchange items.

get_start_time()#

Start time of the component.

get_time_step()#

Component time step.

get_time_units()#

Time units used by the component.

get_value(name, dest)#

Get a copy of a variable’s data.

get_value_at_indices(name, dest, inds)#

Get values at particular indices.

Parameters:
  • name (str) – An input or output variable name, a CSDMS Standard Name.

  • dest (ndarray) – A numpy array into which to place the values.

  • inds (array_like) – The indices into the variable array.

Returns:

Value of the model variable at the given location.

Return type:

array_like

get_value_ptr(name)#

Get a reference to values of the given variable.

This is a getter for the model, used to access the model’s current state. It returns a reference to a model variable, with the return type, size and rank dependent on the variable.

Parameters:

name (str) – An input or output variable name, a CSDMS Standard Name.

Returns:

A reference to a model variable.

Return type:

array_like

get_value_ref(name)#

Get a reference to a variable’s data.

get_var_grid(name)#

Get the grid id for a variable.

get_var_itemsize(name)#

Get the size of elements of a variable.

get_var_location(name)#

Get the grid element type that the a given variable is defined on.

The grid topology can be composed of nodes, edges, and faces.

node

A point that has a coordinate pair or triplet: the most basic element of the topology.

edge

A line or curve bounded by two nodes.

face

A plane or surface enclosed by a set of edges. In a 2D horizontal application one may consider the word “polygon”, but in the hierarchy of elements the word “face” is most common.

Parameters:

name (str) – An input or output variable name, a CSDMS Standard Name.

Returns:

The grid location on which the variable is defined. Must be one of “node”, “edge”, or “face”.

Return type:

str

Notes

CSDMS uses the ugrid conventions to define unstructured grids.

get_var_nbytes(name)#

Get the total number of bytes used by a variable.

get_var_type(name)#

Get the data type for a variable.

get_var_units(name)#

Get the unit used by a variable.

initialize(config_file)#

Initialize the component from a file.

BMI-wrapped Landlab components use input files in YAML format. Component-specific parameters are listed at the top level, followed by grid and then time information. An example input file looks like:

flexure:
    eet: 15.e+3
clock:
    start: 0
    stop: 100.
    step: 2.
grid:
    type: raster
    shape: [20, 40]
    spacing: [1000., 2000.]

In this case, a RasterModelGrid is created (with the given shape and spacing) and passed to the underlying landlab component. The eet=15000. is also given to the component but as a keyword parameter. The BMI clock is initialized with the given parameters.

Parameters:

config_file (str or file_like) – YAML-formatted input file for the component.

set_value(name, values)#

Set the values of a variable.

set_value_at_indices(name, inds, src)#

Specify a new value for a model variable at particular indices.

Parameters:
  • name (str) – An input or output variable name, a CSDMS Standard Name.

  • inds (array_like) – The indices into the variable array.

  • src (array_like) – The new value for the specified variable.

update()#

Update the component one time step.

update_frac(frac)#

Update the component a fraction of a time step.

update_until(then)#

Update the component until a given time.

class LithoLayersBMI#

Bases: Bmi

Basic Modeling Interface for the LithoLayers component.

finalize()#

Clean-up the component.

get_component_name()#

Name of the component.

get_current_time()#

Current component time.

get_end_time()#

Stop time for the component.

get_grid_edge_count(grid)#

Get the number of edges in the grid.

Parameters:

grid (int) – A grid identifier.

Returns:

The total number of grid edges.

Return type:

int

get_grid_edge_nodes(grid, edge_nodes)#

Get the edge-node connectivity.

Parameters:
  • grid (int) – A grid identifier.

  • edge_nodes (ndarray of int, shape (2 x nnodes,)) – A numpy array to place the edge-node connectivity. For each edge, connectivity is given as node at edge tail, followed by node at edge head.

Returns:

The input numpy array that holds the edge-node connectivity.

Return type:

ndarray of int

get_grid_face_count(grid)#

Get the number of faces in the grid.

Parameters:

grid (int) – A grid identifier.

Returns:

The total number of grid faces.

Return type:

int

get_grid_face_edges(grid)#

Get the face-edge connectivity.

Parameters:
  • grid (int) – A grid identifier.

  • face_edges (ndarray of int) – A numpy array to place the face-edge connectivity.

Returns:

The input numpy array that holds the face-edge connectivity.

Return type:

ndarray of int

get_grid_face_nodes(grid, face_nodes)#

Get the face-node connectivity.

Parameters:
  • grid (int) – A grid identifier.

  • face_nodes (ndarray of int) – A numpy array to place the face-node connectivity. For each face, the nodes (listed in a counter-clockwise direction) that form the boundary of the face.

Returns:

The input numpy array that holds the face-node connectivity.

Return type:

ndarray of int

get_grid_node_count(grid)#

Get the number of nodes in the grid.

Parameters:

grid (int) – A grid identifier.

Returns:

The total number of grid nodes.

Return type:

int

get_grid_nodes_per_face(grid, nodes_per_face)#

Get the number of nodes for each face.

Parameters:
  • grid (int) – A grid identifier.

  • nodes_per_face (ndarray of int, shape (nfaces,)) – A numpy array to place the number of nodes per face.

Returns:

The input numpy array that holds the number of nodes per face.

Return type:

ndarray of int

get_grid_origin(grid, origin)#

Get the origin for a structured grid.

get_grid_rank(grid)#

Get the number of dimensions of a grid.

get_grid_shape(grid, shape)#

Get the shape of a structured grid.

get_grid_size(grid)#

Get the total number of elements in the computational grid.

Parameters:

grid (int) – A grid identifier.

Returns:

Size of the grid.

Return type:

int

get_grid_spacing(grid, spacing)#

Get the row and column spacing of a structured grid.

get_grid_type(grid)#

Get the type of grid.

get_grid_x(grid, x)#

Get coordinates of grid nodes in the x direction.

Parameters:
  • grid (int) – A grid identifier.

  • x (ndarray of float, shape (nrows,)) – A numpy array to hold the x-coordinates of the grid node columns.

Returns:

The input numpy array that holds the grid’s column x-coordinates.

Return type:

ndarray of float

get_grid_y(grid, y)#

Get coordinates of grid nodes in the y direction.

Parameters:
  • grid (int) – A grid identifier.

  • y (ndarray of float, shape (ncols,)) – A numpy array to hold the y-coordinates of the grid node rows.

Returns:

The input numpy array that holds the grid’s row y-coordinates.

Return type:

ndarray of float

get_grid_z(grid, z)#

Get coordinates of grid nodes in the z direction.

Parameters:
  • grid (int) – A grid identifier.

  • z (ndarray of float, shape (nlayers,)) – A numpy array to hold the z-coordinates of the grid nodes layers.

Returns:

The input numpy array that holds the grid’s layer z-coordinates.

Return type:

ndarray of float

get_input_item_count()#

Count of a model’s input variables.

Returns:

The number of input variables.

Return type:

int

get_input_var_names()#

Names of the input exchange items.

get_output_item_count()#

Count of a model’s output variables.

Returns:

The number of output variables.

Return type:

int

get_output_var_names()#

Names of the output exchange items.

get_start_time()#

Start time of the component.

get_time_step()#

Component time step.

get_time_units()#

Time units used by the component.

get_value(name, dest)#

Get a copy of a variable’s data.

get_value_at_indices(name, dest, inds)#

Get values at particular indices.

Parameters:
  • name (str) – An input or output variable name, a CSDMS Standard Name.

  • dest (ndarray) – A numpy array into which to place the values.

  • inds (array_like) – The indices into the variable array.

Returns:

Value of the model variable at the given location.

Return type:

array_like

get_value_ptr(name)#

Get a reference to values of the given variable.

This is a getter for the model, used to access the model’s current state. It returns a reference to a model variable, with the return type, size and rank dependent on the variable.

Parameters:

name (str) – An input or output variable name, a CSDMS Standard Name.

Returns:

A reference to a model variable.

Return type:

array_like

get_value_ref(name)#

Get a reference to a variable’s data.

get_var_grid(name)#

Get the grid id for a variable.

get_var_itemsize(name)#

Get the size of elements of a variable.

get_var_location(name)#

Get the grid element type that the a given variable is defined on.

The grid topology can be composed of nodes, edges, and faces.

node

A point that has a coordinate pair or triplet: the most basic element of the topology.

edge

A line or curve bounded by two nodes.

face

A plane or surface enclosed by a set of edges. In a 2D horizontal application one may consider the word “polygon”, but in the hierarchy of elements the word “face” is most common.

Parameters:

name (str) – An input or output variable name, a CSDMS Standard Name.

Returns:

The grid location on which the variable is defined. Must be one of “node”, “edge”, or “face”.

Return type:

str

Notes

CSDMS uses the ugrid conventions to define unstructured grids.

get_var_nbytes(name)#

Get the total number of bytes used by a variable.

get_var_type(name)#

Get the data type for a variable.

get_var_units(name)#

Get the unit used by a variable.

initialize(config_file)#

Initialize the component from a file.

BMI-wrapped Landlab components use input files in YAML format. Component-specific parameters are listed at the top level, followed by grid and then time information. An example input file looks like:

flexure:
    eet: 15.e+3
clock:
    start: 0
    stop: 100.
    step: 2.
grid:
    type: raster
    shape: [20, 40]
    spacing: [1000., 2000.]

In this case, a RasterModelGrid is created (with the given shape and spacing) and passed to the underlying landlab component. The eet=15000. is also given to the component but as a keyword parameter. The BMI clock is initialized with the given parameters.

Parameters:

config_file (str or file_like) – YAML-formatted input file for the component.

set_value(name, values)#

Set the values of a variable.

set_value_at_indices(name, inds, src)#

Specify a new value for a model variable at particular indices.

Parameters:
  • name (str) – An input or output variable name, a CSDMS Standard Name.

  • inds (array_like) – The indices into the variable array.

  • src (array_like) – The new value for the specified variable.

update()#

Update the component one time step.

update_frac(frac)#

Update the component a fraction of a time step.

update_until(then)#

Update the component until a given time.

class LithologyBMI#

Bases: Bmi

Basic Modeling Interface for the Lithology component.

finalize()#

Clean-up the component.

get_component_name()#

Name of the component.

get_current_time()#

Current component time.

get_end_time()#

Stop time for the component.

get_grid_edge_count(grid)#

Get the number of edges in the grid.

Parameters:

grid (int) – A grid identifier.

Returns:

The total number of grid edges.

Return type:

int

get_grid_edge_nodes(grid, edge_nodes)#

Get the edge-node connectivity.

Parameters:
  • grid (int) – A grid identifier.

  • edge_nodes (ndarray of int, shape (2 x nnodes,)) – A numpy array to place the edge-node connectivity. For each edge, connectivity is given as node at edge tail, followed by node at edge head.

Returns:

The input numpy array that holds the edge-node connectivity.

Return type:

ndarray of int

get_grid_face_count(grid)#

Get the number of faces in the grid.

Parameters:

grid (int) – A grid identifier.

Returns:

The total number of grid faces.

Return type:

int

get_grid_face_edges(grid)#

Get the face-edge connectivity.

Parameters:
  • grid (int) – A grid identifier.

  • face_edges (ndarray of int) – A numpy array to place the face-edge connectivity.

Returns:

The input numpy array that holds the face-edge connectivity.

Return type:

ndarray of int

get_grid_face_nodes(grid, face_nodes)#

Get the face-node connectivity.

Parameters:
  • grid (int) – A grid identifier.

  • face_nodes (ndarray of int) – A numpy array to place the face-node connectivity. For each face, the nodes (listed in a counter-clockwise direction) that form the boundary of the face.

Returns:

The input numpy array that holds the face-node connectivity.

Return type:

ndarray of int

get_grid_node_count(grid)#

Get the number of nodes in the grid.

Parameters:

grid (int) – A grid identifier.

Returns:

The total number of grid nodes.

Return type:

int

get_grid_nodes_per_face(grid, nodes_per_face)#

Get the number of nodes for each face.

Parameters:
  • grid (int) – A grid identifier.

  • nodes_per_face (ndarray of int, shape (nfaces,)) – A numpy array to place the number of nodes per face.

Returns:

The input numpy array that holds the number of nodes per face.

Return type:

ndarray of int

get_grid_origin(grid, origin)#

Get the origin for a structured grid.

get_grid_rank(grid)#

Get the number of dimensions of a grid.

get_grid_shape(grid, shape)#

Get the shape of a structured grid.

get_grid_size(grid)#

Get the total number of elements in the computational grid.

Parameters:

grid (int) – A grid identifier.

Returns:

Size of the grid.

Return type:

int

get_grid_spacing(grid, spacing)#

Get the row and column spacing of a structured grid.

get_grid_type(grid)#

Get the type of grid.

get_grid_x(grid, x)#

Get coordinates of grid nodes in the x direction.

Parameters:
  • grid (int) – A grid identifier.

  • x (ndarray of float, shape (nrows,)) – A numpy array to hold the x-coordinates of the grid node columns.

Returns:

The input numpy array that holds the grid’s column x-coordinates.

Return type:

ndarray of float

get_grid_y(grid, y)#

Get coordinates of grid nodes in the y direction.

Parameters:
  • grid (int) – A grid identifier.

  • y (ndarray of float, shape (ncols,)) – A numpy array to hold the y-coordinates of the grid node rows.

Returns:

The input numpy array that holds the grid’s row y-coordinates.

Return type:

ndarray of float

get_grid_z(grid, z)#

Get coordinates of grid nodes in the z direction.

Parameters:
  • grid (int) – A grid identifier.

  • z (ndarray of float, shape (nlayers,)) – A numpy array to hold the z-coordinates of the grid nodes layers.

Returns:

The input numpy array that holds the grid’s layer z-coordinates.

Return type:

ndarray of float

get_input_item_count()#

Count of a model’s input variables.

Returns:

The number of input variables.

Return type:

int

get_input_var_names()#

Names of the input exchange items.

get_output_item_count()#

Count of a model’s output variables.

Returns:

The number of output variables.

Return type:

int

get_output_var_names()#

Names of the output exchange items.

get_start_time()#

Start time of the component.

get_time_step()#

Component time step.

get_time_units()#

Time units used by the component.

get_value(name, dest)#

Get a copy of a variable’s data.

get_value_at_indices(name, dest, inds)#

Get values at particular indices.

Parameters:
  • name (str) – An input or output variable name, a CSDMS Standard Name.

  • dest (ndarray) – A numpy array into which to place the values.

  • inds (array_like) – The indices into the variable array.

Returns:

Value of the model variable at the given location.

Return type:

array_like

get_value_ptr(name)#

Get a reference to values of the given variable.

This is a getter for the model, used to access the model’s current state. It returns a reference to a model variable, with the return type, size and rank dependent on the variable.

Parameters:

name (str) – An input or output variable name, a CSDMS Standard Name.

Returns:

A reference to a model variable.

Return type:

array_like

get_value_ref(name)#

Get a reference to a variable’s data.

get_var_grid(name)#

Get the grid id for a variable.

get_var_itemsize(name)#

Get the size of elements of a variable.

get_var_location(name)#

Get the grid element type that the a given variable is defined on.

The grid topology can be composed of nodes, edges, and faces.

node

A point that has a coordinate pair or triplet: the most basic element of the topology.

edge

A line or curve bounded by two nodes.

face

A plane or surface enclosed by a set of edges. In a 2D horizontal application one may consider the word “polygon”, but in the hierarchy of elements the word “face” is most common.

Parameters:

name (str) – An input or output variable name, a CSDMS Standard Name.

Returns:

The grid location on which the variable is defined. Must be one of “node”, “edge”, or “face”.

Return type:

str

Notes

CSDMS uses the ugrid conventions to define unstructured grids.

get_var_nbytes(name)#

Get the total number of bytes used by a variable.

get_var_type(name)#

Get the data type for a variable.

get_var_units(name)#

Get the unit used by a variable.

initialize(config_file)#

Initialize the component from a file.

BMI-wrapped Landlab components use input files in YAML format. Component-specific parameters are listed at the top level, followed by grid and then time information. An example input file looks like:

flexure:
    eet: 15.e+3
clock:
    start: 0
    stop: 100.
    step: 2.
grid:
    type: raster
    shape: [20, 40]
    spacing: [1000., 2000.]

In this case, a RasterModelGrid is created (with the given shape and spacing) and passed to the underlying landlab component. The eet=15000. is also given to the component but as a keyword parameter. The BMI clock is initialized with the given parameters.

Parameters:

config_file (str or file_like) – YAML-formatted input file for the component.

set_value(name, values)#

Set the values of a variable.

set_value_at_indices(name, inds, src)#

Specify a new value for a model variable at particular indices.

Parameters:
  • name (str) – An input or output variable name, a CSDMS Standard Name.

  • inds (array_like) – The indices into the variable array.

  • src (array_like) – The new value for the specified variable.

update()#

Update the component one time step.

update_frac(frac)#

Update the component a fraction of a time step.

update_until(then)#

Update the component until a given time.

class LossyFlowAccumulatorBMI#

Bases: Bmi

Basic Modeling Interface for the LossyFlowAccumulator component.

finalize()#

Clean-up the component.

get_component_name()#

Name of the component.

get_current_time()#

Current component time.

get_end_time()#

Stop time for the component.

get_grid_edge_count(grid)#

Get the number of edges in the grid.

Parameters:

grid (int) – A grid identifier.

Returns:

The total number of grid edges.

Return type:

int

get_grid_edge_nodes(grid, edge_nodes)#

Get the edge-node connectivity.

Parameters:
  • grid (int) – A grid identifier.

  • edge_nodes (ndarray of int, shape (2 x nnodes,)) – A numpy array to place the edge-node connectivity. For each edge, connectivity is given as node at edge tail, followed by node at edge head.

Returns:

The input numpy array that holds the edge-node connectivity.

Return type:

ndarray of int

get_grid_face_count(grid)#

Get the number of faces in the grid.

Parameters:

grid (int) – A grid identifier.

Returns:

The total number of grid faces.

Return type:

int

get_grid_face_edges(grid)#

Get the face-edge connectivity.

Parameters:
  • grid (int) – A grid identifier.

  • face_edges (ndarray of int) – A numpy array to place the face-edge connectivity.

Returns:

The input numpy array that holds the face-edge connectivity.

Return type:

ndarray of int

get_grid_face_nodes(grid, face_nodes)#

Get the face-node connectivity.

Parameters:
  • grid (int) – A grid identifier.

  • face_nodes (ndarray of int) – A numpy array to place the face-node connectivity. For each face, the nodes (listed in a counter-clockwise direction) that form the boundary of the face.

Returns:

The input numpy array that holds the face-node connectivity.

Return type:

ndarray of int

get_grid_node_count(grid)#

Get the number of nodes in the grid.

Parameters:

grid (int) – A grid identifier.

Returns:

The total number of grid nodes.

Return type:

int

get_grid_nodes_per_face(grid, nodes_per_face)#

Get the number of nodes for each face.

Parameters:
  • grid (int) – A grid identifier.

  • nodes_per_face (ndarray of int, shape (nfaces,)) – A numpy array to place the number of nodes per face.

Returns:

The input numpy array that holds the number of nodes per face.

Return type:

ndarray of int

get_grid_origin(grid, origin)#

Get the origin for a structured grid.

get_grid_rank(grid)#

Get the number of dimensions of a grid.

get_grid_shape(grid, shape)#

Get the shape of a structured grid.

get_grid_size(grid)#

Get the total number of elements in the computational grid.

Parameters:

grid (int) – A grid identifier.

Returns:

Size of the grid.

Return type:

int

get_grid_spacing(grid, spacing)#

Get the row and column spacing of a structured grid.

get_grid_type(grid)#

Get the type of grid.

get_grid_x(grid, x)#

Get coordinates of grid nodes in the x direction.

Parameters:
  • grid (int) – A grid identifier.

  • x (ndarray of float, shape (nrows,)) – A numpy array to hold the x-coordinates of the grid node columns.

Returns:

The input numpy array that holds the grid’s column x-coordinates.

Return type:

ndarray of float

get_grid_y(grid, y)#

Get coordinates of grid nodes in the y direction.

Parameters:
  • grid (int) – A grid identifier.

  • y (ndarray of float, shape (ncols,)) – A numpy array to hold the y-coordinates of the grid node rows.

Returns:

The input numpy array that holds the grid’s row y-coordinates.

Return type:

ndarray of float

get_grid_z(grid, z)#

Get coordinates of grid nodes in the z direction.

Parameters:
  • grid (int) – A grid identifier.

  • z (ndarray of float, shape (nlayers,)) – A numpy array to hold the z-coordinates of the grid nodes layers.

Returns:

The input numpy array that holds the grid’s layer z-coordinates.

Return type:

ndarray of float

get_input_item_count()#

Count of a model’s input variables.

Returns:

The number of input variables.

Return type:

int

get_input_var_names()#

Names of the input exchange items.

get_output_item_count()#

Count of a model’s output variables.

Returns:

The number of output variables.

Return type:

int

get_output_var_names()#

Names of the output exchange items.

get_start_time()#

Start time of the component.

get_time_step()#

Component time step.

get_time_units()#

Time units used by the component.

get_value(name, dest)#

Get a copy of a variable’s data.

get_value_at_indices(name, dest, inds)#

Get values at particular indices.

Parameters:
  • name (str) – An input or output variable name, a CSDMS Standard Name.

  • dest (ndarray) – A numpy array into which to place the values.

  • inds (array_like) – The indices into the variable array.

Returns:

Value of the model variable at the given location.

Return type:

array_like

get_value_ptr(name)#

Get a reference to values of the given variable.

This is a getter for the model, used to access the model’s current state. It returns a reference to a model variable, with the return type, size and rank dependent on the variable.

Parameters:

name (str) – An input or output variable name, a CSDMS Standard Name.

Returns:

A reference to a model variable.

Return type:

array_like

get_value_ref(name)#

Get a reference to a variable’s data.

get_var_grid(name)#

Get the grid id for a variable.

get_var_itemsize(name)#

Get the size of elements of a variable.

get_var_location(name)#

Get the grid element type that the a given variable is defined on.

The grid topology can be composed of nodes, edges, and faces.

node

A point that has a coordinate pair or triplet: the most basic element of the topology.

edge

A line or curve bounded by two nodes.

face

A plane or surface enclosed by a set of edges. In a 2D horizontal application one may consider the word “polygon”, but in the hierarchy of elements the word “face” is most common.

Parameters:

name (str) – An input or output variable name, a CSDMS Standard Name.

Returns:

The grid location on which the variable is defined. Must be one of “node”, “edge”, or “face”.

Return type:

str

Notes

CSDMS uses the ugrid conventions to define unstructured grids.

get_var_nbytes(name)#

Get the total number of bytes used by a variable.

get_var_type(name)#

Get the data type for a variable.

get_var_units(name)#

Get the unit used by a variable.

initialize(config_file)#

Initialize the component from a file.

BMI-wrapped Landlab components use input files in YAML format. Component-specific parameters are listed at the top level, followed by grid and then time information. An example input file looks like:

flexure:
    eet: 15.e+3
clock:
    start: 0
    stop: 100.
    step: 2.
grid:
    type: raster
    shape: [20, 40]
    spacing: [1000., 2000.]

In this case, a RasterModelGrid is created (with the given shape and spacing) and passed to the underlying landlab component. The eet=15000. is also given to the component but as a keyword parameter. The BMI clock is initialized with the given parameters.

Parameters:

config_file (str or file_like) – YAML-formatted input file for the component.

set_value(name, values)#

Set the values of a variable.

set_value_at_indices(name, inds, src)#

Specify a new value for a model variable at particular indices.

Parameters:
  • name (str) – An input or output variable name, a CSDMS Standard Name.

  • inds (array_like) – The indices into the variable array.

  • src (array_like) – The new value for the specified variable.

update()#

Update the component one time step.

update_frac(frac)#

Update the component a fraction of a time step.

update_until(then)#

Update the component until a given time.

class NetworkSedimentTransporterBMI#

Bases: Bmi

Basic Modeling Interface for the NetworkSedimentTransporter component.

finalize()#

Clean-up the component.

get_component_name()#

Name of the component.

get_current_time()#

Current component time.

get_end_time()#

Stop time for the component.

get_grid_edge_count(grid)#

Get the number of edges in the grid.

Parameters:

grid (int) – A grid identifier.

Returns:

The total number of grid edges.

Return type:

int

get_grid_edge_nodes(grid, edge_nodes)#

Get the edge-node connectivity.

Parameters:
  • grid (int) – A grid identifier.

  • edge_nodes (ndarray of int, shape (2 x nnodes,)) – A numpy array to place the edge-node connectivity. For each edge, connectivity is given as node at edge tail, followed by node at edge head.

Returns:

The input numpy array that holds the edge-node connectivity.

Return type:

ndarray of int

get_grid_face_count(grid)#

Get the number of faces in the grid.

Parameters:

grid (int) – A grid identifier.

Returns:

The total number of grid faces.

Return type:

int

get_grid_face_edges(grid)#

Get the face-edge connectivity.

Parameters:
  • grid (int) – A grid identifier.

  • face_edges (ndarray of int) – A numpy array to place the face-edge connectivity.

Returns:

The input numpy array that holds the face-edge connectivity.

Return type:

ndarray of int

get_grid_face_nodes(grid, face_nodes)#

Get the face-node connectivity.

Parameters:
  • grid (int) – A grid identifier.

  • face_nodes (ndarray of int) – A numpy array to place the face-node connectivity. For each face, the nodes (listed in a counter-clockwise direction) that form the boundary of the face.

Returns:

The input numpy array that holds the face-node connectivity.

Return type:

ndarray of int

get_grid_node_count(grid)#

Get the number of nodes in the grid.

Parameters:

grid (int) – A grid identifier.

Returns:

The total number of grid nodes.

Return type:

int

get_grid_nodes_per_face(grid, nodes_per_face)#

Get the number of nodes for each face.

Parameters:
  • grid (int) – A grid identifier.

  • nodes_per_face (ndarray of int, shape (nfaces,)) – A numpy array to place the number of nodes per face.

Returns:

The input numpy array that holds the number of nodes per face.

Return type:

ndarray of int

get_grid_origin(grid, origin)#

Get the origin for a structured grid.

get_grid_rank(grid)#

Get the number of dimensions of a grid.

get_grid_shape(grid, shape)#

Get the shape of a structured grid.

get_grid_size(grid)#

Get the total number of elements in the computational grid.

Parameters:

grid (int) – A grid identifier.

Returns:

Size of the grid.

Return type:

int

get_grid_spacing(grid, spacing)#

Get the row and column spacing of a structured grid.

get_grid_type(grid)#

Get the type of grid.

get_grid_x(grid, x)#

Get coordinates of grid nodes in the x direction.

Parameters:
  • grid (int) – A grid identifier.

  • x (ndarray of float, shape (nrows,)) – A numpy array to hold the x-coordinates of the grid node columns.

Returns:

The input numpy array that holds the grid’s column x-coordinates.

Return type:

ndarray of float

get_grid_y(grid, y)#

Get coordinates of grid nodes in the y direction.

Parameters:
  • grid (int) – A grid identifier.

  • y (ndarray of float, shape (ncols,)) – A numpy array to hold the y-coordinates of the grid node rows.

Returns:

The input numpy array that holds the grid’s row y-coordinates.

Return type:

ndarray of float

get_grid_z(grid, z)#

Get coordinates of grid nodes in the z direction.

Parameters:
  • grid (int) – A grid identifier.

  • z (ndarray of float, shape (nlayers,)) – A numpy array to hold the z-coordinates of the grid nodes layers.

Returns:

The input numpy array that holds the grid’s layer z-coordinates.

Return type:

ndarray of float

get_input_item_count()#

Count of a model’s input variables.

Returns:

The number of input variables.

Return type:

int

get_input_var_names()#

Names of the input exchange items.

get_output_item_count()#

Count of a model’s output variables.

Returns:

The number of output variables.

Return type:

int

get_output_var_names()#

Names of the output exchange items.

get_start_time()#

Start time of the component.

get_time_step()#

Component time step.

get_time_units()#

Time units used by the component.

get_value(name, dest)#

Get a copy of a variable’s data.

get_value_at_indices(name, dest, inds)#

Get values at particular indices.

Parameters:
  • name (str) – An input or output variable name, a CSDMS Standard Name.

  • dest (ndarray) – A numpy array into which to place the values.

  • inds (array_like) – The indices into the variable array.

Returns:

Value of the model variable at the given location.

Return type:

array_like

get_value_ptr(name)#

Get a reference to values of the given variable.

This is a getter for the model, used to access the model’s current state. It returns a reference to a model variable, with the return type, size and rank dependent on the variable.

Parameters:

name (str) – An input or output variable name, a CSDMS Standard Name.

Returns:

A reference to a model variable.

Return type:

array_like

get_value_ref(name)#

Get a reference to a variable’s data.

get_var_grid(name)#

Get the grid id for a variable.

get_var_itemsize(name)#

Get the size of elements of a variable.

get_var_location(name)#

Get the grid element type that the a given variable is defined on.

The grid topology can be composed of nodes, edges, and faces.

node

A point that has a coordinate pair or triplet: the most basic element of the topology.

edge

A line or curve bounded by two nodes.

face

A plane or surface enclosed by a set of edges. In a 2D horizontal application one may consider the word “polygon”, but in the hierarchy of elements the word “face” is most common.

Parameters:

name (str) – An input or output variable name, a CSDMS Standard Name.

Returns:

The grid location on which the variable is defined. Must be one of “node”, “edge”, or “face”.

Return type:

str

Notes

CSDMS uses the ugrid conventions to define unstructured grids.

get_var_nbytes(name)#

Get the total number of bytes used by a variable.

get_var_type(name)#

Get the data type for a variable.

get_var_units(name)#

Get the unit used by a variable.

initialize(config_file)#

Initialize the component from a file.

BMI-wrapped Landlab components use input files in YAML format. Component-specific parameters are listed at the top level, followed by grid and then time information. An example input file looks like:

flexure:
    eet: 15.e+3
clock:
    start: 0
    stop: 100.
    step: 2.
grid:
    type: raster
    shape: [20, 40]
    spacing: [1000., 2000.]

In this case, a RasterModelGrid is created (with the given shape and spacing) and passed to the underlying landlab component. The eet=15000. is also given to the component but as a keyword parameter. The BMI clock is initialized with the given parameters.

Parameters:

config_file (str or file_like) – YAML-formatted input file for the component.

set_value(name, values)#

Set the values of a variable.

set_value_at_indices(name, inds, src)#

Specify a new value for a model variable at particular indices.

Parameters:
  • name (str) – An input or output variable name, a CSDMS Standard Name.

  • inds (array_like) – The indices into the variable array.

  • src (array_like) – The new value for the specified variable.

update()#

Update the component one time step.

update_frac(frac)#

Update the component a fraction of a time step.

update_until(then)#

Update the component until a given time.

class NormalFaultBMI#

Bases: Bmi

Basic Modeling Interface for the NormalFault component.

finalize()#

Clean-up the component.

get_component_name()#

Name of the component.

get_current_time()#

Current component time.

get_end_time()#

Stop time for the component.

get_grid_edge_count(grid)#

Get the number of edges in the grid.

Parameters:

grid (int) – A grid identifier.

Returns:

The total number of grid edges.

Return type:

int

get_grid_edge_nodes(grid, edge_nodes)#

Get the edge-node connectivity.

Parameters:
  • grid (int) – A grid identifier.

  • edge_nodes (ndarray of int, shape (2 x nnodes,)) – A numpy array to place the edge-node connectivity. For each edge, connectivity is given as node at edge tail, followed by node at edge head.

Returns:

The input numpy array that holds the edge-node connectivity.

Return type:

ndarray of int

get_grid_face_count(grid)#

Get the number of faces in the grid.

Parameters:

grid (int) – A grid identifier.

Returns:

The total number of grid faces.

Return type:

int

get_grid_face_edges(grid)#

Get the face-edge connectivity.

Parameters:
  • grid (int) – A grid identifier.

  • face_edges (ndarray of int) – A numpy array to place the face-edge connectivity.

Returns:

The input numpy array that holds the face-edge connectivity.

Return type:

ndarray of int

get_grid_face_nodes(grid, face_nodes)#

Get the face-node connectivity.

Parameters:
  • grid (int) – A grid identifier.

  • face_nodes (ndarray of int) – A numpy array to place the face-node connectivity. For each face, the nodes (listed in a counter-clockwise direction) that form the boundary of the face.

Returns:

The input numpy array that holds the face-node connectivity.

Return type:

ndarray of int

get_grid_node_count(grid)#

Get the number of nodes in the grid.

Parameters:

grid (int) – A grid identifier.

Returns:

The total number of grid nodes.

Return type:

int

get_grid_nodes_per_face(grid, nodes_per_face)#

Get the number of nodes for each face.

Parameters:
  • grid (int) – A grid identifier.

  • nodes_per_face (ndarray of int, shape (nfaces,)) – A numpy array to place the number of nodes per face.

Returns:

The input numpy array that holds the number of nodes per face.

Return type:

ndarray of int

get_grid_origin(grid, origin)#

Get the origin for a structured grid.

get_grid_rank(grid)#

Get the number of dimensions of a grid.

get_grid_shape(grid, shape)#

Get the shape of a structured grid.

get_grid_size(grid)#

Get the total number of elements in the computational grid.

Parameters:

grid (int) – A grid identifier.

Returns:

Size of the grid.

Return type:

int

get_grid_spacing(grid, spacing)#

Get the row and column spacing of a structured grid.

get_grid_type(grid)#

Get the type of grid.

get_grid_x(grid, x)#

Get coordinates of grid nodes in the x direction.

Parameters:
  • grid (int) – A grid identifier.

  • x (ndarray of float, shape (nrows,)) – A numpy array to hold the x-coordinates of the grid node columns.

Returns:

The input numpy array that holds the grid’s column x-coordinates.

Return type:

ndarray of float

get_grid_y(grid, y)#

Get coordinates of grid nodes in the y direction.

Parameters:
  • grid (int) – A grid identifier.

  • y (ndarray of float, shape (ncols,)) – A numpy array to hold the y-coordinates of the grid node rows.

Returns:

The input numpy array that holds the grid’s row y-coordinates.

Return type:

ndarray of float

get_grid_z(grid, z)#

Get coordinates of grid nodes in the z direction.

Parameters:
  • grid (int) – A grid identifier.

  • z (ndarray of float, shape (nlayers,)) – A numpy array to hold the z-coordinates of the grid nodes layers.

Returns:

The input numpy array that holds the grid’s layer z-coordinates.

Return type:

ndarray of float

get_input_item_count()#

Count of a model’s input variables.

Returns:

The number of input variables.

Return type:

int

get_input_var_names()#

Names of the input exchange items.

get_output_item_count()#

Count of a model’s output variables.

Returns:

The number of output variables.

Return type:

int

get_output_var_names()#

Names of the output exchange items.

get_start_time()#

Start time of the component.

get_time_step()#

Component time step.

get_time_units()#

Time units used by the component.

get_value(name, dest)#

Get a copy of a variable’s data.

get_value_at_indices(name, dest, inds)#

Get values at particular indices.

Parameters:
  • name (str) – An input or output variable name, a CSDMS Standard Name.

  • dest (ndarray) – A numpy array into which to place the values.

  • inds (array_like) – The indices into the variable array.

Returns:

Value of the model variable at the given location.

Return type:

array_like

get_value_ptr(name)#

Get a reference to values of the given variable.

This is a getter for the model, used to access the model’s current state. It returns a reference to a model variable, with the return type, size and rank dependent on the variable.

Parameters:

name (str) – An input or output variable name, a CSDMS Standard Name.

Returns:

A reference to a model variable.

Return type:

array_like

get_value_ref(name)#

Get a reference to a variable’s data.

get_var_grid(name)#

Get the grid id for a variable.

get_var_itemsize(name)#

Get the size of elements of a variable.

get_var_location(name)#

Get the grid element type that the a given variable is defined on.

The grid topology can be composed of nodes, edges, and faces.

node

A point that has a coordinate pair or triplet: the most basic element of the topology.

edge

A line or curve bounded by two nodes.

face

A plane or surface enclosed by a set of edges. In a 2D horizontal application one may consider the word “polygon”, but in the hierarchy of elements the word “face” is most common.

Parameters:

name (str) – An input or output variable name, a CSDMS Standard Name.

Returns:

The grid location on which the variable is defined. Must be one of “node”, “edge”, or “face”.

Return type:

str

Notes

CSDMS uses the ugrid conventions to define unstructured grids.

get_var_nbytes(name)#

Get the total number of bytes used by a variable.

get_var_type(name)#

Get the data type for a variable.

get_var_units(name)#

Get the unit used by a variable.

initialize(config_file)#

Initialize the component from a file.

BMI-wrapped Landlab components use input files in YAML format. Component-specific parameters are listed at the top level, followed by grid and then time information. An example input file looks like:

flexure:
    eet: 15.e+3
clock:
    start: 0
    stop: 100.
    step: 2.
grid:
    type: raster
    shape: [20, 40]
    spacing: [1000., 2000.]

In this case, a RasterModelGrid is created (with the given shape and spacing) and passed to the underlying landlab component. The eet=15000. is also given to the component but as a keyword parameter. The BMI clock is initialized with the given parameters.

Parameters:

config_file (str or file_like) – YAML-formatted input file for the component.

set_value(name, values)#

Set the values of a variable.

set_value_at_indices(name, inds, src)#

Specify a new value for a model variable at particular indices.

Parameters:
  • name (str) – An input or output variable name, a CSDMS Standard Name.

  • inds (array_like) – The indices into the variable array.

  • src (array_like) – The new value for the specified variable.

update()#

Update the component one time step.

update_frac(frac)#

Update the component a fraction of a time step.

update_until(then)#

Update the component until a given time.

class OverlandFlowBMI#

Bases: Bmi

Basic Modeling Interface for the OverlandFlow component.

finalize()#

Clean-up the component.

get_component_name()#

Name of the component.

get_current_time()#

Current component time.

get_end_time()#

Stop time for the component.

get_grid_edge_count(grid)#

Get the number of edges in the grid.

Parameters:

grid (int) – A grid identifier.

Returns:

The total number of grid edges.

Return type:

int

get_grid_edge_nodes(grid, edge_nodes)#

Get the edge-node connectivity.

Parameters:
  • grid (int) – A grid identifier.

  • edge_nodes (ndarray of int, shape (2 x nnodes,)) – A numpy array to place the edge-node connectivity. For each edge, connectivity is given as node at edge tail, followed by node at edge head.

Returns:

The input numpy array that holds the edge-node connectivity.

Return type:

ndarray of int

get_grid_face_count(grid)#

Get the number of faces in the grid.

Parameters:

grid (int) – A grid identifier.

Returns:

The total number of grid faces.

Return type:

int

get_grid_face_edges(grid)#

Get the face-edge connectivity.

Parameters:
  • grid (int) – A grid identifier.

  • face_edges (ndarray of int) – A numpy array to place the face-edge connectivity.

Returns:

The input numpy array that holds the face-edge connectivity.

Return type:

ndarray of int

get_grid_face_nodes(grid, face_nodes)#

Get the face-node connectivity.

Parameters:
  • grid (int) – A grid identifier.

  • face_nodes (ndarray of int) – A numpy array to place the face-node connectivity. For each face, the nodes (listed in a counter-clockwise direction) that form the boundary of the face.

Returns:

The input numpy array that holds the face-node connectivity.

Return type:

ndarray of int

get_grid_node_count(grid)#

Get the number of nodes in the grid.

Parameters:

grid (int) – A grid identifier.

Returns:

The total number of grid nodes.

Return type:

int

get_grid_nodes_per_face(grid, nodes_per_face)#

Get the number of nodes for each face.

Parameters:
  • grid (int) – A grid identifier.

  • nodes_per_face (ndarray of int, shape (nfaces,)) – A numpy array to place the number of nodes per face.

Returns:

The input numpy array that holds the number of nodes per face.

Return type:

ndarray of int

get_grid_origin(grid, origin)#

Get the origin for a structured grid.

get_grid_rank(grid)#

Get the number of dimensions of a grid.

get_grid_shape(grid, shape)#

Get the shape of a structured grid.

get_grid_size(grid)#

Get the total number of elements in the computational grid.

Parameters:

grid (int) – A grid identifier.

Returns:

Size of the grid.

Return type:

int

get_grid_spacing(grid, spacing)#

Get the row and column spacing of a structured grid.

get_grid_type(grid)#

Get the type of grid.

get_grid_x(grid, x)#

Get coordinates of grid nodes in the x direction.

Parameters:
  • grid (int) – A grid identifier.

  • x (ndarray of float, shape (nrows,)) – A numpy array to hold the x-coordinates of the grid node columns.

Returns:

The input numpy array that holds the grid’s column x-coordinates.

Return type:

ndarray of float

get_grid_y(grid, y)#

Get coordinates of grid nodes in the y direction.

Parameters:
  • grid (int) – A grid identifier.

  • y (ndarray of float, shape (ncols,)) – A numpy array to hold the y-coordinates of the grid node rows.

Returns:

The input numpy array that holds the grid’s row y-coordinates.

Return type:

ndarray of float

get_grid_z(grid, z)#

Get coordinates of grid nodes in the z direction.

Parameters:
  • grid (int) – A grid identifier.

  • z (ndarray of float, shape (nlayers,)) – A numpy array to hold the z-coordinates of the grid nodes layers.

Returns:

The input numpy array that holds the grid’s layer z-coordinates.

Return type:

ndarray of float

get_input_item_count()#

Count of a model’s input variables.

Returns:

The number of input variables.

Return type:

int

get_input_var_names()#

Names of the input exchange items.

get_output_item_count()#

Count of a model’s output variables.

Returns:

The number of output variables.

Return type:

int

get_output_var_names()#

Names of the output exchange items.

get_start_time()#

Start time of the component.

get_time_step()#

Component time step.

get_time_units()#

Time units used by the component.

get_value(name, dest)#

Get a copy of a variable’s data.

get_value_at_indices(name, dest, inds)#

Get values at particular indices.

Parameters:
  • name (str) – An input or output variable name, a CSDMS Standard Name.

  • dest (ndarray) – A numpy array into which to place the values.

  • inds (array_like) – The indices into the variable array.

Returns:

Value of the model variable at the given location.

Return type:

array_like

get_value_ptr(name)#

Get a reference to values of the given variable.

This is a getter for the model, used to access the model’s current state. It returns a reference to a model variable, with the return type, size and rank dependent on the variable.

Parameters:

name (str) – An input or output variable name, a CSDMS Standard Name.

Returns:

A reference to a model variable.

Return type:

array_like

get_value_ref(name)#

Get a reference to a variable’s data.

get_var_grid(name)#

Get the grid id for a variable.

get_var_itemsize(name)#

Get the size of elements of a variable.

get_var_location(name)#

Get the grid element type that the a given variable is defined on.

The grid topology can be composed of nodes, edges, and faces.

node

A point that has a coordinate pair or triplet: the most basic element of the topology.

edge

A line or curve bounded by two nodes.

face

A plane or surface enclosed by a set of edges. In a 2D horizontal application one may consider the word “polygon”, but in the hierarchy of elements the word “face” is most common.

Parameters:

name (str) – An input or output variable name, a CSDMS Standard Name.

Returns:

The grid location on which the variable is defined. Must be one of “node”, “edge”, or “face”.

Return type:

str

Notes

CSDMS uses the ugrid conventions to define unstructured grids.

get_var_nbytes(name)#

Get the total number of bytes used by a variable.

get_var_type(name)#

Get the data type for a variable.

get_var_units(name)#

Get the unit used by a variable.

initialize(config_file)#

Initialize the component from a file.

BMI-wrapped Landlab components use input files in YAML format. Component-specific parameters are listed at the top level, followed by grid and then time information. An example input file looks like:

flexure:
    eet: 15.e+3
clock:
    start: 0
    stop: 100.
    step: 2.
grid:
    type: raster
    shape: [20, 40]
    spacing: [1000., 2000.]

In this case, a RasterModelGrid is created (with the given shape and spacing) and passed to the underlying landlab component. The eet=15000. is also given to the component but as a keyword parameter. The BMI clock is initialized with the given parameters.

Parameters:

config_file (str or file_like) – YAML-formatted input file for the component.

set_value(name, values)#

Set the values of a variable.

set_value_at_indices(name, inds, src)#

Specify a new value for a model variable at particular indices.

Parameters:
  • name (str) – An input or output variable name, a CSDMS Standard Name.

  • inds (array_like) – The indices into the variable array.

  • src (array_like) – The new value for the specified variable.

update()#

Update the component one time step.

update_frac(frac)#

Update the component a fraction of a time step.

update_until(then)#

Update the component until a given time.

class OverlandFlowBatesBMI#

Bases: Bmi

Basic Modeling Interface for the OverlandFlowBates component.

finalize()#

Clean-up the component.

get_component_name()#

Name of the component.

get_current_time()#

Current component time.

get_end_time()#

Stop time for the component.

get_grid_edge_count(grid)#

Get the number of edges in the grid.

Parameters:

grid (int) – A grid identifier.

Returns:

The total number of grid edges.

Return type:

int

get_grid_edge_nodes(grid, edge_nodes)#

Get the edge-node connectivity.

Parameters:
  • grid (int) – A grid identifier.

  • edge_nodes (ndarray of int, shape (2 x nnodes,)) – A numpy array to place the edge-node connectivity. For each edge, connectivity is given as node at edge tail, followed by node at edge head.

Returns:

The input numpy array that holds the edge-node connectivity.

Return type:

ndarray of int

get_grid_face_count(grid)#

Get the number of faces in the grid.

Parameters:

grid (int) – A grid identifier.

Returns:

The total number of grid faces.

Return type:

int

get_grid_face_edges(grid)#

Get the face-edge connectivity.

Parameters:
  • grid (int) – A grid identifier.

  • face_edges (ndarray of int) – A numpy array to place the face-edge connectivity.

Returns:

The input numpy array that holds the face-edge connectivity.

Return type:

ndarray of int

get_grid_face_nodes(grid, face_nodes)#

Get the face-node connectivity.

Parameters:
  • grid (int) – A grid identifier.

  • face_nodes (ndarray of int) – A numpy array to place the face-node connectivity. For each face, the nodes (listed in a counter-clockwise direction) that form the boundary of the face.

Returns:

The input numpy array that holds the face-node connectivity.

Return type:

ndarray of int

get_grid_node_count(grid)#

Get the number of nodes in the grid.

Parameters:

grid (int) – A grid identifier.

Returns:

The total number of grid nodes.

Return type:

int

get_grid_nodes_per_face(grid, nodes_per_face)#

Get the number of nodes for each face.

Parameters:
  • grid (int) – A grid identifier.

  • nodes_per_face (ndarray of int, shape (nfaces,)) – A numpy array to place the number of nodes per face.

Returns:

The input numpy array that holds the number of nodes per face.

Return type:

ndarray of int

get_grid_origin(grid, origin)#

Get the origin for a structured grid.

get_grid_rank(grid)#

Get the number of dimensions of a grid.

get_grid_shape(grid, shape)#

Get the shape of a structured grid.

get_grid_size(grid)#

Get the total number of elements in the computational grid.

Parameters:

grid (int) – A grid identifier.

Returns:

Size of the grid.

Return type:

int

get_grid_spacing(grid, spacing)#

Get the row and column spacing of a structured grid.

get_grid_type(grid)#

Get the type of grid.

get_grid_x(grid, x)#

Get coordinates of grid nodes in the x direction.

Parameters:
  • grid (int) – A grid identifier.

  • x (ndarray of float, shape (nrows,)) – A numpy array to hold the x-coordinates of the grid node columns.

Returns:

The input numpy array that holds the grid’s column x-coordinates.

Return type:

ndarray of float

get_grid_y(grid, y)#

Get coordinates of grid nodes in the y direction.

Parameters:
  • grid (int) – A grid identifier.

  • y (ndarray of float, shape (ncols,)) – A numpy array to hold the y-coordinates of the grid node rows.

Returns:

The input numpy array that holds the grid’s row y-coordinates.

Return type:

ndarray of float

get_grid_z(grid, z)#

Get coordinates of grid nodes in the z direction.

Parameters:
  • grid (int) – A grid identifier.

  • z (ndarray of float, shape (nlayers,)) – A numpy array to hold the z-coordinates of the grid nodes layers.

Returns:

The input numpy array that holds the grid’s layer z-coordinates.

Return type:

ndarray of float

get_input_item_count()#

Count of a model’s input variables.

Returns:

The number of input variables.

Return type:

int

get_input_var_names()#

Names of the input exchange items.

get_output_item_count()#

Count of a model’s output variables.

Returns:

The number of output variables.

Return type:

int

get_output_var_names()#

Names of the output exchange items.

get_start_time()#

Start time of the component.

get_time_step()#

Component time step.

get_time_units()#

Time units used by the component.

get_value(name, dest)#

Get a copy of a variable’s data.

get_value_at_indices(name, dest, inds)#

Get values at particular indices.

Parameters:
  • name (str) – An input or output variable name, a CSDMS Standard Name.

  • dest (ndarray) – A numpy array into which to place the values.

  • inds (array_like) – The indices into the variable array.

Returns:

Value of the model variable at the given location.

Return type:

array_like

get_value_ptr(name)#

Get a reference to values of the given variable.

This is a getter for the model, used to access the model’s current state. It returns a reference to a model variable, with the return type, size and rank dependent on the variable.

Parameters:

name (str) – An input or output variable name, a CSDMS Standard Name.

Returns:

A reference to a model variable.

Return type:

array_like

get_value_ref(name)#

Get a reference to a variable’s data.

get_var_grid(name)#

Get the grid id for a variable.

get_var_itemsize(name)#

Get the size of elements of a variable.

get_var_location(name)#

Get the grid element type that the a given variable is defined on.

The grid topology can be composed of nodes, edges, and faces.

node

A point that has a coordinate pair or triplet: the most basic element of the topology.

edge

A line or curve bounded by two nodes.

face

A plane or surface enclosed by a set of edges. In a 2D horizontal application one may consider the word “polygon”, but in the hierarchy of elements the word “face” is most common.

Parameters:

name (str) – An input or output variable name, a CSDMS Standard Name.

Returns:

The grid location on which the variable is defined. Must be one of “node”, “edge”, or “face”.

Return type:

str

Notes

CSDMS uses the ugrid conventions to define unstructured grids.

get_var_nbytes(name)#

Get the total number of bytes used by a variable.

get_var_type(name)#

Get the data type for a variable.

get_var_units(name)#

Get the unit used by a variable.

initialize(config_file)#

Initialize the component from a file.

BMI-wrapped Landlab components use input files in YAML format. Component-specific parameters are listed at the top level, followed by grid and then time information. An example input file looks like:

flexure:
    eet: 15.e+3
clock:
    start: 0
    stop: 100.
    step: 2.
grid:
    type: raster
    shape: [20, 40]
    spacing: [1000., 2000.]

In this case, a RasterModelGrid is created (with the given shape and spacing) and passed to the underlying landlab component. The eet=15000. is also given to the component but as a keyword parameter. The BMI clock is initialized with the given parameters.

Parameters:

config_file (str or file_like) – YAML-formatted input file for the component.

set_value(name, values)#

Set the values of a variable.

set_value_at_indices(name, inds, src)#

Specify a new value for a model variable at particular indices.

Parameters:
  • name (str) – An input or output variable name, a CSDMS Standard Name.

  • inds (array_like) – The indices into the variable array.

  • src (array_like) – The new value for the specified variable.

update()#

Update the component one time step.

update_frac(frac)#

Update the component a fraction of a time step.

update_until(then)#

Update the component until a given time.

class PerronNLDiffuseBMI#

Bases: Bmi

Basic Modeling Interface for the PerronNLDiffuse component.

finalize()#

Clean-up the component.

get_component_name()#

Name of the component.

get_current_time()#

Current component time.

get_end_time()#

Stop time for the component.

get_grid_edge_count(grid)#

Get the number of edges in the grid.

Parameters:

grid (int) – A grid identifier.

Returns:

The total number of grid edges.

Return type:

int

get_grid_edge_nodes(grid, edge_nodes)#

Get the edge-node connectivity.

Parameters:
  • grid (int) – A grid identifier.

  • edge_nodes (ndarray of int, shape (2 x nnodes,)) – A numpy array to place the edge-node connectivity. For each edge, connectivity is given as node at edge tail, followed by node at edge head.

Returns:

The input numpy array that holds the edge-node connectivity.

Return type:

ndarray of int

get_grid_face_count(grid)#

Get the number of faces in the grid.

Parameters:

grid (int) – A grid identifier.

Returns:

The total number of grid faces.

Return type:

int

get_grid_face_edges(grid)#

Get the face-edge connectivity.

Parameters:
  • grid (int) – A grid identifier.

  • face_edges (ndarray of int) – A numpy array to place the face-edge connectivity.

Returns:

The input numpy array that holds the face-edge connectivity.

Return type:

ndarray of int

get_grid_face_nodes(grid, face_nodes)#

Get the face-node connectivity.

Parameters:
  • grid (int) – A grid identifier.

  • face_nodes (ndarray of int) – A numpy array to place the face-node connectivity. For each face, the nodes (listed in a counter-clockwise direction) that form the boundary of the face.

Returns:

The input numpy array that holds the face-node connectivity.

Return type:

ndarray of int

get_grid_node_count(grid)#

Get the number of nodes in the grid.

Parameters:

grid (int) – A grid identifier.

Returns:

The total number of grid nodes.

Return type:

int

get_grid_nodes_per_face(grid, nodes_per_face)#

Get the number of nodes for each face.

Parameters:
  • grid (int) – A grid identifier.

  • nodes_per_face (ndarray of int, shape (nfaces,)) – A numpy array to place the number of nodes per face.

Returns:

The input numpy array that holds the number of nodes per face.

Return type:

ndarray of int

get_grid_origin(grid, origin)#

Get the origin for a structured grid.

get_grid_rank(grid)#

Get the number of dimensions of a grid.

get_grid_shape(grid, shape)#

Get the shape of a structured grid.

get_grid_size(grid)#

Get the total number of elements in the computational grid.

Parameters:

grid (int) – A grid identifier.

Returns:

Size of the grid.

Return type:

int

get_grid_spacing(grid, spacing)#

Get the row and column spacing of a structured grid.

get_grid_type(grid)#

Get the type of grid.

get_grid_x(grid, x)#

Get coordinates of grid nodes in the x direction.

Parameters:
  • grid (int) – A grid identifier.

  • x (ndarray of float, shape (nrows,)) – A numpy array to hold the x-coordinates of the grid node columns.

Returns:

The input numpy array that holds the grid’s column x-coordinates.

Return type:

ndarray of float

get_grid_y(grid, y)#

Get coordinates of grid nodes in the y direction.

Parameters:
  • grid (int) – A grid identifier.

  • y (ndarray of float, shape (ncols,)) – A numpy array to hold the y-coordinates of the grid node rows.

Returns:

The input numpy array that holds the grid’s row y-coordinates.

Return type:

ndarray of float

get_grid_z(grid, z)#

Get coordinates of grid nodes in the z direction.

Parameters:
  • grid (int) – A grid identifier.

  • z (ndarray of float, shape (nlayers,)) – A numpy array to hold the z-coordinates of the grid nodes layers.

Returns:

The input numpy array that holds the grid’s layer z-coordinates.

Return type:

ndarray of float

get_input_item_count()#

Count of a model’s input variables.

Returns:

The number of input variables.

Return type:

int

get_input_var_names()#

Names of the input exchange items.

get_output_item_count()#

Count of a model’s output variables.

Returns:

The number of output variables.

Return type:

int

get_output_var_names()#

Names of the output exchange items.

get_start_time()#

Start time of the component.

get_time_step()#

Component time step.

get_time_units()#

Time units used by the component.

get_value(name, dest)#

Get a copy of a variable’s data.

get_value_at_indices(name, dest, inds)#

Get values at particular indices.

Parameters:
  • name (str) – An input or output variable name, a CSDMS Standard Name.

  • dest (ndarray) – A numpy array into which to place the values.

  • inds (array_like) – The indices into the variable array.

Returns:

Value of the model variable at the given location.

Return type:

array_like

get_value_ptr(name)#

Get a reference to values of the given variable.

This is a getter for the model, used to access the model’s current state. It returns a reference to a model variable, with the return type, size and rank dependent on the variable.

Parameters:

name (str) – An input or output variable name, a CSDMS Standard Name.

Returns:

A reference to a model variable.

Return type:

array_like

get_value_ref(name)#

Get a reference to a variable’s data.

get_var_grid(name)#

Get the grid id for a variable.

get_var_itemsize(name)#

Get the size of elements of a variable.

get_var_location(name)#

Get the grid element type that the a given variable is defined on.

The grid topology can be composed of nodes, edges, and faces.

node

A point that has a coordinate pair or triplet: the most basic element of the topology.

edge

A line or curve bounded by two nodes.

face

A plane or surface enclosed by a set of edges. In a 2D horizontal application one may consider the word “polygon”, but in the hierarchy of elements the word “face” is most common.

Parameters:

name (str) – An input or output variable name, a CSDMS Standard Name.

Returns:

The grid location on which the variable is defined. Must be one of “node”, “edge”, or “face”.

Return type:

str

Notes

CSDMS uses the ugrid conventions to define unstructured grids.

get_var_nbytes(name)#

Get the total number of bytes used by a variable.

get_var_type(name)#

Get the data type for a variable.

get_var_units(name)#

Get the unit used by a variable.

initialize(config_file)#

Initialize the component from a file.

BMI-wrapped Landlab components use input files in YAML format. Component-specific parameters are listed at the top level, followed by grid and then time information. An example input file looks like:

flexure:
    eet: 15.e+3
clock:
    start: 0
    stop: 100.
    step: 2.
grid:
    type: raster
    shape: [20, 40]
    spacing: [1000., 2000.]

In this case, a RasterModelGrid is created (with the given shape and spacing) and passed to the underlying landlab component. The eet=15000. is also given to the component but as a keyword parameter. The BMI clock is initialized with the given parameters.

Parameters:

config_file (str or file_like) – YAML-formatted input file for the component.

set_value(name, values)#

Set the values of a variable.

set_value_at_indices(name, inds, src)#

Specify a new value for a model variable at particular indices.

Parameters:
  • name (str) – An input or output variable name, a CSDMS Standard Name.

  • inds (array_like) – The indices into the variable array.

  • src (array_like) – The new value for the specified variable.

update()#

Update the component one time step.

update_frac(frac)#

Update the component a fraction of a time step.

update_until(then)#

Update the component until a given time.

class PotentialEvapotranspirationBMI#

Bases: Bmi

Basic Modeling Interface for the PotentialEvapotranspiration component.

finalize()#

Clean-up the component.

get_component_name()#

Name of the component.

get_current_time()#

Current component time.

get_end_time()#

Stop time for the component.

get_grid_edge_count(grid)#

Get the number of edges in the grid.

Parameters:

grid (int) – A grid identifier.

Returns:

The total number of grid edges.

Return type:

int

get_grid_edge_nodes(grid, edge_nodes)#

Get the edge-node connectivity.

Parameters:
  • grid (int) – A grid identifier.

  • edge_nodes (ndarray of int, shape (2 x nnodes,)) – A numpy array to place the edge-node connectivity. For each edge, connectivity is given as node at edge tail, followed by node at edge head.

Returns:

The input numpy array that holds the edge-node connectivity.

Return type:

ndarray of int

get_grid_face_count(grid)#

Get the number of faces in the grid.

Parameters:

grid (int) – A grid identifier.

Returns:

The total number of grid faces.

Return type:

int

get_grid_face_edges(grid)#

Get the face-edge connectivity.

Parameters:
  • grid (int) – A grid identifier.

  • face_edges (ndarray of int) – A numpy array to place the face-edge connectivity.

Returns:

The input numpy array that holds the face-edge connectivity.

Return type:

ndarray of int

get_grid_face_nodes(grid, face_nodes)#

Get the face-node connectivity.

Parameters:
  • grid (int) – A grid identifier.

  • face_nodes (ndarray of int) – A numpy array to place the face-node connectivity. For each face, the nodes (listed in a counter-clockwise direction) that form the boundary of the face.

Returns:

The input numpy array that holds the face-node connectivity.

Return type:

ndarray of int

get_grid_node_count(grid)#

Get the number of nodes in the grid.

Parameters:

grid (int) – A grid identifier.

Returns:

The total number of grid nodes.

Return type:

int

get_grid_nodes_per_face(grid, nodes_per_face)#

Get the number of nodes for each face.

Parameters:
  • grid (int) – A grid identifier.

  • nodes_per_face (ndarray of int, shape (nfaces,)) – A numpy array to place the number of nodes per face.

Returns:

The input numpy array that holds the number of nodes per face.

Return type:

ndarray of int

get_grid_origin(grid, origin)#

Get the origin for a structured grid.

get_grid_rank(grid)#

Get the number of dimensions of a grid.

get_grid_shape(grid, shape)#

Get the shape of a structured grid.

get_grid_size(grid)#

Get the total number of elements in the computational grid.

Parameters:

grid (int) – A grid identifier.

Returns:

Size of the grid.

Return type:

int

get_grid_spacing(grid, spacing)#

Get the row and column spacing of a structured grid.

get_grid_type(grid)#

Get the type of grid.

get_grid_x(grid, x)#

Get coordinates of grid nodes in the x direction.

Parameters:
  • grid (int) – A grid identifier.

  • x (ndarray of float, shape (nrows,)) – A numpy array to hold the x-coordinates of the grid node columns.

Returns:

The input numpy array that holds the grid’s column x-coordinates.

Return type:

ndarray of float

get_grid_y(grid, y)#

Get coordinates of grid nodes in the y direction.

Parameters:
  • grid (int) – A grid identifier.

  • y (ndarray of float, shape (ncols,)) – A numpy array to hold the y-coordinates of the grid node rows.

Returns:

The input numpy array that holds the grid’s row y-coordinates.

Return type:

ndarray of float

get_grid_z(grid, z)#

Get coordinates of grid nodes in the z direction.

Parameters:
  • grid (int) – A grid identifier.

  • z (ndarray of float, shape (nlayers,)) – A numpy array to hold the z-coordinates of the grid nodes layers.

Returns:

The input numpy array that holds the grid’s layer z-coordinates.

Return type:

ndarray of float

get_input_item_count()#

Count of a model’s input variables.

Returns:

The number of input variables.

Return type:

int

get_input_var_names()#

Names of the input exchange items.

get_output_item_count()#

Count of a model’s output variables.

Returns:

The number of output variables.

Return type:

int

get_output_var_names()#

Names of the output exchange items.

get_start_time()#

Start time of the component.

get_time_step()#

Component time step.

get_time_units()#

Time units used by the component.

get_value(name, dest)#

Get a copy of a variable’s data.

get_value_at_indices(name, dest, inds)#

Get values at particular indices.

Parameters:
  • name (str) – An input or output variable name, a CSDMS Standard Name.

  • dest (ndarray) – A numpy array into which to place the values.

  • inds (array_like) – The indices into the variable array.

Returns:

Value of the model variable at the given location.

Return type:

array_like

get_value_ptr(name)#

Get a reference to values of the given variable.

This is a getter for the model, used to access the model’s current state. It returns a reference to a model variable, with the return type, size and rank dependent on the variable.

Parameters:

name (str) – An input or output variable name, a CSDMS Standard Name.

Returns:

A reference to a model variable.

Return type:

array_like

get_value_ref(name)#

Get a reference to a variable’s data.

get_var_grid(name)#

Get the grid id for a variable.

get_var_itemsize(name)#

Get the size of elements of a variable.

get_var_location(name)#

Get the grid element type that the a given variable is defined on.

The grid topology can be composed of nodes, edges, and faces.

node

A point that has a coordinate pair or triplet: the most basic element of the topology.

edge

A line or curve bounded by two nodes.

face

A plane or surface enclosed by a set of edges. In a 2D horizontal application one may consider the word “polygon”, but in the hierarchy of elements the word “face” is most common.

Parameters:

name (str) – An input or output variable name, a CSDMS Standard Name.

Returns:

The grid location on which the variable is defined. Must be one of “node”, “edge”, or “face”.

Return type:

str

Notes

CSDMS uses the ugrid conventions to define unstructured grids.

get_var_nbytes(name)#

Get the total number of bytes used by a variable.

get_var_type(name)#

Get the data type for a variable.

get_var_units(name)#

Get the unit used by a variable.

initialize(config_file)#

Initialize the component from a file.

BMI-wrapped Landlab components use input files in YAML format. Component-specific parameters are listed at the top level, followed by grid and then time information. An example input file looks like:

flexure:
    eet: 15.e+3
clock:
    start: 0
    stop: 100.
    step: 2.
grid:
    type: raster
    shape: [20, 40]
    spacing: [1000., 2000.]

In this case, a RasterModelGrid is created (with the given shape and spacing) and passed to the underlying landlab component. The eet=15000. is also given to the component but as a keyword parameter. The BMI clock is initialized with the given parameters.

Parameters:

config_file (str or file_like) – YAML-formatted input file for the component.

set_value(name, values)#

Set the values of a variable.

set_value_at_indices(name, inds, src)#

Specify a new value for a model variable at particular indices.

Parameters:
  • name (str) – An input or output variable name, a CSDMS Standard Name.

  • inds (array_like) – The indices into the variable array.

  • src (array_like) – The new value for the specified variable.

update()#

Update the component one time step.

update_frac(frac)#

Update the component a fraction of a time step.

update_until(then)#

Update the component until a given time.

class PotentialityFlowRouterBMI#

Bases: Bmi

Basic Modeling Interface for the PotentialityFlowRouter component.

finalize()#

Clean-up the component.

get_component_name()#

Name of the component.

get_current_time()#

Current component time.

get_end_time()#

Stop time for the component.

get_grid_edge_count(grid)#

Get the number of edges in the grid.

Parameters:

grid (int) – A grid identifier.

Returns:

The total number of grid edges.

Return type:

int

get_grid_edge_nodes(grid, edge_nodes)#

Get the edge-node connectivity.

Parameters:
  • grid (int) – A grid identifier.

  • edge_nodes (ndarray of int, shape (2 x nnodes,)) – A numpy array to place the edge-node connectivity. For each edge, connectivity is given as node at edge tail, followed by node at edge head.

Returns:

The input numpy array that holds the edge-node connectivity.

Return type:

ndarray of int

get_grid_face_count(grid)#

Get the number of faces in the grid.

Parameters:

grid (int) – A grid identifier.

Returns:

The total number of grid faces.

Return type:

int

get_grid_face_edges(grid)#

Get the face-edge connectivity.

Parameters:
  • grid (int) – A grid identifier.

  • face_edges (ndarray of int) – A numpy array to place the face-edge connectivity.

Returns:

The input numpy array that holds the face-edge connectivity.

Return type:

ndarray of int

get_grid_face_nodes(grid, face_nodes)#

Get the face-node connectivity.

Parameters:
  • grid (int) – A grid identifier.

  • face_nodes (ndarray of int) – A numpy array to place the face-node connectivity. For each face, the nodes (listed in a counter-clockwise direction) that form the boundary of the face.

Returns:

The input numpy array that holds the face-node connectivity.

Return type:

ndarray of int

get_grid_node_count(grid)#

Get the number of nodes in the grid.

Parameters:

grid (int) – A grid identifier.

Returns:

The total number of grid nodes.

Return type:

int

get_grid_nodes_per_face(grid, nodes_per_face)#

Get the number of nodes for each face.

Parameters:
  • grid (int) – A grid identifier.

  • nodes_per_face (ndarray of int, shape (nfaces,)) – A numpy array to place the number of nodes per face.

Returns:

The input numpy array that holds the number of nodes per face.

Return type:

ndarray of int

get_grid_origin(grid, origin)#

Get the origin for a structured grid.

get_grid_rank(grid)#

Get the number of dimensions of a grid.

get_grid_shape(grid, shape)#

Get the shape of a structured grid.

get_grid_size(grid)#

Get the total number of elements in the computational grid.

Parameters:

grid (int) – A grid identifier.

Returns:

Size of the grid.

Return type:

int

get_grid_spacing(grid, spacing)#

Get the row and column spacing of a structured grid.

get_grid_type(grid)#

Get the type of grid.

get_grid_x(grid, x)#

Get coordinates of grid nodes in the x direction.

Parameters:
  • grid (int) – A grid identifier.

  • x (ndarray of float, shape (nrows,)) – A numpy array to hold the x-coordinates of the grid node columns.

Returns:

The input numpy array that holds the grid’s column x-coordinates.

Return type:

ndarray of float

get_grid_y(grid, y)#

Get coordinates of grid nodes in the y direction.

Parameters:
  • grid (int) – A grid identifier.

  • y (ndarray of float, shape (ncols,)) – A numpy array to hold the y-coordinates of the grid node rows.

Returns:

The input numpy array that holds the grid’s row y-coordinates.

Return type:

ndarray of float

get_grid_z(grid, z)#

Get coordinates of grid nodes in the z direction.

Parameters:
  • grid (int) – A grid identifier.

  • z (ndarray of float, shape (nlayers,)) – A numpy array to hold the z-coordinates of the grid nodes layers.

Returns:

The input numpy array that holds the grid’s layer z-coordinates.

Return type:

ndarray of float

get_input_item_count()#

Count of a model’s input variables.

Returns:

The number of input variables.

Return type:

int

get_input_var_names()#

Names of the input exchange items.

get_output_item_count()#

Count of a model’s output variables.

Returns:

The number of output variables.

Return type:

int

get_output_var_names()#

Names of the output exchange items.

get_start_time()#

Start time of the component.

get_time_step()#

Component time step.

get_time_units()#

Time units used by the component.

get_value(name, dest)#

Get a copy of a variable’s data.

get_value_at_indices(name, dest, inds)#

Get values at particular indices.

Parameters:
  • name (str) – An input or output variable name, a CSDMS Standard Name.

  • dest (ndarray) – A numpy array into which to place the values.

  • inds (array_like) – The indices into the variable array.

Returns:

Value of the model variable at the given location.

Return type:

array_like

get_value_ptr(name)#

Get a reference to values of the given variable.

This is a getter for the model, used to access the model’s current state. It returns a reference to a model variable, with the return type, size and rank dependent on the variable.

Parameters:

name (str) – An input or output variable name, a CSDMS Standard Name.

Returns:

A reference to a model variable.

Return type:

array_like

get_value_ref(name)#

Get a reference to a variable’s data.

get_var_grid(name)#

Get the grid id for a variable.

get_var_itemsize(name)#

Get the size of elements of a variable.

get_var_location(name)#

Get the grid element type that the a given variable is defined on.

The grid topology can be composed of nodes, edges, and faces.

node

A point that has a coordinate pair or triplet: the most basic element of the topology.

edge

A line or curve bounded by two nodes.

face

A plane or surface enclosed by a set of edges. In a 2D horizontal application one may consider the word “polygon”, but in the hierarchy of elements the word “face” is most common.

Parameters:

name (str) – An input or output variable name, a CSDMS Standard Name.

Returns:

The grid location on which the variable is defined. Must be one of “node”, “edge”, or “face”.

Return type:

str

Notes

CSDMS uses the ugrid conventions to define unstructured grids.

get_var_nbytes(name)#

Get the total number of bytes used by a variable.

get_var_type(name)#

Get the data type for a variable.

get_var_units(name)#

Get the unit used by a variable.

initialize(config_file)#

Initialize the component from a file.

BMI-wrapped Landlab components use input files in YAML format. Component-specific parameters are listed at the top level, followed by grid and then time information. An example input file looks like:

flexure:
    eet: 15.e+3
clock:
    start: 0
    stop: 100.
    step: 2.
grid:
    type: raster
    shape: [20, 40]
    spacing: [1000., 2000.]

In this case, a RasterModelGrid is created (with the given shape and spacing) and passed to the underlying landlab component. The eet=15000. is also given to the component but as a keyword parameter. The BMI clock is initialized with the given parameters.

Parameters:

config_file (str or file_like) – YAML-formatted input file for the component.

set_value(name, values)#

Set the values of a variable.

set_value_at_indices(name, inds, src)#

Specify a new value for a model variable at particular indices.

Parameters:
  • name (str) – An input or output variable name, a CSDMS Standard Name.

  • inds (array_like) – The indices into the variable array.

  • src (array_like) – The new value for the specified variable.

update()#

Update the component one time step.

update_frac(frac)#

Update the component a fraction of a time step.

update_until(then)#

Update the component until a given time.

class PrecipitationDistributionBMI#

Bases: Bmi

Basic Modeling Interface for the PrecipitationDistribution component.

finalize()#

Clean-up the component.

get_component_name()#

Name of the component.

get_current_time()#

Current component time.

get_end_time()#

Stop time for the component.

get_grid_edge_count(grid)#

Get the number of edges in the grid.

Parameters:

grid (int) – A grid identifier.

Returns:

The total number of grid edges.

Return type:

int

get_grid_edge_nodes(grid, edge_nodes)#

Get the edge-node connectivity.

Parameters:
  • grid (int) – A grid identifier.

  • edge_nodes (ndarray of int, shape (2 x nnodes,)) – A numpy array to place the edge-node connectivity. For each edge, connectivity is given as node at edge tail, followed by node at edge head.

Returns:

The input numpy array that holds the edge-node connectivity.

Return type:

ndarray of int

get_grid_face_count(grid)#

Get the number of faces in the grid.

Parameters:

grid (int) – A grid identifier.

Returns:

The total number of grid faces.

Return type:

int

get_grid_face_edges(grid)#

Get the face-edge connectivity.

Parameters:
  • grid (int) – A grid identifier.

  • face_edges (ndarray of int) – A numpy array to place the face-edge connectivity.

Returns:

The input numpy array that holds the face-edge connectivity.

Return type:

ndarray of int

get_grid_face_nodes(grid, face_nodes)#

Get the face-node connectivity.

Parameters:
  • grid (int) – A grid identifier.

  • face_nodes (ndarray of int) – A numpy array to place the face-node connectivity. For each face, the nodes (listed in a counter-clockwise direction) that form the boundary of the face.

Returns:

The input numpy array that holds the face-node connectivity.

Return type:

ndarray of int

get_grid_node_count(grid)#

Get the number of nodes in the grid.

Parameters:

grid (int) – A grid identifier.

Returns:

The total number of grid nodes.

Return type:

int

get_grid_nodes_per_face(grid, nodes_per_face)#

Get the number of nodes for each face.

Parameters:
  • grid (int) – A grid identifier.

  • nodes_per_face (ndarray of int, shape (nfaces,)) – A numpy array to place the number of nodes per face.

Returns:

The input numpy array that holds the number of nodes per face.

Return type:

ndarray of int

get_grid_origin(grid, origin)#

Get the origin for a structured grid.

get_grid_rank(grid)#

Get the number of dimensions of a grid.

get_grid_shape(grid, shape)#

Get the shape of a structured grid.

get_grid_size(grid)#

Get the total number of elements in the computational grid.

Parameters:

grid (int) – A grid identifier.

Returns:

Size of the grid.

Return type:

int

get_grid_spacing(grid, spacing)#

Get the row and column spacing of a structured grid.

get_grid_type(grid)#

Get the type of grid.

get_grid_x(grid, x)#

Get coordinates of grid nodes in the x direction.

Parameters:
  • grid (int) – A grid identifier.

  • x (ndarray of float, shape (nrows,)) – A numpy array to hold the x-coordinates of the grid node columns.

Returns:

The input numpy array that holds the grid’s column x-coordinates.

Return type:

ndarray of float

get_grid_y(grid, y)#

Get coordinates of grid nodes in the y direction.

Parameters:
  • grid (int) – A grid identifier.

  • y (ndarray of float, shape (ncols,)) – A numpy array to hold the y-coordinates of the grid node rows.

Returns:

The input numpy array that holds the grid’s row y-coordinates.

Return type:

ndarray of float

get_grid_z(grid, z)#

Get coordinates of grid nodes in the z direction.

Parameters:
  • grid (int) – A grid identifier.

  • z (ndarray of float, shape (nlayers,)) – A numpy array to hold the z-coordinates of the grid nodes layers.

Returns:

The input numpy array that holds the grid’s layer z-coordinates.

Return type:

ndarray of float

get_input_item_count()#

Count of a model’s input variables.

Returns:

The number of input variables.

Return type:

int

get_input_var_names()#

Names of the input exchange items.

get_output_item_count()#

Count of a model’s output variables.

Returns:

The number of output variables.

Return type:

int

get_output_var_names()#

Names of the output exchange items.

get_start_time()#

Start time of the component.

get_time_step()#

Component time step.

get_time_units()#

Time units used by the component.

get_value(name, dest)#

Get a copy of a variable’s data.

get_value_at_indices(name, dest, inds)#

Get values at particular indices.

Parameters:
  • name (str) – An input or output variable name, a CSDMS Standard Name.

  • dest (ndarray) – A numpy array into which to place the values.

  • inds (array_like) – The indices into the variable array.

Returns:

Value of the model variable at the given location.

Return type:

array_like

get_value_ptr(name)#

Get a reference to values of the given variable.

This is a getter for the model, used to access the model’s current state. It returns a reference to a model variable, with the return type, size and rank dependent on the variable.

Parameters:

name (str) – An input or output variable name, a CSDMS Standard Name.

Returns:

A reference to a model variable.

Return type:

array_like

get_value_ref(name)#

Get a reference to a variable’s data.

get_var_grid(name)#

Get the grid id for a variable.

get_var_itemsize(name)#

Get the size of elements of a variable.

get_var_location(name)#

Get the grid element type that the a given variable is defined on.

The grid topology can be composed of nodes, edges, and faces.

node

A point that has a coordinate pair or triplet: the most basic element of the topology.

edge

A line or curve bounded by two nodes.

face

A plane or surface enclosed by a set of edges. In a 2D horizontal application one may consider the word “polygon”, but in the hierarchy of elements the word “face” is most common.

Parameters:

name (str) – An input or output variable name, a CSDMS Standard Name.

Returns:

The grid location on which the variable is defined. Must be one of “node”, “edge”, or “face”.

Return type:

str

Notes

CSDMS uses the ugrid conventions to define unstructured grids.

get_var_nbytes(name)#

Get the total number of bytes used by a variable.

get_var_type(name)#

Get the data type for a variable.

get_var_units(name)#

Get the unit used by a variable.

initialize(config_file)#

Initialize the component from a file.

BMI-wrapped Landlab components use input files in YAML format. Component-specific parameters are listed at the top level, followed by grid and then time information. An example input file looks like:

flexure:
    eet: 15.e+3
clock:
    start: 0
    stop: 100.
    step: 2.
grid:
    type: raster
    shape: [20, 40]
    spacing: [1000., 2000.]

In this case, a RasterModelGrid is created (with the given shape and spacing) and passed to the underlying landlab component. The eet=15000. is also given to the component but as a keyword parameter. The BMI clock is initialized with the given parameters.

Parameters:

config_file (str or file_like) – YAML-formatted input file for the component.

set_value(name, values)#

Set the values of a variable.

set_value_at_indices(name, inds, src)#

Specify a new value for a model variable at particular indices.

Parameters:
  • name (str) – An input or output variable name, a CSDMS Standard Name.

  • inds (array_like) – The indices into the variable array.

  • src (array_like) – The new value for the specified variable.

update()#

Update the component one time step.

update_frac(frac)#

Update the component a fraction of a time step.

update_until(then)#

Update the component until a given time.

class PriorityFloodFlowRouterBMI#

Bases: Bmi

Basic Modeling Interface for the PriorityFloodFlowRouter component.

finalize()#

Clean-up the component.

get_component_name()#

Name of the component.

get_current_time()#

Current component time.

get_end_time()#

Stop time for the component.

get_grid_edge_count(grid)#

Get the number of edges in the grid.

Parameters:

grid (int) – A grid identifier.

Returns:

The total number of grid edges.

Return type:

int

get_grid_edge_nodes(grid, edge_nodes)#

Get the edge-node connectivity.

Parameters:
  • grid (int) – A grid identifier.

  • edge_nodes (ndarray of int, shape (2 x nnodes,)) – A numpy array to place the edge-node connectivity. For each edge, connectivity is given as node at edge tail, followed by node at edge head.

Returns:

The input numpy array that holds the edge-node connectivity.

Return type:

ndarray of int

get_grid_face_count(grid)#

Get the number of faces in the grid.

Parameters:

grid (int) – A grid identifier.

Returns:

The total number of grid faces.

Return type:

int

get_grid_face_edges(grid)#

Get the face-edge connectivity.

Parameters:
  • grid (int) – A grid identifier.

  • face_edges (ndarray of int) – A numpy array to place the face-edge connectivity.

Returns:

The input numpy array that holds the face-edge connectivity.

Return type:

ndarray of int

get_grid_face_nodes(grid, face_nodes)#

Get the face-node connectivity.

Parameters:
  • grid (int) – A grid identifier.

  • face_nodes (ndarray of int) – A numpy array to place the face-node connectivity. For each face, the nodes (listed in a counter-clockwise direction) that form the boundary of the face.

Returns:

The input numpy array that holds the face-node connectivity.

Return type:

ndarray of int

get_grid_node_count(grid)#

Get the number of nodes in the grid.

Parameters:

grid (int) – A grid identifier.

Returns:

The total number of grid nodes.

Return type:

int

get_grid_nodes_per_face(grid, nodes_per_face)#

Get the number of nodes for each face.

Parameters:
  • grid (int) – A grid identifier.

  • nodes_per_face (ndarray of int, shape (nfaces,)) – A numpy array to place the number of nodes per face.

Returns:

The input numpy array that holds the number of nodes per face.

Return type:

ndarray of int

get_grid_origin(grid, origin)#

Get the origin for a structured grid.

get_grid_rank(grid)#

Get the number of dimensions of a grid.

get_grid_shape(grid, shape)#

Get the shape of a structured grid.

get_grid_size(grid)#

Get the total number of elements in the computational grid.

Parameters:

grid (int) – A grid identifier.

Returns:

Size of the grid.

Return type:

int

get_grid_spacing(grid, spacing)#

Get the row and column spacing of a structured grid.

get_grid_type(grid)#

Get the type of grid.

get_grid_x(grid, x)#

Get coordinates of grid nodes in the x direction.

Parameters:
  • grid (int) – A grid identifier.

  • x (ndarray of float, shape (nrows,)) – A numpy array to hold the x-coordinates of the grid node columns.

Returns:

The input numpy array that holds the grid’s column x-coordinates.

Return type:

ndarray of float

get_grid_y(grid, y)#

Get coordinates of grid nodes in the y direction.

Parameters:
  • grid (int) – A grid identifier.

  • y (ndarray of float, shape (ncols,)) – A numpy array to hold the y-coordinates of the grid node rows.

Returns:

The input numpy array that holds the grid’s row y-coordinates.

Return type:

ndarray of float

get_grid_z(grid, z)#

Get coordinates of grid nodes in the z direction.

Parameters:
  • grid (int) – A grid identifier.

  • z (ndarray of float, shape (nlayers,)) – A numpy array to hold the z-coordinates of the grid nodes layers.

Returns:

The input numpy array that holds the grid’s layer z-coordinates.

Return type:

ndarray of float

get_input_item_count()#

Count of a model’s input variables.

Returns:

The number of input variables.

Return type:

int

get_input_var_names()#

Names of the input exchange items.

get_output_item_count()#

Count of a model’s output variables.

Returns:

The number of output variables.

Return type:

int

get_output_var_names()#

Names of the output exchange items.

get_start_time()#

Start time of the component.

get_time_step()#

Component time step.

get_time_units()#

Time units used by the component.

get_value(name, dest)#

Get a copy of a variable’s data.

get_value_at_indices(name, dest, inds)#

Get values at particular indices.

Parameters:
  • name (str) – An input or output variable name, a CSDMS Standard Name.

  • dest (ndarray) – A numpy array into which to place the values.

  • inds (array_like) – The indices into the variable array.

Returns:

Value of the model variable at the given location.

Return type:

array_like

get_value_ptr(name)#

Get a reference to values of the given variable.

This is a getter for the model, used to access the model’s current state. It returns a reference to a model variable, with the return type, size and rank dependent on the variable.

Parameters:

name (str) – An input or output variable name, a CSDMS Standard Name.

Returns:

A reference to a model variable.

Return type:

array_like

get_value_ref(name)#

Get a reference to a variable’s data.

get_var_grid(name)#

Get the grid id for a variable.

get_var_itemsize(name)#

Get the size of elements of a variable.

get_var_location(name)#

Get the grid element type that the a given variable is defined on.

The grid topology can be composed of nodes, edges, and faces.

node

A point that has a coordinate pair or triplet: the most basic element of the topology.

edge

A line or curve bounded by two nodes.

face

A plane or surface enclosed by a set of edges. In a 2D horizontal application one may consider the word “polygon”, but in the hierarchy of elements the word “face” is most common.

Parameters:

name (str) – An input or output variable name, a CSDMS Standard Name.

Returns:

The grid location on which the variable is defined. Must be one of “node”, “edge”, or “face”.

Return type:

str

Notes

CSDMS uses the ugrid conventions to define unstructured grids.

get_var_nbytes(name)#

Get the total number of bytes used by a variable.

get_var_type(name)#

Get the data type for a variable.

get_var_units(name)#

Get the unit used by a variable.

initialize(config_file)#

Initialize the component from a file.

BMI-wrapped Landlab components use input files in YAML format. Component-specific parameters are listed at the top level, followed by grid and then time information. An example input file looks like:

flexure:
    eet: 15.e+3
clock:
    start: 0
    stop: 100.
    step: 2.
grid:
    type: raster
    shape: [20, 40]
    spacing: [1000., 2000.]

In this case, a RasterModelGrid is created (with the given shape and spacing) and passed to the underlying landlab component. The eet=15000. is also given to the component but as a keyword parameter. The BMI clock is initialized with the given parameters.

Parameters:

config_file (str or file_like) – YAML-formatted input file for the component.

set_value(name, values)#

Set the values of a variable.

set_value_at_indices(name, inds, src)#

Specify a new value for a model variable at particular indices.

Parameters:
  • name (str) – An input or output variable name, a CSDMS Standard Name.

  • inds (array_like) – The indices into the variable array.

  • src (array_like) – The new value for the specified variable.

update()#

Update the component one time step.

update_frac(frac)#

Update the component a fraction of a time step.

update_until(then)#

Update the component until a given time.

class ProfilerBMI#

Bases: Bmi

Basic Modeling Interface for the Profiler component.

finalize()#

Clean-up the component.

get_component_name()#

Name of the component.

get_current_time()#

Current component time.

get_end_time()#

Stop time for the component.

get_grid_edge_count(grid)#

Get the number of edges in the grid.

Parameters:

grid (int) – A grid identifier.

Returns:

The total number of grid edges.

Return type:

int

get_grid_edge_nodes(grid, edge_nodes)#

Get the edge-node connectivity.

Parameters:
  • grid (int) – A grid identifier.

  • edge_nodes (ndarray of int, shape (2 x nnodes,)) – A numpy array to place the edge-node connectivity. For each edge, connectivity is given as node at edge tail, followed by node at edge head.

Returns:

The input numpy array that holds the edge-node connectivity.

Return type:

ndarray of int

get_grid_face_count(grid)#

Get the number of faces in the grid.

Parameters:

grid (int) – A grid identifier.

Returns:

The total number of grid faces.

Return type:

int

get_grid_face_edges(grid)#

Get the face-edge connectivity.

Parameters:
  • grid (int) – A grid identifier.

  • face_edges (ndarray of int) – A numpy array to place the face-edge connectivity.

Returns:

The input numpy array that holds the face-edge connectivity.

Return type:

ndarray of int

get_grid_face_nodes(grid, face_nodes)#

Get the face-node connectivity.

Parameters:
  • grid (int) – A grid identifier.

  • face_nodes (ndarray of int) – A numpy array to place the face-node connectivity. For each face, the nodes (listed in a counter-clockwise direction) that form the boundary of the face.

Returns:

The input numpy array that holds the face-node connectivity.

Return type:

ndarray of int

get_grid_node_count(grid)#

Get the number of nodes in the grid.

Parameters:

grid (int) – A grid identifier.

Returns:

The total number of grid nodes.

Return type:

int

get_grid_nodes_per_face(grid, nodes_per_face)#

Get the number of nodes for each face.

Parameters:
  • grid (int) – A grid identifier.

  • nodes_per_face (ndarray of int, shape (nfaces,)) – A numpy array to place the number of nodes per face.

Returns:

The input numpy array that holds the number of nodes per face.

Return type:

ndarray of int

get_grid_origin(grid, origin)#

Get the origin for a structured grid.

get_grid_rank(grid)#

Get the number of dimensions of a grid.

get_grid_shape(grid, shape)#

Get the shape of a structured grid.

get_grid_size(grid)#

Get the total number of elements in the computational grid.

Parameters:

grid (int) – A grid identifier.

Returns:

Size of the grid.

Return type:

int

get_grid_spacing(grid, spacing)#

Get the row and column spacing of a structured grid.

get_grid_type(grid)#

Get the type of grid.

get_grid_x(grid, x)#

Get coordinates of grid nodes in the x direction.

Parameters:
  • grid (int) – A grid identifier.

  • x (ndarray of float, shape (nrows,)) – A numpy array to hold the x-coordinates of the grid node columns.

Returns:

The input numpy array that holds the grid’s column x-coordinates.

Return type:

ndarray of float

get_grid_y(grid, y)#

Get coordinates of grid nodes in the y direction.

Parameters:
  • grid (int) – A grid identifier.

  • y (ndarray of float, shape (ncols,)) – A numpy array to hold the y-coordinates of the grid node rows.

Returns:

The input numpy array that holds the grid’s row y-coordinates.

Return type:

ndarray of float

get_grid_z(grid, z)#

Get coordinates of grid nodes in the z direction.

Parameters:
  • grid (int) – A grid identifier.

  • z (ndarray of float, shape (nlayers,)) – A numpy array to hold the z-coordinates of the grid nodes layers.

Returns:

The input numpy array that holds the grid’s layer z-coordinates.

Return type:

ndarray of float

get_input_item_count()#

Count of a model’s input variables.

Returns:

The number of input variables.

Return type:

int

get_input_var_names()#

Names of the input exchange items.

get_output_item_count()#

Count of a model’s output variables.

Returns:

The number of output variables.

Return type:

int

get_output_var_names()#

Names of the output exchange items.

get_start_time()#

Start time of the component.

get_time_step()#

Component time step.

get_time_units()#

Time units used by the component.

get_value(name, dest)#

Get a copy of a variable’s data.

get_value_at_indices(name, dest, inds)#

Get values at particular indices.

Parameters:
  • name (str) – An input or output variable name, a CSDMS Standard Name.

  • dest (ndarray) – A numpy array into which to place the values.

  • inds (array_like) – The indices into the variable array.

Returns:

Value of the model variable at the given location.

Return type:

array_like

get_value_ptr(name)#

Get a reference to values of the given variable.

This is a getter for the model, used to access the model’s current state. It returns a reference to a model variable, with the return type, size and rank dependent on the variable.

Parameters:

name (str) – An input or output variable name, a CSDMS Standard Name.

Returns:

A reference to a model variable.

Return type:

array_like

get_value_ref(name)#

Get a reference to a variable’s data.

get_var_grid(name)#

Get the grid id for a variable.

get_var_itemsize(name)#

Get the size of elements of a variable.

get_var_location(name)#

Get the grid element type that the a given variable is defined on.

The grid topology can be composed of nodes, edges, and faces.

node

A point that has a coordinate pair or triplet: the most basic element of the topology.

edge

A line or curve bounded by two nodes.

face

A plane or surface enclosed by a set of edges. In a 2D horizontal application one may consider the word “polygon”, but in the hierarchy of elements the word “face” is most common.

Parameters:

name (str) – An input or output variable name, a CSDMS Standard Name.

Returns:

The grid location on which the variable is defined. Must be one of “node”, “edge”, or “face”.

Return type:

str

Notes

CSDMS uses the ugrid conventions to define unstructured grids.

get_var_nbytes(name)#

Get the total number of bytes used by a variable.

get_var_type(name)#

Get the data type for a variable.

get_var_units(name)#

Get the unit used by a variable.

initialize(config_file)#

Initialize the component from a file.

BMI-wrapped Landlab components use input files in YAML format. Component-specific parameters are listed at the top level, followed by grid and then time information. An example input file looks like:

flexure:
    eet: 15.e+3
clock:
    start: 0
    stop: 100.
    step: 2.
grid:
    type: raster
    shape: [20, 40]
    spacing: [1000., 2000.]

In this case, a RasterModelGrid is created (with the given shape and spacing) and passed to the underlying landlab component. The eet=15000. is also given to the component but as a keyword parameter. The BMI clock is initialized with the given parameters.

Parameters:

config_file (str or file_like) – YAML-formatted input file for the component.

set_value(name, values)#

Set the values of a variable.

set_value_at_indices(name, inds, src)#

Specify a new value for a model variable at particular indices.

Parameters:
  • name (str) – An input or output variable name, a CSDMS Standard Name.

  • inds (array_like) – The indices into the variable array.

  • src (array_like) – The new value for the specified variable.

update()#

Update the component one time step.

update_frac(frac)#

Update the component a fraction of a time step.

update_until(then)#

Update the component until a given time.

class RadiationBMI#

Bases: Bmi

Basic Modeling Interface for the Radiation component.

finalize()#

Clean-up the component.

get_component_name()#

Name of the component.

get_current_time()#

Current component time.

get_end_time()#

Stop time for the component.

get_grid_edge_count(grid)#

Get the number of edges in the grid.

Parameters:

grid (int) – A grid identifier.

Returns:

The total number of grid edges.

Return type:

int

get_grid_edge_nodes(grid, edge_nodes)#

Get the edge-node connectivity.

Parameters:
  • grid (int) – A grid identifier.

  • edge_nodes (ndarray of int, shape (2 x nnodes,)) – A numpy array to place the edge-node connectivity. For each edge, connectivity is given as node at edge tail, followed by node at edge head.

Returns:

The input numpy array that holds the edge-node connectivity.

Return type:

ndarray of int

get_grid_face_count(grid)#

Get the number of faces in the grid.

Parameters:

grid (int) – A grid identifier.

Returns:

The total number of grid faces.

Return type:

int

get_grid_face_edges(grid)#

Get the face-edge connectivity.

Parameters:
  • grid (int) – A grid identifier.

  • face_edges (ndarray of int) – A numpy array to place the face-edge connectivity.

Returns:

The input numpy array that holds the face-edge connectivity.

Return type:

ndarray of int

get_grid_face_nodes(grid, face_nodes)#

Get the face-node connectivity.

Parameters:
  • grid (int) – A grid identifier.

  • face_nodes (ndarray of int) – A numpy array to place the face-node connectivity. For each face, the nodes (listed in a counter-clockwise direction) that form the boundary of the face.

Returns:

The input numpy array that holds the face-node connectivity.

Return type:

ndarray of int

get_grid_node_count(grid)#

Get the number of nodes in the grid.

Parameters:

grid (int) – A grid identifier.

Returns:

The total number of grid nodes.

Return type:

int

get_grid_nodes_per_face(grid, nodes_per_face)#

Get the number of nodes for each face.

Parameters:
  • grid (int) – A grid identifier.

  • nodes_per_face (ndarray of int, shape (nfaces,)) – A numpy array to place the number of nodes per face.

Returns:

The input numpy array that holds the number of nodes per face.

Return type:

ndarray of int

get_grid_origin(grid, origin)#

Get the origin for a structured grid.

get_grid_rank(grid)#

Get the number of dimensions of a grid.

get_grid_shape(grid, shape)#

Get the shape of a structured grid.

get_grid_size(grid)#

Get the total number of elements in the computational grid.

Parameters:

grid (int) – A grid identifier.

Returns:

Size of the grid.

Return type:

int

get_grid_spacing(grid, spacing)#

Get the row and column spacing of a structured grid.

get_grid_type(grid)#

Get the type of grid.

get_grid_x(grid, x)#

Get coordinates of grid nodes in the x direction.

Parameters:
  • grid (int) – A grid identifier.

  • x (ndarray of float, shape (nrows,)) – A numpy array to hold the x-coordinates of the grid node columns.

Returns:

The input numpy array that holds the grid’s column x-coordinates.

Return type:

ndarray of float

get_grid_y(grid, y)#

Get coordinates of grid nodes in the y direction.

Parameters:
  • grid (int) – A grid identifier.

  • y (ndarray of float, shape (ncols,)) – A numpy array to hold the y-coordinates of the grid node rows.

Returns:

The input numpy array that holds the grid’s row y-coordinates.

Return type:

ndarray of float

get_grid_z(grid, z)#

Get coordinates of grid nodes in the z direction.

Parameters:
  • grid (int) – A grid identifier.

  • z (ndarray of float, shape (nlayers,)) – A numpy array to hold the z-coordinates of the grid nodes layers.

Returns:

The input numpy array that holds the grid’s layer z-coordinates.

Return type:

ndarray of float

get_input_item_count()#

Count of a model’s input variables.

Returns:

The number of input variables.

Return type:

int

get_input_var_names()#

Names of the input exchange items.

get_output_item_count()#

Count of a model’s output variables.

Returns:

The number of output variables.

Return type:

int

get_output_var_names()#

Names of the output exchange items.

get_start_time()#

Start time of the component.

get_time_step()#

Component time step.

get_time_units()#

Time units used by the component.

get_value(name, dest)#

Get a copy of a variable’s data.

get_value_at_indices(name, dest, inds)#

Get values at particular indices.

Parameters:
  • name (str) – An input or output variable name, a CSDMS Standard Name.

  • dest (ndarray) – A numpy array into which to place the values.

  • inds (array_like) – The indices into the variable array.

Returns:

Value of the model variable at the given location.

Return type:

array_like

get_value_ptr(name)#

Get a reference to values of the given variable.

This is a getter for the model, used to access the model’s current state. It returns a reference to a model variable, with the return type, size and rank dependent on the variable.

Parameters:

name (str) – An input or output variable name, a CSDMS Standard Name.

Returns:

A reference to a model variable.

Return type:

array_like

get_value_ref(name)#

Get a reference to a variable’s data.

get_var_grid(name)#

Get the grid id for a variable.

get_var_itemsize(name)#

Get the size of elements of a variable.

get_var_location(name)#

Get the grid element type that the a given variable is defined on.

The grid topology can be composed of nodes, edges, and faces.

node

A point that has a coordinate pair or triplet: the most basic element of the topology.

edge

A line or curve bounded by two nodes.

face

A plane or surface enclosed by a set of edges. In a 2D horizontal application one may consider the word “polygon”, but in the hierarchy of elements the word “face” is most common.

Parameters:

name (str) – An input or output variable name, a CSDMS Standard Name.

Returns:

The grid location on which the variable is defined. Must be one of “node”, “edge”, or “face”.

Return type:

str

Notes

CSDMS uses the ugrid conventions to define unstructured grids.

get_var_nbytes(name)#

Get the total number of bytes used by a variable.

get_var_type(name)#

Get the data type for a variable.

get_var_units(name)#

Get the unit used by a variable.

initialize(config_file)#

Initialize the component from a file.

BMI-wrapped Landlab components use input files in YAML format. Component-specific parameters are listed at the top level, followed by grid and then time information. An example input file looks like:

flexure:
    eet: 15.e+3
clock:
    start: 0
    stop: 100.
    step: 2.
grid:
    type: raster
    shape: [20, 40]
    spacing: [1000., 2000.]

In this case, a RasterModelGrid is created (with the given shape and spacing) and passed to the underlying landlab component. The eet=15000. is also given to the component but as a keyword parameter. The BMI clock is initialized with the given parameters.

Parameters:

config_file (str or file_like) – YAML-formatted input file for the component.

set_value(name, values)#

Set the values of a variable.

set_value_at_indices(name, inds, src)#

Specify a new value for a model variable at particular indices.

Parameters:
  • name (str) – An input or output variable name, a CSDMS Standard Name.

  • inds (array_like) – The indices into the variable array.

  • src (array_like) – The new value for the specified variable.

update()#

Update the component one time step.

update_frac(frac)#

Update the component a fraction of a time step.

update_until(then)#

Update the component until a given time.

class SedDepEroderBMI#

Bases: Bmi

Basic Modeling Interface for the SedDepEroder component.

finalize()#

Clean-up the component.

get_component_name()#

Name of the component.

get_current_time()#

Current component time.

get_end_time()#

Stop time for the component.

get_grid_edge_count(grid)#

Get the number of edges in the grid.

Parameters:

grid (int) – A grid identifier.

Returns:

The total number of grid edges.

Return type:

int

get_grid_edge_nodes(grid, edge_nodes)#

Get the edge-node connectivity.

Parameters:
  • grid (int) – A grid identifier.

  • edge_nodes (ndarray of int, shape (2 x nnodes,)) – A numpy array to place the edge-node connectivity. For each edge, connectivity is given as node at edge tail, followed by node at edge head.

Returns:

The input numpy array that holds the edge-node connectivity.

Return type:

ndarray of int

get_grid_face_count(grid)#

Get the number of faces in the grid.

Parameters:

grid (int) – A grid identifier.

Returns:

The total number of grid faces.

Return type:

int

get_grid_face_edges(grid)#

Get the face-edge connectivity.

Parameters:
  • grid (int) – A grid identifier.

  • face_edges (ndarray of int) – A numpy array to place the face-edge connectivity.

Returns:

The input numpy array that holds the face-edge connectivity.

Return type:

ndarray of int

get_grid_face_nodes(grid, face_nodes)#

Get the face-node connectivity.

Parameters:
  • grid (int) – A grid identifier.

  • face_nodes (ndarray of int) – A numpy array to place the face-node connectivity. For each face, the nodes (listed in a counter-clockwise direction) that form the boundary of the face.

Returns:

The input numpy array that holds the face-node connectivity.

Return type:

ndarray of int

get_grid_node_count(grid)#

Get the number of nodes in the grid.

Parameters:

grid (int) – A grid identifier.

Returns:

The total number of grid nodes.

Return type:

int

get_grid_nodes_per_face(grid, nodes_per_face)#

Get the number of nodes for each face.

Parameters:
  • grid (int) – A grid identifier.

  • nodes_per_face (ndarray of int, shape (nfaces,)) – A numpy array to place the number of nodes per face.

Returns:

The input numpy array that holds the number of nodes per face.

Return type:

ndarray of int

get_grid_origin(grid, origin)#

Get the origin for a structured grid.

get_grid_rank(grid)#

Get the number of dimensions of a grid.

get_grid_shape(grid, shape)#

Get the shape of a structured grid.

get_grid_size(grid)#

Get the total number of elements in the computational grid.

Parameters:

grid (int) – A grid identifier.

Returns:

Size of the grid.

Return type:

int

get_grid_spacing(grid, spacing)#

Get the row and column spacing of a structured grid.

get_grid_type(grid)#

Get the type of grid.

get_grid_x(grid, x)#

Get coordinates of grid nodes in the x direction.

Parameters:
  • grid (int) – A grid identifier.

  • x (ndarray of float, shape (nrows,)) – A numpy array to hold the x-coordinates of the grid node columns.

Returns:

The input numpy array that holds the grid’s column x-coordinates.

Return type:

ndarray of float

get_grid_y(grid, y)#

Get coordinates of grid nodes in the y direction.

Parameters:
  • grid (int) – A grid identifier.

  • y (ndarray of float, shape (ncols,)) – A numpy array to hold the y-coordinates of the grid node rows.

Returns:

The input numpy array that holds the grid’s row y-coordinates.

Return type:

ndarray of float

get_grid_z(grid, z)#

Get coordinates of grid nodes in the z direction.

Parameters:
  • grid (int) – A grid identifier.

  • z (ndarray of float, shape (nlayers,)) – A numpy array to hold the z-coordinates of the grid nodes layers.

Returns:

The input numpy array that holds the grid’s layer z-coordinates.

Return type:

ndarray of float

get_input_item_count()#

Count of a model’s input variables.

Returns:

The number of input variables.

Return type:

int

get_input_var_names()#

Names of the input exchange items.

get_output_item_count()#

Count of a model’s output variables.

Returns:

The number of output variables.

Return type:

int

get_output_var_names()#

Names of the output exchange items.

get_start_time()#

Start time of the component.

get_time_step()#

Component time step.

get_time_units()#

Time units used by the component.

get_value(name, dest)#

Get a copy of a variable’s data.

get_value_at_indices(name, dest, inds)#

Get values at particular indices.

Parameters:
  • name (str) – An input or output variable name, a CSDMS Standard Name.

  • dest (ndarray) – A numpy array into which to place the values.

  • inds (array_like) – The indices into the variable array.

Returns:

Value of the model variable at the given location.

Return type:

array_like

get_value_ptr(name)#

Get a reference to values of the given variable.

This is a getter for the model, used to access the model’s current state. It returns a reference to a model variable, with the return type, size and rank dependent on the variable.

Parameters:

name (str) – An input or output variable name, a CSDMS Standard Name.

Returns:

A reference to a model variable.

Return type:

array_like

get_value_ref(name)#

Get a reference to a variable’s data.

get_var_grid(name)#

Get the grid id for a variable.

get_var_itemsize(name)#

Get the size of elements of a variable.

get_var_location(name)#

Get the grid element type that the a given variable is defined on.

The grid topology can be composed of nodes, edges, and faces.

node

A point that has a coordinate pair or triplet: the most basic element of the topology.

edge

A line or curve bounded by two nodes.

face

A plane or surface enclosed by a set of edges. In a 2D horizontal application one may consider the word “polygon”, but in the hierarchy of elements the word “face” is most common.

Parameters:

name (str) – An input or output variable name, a CSDMS Standard Name.

Returns:

The grid location on which the variable is defined. Must be one of “node”, “edge”, or “face”.

Return type:

str

Notes

CSDMS uses the ugrid conventions to define unstructured grids.

get_var_nbytes(name)#

Get the total number of bytes used by a variable.

get_var_type(name)#

Get the data type for a variable.

get_var_units(name)#

Get the unit used by a variable.

initialize(config_file)#

Initialize the component from a file.

BMI-wrapped Landlab components use input files in YAML format. Component-specific parameters are listed at the top level, followed by grid and then time information. An example input file looks like:

flexure:
    eet: 15.e+3
clock:
    start: 0
    stop: 100.
    step: 2.
grid:
    type: raster
    shape: [20, 40]
    spacing: [1000., 2000.]

In this case, a RasterModelGrid is created (with the given shape and spacing) and passed to the underlying landlab component. The eet=15000. is also given to the component but as a keyword parameter. The BMI clock is initialized with the given parameters.

Parameters:

config_file (str or file_like) – YAML-formatted input file for the component.

set_value(name, values)#

Set the values of a variable.

set_value_at_indices(name, inds, src)#

Specify a new value for a model variable at particular indices.

Parameters:
  • name (str) – An input or output variable name, a CSDMS Standard Name.

  • inds (array_like) – The indices into the variable array.

  • src (array_like) – The new value for the specified variable.

update()#

Update the component one time step.

update_frac(frac)#

Update the component a fraction of a time step.

update_until(then)#

Update the component until a given time.

class SedimentPulserAtLinksBMI#

Bases: Bmi

Basic Modeling Interface for the SedimentPulserAtLinks component.

finalize()#

Clean-up the component.

get_component_name()#

Name of the component.

get_current_time()#

Current component time.

get_end_time()#

Stop time for the component.

get_grid_edge_count(grid)#

Get the number of edges in the grid.

Parameters:

grid (int) – A grid identifier.

Returns:

The total number of grid edges.

Return type:

int

get_grid_edge_nodes(grid, edge_nodes)#

Get the edge-node connectivity.

Parameters:
  • grid (int) – A grid identifier.

  • edge_nodes (ndarray of int, shape (2 x nnodes,)) – A numpy array to place the edge-node connectivity. For each edge, connectivity is given as node at edge tail, followed by node at edge head.

Returns:

The input numpy array that holds the edge-node connectivity.

Return type:

ndarray of int

get_grid_face_count(grid)#

Get the number of faces in the grid.

Parameters:

grid (int) – A grid identifier.

Returns:

The total number of grid faces.

Return type:

int

get_grid_face_edges(grid)#

Get the face-edge connectivity.

Parameters:
  • grid (int) – A grid identifier.

  • face_edges (ndarray of int) – A numpy array to place the face-edge connectivity.

Returns:

The input numpy array that holds the face-edge connectivity.

Return type:

ndarray of int

get_grid_face_nodes(grid, face_nodes)#

Get the face-node connectivity.

Parameters:
  • grid (int) – A grid identifier.

  • face_nodes (ndarray of int) – A numpy array to place the face-node connectivity. For each face, the nodes (listed in a counter-clockwise direction) that form the boundary of the face.

Returns:

The input numpy array that holds the face-node connectivity.

Return type:

ndarray of int

get_grid_node_count(grid)#

Get the number of nodes in the grid.

Parameters:

grid (int) – A grid identifier.

Returns:

The total number of grid nodes.

Return type:

int

get_grid_nodes_per_face(grid, nodes_per_face)#

Get the number of nodes for each face.

Parameters:
  • grid (int) – A grid identifier.

  • nodes_per_face (ndarray of int, shape (nfaces,)) – A numpy array to place the number of nodes per face.

Returns:

The input numpy array that holds the number of nodes per face.

Return type:

ndarray of int

get_grid_origin(grid, origin)#

Get the origin for a structured grid.

get_grid_rank(grid)#

Get the number of dimensions of a grid.

get_grid_shape(grid, shape)#

Get the shape of a structured grid.

get_grid_size(grid)#

Get the total number of elements in the computational grid.

Parameters:

grid (int) – A grid identifier.

Returns:

Size of the grid.

Return type:

int

get_grid_spacing(grid, spacing)#

Get the row and column spacing of a structured grid.

get_grid_type(grid)#

Get the type of grid.

get_grid_x(grid, x)#

Get coordinates of grid nodes in the x direction.

Parameters:
  • grid (int) – A grid identifier.

  • x (ndarray of float, shape (nrows,)) – A numpy array to hold the x-coordinates of the grid node columns.

Returns:

The input numpy array that holds the grid’s column x-coordinates.

Return type:

ndarray of float

get_grid_y(grid, y)#

Get coordinates of grid nodes in the y direction.

Parameters:
  • grid (int) – A grid identifier.

  • y (ndarray of float, shape (ncols,)) – A numpy array to hold the y-coordinates of the grid node rows.

Returns:

The input numpy array that holds the grid’s row y-coordinates.

Return type:

ndarray of float

get_grid_z(grid, z)#

Get coordinates of grid nodes in the z direction.

Parameters:
  • grid (int) – A grid identifier.

  • z (ndarray of float, shape (nlayers,)) – A numpy array to hold the z-coordinates of the grid nodes layers.

Returns:

The input numpy array that holds the grid’s layer z-coordinates.

Return type:

ndarray of float

get_input_item_count()#

Count of a model’s input variables.

Returns:

The number of input variables.

Return type:

int

get_input_var_names()#

Names of the input exchange items.

get_output_item_count()#

Count of a model’s output variables.

Returns:

The number of output variables.

Return type:

int

get_output_var_names()#

Names of the output exchange items.

get_start_time()#

Start time of the component.

get_time_step()#

Component time step.

get_time_units()#

Time units used by the component.

get_value(name, dest)#

Get a copy of a variable’s data.

get_value_at_indices(name, dest, inds)#

Get values at particular indices.

Parameters:
  • name (str) – An input or output variable name, a CSDMS Standard Name.

  • dest (ndarray) – A numpy array into which to place the values.

  • inds (array_like) – The indices into the variable array.

Returns:

Value of the model variable at the given location.

Return type:

array_like

get_value_ptr(name)#

Get a reference to values of the given variable.

This is a getter for the model, used to access the model’s current state. It returns a reference to a model variable, with the return type, size and rank dependent on the variable.

Parameters:

name (str) – An input or output variable name, a CSDMS Standard Name.

Returns:

A reference to a model variable.

Return type:

array_like

get_value_ref(name)#

Get a reference to a variable’s data.

get_var_grid(name)#

Get the grid id for a variable.

get_var_itemsize(name)#

Get the size of elements of a variable.

get_var_location(name)#

Get the grid element type that the a given variable is defined on.

The grid topology can be composed of nodes, edges, and faces.

node

A point that has a coordinate pair or triplet: the most basic element of the topology.

edge

A line or curve bounded by two nodes.

face

A plane or surface enclosed by a set of edges. In a 2D horizontal application one may consider the word “polygon”, but in the hierarchy of elements the word “face” is most common.

Parameters:

name (str) – An input or output variable name, a CSDMS Standard Name.

Returns:

The grid location on which the variable is defined. Must be one of “node”, “edge”, or “face”.

Return type:

str

Notes

CSDMS uses the ugrid conventions to define unstructured grids.

get_var_nbytes(name)#

Get the total number of bytes used by a variable.

get_var_type(name)#

Get the data type for a variable.

get_var_units(name)#

Get the unit used by a variable.

initialize(config_file)#

Initialize the component from a file.

BMI-wrapped Landlab components use input files in YAML format. Component-specific parameters are listed at the top level, followed by grid and then time information. An example input file looks like:

flexure:
    eet: 15.e+3
clock:
    start: 0
    stop: 100.
    step: 2.
grid:
    type: raster
    shape: [20, 40]
    spacing: [1000., 2000.]

In this case, a RasterModelGrid is created (with the given shape and spacing) and passed to the underlying landlab component. The eet=15000. is also given to the component but as a keyword parameter. The BMI clock is initialized with the given parameters.

Parameters:

config_file (str or file_like) – YAML-formatted input file for the component.

set_value(name, values)#

Set the values of a variable.

set_value_at_indices(name, inds, src)#

Specify a new value for a model variable at particular indices.

Parameters:
  • name (str) – An input or output variable name, a CSDMS Standard Name.

  • inds (array_like) – The indices into the variable array.

  • src (array_like) – The new value for the specified variable.

update()#

Update the component one time step.

update_frac(frac)#

Update the component a fraction of a time step.

update_until(then)#

Update the component until a given time.

class SedimentPulserEachParcelBMI#

Bases: Bmi

Basic Modeling Interface for the SedimentPulserEachParcel component.

finalize()#

Clean-up the component.

get_component_name()#

Name of the component.

get_current_time()#

Current component time.

get_end_time()#

Stop time for the component.

get_grid_edge_count(grid)#

Get the number of edges in the grid.

Parameters:

grid (int) – A grid identifier.

Returns:

The total number of grid edges.

Return type:

int

get_grid_edge_nodes(grid, edge_nodes)#

Get the edge-node connectivity.

Parameters:
  • grid (int) – A grid identifier.

  • edge_nodes (ndarray of int, shape (2 x nnodes,)) – A numpy array to place the edge-node connectivity. For each edge, connectivity is given as node at edge tail, followed by node at edge head.

Returns:

The input numpy array that holds the edge-node connectivity.

Return type:

ndarray of int

get_grid_face_count(grid)#

Get the number of faces in the grid.

Parameters:

grid (int) – A grid identifier.

Returns:

The total number of grid faces.

Return type:

int

get_grid_face_edges(grid)#

Get the face-edge connectivity.

Parameters:
  • grid (int) – A grid identifier.

  • face_edges (ndarray of int) – A numpy array to place the face-edge connectivity.

Returns:

The input numpy array that holds the face-edge connectivity.

Return type:

ndarray of int

get_grid_face_nodes(grid, face_nodes)#

Get the face-node connectivity.

Parameters:
  • grid (int) – A grid identifier.

  • face_nodes (ndarray of int) – A numpy array to place the face-node connectivity. For each face, the nodes (listed in a counter-clockwise direction) that form the boundary of the face.

Returns:

The input numpy array that holds the face-node connectivity.

Return type:

ndarray of int

get_grid_node_count(grid)#

Get the number of nodes in the grid.

Parameters:

grid (int) – A grid identifier.

Returns:

The total number of grid nodes.

Return type:

int

get_grid_nodes_per_face(grid, nodes_per_face)#

Get the number of nodes for each face.

Parameters:
  • grid (int) – A grid identifier.

  • nodes_per_face (ndarray of int, shape (nfaces,)) – A numpy array to place the number of nodes per face.

Returns:

The input numpy array that holds the number of nodes per face.

Return type:

ndarray of int

get_grid_origin(grid, origin)#

Get the origin for a structured grid.

get_grid_rank(grid)#

Get the number of dimensions of a grid.

get_grid_shape(grid, shape)#

Get the shape of a structured grid.

get_grid_size(grid)#

Get the total number of elements in the computational grid.

Parameters:

grid (int) – A grid identifier.

Returns:

Size of the grid.

Return type:

int

get_grid_spacing(grid, spacing)#

Get the row and column spacing of a structured grid.

get_grid_type(grid)#

Get the type of grid.

get_grid_x(grid, x)#

Get coordinates of grid nodes in the x direction.

Parameters:
  • grid (int) – A grid identifier.

  • x (ndarray of float, shape (nrows,)) – A numpy array to hold the x-coordinates of the grid node columns.

Returns:

The input numpy array that holds the grid’s column x-coordinates.

Return type:

ndarray of float

get_grid_y(grid, y)#

Get coordinates of grid nodes in the y direction.

Parameters:
  • grid (int) – A grid identifier.

  • y (ndarray of float, shape (ncols,)) – A numpy array to hold the y-coordinates of the grid node rows.

Returns:

The input numpy array that holds the grid’s row y-coordinates.

Return type:

ndarray of float

get_grid_z(grid, z)#

Get coordinates of grid nodes in the z direction.

Parameters:
  • grid (int) – A grid identifier.

  • z (ndarray of float, shape (nlayers,)) – A numpy array to hold the z-coordinates of the grid nodes layers.

Returns:

The input numpy array that holds the grid’s layer z-coordinates.

Return type:

ndarray of float

get_input_item_count()#

Count of a model’s input variables.

Returns:

The number of input variables.

Return type:

int

get_input_var_names()#

Names of the input exchange items.

get_output_item_count()#

Count of a model’s output variables.

Returns:

The number of output variables.

Return type:

int

get_output_var_names()#

Names of the output exchange items.

get_start_time()#

Start time of the component.

get_time_step()#

Component time step.

get_time_units()#

Time units used by the component.

get_value(name, dest)#

Get a copy of a variable’s data.

get_value_at_indices(name, dest, inds)#

Get values at particular indices.

Parameters:
  • name (str) – An input or output variable name, a CSDMS Standard Name.

  • dest (ndarray) – A numpy array into which to place the values.

  • inds (array_like) – The indices into the variable array.

Returns:

Value of the model variable at the given location.

Return type:

array_like

get_value_ptr(name)#

Get a reference to values of the given variable.

This is a getter for the model, used to access the model’s current state. It returns a reference to a model variable, with the return type, size and rank dependent on the variable.

Parameters:

name (str) – An input or output variable name, a CSDMS Standard Name.

Returns:

A reference to a model variable.

Return type:

array_like

get_value_ref(name)#

Get a reference to a variable’s data.

get_var_grid(name)#

Get the grid id for a variable.

get_var_itemsize(name)#

Get the size of elements of a variable.

get_var_location(name)#

Get the grid element type that the a given variable is defined on.

The grid topology can be composed of nodes, edges, and faces.

node

A point that has a coordinate pair or triplet: the most basic element of the topology.

edge

A line or curve bounded by two nodes.

face

A plane or surface enclosed by a set of edges. In a 2D horizontal application one may consider the word “polygon”, but in the hierarchy of elements the word “face” is most common.

Parameters:

name (str) – An input or output variable name, a CSDMS Standard Name.

Returns:

The grid location on which the variable is defined. Must be one of “node”, “edge”, or “face”.

Return type:

str

Notes

CSDMS uses the ugrid conventions to define unstructured grids.

get_var_nbytes(name)#

Get the total number of bytes used by a variable.

get_var_type(name)#

Get the data type for a variable.

get_var_units(name)#

Get the unit used by a variable.

initialize(config_file)#

Initialize the component from a file.

BMI-wrapped Landlab components use input files in YAML format. Component-specific parameters are listed at the top level, followed by grid and then time information. An example input file looks like:

flexure:
    eet: 15.e+3
clock:
    start: 0
    stop: 100.
    step: 2.
grid:
    type: raster
    shape: [20, 40]
    spacing: [1000., 2000.]

In this case, a RasterModelGrid is created (with the given shape and spacing) and passed to the underlying landlab component. The eet=15000. is also given to the component but as a keyword parameter. The BMI clock is initialized with the given parameters.

Parameters:

config_file (str or file_like) – YAML-formatted input file for the component.

set_value(name, values)#

Set the values of a variable.

set_value_at_indices(name, inds, src)#

Specify a new value for a model variable at particular indices.

Parameters:
  • name (str) – An input or output variable name, a CSDMS Standard Name.

  • inds (array_like) – The indices into the variable array.

  • src (array_like) – The new value for the specified variable.

update()#

Update the component one time step.

update_frac(frac)#

Update the component a fraction of a time step.

update_until(then)#

Update the component until a given time.

class SimpleSubmarineDiffuserBMI#

Bases: Bmi

Basic Modeling Interface for the SimpleSubmarineDiffuser component.

finalize()#

Clean-up the component.

get_component_name()#

Name of the component.

get_current_time()#

Current component time.

get_end_time()#

Stop time for the component.

get_grid_edge_count(grid)#

Get the number of edges in the grid.

Parameters:

grid (int) – A grid identifier.

Returns:

The total number of grid edges.

Return type:

int

get_grid_edge_nodes(grid, edge_nodes)#

Get the edge-node connectivity.

Parameters:
  • grid (int) – A grid identifier.

  • edge_nodes (ndarray of int, shape (2 x nnodes,)) – A numpy array to place the edge-node connectivity. For each edge, connectivity is given as node at edge tail, followed by node at edge head.

Returns:

The input numpy array that holds the edge-node connectivity.

Return type:

ndarray of int

get_grid_face_count(grid)#

Get the number of faces in the grid.

Parameters:

grid (int) – A grid identifier.

Returns:

The total number of grid faces.

Return type:

int

get_grid_face_edges(grid)#

Get the face-edge connectivity.

Parameters:
  • grid (int) – A grid identifier.

  • face_edges (ndarray of int) – A numpy array to place the face-edge connectivity.

Returns:

The input numpy array that holds the face-edge connectivity.

Return type:

ndarray of int

get_grid_face_nodes(grid, face_nodes)#

Get the face-node connectivity.

Parameters:
  • grid (int) – A grid identifier.

  • face_nodes (ndarray of int) – A numpy array to place the face-node connectivity. For each face, the nodes (listed in a counter-clockwise direction) that form the boundary of the face.

Returns:

The input numpy array that holds the face-node connectivity.

Return type:

ndarray of int

get_grid_node_count(grid)#

Get the number of nodes in the grid.

Parameters:

grid (int) – A grid identifier.

Returns:

The total number of grid nodes.

Return type:

int

get_grid_nodes_per_face(grid, nodes_per_face)#

Get the number of nodes for each face.

Parameters:
  • grid (int) – A grid identifier.

  • nodes_per_face (ndarray of int, shape (nfaces,)) – A numpy array to place the number of nodes per face.

Returns:

The input numpy array that holds the number of nodes per face.

Return type:

ndarray of int

get_grid_origin(grid, origin)#

Get the origin for a structured grid.

get_grid_rank(grid)#

Get the number of dimensions of a grid.

get_grid_shape(grid, shape)#

Get the shape of a structured grid.

get_grid_size(grid)#

Get the total number of elements in the computational grid.

Parameters:

grid (int) – A grid identifier.

Returns:

Size of the grid.

Return type:

int

get_grid_spacing(grid, spacing)#

Get the row and column spacing of a structured grid.

get_grid_type(grid)#

Get the type of grid.

get_grid_x(grid, x)#

Get coordinates of grid nodes in the x direction.

Parameters:
  • grid (int) – A grid identifier.

  • x (ndarray of float, shape (nrows,)) – A numpy array to hold the x-coordinates of the grid node columns.

Returns:

The input numpy array that holds the grid’s column x-coordinates.

Return type:

ndarray of float

get_grid_y(grid, y)#

Get coordinates of grid nodes in the y direction.

Parameters:
  • grid (int) – A grid identifier.

  • y (ndarray of float, shape (ncols,)) – A numpy array to hold the y-coordinates of the grid node rows.

Returns:

The input numpy array that holds the grid’s row y-coordinates.

Return type:

ndarray of float

get_grid_z(grid, z)#

Get coordinates of grid nodes in the z direction.

Parameters:
  • grid (int) – A grid identifier.

  • z (ndarray of float, shape (nlayers,)) – A numpy array to hold the z-coordinates of the grid nodes layers.

Returns:

The input numpy array that holds the grid’s layer z-coordinates.

Return type:

ndarray of float

get_input_item_count()#

Count of a model’s input variables.

Returns:

The number of input variables.

Return type:

int

get_input_var_names()#

Names of the input exchange items.

get_output_item_count()#

Count of a model’s output variables.

Returns:

The number of output variables.

Return type:

int

get_output_var_names()#

Names of the output exchange items.

get_start_time()#

Start time of the component.

get_time_step()#

Component time step.

get_time_units()#

Time units used by the component.

get_value(name, dest)#

Get a copy of a variable’s data.

get_value_at_indices(name, dest, inds)#

Get values at particular indices.

Parameters:
  • name (str) – An input or output variable name, a CSDMS Standard Name.

  • dest (ndarray) – A numpy array into which to place the values.

  • inds (array_like) – The indices into the variable array.

Returns:

Value of the model variable at the given location.

Return type:

array_like

get_value_ptr(name)#

Get a reference to values of the given variable.

This is a getter for the model, used to access the model’s current state. It returns a reference to a model variable, with the return type, size and rank dependent on the variable.

Parameters:

name (str) – An input or output variable name, a CSDMS Standard Name.

Returns:

A reference to a model variable.

Return type:

array_like

get_value_ref(name)#

Get a reference to a variable’s data.

get_var_grid(name)#

Get the grid id for a variable.

get_var_itemsize(name)#

Get the size of elements of a variable.

get_var_location(name)#

Get the grid element type that the a given variable is defined on.

The grid topology can be composed of nodes, edges, and faces.

node

A point that has a coordinate pair or triplet: the most basic element of the topology.

edge

A line or curve bounded by two nodes.

face

A plane or surface enclosed by a set of edges. In a 2D horizontal application one may consider the word “polygon”, but in the hierarchy of elements the word “face” is most common.

Parameters:

name (str) – An input or output variable name, a CSDMS Standard Name.

Returns:

The grid location on which the variable is defined. Must be one of “node”, “edge”, or “face”.

Return type:

str

Notes

CSDMS uses the ugrid conventions to define unstructured grids.

get_var_nbytes(name)#

Get the total number of bytes used by a variable.

get_var_type(name)#

Get the data type for a variable.

get_var_units(name)#

Get the unit used by a variable.

initialize(config_file)#

Initialize the component from a file.

BMI-wrapped Landlab components use input files in YAML format. Component-specific parameters are listed at the top level, followed by grid and then time information. An example input file looks like:

flexure:
    eet: 15.e+3
clock:
    start: 0
    stop: 100.
    step: 2.
grid:
    type: raster
    shape: [20, 40]
    spacing: [1000., 2000.]

In this case, a RasterModelGrid is created (with the given shape and spacing) and passed to the underlying landlab component. The eet=15000. is also given to the component but as a keyword parameter. The BMI clock is initialized with the given parameters.

Parameters:

config_file (str or file_like) – YAML-formatted input file for the component.

set_value(name, values)#

Set the values of a variable.

set_value_at_indices(name, inds, src)#

Specify a new value for a model variable at particular indices.

Parameters:
  • name (str) – An input or output variable name, a CSDMS Standard Name.

  • inds (array_like) – The indices into the variable array.

  • src (array_like) – The new value for the specified variable.

update()#

Update the component one time step.

update_frac(frac)#

Update the component a fraction of a time step.

update_until(then)#

Update the component until a given time.

class SinkFillerBMI#

Bases: Bmi

Basic Modeling Interface for the SinkFiller component.

finalize()#

Clean-up the component.

get_component_name()#

Name of the component.

get_current_time()#

Current component time.

get_end_time()#

Stop time for the component.

get_grid_edge_count(grid)#

Get the number of edges in the grid.

Parameters:

grid (int) – A grid identifier.

Returns:

The total number of grid edges.

Return type:

int

get_grid_edge_nodes(grid, edge_nodes)#

Get the edge-node connectivity.

Parameters:
  • grid (int) – A grid identifier.

  • edge_nodes (ndarray of int, shape (2 x nnodes,)) – A numpy array to place the edge-node connectivity. For each edge, connectivity is given as node at edge tail, followed by node at edge head.

Returns:

The input numpy array that holds the edge-node connectivity.

Return type:

ndarray of int

get_grid_face_count(grid)#

Get the number of faces in the grid.

Parameters:

grid (int) – A grid identifier.

Returns:

The total number of grid faces.

Return type:

int

get_grid_face_edges(grid)#

Get the face-edge connectivity.

Parameters:
  • grid (int) – A grid identifier.

  • face_edges (ndarray of int) – A numpy array to place the face-edge connectivity.

Returns:

The input numpy array that holds the face-edge connectivity.

Return type:

ndarray of int

get_grid_face_nodes(grid, face_nodes)#

Get the face-node connectivity.

Parameters:
  • grid (int) – A grid identifier.

  • face_nodes (ndarray of int) – A numpy array to place the face-node connectivity. For each face, the nodes (listed in a counter-clockwise direction) that form the boundary of the face.

Returns:

The input numpy array that holds the face-node connectivity.

Return type:

ndarray of int

get_grid_node_count(grid)#

Get the number of nodes in the grid.

Parameters:

grid (int) – A grid identifier.

Returns:

The total number of grid nodes.

Return type:

int

get_grid_nodes_per_face(grid, nodes_per_face)#

Get the number of nodes for each face.

Parameters:
  • grid (int) – A grid identifier.

  • nodes_per_face (ndarray of int, shape (nfaces,)) – A numpy array to place the number of nodes per face.

Returns:

The input numpy array that holds the number of nodes per face.

Return type:

ndarray of int

get_grid_origin(grid, origin)#

Get the origin for a structured grid.

get_grid_rank(grid)#

Get the number of dimensions of a grid.

get_grid_shape(grid, shape)#

Get the shape of a structured grid.

get_grid_size(grid)#

Get the total number of elements in the computational grid.

Parameters:

grid (int) – A grid identifier.

Returns:

Size of the grid.

Return type:

int

get_grid_spacing(grid, spacing)#

Get the row and column spacing of a structured grid.

get_grid_type(grid)#

Get the type of grid.

get_grid_x(grid, x)#

Get coordinates of grid nodes in the x direction.

Parameters:
  • grid (int) – A grid identifier.

  • x (ndarray of float, shape (nrows,)) – A numpy array to hold the x-coordinates of the grid node columns.

Returns:

The input numpy array that holds the grid’s column x-coordinates.

Return type:

ndarray of float

get_grid_y(grid, y)#

Get coordinates of grid nodes in the y direction.

Parameters:
  • grid (int) – A grid identifier.

  • y (ndarray of float, shape (ncols,)) – A numpy array to hold the y-coordinates of the grid node rows.

Returns:

The input numpy array that holds the grid’s row y-coordinates.

Return type:

ndarray of float

get_grid_z(grid, z)#

Get coordinates of grid nodes in the z direction.

Parameters:
  • grid (int) – A grid identifier.

  • z (ndarray of float, shape (nlayers,)) – A numpy array to hold the z-coordinates of the grid nodes layers.

Returns:

The input numpy array that holds the grid’s layer z-coordinates.

Return type:

ndarray of float

get_input_item_count()#

Count of a model’s input variables.

Returns:

The number of input variables.

Return type:

int

get_input_var_names()#

Names of the input exchange items.

get_output_item_count()#

Count of a model’s output variables.

Returns:

The number of output variables.

Return type:

int

get_output_var_names()#

Names of the output exchange items.

get_start_time()#

Start time of the component.

get_time_step()#

Component time step.

get_time_units()#

Time units used by the component.

get_value(name, dest)#

Get a copy of a variable’s data.

get_value_at_indices(name, dest, inds)#

Get values at particular indices.

Parameters:
  • name (str) – An input or output variable name, a CSDMS Standard Name.

  • dest (ndarray) – A numpy array into which to place the values.

  • inds (array_like) – The indices into the variable array.

Returns:

Value of the model variable at the given location.

Return type:

array_like

get_value_ptr(name)#

Get a reference to values of the given variable.

This is a getter for the model, used to access the model’s current state. It returns a reference to a model variable, with the return type, size and rank dependent on the variable.

Parameters:

name (str) – An input or output variable name, a CSDMS Standard Name.

Returns:

A reference to a model variable.

Return type:

array_like

get_value_ref(name)#

Get a reference to a variable’s data.

get_var_grid(name)#

Get the grid id for a variable.

get_var_itemsize(name)#

Get the size of elements of a variable.

get_var_location(name)#

Get the grid element type that the a given variable is defined on.

The grid topology can be composed of nodes, edges, and faces.

node

A point that has a coordinate pair or triplet: the most basic element of the topology.

edge

A line or curve bounded by two nodes.

face

A plane or surface enclosed by a set of edges. In a 2D horizontal application one may consider the word “polygon”, but in the hierarchy of elements the word “face” is most common.

Parameters:

name (str) – An input or output variable name, a CSDMS Standard Name.

Returns:

The grid location on which the variable is defined. Must be one of “node”, “edge”, or “face”.

Return type:

str

Notes

CSDMS uses the ugrid conventions to define unstructured grids.

get_var_nbytes(name)#

Get the total number of bytes used by a variable.

get_var_type(name)#

Get the data type for a variable.

get_var_units(name)#

Get the unit used by a variable.

initialize(config_file)#

Initialize the component from a file.

BMI-wrapped Landlab components use input files in YAML format. Component-specific parameters are listed at the top level, followed by grid and then time information. An example input file looks like:

flexure:
    eet: 15.e+3
clock:
    start: 0
    stop: 100.
    step: 2.
grid:
    type: raster
    shape: [20, 40]
    spacing: [1000., 2000.]

In this case, a RasterModelGrid is created (with the given shape and spacing) and passed to the underlying landlab component. The eet=15000. is also given to the component but as a keyword parameter. The BMI clock is initialized with the given parameters.

Parameters:

config_file (str or file_like) – YAML-formatted input file for the component.

set_value(name, values)#

Set the values of a variable.

set_value_at_indices(name, inds, src)#

Specify a new value for a model variable at particular indices.

Parameters:
  • name (str) – An input or output variable name, a CSDMS Standard Name.

  • inds (array_like) – The indices into the variable array.

  • src (array_like) – The new value for the specified variable.

update()#

Update the component one time step.

update_frac(frac)#

Update the component a fraction of a time step.

update_until(then)#

Update the component until a given time.

class SinkFillerBarnesBMI#

Bases: Bmi

Basic Modeling Interface for the SinkFillerBarnes component.

finalize()#

Clean-up the component.

get_component_name()#

Name of the component.

get_current_time()#

Current component time.

get_end_time()#

Stop time for the component.

get_grid_edge_count(grid)#

Get the number of edges in the grid.

Parameters:

grid (int) – A grid identifier.

Returns:

The total number of grid edges.

Return type:

int

get_grid_edge_nodes(grid, edge_nodes)#

Get the edge-node connectivity.

Parameters:
  • grid (int) – A grid identifier.

  • edge_nodes (ndarray of int, shape (2 x nnodes,)) – A numpy array to place the edge-node connectivity. For each edge, connectivity is given as node at edge tail, followed by node at edge head.

Returns:

The input numpy array that holds the edge-node connectivity.

Return type:

ndarray of int

get_grid_face_count(grid)#

Get the number of faces in the grid.

Parameters:

grid (int) – A grid identifier.

Returns:

The total number of grid faces.

Return type:

int

get_grid_face_edges(grid)#

Get the face-edge connectivity.

Parameters:
  • grid (int) – A grid identifier.

  • face_edges (ndarray of int) – A numpy array to place the face-edge connectivity.

Returns:

The input numpy array that holds the face-edge connectivity.

Return type:

ndarray of int

get_grid_face_nodes(grid, face_nodes)#

Get the face-node connectivity.

Parameters:
  • grid (int) – A grid identifier.

  • face_nodes (ndarray of int) – A numpy array to place the face-node connectivity. For each face, the nodes (listed in a counter-clockwise direction) that form the boundary of the face.

Returns:

The input numpy array that holds the face-node connectivity.

Return type:

ndarray of int

get_grid_node_count(grid)#

Get the number of nodes in the grid.

Parameters:

grid (int) – A grid identifier.

Returns:

The total number of grid nodes.

Return type:

int

get_grid_nodes_per_face(grid, nodes_per_face)#

Get the number of nodes for each face.

Parameters:
  • grid (int) – A grid identifier.

  • nodes_per_face (ndarray of int, shape (nfaces,)) – A numpy array to place the number of nodes per face.

Returns:

The input numpy array that holds the number of nodes per face.

Return type:

ndarray of int

get_grid_origin(grid, origin)#

Get the origin for a structured grid.

get_grid_rank(grid)#

Get the number of dimensions of a grid.

get_grid_shape(grid, shape)#

Get the shape of a structured grid.

get_grid_size(grid)#

Get the total number of elements in the computational grid.

Parameters:

grid (int) – A grid identifier.

Returns:

Size of the grid.

Return type:

int

get_grid_spacing(grid, spacing)#

Get the row and column spacing of a structured grid.

get_grid_type(grid)#

Get the type of grid.

get_grid_x(grid, x)#

Get coordinates of grid nodes in the x direction.

Parameters:
  • grid (int) – A grid identifier.

  • x (ndarray of float, shape (nrows,)) – A numpy array to hold the x-coordinates of the grid node columns.

Returns:

The input numpy array that holds the grid’s column x-coordinates.

Return type:

ndarray of float

get_grid_y(grid, y)#

Get coordinates of grid nodes in the y direction.

Parameters:
  • grid (int) – A grid identifier.

  • y (ndarray of float, shape (ncols,)) – A numpy array to hold the y-coordinates of the grid node rows.

Returns:

The input numpy array that holds the grid’s row y-coordinates.

Return type:

ndarray of float

get_grid_z(grid, z)#

Get coordinates of grid nodes in the z direction.

Parameters:
  • grid (int) – A grid identifier.

  • z (ndarray of float, shape (nlayers,)) – A numpy array to hold the z-coordinates of the grid nodes layers.

Returns:

The input numpy array that holds the grid’s layer z-coordinates.

Return type:

ndarray of float

get_input_item_count()#

Count of a model’s input variables.

Returns:

The number of input variables.

Return type:

int

get_input_var_names()#

Names of the input exchange items.

get_output_item_count()#

Count of a model’s output variables.

Returns:

The number of output variables.

Return type:

int

get_output_var_names()#

Names of the output exchange items.

get_start_time()#

Start time of the component.

get_time_step()#

Component time step.

get_time_units()#

Time units used by the component.

get_value(name, dest)#

Get a copy of a variable’s data.

get_value_at_indices(name, dest, inds)#

Get values at particular indices.

Parameters:
  • name (str) – An input or output variable name, a CSDMS Standard Name.

  • dest (ndarray) – A numpy array into which to place the values.

  • inds (array_like) – The indices into the variable array.

Returns:

Value of the model variable at the given location.

Return type:

array_like

get_value_ptr(name)#

Get a reference to values of the given variable.

This is a getter for the model, used to access the model’s current state. It returns a reference to a model variable, with the return type, size and rank dependent on the variable.

Parameters:

name (str) – An input or output variable name, a CSDMS Standard Name.

Returns:

A reference to a model variable.

Return type:

array_like

get_value_ref(name)#

Get a reference to a variable’s data.

get_var_grid(name)#

Get the grid id for a variable.

get_var_itemsize(name)#

Get the size of elements of a variable.

get_var_location(name)#

Get the grid element type that the a given variable is defined on.

The grid topology can be composed of nodes, edges, and faces.

node

A point that has a coordinate pair or triplet: the most basic element of the topology.

edge

A line or curve bounded by two nodes.

face

A plane or surface enclosed by a set of edges. In a 2D horizontal application one may consider the word “polygon”, but in the hierarchy of elements the word “face” is most common.

Parameters:

name (str) – An input or output variable name, a CSDMS Standard Name.

Returns:

The grid location on which the variable is defined. Must be one of “node”, “edge”, or “face”.

Return type:

str

Notes

CSDMS uses the ugrid conventions to define unstructured grids.

get_var_nbytes(name)#

Get the total number of bytes used by a variable.

get_var_type(name)#

Get the data type for a variable.

get_var_units(name)#

Get the unit used by a variable.

initialize(config_file)#

Initialize the component from a file.

BMI-wrapped Landlab components use input files in YAML format. Component-specific parameters are listed at the top level, followed by grid and then time information. An example input file looks like:

flexure:
    eet: 15.e+3
clock:
    start: 0
    stop: 100.
    step: 2.
grid:
    type: raster
    shape: [20, 40]
    spacing: [1000., 2000.]

In this case, a RasterModelGrid is created (with the given shape and spacing) and passed to the underlying landlab component. The eet=15000. is also given to the component but as a keyword parameter. The BMI clock is initialized with the given parameters.

Parameters:

config_file (str or file_like) – YAML-formatted input file for the component.

set_value(name, values)#

Set the values of a variable.

set_value_at_indices(name, inds, src)#

Specify a new value for a model variable at particular indices.

Parameters:
  • name (str) – An input or output variable name, a CSDMS Standard Name.

  • inds (array_like) – The indices into the variable array.

  • src (array_like) – The new value for the specified variable.

update()#

Update the component one time step.

update_frac(frac)#

Update the component a fraction of a time step.

update_until(then)#

Update the component until a given time.

class SoilInfiltrationGreenAmptBMI#

Bases: Bmi

Basic Modeling Interface for the SoilInfiltrationGreenAmpt component.

finalize()#

Clean-up the component.

get_component_name()#

Name of the component.

get_current_time()#

Current component time.

get_end_time()#

Stop time for the component.

get_grid_edge_count(grid)#

Get the number of edges in the grid.

Parameters:

grid (int) – A grid identifier.

Returns:

The total number of grid edges.

Return type:

int

get_grid_edge_nodes(grid, edge_nodes)#

Get the edge-node connectivity.

Parameters:
  • grid (int) – A grid identifier.

  • edge_nodes (ndarray of int, shape (2 x nnodes,)) – A numpy array to place the edge-node connectivity. For each edge, connectivity is given as node at edge tail, followed by node at edge head.

Returns:

The input numpy array that holds the edge-node connectivity.

Return type:

ndarray of int

get_grid_face_count(grid)#

Get the number of faces in the grid.

Parameters:

grid (int) – A grid identifier.

Returns:

The total number of grid faces.

Return type:

int

get_grid_face_edges(grid)#

Get the face-edge connectivity.

Parameters:
  • grid (int) – A grid identifier.

  • face_edges (ndarray of int) – A numpy array to place the face-edge connectivity.

Returns:

The input numpy array that holds the face-edge connectivity.

Return type:

ndarray of int

get_grid_face_nodes(grid, face_nodes)#

Get the face-node connectivity.

Parameters:
  • grid (int) – A grid identifier.

  • face_nodes (ndarray of int) – A numpy array to place the face-node connectivity. For each face, the nodes (listed in a counter-clockwise direction) that form the boundary of the face.

Returns:

The input numpy array that holds the face-node connectivity.

Return type:

ndarray of int

get_grid_node_count(grid)#

Get the number of nodes in the grid.

Parameters:

grid (int) – A grid identifier.

Returns:

The total number of grid nodes.

Return type:

int

get_grid_nodes_per_face(grid, nodes_per_face)#

Get the number of nodes for each face.

Parameters:
  • grid (int) – A grid identifier.

  • nodes_per_face (ndarray of int, shape (nfaces,)) – A numpy array to place the number of nodes per face.

Returns:

The input numpy array that holds the number of nodes per face.

Return type:

ndarray of int

get_grid_origin(grid, origin)#

Get the origin for a structured grid.

get_grid_rank(grid)#

Get the number of dimensions of a grid.

get_grid_shape(grid, shape)#

Get the shape of a structured grid.

get_grid_size(grid)#

Get the total number of elements in the computational grid.

Parameters:

grid (int) – A grid identifier.

Returns:

Size of the grid.

Return type:

int

get_grid_spacing(grid, spacing)#

Get the row and column spacing of a structured grid.

get_grid_type(grid)#

Get the type of grid.

get_grid_x(grid, x)#

Get coordinates of grid nodes in the x direction.

Parameters:
  • grid (int) – A grid identifier.

  • x (ndarray of float, shape (nrows,)) – A numpy array to hold the x-coordinates of the grid node columns.

Returns:

The input numpy array that holds the grid’s column x-coordinates.

Return type:

ndarray of float

get_grid_y(grid, y)#

Get coordinates of grid nodes in the y direction.

Parameters:
  • grid (int) – A grid identifier.

  • y (ndarray of float, shape (ncols,)) – A numpy array to hold the y-coordinates of the grid node rows.

Returns:

The input numpy array that holds the grid’s row y-coordinates.

Return type:

ndarray of float

get_grid_z(grid, z)#

Get coordinates of grid nodes in the z direction.

Parameters:
  • grid (int) – A grid identifier.

  • z (ndarray of float, shape (nlayers,)) – A numpy array to hold the z-coordinates of the grid nodes layers.

Returns:

The input numpy array that holds the grid’s layer z-coordinates.

Return type:

ndarray of float

get_input_item_count()#

Count of a model’s input variables.

Returns:

The number of input variables.

Return type:

int

get_input_var_names()#

Names of the input exchange items.

get_output_item_count()#

Count of a model’s output variables.

Returns:

The number of output variables.

Return type:

int

get_output_var_names()#

Names of the output exchange items.

get_start_time()#

Start time of the component.

get_time_step()#

Component time step.

get_time_units()#

Time units used by the component.

get_value(name, dest)#

Get a copy of a variable’s data.

get_value_at_indices(name, dest, inds)#

Get values at particular indices.

Parameters:
  • name (str) – An input or output variable name, a CSDMS Standard Name.

  • dest (ndarray) – A numpy array into which to place the values.

  • inds (array_like) – The indices into the variable array.

Returns:

Value of the model variable at the given location.

Return type:

array_like

get_value_ptr(name)#

Get a reference to values of the given variable.

This is a getter for the model, used to access the model’s current state. It returns a reference to a model variable, with the return type, size and rank dependent on the variable.

Parameters:

name (str) – An input or output variable name, a CSDMS Standard Name.

Returns:

A reference to a model variable.

Return type:

array_like

get_value_ref(name)#

Get a reference to a variable’s data.

get_var_grid(name)#

Get the grid id for a variable.

get_var_itemsize(name)#

Get the size of elements of a variable.

get_var_location(name)#

Get the grid element type that the a given variable is defined on.

The grid topology can be composed of nodes, edges, and faces.

node

A point that has a coordinate pair or triplet: the most basic element of the topology.

edge

A line or curve bounded by two nodes.

face

A plane or surface enclosed by a set of edges. In a 2D horizontal application one may consider the word “polygon”, but in the hierarchy of elements the word “face” is most common.

Parameters:

name (str) – An input or output variable name, a CSDMS Standard Name.

Returns:

The grid location on which the variable is defined. Must be one of “node”, “edge”, or “face”.

Return type:

str

Notes

CSDMS uses the ugrid conventions to define unstructured grids.

get_var_nbytes(name)#

Get the total number of bytes used by a variable.

get_var_type(name)#

Get the data type for a variable.

get_var_units(name)#

Get the unit used by a variable.

initialize(config_file)#

Initialize the component from a file.

BMI-wrapped Landlab components use input files in YAML format. Component-specific parameters are listed at the top level, followed by grid and then time information. An example input file looks like:

flexure:
    eet: 15.e+3
clock:
    start: 0
    stop: 100.
    step: 2.
grid:
    type: raster
    shape: [20, 40]
    spacing: [1000., 2000.]

In this case, a RasterModelGrid is created (with the given shape and spacing) and passed to the underlying landlab component. The eet=15000. is also given to the component but as a keyword parameter. The BMI clock is initialized with the given parameters.

Parameters:

config_file (str or file_like) – YAML-formatted input file for the component.

set_value(name, values)#

Set the values of a variable.

set_value_at_indices(name, inds, src)#

Specify a new value for a model variable at particular indices.

Parameters:
  • name (str) – An input or output variable name, a CSDMS Standard Name.

  • inds (array_like) – The indices into the variable array.

  • src (array_like) – The new value for the specified variable.

update()#

Update the component one time step.

update_frac(frac)#

Update the component a fraction of a time step.

update_until(then)#

Update the component until a given time.

class SoilMoistureBMI#

Bases: Bmi

Basic Modeling Interface for the SoilMoisture component.

finalize()#

Clean-up the component.

get_component_name()#

Name of the component.

get_current_time()#

Current component time.

get_end_time()#

Stop time for the component.

get_grid_edge_count(grid)#

Get the number of edges in the grid.

Parameters:

grid (int) – A grid identifier.

Returns:

The total number of grid edges.

Return type:

int

get_grid_edge_nodes(grid, edge_nodes)#

Get the edge-node connectivity.

Parameters:
  • grid (int) – A grid identifier.

  • edge_nodes (ndarray of int, shape (2 x nnodes,)) – A numpy array to place the edge-node connectivity. For each edge, connectivity is given as node at edge tail, followed by node at edge head.

Returns:

The input numpy array that holds the edge-node connectivity.

Return type:

ndarray of int

get_grid_face_count(grid)#

Get the number of faces in the grid.

Parameters:

grid (int) – A grid identifier.

Returns:

The total number of grid faces.

Return type:

int

get_grid_face_edges(grid)#

Get the face-edge connectivity.

Parameters:
  • grid (int) – A grid identifier.

  • face_edges (ndarray of int) – A numpy array to place the face-edge connectivity.

Returns:

The input numpy array that holds the face-edge connectivity.

Return type:

ndarray of int

get_grid_face_nodes(grid, face_nodes)#

Get the face-node connectivity.

Parameters:
  • grid (int) – A grid identifier.

  • face_nodes (ndarray of int) – A numpy array to place the face-node connectivity. For each face, the nodes (listed in a counter-clockwise direction) that form the boundary of the face.

Returns:

The input numpy array that holds the face-node connectivity.

Return type:

ndarray of int

get_grid_node_count(grid)#

Get the number of nodes in the grid.

Parameters:

grid (int) – A grid identifier.

Returns:

The total number of grid nodes.

Return type:

int

get_grid_nodes_per_face(grid, nodes_per_face)#

Get the number of nodes for each face.

Parameters:
  • grid (int) – A grid identifier.

  • nodes_per_face (ndarray of int, shape (nfaces,)) – A numpy array to place the number of nodes per face.

Returns:

The input numpy array that holds the number of nodes per face.

Return type:

ndarray of int

get_grid_origin(grid, origin)#

Get the origin for a structured grid.

get_grid_rank(grid)#

Get the number of dimensions of a grid.

get_grid_shape(grid, shape)#

Get the shape of a structured grid.

get_grid_size(grid)#

Get the total number of elements in the computational grid.

Parameters:

grid (int) – A grid identifier.

Returns:

Size of the grid.

Return type:

int

get_grid_spacing(grid, spacing)#

Get the row and column spacing of a structured grid.

get_grid_type(grid)#

Get the type of grid.

get_grid_x(grid, x)#

Get coordinates of grid nodes in the x direction.

Parameters:
  • grid (int) – A grid identifier.

  • x (ndarray of float, shape (nrows,)) – A numpy array to hold the x-coordinates of the grid node columns.

Returns:

The input numpy array that holds the grid’s column x-coordinates.

Return type:

ndarray of float

get_grid_y(grid, y)#

Get coordinates of grid nodes in the y direction.

Parameters:
  • grid (int) – A grid identifier.

  • y (ndarray of float, shape (ncols,)) – A numpy array to hold the y-coordinates of the grid node rows.

Returns:

The input numpy array that holds the grid’s row y-coordinates.

Return type:

ndarray of float

get_grid_z(grid, z)#

Get coordinates of grid nodes in the z direction.

Parameters:
  • grid (int) – A grid identifier.

  • z (ndarray of float, shape (nlayers,)) – A numpy array to hold the z-coordinates of the grid nodes layers.

Returns:

The input numpy array that holds the grid’s layer z-coordinates.

Return type:

ndarray of float

get_input_item_count()#

Count of a model’s input variables.

Returns:

The number of input variables.

Return type:

int

get_input_var_names()#

Names of the input exchange items.

get_output_item_count()#

Count of a model’s output variables.

Returns:

The number of output variables.

Return type:

int

get_output_var_names()#

Names of the output exchange items.

get_start_time()#

Start time of the component.

get_time_step()#

Component time step.

get_time_units()#

Time units used by the component.

get_value(name, dest)#

Get a copy of a variable’s data.

get_value_at_indices(name, dest, inds)#

Get values at particular indices.

Parameters:
  • name (str) – An input or output variable name, a CSDMS Standard Name.

  • dest (ndarray) – A numpy array into which to place the values.

  • inds (array_like) – The indices into the variable array.

Returns:

Value of the model variable at the given location.

Return type:

array_like

get_value_ptr(name)#

Get a reference to values of the given variable.

This is a getter for the model, used to access the model’s current state. It returns a reference to a model variable, with the return type, size and rank dependent on the variable.

Parameters:

name (str) – An input or output variable name, a CSDMS Standard Name.

Returns:

A reference to a model variable.

Return type:

array_like

get_value_ref(name)#

Get a reference to a variable’s data.

get_var_grid(name)#

Get the grid id for a variable.

get_var_itemsize(name)#

Get the size of elements of a variable.

get_var_location(name)#

Get the grid element type that the a given variable is defined on.

The grid topology can be composed of nodes, edges, and faces.

node

A point that has a coordinate pair or triplet: the most basic element of the topology.

edge

A line or curve bounded by two nodes.

face

A plane or surface enclosed by a set of edges. In a 2D horizontal application one may consider the word “polygon”, but in the hierarchy of elements the word “face” is most common.

Parameters:

name (str) – An input or output variable name, a CSDMS Standard Name.

Returns:

The grid location on which the variable is defined. Must be one of “node”, “edge”, or “face”.

Return type:

str

Notes

CSDMS uses the ugrid conventions to define unstructured grids.

get_var_nbytes(name)#

Get the total number of bytes used by a variable.

get_var_type(name)#

Get the data type for a variable.

get_var_units(name)#

Get the unit used by a variable.

initialize(config_file)#

Initialize the component from a file.

BMI-wrapped Landlab components use input files in YAML format. Component-specific parameters are listed at the top level, followed by grid and then time information. An example input file looks like:

flexure:
    eet: 15.e+3
clock:
    start: 0
    stop: 100.
    step: 2.
grid:
    type: raster
    shape: [20, 40]
    spacing: [1000., 2000.]

In this case, a RasterModelGrid is created (with the given shape and spacing) and passed to the underlying landlab component. The eet=15000. is also given to the component but as a keyword parameter. The BMI clock is initialized with the given parameters.

Parameters:

config_file (str or file_like) – YAML-formatted input file for the component.

set_value(name, values)#

Set the values of a variable.

set_value_at_indices(name, inds, src)#

Specify a new value for a model variable at particular indices.

Parameters:
  • name (str) – An input or output variable name, a CSDMS Standard Name.

  • inds (array_like) – The indices into the variable array.

  • src (array_like) – The new value for the specified variable.

update()#

Update the component one time step.

update_frac(frac)#

Update the component a fraction of a time step.

update_until(then)#

Update the component until a given time.

class SpaceBMI#

Bases: Bmi

Basic Modeling Interface for the Space component.

finalize()#

Clean-up the component.

get_component_name()#

Name of the component.

get_current_time()#

Current component time.

get_end_time()#

Stop time for the component.

get_grid_edge_count(grid)#

Get the number of edges in the grid.

Parameters:

grid (int) – A grid identifier.

Returns:

The total number of grid edges.

Return type:

int

get_grid_edge_nodes(grid, edge_nodes)#

Get the edge-node connectivity.

Parameters:
  • grid (int) – A grid identifier.

  • edge_nodes (ndarray of int, shape (2 x nnodes,)) – A numpy array to place the edge-node connectivity. For each edge, connectivity is given as node at edge tail, followed by node at edge head.

Returns:

The input numpy array that holds the edge-node connectivity.

Return type:

ndarray of int

get_grid_face_count(grid)#

Get the number of faces in the grid.

Parameters:

grid (int) – A grid identifier.

Returns:

The total number of grid faces.

Return type:

int

get_grid_face_edges(grid)#

Get the face-edge connectivity.

Parameters:
  • grid (int) – A grid identifier.

  • face_edges (ndarray of int) – A numpy array to place the face-edge connectivity.

Returns:

The input numpy array that holds the face-edge connectivity.

Return type:

ndarray of int

get_grid_face_nodes(grid, face_nodes)#

Get the face-node connectivity.

Parameters:
  • grid (int) – A grid identifier.

  • face_nodes (ndarray of int) – A numpy array to place the face-node connectivity. For each face, the nodes (listed in a counter-clockwise direction) that form the boundary of the face.

Returns:

The input numpy array that holds the face-node connectivity.

Return type:

ndarray of int

get_grid_node_count(grid)#

Get the number of nodes in the grid.

Parameters:

grid (int) – A grid identifier.

Returns:

The total number of grid nodes.

Return type:

int

get_grid_nodes_per_face(grid, nodes_per_face)#

Get the number of nodes for each face.

Parameters:
  • grid (int) – A grid identifier.

  • nodes_per_face (ndarray of int, shape (nfaces,)) – A numpy array to place the number of nodes per face.

Returns:

The input numpy array that holds the number of nodes per face.

Return type:

ndarray of int

get_grid_origin(grid, origin)#

Get the origin for a structured grid.

get_grid_rank(grid)#

Get the number of dimensions of a grid.

get_grid_shape(grid, shape)#

Get the shape of a structured grid.

get_grid_size(grid)#

Get the total number of elements in the computational grid.

Parameters:

grid (int) – A grid identifier.

Returns:

Size of the grid.

Return type:

int

get_grid_spacing(grid, spacing)#

Get the row and column spacing of a structured grid.

get_grid_type(grid)#

Get the type of grid.

get_grid_x(grid, x)#

Get coordinates of grid nodes in the x direction.

Parameters:
  • grid (int) – A grid identifier.

  • x (ndarray of float, shape (nrows,)) – A numpy array to hold the x-coordinates of the grid node columns.

Returns:

The input numpy array that holds the grid’s column x-coordinates.

Return type:

ndarray of float

get_grid_y(grid, y)#

Get coordinates of grid nodes in the y direction.

Parameters:
  • grid (int) – A grid identifier.

  • y (ndarray of float, shape (ncols,)) – A numpy array to hold the y-coordinates of the grid node rows.

Returns:

The input numpy array that holds the grid’s row y-coordinates.

Return type:

ndarray of float

get_grid_z(grid, z)#

Get coordinates of grid nodes in the z direction.

Parameters:
  • grid (int) – A grid identifier.

  • z (ndarray of float, shape (nlayers,)) – A numpy array to hold the z-coordinates of the grid nodes layers.

Returns:

The input numpy array that holds the grid’s layer z-coordinates.

Return type:

ndarray of float

get_input_item_count()#

Count of a model’s input variables.

Returns:

The number of input variables.

Return type:

int

get_input_var_names()#

Names of the input exchange items.

get_output_item_count()#

Count of a model’s output variables.

Returns:

The number of output variables.

Return type:

int

get_output_var_names()#

Names of the output exchange items.

get_start_time()#

Start time of the component.

get_time_step()#

Component time step.

get_time_units()#

Time units used by the component.

get_value(name, dest)#

Get a copy of a variable’s data.

get_value_at_indices(name, dest, inds)#

Get values at particular indices.

Parameters:
  • name (str) – An input or output variable name, a CSDMS Standard Name.

  • dest (ndarray) – A numpy array into which to place the values.

  • inds (array_like) – The indices into the variable array.

Returns:

Value of the model variable at the given location.

Return type:

array_like

get_value_ptr(name)#

Get a reference to values of the given variable.

This is a getter for the model, used to access the model’s current state. It returns a reference to a model variable, with the return type, size and rank dependent on the variable.

Parameters:

name (str) – An input or output variable name, a CSDMS Standard Name.

Returns:

A reference to a model variable.

Return type:

array_like

get_value_ref(name)#

Get a reference to a variable’s data.

get_var_grid(name)#

Get the grid id for a variable.

get_var_itemsize(name)#

Get the size of elements of a variable.

get_var_location(name)#

Get the grid element type that the a given variable is defined on.

The grid topology can be composed of nodes, edges, and faces.

node

A point that has a coordinate pair or triplet: the most basic element of the topology.

edge

A line or curve bounded by two nodes.

face

A plane or surface enclosed by a set of edges. In a 2D horizontal application one may consider the word “polygon”, but in the hierarchy of elements the word “face” is most common.

Parameters:

name (str) – An input or output variable name, a CSDMS Standard Name.

Returns:

The grid location on which the variable is defined. Must be one of “node”, “edge”, or “face”.

Return type:

str

Notes

CSDMS uses the ugrid conventions to define unstructured grids.

get_var_nbytes(name)#

Get the total number of bytes used by a variable.

get_var_type(name)#

Get the data type for a variable.

get_var_units(name)#

Get the unit used by a variable.

initialize(config_file)#

Initialize the component from a file.

BMI-wrapped Landlab components use input files in YAML format. Component-specific parameters are listed at the top level, followed by grid and then time information. An example input file looks like:

flexure:
    eet: 15.e+3
clock:
    start: 0
    stop: 100.
    step: 2.
grid:
    type: raster
    shape: [20, 40]
    spacing: [1000., 2000.]

In this case, a RasterModelGrid is created (with the given shape and spacing) and passed to the underlying landlab component. The eet=15000. is also given to the component but as a keyword parameter. The BMI clock is initialized with the given parameters.

Parameters:

config_file (str or file_like) – YAML-formatted input file for the component.

set_value(name, values)#

Set the values of a variable.

set_value_at_indices(name, inds, src)#

Specify a new value for a model variable at particular indices.

Parameters:
  • name (str) – An input or output variable name, a CSDMS Standard Name.

  • inds (array_like) – The indices into the variable array.

  • src (array_like) – The new value for the specified variable.

update()#

Update the component one time step.

update_frac(frac)#

Update the component a fraction of a time step.

update_until(then)#

Update the component until a given time.

class SpaceLargeScaleEroderBMI#

Bases: Bmi

Basic Modeling Interface for the SpaceLargeScaleEroder component.

finalize()#

Clean-up the component.

get_component_name()#

Name of the component.

get_current_time()#

Current component time.

get_end_time()#

Stop time for the component.

get_grid_edge_count(grid)#

Get the number of edges in the grid.

Parameters:

grid (int) – A grid identifier.

Returns:

The total number of grid edges.

Return type:

int

get_grid_edge_nodes(grid, edge_nodes)#

Get the edge-node connectivity.

Parameters:
  • grid (int) – A grid identifier.

  • edge_nodes (ndarray of int, shape (2 x nnodes,)) – A numpy array to place the edge-node connectivity. For each edge, connectivity is given as node at edge tail, followed by node at edge head.

Returns:

The input numpy array that holds the edge-node connectivity.

Return type:

ndarray of int

get_grid_face_count(grid)#

Get the number of faces in the grid.

Parameters:

grid (int) – A grid identifier.

Returns:

The total number of grid faces.

Return type:

int

get_grid_face_edges(grid)#

Get the face-edge connectivity.

Parameters:
  • grid (int) – A grid identifier.

  • face_edges (ndarray of int) – A numpy array to place the face-edge connectivity.

Returns:

The input numpy array that holds the face-edge connectivity.

Return type:

ndarray of int

get_grid_face_nodes(grid, face_nodes)#

Get the face-node connectivity.

Parameters:
  • grid (int) – A grid identifier.

  • face_nodes (ndarray of int) – A numpy array to place the face-node connectivity. For each face, the nodes (listed in a counter-clockwise direction) that form the boundary of the face.

Returns:

The input numpy array that holds the face-node connectivity.

Return type:

ndarray of int

get_grid_node_count(grid)#

Get the number of nodes in the grid.

Parameters:

grid (int) – A grid identifier.

Returns:

The total number of grid nodes.

Return type:

int

get_grid_nodes_per_face(grid, nodes_per_face)#

Get the number of nodes for each face.

Parameters:
  • grid (int) – A grid identifier.

  • nodes_per_face (ndarray of int, shape (nfaces,)) – A numpy array to place the number of nodes per face.

Returns:

The input numpy array that holds the number of nodes per face.

Return type:

ndarray of int

get_grid_origin(grid, origin)#

Get the origin for a structured grid.

get_grid_rank(grid)#

Get the number of dimensions of a grid.

get_grid_shape(grid, shape)#

Get the shape of a structured grid.

get_grid_size(grid)#

Get the total number of elements in the computational grid.

Parameters:

grid (int) – A grid identifier.

Returns:

Size of the grid.

Return type:

int

get_grid_spacing(grid, spacing)#

Get the row and column spacing of a structured grid.

get_grid_type(grid)#

Get the type of grid.

get_grid_x(grid, x)#

Get coordinates of grid nodes in the x direction.

Parameters:
  • grid (int) – A grid identifier.

  • x (ndarray of float, shape (nrows,)) – A numpy array to hold the x-coordinates of the grid node columns.

Returns:

The input numpy array that holds the grid’s column x-coordinates.

Return type:

ndarray of float

get_grid_y(grid, y)#

Get coordinates of grid nodes in the y direction.

Parameters:
  • grid (int) – A grid identifier.

  • y (ndarray of float, shape (ncols,)) – A numpy array to hold the y-coordinates of the grid node rows.

Returns:

The input numpy array that holds the grid’s row y-coordinates.

Return type:

ndarray of float

get_grid_z(grid, z)#

Get coordinates of grid nodes in the z direction.

Parameters:
  • grid (int) – A grid identifier.

  • z (ndarray of float, shape (nlayers,)) – A numpy array to hold the z-coordinates of the grid nodes layers.

Returns:

The input numpy array that holds the grid’s layer z-coordinates.

Return type:

ndarray of float

get_input_item_count()#

Count of a model’s input variables.

Returns:

The number of input variables.

Return type:

int

get_input_var_names()#

Names of the input exchange items.

get_output_item_count()#

Count of a model’s output variables.

Returns:

The number of output variables.

Return type:

int

get_output_var_names()#

Names of the output exchange items.

get_start_time()#

Start time of the component.

get_time_step()#

Component time step.

get_time_units()#

Time units used by the component.

get_value(name, dest)#

Get a copy of a variable’s data.

get_value_at_indices(name, dest, inds)#

Get values at particular indices.

Parameters:
  • name (str) – An input or output variable name, a CSDMS Standard Name.

  • dest (ndarray) – A numpy array into which to place the values.

  • inds (array_like) – The indices into the variable array.

Returns:

Value of the model variable at the given location.

Return type:

array_like

get_value_ptr(name)#

Get a reference to values of the given variable.

This is a getter for the model, used to access the model’s current state. It returns a reference to a model variable, with the return type, size and rank dependent on the variable.

Parameters:

name (str) – An input or output variable name, a CSDMS Standard Name.

Returns:

A reference to a model variable.

Return type:

array_like

get_value_ref(name)#

Get a reference to a variable’s data.

get_var_grid(name)#

Get the grid id for a variable.

get_var_itemsize(name)#

Get the size of elements of a variable.

get_var_location(name)#

Get the grid element type that the a given variable is defined on.

The grid topology can be composed of nodes, edges, and faces.

node

A point that has a coordinate pair or triplet: the most basic element of the topology.

edge

A line or curve bounded by two nodes.

face

A plane or surface enclosed by a set of edges. In a 2D horizontal application one may consider the word “polygon”, but in the hierarchy of elements the word “face” is most common.

Parameters:

name (str) – An input or output variable name, a CSDMS Standard Name.

Returns:

The grid location on which the variable is defined. Must be one of “node”, “edge”, or “face”.

Return type:

str

Notes

CSDMS uses the ugrid conventions to define unstructured grids.

get_var_nbytes(name)#

Get the total number of bytes used by a variable.

get_var_type(name)#

Get the data type for a variable.

get_var_units(name)#

Get the unit used by a variable.

initialize(config_file)#

Initialize the component from a file.

BMI-wrapped Landlab components use input files in YAML format. Component-specific parameters are listed at the top level, followed by grid and then time information. An example input file looks like:

flexure:
    eet: 15.e+3
clock:
    start: 0
    stop: 100.
    step: 2.
grid:
    type: raster
    shape: [20, 40]
    spacing: [1000., 2000.]

In this case, a RasterModelGrid is created (with the given shape and spacing) and passed to the underlying landlab component. The eet=15000. is also given to the component but as a keyword parameter. The BMI clock is initialized with the given parameters.

Parameters:

config_file (str or file_like) – YAML-formatted input file for the component.

set_value(name, values)#

Set the values of a variable.

set_value_at_indices(name, inds, src)#

Specify a new value for a model variable at particular indices.

Parameters:
  • name (str) – An input or output variable name, a CSDMS Standard Name.

  • inds (array_like) – The indices into the variable array.

  • src (array_like) – The new value for the specified variable.

update()#

Update the component one time step.

update_frac(frac)#

Update the component a fraction of a time step.

update_until(then)#

Update the component until a given time.

class SpatialPrecipitationDistributionBMI#

Bases: Bmi

Basic Modeling Interface for the SpatialPrecipitationDistribution component.

finalize()#

Clean-up the component.

get_component_name()#

Name of the component.

get_current_time()#

Current component time.

get_end_time()#

Stop time for the component.

get_grid_edge_count(grid)#

Get the number of edges in the grid.

Parameters:

grid (int) – A grid identifier.

Returns:

The total number of grid edges.

Return type:

int

get_grid_edge_nodes(grid, edge_nodes)#

Get the edge-node connectivity.

Parameters:
  • grid (int) – A grid identifier.

  • edge_nodes (ndarray of int, shape (2 x nnodes,)) – A numpy array to place the edge-node connectivity. For each edge, connectivity is given as node at edge tail, followed by node at edge head.

Returns:

The input numpy array that holds the edge-node connectivity.

Return type:

ndarray of int

get_grid_face_count(grid)#

Get the number of faces in the grid.

Parameters:

grid (int) – A grid identifier.

Returns:

The total number of grid faces.

Return type:

int

get_grid_face_edges(grid)#

Get the face-edge connectivity.

Parameters:
  • grid (int) – A grid identifier.

  • face_edges (ndarray of int) – A numpy array to place the face-edge connectivity.

Returns:

The input numpy array that holds the face-edge connectivity.

Return type:

ndarray of int

get_grid_face_nodes(grid, face_nodes)#

Get the face-node connectivity.

Parameters:
  • grid (int) – A grid identifier.

  • face_nodes (ndarray of int) – A numpy array to place the face-node connectivity. For each face, the nodes (listed in a counter-clockwise direction) that form the boundary of the face.

Returns:

The input numpy array that holds the face-node connectivity.

Return type:

ndarray of int

get_grid_node_count(grid)#

Get the number of nodes in the grid.

Parameters:

grid (int) – A grid identifier.

Returns:

The total number of grid nodes.

Return type:

int

get_grid_nodes_per_face(grid, nodes_per_face)#

Get the number of nodes for each face.

Parameters:
  • grid (int) – A grid identifier.

  • nodes_per_face (ndarray of int, shape (nfaces,)) – A numpy array to place the number of nodes per face.

Returns:

The input numpy array that holds the number of nodes per face.

Return type:

ndarray of int

get_grid_origin(grid, origin)#

Get the origin for a structured grid.

get_grid_rank(grid)#

Get the number of dimensions of a grid.

get_grid_shape(grid, shape)#

Get the shape of a structured grid.

get_grid_size(grid)#

Get the total number of elements in the computational grid.

Parameters:

grid (int) – A grid identifier.

Returns:

Size of the grid.

Return type:

int

get_grid_spacing(grid, spacing)#

Get the row and column spacing of a structured grid.

get_grid_type(grid)#

Get the type of grid.

get_grid_x(grid, x)#

Get coordinates of grid nodes in the x direction.

Parameters:
  • grid (int) – A grid identifier.

  • x (ndarray of float, shape (nrows,)) – A numpy array to hold the x-coordinates of the grid node columns.

Returns:

The input numpy array that holds the grid’s column x-coordinates.

Return type:

ndarray of float

get_grid_y(grid, y)#

Get coordinates of grid nodes in the y direction.

Parameters:
  • grid (int) – A grid identifier.

  • y (ndarray of float, shape (ncols,)) – A numpy array to hold the y-coordinates of the grid node rows.

Returns:

The input numpy array that holds the grid’s row y-coordinates.

Return type:

ndarray of float

get_grid_z(grid, z)#

Get coordinates of grid nodes in the z direction.

Parameters:
  • grid (int) – A grid identifier.

  • z (ndarray of float, shape (nlayers,)) – A numpy array to hold the z-coordinates of the grid nodes layers.

Returns:

The input numpy array that holds the grid’s layer z-coordinates.

Return type:

ndarray of float

get_input_item_count()#

Count of a model’s input variables.

Returns:

The number of input variables.

Return type:

int

get_input_var_names()#

Names of the input exchange items.

get_output_item_count()#

Count of a model’s output variables.

Returns:

The number of output variables.

Return type:

int

get_output_var_names()#

Names of the output exchange items.

get_start_time()#

Start time of the component.

get_time_step()#

Component time step.

get_time_units()#

Time units used by the component.

get_value(name, dest)#

Get a copy of a variable’s data.

get_value_at_indices(name, dest, inds)#

Get values at particular indices.

Parameters:
  • name (str) – An input or output variable name, a CSDMS Standard Name.

  • dest (ndarray) – A numpy array into which to place the values.

  • inds (array_like) – The indices into the variable array.

Returns:

Value of the model variable at the given location.

Return type:

array_like

get_value_ptr(name)#

Get a reference to values of the given variable.

This is a getter for the model, used to access the model’s current state. It returns a reference to a model variable, with the return type, size and rank dependent on the variable.

Parameters:

name (str) – An input or output variable name, a CSDMS Standard Name.

Returns:

A reference to a model variable.

Return type:

array_like

get_value_ref(name)#

Get a reference to a variable’s data.

get_var_grid(name)#

Get the grid id for a variable.

get_var_itemsize(name)#

Get the size of elements of a variable.

get_var_location(name)#

Get the grid element type that the a given variable is defined on.

The grid topology can be composed of nodes, edges, and faces.

node

A point that has a coordinate pair or triplet: the most basic element of the topology.

edge

A line or curve bounded by two nodes.

face

A plane or surface enclosed by a set of edges. In a 2D horizontal application one may consider the word “polygon”, but in the hierarchy of elements the word “face” is most common.

Parameters:

name (str) – An input or output variable name, a CSDMS Standard Name.

Returns:

The grid location on which the variable is defined. Must be one of “node”, “edge”, or “face”.

Return type:

str

Notes

CSDMS uses the ugrid conventions to define unstructured grids.

get_var_nbytes(name)#

Get the total number of bytes used by a variable.

get_var_type(name)#

Get the data type for a variable.

get_var_units(name)#

Get the unit used by a variable.

initialize(config_file)#

Initialize the component from a file.

BMI-wrapped Landlab components use input files in YAML format. Component-specific parameters are listed at the top level, followed by grid and then time information. An example input file looks like:

flexure:
    eet: 15.e+3
clock:
    start: 0
    stop: 100.
    step: 2.
grid:
    type: raster
    shape: [20, 40]
    spacing: [1000., 2000.]

In this case, a RasterModelGrid is created (with the given shape and spacing) and passed to the underlying landlab component. The eet=15000. is also given to the component but as a keyword parameter. The BMI clock is initialized with the given parameters.

Parameters:

config_file (str or file_like) – YAML-formatted input file for the component.

set_value(name, values)#

Set the values of a variable.

set_value_at_indices(name, inds, src)#

Specify a new value for a model variable at particular indices.

Parameters:
  • name (str) – An input or output variable name, a CSDMS Standard Name.

  • inds (array_like) – The indices into the variable array.

  • src (array_like) – The new value for the specified variable.

update()#

Update the component one time step.

update_frac(frac)#

Update the component a fraction of a time step.

update_until(then)#

Update the component until a given time.

class SpeciesEvolverBMI#

Bases: Bmi

Basic Modeling Interface for the SpeciesEvolver component.

finalize()#

Clean-up the component.

get_component_name()#

Name of the component.

get_current_time()#

Current component time.

get_end_time()#

Stop time for the component.

get_grid_edge_count(grid)#

Get the number of edges in the grid.

Parameters:

grid (int) – A grid identifier.

Returns:

The total number of grid edges.

Return type:

int

get_grid_edge_nodes(grid, edge_nodes)#

Get the edge-node connectivity.

Parameters:
  • grid (int) – A grid identifier.

  • edge_nodes (ndarray of int, shape (2 x nnodes,)) – A numpy array to place the edge-node connectivity. For each edge, connectivity is given as node at edge tail, followed by node at edge head.

Returns:

The input numpy array that holds the edge-node connectivity.

Return type:

ndarray of int

get_grid_face_count(grid)#

Get the number of faces in the grid.

Parameters:

grid (int) – A grid identifier.

Returns:

The total number of grid faces.

Return type:

int

get_grid_face_edges(grid)#

Get the face-edge connectivity.

Parameters:
  • grid (int) – A grid identifier.

  • face_edges (ndarray of int) – A numpy array to place the face-edge connectivity.

Returns:

The input numpy array that holds the face-edge connectivity.

Return type:

ndarray of int

get_grid_face_nodes(grid, face_nodes)#

Get the face-node connectivity.

Parameters:
  • grid (int) – A grid identifier.

  • face_nodes (ndarray of int) – A numpy array to place the face-node connectivity. For each face, the nodes (listed in a counter-clockwise direction) that form the boundary of the face.

Returns:

The input numpy array that holds the face-node connectivity.

Return type:

ndarray of int

get_grid_node_count(grid)#

Get the number of nodes in the grid.

Parameters:

grid (int) – A grid identifier.

Returns:

The total number of grid nodes.

Return type:

int

get_grid_nodes_per_face(grid, nodes_per_face)#

Get the number of nodes for each face.

Parameters:
  • grid (int) – A grid identifier.

  • nodes_per_face (ndarray of int, shape (nfaces,)) – A numpy array to place the number of nodes per face.

Returns:

The input numpy array that holds the number of nodes per face.

Return type:

ndarray of int

get_grid_origin(grid, origin)#

Get the origin for a structured grid.

get_grid_rank(grid)#

Get the number of dimensions of a grid.

get_grid_shape(grid, shape)#

Get the shape of a structured grid.

get_grid_size(grid)#

Get the total number of elements in the computational grid.

Parameters:

grid (int) – A grid identifier.

Returns:

Size of the grid.

Return type:

int

get_grid_spacing(grid, spacing)#

Get the row and column spacing of a structured grid.

get_grid_type(grid)#

Get the type of grid.

get_grid_x(grid, x)#

Get coordinates of grid nodes in the x direction.

Parameters:
  • grid (int) – A grid identifier.

  • x (ndarray of float, shape (nrows,)) – A numpy array to hold the x-coordinates of the grid node columns.

Returns:

The input numpy array that holds the grid’s column x-coordinates.

Return type:

ndarray of float

get_grid_y(grid, y)#

Get coordinates of grid nodes in the y direction.

Parameters:
  • grid (int) – A grid identifier.

  • y (ndarray of float, shape (ncols,)) – A numpy array to hold the y-coordinates of the grid node rows.

Returns:

The input numpy array that holds the grid’s row y-coordinates.

Return type:

ndarray of float

get_grid_z(grid, z)#

Get coordinates of grid nodes in the z direction.

Parameters:
  • grid (int) – A grid identifier.

  • z (ndarray of float, shape (nlayers,)) – A numpy array to hold the z-coordinates of the grid nodes layers.

Returns:

The input numpy array that holds the grid’s layer z-coordinates.

Return type:

ndarray of float

get_input_item_count()#

Count of a model’s input variables.

Returns:

The number of input variables.

Return type:

int

get_input_var_names()#

Names of the input exchange items.

get_output_item_count()#

Count of a model’s output variables.

Returns:

The number of output variables.

Return type:

int

get_output_var_names()#

Names of the output exchange items.

get_start_time()#

Start time of the component.

get_time_step()#

Component time step.

get_time_units()#

Time units used by the component.

get_value(name, dest)#

Get a copy of a variable’s data.

get_value_at_indices(name, dest, inds)#

Get values at particular indices.

Parameters:
  • name (str) – An input or output variable name, a CSDMS Standard Name.

  • dest (ndarray) – A numpy array into which to place the values.

  • inds (array_like) – The indices into the variable array.

Returns:

Value of the model variable at the given location.

Return type:

array_like

get_value_ptr(name)#

Get a reference to values of the given variable.

This is a getter for the model, used to access the model’s current state. It returns a reference to a model variable, with the return type, size and rank dependent on the variable.

Parameters:

name (str) – An input or output variable name, a CSDMS Standard Name.

Returns:

A reference to a model variable.

Return type:

array_like

get_value_ref(name)#

Get a reference to a variable’s data.

get_var_grid(name)#

Get the grid id for a variable.

get_var_itemsize(name)#

Get the size of elements of a variable.

get_var_location(name)#

Get the grid element type that the a given variable is defined on.

The grid topology can be composed of nodes, edges, and faces.

node

A point that has a coordinate pair or triplet: the most basic element of the topology.

edge

A line or curve bounded by two nodes.

face

A plane or surface enclosed by a set of edges. In a 2D horizontal application one may consider the word “polygon”, but in the hierarchy of elements the word “face” is most common.

Parameters:

name (str) – An input or output variable name, a CSDMS Standard Name.

Returns:

The grid location on which the variable is defined. Must be one of “node”, “edge”, or “face”.

Return type:

str

Notes

CSDMS uses the ugrid conventions to define unstructured grids.

get_var_nbytes(name)#

Get the total number of bytes used by a variable.

get_var_type(name)#

Get the data type for a variable.

get_var_units(name)#

Get the unit used by a variable.

initialize(config_file)#

Initialize the component from a file.

BMI-wrapped Landlab components use input files in YAML format. Component-specific parameters are listed at the top level, followed by grid and then time information. An example input file looks like:

flexure:
    eet: 15.e+3
clock:
    start: 0
    stop: 100.
    step: 2.
grid:
    type: raster
    shape: [20, 40]
    spacing: [1000., 2000.]

In this case, a RasterModelGrid is created (with the given shape and spacing) and passed to the underlying landlab component. The eet=15000. is also given to the component but as a keyword parameter. The BMI clock is initialized with the given parameters.

Parameters:

config_file (str or file_like) – YAML-formatted input file for the component.

set_value(name, values)#

Set the values of a variable.

set_value_at_indices(name, inds, src)#

Specify a new value for a model variable at particular indices.

Parameters:
  • name (str) – An input or output variable name, a CSDMS Standard Name.

  • inds (array_like) – The indices into the variable array.

  • src (array_like) – The new value for the specified variable.

update()#

Update the component one time step.

update_frac(frac)#

Update the component a fraction of a time step.

update_until(then)#

Update the component until a given time.

class SteepnessFinderBMI#

Bases: Bmi

Basic Modeling Interface for the SteepnessFinder component.

finalize()#

Clean-up the component.

get_component_name()#

Name of the component.

get_current_time()#

Current component time.

get_end_time()#

Stop time for the component.

get_grid_edge_count(grid)#

Get the number of edges in the grid.

Parameters:

grid (int) – A grid identifier.

Returns:

The total number of grid edges.

Return type:

int

get_grid_edge_nodes(grid, edge_nodes)#

Get the edge-node connectivity.

Parameters:
  • grid (int) – A grid identifier.

  • edge_nodes (ndarray of int, shape (2 x nnodes,)) – A numpy array to place the edge-node connectivity. For each edge, connectivity is given as node at edge tail, followed by node at edge head.

Returns:

The input numpy array that holds the edge-node connectivity.

Return type:

ndarray of int

get_grid_face_count(grid)#

Get the number of faces in the grid.

Parameters:

grid (int) – A grid identifier.

Returns:

The total number of grid faces.

Return type:

int

get_grid_face_edges(grid)#

Get the face-edge connectivity.

Parameters:
  • grid (int) – A grid identifier.

  • face_edges (ndarray of int) – A numpy array to place the face-edge connectivity.

Returns:

The input numpy array that holds the face-edge connectivity.

Return type:

ndarray of int

get_grid_face_nodes(grid, face_nodes)#

Get the face-node connectivity.

Parameters:
  • grid (int) – A grid identifier.

  • face_nodes (ndarray of int) – A numpy array to place the face-node connectivity. For each face, the nodes (listed in a counter-clockwise direction) that form the boundary of the face.

Returns:

The input numpy array that holds the face-node connectivity.

Return type:

ndarray of int

get_grid_node_count(grid)#

Get the number of nodes in the grid.

Parameters:

grid (int) – A grid identifier.

Returns:

The total number of grid nodes.

Return type:

int

get_grid_nodes_per_face(grid, nodes_per_face)#

Get the number of nodes for each face.

Parameters:
  • grid (int) – A grid identifier.

  • nodes_per_face (ndarray of int, shape (nfaces,)) – A numpy array to place the number of nodes per face.

Returns:

The input numpy array that holds the number of nodes per face.

Return type:

ndarray of int

get_grid_origin(grid, origin)#

Get the origin for a structured grid.

get_grid_rank(grid)#

Get the number of dimensions of a grid.

get_grid_shape(grid, shape)#

Get the shape of a structured grid.

get_grid_size(grid)#

Get the total number of elements in the computational grid.

Parameters:

grid (int) – A grid identifier.

Returns:

Size of the grid.

Return type:

int

get_grid_spacing(grid, spacing)#

Get the row and column spacing of a structured grid.

get_grid_type(grid)#

Get the type of grid.

get_grid_x(grid, x)#

Get coordinates of grid nodes in the x direction.

Parameters:
  • grid (int) – A grid identifier.

  • x (ndarray of float, shape (nrows,)) – A numpy array to hold the x-coordinates of the grid node columns.

Returns:

The input numpy array that holds the grid’s column x-coordinates.

Return type:

ndarray of float

get_grid_y(grid, y)#

Get coordinates of grid nodes in the y direction.

Parameters:
  • grid (int) – A grid identifier.

  • y (ndarray of float, shape (ncols,)) – A numpy array to hold the y-coordinates of the grid node rows.

Returns:

The input numpy array that holds the grid’s row y-coordinates.

Return type:

ndarray of float

get_grid_z(grid, z)#

Get coordinates of grid nodes in the z direction.

Parameters:
  • grid (int) – A grid identifier.

  • z (ndarray of float, shape (nlayers,)) – A numpy array to hold the z-coordinates of the grid nodes layers.

Returns:

The input numpy array that holds the grid’s layer z-coordinates.

Return type:

ndarray of float

get_input_item_count()#

Count of a model’s input variables.

Returns:

The number of input variables.

Return type:

int

get_input_var_names()#

Names of the input exchange items.

get_output_item_count()#

Count of a model’s output variables.

Returns:

The number of output variables.

Return type:

int

get_output_var_names()#

Names of the output exchange items.

get_start_time()#

Start time of the component.

get_time_step()#

Component time step.

get_time_units()#

Time units used by the component.

get_value(name, dest)#

Get a copy of a variable’s data.

get_value_at_indices(name, dest, inds)#

Get values at particular indices.

Parameters:
  • name (str) – An input or output variable name, a CSDMS Standard Name.

  • dest (ndarray) – A numpy array into which to place the values.

  • inds (array_like) – The indices into the variable array.

Returns:

Value of the model variable at the given location.

Return type:

array_like

get_value_ptr(name)#

Get a reference to values of the given variable.

This is a getter for the model, used to access the model’s current state. It returns a reference to a model variable, with the return type, size and rank dependent on the variable.

Parameters:

name (str) – An input or output variable name, a CSDMS Standard Name.

Returns:

A reference to a model variable.

Return type:

array_like

get_value_ref(name)#

Get a reference to a variable’s data.

get_var_grid(name)#

Get the grid id for a variable.

get_var_itemsize(name)#

Get the size of elements of a variable.

get_var_location(name)#

Get the grid element type that the a given variable is defined on.

The grid topology can be composed of nodes, edges, and faces.

node

A point that has a coordinate pair or triplet: the most basic element of the topology.

edge

A line or curve bounded by two nodes.

face

A plane or surface enclosed by a set of edges. In a 2D horizontal application one may consider the word “polygon”, but in the hierarchy of elements the word “face” is most common.

Parameters:

name (str) – An input or output variable name, a CSDMS Standard Name.

Returns:

The grid location on which the variable is defined. Must be one of “node”, “edge”, or “face”.

Return type:

str

Notes

CSDMS uses the ugrid conventions to define unstructured grids.

get_var_nbytes(name)#

Get the total number of bytes used by a variable.

get_var_type(name)#

Get the data type for a variable.

get_var_units(name)#

Get the unit used by a variable.

initialize(config_file)#

Initialize the component from a file.

BMI-wrapped Landlab components use input files in YAML format. Component-specific parameters are listed at the top level, followed by grid and then time information. An example input file looks like:

flexure:
    eet: 15.e+3
clock:
    start: 0
    stop: 100.
    step: 2.
grid:
    type: raster
    shape: [20, 40]
    spacing: [1000., 2000.]

In this case, a RasterModelGrid is created (with the given shape and spacing) and passed to the underlying landlab component. The eet=15000. is also given to the component but as a keyword parameter. The BMI clock is initialized with the given parameters.

Parameters:

config_file (str or file_like) – YAML-formatted input file for the component.

set_value(name, values)#

Set the values of a variable.

set_value_at_indices(name, inds, src)#

Specify a new value for a model variable at particular indices.

Parameters:
  • name (str) – An input or output variable name, a CSDMS Standard Name.

  • inds (array_like) – The indices into the variable array.

  • src (array_like) – The new value for the specified variable.

update()#

Update the component one time step.

update_frac(frac)#

Update the component a fraction of a time step.

update_until(then)#

Update the component until a given time.

class StreamPowerEroderBMI#

Bases: Bmi

Basic Modeling Interface for the StreamPowerEroder component.

finalize()#

Clean-up the component.

get_component_name()#

Name of the component.

get_current_time()#

Current component time.

get_end_time()#

Stop time for the component.

get_grid_edge_count(grid)#

Get the number of edges in the grid.

Parameters:

grid (int) – A grid identifier.

Returns:

The total number of grid edges.

Return type:

int

get_grid_edge_nodes(grid, edge_nodes)#

Get the edge-node connectivity.

Parameters:
  • grid (int) – A grid identifier.

  • edge_nodes (ndarray of int, shape (2 x nnodes,)) – A numpy array to place the edge-node connectivity. For each edge, connectivity is given as node at edge tail, followed by node at edge head.

Returns:

The input numpy array that holds the edge-node connectivity.

Return type:

ndarray of int

get_grid_face_count(grid)#

Get the number of faces in the grid.

Parameters:

grid (int) – A grid identifier.

Returns:

The total number of grid faces.

Return type:

int

get_grid_face_edges(grid)#

Get the face-edge connectivity.

Parameters:
  • grid (int) – A grid identifier.

  • face_edges (ndarray of int) – A numpy array to place the face-edge connectivity.

Returns:

The input numpy array that holds the face-edge connectivity.

Return type:

ndarray of int

get_grid_face_nodes(grid, face_nodes)#

Get the face-node connectivity.

Parameters:
  • grid (int) – A grid identifier.

  • face_nodes (ndarray of int) – A numpy array to place the face-node connectivity. For each face, the nodes (listed in a counter-clockwise direction) that form the boundary of the face.

Returns:

The input numpy array that holds the face-node connectivity.

Return type:

ndarray of int

get_grid_node_count(grid)#

Get the number of nodes in the grid.

Parameters:

grid (int) – A grid identifier.

Returns:

The total number of grid nodes.

Return type:

int

get_grid_nodes_per_face(grid, nodes_per_face)#

Get the number of nodes for each face.

Parameters:
  • grid (int) – A grid identifier.

  • nodes_per_face (ndarray of int, shape (nfaces,)) – A numpy array to place the number of nodes per face.

Returns:

The input numpy array that holds the number of nodes per face.

Return type:

ndarray of int

get_grid_origin(grid, origin)#

Get the origin for a structured grid.

get_grid_rank(grid)#

Get the number of dimensions of a grid.

get_grid_shape(grid, shape)#

Get the shape of a structured grid.

get_grid_size(grid)#

Get the total number of elements in the computational grid.

Parameters:

grid (int) – A grid identifier.

Returns:

Size of the grid.

Return type:

int

get_grid_spacing(grid, spacing)#

Get the row and column spacing of a structured grid.

get_grid_type(grid)#

Get the type of grid.

get_grid_x(grid, x)#

Get coordinates of grid nodes in the x direction.

Parameters:
  • grid (int) – A grid identifier.

  • x (ndarray of float, shape (nrows,)) – A numpy array to hold the x-coordinates of the grid node columns.

Returns:

The input numpy array that holds the grid’s column x-coordinates.

Return type:

ndarray of float

get_grid_y(grid, y)#

Get coordinates of grid nodes in the y direction.

Parameters:
  • grid (int) – A grid identifier.

  • y (ndarray of float, shape (ncols,)) – A numpy array to hold the y-coordinates of the grid node rows.

Returns:

The input numpy array that holds the grid’s row y-coordinates.

Return type:

ndarray of float

get_grid_z(grid, z)#

Get coordinates of grid nodes in the z direction.

Parameters:
  • grid (int) – A grid identifier.

  • z (ndarray of float, shape (nlayers,)) – A numpy array to hold the z-coordinates of the grid nodes layers.

Returns:

The input numpy array that holds the grid’s layer z-coordinates.

Return type:

ndarray of float

get_input_item_count()#

Count of a model’s input variables.

Returns:

The number of input variables.

Return type:

int

get_input_var_names()#

Names of the input exchange items.

get_output_item_count()#

Count of a model’s output variables.

Returns:

The number of output variables.

Return type:

int

get_output_var_names()#

Names of the output exchange items.

get_start_time()#

Start time of the component.

get_time_step()#

Component time step.

get_time_units()#

Time units used by the component.

get_value(name, dest)#

Get a copy of a variable’s data.

get_value_at_indices(name, dest, inds)#

Get values at particular indices.

Parameters:
  • name (str) – An input or output variable name, a CSDMS Standard Name.

  • dest (ndarray) – A numpy array into which to place the values.

  • inds (array_like) – The indices into the variable array.

Returns:

Value of the model variable at the given location.

Return type:

array_like

get_value_ptr(name)#

Get a reference to values of the given variable.

This is a getter for the model, used to access the model’s current state. It returns a reference to a model variable, with the return type, size and rank dependent on the variable.

Parameters:

name (str) – An input or output variable name, a CSDMS Standard Name.

Returns:

A reference to a model variable.

Return type:

array_like

get_value_ref(name)#

Get a reference to a variable’s data.

get_var_grid(name)#

Get the grid id for a variable.

get_var_itemsize(name)#

Get the size of elements of a variable.

get_var_location(name)#

Get the grid element type that the a given variable is defined on.

The grid topology can be composed of nodes, edges, and faces.

node

A point that has a coordinate pair or triplet: the most basic element of the topology.

edge

A line or curve bounded by two nodes.

face

A plane or surface enclosed by a set of edges. In a 2D horizontal application one may consider the word “polygon”, but in the hierarchy of elements the word “face” is most common.

Parameters:

name (str) – An input or output variable name, a CSDMS Standard Name.

Returns:

The grid location on which the variable is defined. Must be one of “node”, “edge”, or “face”.

Return type:

str

Notes

CSDMS uses the ugrid conventions to define unstructured grids.

get_var_nbytes(name)#

Get the total number of bytes used by a variable.

get_var_type(name)#

Get the data type for a variable.

get_var_units(name)#

Get the unit used by a variable.

initialize(config_file)#

Initialize the component from a file.

BMI-wrapped Landlab components use input files in YAML format. Component-specific parameters are listed at the top level, followed by grid and then time information. An example input file looks like:

flexure:
    eet: 15.e+3
clock:
    start: 0
    stop: 100.
    step: 2.
grid:
    type: raster
    shape: [20, 40]
    spacing: [1000., 2000.]

In this case, a RasterModelGrid is created (with the given shape and spacing) and passed to the underlying landlab component. The eet=15000. is also given to the component but as a keyword parameter. The BMI clock is initialized with the given parameters.

Parameters:

config_file (str or file_like) – YAML-formatted input file for the component.

set_value(name, values)#

Set the values of a variable.

set_value_at_indices(name, inds, src)#

Specify a new value for a model variable at particular indices.

Parameters:
  • name (str) – An input or output variable name, a CSDMS Standard Name.

  • inds (array_like) – The indices into the variable array.

  • src (array_like) – The new value for the specified variable.

update()#

Update the component one time step.

update_frac(frac)#

Update the component a fraction of a time step.

update_until(then)#

Update the component until a given time.

class StreamPowerSmoothThresholdEroderBMI#

Bases: Bmi

Basic Modeling Interface for the StreamPowerSmoothThresholdEroder component.

finalize()#

Clean-up the component.

get_component_name()#

Name of the component.

get_current_time()#

Current component time.

get_end_time()#

Stop time for the component.

get_grid_edge_count(grid)#

Get the number of edges in the grid.

Parameters:

grid (int) – A grid identifier.

Returns:

The total number of grid edges.

Return type:

int

get_grid_edge_nodes(grid, edge_nodes)#

Get the edge-node connectivity.

Parameters:
  • grid (int) – A grid identifier.

  • edge_nodes (ndarray of int, shape (2 x nnodes,)) – A numpy array to place the edge-node connectivity. For each edge, connectivity is given as node at edge tail, followed by node at edge head.

Returns:

The input numpy array that holds the edge-node connectivity.

Return type:

ndarray of int

get_grid_face_count(grid)#

Get the number of faces in the grid.

Parameters:

grid (int) – A grid identifier.

Returns:

The total number of grid faces.

Return type:

int

get_grid_face_edges(grid)#

Get the face-edge connectivity.

Parameters:
  • grid (int) – A grid identifier.

  • face_edges (ndarray of int) – A numpy array to place the face-edge connectivity.

Returns:

The input numpy array that holds the face-edge connectivity.

Return type:

ndarray of int

get_grid_face_nodes(grid, face_nodes)#

Get the face-node connectivity.

Parameters:
  • grid (int) – A grid identifier.

  • face_nodes (ndarray of int) – A numpy array to place the face-node connectivity. For each face, the nodes (listed in a counter-clockwise direction) that form the boundary of the face.

Returns:

The input numpy array that holds the face-node connectivity.

Return type:

ndarray of int

get_grid_node_count(grid)#

Get the number of nodes in the grid.

Parameters:

grid (int) – A grid identifier.

Returns:

The total number of grid nodes.

Return type:

int

get_grid_nodes_per_face(grid, nodes_per_face)#

Get the number of nodes for each face.

Parameters:
  • grid (int) – A grid identifier.

  • nodes_per_face (ndarray of int, shape (nfaces,)) – A numpy array to place the number of nodes per face.

Returns:

The input numpy array that holds the number of nodes per face.

Return type:

ndarray of int

get_grid_origin(grid, origin)#

Get the origin for a structured grid.

get_grid_rank(grid)#

Get the number of dimensions of a grid.

get_grid_shape(grid, shape)#

Get the shape of a structured grid.

get_grid_size(grid)#

Get the total number of elements in the computational grid.

Parameters:

grid (int) – A grid identifier.

Returns:

Size of the grid.

Return type:

int

get_grid_spacing(grid, spacing)#

Get the row and column spacing of a structured grid.

get_grid_type(grid)#

Get the type of grid.

get_grid_x(grid, x)#

Get coordinates of grid nodes in the x direction.

Parameters:
  • grid (int) – A grid identifier.

  • x (ndarray of float, shape (nrows,)) – A numpy array to hold the x-coordinates of the grid node columns.

Returns:

The input numpy array that holds the grid’s column x-coordinates.

Return type:

ndarray of float

get_grid_y(grid, y)#

Get coordinates of grid nodes in the y direction.

Parameters:
  • grid (int) – A grid identifier.

  • y (ndarray of float, shape (ncols,)) – A numpy array to hold the y-coordinates of the grid node rows.

Returns:

The input numpy array that holds the grid’s row y-coordinates.

Return type:

ndarray of float

get_grid_z(grid, z)#

Get coordinates of grid nodes in the z direction.

Parameters:
  • grid (int) – A grid identifier.

  • z (ndarray of float, shape (nlayers,)) – A numpy array to hold the z-coordinates of the grid nodes layers.

Returns:

The input numpy array that holds the grid’s layer z-coordinates.

Return type:

ndarray of float

get_input_item_count()#

Count of a model’s input variables.

Returns:

The number of input variables.

Return type:

int

get_input_var_names()#

Names of the input exchange items.

get_output_item_count()#

Count of a model’s output variables.

Returns:

The number of output variables.

Return type:

int

get_output_var_names()#

Names of the output exchange items.

get_start_time()#

Start time of the component.

get_time_step()#

Component time step.

get_time_units()#

Time units used by the component.

get_value(name, dest)#

Get a copy of a variable’s data.

get_value_at_indices(name, dest, inds)#

Get values at particular indices.

Parameters:
  • name (str) – An input or output variable name, a CSDMS Standard Name.

  • dest (ndarray) – A numpy array into which to place the values.

  • inds (array_like) – The indices into the variable array.

Returns:

Value of the model variable at the given location.

Return type:

array_like

get_value_ptr(name)#

Get a reference to values of the given variable.

This is a getter for the model, used to access the model’s current state. It returns a reference to a model variable, with the return type, size and rank dependent on the variable.

Parameters:

name (str) – An input or output variable name, a CSDMS Standard Name.

Returns:

A reference to a model variable.

Return type:

array_like

get_value_ref(name)#

Get a reference to a variable’s data.

get_var_grid(name)#

Get the grid id for a variable.

get_var_itemsize(name)#

Get the size of elements of a variable.

get_var_location(name)#

Get the grid element type that the a given variable is defined on.

The grid topology can be composed of nodes, edges, and faces.

node

A point that has a coordinate pair or triplet: the most basic element of the topology.

edge

A line or curve bounded by two nodes.

face

A plane or surface enclosed by a set of edges. In a 2D horizontal application one may consider the word “polygon”, but in the hierarchy of elements the word “face” is most common.

Parameters:

name (str) – An input or output variable name, a CSDMS Standard Name.

Returns:

The grid location on which the variable is defined. Must be one of “node”, “edge”, or “face”.

Return type:

str

Notes

CSDMS uses the ugrid conventions to define unstructured grids.

get_var_nbytes(name)#

Get the total number of bytes used by a variable.

get_var_type(name)#

Get the data type for a variable.

get_var_units(name)#

Get the unit used by a variable.

initialize(config_file)#

Initialize the component from a file.

BMI-wrapped Landlab components use input files in YAML format. Component-specific parameters are listed at the top level, followed by grid and then time information. An example input file looks like:

flexure:
    eet: 15.e+3
clock:
    start: 0
    stop: 100.
    step: 2.
grid:
    type: raster
    shape: [20, 40]
    spacing: [1000., 2000.]

In this case, a RasterModelGrid is created (with the given shape and spacing) and passed to the underlying landlab component. The eet=15000. is also given to the component but as a keyword parameter. The BMI clock is initialized with the given parameters.

Parameters:

config_file (str or file_like) – YAML-formatted input file for the component.

set_value(name, values)#

Set the values of a variable.

set_value_at_indices(name, inds, src)#

Specify a new value for a model variable at particular indices.

Parameters:
  • name (str) – An input or output variable name, a CSDMS Standard Name.

  • inds (array_like) – The indices into the variable array.

  • src (array_like) – The new value for the specified variable.

update()#

Update the component one time step.

update_frac(frac)#

Update the component a fraction of a time step.

update_until(then)#

Update the component until a given time.

class TaylorNonLinearDiffuserBMI#

Bases: Bmi

Basic Modeling Interface for the TaylorNonLinearDiffuser component.

finalize()#

Clean-up the component.

get_component_name()#

Name of the component.

get_current_time()#

Current component time.

get_end_time()#

Stop time for the component.

get_grid_edge_count(grid)#

Get the number of edges in the grid.

Parameters:

grid (int) – A grid identifier.

Returns:

The total number of grid edges.

Return type:

int

get_grid_edge_nodes(grid, edge_nodes)#

Get the edge-node connectivity.

Parameters:
  • grid (int) – A grid identifier.

  • edge_nodes (ndarray of int, shape (2 x nnodes,)) – A numpy array to place the edge-node connectivity. For each edge, connectivity is given as node at edge tail, followed by node at edge head.

Returns:

The input numpy array that holds the edge-node connectivity.

Return type:

ndarray of int

get_grid_face_count(grid)#

Get the number of faces in the grid.

Parameters:

grid (int) – A grid identifier.

Returns:

The total number of grid faces.

Return type:

int

get_grid_face_edges(grid)#

Get the face-edge connectivity.

Parameters:
  • grid (int) – A grid identifier.

  • face_edges (ndarray of int) – A numpy array to place the face-edge connectivity.

Returns:

The input numpy array that holds the face-edge connectivity.

Return type:

ndarray of int

get_grid_face_nodes(grid, face_nodes)#

Get the face-node connectivity.

Parameters:
  • grid (int) – A grid identifier.

  • face_nodes (ndarray of int) – A numpy array to place the face-node connectivity. For each face, the nodes (listed in a counter-clockwise direction) that form the boundary of the face.

Returns:

The input numpy array that holds the face-node connectivity.

Return type:

ndarray of int

get_grid_node_count(grid)#

Get the number of nodes in the grid.

Parameters:

grid (int) – A grid identifier.

Returns:

The total number of grid nodes.

Return type:

int

get_grid_nodes_per_face(grid, nodes_per_face)#

Get the number of nodes for each face.

Parameters:
  • grid (int) – A grid identifier.

  • nodes_per_face (ndarray of int, shape (nfaces,)) – A numpy array to place the number of nodes per face.

Returns:

The input numpy array that holds the number of nodes per face.

Return type:

ndarray of int

get_grid_origin(grid, origin)#

Get the origin for a structured grid.

get_grid_rank(grid)#

Get the number of dimensions of a grid.

get_grid_shape(grid, shape)#

Get the shape of a structured grid.

get_grid_size(grid)#

Get the total number of elements in the computational grid.

Parameters:

grid (int) – A grid identifier.

Returns:

Size of the grid.

Return type:

int

get_grid_spacing(grid, spacing)#

Get the row and column spacing of a structured grid.

get_grid_type(grid)#

Get the type of grid.

get_grid_x(grid, x)#

Get coordinates of grid nodes in the x direction.

Parameters:
  • grid (int) – A grid identifier.

  • x (ndarray of float, shape (nrows,)) – A numpy array to hold the x-coordinates of the grid node columns.

Returns:

The input numpy array that holds the grid’s column x-coordinates.

Return type:

ndarray of float

get_grid_y(grid, y)#

Get coordinates of grid nodes in the y direction.

Parameters:
  • grid (int) – A grid identifier.

  • y (ndarray of float, shape (ncols,)) – A numpy array to hold the y-coordinates of the grid node rows.

Returns:

The input numpy array that holds the grid’s row y-coordinates.

Return type:

ndarray of float

get_grid_z(grid, z)#

Get coordinates of grid nodes in the z direction.

Parameters:
  • grid (int) – A grid identifier.

  • z (ndarray of float, shape (nlayers,)) – A numpy array to hold the z-coordinates of the grid nodes layers.

Returns:

The input numpy array that holds the grid’s layer z-coordinates.

Return type:

ndarray of float

get_input_item_count()#

Count of a model’s input variables.

Returns:

The number of input variables.

Return type:

int

get_input_var_names()#

Names of the input exchange items.

get_output_item_count()#

Count of a model’s output variables.

Returns:

The number of output variables.

Return type:

int

get_output_var_names()#

Names of the output exchange items.

get_start_time()#

Start time of the component.

get_time_step()#

Component time step.

get_time_units()#

Time units used by the component.

get_value(name, dest)#

Get a copy of a variable’s data.

get_value_at_indices(name, dest, inds)#

Get values at particular indices.

Parameters:
  • name (str) – An input or output variable name, a CSDMS Standard Name.

  • dest (ndarray) – A numpy array into which to place the values.

  • inds (array_like) – The indices into the variable array.

Returns:

Value of the model variable at the given location.

Return type:

array_like

get_value_ptr(name)#

Get a reference to values of the given variable.

This is a getter for the model, used to access the model’s current state. It returns a reference to a model variable, with the return type, size and rank dependent on the variable.

Parameters:

name (str) – An input or output variable name, a CSDMS Standard Name.

Returns:

A reference to a model variable.

Return type:

array_like

get_value_ref(name)#

Get a reference to a variable’s data.

get_var_grid(name)#

Get the grid id for a variable.

get_var_itemsize(name)#

Get the size of elements of a variable.

get_var_location(name)#

Get the grid element type that the a given variable is defined on.

The grid topology can be composed of nodes, edges, and faces.

node

A point that has a coordinate pair or triplet: the most basic element of the topology.

edge

A line or curve bounded by two nodes.

face

A plane or surface enclosed by a set of edges. In a 2D horizontal application one may consider the word “polygon”, but in the hierarchy of elements the word “face” is most common.

Parameters:

name (str) – An input or output variable name, a CSDMS Standard Name.

Returns:

The grid location on which the variable is defined. Must be one of “node”, “edge”, or “face”.

Return type:

str

Notes

CSDMS uses the ugrid conventions to define unstructured grids.

get_var_nbytes(name)#

Get the total number of bytes used by a variable.

get_var_type(name)#

Get the data type for a variable.

get_var_units(name)#

Get the unit used by a variable.

initialize(config_file)#

Initialize the component from a file.

BMI-wrapped Landlab components use input files in YAML format. Component-specific parameters are listed at the top level, followed by grid and then time information. An example input file looks like:

flexure:
    eet: 15.e+3
clock:
    start: 0
    stop: 100.
    step: 2.
grid:
    type: raster
    shape: [20, 40]
    spacing: [1000., 2000.]

In this case, a RasterModelGrid is created (with the given shape and spacing) and passed to the underlying landlab component. The eet=15000. is also given to the component but as a keyword parameter. The BMI clock is initialized with the given parameters.

Parameters:

config_file (str or file_like) – YAML-formatted input file for the component.

set_value(name, values)#

Set the values of a variable.

set_value_at_indices(name, inds, src)#

Specify a new value for a model variable at particular indices.

Parameters:
  • name (str) – An input or output variable name, a CSDMS Standard Name.

  • inds (array_like) – The indices into the variable array.

  • src (array_like) – The new value for the specified variable.

update()#

Update the component one time step.

update_frac(frac)#

Update the component a fraction of a time step.

update_until(then)#

Update the component until a given time.

class ThresholdEroderBMI#

Bases: Bmi

Basic Modeling Interface for the ThresholdEroder component.

finalize()#

Clean-up the component.

get_component_name()#

Name of the component.

get_current_time()#

Current component time.

get_end_time()#

Stop time for the component.

get_grid_edge_count(grid)#

Get the number of edges in the grid.

Parameters:

grid (int) – A grid identifier.

Returns:

The total number of grid edges.

Return type:

int

get_grid_edge_nodes(grid, edge_nodes)#

Get the edge-node connectivity.

Parameters:
  • grid (int) – A grid identifier.

  • edge_nodes (ndarray of int, shape (2 x nnodes,)) – A numpy array to place the edge-node connectivity. For each edge, connectivity is given as node at edge tail, followed by node at edge head.

Returns:

The input numpy array that holds the edge-node connectivity.

Return type:

ndarray of int

get_grid_face_count(grid)#

Get the number of faces in the grid.

Parameters:

grid (int) – A grid identifier.

Returns:

The total number of grid faces.

Return type:

int

get_grid_face_edges(grid)#

Get the face-edge connectivity.

Parameters:
  • grid (int) – A grid identifier.

  • face_edges (ndarray of int) – A numpy array to place the face-edge connectivity.

Returns:

The input numpy array that holds the face-edge connectivity.

Return type:

ndarray of int

get_grid_face_nodes(grid, face_nodes)#

Get the face-node connectivity.

Parameters:
  • grid (int) – A grid identifier.

  • face_nodes (ndarray of int) – A numpy array to place the face-node connectivity. For each face, the nodes (listed in a counter-clockwise direction) that form the boundary of the face.

Returns:

The input numpy array that holds the face-node connectivity.

Return type:

ndarray of int

get_grid_node_count(grid)#

Get the number of nodes in the grid.

Parameters:

grid (int) – A grid identifier.

Returns:

The total number of grid nodes.

Return type:

int

get_grid_nodes_per_face(grid, nodes_per_face)#

Get the number of nodes for each face.

Parameters:
  • grid (int) – A grid identifier.

  • nodes_per_face (ndarray of int, shape (nfaces,)) – A numpy array to place the number of nodes per face.

Returns:

The input numpy array that holds the number of nodes per face.

Return type:

ndarray of int

get_grid_origin(grid, origin)#

Get the origin for a structured grid.

get_grid_rank(grid)#

Get the number of dimensions of a grid.

get_grid_shape(grid, shape)#

Get the shape of a structured grid.

get_grid_size(grid)#

Get the total number of elements in the computational grid.

Parameters:

grid (int) – A grid identifier.

Returns:

Size of the grid.

Return type:

int

get_grid_spacing(grid, spacing)#

Get the row and column spacing of a structured grid.

get_grid_type(grid)#

Get the type of grid.

get_grid_x(grid, x)#

Get coordinates of grid nodes in the x direction.

Parameters:
  • grid (int) – A grid identifier.

  • x (ndarray of float, shape (nrows,)) – A numpy array to hold the x-coordinates of the grid node columns.

Returns:

The input numpy array that holds the grid’s column x-coordinates.

Return type:

ndarray of float

get_grid_y(grid, y)#

Get coordinates of grid nodes in the y direction.

Parameters:
  • grid (int) – A grid identifier.

  • y (ndarray of float, shape (ncols,)) – A numpy array to hold the y-coordinates of the grid node rows.

Returns:

The input numpy array that holds the grid’s row y-coordinates.

Return type:

ndarray of float

get_grid_z(grid, z)#

Get coordinates of grid nodes in the z direction.

Parameters:
  • grid (int) – A grid identifier.

  • z (ndarray of float, shape (nlayers,)) – A numpy array to hold the z-coordinates of the grid nodes layers.

Returns:

The input numpy array that holds the grid’s layer z-coordinates.

Return type:

ndarray of float

get_input_item_count()#

Count of a model’s input variables.

Returns:

The number of input variables.

Return type:

int

get_input_var_names()#

Names of the input exchange items.

get_output_item_count()#

Count of a model’s output variables.

Returns:

The number of output variables.

Return type:

int

get_output_var_names()#

Names of the output exchange items.

get_start_time()#

Start time of the component.

get_time_step()#

Component time step.

get_time_units()#

Time units used by the component.

get_value(name, dest)#

Get a copy of a variable’s data.

get_value_at_indices(name, dest, inds)#

Get values at particular indices.

Parameters:
  • name (str) – An input or output variable name, a CSDMS Standard Name.

  • dest (ndarray) – A numpy array into which to place the values.

  • inds (array_like) – The indices into the variable array.

Returns:

Value of the model variable at the given location.

Return type:

array_like

get_value_ptr(name)#

Get a reference to values of the given variable.

This is a getter for the model, used to access the model’s current state. It returns a reference to a model variable, with the return type, size and rank dependent on the variable.

Parameters:

name (str) – An input or output variable name, a CSDMS Standard Name.

Returns:

A reference to a model variable.

Return type:

array_like

get_value_ref(name)#

Get a reference to a variable’s data.

get_var_grid(name)#

Get the grid id for a variable.

get_var_itemsize(name)#

Get the size of elements of a variable.

get_var_location(name)#

Get the grid element type that the a given variable is defined on.

The grid topology can be composed of nodes, edges, and faces.

node

A point that has a coordinate pair or triplet: the most basic element of the topology.

edge

A line or curve bounded by two nodes.

face

A plane or surface enclosed by a set of edges. In a 2D horizontal application one may consider the word “polygon”, but in the hierarchy of elements the word “face” is most common.

Parameters:

name (str) – An input or output variable name, a CSDMS Standard Name.

Returns:

The grid location on which the variable is defined. Must be one of “node”, “edge”, or “face”.

Return type:

str

Notes

CSDMS uses the ugrid conventions to define unstructured grids.

get_var_nbytes(name)#

Get the total number of bytes used by a variable.

get_var_type(name)#

Get the data type for a variable.

get_var_units(name)#

Get the unit used by a variable.

initialize(config_file)#

Initialize the component from a file.

BMI-wrapped Landlab components use input files in YAML format. Component-specific parameters are listed at the top level, followed by grid and then time information. An example input file looks like:

flexure:
    eet: 15.e+3
clock:
    start: 0
    stop: 100.
    step: 2.
grid:
    type: raster
    shape: [20, 40]
    spacing: [1000., 2000.]

In this case, a RasterModelGrid is created (with the given shape and spacing) and passed to the underlying landlab component. The eet=15000. is also given to the component but as a keyword parameter. The BMI clock is initialized with the given parameters.

Parameters:

config_file (str or file_like) – YAML-formatted input file for the component.

set_value(name, values)#

Set the values of a variable.

set_value_at_indices(name, inds, src)#

Specify a new value for a model variable at particular indices.

Parameters:
  • name (str) – An input or output variable name, a CSDMS Standard Name.

  • inds (array_like) – The indices into the variable array.

  • src (array_like) – The new value for the specified variable.

update()#

Update the component one time step.

update_frac(frac)#

Update the component a fraction of a time step.

update_until(then)#

Update the component until a given time.

class TidalFlowCalculatorBMI#

Bases: Bmi

Basic Modeling Interface for the TidalFlowCalculator component.

finalize()#

Clean-up the component.

get_component_name()#

Name of the component.

get_current_time()#

Current component time.

get_end_time()#

Stop time for the component.

get_grid_edge_count(grid)#

Get the number of edges in the grid.

Parameters:

grid (int) – A grid identifier.

Returns:

The total number of grid edges.

Return type:

int

get_grid_edge_nodes(grid, edge_nodes)#

Get the edge-node connectivity.

Parameters:
  • grid (int) – A grid identifier.

  • edge_nodes (ndarray of int, shape (2 x nnodes,)) – A numpy array to place the edge-node connectivity. For each edge, connectivity is given as node at edge tail, followed by node at edge head.

Returns:

The input numpy array that holds the edge-node connectivity.

Return type:

ndarray of int

get_grid_face_count(grid)#

Get the number of faces in the grid.

Parameters:

grid (int) – A grid identifier.

Returns:

The total number of grid faces.

Return type:

int

get_grid_face_edges(grid)#

Get the face-edge connectivity.

Parameters:
  • grid (int) – A grid identifier.

  • face_edges (ndarray of int) – A numpy array to place the face-edge connectivity.

Returns:

The input numpy array that holds the face-edge connectivity.

Return type:

ndarray of int

get_grid_face_nodes(grid, face_nodes)#

Get the face-node connectivity.

Parameters:
  • grid (int) – A grid identifier.

  • face_nodes (ndarray of int) – A numpy array to place the face-node connectivity. For each face, the nodes (listed in a counter-clockwise direction) that form the boundary of the face.

Returns:

The input numpy array that holds the face-node connectivity.

Return type:

ndarray of int

get_grid_node_count(grid)#

Get the number of nodes in the grid.

Parameters:

grid (int) – A grid identifier.

Returns:

The total number of grid nodes.

Return type:

int

get_grid_nodes_per_face(grid, nodes_per_face)#

Get the number of nodes for each face.

Parameters:
  • grid (int) – A grid identifier.

  • nodes_per_face (ndarray of int, shape (nfaces,)) – A numpy array to place the number of nodes per face.

Returns:

The input numpy array that holds the number of nodes per face.

Return type:

ndarray of int

get_grid_origin(grid, origin)#

Get the origin for a structured grid.

get_grid_rank(grid)#

Get the number of dimensions of a grid.

get_grid_shape(grid, shape)#

Get the shape of a structured grid.

get_grid_size(grid)#

Get the total number of elements in the computational grid.

Parameters:

grid (int) – A grid identifier.

Returns:

Size of the grid.

Return type:

int

get_grid_spacing(grid, spacing)#

Get the row and column spacing of a structured grid.

get_grid_type(grid)#

Get the type of grid.

get_grid_x(grid, x)#

Get coordinates of grid nodes in the x direction.

Parameters:
  • grid (int) – A grid identifier.

  • x (ndarray of float, shape (nrows,)) – A numpy array to hold the x-coordinates of the grid node columns.

Returns:

The input numpy array that holds the grid’s column x-coordinates.

Return type:

ndarray of float

get_grid_y(grid, y)#

Get coordinates of grid nodes in the y direction.

Parameters:
  • grid (int) – A grid identifier.

  • y (ndarray of float, shape (ncols,)) – A numpy array to hold the y-coordinates of the grid node rows.

Returns:

The input numpy array that holds the grid’s row y-coordinates.

Return type:

ndarray of float

get_grid_z(grid, z)#

Get coordinates of grid nodes in the z direction.

Parameters:
  • grid (int) – A grid identifier.

  • z (ndarray of float, shape (nlayers,)) – A numpy array to hold the z-coordinates of the grid nodes layers.

Returns:

The input numpy array that holds the grid’s layer z-coordinates.

Return type:

ndarray of float

get_input_item_count()#

Count of a model’s input variables.

Returns:

The number of input variables.

Return type:

int

get_input_var_names()#

Names of the input exchange items.

get_output_item_count()#

Count of a model’s output variables.

Returns:

The number of output variables.

Return type:

int

get_output_var_names()#

Names of the output exchange items.

get_start_time()#

Start time of the component.

get_time_step()#

Component time step.

get_time_units()#

Time units used by the component.

get_value(name, dest)#

Get a copy of a variable’s data.

get_value_at_indices(name, dest, inds)#

Get values at particular indices.

Parameters:
  • name (str) – An input or output variable name, a CSDMS Standard Name.

  • dest (ndarray) – A numpy array into which to place the values.

  • inds (array_like) – The indices into the variable array.

Returns:

Value of the model variable at the given location.

Return type:

array_like

get_value_ptr(name)#

Get a reference to values of the given variable.

This is a getter for the model, used to access the model’s current state. It returns a reference to a model variable, with the return type, size and rank dependent on the variable.

Parameters:

name (str) – An input or output variable name, a CSDMS Standard Name.

Returns:

A reference to a model variable.

Return type:

array_like

get_value_ref(name)#

Get a reference to a variable’s data.

get_var_grid(name)#

Get the grid id for a variable.

get_var_itemsize(name)#

Get the size of elements of a variable.

get_var_location(name)#

Get the grid element type that the a given variable is defined on.

The grid topology can be composed of nodes, edges, and faces.

node

A point that has a coordinate pair or triplet: the most basic element of the topology.

edge

A line or curve bounded by two nodes.

face

A plane or surface enclosed by a set of edges. In a 2D horizontal application one may consider the word “polygon”, but in the hierarchy of elements the word “face” is most common.

Parameters:

name (str) – An input or output variable name, a CSDMS Standard Name.

Returns:

The grid location on which the variable is defined. Must be one of “node”, “edge”, or “face”.

Return type:

str

Notes

CSDMS uses the ugrid conventions to define unstructured grids.

get_var_nbytes(name)#

Get the total number of bytes used by a variable.

get_var_type(name)#

Get the data type for a variable.

get_var_units(name)#

Get the unit used by a variable.

initialize(config_file)#

Initialize the component from a file.

BMI-wrapped Landlab components use input files in YAML format. Component-specific parameters are listed at the top level, followed by grid and then time information. An example input file looks like:

flexure:
    eet: 15.e+3
clock:
    start: 0
    stop: 100.
    step: 2.
grid:
    type: raster
    shape: [20, 40]
    spacing: [1000., 2000.]

In this case, a RasterModelGrid is created (with the given shape and spacing) and passed to the underlying landlab component. The eet=15000. is also given to the component but as a keyword parameter. The BMI clock is initialized with the given parameters.

Parameters:

config_file (str or file_like) – YAML-formatted input file for the component.

set_value(name, values)#

Set the values of a variable.

set_value_at_indices(name, inds, src)#

Specify a new value for a model variable at particular indices.

Parameters:
  • name (str) – An input or output variable name, a CSDMS Standard Name.

  • inds (array_like) – The indices into the variable array.

  • src (array_like) – The new value for the specified variable.

update()#

Update the component one time step.

update_frac(frac)#

Update the component a fraction of a time step.

update_until(then)#

Update the component until a given time.

class TransportLengthHillslopeDiffuserBMI#

Bases: Bmi

Basic Modeling Interface for the TransportLengthHillslopeDiffuser component.

finalize()#

Clean-up the component.

get_component_name()#

Name of the component.

get_current_time()#

Current component time.

get_end_time()#

Stop time for the component.

get_grid_edge_count(grid)#

Get the number of edges in the grid.

Parameters:

grid (int) – A grid identifier.

Returns:

The total number of grid edges.

Return type:

int

get_grid_edge_nodes(grid, edge_nodes)#

Get the edge-node connectivity.

Parameters:
  • grid (int) – A grid identifier.

  • edge_nodes (ndarray of int, shape (2 x nnodes,)) – A numpy array to place the edge-node connectivity. For each edge, connectivity is given as node at edge tail, followed by node at edge head.

Returns:

The input numpy array that holds the edge-node connectivity.

Return type:

ndarray of int

get_grid_face_count(grid)#

Get the number of faces in the grid.

Parameters:

grid (int) – A grid identifier.

Returns:

The total number of grid faces.

Return type:

int

get_grid_face_edges(grid)#

Get the face-edge connectivity.

Parameters:
  • grid (int) – A grid identifier.

  • face_edges (ndarray of int) – A numpy array to place the face-edge connectivity.

Returns:

The input numpy array that holds the face-edge connectivity.

Return type:

ndarray of int

get_grid_face_nodes(grid, face_nodes)#

Get the face-node connectivity.

Parameters:
  • grid (int) – A grid identifier.

  • face_nodes (ndarray of int) – A numpy array to place the face-node connectivity. For each face, the nodes (listed in a counter-clockwise direction) that form the boundary of the face.

Returns:

The input numpy array that holds the face-node connectivity.

Return type:

ndarray of int

get_grid_node_count(grid)#

Get the number of nodes in the grid.

Parameters:

grid (int) – A grid identifier.

Returns:

The total number of grid nodes.

Return type:

int

get_grid_nodes_per_face(grid, nodes_per_face)#

Get the number of nodes for each face.

Parameters:
  • grid (int) – A grid identifier.

  • nodes_per_face (ndarray of int, shape (nfaces,)) – A numpy array to place the number of nodes per face.

Returns:

The input numpy array that holds the number of nodes per face.

Return type:

ndarray of int

get_grid_origin(grid, origin)#

Get the origin for a structured grid.

get_grid_rank(grid)#

Get the number of dimensions of a grid.

get_grid_shape(grid, shape)#

Get the shape of a structured grid.

get_grid_size(grid)#

Get the total number of elements in the computational grid.

Parameters:

grid (int) – A grid identifier.

Returns:

Size of the grid.

Return type:

int

get_grid_spacing(grid, spacing)#

Get the row and column spacing of a structured grid.

get_grid_type(grid)#

Get the type of grid.

get_grid_x(grid, x)#

Get coordinates of grid nodes in the x direction.

Parameters:
  • grid (int) – A grid identifier.

  • x (ndarray of float, shape (nrows,)) – A numpy array to hold the x-coordinates of the grid node columns.

Returns:

The input numpy array that holds the grid’s column x-coordinates.

Return type:

ndarray of float

get_grid_y(grid, y)#

Get coordinates of grid nodes in the y direction.

Parameters:
  • grid (int) – A grid identifier.

  • y (ndarray of float, shape (ncols,)) – A numpy array to hold the y-coordinates of the grid node rows.

Returns:

The input numpy array that holds the grid’s row y-coordinates.

Return type:

ndarray of float

get_grid_z(grid, z)#

Get coordinates of grid nodes in the z direction.

Parameters:
  • grid (int) – A grid identifier.

  • z (ndarray of float, shape (nlayers,)) – A numpy array to hold the z-coordinates of the grid nodes layers.

Returns:

The input numpy array that holds the grid’s layer z-coordinates.

Return type:

ndarray of float

get_input_item_count()#

Count of a model’s input variables.

Returns:

The number of input variables.

Return type:

int

get_input_var_names()#

Names of the input exchange items.

get_output_item_count()#

Count of a model’s output variables.

Returns:

The number of output variables.

Return type:

int

get_output_var_names()#

Names of the output exchange items.

get_start_time()#

Start time of the component.

get_time_step()#

Component time step.

get_time_units()#

Time units used by the component.

get_value(name, dest)#

Get a copy of a variable’s data.

get_value_at_indices(name, dest, inds)#

Get values at particular indices.

Parameters:
  • name (str) – An input or output variable name, a CSDMS Standard Name.

  • dest (ndarray) – A numpy array into which to place the values.

  • inds (array_like) – The indices into the variable array.

Returns:

Value of the model variable at the given location.

Return type:

array_like

get_value_ptr(name)#

Get a reference to values of the given variable.

This is a getter for the model, used to access the model’s current state. It returns a reference to a model variable, with the return type, size and rank dependent on the variable.

Parameters:

name (str) – An input or output variable name, a CSDMS Standard Name.

Returns:

A reference to a model variable.

Return type:

array_like

get_value_ref(name)#

Get a reference to a variable’s data.

get_var_grid(name)#

Get the grid id for a variable.

get_var_itemsize(name)#

Get the size of elements of a variable.

get_var_location(name)#

Get the grid element type that the a given variable is defined on.

The grid topology can be composed of nodes, edges, and faces.

node

A point that has a coordinate pair or triplet: the most basic element of the topology.

edge

A line or curve bounded by two nodes.

face

A plane or surface enclosed by a set of edges. In a 2D horizontal application one may consider the word “polygon”, but in the hierarchy of elements the word “face” is most common.

Parameters:

name (str) – An input or output variable name, a CSDMS Standard Name.

Returns:

The grid location on which the variable is defined. Must be one of “node”, “edge”, or “face”.

Return type:

str

Notes

CSDMS uses the ugrid conventions to define unstructured grids.

get_var_nbytes(name)#

Get the total number of bytes used by a variable.

get_var_type(name)#

Get the data type for a variable.

get_var_units(name)#

Get the unit used by a variable.

initialize(config_file)#

Initialize the component from a file.

BMI-wrapped Landlab components use input files in YAML format. Component-specific parameters are listed at the top level, followed by grid and then time information. An example input file looks like:

flexure:
    eet: 15.e+3
clock:
    start: 0
    stop: 100.
    step: 2.
grid:
    type: raster
    shape: [20, 40]
    spacing: [1000., 2000.]

In this case, a RasterModelGrid is created (with the given shape and spacing) and passed to the underlying landlab component. The eet=15000. is also given to the component but as a keyword parameter. The BMI clock is initialized with the given parameters.

Parameters:

config_file (str or file_like) – YAML-formatted input file for the component.

set_value(name, values)#

Set the values of a variable.

set_value_at_indices(name, inds, src)#

Specify a new value for a model variable at particular indices.

Parameters:
  • name (str) – An input or output variable name, a CSDMS Standard Name.

  • inds (array_like) – The indices into the variable array.

  • src (array_like) – The new value for the specified variable.

update()#

Update the component one time step.

update_frac(frac)#

Update the component a fraction of a time step.

update_until(then)#

Update the component until a given time.

class TrickleDownProfilerBMI#

Bases: Bmi

Basic Modeling Interface for the TrickleDownProfiler component.

finalize()#

Clean-up the component.

get_component_name()#

Name of the component.

get_current_time()#

Current component time.

get_end_time()#

Stop time for the component.

get_grid_edge_count(grid)#

Get the number of edges in the grid.

Parameters:

grid (int) – A grid identifier.

Returns:

The total number of grid edges.

Return type:

int

get_grid_edge_nodes(grid, edge_nodes)#

Get the edge-node connectivity.

Parameters:
  • grid (int) – A grid identifier.

  • edge_nodes (ndarray of int, shape (2 x nnodes,)) – A numpy array to place the edge-node connectivity. For each edge, connectivity is given as node at edge tail, followed by node at edge head.

Returns:

The input numpy array that holds the edge-node connectivity.

Return type:

ndarray of int

get_grid_face_count(grid)#

Get the number of faces in the grid.

Parameters:

grid (int) – A grid identifier.

Returns:

The total number of grid faces.

Return type:

int

get_grid_face_edges(grid)#

Get the face-edge connectivity.

Parameters:
  • grid (int) – A grid identifier.

  • face_edges (ndarray of int) – A numpy array to place the face-edge connectivity.

Returns:

The input numpy array that holds the face-edge connectivity.

Return type:

ndarray of int

get_grid_face_nodes(grid, face_nodes)#

Get the face-node connectivity.

Parameters:
  • grid (int) – A grid identifier.

  • face_nodes (ndarray of int) – A numpy array to place the face-node connectivity. For each face, the nodes (listed in a counter-clockwise direction) that form the boundary of the face.

Returns:

The input numpy array that holds the face-node connectivity.

Return type:

ndarray of int

get_grid_node_count(grid)#

Get the number of nodes in the grid.

Parameters:

grid (int) – A grid identifier.

Returns:

The total number of grid nodes.

Return type:

int

get_grid_nodes_per_face(grid, nodes_per_face)#

Get the number of nodes for each face.

Parameters:
  • grid (int) – A grid identifier.

  • nodes_per_face (ndarray of int, shape (nfaces,)) – A numpy array to place the number of nodes per face.

Returns:

The input numpy array that holds the number of nodes per face.

Return type:

ndarray of int

get_grid_origin(grid, origin)#

Get the origin for a structured grid.

get_grid_rank(grid)#

Get the number of dimensions of a grid.

get_grid_shape(grid, shape)#

Get the shape of a structured grid.

get_grid_size(grid)#

Get the total number of elements in the computational grid.

Parameters:

grid (int) – A grid identifier.

Returns:

Size of the grid.

Return type:

int

get_grid_spacing(grid, spacing)#

Get the row and column spacing of a structured grid.

get_grid_type(grid)#

Get the type of grid.

get_grid_x(grid, x)#

Get coordinates of grid nodes in the x direction.

Parameters:
  • grid (int) – A grid identifier.

  • x (ndarray of float, shape (nrows,)) – A numpy array to hold the x-coordinates of the grid node columns.

Returns:

The input numpy array that holds the grid’s column x-coordinates.

Return type:

ndarray of float

get_grid_y(grid, y)#

Get coordinates of grid nodes in the y direction.

Parameters:
  • grid (int) – A grid identifier.

  • y (ndarray of float, shape (ncols,)) – A numpy array to hold the y-coordinates of the grid node rows.

Returns:

The input numpy array that holds the grid’s row y-coordinates.

Return type:

ndarray of float

get_grid_z(grid, z)#

Get coordinates of grid nodes in the z direction.

Parameters:
  • grid (int) – A grid identifier.

  • z (ndarray of float, shape (nlayers,)) – A numpy array to hold the z-coordinates of the grid nodes layers.

Returns:

The input numpy array that holds the grid’s layer z-coordinates.

Return type:

ndarray of float

get_input_item_count()#

Count of a model’s input variables.

Returns:

The number of input variables.

Return type:

int

get_input_var_names()#

Names of the input exchange items.

get_output_item_count()#

Count of a model’s output variables.

Returns:

The number of output variables.

Return type:

int

get_output_var_names()#

Names of the output exchange items.

get_start_time()#

Start time of the component.

get_time_step()#

Component time step.

get_time_units()#

Time units used by the component.

get_value(name, dest)#

Get a copy of a variable’s data.

get_value_at_indices(name, dest, inds)#

Get values at particular indices.

Parameters:
  • name (str) – An input or output variable name, a CSDMS Standard Name.

  • dest (ndarray) – A numpy array into which to place the values.

  • inds (array_like) – The indices into the variable array.

Returns:

Value of the model variable at the given location.

Return type:

array_like

get_value_ptr(name)#

Get a reference to values of the given variable.

This is a getter for the model, used to access the model’s current state. It returns a reference to a model variable, with the return type, size and rank dependent on the variable.

Parameters:

name (str) – An input or output variable name, a CSDMS Standard Name.

Returns:

A reference to a model variable.

Return type:

array_like

get_value_ref(name)#

Get a reference to a variable’s data.

get_var_grid(name)#

Get the grid id for a variable.

get_var_itemsize(name)#

Get the size of elements of a variable.

get_var_location(name)#

Get the grid element type that the a given variable is defined on.

The grid topology can be composed of nodes, edges, and faces.

node

A point that has a coordinate pair or triplet: the most basic element of the topology.

edge

A line or curve bounded by two nodes.

face

A plane or surface enclosed by a set of edges. In a 2D horizontal application one may consider the word “polygon”, but in the hierarchy of elements the word “face” is most common.

Parameters:

name (str) – An input or output variable name, a CSDMS Standard Name.

Returns:

The grid location on which the variable is defined. Must be one of “node”, “edge”, or “face”.

Return type:

str

Notes

CSDMS uses the ugrid conventions to define unstructured grids.

get_var_nbytes(name)#

Get the total number of bytes used by a variable.

get_var_type(name)#

Get the data type for a variable.

get_var_units(name)#

Get the unit used by a variable.

initialize(config_file)#

Initialize the component from a file.

BMI-wrapped Landlab components use input files in YAML format. Component-specific parameters are listed at the top level, followed by grid and then time information. An example input file looks like:

flexure:
    eet: 15.e+3
clock:
    start: 0
    stop: 100.
    step: 2.
grid:
    type: raster
    shape: [20, 40]
    spacing: [1000., 2000.]

In this case, a RasterModelGrid is created (with the given shape and spacing) and passed to the underlying landlab component. The eet=15000. is also given to the component but as a keyword parameter. The BMI clock is initialized with the given parameters.

Parameters:

config_file (str or file_like) – YAML-formatted input file for the component.

set_value(name, values)#

Set the values of a variable.

set_value_at_indices(name, inds, src)#

Specify a new value for a model variable at particular indices.

Parameters:
  • name (str) – An input or output variable name, a CSDMS Standard Name.

  • inds (array_like) – The indices into the variable array.

  • src (array_like) – The new value for the specified variable.

update()#

Update the component one time step.

update_frac(frac)#

Update the component a fraction of a time step.

update_until(then)#

Update the component until a given time.

class VegCABMI#

Bases: Bmi

Basic Modeling Interface for the VegCA component.

finalize()#

Clean-up the component.

get_component_name()#

Name of the component.

get_current_time()#

Current component time.

get_end_time()#

Stop time for the component.

get_grid_edge_count(grid)#

Get the number of edges in the grid.

Parameters:

grid (int) – A grid identifier.

Returns:

The total number of grid edges.

Return type:

int

get_grid_edge_nodes(grid, edge_nodes)#

Get the edge-node connectivity.

Parameters:
  • grid (int) – A grid identifier.

  • edge_nodes (ndarray of int, shape (2 x nnodes,)) – A numpy array to place the edge-node connectivity. For each edge, connectivity is given as node at edge tail, followed by node at edge head.

Returns:

The input numpy array that holds the edge-node connectivity.

Return type:

ndarray of int

get_grid_face_count(grid)#

Get the number of faces in the grid.

Parameters:

grid (int) – A grid identifier.

Returns:

The total number of grid faces.

Return type:

int

get_grid_face_edges(grid)#

Get the face-edge connectivity.

Parameters:
  • grid (int) – A grid identifier.

  • face_edges (ndarray of int) – A numpy array to place the face-edge connectivity.

Returns:

The input numpy array that holds the face-edge connectivity.

Return type:

ndarray of int

get_grid_face_nodes(grid, face_nodes)#

Get the face-node connectivity.

Parameters:
  • grid (int) – A grid identifier.

  • face_nodes (ndarray of int) – A numpy array to place the face-node connectivity. For each face, the nodes (listed in a counter-clockwise direction) that form the boundary of the face.

Returns:

The input numpy array that holds the face-node connectivity.

Return type:

ndarray of int

get_grid_node_count(grid)#

Get the number of nodes in the grid.

Parameters:

grid (int) – A grid identifier.

Returns:

The total number of grid nodes.

Return type:

int

get_grid_nodes_per_face(grid, nodes_per_face)#

Get the number of nodes for each face.

Parameters:
  • grid (int) – A grid identifier.

  • nodes_per_face (ndarray of int, shape (nfaces,)) – A numpy array to place the number of nodes per face.

Returns:

The input numpy array that holds the number of nodes per face.

Return type:

ndarray of int

get_grid_origin(grid, origin)#

Get the origin for a structured grid.

get_grid_rank(grid)#

Get the number of dimensions of a grid.

get_grid_shape(grid, shape)#

Get the shape of a structured grid.

get_grid_size(grid)#

Get the total number of elements in the computational grid.

Parameters:

grid (int) – A grid identifier.

Returns:

Size of the grid.

Return type:

int

get_grid_spacing(grid, spacing)#

Get the row and column spacing of a structured grid.

get_grid_type(grid)#

Get the type of grid.

get_grid_x(grid, x)#

Get coordinates of grid nodes in the x direction.

Parameters:
  • grid (int) – A grid identifier.

  • x (ndarray of float, shape (nrows,)) – A numpy array to hold the x-coordinates of the grid node columns.

Returns:

The input numpy array that holds the grid’s column x-coordinates.

Return type:

ndarray of float

get_grid_y(grid, y)#

Get coordinates of grid nodes in the y direction.

Parameters:
  • grid (int) – A grid identifier.

  • y (ndarray of float, shape (ncols,)) – A numpy array to hold the y-coordinates of the grid node rows.

Returns:

The input numpy array that holds the grid’s row y-coordinates.

Return type:

ndarray of float

get_grid_z(grid, z)#

Get coordinates of grid nodes in the z direction.

Parameters:
  • grid (int) – A grid identifier.

  • z (ndarray of float, shape (nlayers,)) – A numpy array to hold the z-coordinates of the grid nodes layers.

Returns:

The input numpy array that holds the grid’s layer z-coordinates.

Return type:

ndarray of float

get_input_item_count()#

Count of a model’s input variables.

Returns:

The number of input variables.

Return type:

int

get_input_var_names()#

Names of the input exchange items.

get_output_item_count()#

Count of a model’s output variables.

Returns:

The number of output variables.

Return type:

int

get_output_var_names()#

Names of the output exchange items.

get_start_time()#

Start time of the component.

get_time_step()#

Component time step.

get_time_units()#

Time units used by the component.

get_value(name, dest)#

Get a copy of a variable’s data.

get_value_at_indices(name, dest, inds)#

Get values at particular indices.

Parameters:
  • name (str) – An input or output variable name, a CSDMS Standard Name.

  • dest (ndarray) – A numpy array into which to place the values.

  • inds (array_like) – The indices into the variable array.

Returns:

Value of the model variable at the given location.

Return type:

array_like

get_value_ptr(name)#

Get a reference to values of the given variable.

This is a getter for the model, used to access the model’s current state. It returns a reference to a model variable, with the return type, size and rank dependent on the variable.

Parameters:

name (str) – An input or output variable name, a CSDMS Standard Name.

Returns:

A reference to a model variable.

Return type:

array_like

get_value_ref(name)#

Get a reference to a variable’s data.

get_var_grid(name)#

Get the grid id for a variable.

get_var_itemsize(name)#

Get the size of elements of a variable.

get_var_location(name)#

Get the grid element type that the a given variable is defined on.

The grid topology can be composed of nodes, edges, and faces.

node

A point that has a coordinate pair or triplet: the most basic element of the topology.

edge

A line or curve bounded by two nodes.

face

A plane or surface enclosed by a set of edges. In a 2D horizontal application one may consider the word “polygon”, but in the hierarchy of elements the word “face” is most common.

Parameters:

name (str) – An input or output variable name, a CSDMS Standard Name.

Returns:

The grid location on which the variable is defined. Must be one of “node”, “edge”, or “face”.

Return type:

str

Notes

CSDMS uses the ugrid conventions to define unstructured grids.

get_var_nbytes(name)#

Get the total number of bytes used by a variable.

get_var_type(name)#

Get the data type for a variable.

get_var_units(name)#

Get the unit used by a variable.

initialize(config_file)#

Initialize the component from a file.

BMI-wrapped Landlab components use input files in YAML format. Component-specific parameters are listed at the top level, followed by grid and then time information. An example input file looks like:

flexure:
    eet: 15.e+3
clock:
    start: 0
    stop: 100.
    step: 2.
grid:
    type: raster
    shape: [20, 40]
    spacing: [1000., 2000.]

In this case, a RasterModelGrid is created (with the given shape and spacing) and passed to the underlying landlab component. The eet=15000. is also given to the component but as a keyword parameter. The BMI clock is initialized with the given parameters.

Parameters:

config_file (str or file_like) – YAML-formatted input file for the component.

set_value(name, values)#

Set the values of a variable.

set_value_at_indices(name, inds, src)#

Specify a new value for a model variable at particular indices.

Parameters:
  • name (str) – An input or output variable name, a CSDMS Standard Name.

  • inds (array_like) – The indices into the variable array.

  • src (array_like) – The new value for the specified variable.

update()#

Update the component one time step.

update_frac(frac)#

Update the component a fraction of a time step.

update_until(then)#

Update the component until a given time.

class VegetationBMI#

Bases: Bmi

Basic Modeling Interface for the Vegetation component.

finalize()#

Clean-up the component.

get_component_name()#

Name of the component.

get_current_time()#

Current component time.

get_end_time()#

Stop time for the component.

get_grid_edge_count(grid)#

Get the number of edges in the grid.

Parameters:

grid (int) – A grid identifier.

Returns:

The total number of grid edges.

Return type:

int

get_grid_edge_nodes(grid, edge_nodes)#

Get the edge-node connectivity.

Parameters:
  • grid (int) – A grid identifier.

  • edge_nodes (ndarray of int, shape (2 x nnodes,)) – A numpy array to place the edge-node connectivity. For each edge, connectivity is given as node at edge tail, followed by node at edge head.

Returns:

The input numpy array that holds the edge-node connectivity.

Return type:

ndarray of int

get_grid_face_count(grid)#

Get the number of faces in the grid.

Parameters:

grid (int) – A grid identifier.

Returns:

The total number of grid faces.

Return type:

int

get_grid_face_edges(grid)#

Get the face-edge connectivity.

Parameters:
  • grid (int) – A grid identifier.

  • face_edges (ndarray of int) – A numpy array to place the face-edge connectivity.

Returns:

The input numpy array that holds the face-edge connectivity.

Return type:

ndarray of int

get_grid_face_nodes(grid, face_nodes)#

Get the face-node connectivity.

Parameters:
  • grid (int) – A grid identifier.

  • face_nodes (ndarray of int) – A numpy array to place the face-node connectivity. For each face, the nodes (listed in a counter-clockwise direction) that form the boundary of the face.

Returns:

The input numpy array that holds the face-node connectivity.

Return type:

ndarray of int

get_grid_node_count(grid)#

Get the number of nodes in the grid.

Parameters:

grid (int) – A grid identifier.

Returns:

The total number of grid nodes.

Return type:

int

get_grid_nodes_per_face(grid, nodes_per_face)#

Get the number of nodes for each face.

Parameters:
  • grid (int) – A grid identifier.

  • nodes_per_face (ndarray of int, shape (nfaces,)) – A numpy array to place the number of nodes per face.

Returns:

The input numpy array that holds the number of nodes per face.

Return type:

ndarray of int

get_grid_origin(grid, origin)#

Get the origin for a structured grid.

get_grid_rank(grid)#

Get the number of dimensions of a grid.

get_grid_shape(grid, shape)#

Get the shape of a structured grid.

get_grid_size(grid)#

Get the total number of elements in the computational grid.

Parameters:

grid (int) – A grid identifier.

Returns:

Size of the grid.

Return type:

int

get_grid_spacing(grid, spacing)#

Get the row and column spacing of a structured grid.

get_grid_type(grid)#

Get the type of grid.

get_grid_x(grid, x)#

Get coordinates of grid nodes in the x direction.

Parameters:
  • grid (int) – A grid identifier.

  • x (ndarray of float, shape (nrows,)) – A numpy array to hold the x-coordinates of the grid node columns.

Returns:

The input numpy array that holds the grid’s column x-coordinates.

Return type:

ndarray of float

get_grid_y(grid, y)#

Get coordinates of grid nodes in the y direction.

Parameters:
  • grid (int) – A grid identifier.

  • y (ndarray of float, shape (ncols,)) – A numpy array to hold the y-coordinates of the grid node rows.

Returns:

The input numpy array that holds the grid’s row y-coordinates.

Return type:

ndarray of float

get_grid_z(grid, z)#

Get coordinates of grid nodes in the z direction.

Parameters:
  • grid (int) – A grid identifier.

  • z (ndarray of float, shape (nlayers,)) – A numpy array to hold the z-coordinates of the grid nodes layers.

Returns:

The input numpy array that holds the grid’s layer z-coordinates.

Return type:

ndarray of float

get_input_item_count()#

Count of a model’s input variables.

Returns:

The number of input variables.

Return type:

int

get_input_var_names()#

Names of the input exchange items.

get_output_item_count()#

Count of a model’s output variables.

Returns:

The number of output variables.

Return type:

int

get_output_var_names()#

Names of the output exchange items.

get_start_time()#

Start time of the component.

get_time_step()#

Component time step.

get_time_units()#

Time units used by the component.

get_value(name, dest)#

Get a copy of a variable’s data.

get_value_at_indices(name, dest, inds)#

Get values at particular indices.

Parameters:
  • name (str) – An input or output variable name, a CSDMS Standard Name.

  • dest (ndarray) – A numpy array into which to place the values.

  • inds (array_like) – The indices into the variable array.

Returns:

Value of the model variable at the given location.

Return type:

array_like

get_value_ptr(name)#

Get a reference to values of the given variable.

This is a getter for the model, used to access the model’s current state. It returns a reference to a model variable, with the return type, size and rank dependent on the variable.

Parameters:

name (str) – An input or output variable name, a CSDMS Standard Name.

Returns:

A reference to a model variable.

Return type:

array_like

get_value_ref(name)#

Get a reference to a variable’s data.

get_var_grid(name)#

Get the grid id for a variable.

get_var_itemsize(name)#

Get the size of elements of a variable.

get_var_location(name)#

Get the grid element type that the a given variable is defined on.

The grid topology can be composed of nodes, edges, and faces.

node

A point that has a coordinate pair or triplet: the most basic element of the topology.

edge

A line or curve bounded by two nodes.

face

A plane or surface enclosed by a set of edges. In a 2D horizontal application one may consider the word “polygon”, but in the hierarchy of elements the word “face” is most common.

Parameters:

name (str) – An input or output variable name, a CSDMS Standard Name.

Returns:

The grid location on which the variable is defined. Must be one of “node”, “edge”, or “face”.

Return type:

str

Notes

CSDMS uses the ugrid conventions to define unstructured grids.

get_var_nbytes(name)#

Get the total number of bytes used by a variable.

get_var_type(name)#

Get the data type for a variable.

get_var_units(name)#

Get the unit used by a variable.

initialize(config_file)#

Initialize the component from a file.

BMI-wrapped Landlab components use input files in YAML format. Component-specific parameters are listed at the top level, followed by grid and then time information. An example input file looks like:

flexure:
    eet: 15.e+3
clock:
    start: 0
    stop: 100.
    step: 2.
grid:
    type: raster
    shape: [20, 40]
    spacing: [1000., 2000.]

In this case, a RasterModelGrid is created (with the given shape and spacing) and passed to the underlying landlab component. The eet=15000. is also given to the component but as a keyword parameter. The BMI clock is initialized with the given parameters.

Parameters:

config_file (str or file_like) – YAML-formatted input file for the component.

set_value(name, values)#

Set the values of a variable.

set_value_at_indices(name, inds, src)#

Specify a new value for a model variable at particular indices.

Parameters:
  • name (str) – An input or output variable name, a CSDMS Standard Name.

  • inds (array_like) – The indices into the variable array.

  • src (array_like) – The new value for the specified variable.

update()#

Update the component one time step.

update_frac(frac)#

Update the component a fraction of a time step.

update_until(then)#

Update the component until a given time.

class gFlexBMI#

Bases: Bmi

Basic Modeling Interface for the gFlex component.

finalize()#

Clean-up the component.

get_component_name()#

Name of the component.

get_current_time()#

Current component time.

get_end_time()#

Stop time for the component.

get_grid_edge_count(grid)#

Get the number of edges in the grid.

Parameters:

grid (int) – A grid identifier.

Returns:

The total number of grid edges.

Return type:

int

get_grid_edge_nodes(grid, edge_nodes)#

Get the edge-node connectivity.

Parameters:
  • grid (int) – A grid identifier.

  • edge_nodes (ndarray of int, shape (2 x nnodes,)) – A numpy array to place the edge-node connectivity. For each edge, connectivity is given as node at edge tail, followed by node at edge head.

Returns:

The input numpy array that holds the edge-node connectivity.

Return type:

ndarray of int

get_grid_face_count(grid)#

Get the number of faces in the grid.

Parameters:

grid (int) – A grid identifier.

Returns:

The total number of grid faces.

Return type:

int

get_grid_face_edges(grid)#

Get the face-edge connectivity.

Parameters:
  • grid (int) – A grid identifier.

  • face_edges (ndarray of int) – A numpy array to place the face-edge connectivity.

Returns:

The input numpy array that holds the face-edge connectivity.

Return type:

ndarray of int

get_grid_face_nodes(grid, face_nodes)#

Get the face-node connectivity.

Parameters:
  • grid (int) – A grid identifier.

  • face_nodes (ndarray of int) – A numpy array to place the face-node connectivity. For each face, the nodes (listed in a counter-clockwise direction) that form the boundary of the face.

Returns:

The input numpy array that holds the face-node connectivity.

Return type:

ndarray of int

get_grid_node_count(grid)#

Get the number of nodes in the grid.

Parameters:

grid (int) – A grid identifier.

Returns:

The total number of grid nodes.

Return type:

int

get_grid_nodes_per_face(grid, nodes_per_face)#

Get the number of nodes for each face.

Parameters:
  • grid (int) – A grid identifier.

  • nodes_per_face (ndarray of int, shape (nfaces,)) – A numpy array to place the number of nodes per face.

Returns:

The input numpy array that holds the number of nodes per face.

Return type:

ndarray of int

get_grid_origin(grid, origin)#

Get the origin for a structured grid.

get_grid_rank(grid)#

Get the number of dimensions of a grid.

get_grid_shape(grid, shape)#

Get the shape of a structured grid.

get_grid_size(grid)#

Get the total number of elements in the computational grid.

Parameters:

grid (int) – A grid identifier.

Returns:

Size of the grid.

Return type:

int

get_grid_spacing(grid, spacing)#

Get the row and column spacing of a structured grid.

get_grid_type(grid)#

Get the type of grid.

get_grid_x(grid, x)#

Get coordinates of grid nodes in the x direction.

Parameters:
  • grid (int) – A grid identifier.

  • x (ndarray of float, shape (nrows,)) – A numpy array to hold the x-coordinates of the grid node columns.

Returns:

The input numpy array that holds the grid’s column x-coordinates.

Return type:

ndarray of float

get_grid_y(grid, y)#

Get coordinates of grid nodes in the y direction.

Parameters:
  • grid (int) – A grid identifier.

  • y (ndarray of float, shape (ncols,)) – A numpy array to hold the y-coordinates of the grid node rows.

Returns:

The input numpy array that holds the grid’s row y-coordinates.

Return type:

ndarray of float

get_grid_z(grid, z)#

Get coordinates of grid nodes in the z direction.

Parameters:
  • grid (int) – A grid identifier.

  • z (ndarray of float, shape (nlayers,)) – A numpy array to hold the z-coordinates of the grid nodes layers.

Returns:

The input numpy array that holds the grid’s layer z-coordinates.

Return type:

ndarray of float

get_input_item_count()#

Count of a model’s input variables.

Returns:

The number of input variables.

Return type:

int

get_input_var_names()#

Names of the input exchange items.

get_output_item_count()#

Count of a model’s output variables.

Returns:

The number of output variables.

Return type:

int

get_output_var_names()#

Names of the output exchange items.

get_start_time()#

Start time of the component.

get_time_step()#

Component time step.

get_time_units()#

Time units used by the component.

get_value(name, dest)#

Get a copy of a variable’s data.

get_value_at_indices(name, dest, inds)#

Get values at particular indices.

Parameters:
  • name (str) – An input or output variable name, a CSDMS Standard Name.

  • dest (ndarray) – A numpy array into which to place the values.

  • inds (array_like) – The indices into the variable array.

Returns:

Value of the model variable at the given location.

Return type:

array_like

get_value_ptr(name)#

Get a reference to values of the given variable.

This is a getter for the model, used to access the model’s current state. It returns a reference to a model variable, with the return type, size and rank dependent on the variable.

Parameters:

name (str) – An input or output variable name, a CSDMS Standard Name.

Returns:

A reference to a model variable.

Return type:

array_like

get_value_ref(name)#

Get a reference to a variable’s data.

get_var_grid(name)#

Get the grid id for a variable.

get_var_itemsize(name)#

Get the size of elements of a variable.

get_var_location(name)#

Get the grid element type that the a given variable is defined on.

The grid topology can be composed of nodes, edges, and faces.

node

A point that has a coordinate pair or triplet: the most basic element of the topology.

edge

A line or curve bounded by two nodes.

face

A plane or surface enclosed by a set of edges. In a 2D horizontal application one may consider the word “polygon”, but in the hierarchy of elements the word “face” is most common.

Parameters:

name (str) – An input or output variable name, a CSDMS Standard Name.

Returns:

The grid location on which the variable is defined. Must be one of “node”, “edge”, or “face”.

Return type:

str

Notes

CSDMS uses the ugrid conventions to define unstructured grids.

get_var_nbytes(name)#

Get the total number of bytes used by a variable.

get_var_type(name)#

Get the data type for a variable.

get_var_units(name)#

Get the unit used by a variable.

initialize(config_file)#

Initialize the component from a file.

BMI-wrapped Landlab components use input files in YAML format. Component-specific parameters are listed at the top level, followed by grid and then time information. An example input file looks like:

flexure:
    eet: 15.e+3
clock:
    start: 0
    stop: 100.
    step: 2.
grid:
    type: raster
    shape: [20, 40]
    spacing: [1000., 2000.]

In this case, a RasterModelGrid is created (with the given shape and spacing) and passed to the underlying landlab component. The eet=15000. is also given to the component but as a keyword parameter. The BMI clock is initialized with the given parameters.

Parameters:

config_file (str or file_like) – YAML-formatted input file for the component.

set_value(name, values)#

Set the values of a variable.

set_value_at_indices(name, inds, src)#

Specify a new value for a model variable at particular indices.

Parameters:
  • name (str) – An input or output variable name, a CSDMS Standard Name.

  • inds (array_like) – The indices into the variable array.

  • src (array_like) – The new value for the specified variable.

update()#

Update the component one time step.

update_frac(frac)#

Update the component a fraction of a time step.

update_until(then)#

Update the component until a given time.

landlab.bmi.standard_names module#

Module contents#

class TimeStepper(start=0.0, stop=None, step=1.0, units='s')[source]#

Bases: object

Step through time.

Parameters:
  • start (float, optional) – Clock start time.

  • stop (float, optional) – Stop time.

  • step (float, optional) – Time step.

Examples

>>> from landlab.bmi import TimeStepper
>>> time_stepper = TimeStepper()
>>> time_stepper.start
0.0
>>> time_stepper.stop is None
True
>>> time_stepper.step
1.0
>>> time_stepper.time
0.0
>>> for _ in range(10):
...     time_stepper.advance()
...
>>> time_stepper.time
10.0
>>> time_stepper = TimeStepper(1.0, 13.0, 2.0)
>>> [time for time in time_stepper]
[1.0, 3.0, 5.0, 7.0, 9.0, 11.0]
advance()[source]#

Advance the time stepper by one time step.

property start#

Start time.

property step#

Time Step.

property stop#

Stop time.

property time#

Current time.

property units#

Time units.

wrap_as_bmi(cls)[source]#

Wrap a landlab class so it exposes a BMI.

Give a landlab component a Basic Model Interface (BMI). Since landlab components have an interface that is already in the style of BMI, this function adds just a light wrapping to landlab components. There are a number of differences that may cause some confusion to landlab users.

  1. Because BMI doesn’t have a concept of a dual grid, it only defines nodes (points), edges (vectors), and faces (areas). The dual-graph of landlab is considered as two separate grids by BMI.

  2. It is important to note that BMI has only three grid elements (node, edge, and face) while landlab has 6. The names used by landlab and BMI are also different.

    Thus, a BMI-wrapped landlab component will always have two grids with grid identifiers 0, and 1. Grid 0 will contain the landlab nodes, links, and patches while grid 1 will contain corners, faces, and cells.landlab and BMI refer to grid elements by different names. The mapping from landlab to BMI nomenclature is the following:

    Grid 0: * node: node * link: edge * patch: face

    Grid 1: * corner: node * face: edge * cell: face

  3. In BMI, the initialize method requires an input file that is used to create and setup the model for time-stepping. landlab components generally do not have anything like this; instead this task is usually done programmatically. Thus, the input file that is used by the BMI initialize method is a standard landlab input file as used by the landlab create_grid function.

Parameters:

cls (class) – A landlab class that inherits from Component.

Returns:

A wrapped class that exposes a BMI.

Return type:

class

Examples

>>> from landlab.bmi import wrap_as_bmi
>>> from landlab.components.flexure import Flexure
>>> BmiFlexure = wrap_as_bmi(Flexure)
>>> flexure = BmiFlexure()
>>> sorted(flexure.get_input_var_names())
['boundary_condition_flag', 'lithosphere__overlying_pressure_increment']
>>> flexure.get_var_units("lithosphere__overlying_pressure_increment")
'Pa'
>>> config = '''
... flexure:
...     eet: 10.e+3
...     method: flexure
... clock:
...     start: 0.
...     stop: 10.
...     step: 2.
... grid:
...     RasterModelGrid:
...     - [20, 40]
...     - xy_spacing: [2000., 1000.]
...     - fields:
...        node:
...          lithosphere__overlying_pressure_increment:
...            constant:
...              - value: 0.0
... '''
>>> flexure.initialize(config)
>>> sorted(flexure.get_output_var_names())
['boundary_condition_flag', 'lithosphere_surface__elevation_increment']
>>> flexure.get_var_grid("lithosphere_surface__elevation_increment")
0
>>> flexure.get_grid_shape(0, np.empty(flexure.get_grid_rank(0), dtype=int))
array([20, 40])
>>> dz = np.empty(flexure.get_grid_size(0))
>>> _ = flexure.get_value("lithosphere_surface__elevation_increment", dz)
>>> np.all(dz == 0.0)
True
>>> flexure.get_current_time()
0.0
>>> sorted(flexure.get_input_var_names())
['boundary_condition_flag', 'lithosphere__overlying_pressure_increment']
>>> load = np.zeros((20, 40), dtype=float)
>>> load[0, 0] = 1.0
>>> flexure.set_value("lithosphere__overlying_pressure_increment", load)
>>> flexure.update()
>>> flexure.get_current_time()
2.0
>>> _ = flexure.get_value("lithosphere_surface__elevation_increment", dz)
>>> np.all(dz == 0.0)
False