class ModelTemplate

Model Template

Additionally, a ModelTemplate provides a template for creating your own model derived from the terrainbentobase classes.

A template for making a derived terrainbento model.

This template shows all of the required parts of a new terrainbento model, designed and created by you

In this part of the documentation, we make sure to include hyperlinks to all landlab components used.

class ModelTemplate(clock, grid, m_sp=0.5, n_sp=1.0, water_erodibility=0.0001, regolith_transport_parameter=0.1, **kwargs)[source]

Bases: terrainbento.base_class.erosion_model.ErosionModel

ModelTemplate is a template for making your own terrainbento models.

This is where you will put introductory information about the model. We recommend that you start from an existing terrainbento model”s docstring and modify to preserve a somewhat standard style.

The docstring should have:

  1. A brief description of the model.

  2. Links to all landlab components used.

  3. Description of the governing equation of the model.

__init__(clock, grid, m_sp=0.5, n_sp=1.0, water_erodibility=0.0001, regolith_transport_parameter=0.1, **kwargs)[source]

Examples

This is where you can make code examples showing how to use the model you created. Here we typically put a very short example that shows a minimally complete parameter dictionary for creating an instance of the model.

Then in unit tests we include all possible analytical solutions and assertion tests needed to verify the model program is working as expected.

For example: This is a minimal example to demonstrate how to construct an instance of model ModelTemplate. Note that a YAML input file can be used instead of a parameter dictionary. For more detailed examples, including steady-state test examples, see the terrainbento tutorials.

To begin, import the model class.

>>> from terrainbento.model_template import ModelTemplate
>>> from landlab import RasterModelGrid
>>> from landlab.values import random
>>> from terrainbento import Clock, BasicStVs
>>> clock = Clock(start=0, stop=100, step=1)
>>> grid = RasterModelGrid((5,5))
>>> _ = random(grid, "topographic__elevation")

Construct the model.

>>> model = ModelTemplate(clock, grid)
finalize()[source]

Finalize model.

Put additional information about finalizing the model here.

my_internal_function()[source]

Do something necessary to instantiate or run ModelTemplate.

run_one_step(step)[source]

Run each component for one time step.

Put any additional information about run_one_step here. Importantly, run_one_step should only take on parameter, step.

main()[source]

Executes model.