API documentation for the uptake module#
The models.soil.uptake module contains functions that are used to
capture the uptake competition for the various microbial groups in the simulation.
Classes:
|
Maximum rate at which each nutrient can be taken up by the microbial group. |
|
Net consumption of each labile due to microbial activity. |
Functions:
Calculate the rate at which carbon is assimilated by microbes. |
|
Calculate highest achievable uptake rate for a specific nutrient. |
|
Calculate the maximum uptake rate for each category of nutrient. |
|
Calculate the rate at which microbes uptake each nutrient. |
|
Find net consumption of each nutrient class for a free-living microbial group. |
|
Find net consumption of each nutrient class for a symbiotic microbial group. |
- class virtual_ecosystem.models.soil.uptake.MaxUptakeRates(carbon: ndarray[tuple[Any, ...], dtype[floating]], organic_nitrogen: ndarray[tuple[Any, ...], dtype[floating]], organic_phosphorus: ndarray[tuple[Any, ...], dtype[floating]], ammonium: ndarray[tuple[Any, ...], dtype[floating]], nitrate: ndarray[tuple[Any, ...], dtype[floating]], inorganic_phosphorus: ndarray[tuple[Any, ...], dtype[floating]])[source]#
Maximum rate at which each nutrient can be taken up by the microbial group.
Attributes:
Maximum uptake rate of ammonium [kg{N} m^-3 day^-1].
Maximum uptake of low molecular weight carbon [kg{C} m^-3 day^-1].
Maximum uptake rate of labile inorganic phosphorus [kg{P} m^-3 day^-1].
Maximum uptake rate of nitrate [kg{N} m^-3 day^-1].
Maximum uptake rate of organic nitrogen [kg{N} m^-3 day^-1].
Maximum uptake rate of organic phosphorus [kg{P} m^-3 day^-1].
- ammonium: ndarray[tuple[Any, ...], dtype[floating]]#
Maximum uptake rate of ammonium [kg{N} m^-3 day^-1].
- carbon: ndarray[tuple[Any, ...], dtype[floating]]#
Maximum uptake of low molecular weight carbon [kg{C} m^-3 day^-1].
- inorganic_phosphorus: ndarray[tuple[Any, ...], dtype[floating]]#
Maximum uptake rate of labile inorganic phosphorus [kg{P} m^-3 day^-1].
- nitrate: ndarray[tuple[Any, ...], dtype[floating]]#
Maximum uptake rate of nitrate [kg{N} m^-3 day^-1].
- class virtual_ecosystem.models.soil.uptake.NetNutrientConsumption(carbon: ndarray[tuple[Any, ...], dtype[floating]], organic_nitrogen: ndarray[tuple[Any, ...], dtype[floating]], ammonium: ndarray[tuple[Any, ...], dtype[floating]], nitrate: ndarray[tuple[Any, ...], dtype[floating]], organic_phosphorus: ndarray[tuple[Any, ...], dtype[floating]], inorganic_phosphorus: ndarray[tuple[Any, ...], dtype[floating]])[source]#
Net consumption of each labile due to microbial activity.
The labile inorganic pools can have negative consumptions because microbes can mineralise inorganic nutrients from nutrients in organic form.
Attributes:
Uptake of ammonium [kg{N} m^-3 day^-1].
Uptake of low molecular weight carbon [kg{C} m^-3 day^-1].
Uptake of labile inorganic phosphorus [kg{P} m^-3 day^-1].
Uptake of nitrate [kg{N} m^-3 day^-1].
Uptake of dissolved organic nitrogen [kg{N} m^-3 day^-1].
Uptake of dissolved organic phosphorus [kg{P} m^-3 day^-1].
- carbon: ndarray[tuple[Any, ...], dtype[floating]]#
Uptake of low molecular weight carbon [kg{C} m^-3 day^-1].
- inorganic_phosphorus: ndarray[tuple[Any, ...], dtype[floating]]#
Uptake of labile inorganic phosphorus [kg{P} m^-3 day^-1].
- virtual_ecosystem.models.soil.uptake.calculate_actual_carbon_gain(max_uptake_rates: MaxUptakeRates, external_carbon_supply: ndarray[tuple[Any, ...], dtype[floating]] | None, carbon_use_efficiency: ndarray[tuple[Any, ...], dtype[floating]], functional_group: MicrobialGroupConstants) ndarray[tuple[Any, ...], dtype[floating]][source]#
Calculate the rate at which carbon is assimilated by microbes.
The limitation that each nutrient places on carbon assimilation is determined. For carbon this is based on carbon use efficiency, but in the case of nitrogen and phosphorus this is determined based on biomass stoichiometry (i.e. you can’t add more carbon to biomass if you are deficient in nitrogen). This is used to calculate the actual rate at which carbon is assimilated to biomass.
In the symbiotic case, microbes can only use the carbon is supplied by their plant partners to grow. In return for this, symbiotic microbes must provide a fraction of the nutrients they uptake back to the plants. This means that they can only assimilate a fraction of the nutrients that they uptake as biomass, which generally reduces maximum carbon assimilation rates.
- Parameters:
max_uptake_rates – Maximum uptake rates for each nutrient class [kg m^-3 day^-1]
external_carbon_supply – Additional supply of carbon to the microbial group from external sources (i.e. partner plants) [kg{C} m^-3 day^-1]
carbon_use_efficiency – Carbon use efficiency of the microbial group (varies with temperature) [unitless]
functional_group – A data class containing the parameters defining the microbial functional group.
- Returns:
The rate at which carbon is assimilated to biomass [kg m^-3 day^-1].
- virtual_ecosystem.models.soil.uptake.calculate_highest_achievable_nutrient_uptake(labile_nutrient_pool: ndarray[tuple[Any, ...], dtype[floating]], microbial_pool_size: ndarray[tuple[Any, ...], dtype[floating]], water_factor: ndarray[tuple[Any, ...], dtype[floating]], pH_factor: ndarray[tuple[Any, ...], dtype[floating]], soil_temp: ndarray[tuple[Any, ...], dtype[floating]], max_uptake_rate: float, activation_energy_uptake: float, half_saturation_constant: float, activation_energy_uptake_saturation: float, reference_temperature: float) ndarray[tuple[Any, ...], dtype[floating]][source]#
Calculate highest achievable uptake rate for a specific nutrient.
This function starts by calculating the impact that environmental factors have on the rate and saturation constants for microbial uptake. These constants are then used to calculate the maximum possible uptake rate for the specific nutrient and microbial group in question.
- Parameters:
labile_nutrient_pool – Mass of nutrient that is in a readily uptakeable (labile) form [kg{nutrient} m^-3]
microbial_pool_size – Size of microbial biomass (carbon) pool of interest [kg{C} m^-3]
water_factor – A factor capturing the impact of soil water potential on microbial rates [unitless]
pH_factor – A factor capturing the impact of soil pH on microbial rates [unitless]
soil_temp – soil temperature for each soil grid cell [Celsius]
max_uptake_rate – Maximum possible uptake rate of the nutrient (at reference temperature) [day^-1]
activation_energy_uptake – Activation energy for nutrient uptake for the microbial group in question [J Kelvin^-1].
half_saturation_constant – Half saturation constant for nutrient uptake (at reference temperature) [kg{nutrient} m^-3]
activation_energy_uptake_saturation – Activation energy for nutrient uptake saturation for the microbial group in question [J Kelvin^-1].
reference_temperature – The reference temperature of the Arrhenius equation [Celsius]
- Returns:
The maximum uptake rate by the soil microbial biomass for the nutrient in question.
- virtual_ecosystem.models.soil.uptake.calculate_maximum_uptake_rates(soil_c_pool_lmwc: ndarray[tuple[Any, ...], dtype[floating]], soil_n_pool_don: ndarray[tuple[Any, ...], dtype[floating]], soil_n_pool_ammonium: ndarray[tuple[Any, ...], dtype[floating]], soil_n_pool_nitrate: ndarray[tuple[Any, ...], dtype[floating]], soil_p_pool_dop: ndarray[tuple[Any, ...], dtype[floating]], soil_p_pool_labile: ndarray[tuple[Any, ...], dtype[floating]], microbial_pool_size: ndarray[tuple[Any, ...], dtype[floating]], water_factor: ndarray[tuple[Any, ...], dtype[floating]], pH_factor: ndarray[tuple[Any, ...], dtype[floating]], soil_temp: ndarray[tuple[Any, ...], dtype[floating]], functional_group: MicrobialGroupConstants) MaxUptakeRates[source]#
Calculate the maximum uptake rate for each category of nutrient.
Categories are, carbon, organic nitrogen and phosphorus, inorganic nitrogen (ammonium and nitrate), and inorganic phosphorus.
- Parameters:
soil_c_pool_lmwc – Low molecular weight carbon pool [kg{C} m^-3]
soil_n_pool_don – Dissolved organic nitrogen pool [kg{N} m^-3]
soil_n_pool_ammonium – Soil ammonium pool [kg{N} m^-3]
soil_n_pool_nitrate – Soil nitrate pool [kg{N} m^-3]
soil_p_pool_dop – Dissolved organic phosphorus pool [kg{P} m^-3]
soil_p_pool_labile – Labile inorganic phosphorus pool [kg{P} m^-3]
microbial_pool_size – Amount of biomass for functional of interest [kg{C} m^-3]
lmwc_c_n_ratio – Carbon to nitrogen ratio of the low molecular weight carbon pool [unitless]
lmwc_c_p_ratio – Carbon to phosphorus ratio of the low molecular weight carbon pool [unitless]
water_factor – A factor capturing the impact of soil water potential on microbial rates [unitless]
pH_factor – A factor capturing the impact of soil pH on microbial rates [unitless]
soil_temp – soil temperature for each soil grid cell [Celsius]
constants – Set of constants for the soil model.
functional_group – A data class containing the parameters defining the microbial functional group
- Returns:
The maximum rate at which each category of nutrient can be taken up by the microbial group of interest.
- virtual_ecosystem.models.soil.uptake.calculate_nutrient_uptake_rates(soil_c_pool_lmwc: ndarray[tuple[Any, ...], dtype[floating]], soil_n_pool_don: ndarray[tuple[Any, ...], dtype[floating]], soil_n_pool_ammonium: ndarray[tuple[Any, ...], dtype[floating]], soil_n_pool_nitrate: ndarray[tuple[Any, ...], dtype[floating]], soil_p_pool_dop: ndarray[tuple[Any, ...], dtype[floating]], soil_p_pool_labile: ndarray[tuple[Any, ...], dtype[floating]], microbial_pool_size: ndarray[tuple[Any, ...], dtype[floating]], external_carbon_supply: ndarray[tuple[Any, ...], dtype[floating]] | None, water_factor: ndarray[tuple[Any, ...], dtype[floating]], pH_factor: ndarray[tuple[Any, ...], dtype[floating]], soil_temp: ndarray[tuple[Any, ...], dtype[floating]], constants: SoilConstants, functional_group: MicrobialGroupConstants) tuple[ndarray[tuple[Any, ...], dtype[floating]], NetNutrientConsumption][source]#
Calculate the rate at which microbes uptake each nutrient.
These rates are found based on the assumption that microbial stoichiometry is inflexible, i.e. assuming that the rate of uptake of all nutrients (carbon, nitrogen and phosphorus) needed for growth will be set by the least available nutrient. The carbon case is more complex as carbon gets used both for biomass synthesis and respiration. In this case, we calculate the carbon use efficiency and use this to find the maximum amount of carbon available for biomass synthesis. Once the most limiting nutrient uptake stream is found it is straightforward to find the demand for other nutrients. This is because the microbial biomass stoichiometry can only remain the same if nutrients are taken up following the same stoichiometry (with an adjustment made for carbon use efficiency).
Biomass synthesis is split between the synthesis of new cellular biomass and the production of extracellular enzymes. We assume that extracellular enzymes are always produced in fixed proportion to the rate at which new biomass is synthesised. As such, we calculate the nutrient costs of synthesising new biomass based on a weighted (by relative investment in production) average of the stoichiometry of the different enzymes and the microbial group itself.
The balance of mineralisation and immobilisation rates of inorganic nitrogen and phosphorus are also calculated in this function. This is done by calculating the difference between the demand for nitrogen and phosphorus and their uptake due to organic matter uptake. If more is taken up as a component of organic matter than is needed then nutrients are mineralised, i.e. mass is added to the relevant inorganic nutrient pool. Conversely, if more is required to meet demand uptake occurs from the relevant inorganic nutrient pool (this is termed immobilisation). Two forms inorganic nitrogen can be taken up by microbes, ammonium and nitrate. The rate at which these are taken up is determined by the ratio of their uptake rates. When inorganic nitrogen is mineralised the ratio of ammonium to nitrate mineralised is determined by a fixed ratio defined in the model constants.
Symbiotic microbes depend on their symbiotic plant partners for their carbon requirements. They uptake the nitrogen and phosphorus they need to grow from the soil, preferentially taking inorganic nutrients. A fixed (but configurable) fraction of their uptake is supplied to their symbiotic partners. If more carbon is supplied than the microbes can use the surplus is added to the soil as LMWC.
- Parameters:
soil_c_pool_lmwc – Low molecular weight carbon pool [kg{C} m^-3]
soil_n_pool_don – Dissolved organic nitrogen pool [kg{N} m^-3]
soil_n_pool_ammonium – Soil ammonium pool [kg{N} m^-3]
soil_n_pool_nitrate – Soil nitrate pool [kg{N} m^-3]
soil_p_pool_dop – Dissolved organic phosphorus pool [kg{P} m^-3]
soil_p_pool_labile – Labile inorganic phosphorus pool [kg{P} m^-3]
microbial_pool_size – Amount of biomass for functional of interest [kg{C} m^-3]
external_carbon_supply – Additional supply of carbon to the microbial group from external sources (i.e. partner plants) [kg{C} m^-3 day^-1]
water_factor – A factor capturing the impact of soil water potential on microbial rates [unitless]
pH_factor – A factor capturing the impact of soil pH on microbial rates [unitless]
soil_temp – soil temperature for each soil grid cell [Celsius]
constants – Set of constants for the soil model.
functional_group – A data class containing the parameters defining the microbial functional group
- Returns:
A tuple containing the rate at which microbial (cellular) biomass is generated due to nutrient uptake, as well as a dataclass containing the rate at which carbon, nitrogen and phosphorus get taken up.
- Raises:
ValueError – If an external carbon supply is provided without a corresponding demand for nitrogen and phosphorus exchange
- virtual_ecosystem.models.soil.uptake.find_net_nutrient_consumptions_free_living(max_uptake_rates: MaxUptakeRates, actual_carbon_gain: ndarray[tuple[Any, ...], dtype[floating]], carbon_use_efficiency: ndarray[tuple[Any, ...], dtype[floating]], functional_group: MicrobialGroupConstants, ammonium_mineralisation_proportion: float) NetNutrientConsumption[source]#
Find net consumption of each nutrient class for a free-living microbial group.
These net consumptions can be negative as microbes can mineralise nutrients from organic matter.
We assume that organic matter is always taken up at the maximum possible rate. This is because organic matter contains carbon, nitrogen and phosphorus and one of these will always be limiting growth. Any excess uptake through organic matter gets returned (this represents overflow metabolism). If the microbial group is heavily carbon limited nutrients will be returned to the soil in an inorganic form, conversely if it is less carbon limited the excess nutrients will be returned in an organic form. If the demand for nitrogen or phosphorus exceeds the amount provided through organic matter uptake, inorganic nutrients are uptaken.
- Parameters:
max_uptake_rates – Maximum uptake rates for each nutrient class [kg m^-3 day^-1]
actual_carbon_gain – The rate at which carbon is assimilated to biomass [kg C m^-3 day^-1]
carbon_use_efficiency – Carbon use efficiency of the microbial group (varies with temperature) [unitless]
functional_group – A data class containing the parameters defining the microbial functional group.
ammonium_mineralisation_proportion – Proportion of microbially mineralised nitrogen that takes the form of ammonium [unitless]
- Returns:
The net consumption/production of each nutrient class [kg m^-3 day^-1].
- virtual_ecosystem.models.soil.uptake.find_net_nutrient_consumptions_symbiotic(max_uptake_rates: MaxUptakeRates, actual_carbon_gain: ndarray[tuple[Any, ...], dtype[floating]], external_carbon_supply: ndarray[tuple[Any, ...], dtype[floating]], carbon_use_efficiency: ndarray[tuple[Any, ...], dtype[floating]], functional_group: MicrobialGroupConstants) NetNutrientConsumption[source]#
Find net consumption of each nutrient class for a symbiotic microbial group.
We assume that inorganic nutrients are preferentially taken up, as the symbiotic microbes are reliant on their hosts for carbon. If the demand for nitrogen or phosphorus exceeds the amount provided through inorganic matter uptake, organic nutrients are uptaken. Though this implies a corresponding uptake of carbon, we do not track it as we are assuming that the symbiotic partners cannot make use of this carbon at all, and so immediately release it. If more carbon is supplied (by symbiotic plant partners) than the microbes make use of the surplus carbon is added to the soil as LMWC.
- Parameters:
max_uptake_rates – Maximum uptake rates for each nutrient class [kg m^-3 day^-1]
actual_carbon_gain – The rate at which carbon is assimilated to biomass [kg C m^-3 day^-1]
external_carbon_supply – Additional supply of carbon to the microbial group from symbiotic partner plants [kg{C} m^-3 day^-1]
carbon_use_efficiency – Carbon use efficiency of the microbial group (varies with temperature) [unitless]
functional_group – A data class containing the parameters defining the microbial functional group.
- Returns:
The net consumption/production of each nutrient class [kg m^-3 day^-1].