<jupyter_start><jupyter_text>The soil production function This lesson produced by <NAME> and <NAME>. Last update (13/09/2021) Back in the late 1800s, people (including <NAME>) were speculating about the rates at which soil was formed. This might depend on things like the number of burrowing animals, the rock type, the number of plants, and other factors. The soil is "produced" from somewhere, and usually it is produced from some combination of conversion of rock to sediments, addition of organic matter, and deposition of dust. But we are going to focus on the conversion of rock material to sediment that can move. Gilbert suggested that the rate soil was produced (from underlying rocks) depended on the thickness of the soil. We can make a prediction about the relationship between soil thickness and the rate soil is produced, and we call this the *soil production function*.This function has proposed to have a few different forms, which we will explore below.   Exponential Soil Production In lectures we identified that the rate of weathering on a hillslope could be described as an exponential function that depends on soil depth, with weathering rates declining as soil gets deeper (Heimsath et al., 1997):$p = W_0 e^{-\frac{h}{\gamma}}$where $W_0$ is the soil production rate with no soil, and $\gamma$ is a length scale that determines how quickly soil production falls off with depth.Typical values for $W_0$ are in the range 0.01-1 mm/yr [(Perron, 2017)](http://www.annualreviews.org/doi/abs/10.1146/annurev-earth-060614-105405). Note that when you're doing numerical calculations you have to be consistent with units. We will always do calculations in length units of ***metres*** (m), time units of ***years*** (y) and mass units of ***kilograms*** (kg). However we might convert to other units for the purposes of plotting sensible numbers (e.g. Weathering rates in mm/y = m/y $\times$ 1000).Let's take a look at what this function looks like by plotting it with python:<jupyter_code>%matplotlib inline
import matplotlib.pyplot as plt
import numpy as np
h_locs = np.arange(0,2,0.1)<jupyter_output><empty_output><jupyter_text>We define the soil production function:<jupyter_code>def soil_prod_function(h_locs, W_0 = 0.0001, gamma = 0.4):
    P = np.multiply(W_0,  np.exp( - np.divide(h_locs,gamma)  )  )
    return P<jupyter_output><empty_output><jupyter_text>Now lets plot the function and see what it looks like.In the code below there are two soil production functions that you can compare. For example if you make `W_0` twice as much as `W_02` that means the second soil production function produces soil twice as fast as the first when there is no soil.<jupyter_code>plt.rcParams['figure.figsize'] = [10, 4]
plt.clf()

# TRY CHANGING THE FOUR PARAMETER BELOW
# These two are for the first soil production function
W_0 = 0.0001
gamma = 0.4

# These two are for the second soil production function
W_02 = 0.0002
gamma2 = 0.4

# This bit calculates the functions
P = soil_prod_function(h_locs, W_0 = W_0, gamma = gamma)
P2 = soil_prod_function(h_locs, W_0 = W_02, gamma = gamma2)

# The rest of this stuff makes the figure
f, ax = plt.subplots(1, 1)
ax.plot(h_locs, P*1000,label="P1")
ax.plot(h_locs, P2*1000,label="P2")
ax.set_xlabel("Soil thickness ($m$)")
ax.set_ylabel("Soil production (mm/yr)")
plt.title("Two soil production function. Try playing with the parameters!")
ax.legend()
plt.tight_layout()<jupyter_output><empty_output><jupyter_text>The peaked soil production function We also discussed in the lecture an alternative way in which soil may be produced: where there are very slow rates of soil production where there is bare bedrock, then soil peaks at some intermediate thickness before decreasing exponentially with increasing soil thickness. This model dates back to Gilbert (1877), and makes intuitive sense: water is needed for weathering processes as we discussed today. If there is bare bedrock, water is quickly transported through overland flow and little weathering can take place. If there is too much soil, then it's unlikely to be fully saturated down to the bedrock--soil interface.In this section, we will make some plots of a hypothetical peaked (or humped) soil production function.We will use the theoretical formulation from [Cox (1980)](https://onlinelibrary.wiley.com/doi/abs/10.1002/esp.3760050305) to calculate the weathering rate for a range of soil depths. This is a bit more complicated than the exponential function and has a bigger range of parameters:\begin{equation}W = W_0 (\alpha e^{-kh}) + (1 - \alpha)f \\f = \Bigg(1 + c\frac{h}{h_c} - \frac{h^2}{{h_c}^2}\Bigg)\end{equation}You should recognise some of these parameters from the exponential equation. The first part of the equation is the exponential function multiplied by a coefficient, $\alpha$. $W$ is still the weathering rate, $W_0$ is the inital rate of soil production where there is no soil, and $h$ is soil depth. There are two new parameters: $h_c$ is a critical soil depth (m), and $c$ is an empirical constant. Anhert (1977) suggests that $c$ might vary between 1.7 - 2.3, $h_c$ might vary between 0.6 - 1.5, and $\alpha$ between 0 - 1. If $\alpha = 1$, then the relationship is simply the exponential function.<jupyter_code># first, let's clear the original figure
plt.clf()
# make a new figure
fig, ax = plt.subplots()


k = 1

# define the critical depth for soil production
h_c = 0.5 #metres

# define the initial rate of soil production 
W_0 = 0.0005 #m/year

# define the constant c
c = 2 #dimensionless

# define alpha
alpha = 0.2

# calculate the weathering rate for the range of soil depths, h
f = (1 + c*(h_locs/h_c) - h_locs**2/h_c**2)
W = W_0 * (alpha * np.exp(-k*h_locs) + (1 - alpha)*f)

# plot the new result with a blue dashed line
ax.plot(h_locs,W*1000.,'--', color='blue', label = 'Peaked function')

# add a legend 
plt.legend(loc = 'upper right')

# set the y limit of the humped function to 0 (so we don't get negative weathering rates), and set the axis labels
ax.set_ylim(0,)
plt.xlabel("Soil Depth (m)")
plt.ylabel("Weathering Rate (mm/y)")
plt.title("The peaked soil production function")
plt.tight_layout()<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.0874616750040342, 'fraction_numerical': 0.02807810230756818, 'mean_word_length': 4.707182320441989, 'pattern_counts': {'":': 0, '<': 20, '<?xml version=': 0, '>': 20, 'https://': 1, 'lorem ipsum': 0, 'www.': 1, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '4', 'dir': 'jupyter-structured-clean-dedup', 'id': '14373', 'license': 'MIT', 'n_tokens_mistral': 1964, 'n_tokens_neox': 1796, 'n_words': 857, 'path': 'Soil_production_and_weathering/The_soil_production_function.ipynb', 'repo_name': 'simon-m-mudd/smm_teaching_notebooks', 'size': '6216'}