RUFAS.routines.field.soil.carbon_cycling.pool_gas_partition module#

class RUFAS.routines.field.soil.carbon_cycling.pool_gas_partition.PoolGasPartition(soil_data: SoilData | None, field_size: float | None = None)#

Bases: object

Manages the partitioning of carbon between different soil pools and the atmosphere, contributing to the overall carbon cycling within a field.

Parameters#

soil_dataSoilData, optional

The SoilData object used by this module to track carbon in 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).

Attributes#

dataSoilData

The SoilData object used by this module to track carbon in the soil profile, creates new one if one is not provided.

References#

pseudocode_soil S.6.C.1 to S.6.C.13

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

Main routine to update variables associated with gas partitioning in all layers.

Notes#

This method applies all the gas-partitioning sub routines to each layer of soil that is present in the soil data object.

static _determine_soil_passive_carbon_amount(passive_carbon_amount: float, slow_to_passive_carbon_amount: float, active_carbon_to_passive_amount: float, passive_carbon_decomposition_amount: float) float#

Aggregate the total amount of passive carbon in the layer.

This function updates the passive carbon stored in the soil based on the provided inputs.

Parameters#

passive_carbon_amountfloat

Passive carbon stored in the soil (kg/ha).

slow_to_passive_carbon_amountfloat

Slow carbon decomposed into passive carbon (kg/ha).

active_carbon_to_passive_amountfloat

Active carbon decomposed into passive carbon (kg/ha).

passive_carbon_decomposition_amountfloat

Passive carbon decomposed into active or passive carbon and CO2 (kg/ha).

Returns#

float

Updated passive carbon stored in the soil (kg/ha).

References#

pseudocode_soil Reference: S.6.C.13.

static _determine_soil_slow_carbon_amount(slow_carbon_amount: float, plant_structural_slow_carbon_remaining: float, soil_structural_slow_carbon_remaining: float, active_carbon_to_slow_amount: float, slow_carbon_decomposition_amount: float)#

Aggregate the total amount of slow carbon in the layer.

This function updates the slow carbon stored in the soil based on the provided inputs.

Parameters#

slow_carbon_amountfloat

Slow carbon stored in the soil (kg/ha).

plant_structural_slow_carbon_remainingfloat

Plant metabolic carbon decomposed to slow carbon after accounting for carbon dioxide loss (kg/ha).

soil_structural_slow_carbon_remainingfloat

Soil structural carbon decomposed to slow carbon after accounting for carbon dioxide loss (kg/ha).

active_carbon_to_slow_amountfloat

Active carbon decomposed into slow carbon (kg/ha).

slow_carbon_decomposition_amountfloat

Slow carbon decomposed into active or passive carbon and CO2 (kg/ha).

Returns#

float

Updated slow carbon stored in the soil (kg/ha).

References#

pseudocode_soil Reference: S.6.C.12.

static _determine_plant_active_decompose_carbon(plant_metabolic_active_carbon_remaining: float, plant_structural_active_carbon_remaining: float) float#

Calculate plant carbon decomposed into the active carbon pool in the layer (kg/ha).

Parameters#

plant_metabolic_active_carbon_remainingfloat

Plant metabolic carbon decomposed to active carbon after accounting for carbon dioxide loss (kg/ha).

plant_structural_active_carbon_remainingfloat

Plant structural carbon decomposed to active carbon after accounting for carbon dioxide loss (kg/ha).

Returns#

float

Plant carbon decomposed into the active carbon pool (kg/ha).

References#

pseudocode_soil Reference: S.6.C.11.

static _determine_soil_active_decompose_carbon(soil_metabolic_active_carbon_remaining: float, soil_structural_active_carbon_remaining: float) float#

Calculate soil carbon decomposed into the active carbon pool in the layer (kg/ha).

Parameters#

soil_metabolic_active_carbon_remainingfloat

Soil metabolic carbon decomposed to active carbon after accounting for carbon dioxide loss (kg/ha).

soil_structural_active_carbon_remainingfloat

Soil structural carbon decomposed to active carbon after accounting for carbon dioxide loss (kg/ha).

Returns#

float

Soil carbon decomposed into the active carbon pool (kg/ha).

References#

pseudocode_soil Reference: S.6.C.11.

static _determine_soil_active_carbon_amount(active_carbon_amount: float, plant_active_decompose_carbon: float, soil_active_decompose_carbon: float, passive_to_active_carbon_amount: float, slow_to_active_carbon_amount: float, active_carbon_decomposition_amount: float) float#

Aggregate the total amount of active carbon in the layer.

Parameters#

active_carbon_amountfloat

Active carbon stored in the soil (kg/ha).

plant_active_decompose_carbonfloat

Plant carbon decomposed into the active carbon pool (kg/ha).

soil_active_decompose_carbonfloat

Soil carbon decomposed into the active carbon pool (kg/ha).

passive_to_active_carbon_amountfloat

Passive carbon decomposed into active carbon (kg/ha).

slow_to_active_carbon_amountfloat

Slow carbon decomposed into active carbon (kg/ha).

active_carbon_decomposition_amountfloat

Active carbon decomposed into slow or passive carbon and CO2 (kg/ha).

Returns#

float

Updated active carbon stored in the soil (kg/ha).

References#

pseudocode_soil Reference: S.6.C.11.

static _determine_passive_to_active_carbon_amount(passive_carbon_decomposition_amount: float, passive_carbon_loss_rate=0.55) float#

Calculate passive carbon decomposed into active carbon in the layer (kg/ha).

Parameters#

passive_carbon_decomposition_amountfloat

Passive carbon decomposed into active or passive carbon and CO2 (kg/ha).

passive_carbon_loss_ratefloat

Fraction of passive carbon lost as CO2 during decomposition (unitless).

Returns#

float

Passive carbon decomposed into active carbon (kg/ha).

References#

pseudocode_soil Reference: S.6.C.10.

static _determine_passive_carbon_co2_lost_amount(passive_carbon_decomposition_amount: float, passive_carbon_loss_rate=0.55) float#

Calculate passive carbon lost as CO2 during decomposition in the layer (kg/ha).

Parameters#

passive_carbon_decomposition_amountfloat

Passive carbon decomposed into active or passive carbon and CO2 (kg/ha).

passive_carbon_loss_ratefloat

Fraction of passive carbon lost as CO2 during decomposition (unitless).

Returns#

float

Passive carbon lost as CO2 during decomposition (kg/ha).

References#

pseudocode_soil Reference: S.6.C.10.

static _determine_slow_to_active_carbon_amount(slow_carbon_decomposition_amount: float, slow_carbon_passive_decompose_rate=0.03, slow_carbon_loss_rate=0.55) float#

Calculate slow carbon decomposed into active carbon in the layer (kg/ha).

Parameters#

slow_carbon_decomposition_amountfloat

Slow carbon decomposed into active or passive carbon and CO2 (kg/ha).

slow_carbon_passive_decompose_ratefloat

Fraction of slow carbon decomposed into passive carbon (unitless).

slow_carbon_loss_ratefloat

Fraction of slow carbon lost as CO2 during decomposition (unitless).

Returns#

float

Slow carbon decomposed into active carbon (kg/ha).

References#

pseudocode_soil Reference: S.6.C.9.

static _determine_slow_carbon_co2_lost_amount(slow_carbon_decomposition_amount: float, slow_carbon_loss_rate=0.55) float#

Calculate slow carbon lost as CO2 during decomposition in the layer (kg/ha).

Parameters#

slow_carbon_decomposition_amountfloat

Slow carbon decomposed into active or passive carbon and CO2 (kg/ha).

slow_carbon_loss_ratefloat

Fraction of slow carbon lost as CO2 during decomposition (unitless).

Returns#

float

Slow carbon lost as CO2 during decomposition (kg/ha).

References#

pseudocode_soil Reference: S.6.C.9.

static _determine_slow_to_passive_carbon_amount(slow_carbon_decomposition_amount: float, slow_carbon_passive_decompose_rate=0.03) float#

Calculate slow carbon decomposed into passive carbon in the layer (kg/ha).

Parameters#

slow_carbon_decomposition_amountfloat

Slow carbon decomposed into active or passive carbon and CO2 (kg/ha).

slow_carbon_passive_decompose_ratefloat

Fraction of slow carbon decomposed into passive carbon (unitless).

Returns#

float

Slow carbon decomposed into passive carbon (kg/ha).

References#

pseudocode_soil Reference: S.6.C.9.

static _determine_active_carbon_to_passive_amount(active_carbon_decomposition_amount: float) float#

Calculate active carbon decomposed into passive carbon in the layer (kg/ha).

Parameters#

active_carbon_decomposition_amountfloat

Active carbon decomposed into slow or passive carbon and CO2 (kg/ha).

Returns#

float

Active carbon decomposed into passive carbon (kg/ha).

References#

pseudocode_soil Reference: S.6.C.8.

static _determine_active_carbon_to_slow_loss(active_carbon_decomposition_amount: float, carbon_lost_adjusted_factor: float) float#

Calculate active carbon lost as CO2 during decomposition into slow carbon in the layer (kg/ha).

Parameters#

active_carbon_decomposition_amountfloat

Active carbon decomposed into slow or passive carbon and CO2 (kg/ha).

carbon_lost_adjusted_factorfloat

Adjusted factor of CO2 loss from the decomposition of active carbon.

Returns#

float

Active carbon lost as CO2 during decomposition into slow carbon (kg/ha).

References#

pseudocode_soil Reference: S.6.C.7.

static _determine_active_carbon_to_slow_amount(active_carbon_decomposition_amount: float, carbon_lost_adjusted_factor: float) float#

Calculate active carbon decomposed into slow carbon in the layer (kg/ha).

Parameters#

active_carbon_decomposition_amountfloat

Active carbon decomposed into slow or passive carbon and CO2 (kg/ha).

carbon_lost_adjusted_factorfloat

Adjusted factor of CO2 loss from the decomposition of active carbon.

Returns#

float

Active carbon decomposed into slow carbon (kg/ha).

References#

pseudocode_soil Reference: S.6.C.7.

static _determine_carbon_lost_adjusted_factor(silt_clay_content: float) float#

Calculate the adjusted factor of CO2 loss from the decomposition of active carbon in the layer.

Parameters#

silt_clay_contentfloat

Fraction of silt and clay content in the soil (unitless).

Returns#

float

Adjusted factor of CO2 loss from the decomposition of active carbon.

References#

pseudocode_soil Reference: S.6.C.6.

static _determine_passive_carbon_decomposition_amount(decomposition_moisture_effect: float, decomposition_temperature_effect: float, passive_carbon_amount: float, passive_carbon_decomposition_factor=0.00013) float#

Calculate passive carbon decomposed into active or passive carbon and CO2 in the layer (kg/ha).

Parameters#

decomposition_moisture_effectfloat

Moisture effect on decomposition factor (unitless) (pseudocode_soil S.6.A.2).

decomposition_temperature_effectfloat

Temperature effect on decomposition factor (unitless) (pseudocode_soil S.6.A.1).

passive_carbon_amountfloat

Passive carbon stored in the soil (kg/ha).

passive_carbon_decomposition_factorfloat

Passive carbon decomposition factor.

Returns#

float

Passive carbon decomposed into active or passive carbon and CO2 (kg/ha).

References#

pseudocode_soil Reference: S.6.C.5.

static _determine_slow_carbon_decomposition_amount(decomposition_moisture_effect: float, decomposition_temperature_effect: float, slow_carbon_amount: float, slow_carbon_decomposition_factor=0.0038) float#

Calculate slow carbon decomposed into active or passive carbon and CO2 in the layer (kg/ha).

Parameters#

decomposition_moisture_effectfloat

Moisture effect on decomposition factor (unitless) (pseudocode_soil S.6.A.2).

decomposition_temperature_effectfloat

Temperature effect on decomposition factor (unitless) (pseudocode_soil S.6.A.1).

slow_carbon_amountfloat

Slow carbon stored in the soil (kg/ha).

slow_carbon_decomposition_factorfloat

Slow carbon decomposition factor.

Returns#

float

Slow carbon decomposed into active or passive carbon and CO2 (kg/ha).

References#

pseudocode_soil Reference: S.6.C.4.

static _determine_active_carbon_decomposition_amount(moisture_effect: float, temperature_effect: float, active_carbon: float, active_carbon_decomposition_rate: float) float#

Calculate active carbon decomposed into slow or passive carbon and CO2 in the layer (kg/ha).

Parameters#

moisture_effectfloat

Moisture effect on decomposition factor (unitless) (pseudocode_soil S.6.A.2).

temperature_effectfloat

Temperature effect on decomposition factor (unitless) (pseudocode_soil S.6.A.1).

active_carbonfloat

Active carbon stored in the soil (kg/ha).

active_carbon_decomposition_ratefloat

Active carbon decomposition factor (unitless).

Returns#

float

Active carbon decomposed into slow or passive carbon and CO2 (kg/ha).

References#

pseudocode_soil Reference: S.6.C.3.

static _determine_active_carbon_decomposition_rate(silt_clay_content: float, max_carbon_decomposition_rate: float = 0.14) float#

Calculate the rate at which active carbon is decomposed into slow or passive carbon and CO2 in the layer (unitless).

Parameters#

silt_clay_contentfloat

Silt and clay content in the soil (%).

max_carbon_decomposition_ratefloat

Maximum rate of carbon decomposition (unitless).

Returns#

float

Rate at which active carbon is decomposed into slow or passive carbon and CO2 (unitless).

References#

pseudocode_soil Reference: S.6.C.2.

static _determine_plant_metabolic_active_carbon_loss(plant_metabolic_active_carbon_usage: float, metabolic_active_carbon_loss_rate: float = 0.55) float#

Calculate plant metabolic carbon being lost as carbon dioxide during decomposition into active carbon in the Parameters ———- plant_metabolic_active_carbon_usage : float

Plant metabolic carbon decomposed into active carbon (kg/ha).

metabolic_active_carbon_loss_ratefloat

Rate of carbon dioxide loss during transformation of metabolic to active carbon.

Returns#

float

Plant metabolic carbon being lost as carbon dioxide during decomposition into active carbon (kg/ha).

References#

pseudocode_soil Reference: S.6.C.1.

static _determine_plant_metabolic_active_carbon_remaining(plant_metabolic_active_carbon_usage: float, metabolic_active_carbon_loss_rate: float = 0.55) float#

Calculate plant metabolic carbon decomposed to active carbon after accounting for carbon dioxide loss in the layer (kg/ha).

Parameters#

plant_metabolic_active_carbon_usagefloat

Plant metabolic carbon decomposed into active carbon (kg/ha).

metabolic_active_carbon_loss_ratefloat

Rate of carbon dioxide loss during transformation of metabolic to active carbon.

Returns#

float

Plant metabolic carbon decomposed to active carbon after accounting for carbon dioxide loss (kg/ha).

References#

pseudocode_soil Reference: S.6.C.1.

static _determine_plant_structural_active_carbon_loss(plant_structural_active_carbon_usage: float, structural_active_carbon_loss_rate: float = 0.45) float#

Calculate plant structural carbon being lost as carbon dioxide during decomposition into active carbon in the layer (kg/ha).

Parameters#

plant_structural_active_carbon_usagefloat

Plant structural carbon decomposed into active carbon (kg/ha).

structural_active_carbon_loss_ratefloat

Rate of carbon dioxide loss during transformation of structural to active carbon.

Returns#

float

Plant structural carbon being lost as carbon dioxide during decomposition into active carbon (kg/ha).

References#

pseudocode_soil Reference: S.6.C.1.

static _determine_plant_structural_active_carbon_remaining(plant_structural_active_carbon_usage: float, structural_active_carbon_loss_rate: float = 0.45) float#

Calculate plant metabolic carbon decomposed to active carbon after accounting for carbon dioxide loss in the layer (kg/ha).

Parameters#

plant_structural_active_carbon_usagefloat

Plant metabolic carbon decomposed into active carbon (kg/ha).

structural_active_carbon_loss_ratefloat

Rate of carbon dioxide loss during transformation of structural to active carbon.

Returns#

float

Plant metabolic carbon decomposed to active carbon after accounting for carbon dioxide loss (kg/ha).

References#

pseudocode_soil Reference: S.6.C.1.

static _determine_plant_structural_slow_carbon_loss(plant_structural_slow_carbon_usage: float, structural_slow_carbon_loss_rate: float = 0.3) float#

Calculate plant structural carbon being lost as carbon dioxide during decomposition into slow carbon in the layer (kg/ha).

Parameters#

plant_structural_slow_carbon_usagefloat

Plant structural carbon decomposed into slow carbon (kg/ha).

structural_slow_carbon_loss_ratefloat

Rate of carbon dioxide loss during transformation of structural to slow carbon.

Returns#

float

Plant structural carbon being lost as carbon dioxide during decomposition into slow carbon (kg/ha).

References#

pseudocode_soil Reference: S.6.C.1.

static _determine_plant_structural_slow_carbon_remaining(plant_structural_slow_carbon_usage: float, structural_slow_carbon_loss_rate: float = 0.3) float#

Calculate plant metabolic carbon decomposed to slow carbon after accounting for carbon dioxide loss in the layer (kg/ha).

Parameters#

plant_structural_slow_carbon_usagefloat

Plant metabolic carbon decomposed into slow carbon (kg/ha).

structural_slow_carbon_loss_ratefloat

Rate of carbon dioxide loss during transformation of structural to slow carbon.

Returns#

float

Plant metabolic carbon decomposed to slow carbon after accounting for carbon dioxide loss (kg/ha).

References#

pseudocode_soil Reference: S.6.C.1.

static _determine_soil_metabolic_active_carbon_loss(soil_metabolic_active_carbon_usage: float, metabolic_active_carbon_loss_rate: float = 0.55) float#

Calculate soil metabolic carbon being lost as carbon dioxide during decomposition into active carbon in the layer (kg/ha).

Parameters#

soil_metabolic_active_carbon_usagefloat

Soil metabolic carbon decomposed into active carbon (kg/ha).

metabolic_active_carbon_loss_ratefloat

Rate of carbon dioxide loss during transformation of metabolic to active carbon.

Returns#

float

Soil metabolic carbon being lost as carbon dioxide during decomposition into active carbon (kg/ha).

References#

pseudocode_soil Reference: S.6.C.1.

static _determine_soil_metabolic_active_carbon_remaining(soil_metabolic_active_carbon_usage: float, metabolic_active_carbon_loss_rate: float = 0.55) float#

Calculate soil metabolic carbon decomposed to active carbon after accounting for carbon dioxide loss in the layer (kg/ha).

Parameters#

soil_metabolic_active_carbon_usagefloat

Soil metabolic carbon decomposed into active carbon (kg/ha).

metabolic_active_carbon_loss_ratefloat

Rate of carbon dioxide loss during transformation of metabolic to active carbon.

Returns#

float

Soil metabolic carbon decomposed to active carbon after accounting for carbon dioxide loss (kg/ha).

References#

pseudocode_soil Reference: S.6.C.1.

static _determine_soil_structural_active_carbon_loss(soil_structural_active_carbon_usage: float, structural_active_carbon_loss_rate: float = 0.45) float#

Calculate soil structural carbon being lost as carbon dioxide during decomposition into active carbon in the layer (kg/ha).

Parameters#

soil_structural_active_carbon_usagefloat

Soil structural carbon decomposed into active carbon (kg/ha).

structural_active_carbon_loss_ratefloat

Rate of carbon dioxide loss during transformation of structural to active carbon.

Returns#

float

Soil structural carbon being lost as carbon dioxide during decomposition into active carbon (kg/ha).

References#

pseudocode_soil Reference: S.6.C.1.

static _determine_soil_structural_active_carbon_remaining(soil_structural_active_carbon_usage: float, structural_active_carbon_loss_rate: float = 0.45) float#

Calculate soil structural carbon decomposed to active carbon after accounting for carbon dioxide loss in the layer (kg/ha).

Parameters#

soil_structural_active_carbon_usagefloat

Soil structural carbon decomposed into active carbon (kg/ha).

structural_active_carbon_loss_ratefloat

Rate of carbon dioxide loss during transformation of structural to active carbon.

Returns#

float

Soil structural carbon decomposed to active carbon after accounting for carbon dioxide loss (kg/ha).

References#

pseudocode_soil Reference: S.6.C.1.

static _determine_soil_structural_slow_carbon_loss(soil_structural_slow_carbon_usage: float, structural_slow_carbon_loss_rate: float = 0.3) float#

Calculate soil structural carbon being lost as carbon dioxide during decomposition into slow carbon in the layer (kg/ha).

Parameters#

soil_structural_slow_carbon_usagefloat

Soil structural carbon decomposed into slow carbon (kg/ha).

structural_slow_carbon_loss_ratefloat

Rate of carbon dioxide loss during transformation of structural to slow carbon.

Returns#

float

Soil structural carbon being lost as carbon dioxide during decomposition into slow carbon (kg/ha).

References#

pseudocode_soil Reference: S.6.C.1.

static _determine_soil_structural_slow_carbon_remaining(soil_structural_slow_carbon_usage: float, structural_slow_carbon_loss_rate: float = 0.3) float#

Calculate soil structural carbon decomposed to slow carbon after accounting for carbon dioxide loss in the layer (kg/ha).

Parameters#

soil_structural_slow_carbon_usagefloat

Soil structural carbon decomposed into slow carbon (kg/ha).

structural_slow_carbon_loss_ratefloat

Rate of carbon dioxide loss during transformation of structural to slow carbon (unitless).

Returns#

float

Soil structural carbon decomposed to slow carbon after accounting for carbon dioxide loss (kg/ha).

References#

pseudocode_soil Reference: S.6.C.1.