RUFAS.routines.field.field.manure_application module#
- RUFAS.routines.field.field.manure_application.FRESH_FRACTION_OF_ORGANIC_NITROGEN = 0.9286#
This fraction was used in the evaluation of RuFaS Soil Nitrogen cycling, and was validated empirically.
- RUFAS.routines.field.field.manure_application.SOIL_INFILTRATION = 0.6#
Surphos assumes infiltration of 60% of nutrients from manure with less than 15% dry matter
- class RUFAS.routines.field.field.manure_application.ManureApplication(soil_data: SoilData | None = None, field_size: float | None = None)#
Bases:
object
This class contains all necessary methods for adding new applications for manure phosphorus to a field, based on the SurPhos model.
Parameters#
- soil_dataSoilData, optional
The SoilData object used by this module to track manure phosphorus activity, 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
Reference to the SoilData object that is being tracked
Methods#
- apply_grazing_manure(dry_matter_mass: float, dry_matter_fraction: float, total_phosphorus_mass: float,
inorganic_nitrogen_fraction: float, ammonium_fraction: float, organic_nitrogen_fraction: float, field_size: float) -> None
This method takes a new application of machine-applied manure phosphorus and adds it to the existing pool to be tracked.
- apply_machine_manure(dry_matter_mass: float, dry_matter_fraction: float,
total_phosphorus_mass: float, field_coverage: float, application_depth: float, surface_remainder_fraction: float, field_size: float, inorganic_nitrogen_fraction: float, ammonium_fraction: float, organic_nitrogen_fraction: float, water_extractable_inorganic_phosphorus_fraction: float = None, source_animal: str = None) -> None
This method takes a new application of machine-applied manure phosphorus and adds it to the existing pool to be tracked.
- apply_grazing_manure(dry_matter_mass: float, dry_matter_fraction: float, total_phosphorus_mass: float, inorganic_nitrogen_fraction: float, ammonium_fraction: float, organic_nitrogen_fraction: float, field_size: float) None #
- This method takes a new application of machine-applied manure phosphorus and adds it to the existing pool to
be tracked.
Parameters#
- dry_matter_massfloat
Dry weight equivalent of this application (kg).
- dry_matter_fractionfloat
Fraction of this manure application that is dry matter, in the range (0.0, 1.0] (unitless).
- total_phosphorus_massfloat
Total mass of phosphorus in this application of manure (kg).
- inorganic_nitrogen_fractionfloat
Fraction of dry manure mass that is inorganic nitrogen (unitless).
- ammonium_fractionfloat
Fraction of inorganic nitrogen that is ammonium (unitless).
- organic_nitrogen_fractionfloat
Fraction of dry manure mass that is organic nitrogen (unitless).
- field_sizefloat
Size of the field (ha).
Notes#
The hardcoded values that determine the distribution of phosphorus between the water extractable inorganic/organic and stable inorganic/organic pools are listed in the SurPhos theoretical documentation page 7, in the paragraph immediately following the head “Simulation of Grazing Manure Transforms”.
- apply_machine_manure(dry_matter_mass: float, dry_matter_fraction: float, total_phosphorus_mass: float, field_coverage: float, application_depth: float, surface_remainder_fraction: float, field_size: float, inorganic_nitrogen_fraction: float, ammonium_fraction: float, organic_nitrogen_fraction: float, water_extractable_inorganic_phosphorus_fraction: float | None = None, source_animal: str | None = None) None #
- This method takes a new application of machine-applied manure phosphorus and adds it to the existing pool to
be tracked.
Parameters#
- dry_matter_massfloat
Dry weight equivalent of this application (kg).
- dry_matter_fractionfloat
Fraction of this manure application that is dry matter, in the range (0.0, 1.0] (unitless).
- total_phosphorus_massfloat
Total mass of phosphorus in this application of manure (kg).
- field_coveragefloat
Fraction of the field this manure is applied to (unitless).
- application_depthfloat
Depth at which fertilizer is injected into the soil (mm).
- surface_remainder_fractionfloat
Fraction of fertilizer applied that remains on the soil surface after application (unitless).
- field_sizefloat
Size of the field (ha).
- inorganic_nitrogen_fractionfloat
Fraction of dry manure mass that is inorganic nitrogen (unitless).
- ammonium_fractionfloat
Fraction of inorganic nitrogen that is ammonium (unitless).
- organic_nitrogen_fractionfloat
Fraction of dry manure mass that is organic nitrogen (unitless).
- water_extractable_inorganic_phosphorus_fractionfloat, default=None
Fraction of total phosphorus in this application of manure that is water extractable inorganic phosphorus, in the range [0.0, 1.0] (unitless).
- source_animalstr, default=None
Type of animal that produced this manure (options are “CATTLE”, “SWINE”, or “POULTRY”) (unitless).
Raises#
- ValueError
If the water extractable inorganic phosphorus fraction is not inside the range [0.0, 0.95].
Notes#
When manure is applied that contains 15% or less solid matter, the slurry immediately infiltrates the soil. The SurPhos theoretical documentation states that “the model assumes slurry liquid immediately infiltrates into soil and adds 60% of all manure P to corresponding soil P pools”.
- _add_nitrogen_to_soil_layer(layer_index: int, dry_matter_mass: float, inorganic_nitrogen_fraction: float, ammonium_fraction: float, organic_nitrogen_fraction: float, field_size: float) None #
Adds nitrogen into the top of the soil profile when manure is applied to the field.
Parameters#
- layer_indexint
Index of the soil layer to be added to (unitless).
- dry_matter_massfloat
Dry weight equivalent of this application (kg).
- inorganic_nitrogen_fractionfloat
Fraction of dry manure mass that is inorganic nitrogen (unitless).
- ammonium_fractionfloat
Fraction of inorganic nitrogen that is ammonium (unitless).
- organic_nitrogen_fractionfloat
Fraction of dry manure mass that is organic nitrogen (unitless).
- field_sizefloat
Size of the field (ha).
References#
SWAT Theoretical documentation section 6:1.7 pseudocode_field_management [FM.4.D.1]
Notes#
This method allows nitrogen to be added to any soil layer in the profile by specifying the index of that layer. The top soil layer will always be at index 0.
Instead of partitioning organic nitrogen between the fresh and active pools, it is partitioned between the stable and active pools. Refer to the pseudocode for this.
- _apply_subsurface_manure(total_phosphorus_mass: float, water_extractable_inorganic_phosphorus_fraction: float, water_extractable_organic_phosphorus_fraction: float, stable_inorganic_phosphorus_fraction: float, stable_organic_phosphorus_fraction: float, dry_matter_mass: float, inorganic_nitrogen_fraction: float, ammonium_fraction: float, organic_nitrogen_fraction: float, application_depth: float, subsurface_fraction: float, field_size: float) None #
Applies subsurface nutrients to the soil profile.
Parameters#
- total_phosphorus_massfloat
Total mass of phosphorus in this application of manure (kg).
- water_extractable_inorganic_phosphorus_fractionfloat
Fraction of total phosphorus in this application of manure that is water extractable inorganic phosphorus, in the range [0.0, 1.0] (unitless).
- water_extractable_organic_phosphorus_fractionfloat
Fraction of total phosphorus in this application of manure that is water extractable organic phosphorus, in the range [0.0, 1.0] (unitless).
- stable_inorganic_phosphorus_fractionfloat
Fraction of total phosphorus in this application of manure that is stable inorganic phosphorus, in the range [0.0, 1.0] (unitless).
- stable_organic_phosphorus_fractionfloat
Fraction of total phosphorus in this application of manure that is stable organic phosphorus, in the range [0.0, 1.0] (unitless).
- dry_matter_massfloat
Dry weight equivalent of the manure application (kg).
- inorganic_nitrogen_fractionfloat
Fraction of dry manure mass that is inorganic nitrogen (unitless).
- ammonium_fractionfloat
Fraction of inorganic nitrogen that is ammonium (unitless).
- organic_nitrogen_fractionfloat
Fraction of dry manure mass that is organic nitrogen (unitless).
- application_depthfloat
Depth at which fertilizer is injected into the soil (mm).
- subsurface_fractionfloat
Fraction of total manure application that is applied below the soil surface (unitless).
- field_sizefloat
Size of the field (ha).
Notes#
Only 95% of water extractable organic and stable organic phosphorus are put into their corresponding pools because that is how SurPhos transfers organic phosphorus, as an approximation for organic phosphorus loss. This practice will be changed when issue #444 is addressed.
- static _determine_grazing_manure_field_coverage(field_size: float, total_manure_applied: float) float #
Calculates the fraction of the field covered by manure that was applied by grazers.
Parameters#
- field_sizefloat
Size of the field (ha)
- total_manure_appliedfloat
Total mass of the manure application (kg)
Returns#
- float
The fraction of the field covered by manure (unitless)
Notes#
This method is only used for calculating the field coverage for manure applied by grazers. It is based on the relationship specified in the SurPhos theoretical documentation which states that the ratio is 250 grams of manure to 659 square centimeters of field coverage (James et al., 2007).
References#
- James E., Kleinman P., Veith T., Stedman R., Sharpley A. (2007) Phosphorus contributions from
pastured dairy cattle to streams of the Cannonsville Watershed, New York. Journal of Soil and Water Conservation 62:40-47.
- static _determine_moisture_factor(dry_matter_fraction: float) float #
- This method determines the moisture factor of a new manure application based on how much manure was applied
and how much water was in the application.
Parameters#
- dry_matter_fractionfloat
Fraction of this manure application that is dry matter, in the range (0.0, 1.0] (unitless)
Returns#
- float
The moisture factor of this application of manure (unitless)
Raises#
- ValueError
If the dry matter content is not inside the range (0.0, 1.0]
Notes#
This equation is not listed in the SurPhos theoretical documentation, but is present in both the SurPhos Python and Fortran code (see manure.f and manure.py, lines 30, 31 and 41, 42 respectively). This equation is a way of determining the moisture factor based on the amount of dry matter mass in the manure application that produces more accurate results.
- static _determine_weighted_manure_attributes(old_total_dry_mass: float, old_moisture_factor: float, old_field_coverage: float, application_dry_mass: float, application_dry_fraction: float, application_field_coverage: float) Dict #
Recalculates the manure pool attributes that use a weighted average to find their new values.
Parameters#
- old_total_dry_massfloat
Dry weight equivalent of the manure that was already on the field (kg)
- old_moisture_factorfloat
Moisture factor of the manure that was already on the field, between [0, 0.9] (unitless)
- old_field_coveragefloat
The fraction of the area of the field that was already covered by old manure, between [0, 1] (unitless)
- application_dry_massfloat
Dry weight equivalent of manure application (kg)
- application_dry_fractionfloat
Fraction of this manure application that is dry matter, in the range (0.0, 1.0] (unitless)
- application_field_coveragefloat
Fraction of the field covered by the manure application (unitless)
Returns#
- new_dry_matter_massfloat
The new dry weight equivalent of manure on the field (kg)
- new_moisture_factorfloat
The new moisture factor of the manure on the field, in the range [0, 0.9] (unitless)
- new_field_coveragefloat
The new fraction of field area that is covered by manure, in the range [0, 1] (unitless)
Notes#
To keep a more accurate state of the manure and grazing phosphorus pools, the field coverage and moisture variables are recalculated to be a weighted average of the new and preexisting field coverage and moisture variables, weighted by mass.
- static _determine_water_extractable_inorganic_phosphorus_fraction_by_animal(animal_type: str | None) float #
Parameters#
- animal_typestr
Type of animal that produced the manure (can be either “CATTLE”, “SWINE”, or “POULTRY”)
Returns#
- float
Fraction of manure that is water-extractable inorganic phosphorus (unitless)
Raises#
- ValueError
If the animal type passed does not match any of the supported types.
Notes#
These are reasonable defaults provided Pete Vadas.