RUFAS.routines.field.soil.phosphorus_cycling.soluble_phosphorus module#

class RUFAS.routines.field.soil.phosphorus_cycling.soluble_phosphorus.SolublePhosphorus(soil_data: SoilData | None, field_size: float | None = None)#

Bases: object

Tracks the movement of phosphorus in the soil profile using equations from the APLE (Agricultural Phosphorus Loss Estimator) model.

Parameters#

soil_dataSoilData, optional

An instance of SoilData for tracking the movement of phosphorus through the soil profile. If not provided, a new instance will be created with the specified field size.

field_sizefloat, optional

The size of the field (ha).

Attributes#

dataSoilData

The SoilData object that stores and manages the phosphorus data within the soil profile.

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

This method initializes the SoilData object that this module will work with, or create one if none provided.

Parameters#

soil_dataSoilData, optional

The SoilData object used by this module to track phosphorus as it moves through the soil profile, creates new one if one is not provided.

field_sizefloat, optional

Used to initialize a SoilData object for this module to work with, if a pre-configured SoilData object is not provided (ha).

daily_update_routine(runoff: float, field_size: float) None#

Removes phosphorus from the top layer of soil due to runoff, and moves phosphorus downward through the soil profile as water percolates through it.

Parameters#

runofffloat

Amount of rainfall that runs off the field on the current day (mm).

field_sizefloat

Size of the field (ha).

Notes#

This method is responsible for adjusting phosphorus levels in the soil profile as dictated by the two processes it simulates. First, if there is any runoff on the current day, it calculates how much phosphorus is lost from the top soil layer as a result and removes it. Then it iterates through the soil profile, calculating how much phosphorus is carried downward by percolating water and moving that phosphorus between the layers.

static _determine_phosphorus_runoff_from_top_soil(runoff: float, field_size: float, labile_phosphorus: float, bulk_density: float, layer_thickness: float) float#

This method calculates how much phosphorus is lost from the top soil layer to runoff.

Parameters#

runofffloat

Amount of rainfall that runs off the field on the current day (mm).

field_sizefloat

Size of the field (ha).

labile_phosphorusfloat

Concentration of labile phosphorus in the soil layer (kg / ha).

bulk_densityfloat

Density of the soil layer (megagrams / cubic meter).

layer_thicknessfloat

Thickness of the soil layer (mm).

Returns#

float

Amount of phosphorus removed from the soil layer by runoff water (kg / ha).

References#

APLE Theoretical eqn. [9] (used to calculate top_layer_dissolved_reactive_phosphorus_runoff)

static _determine_isotherm_slope(clay_fraction: float) float#

Calculates the slope of the linear phosphorus sorption isotherm.

Parameters#

clay_fractionfloat

Fraction clay content of a soil layer, expressed in the range [0, 1.0] (unitless).

Returns#

float

The slope of the phosphorus sorption isotherm (unitless).

References#

APLE Theoretical Documentation eqn. [15]

static _determine_isotherm_intercept(isotherm_slope: float) float#

Calculates the intercept of the linear phosphorus sorption isotherm.

Parameters#

isotherm_slopefloat

The slope of the phosphorus sorption isotherm (unitless).

Returns#

float

The intercept of the phosphorus sorption isotherm (unitless).

References#

APLE Theoretical Documentation eqn. [16]

static _determine_dissolved_reactive_phosphorus_leachate(soil_phosphorus: float, isotherm_slope: float, isotherm_intercept: float) float#

Calculates how much phosphorus can be leached out of a soil layer by percolation from layer.

Parameters#

soil_phosphorusfloat

Concentration of phosphorus in the soil layer (mg phosphorous per kg soil).

isotherm_slopefloat

Slope of the phosphorus sorption isotherm (unitless).

isotherm_intercept

Intercept of the phosphorus sorption isotherm (unitless).

Returns#

float

Concentration of dissolved phosphorus in the soil water that can be leached into the next layer (mg / L).

References#

APLE Theoretical Documentation eqn. [14]

Notes#

The maximum bound on the Phosphorus concentration of 20 milligrams per liter comes from page 8 of the APLE Theoretical documentation, in the paragraph below equations [16].

static _determine_percolated_water_volume(percolated_water: float, field_size: float) float#

Calculates the volume of water that is percolated out of a soil layer.

Parameters#

percolated_waterfloat

Amount of water that percolated out of the soil layer on a given day (mm).

field_sizefloat

Size of the field (ha).

Returns#

float

Volume of water that percolated out of the soil on the current day (L).

static _determine_phosphorus_percolated_from_layer(labile_phosphorus: float, bulk_density: float, layer_thickness: float, clay_fraction: float, percolated_water: float, field_size: float) float#

Calculates the actual amount of phosphorus that leaves a soil layer and enters the one below it.

Parameters#

labile_phosphorusfloat

The labile phosphorus content of this layer of soil (kg / ha).

bulk_densityfloat

The density of this soil layer (megagrams / cubic meter).

layer_thicknessfloat

The thickness of this layer of soil (mm).

clay_fractionfloat

The fraction of clay content expressed of soil in this layer, expressed as a number in the range [0, 1.0] (unitless).

percolated_waterfloat

The amount of water that percolated from this soil layer on the current day (mm).

field_sizefloat

The size of the field (ha).

Returns#

float

The amount of phosphorus that leaves this layer of soil on the current day (kg / ha).