RUFAS.routines.field.soil.nitrogen_cycling.mineralization_decomp module#

class RUFAS.routines.field.soil.nitrogen_cycling.mineralization_decomp.MineralizationDecomposition(soil_data: SoilData | None = None, field_size: float | None = None)#

Bases: object

This module is responsible for nitrogen mineralization and decomposition.

Parameters#

soil_dataSoilData, optional

The SoilData object used by this module to track nitrogen mineralization and decomposition, creates new one if one is not provided.

field_sizefloat, optional

Size of the field (ha).

Attributes#

dataSoilData

The SoilData object used by this module to track nitrogen mineralization and decomposition.

__init__(soil_data: SoilData | None = None, field_size: float | None = None)#
mineralize_and_decompose_nitrogen() None#

Conducts the daily mineralization and decomposition operations on the fresh organic nitrogen and residue in the top soil layer.

References#

SWAT Theoretical documentation section 3:1.2.2, specifically eqn. 3:1.2.9 (used to determine how much nitrogen gets transferred to the nitrate and active inorganic pools).

static _calculate_residue_nutrient_ratio(carbon_amount: float, organic_nutrient: float, inorganic_nutrient: float) float#

Calculates the ratio carbon to the nutrient passed in the soil layer.

Parameters#

carbon_amountfloat

Amount of carbon in the soil layer (kg / ha).

organic_nutrientfloat

Amount of organic nutrients in the soil layer (kg / ha).

inorganic_nutrientfloat

Amount of inorganic nutrients in the soil layer (kg / ha).

Returns#

float

The residue nutrient ratio for the nutrient passed (unitless).

References#

SWAT Theoretical documentation, eqn. 3:1.2.5, 6

Notes#

The equations for determining the carbon-nitrogen ratio and carbon-phosphorus ratio are identical in structure so they have been implemented in the same method, hence why this method takes in a generic nutrient. Also, if there are no nutrients in the soil, the carbon to nutrient ratio is set to be infinite.

static _calculate_nutrient_term_for_residue_composition_factor(nutrient_ratio: float, constant_term: float) float#

Calculates terms that used to determine the nutrient cycling composition factor.

Parameters#

nutrient_ratiofloat

The ratio of carbon to a specific nutrient (unitless).

constant_termfloat

The constant term used in this equation (unitless).

Returns#

float

One of the terms used in the equation to calculate the nutrient cycling residue composition factor.

References#

SWAT Theoretical documentation eqn. 3:1.2.8

Notes#

This is a helper method for the method that actually calculates the nutrient cycling residue composition factor. It is used for both the nitrogen and phosphorus terms, hence why it takes a generic “nutrient_ratio” and different constants.

When calculating the nitrogen term, the constant is 25. For phosphorus, it is 200.

static _calculate_nutrient_cycling_residue_composition_factor(carbon_nitrogen_ratio: float, carbon_phosphorus_ratio: float) float#

Calculates the residue composition factor for use in computing the decay rate constant.

Parameters#

carbon_nitrogen_ratiofloat

Ratio of carbon to nitrogen in this layer of the soil profile (unitless).

carbon_phosphorus_ratiofloat

Ratio of carbon to phosphorus in this layer of the soil profile (unitless).

Returns#

The nutrient cycling residue composition factor (unitless).

References#

SWAT Theoretical documentation eqn. 3:1.2.8

Notes#

The values of the constant used to determine the nitrogen and phosphorus terms are 25 and 200, respectively.

static _calculate_decay_rate_constant(fresh_organic_residue_mineralization_rate: float, residue_composition_factor: float, temp_factor: float, moisture_factor) float#

Calculates the decay rate constant for residue.

Parameters#

fresh_organic_residue_mineralization_ratefloat

Rate coefficient for mineralization of fresh organic nutrients from residue (unitless).

residue_composition_factorfloat

Nutrient cycling residue composition factor for the current soil layer (unitless).

temp_factorfloat

Nutrient cycling temperature factor for the current soil layer (unitless).

moisture_factorfloat

Nutrient cycling water factor for the current soil layer (unitless).

Returns#

The decay rate constant for residue decomposition (unitless).

References#

SWAT Theoretical documentation eqn. 3:1.2.7

Notes#

The definition for the rate coefficient for mineralization of the residue fresh organic nutrients can be found in the SWAT Input .BSN file (see “RSDCO” on page 101) and SWAT Input CROP.DAT file (see “RSDCO_PL” on page 205).