landlab.components.stream_power.stream_power_smooth_threshold

stream_power_smooth_threshold.py: Defines the StreamPowerSmoothThresholdEroder, which is a version of the FastscapeEroder (derived from it).

StreamPowerSmoothThresholdEroder uses a mathematically smooth threshold formulation, rather than one with a singularity. The erosion rate is defined as follows:

$omega = K A^m S$

$E = omega - omega_c left[ 1 - exp ( -omega / omega_c ) right]$

Created on Sat Nov 26 08:36:49 2016

@author: gtucker

class StreamPowerSmoothThresholdEroder[source]

Bases: FastscapeEroder

Stream erosion component with smooth threshold function.

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). NOTE: NOT PRESENTLY HONORED BY StreamPowerSmoothThresholdEroder (TODO)

  • threshold_sp (float (TODO: array, or field name)) – The threshold stream power.

  • 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.

Examples

>>> from landlab import RasterModelGrid
>>> rg = RasterModelGrid((3, 4))
>>> rg.set_closed_boundaries_at_grid_edges(False, True, True, True)
>>> z = rg.add_zeros("node", "topographic__elevation")
>>> z[5] = 2.0
>>> z[6] = 1.0
>>> from landlab.components import FlowAccumulator
>>> fr = FlowAccumulator(rg, flow_director="D4")
>>> fr.run_one_step()
>>> from landlab.components import StreamPowerSmoothThresholdEroder
>>> sp = StreamPowerSmoothThresholdEroder(rg, K_sp=1.0)
>>> sp.thresholds
1.0
>>> sp.run_one_step(dt=1.0)
>>> import numpy as np
>>> np.round(z[5:7], 3)
array([1.646, 0.667])
>>> z[5] = 2.0
>>> z[6] = 1.0
>>> import numpy as np
>>> q = np.zeros(rg.number_of_nodes) + 0.25
>>> q[6] = 100.0
>>> sp = StreamPowerSmoothThresholdEroder(rg, K_sp=1.0, discharge_field=q)
>>> sp.run_one_step(dt=1.0)
>>> np.round(z[5:7], 3)
array([1.754, 0.164])

References

Required Software Citation(s) Specific to this Component

Barnhart, K., Glade, R., Shobe, C., Tucker, G. (2019). Terrainbento 1.0: a Python package for multi-model analysis in long-term drainage basin evolution. Geoscientific Model Development 12(4), 1267–1297. https://dx.doi.org/10.5194/gmd-12-1267-2019

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 StreamPowerSmoothThresholdEroder.

property K

Erodibility (units depend on m_sp).

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

Initialize StreamPowerSmoothThresholdEroder.

static __new__(cls, *args, **kwds)
property alpha

Erosion term divided by link length.

Alpha is given as:

alpha = K A^m dt / L

where K is the erodibility, A is the drainage area, m is the drainage area exponent, dt is the timestep, and L is the link length.

cite_as = '\n    @article{barnhart2019terrain,\n      author = {Barnhart, Katherine R and Glade, Rachel C and Shobe, Charles M\n                and Tucker, Gregory E},\n      title = {{Terrainbento 1.0: a Python package for multi-model analysis in\n                long-term drainage basin evolution}},\n      doi = {10.5194/gmd-12-1267-2019},\n      pages = {1267---1297},\n      number = {4},\n      volume = {12},\n      journal = {Geoscientific Model Development},\n      year = {2019},\n    }\n    '
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'))
property delta

Erosion term divided by link length and erosion threshold.

delta is given as:

delta = K A^m dt / (L * omega_c)

where K is the erodibility, A is the drainage area, m is the drainage area exponent, dt is the timestep, L is the link length, and omega_c is the erosion threshold.

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 gamma

Erosion threshold times timestep.

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 = 'StreamPowerSmoothThresholdEroder'
optional_var_names = ()
output_var_names = ('topographic__elevation',)
run_one_step(dt, runoff_rate=None)[source]

Run one forward iteration of duration dt.

Parameters:
  • dt (float) – Time step size

  • runoff_rate ((not used yet)) – (to be added later)

Examples

>>> from landlab import RasterModelGrid
>>> rg = RasterModelGrid((3, 3))
>>> rg.set_closed_boundaries_at_grid_edges(False, True, True, True)
>>> z = rg.add_zeros("node", "topographic__elevation")
>>> z[4] = 1.0
>>> from landlab.components import FlowAccumulator
>>> fr = FlowAccumulator(rg, flow_director="D4")
>>> fr.run_one_step()
>>> from landlab.components import StreamPowerSmoothThresholdEroder
>>> sp = StreamPowerSmoothThresholdEroder(rg, K_sp=1.0)
>>> sp.run_one_step(dt=1.0)
>>> sp.alpha
array([0., 0., 0., 0., 1., 0., 0., 0., 0.])
>>> sp.gamma
array([0., 0., 0., 0., 1., 0., 0., 0., 0.])
>>> sp.delta
array([0., 0., 0., 0., 1., 0., 0., 0., 0.])
property shape

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

property thresholds

Erosion thresholds.

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