### Local installation of badlands-companion from GitHub Source: https://github.com/badlands-model/badlands/blob/master/docs/examples.rst If pip installation fails, clone the repository and run the setup script manually. This installs the companion functions locally. ```bash git clone https://github.com/badlands-model/badlands-companion.git cd badlands-companion python3 setup.py install ``` -------------------------------- ### Install badlands-companion from source Source: https://github.com/badlands-model/badlands/blob/master/docs/install.rst Install the badlands-companion package from its cloned repository using setup.py. ```bash cd ../../badlands-companion sudo python3 setup.py install ``` -------------------------------- ### Install badlands-companion via pip Source: https://github.com/badlands-model/badlands/blob/master/docs/examples.rst Install the companion Python package from PyPI. Use this to get the pre- and post-processing classes on your local environment. ```bash pip install badlands-companion ``` -------------------------------- ### Install badlands from source Source: https://github.com/badlands-model/badlands/blob/master/docs/install.rst Install the badlands package from the cloned repository using pip. ```bash sudo python3 -m pip install ./badlands ``` -------------------------------- ### Clone badlands and badlands-companion repositories Source: https://github.com/badlands-model/badlands/blob/master/docs/install.rst Clone the badlands and badlands-companion repositories from GitHub as the first step of the Git installation method. ```bash git clone https://github.com/badlands-model/badlands.git git clone https://github.com/badlands-model/badlands-companion.git ``` -------------------------------- ### Run badlands Docker container Source: https://github.com/badlands-model/badlands/blob/master/docs/install.rst Starts a new container from the badlandsmodel/badlands image, mapping port 8888 and mounting the current directory to /live/share. Use -it for interactive tty and -v for volume mapping. ```bash docker run -it -p 8888:8888 -v "$PWD":/live/share badlandsmodel/badlands ``` -------------------------------- ### Install badlands via PyPI with meshplex prerequisite Source: https://github.com/badlands-model/badlands/blob/master/docs/install.rst Install the required meshplex version and the badlands packages from PyPI. The meshplex dependency must be installed manually first because the PyPI version requires a license. ```bash sudo pip3 install git+https://github.com/kinnala/meshplex sudo pip3 install badlands sudo pip3 install badlands-companion ``` -------------------------------- ### Install documentation dependencies Source: https://github.com/badlands-model/badlands/blob/master/docs/README.md Install the Python packages required to build the Sphinx documentation. Run this in the same virtualenv or Python environment as Badlands. ```bash pip install -r requirements.txt ``` -------------------------------- ### Pull badlands Docker image Source: https://github.com/badlands-model/badlands/blob/master/docs/install.rst Downloads the badlandsmodel/badlands Docker image from Docker Hub. Only needed once before running the container. ```bash docker pull badlandsmodel/badlands ``` -------------------------------- ### Clone the badlands-workshop repository Source: https://github.com/badlands-model/badlands/blob/master/docs/examples.rst Use this command to clone the GitHub repository containing the Jupyter notebooks that demonstrate the main workflows for constructing and running surface processes models with badlands. ```bash git clone https://github.com/badlands-model/badlands-workshop.git ``` -------------------------------- ### Finite difference boundary conditions for flexure Source: https://github.com/badlands-model/badlands/blob/master/docs/xml.rst Defines boundary conditions for each edge (W, E, S, N) of the flexure model. Options include 0Displacement0Slope, 0Moment0Shear, 0Slope0Shear, Mirror, and Periodic. The example uses 0Displacement0Slope for all edges. ```xml 0Displacement0Slope 0Displacement0Slope 0Displacement0Slope 0Displacement0Slope ``` -------------------------------- ### XML declaration and root element Source: https://github.com/badlands-model/badlands/blob/master/docs/xml.rst The XML input file for badlands starts with the XML declaration and a root element named 'badlands' with an XML schema instance namespace. ```xml ``` -------------------------------- ### Wave definition XML structure Source: https://github.com/badlands-model/badlands/blob/master/docs/xml.rst Defines a wave event with start and end times, number of climates, and multiple climate entries specifying percentage of time, significant wave height, and wave direction. The wave field must be ordered by increasing start time with continuous time intervals without overlaps. Wave directions are reduced to 8 possible values (East, North, West, South, NE, NW, SW, SE). ```xml -14000. 0 3 0.3 2. 0 0.3 2. 30 0.4 2. 300 ``` -------------------------------- ### Carbonate growth definition XML structure Source: https://github.com/badlands-model/badlands/blob/master/docs/xml.rst Defines carbonate growth with initial basement structure, growth time interval, number of reef growth events, and per-event growth rates for two species. Events must be ordered by increasing start time with continuous time intervals without overlaps. Two carbonate types (species1 and species2) and hemipelagic deposition can be defined. ```xml data/base500south.csv 50. 2 -1000. -750. 0.009 0.005 -500. -250. 0. 0. ``` -------------------------------- ### Build documentation with Sphinx Source: https://github.com/badlands-model/badlands/blob/master/docs/README.md Build the HTML documentation using Sphinx. The READTHEDOCS=True environment variable is required to stub out FORTRAN components with MagicMock, as RTD's builder cannot compile them. ```bash READTHEDOCS=True make clean html ``` -------------------------------- ### Build dist directory for package release Source: https://github.com/badlands-model/badlands/blob/master/docs/README.md Build the distribution directory for a package release using the Python build module. ```bash python -m build ``` -------------------------------- ### Couple UWGeodynamics with Badlands surface processes Source: https://github.com/badlands-model/badlands/blob/master/docs/use.rst Sets up a Badlands surface process model within a UWGeodynamics simulation. Requires an XML file with Badlands input parameters as described in the documentation. The resulting Model is a 2-way coupled thermo-mechanical model with surface processes, where the velocity field from the thermo-mechanical model advects the surface in Badlands, and material distribution in the thermo-mechanical model is updated. It is recommended to use a higher spatial resolution in the surface processes model than in the thermo-mechanical model. ```python import UWGeodynamics as GEO u = GEO.u air = GEO.Material() sediment = GEO.Material() Model.surfaceProcesses = GEO.surfaceProcesses.Badlands( airIndex=[air.index], sedimentIndex=sediment.index, XML="resources/badlands.xml", resolution=1. * u.kilometre, checkpoint_interval=0.01 * u.megayears) ``` -------------------------------- ### Stream power law XML configuration (sp_law) Source: https://github.com/badlands-model/badlands/blob/master/docs/xml.rst XML block configuring the stream power law in badlands. Includes deposition toggle, critical slope, deposition percentage, lake fill thickness, m/n exponents, erodibility, marine deposit distribution, and hyperpycnal flow parameters. Defaults: dep=1, fillmax=200 m, diffnb=5, diffprop=0.9; optional parameters slp_cr, perc_dep, propa, propb, dens_cr, deepbasin. ```xml 1 0.001 0.5 50. 0.5 1.0 1.e-6 5 0.2 2000. 0.005 1060. -2500. ``` -------------------------------- ### Wave global parameters structure Source: https://github.com/badlands-model/badlands/blob/master/docs/xml.rst Configures wave simulation parameters including model selection (SWAN or WaveSed), time interval, grid resolution, wave base depth, sediment transport and diffusion steps. Defaults are noted for wmodel, wCd, wCe, tsteps, and dsteps. ```xml 0 250. 1000. 20 1 0.0001 50. 0.35 0.002 10 500 500 ``` -------------------------------- ### Simulation time structure XML Source: https://github.com/badlands-model/badlands/blob/master/docs/xml.rst Defines the simulation time parameters including restart settings, start/end times, time step bounds, display interval, and mesh output frequency. The restart element specifies the output folder and step number to resume from. ```xml ``` -------------------------------- ### Hillslope diffusion parameters XML configuration Source: https://github.com/badlands-model/badlands/blob/master/docs/xml.rst Defines the creep transport parameters for hillslope diffusion in badlands. Includes linear and non-linear diffusion coefficients, critical slope, and slope failure settings. The and parameters are optional with default value 0, meaning non-linear diffusion and slope failure are not considered unless specified. ```xml 0.001 0.005 0.8 10. 0.26 3. ``` -------------------------------- ### Orographic precipitation model definitions (two rain events) Source: https://github.com/badlands-model/badlands/blob/master/docs/xml.rst Two blocks using the Smith & Barstad (2004) orographic precipitation model. The first uses a linear elevation trend with , , , and . The second includes background precipitation (), wind components (, ), and optional parameters , , , , with documented defaults. ```xml 200000. 300000. 5000. 0.2 5. 3000. 300000. 400000. 5000. 1. 0.2 4. -3. 2. 1000. 1000. 0.005 0.005 3000. ``` -------------------------------- ### Precipitation structure with uniform and map-based rain events Source: https://github.com/badlands-model/badlands/blob/master/docs/xml.rst Defines the XML block with multiple events. The first uses a uniform precipitation value () and the second uses a precipitation map () in ASCII format with one column ordered like the topography file (lower left to upper right, row-wise). ```xml 4 0. 100000. 1. 100000. 200000. data/rainLR.csv ``` -------------------------------- ### Grid structure definition Source: https://github.com/badlands-model/badlands/blob/master/docs/xml.rst Defines the grid structure for the simulation, including the digital elevation model file path, optional resolution factor, boundary type, and optional depression-less surface option. The resfactor default is 1, nopit default is 0. ```xml data/regularMR.csv 2 slope 0 ``` -------------------------------- ### Tectonic structure XML Source: https://github.com/badlands-model/badlands/blob/master/docs/xml.rst Placeholder for tectonic structure configuration. The source does not provide the actual XML content. ```xml ``` -------------------------------- ### Sea-level structure XML Source: https://github.com/badlands-model/badlands/blob/master/docs/xml.rst Sets a relative sea-level position or defines a custom sea-level curve. The curve file is a two-column ASCII file with time and sea-level position; linear interpolation is used between points. ```xml -100. ``` -------------------------------- ### Stratal structure XML Source: https://github.com/badlands-model/badlands/blob/master/docs/xml.rst Optional element to record stratigraphic architecture. Requires horizontal resolution of the recording mesh and the time interval for recording. The grid resolution must be a factor of the topographic grid resolution, and the layer interval must be a multiple of the display interval. ```xml 500. 2500. 0.52 0.47 ```