Difference equation
RegionalGrasslandSim.initialize_parameters — Methodinitialize_parameters(; input_obj)Initialize all parameters and store them in one object.
RegionalGrasslandSim.input_WHC_PWP — Methodinput_WHC_PWP(; sand, silt, clay, organic, bulk, rootdepth)Derive walter holding capacity (WHC) and permanent wilting point (PWP) from soil properties.
\[\begin{align} θ₁ &= a₁ ⋅ \text{sand} + b₁ ⋅ \text{silt} + c₁ ⋅ \text{clay} + d₁ ⋅ \text{organic} + e₁ ⋅ \text{bulk} \\ \text{WHC} &= θ₁ ⋅ \text{rootdepth} \\ θ₂ &= a₂ ⋅ \text{sand} + b₂ ⋅ \text{silt} + c₂ ⋅ \text{clay} + d₂ ⋅ \text{organic} + e₂ ⋅ \text{bulk} \\ \text{PWP} &= θ₂ ⋅ \text{rootdepth} \end{align}\]
Equation and coefficients are taken from [19]. The coefficients a, b, c, d and e differ for the water holding capacity (matrix potential Ψ = -0.07 bar) and the permanent wilting point (matrix potential Ψ = -15 bar). The empirical coefficients that were estimated by [19] can be seen in the folling table:
| Ψ [bar] | a | b | c | d | e |
|---|---|---|---|---|---|
| -0.07 | 0.005678 | 0.009228 | 0.009135 | 0.006103 | -0.2696 |
| -15 | -5.9e-5 | 0.001142 | 0.005766 | 0.002228 | 0.02671 |
sand: sand content [%]silt: silt content [%]clay: clay content [%]bulk: bulk density [g cm⁻³]organic: organic matter content [%]rootdepth: rooting depth [mm]θ: water content [cm³ cm⁻³]WHC: water holding capacity [mm]PWP: permanent wilting point [mm]
RegionalGrasslandSim.input_nutrients — Methodinput_nutrients(; gradientm, total_N, CN_ratio)Derive a nutrient index by combining total nitrogen and carbon to nitrogen ratio.
\[ N = \frac{1}{1 + exp(-β₁ ⋅ \text{total_N} -β₂ ⋅ \text{CN_ratio}⁻¹)}\]
CN_ratio: carbon to nitrogen ratio [-]total_N: total nitrogen [g kg⁻¹]
RegionalGrasslandSim.main_loop! — Methodmain_loop!(; calc, ts, p)Run the main loop for all days.
RegionalGrasslandSim.one_day! — Methodone_day!(; calc, p, t)Calculate the density differences of all state variables of one day.
RegionalGrasslandSim.solve_prob — Methodsolve_prob(; input_obj, inf_p, calc = nothing)Solve the model for one site.
Intialize the parameters, the state variables and the output vectors. In addition some vectors are preallocated to avoid allocations in the main loop. Then, run the main loop and store the results in the output vectors.