15B. Integration of RothCN in Miterra

Here we describe how the output calculated by Miterra is linked to the input to RothCN.

C & N inputs from various sources

crop residues

Calculations of organic C and N inputs from crop residues are described in Residue removal & incorporation.

For N input, it is assumed that all N in crop residues are in organic form.

Manure & grazing excretion

Organic C inputs from manure application and grazing excretion are calculated based on the N content and C:N ratios:

Equation 15B.1

where:

is the total N in applied manure or grazing excretion (kg N ha–1).

is the C:N ratio of manure or grazing excretion.

N in manure is present in both inorganic and organic forms.

Equation 15B.2

where:

is the fraction of organic N in total N.

Compost and sludge

Calculation of C and N (both inorganic and organic forms) content in compost and sludge is decribed in 8. Compost & Sludge.

Other sources

Other sources of mineral N input include:

  • Atmospheric deposition

  • Biological N fixation (BNF)

    The estimation of BNF for each type of crop is given in Biological N fixation. Only BNF by arable crops (including perennial crops) and grassland are counted as direct mineral N input. N-fixing microorganisms often form symbiosis with legume crops, and it is therefore assumed that BNF by soybeans and pulses are immediately taken up by those crops, and are returned to soil via residue incorporation.

Emissions and balances

After integration of RothCN into Miterra, the soil N pool is now separated into organic and mineral pools. Nitrogen inputs are partitioned into soil mineral or organic N pools according to their respective fractions of mineal and organic N content. The organic and mineral N pools are connected via mineralization or immobilization during soil organic matter descmposition. Soil mineral N pool is the only source for crop N uptake, N emissions, and losses.

roth cn miterra
Figure 15B.1: Integration of RothCN with Miterra.

Surface losses & crop removal

Surface losses include gaseous emissions (NH3, N2O, and NOx) and surface runoff, originating from fertiliser applications and grazing excretions. Calculations of these losses are based on total N content (both organic and mineral), and are described in 10. N Losses from Soil.

Crop removal refers to the part of N removed from the field by harvest and residue removal. Calculations are described in Harvested products and Residue removal & incorporation.

Leaching

In the original approach of Miterra, leaching is calculated as a fraction of soil total N surplus. With RothCN integration, leaching is now calculated as a fraction of corrected mineral N surplus in soil.

Equation 15B.3

where:

is the annual total gaseous emissions of NH3, NOx, and N2O from fertilization, grazing excretions, and residues (see 10. N Losses from Soil).

is the annual N losses from fertilization and grazing excretions via surface runoff (see Surface runoff).

is the annual N removed from the field by harvest and residue removal (see Harvested products and Residue removal & incorporation).

is the fraction of water flow that is leached (see Leaching).

Should N losses from soil mineral N pool be subtracted monthly, or annually?

Annually at the end of the year.

In Miterra, crop uptake, emissions, runoff, and leaching are all calculated as annual losses, and distributed evenly to 12 months over the year. Annual N inputs are divided as mineral and organic fractions, and distributed to monthly inputs in the same way. Due to lack of data and reliable estimation on soil mineral N content, RothCN assumed that soil mineral N pool at the beginning of the year to be 0.

In the first month of the simulation, the size of soil mineral N pool is only equal to the size of monthly mineral N input, plus the N mineralized from SOM decomposition in the first month. This value is very likely less than the estimated monthly losses. In this case, if losses are subtracted monthly, it will lead to a negative soil mineral N pool size. While the pool size may be reset to 0, the same problem will occur in the next month, and likely propagete to the rest of the year. In the end, this will lead to an underestimated N leaching, as the monthly soil mineral N surpluses for some months are 0.

This is avoided by calculating balances annually at the end of the year. Without substracting losses in each month, the soil mineral N pool accumulates inputs and mineralized N towards the end of thhe year. In this way, by the end of the year, the soil mineral N pool size reflects the annual mineral N input, and the annual potential net mineralization, which is more in line with the estimated annual losses.

Should surface losses be subtracted from input before addition, or from soil mineral N pool after decomposition?

From soil mineral N pool after decomposition.

N losses from soil surface, including gaseous emissions and surface runoff, are estimated in Miterra as total N. If these losses are subtracted from the input before addition, the following equations apply:

An unintended implicit assumption is made in this case: that in N losses, the fraction of fmineral comes from existing mineral N at the time of addition, and the fraction of forganic is attributed to be originating from organic N in the input material. However, this implicit assumption is not reliable.

To consider this matter from a mechanistic, process-based perspective: all organic N forms must be mineralized to inorganic N before they can be utilized by plants, or converted to gaseous emissions. However, determination of mineralization fraction before addition is not possible. Therefore, it is justifiable to substract N loss terms after calculation of SOM decomposition.

Implementation

The following pseudocode in Python gives an example of the implementation of the RothCN model. The pseudocode focuses on the logical sequence of model calculations rather than actual formulae. When applicable, the actual formulae are given in callouts and referenced to relevant sections in the model description.

Parameters and variables

Parameters used by the RothCN model are listed below. Parameter values are given in Table 15A.1.

k = {...}          # 1st-order decomposition rate constant of each SOM compartment.
f = {...}          # Partition fraction of organic C input to each SOM compartment
CNRatio_t = {...}  # Theoretical C:N ratio of each SOM compartment.

Variables used in calculation are listed below.

MineralNSources = ...    # Sources of mineral N inputs.

CarbonSources = {...}    # Sources of organic C inputs.
OrganicNSources = {...}  # Sources of organic N inputs.

SOC_Inputs = {...}      # Organic C inputs partitioned into each SOM compartment.
SON_Inputs = {...}      # Organic N inputs partitioned into each SOM compartment.

ModifyFactor = {...}    # Modifying factors for decomposition rate.
DecompFrac = {...}      # Decomposition fractions for each SOM compartment.
                        # Note that this variable is a nested dict.

SOC_init = ...          # Initial size of soil organic C pool.
SON_init = ...          # Initial size of soil organic N pool.
SoilCNRatio = ...       # C:N ratio of the soil.

SOC = {...}             # Present size of organic C in each SOM compartment.
SON = {...}             # Present size organic N in each SOM compartment.
CNRatio = {...}         # Present C:N ratio of each SOM compartment.
dSOC = {...}            # Decomposed organic C in each SOM compartment.
dSON = {...}            # N released from each SOM compartments during decomposition.

SoilOrganicN = ...      # Present size of soil organic N pool.
SoilMineralN = ...      # Present size of soil mineral N pool.

Flow structure

Calculate_C_N_Inputs()
Calculate_Modifying_Factors_Decomposition_Rates()
Initialize_SOM_Compartments()

for year in range(simulation_years):
    for month in range(12):
        Calculate_SOM_Turnover()

Calculate_Losses_Balance()

Step 1: Calculate C and N inputs

1.1 Calculate C and N inputs from each source

for source in ["Residues", "Manure", "Grazing", "Compost", "Sludge"]:
    CarbonSources[source] = ...  (1)
    OrganicNSources[source] = ...  (1)
    MineralNSources += ...  (2)

(3)
CarbonSources["Fertilisers"] = CarbonSources["Manure"] + CarbonSources["Grazing"] + \
                               CarbonSources["Compost"] + CarbonSources["Sludge"]

OrganicNSources["Fertilisers"] = OrganicNSources["Manure"] + OrganicNSources["Grazing"] + \
                                 OrganicNSources["Compost"] + OrganicNSources["Sludge"]
1 See C & N inputs from various sources.
2 See C & N inputs from various sources. Mineral N inputs from all sources are aggregated.
3 Organic inputs from organic fertilisers (manure, compost & sludge) and grazing excretion are aggregated.

1.2 Partition organic C inputs into SOM compartments

Organic C inputs from crop residues and organic fertilisers are partitioned into each SOM compartment according to their partition fractions (see Partitioning of organic carbon).

for compartment in ["DPM", "RPM"]:
    SOC_Inputs[compartment] = CarbonSources["Residues"] * f[compartment]  (1)

for compartment in ["DMA", "RMA", "HUM"]:
    for source in ["Manure", "Grazing", "Compost", "Sludge"]:
        SOC_Inputs[compartment] = CarbonSources[source] * f[compartment]  (2)
1 Note that annual and perennial crop residues have different partition fractions (see Table 15A.1).
2 Note that manure/grazing and compost/sludge have differenr partition fractions (see Table 15A.1).

1.3 Calculate organic N inputs to SOM compartments

Organic N inputs to each SOM compartment are calculated in 2 steps:

First, the theoretical size of organic N in each SOM compartment is determined based on the organic C addition and theoretical C:N ratio of the compartment.

# Calculate theoretical size of organic N in SOM compartments
for compartment in ["DPM", "RPM", "DMA", "RMA", "HUM"]:
    SON_Inputs[compartment] = SOC_Inputs[compartment] / CNRatio_t[compartment]

Second, the sum of the theoretical size of relavent compartments is checked with the actual organic N present in the input source. The theoretical sizes are then re-scaled so that the sum matches the input source (see Partitioning of organic nitrogen]).

# Re-partition
SON_Inputs["Residues"] = SON_Inputs["DPM"] + SON_Inputs["RPM"]
if SON_Inputs["Residues"] != OrganicNSources["Residues"]:
    for compartment in ["DPM", "RPM"]:
        SON_Inputs[compartment] *= OrganicNSources["Residues"] / SON_Inputs["Residues"]  (1)

SON_Inputs["Fertilisers"] = SON_Inputs["DMA"] + SON_Inputs["RMA"] + SON_Inputs["HUM"]
if SON_Inputs["Fertilisers"] != OrganicNSources["Fertilisers"]:
    for compartment in ["DMA", "RMA", "HUM"]:
        SON_Inputs[compartment] *= OrganicNSources["Fertilisers"] / SON_Inputs["Fertilisers"]  (1)

Step 2: Calculate rate modifying factors and decomposition fractions

for month in range(12):
    ModifyFactor[month] = ...  (1)

    for compartment in ["DPM", "RPM", "DMA", "RMA", "HUM", "BIO"]:
        DecompFrac[compartment][month] = ...  (2)

Step 3: Initialize SOM compartments

3.1 Initialize SOC compartments

Initial sizes of soil organic C pool, and organic C in each SOM compartment is calculated according to Initializing soil organic carbon pool.

SOC_init = ...  (1)

for compartment in ["DPM", "RPM", "DMA", "RMA", "HUM", "BIO", "IOM"]:
    SOC[compartment] = ...  (2)
1 See Equation 15A.10.
2 See Equation 15A.11 (input material compartments), Equation 15A.12 (IOM), Equation 15A.13 (BIO and HUM).

3.2 Initialize SON compartments

Initial sizes of soil organic N pool is determined from soil organic C pool and soil C:N ratio. Organic N in each SOM compartment is calculated from the size of organic C and theoretical compartment C:N ratio, followed by re-partitioning (see Initializing soil mineral and organic nitrogen pool).

SON_init = SOC_init / SoilCNRatio

for compartment in ["DPM", "RPM", "DMA", "RMA", "HUM", "BIO", "IOM"]:
    SON[compartment] = SOC[compartment] / CNRatio_t[compartment]

SON_total = sum(SON)
if SON_total != SON_init:
    for compartment in ["DPM", "RPM", "DMA", "RMA", "HUM", "BIO", "IOM"]:
        SON[compartment] *= SON_init / SON_total  (1)

Step 4: Calculate SOM turnover

The initial size of soil organic and mineral N pools are calculated. These two pools are used in mineralization and immobilization.

SoilOrganicN = sum(SON)  # = SON_init

# Assuming initial soil mineral N to be 0, as at present we don't
# have input data or good estimation on soil mineral N content.
SoilMineralN = 0

SOM turnover is calculated on a monthly time step. Calculations are performed within loops of years and months. The pseudocode below shows the calculations of each time step.

4.1 Add inputs

Partition annual inputs evenly to each month.

for compartment in ["DPM", "RPM", "DMA", "RMA", "HUM"]:
    SOC[compartment] += SOC_Inputs[compartment] / 12
    SON[compartment] += SON_Inputs[compartment] / 12

4.2 Calculate decomposition

Decomposition of SOM follows a 1st-order reaction kinetics. N released during decomposition is calculated from C:N ratios of each compartment.

for compartment in ["DPM", "RPM", "DMA", "RMA", "HUM", "BIO"]:
    CNRatio[compartment] = SOC[compartment] / SON[compartment]  (1)

    dSOC[compartment] = SOC[compartment] * DecompFrac[compartment][month]
    dSON[compartment] = dSOC[compartment] / CNRatio[compartment]  (2)
1 Potential division-by-zero error if the field has never received manure application. See Equation 15A.29.
2 See Equation 15A.30.

4.3 Calculation assimilation and CO2 emissions

Part of the decomposed SOC is emitted as CO2, and the remaining part is assimilated into BIO and HUM. The assimilated N is determined from C:N ratios.

CO2Emitted += ...  (1)

for compartment in ["HUM", "BIO"]:
    AssimilatedSOC[compartment] = ...  (2)
    AssimilatedSON[compartment] = ...  (3)

4.4 Handle mineralization or immobilization

Mineralization or immobilization is determined from the difference of N released and the assimilation requirement.

# Add organic and mineral N inputs to respective pools.
SoilOrganicN += sum(SON_Inputs) / 12
SoilMineralN += MineralNSources / 12

# Calculate the difference between released N and assimilation requirement.
N_difference = sum(dSON) - sum(AssimilatedSON)

if N_difference >= 0:
    # Mineralization takes place.
    # The amount of `N_difference` is later added to soil mineral N pool,
    # and a corresponding amount is deducted from organic N pool.
    # Nothing further needs to be performed in this step.
    pass

else:
    # Immobilization should take place.
    # TODO: See subsection below on how immobilization is handled.
    ...

# Update soil organic N and soil mineral N pools
SoilOrganicN -= N_difference
SoilMineralN += N_difference

Immobilization

In case of partial immobilization, Method 1: Partial fulfillment approach is used.

# Assuming that 80% of soil mineral N may be immobilized.
ImmobilizableSoilN = SoilMineralN * 0.8

if ImmobilizableSoilN >= abs(N_difference):
    # There is sufficient mineral N for immobilization.
    # Nothing further needs to be done here.
    # Since `N_difference` is < 0, the amount of `N_difference` will be
    # deducted from soil mineral N pool, and added to organic N pool.
    pass

else:
    # Soil mineral N is not sufficient for full immobilization.
    # Partial assimilation must take place.
    # In this case, the amount of `ImmobilizableSoilN` will be immobilized.
    N_difference = -ImmobilizableSoilN
    ImmobilizedN = sum(dSON) + ImmobilizableSoilN

    # BIO has priority for assimilation over HUM.
    if ImmobilizedN >= AssimilatedSON["BIO"]:
        AssimilatedSON["HUM"] = ImmobilizedN - AssimilatedSON["BIO"]
    else:
        AssimilatedSON["BIO"] = ImmobilizedN
        AssimilatedSON["HUM"] = 0

4.5 Update compartment size

Sizes of SOM compartments are updated at the end of the time step to reflect the changes.

for compartment in ["DPM", "RPM", "DMA", "RMA"]:
    SOC[compartment] -= dSOC[compartment]
    SON[compartment] -= dSON[compartment]

for compartment in ["HUM", "BIO"]:
    SOC[compartment] = SOC[compartment] - dSOC[compartment] + AssimilatedSOC[compartment]
    SON[compartment] = SON[compartment] - dSON[compartment] + AssimilatedSON[compartment]

Step 5: Calculate N losses and balances

N losses and balances are calculated in the last step. Note that while SOM turnover is calculated monthly, losses and balances are calculated on a yearly basis.

SoilMineralNSurplus = SoilMineralN - ...  (1)
Leaching = SoilMineralNSurplus * LeachingFraction  (1)

SON_Change = SoilOrganicN - SON_init