landlab.components.stream_power.fastscape_stream_power

Fastscape stream power erosion.

class FastscapeEroder[source]

Bases: Component

Fastscape stream power erosion.

This class uses the Braun-Willett Fastscape approach to calculate the amount of erosion at each node in a grid, following a stream power framework. This should allow it to be stable against larger timesteps than an explicit stream power scheme.

Note that although this scheme is nominally implicit, and will reach a numerically-correct solution under topographic steady state regardless of timestep length, the accuracy of transient solutions is not timestep independent (see Braun & Willett 2013, Appendix B for further details). Although the scheme remains significantly more robust and permits longer timesteps than a traditional explicit solver under such conditions, it is still possible to create numerical instability through use of too long a timestep while using this component. The user is cautioned to check their implementation is behaving stably before fully trusting it.

Stream power erosion is implemented as:

\[E = K A ^ m S ^ n - \textit{threshold_sp}\]

if \(K A ^ m S ^ n > \textit{threshold_sp}\), and:

\[E = 0,\]

if \(K A^m S^n <= \textit{threshold_sp}\).

This module assumes you have already run landlab.components.flow_accum.flow_accumulator.FlowAccumulator.run_one_step in the same timestep. It looks for ‘flow__upstream_node_order’, ‘flow__link_to_receiver_node’, ‘drainage_area’, ‘flow__receiver_node’, and ‘topographic__elevation’ at the nodes in the grid. ‘drainage_area’ should be in area upstream, not volume (i.e., set runoff_rate=1.0 when calling FlowAccumulator.run_one_step).

The primary method of this class is run_one_step.

Examples

>>> import numpy as np
>>> from landlab import RasterModelGrid
>>> from landlab.components import FlowAccumulator, FastscapeEroder
>>> grid = RasterModelGrid((5, 5), xy_spacing=10.0)
>>> z = [
...     [7.0, 7.0, 7.0, 7.0, 7.0],
...     [7.0, 5.0, 3.2, 6.0, 7.0],
...     [7.0, 2.0, 3.0, 5.0, 7.0],
...     [7.0, 1.0, 1.9, 4.0, 7.0],
...     [7.0, 0.0, 7.0, 7.0, 7.0],
... ]
>>> z = grid.add_field("topographic__elevation", z, at="node")
>>> fr = FlowAccumulator(grid, flow_director="D8")
>>> sp = FastscapeEroder(grid, K_sp=1.0)
>>> fr.run_one_step()
>>> sp.run_one_step(dt=1.0)
>>> z
array([7.        , 7.        , 7.        , 7.        , 7.        ,
       7.        , 2.92996598, 2.02996598, 4.01498299, 7.        ,
       7.        , 0.85993197, 1.87743897, 3.28268321, 7.        ,
       7.        , 0.28989795, 0.85403051, 2.42701526, 7.        ,
       7.        , 0.        , 7.        , 7.        , 7.        ])
>>> grid = RasterModelGrid((3, 7), xy_spacing=1.0)
>>> z = np.array(grid.node_x**2.0)
>>> z = grid.add_field("topographic__elevation", z, at="node")
>>> grid.status_at_node[grid.nodes_at_left_edge] = grid.BC_NODE_IS_FIXED_VALUE
>>> grid.status_at_node[grid.nodes_at_top_edge] = grid.BC_NODE_IS_CLOSED
>>> grid.status_at_node[grid.nodes_at_bottom_edge] = grid.BC_NODE_IS_CLOSED
>>> grid.status_at_node[grid.nodes_at_right_edge] = grid.BC_NODE_IS_CLOSED
>>> fr = FlowAccumulator(grid, flow_director="D8")
>>> sp = FastscapeEroder(grid, K_sp=0.1, m_sp=0.0, n_sp=2.0, threshold_sp=2.0)
>>> fr.run_one_step()
>>> sp.run_one_step(dt=10.0)
>>> z.reshape(grid.shape)[1, :]
array([ 0.        ,  1.        ,  4.        ,  8.52493772, 13.29039699,
       18.44367949, 36.        ])
>>> grid = RasterModelGrid((3, 7), xy_spacing=1.0)
>>> z = np.array(grid.node_x**2.0)
>>> z = grid.add_field("topographic__elevation", z, at="node")
>>> grid.status_at_node[grid.nodes_at_left_edge] = grid.BC_NODE_IS_FIXED_VALUE
>>> grid.status_at_node[grid.nodes_at_top_edge] = grid.BC_NODE_IS_CLOSED
>>> grid.status_at_node[grid.nodes_at_bottom_edge] = grid.BC_NODE_IS_CLOSED
>>> grid.status_at_node[grid.nodes_at_right_edge] = grid.BC_NODE_IS_CLOSED
>>> cell_area = 1.0
>>> fr = FlowAccumulator(grid, flow_director="D8", runoff_rate=2.0)
>>> grid.at_node["water__unit_flux_in"]
array([2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2.,
       2., 2., 2., 2., 2., 2., 2., 2.])
>>> K_field = grid.ones(at="node")  # K can be a field
>>> sp = FastscapeEroder(
...     grid,
...     K_sp=K_field,
...     m_sp=1.0,
...     n_sp=0.6,
...     threshold_sp=grid.node_x,
...     discharge_field="surface_water__discharge",
... )
>>> fr.run_one_step()
>>> sp.run_one_step(1.0)
>>> z.reshape(grid.shape)[1, :]
array([ 0.        ,  0.06474841,  0.58634459,  2.6725351 ,  8.4921219 ,
       20.92606983, 36.        ])

References

Required Software Citation(s) Specific to this Component

None Listed

Additional References

Braun, J., Willett, S. (2013). A very efficient O(n), implicit and parallel method to solve the stream power equation governing fluvial incision and landscape evolution. Geomorphology 180-181(C), 170-179. https://dx.doi.org/10.1016/j.geomorph.2012.10.008

Initialize the Fastscape stream power component. Note: a timestep, dt, can no longer be supplied to this component through the input file. It must instead be passed directly to the run method.

Parameters:
  • grid (ModelGrid) – A grid.

  • K_sp (float, array, or field name) – K in the stream power equation (units vary with other parameters).

  • m_sp (float, optional) – m in the stream power equation (power on drainage area).

  • n_sp (float, optional) – n in the stream power equation (power on slope).

  • threshold_sp (float, array, or field name) – Erosion threshold in the stream power equation.

  • discharge_field (float, field name, or array, optional) – Discharge [L^2/T]. The default is to use the grid field ‘drainage_area’. To use custom spatially/temporally varying rainfall, use ‘water__unit_flux_in’ to specify water input to the FlowAccumulator and use “surface_water__discharge” for this keyword argument.

  • erode_flooded_nodes (bool (optional)) – Whether erosion occurs in flooded nodes identified by a depression/lake mapper (e.g., DepressionFinderAndRouter). When set to false, the field flood_status_code must be present on the grid (this is created by the DepressionFinderAndRouter). Default True.

property K

Erodibility (units depend on m_sp).

__init__(grid, K_sp=0.001, m_sp=0.5, n_sp=1.0, threshold_sp=0.0, discharge_field='drainage_area', erode_flooded_nodes=True)[source]

Initialize the Fastscape stream power component. Note: a timestep, dt, can no longer be supplied to this component through the input file. It must instead be passed directly to the run method.

Parameters:
  • grid (ModelGrid) – A grid.

  • K_sp (float, array, or field name) – K in the stream power equation (units vary with other parameters).

  • m_sp (float, optional) – m in the stream power equation (power on drainage area).

  • n_sp (float, optional) – n in the stream power equation (power on slope).

  • threshold_sp (float, array, or field name) – Erosion threshold in the stream power equation.

  • discharge_field (float, field name, or array, optional) – Discharge [L^2/T]. The default is to use the grid field ‘drainage_area’. To use custom spatially/temporally varying rainfall, use ‘water__unit_flux_in’ to specify water input to the FlowAccumulator and use “surface_water__discharge” for this keyword argument.

  • erode_flooded_nodes (bool (optional)) – Whether erosion occurs in flooded nodes identified by a depression/lake mapper (e.g., DepressionFinderAndRouter). When set to false, the field flood_status_code must be present on the grid (this is created by the DepressionFinderAndRouter). Default True.

static __new__(cls, *args, **kwds)
cite_as = ''
property coords

Return the coordinates of nodes on grid attached to the component.

property current_time

Current time.

Some components may keep track of the current time. In this case, the current_time attribute is incremented. Otherwise it is set to None.

Return type:

current_time

definitions = (('drainage_area', "Upstream accumulated surface area contributing to the node's discharge"), ('flow__link_to_receiver_node', 'ID of link downstream of each node, which carries the discharge'), ('flow__receiver_node', 'Node array of receivers (node that receives flow from current node)'), ('flow__upstream_node_order', 'Node array containing downstream-to-upstream ordered list of node IDs'), ('topographic__elevation', 'Land surface topographic elevation'))
classmethod from_path(grid, path)

Create a component from an input file.

Parameters:
  • grid (ModelGrid) – A landlab grid.

  • path (str or file_like) – Path to a parameter file, contents of a parameter file, or a file-like object.

Returns:

A newly-created component.

Return type:

Component

property grid

Return the grid attached to the component.

initialize_optional_output_fields()

Create fields for a component based on its optional field outputs, if declared in _optional_var_names.

This method will create new fields (without overwrite) for any fields output by the component as optional. New fields are initialized to zero. New fields are created as arrays of floats, unless the component also contains the specifying property _var_type.

initialize_output_fields(values_per_element=None)

Create fields for a component based on its input and output var names.

This method will create new fields (without overwrite) for any fields output by, but not supplied to, the component. New fields are initialized to zero. Ignores optional fields. New fields are created as arrays of floats, unless the component specifies the variable type.

Parameters:

values_per_element (int (optional)) – On occasion, it is necessary to create a field that is of size (n_grid_elements, values_per_element) instead of the default size (n_grid_elements,). Use this keyword argument to acomplish this task.

input_var_names = ('drainage_area', 'flow__link_to_receiver_node', 'flow__receiver_node', 'flow__upstream_node_order', 'topographic__elevation')
name = 'FastscapeEroder'
optional_var_names = ()
output_var_names = ('topographic__elevation',)
run_one_step(dt)[source]

Erode for a single time step.

This method implements the stream power erosion across one time interval, dt, following the Braun-Willett (2013) implicit Fastscape algorithm.

This follows Landlab standardized component design, and supercedes the old driving method erode.

Parameters:

dt (float) – Time-step size

property shape

Return the grid shape attached to the component, if defined.

unit_agnostic = True
units = (('drainage_area', 'm**2'), ('flow__link_to_receiver_node', '-'), ('flow__receiver_node', '-'), ('flow__upstream_node_order', '-'), ('topographic__elevation', 'm'))
classmethod var_definition(name)

Get a description of a particular field.

Parameters:

name (str) – A field name.

Returns:

A description of each field.

Return type:

tuple of (name, *description*)

classmethod var_help(name)

Print a help message for a particular field.

Parameters:

name (str) – A field name.

classmethod var_loc(name)

Location where a particular variable is defined.

Parameters:

name (str) – A field name.

Returns:

The location (‘node’, ‘link’, etc.) where a variable is defined.

Return type:

str

var_mapping = (('drainage_area', 'node'), ('flow__link_to_receiver_node', 'node'), ('flow__receiver_node', 'node'), ('flow__upstream_node_order', 'node'), ('topographic__elevation', 'node'))
classmethod var_type(name)

Returns the dtype of a field (float, int, bool, str…).

Parameters:

name (str) – A field name.

Returns:

The dtype of the field.

Return type:

dtype

classmethod var_units(name)

Get the units of a particular field.

Parameters:

name (str) – A field name.

Returns:

Units for the given field.

Return type:

str