| Title: | Global Livestock Environmental Assessment Model (GLEAM-X) |
|---|---|
| Description: | GLEAM-X is the official R implementation of FAO’s Global Livestock Environmental Assessment Model (GLEAM). The package provides a modular, transparent framework for simulating livestock production systems and quantifying their environmental impacts. |
| Authors: | Ahmed Jou [aut, cre] (ORCID: <https://orcid.org/0009-0002-2309-4583>, https://applitics.fr), Yassine Elaouni [aut] (https://applitics.fr), Dominik Wisser [aut] (ORCID: <https://orcid.org/0000-0001-8368-3801>, GLEAM team lead, FAO), Lydia Lanzoni [aut] (ORCID: <https://orcid.org/0000-0002-4488-4368>, Livestock and climate change specialist, FAO), Giuseppe Tempio [aut] (ORCID: <https://orcid.org/0009-0004-2272-0794>, Livestock environmental impact analyst, FAO), Phyllis Ndungu' [ctb] (Livestock and climate change specialist, FAO), Yushan Li [ctb] (Livestock and sustainability specialist, FAO), Manling Xu [ctb] (Livestock data intern, FAO), Zixin Wang [ctb] (Livestock data intern, FAO), Narindra Rakotovao [ctb] (Livestock policy officer, FAO), Stewart Chikoloma [ctb] (Livestock data specialist, FAO), David OBrien [ctb] (ORCID: <https://orcid.org/0009-0007-0339-0517>, https://applitics.fr), Food and Agriculture Organization of the United Nations FAO [cph] (Original GLEAM model framework), Federal Ministry of Agriculture, Food and Regional Identity of Germany BMELH [fnd] (Funding support) |
| Maintainer: | Ahmed Jou <[email protected]> |
| License: | AGPL-3 |
| Version: | 0.8.0 |
| Built: | 2026-05-17 09:52:57 UTC |
| Source: | https://github.com/un-fao/gleam |
Calculates the greenhouse gas emissions (GHG) attributable to specific commodities by applying allocation shares to total herd-level emissions.
calc_allocated_emissions(value, allocation_share)calc_allocated_emissions(value, allocation_share)
value |
Numeric. Total herd-level emissions by source before allocation to commodities (kg gas). |
allocation_share |
Numeric. Allocation share assigned to the commodity for the corresponding emission source (fraction). |
Allocation shares represent the fraction of total emissions assigned to
each commodity (e.g., meat, milk, fibre).
See run_allocation_module() for additional details.
Allocated emissions are calculated as:
This function is part of the run_aggregation_module().
Numeric. Allocated emissions for each commodity–emission combination (kg gas).
run_aggregation_module(),
run_allocation_module()
Calculates the average and final live weight for a given sex–age cohort based on initial weight, potential final weight, slaughter weight, and the offtake rate.
calc_avg_weights( live_weight_cohort_initial, live_weight_cohort_potential_final, live_weight_cohort_at_slaughter, offtake_rate )calc_avg_weights( live_weight_cohort_initial, live_weight_cohort_potential_final, live_weight_cohort_at_slaughter, offtake_rate )
live_weight_cohort_initial |
Numeric. Live weight at the beginning of the cohort stage (kg). |
live_weight_cohort_potential_final |
Numeric. Potential final live weight attainable at the end of the cohort stage in the absence of offtake (kg). (For juveniles: equals weaning weight; For subadults: equals adult live weight; For adults: equals adult live weight) |
live_weight_cohort_at_slaughter |
Numeric. Live weight at slaughter for animals removed from the cohort (kg). |
offtake_rate |
Numeric. Annual proportion of animals removed from the herd for each sex-age cohort (fraction). |
The calculation of live_weight_cohort_average and live_weight_cohort_final is performed considering that
a fraction of animals is removed (offtake) during the cohort stage, while the
remaining animals reach the potential final live weight.
The final live weight is computed as:
The average live weight over the stage is approximated as:
This function is part of the run_weights_module().
A named list with:
Numeric. Average live weight over the cohort stage. Computed by accounting for the share of offtaken animals within the cohort, using their slaughter weight, and the potential final weight of animals that remain in the cohort (kg).
Numeric. Live weight at the end of the cohort stage, accounting for both surviving and offtaken animals. Computed as a weighted average of the potential final weight of surviving animals and the slaughter weight of offtaken animals, based on the offtake rate (kg).
Calculates daily enteric methane emissions (kg CH4/head/day) based on gross energy intake, methane conversion factor (ym), and dry matter intake.
calc_ch4_enteric( species_short, ch4_conversion_factor_ym, ch4_mitigation_factor, ration_gross_energy, ration_intake )calc_ch4_enteric( species_short, ch4_conversion_factor_ym, ch4_mitigation_factor, ration_gross_energy, ration_intake )
species_short |
Character. Code identifying the livestock species. Supported values include:
|
ch4_conversion_factor_ym |
Numeric. Methane (CH4) conversion factor (ym), representing the percentage of gross energy of the feed ration that is converted to CH4 (percentage). |
ch4_mitigation_factor |
Numeric. Optional. Multiplicative mitigation factor applied to
baseline enteric methane (CH4) emissions (dimensionless). If not provided, a default
value of |
ration_gross_energy |
Numeric. Average gross energy content of the diet (MJ/kg DM). |
ration_intake |
Numeric. Average daily dry matter intake of feed (kg DM/head/day). |
The formula used to estimate daily enteric methane emissions is:
where 55.65 MJ/kg is the energy content of methane.
ration_gross_energy and ration_intake can be calculated with
calc_ration_gross_energy and calc_ration_intake (
see also run_ration_quality_module and run_metabolic_energy_req_module).
This function is part of the run_emissions_enteric_module().
Numeric. Average daily enteric methane (CH4) emissions (kg CH4/head/day).
IPCC. (2019). 2019 Refinement to the 2006 IPCC Guidelines for National Greenhouse Gas Inventories. Chapter 10: Emissions from Livestock and Manure Management, Equation 10.21.
IPCC. (2006). 2006 IPCC Guidelines for National Greenhouse Gas Inventories. Chapter 10: Emissions from Livestock and Manure Management, Equation 10.21.
run_emissions_enteric_module,
calc_ration_gross_energy,
calc_ration_intake,
run_ration_quality_module
run_metabolic_energy_req_module
Calculates daily methane emissions from manure management using IPCC-based parameters and separates emissions from manure deposited on pasture, manure burned for fuel, and all other manure management systems.
calc_ch4_manure(ratio_m3CH4_to_kgCH4 = 0.67, volatile_solids, ...)calc_ch4_manure(ratio_m3CH4_to_kgCH4 = 0.67, volatile_solids, ...)
ratio_m3CH4_to_kgCH4 |
Numeric. Conversion factor used to convert methane (CH4) from volumetric unit (m3) to a mass unit (kg). This value represents the density of methane. It defaults to 0.67 kg/m3. |
volatile_solids |
Numeric. Total volatile solids (VS) excreted per animal per day, representing the organic material in livestock manure and consisting of both biodegradable and non-biodegradable fractions (kg VS/head/day). |
... |
A variable number of manure management system (MMS) arguments. Each MMS must be provided as a named numeric vector with exactly the following fields:
Two MMS names are treated explicitly when present:
All remaining MMS arguments are grouped and treated as other manure management systems. |
This calculation follows the structure of IPCC Equation 10.23 for methane (CH4) emission factors from manure management.
In the IPCC formulation, emissions are determined by combining:
daily volatile solids excretion (volatile_solids) - see calc_volatile_solids,
the maximum methane-producing capacity (b0),
the methane conversion factor (mcf) for each manure
management system,
and the fraction of manure handled in each system
(manure_management_system_fraction).
Applying the IPCC conversion factor from m3 CH4 to kg CH4 (0.67), daily methane emissions are calculated as:
The summation is taken over all manure management systems included in the calculation. Results are expressed at daily resolution (kg CH4/head/day), consistent with Equation 10.23 after adapting the original annual formulation to a daily basis.
This function is part of the run_emissions_manure_module().
A named list with the following elements:
Numeric. Methane (CH4) emissions from manure deposited on pasture (kg CH4/head/day).
Numeric. Methane (CH4) emissions from manure burned for fuel (kg CH4/head/day).
Numeric. Methane (CH4) emissions from manure management systems, excluding emissions from manure deposited on pasture and burned for fuel (kg CH4/head/day).
Numeric. Methane (CH4) emissions from manure management systems, excluding manure burned for fuel (kg CH4/head/day).
IPCC. (2019). 2019 Refinement to the 2006 IPCC Guidelines for National Greenhouse Gas Inventories, Chapter 10: Emissions from Livestock and Manure Management. Equation 10.23.
IPCC. (2006). 2006 IPCC Guidelines for National Greenhouse Gas Inventories, Chapter 10: Emissions from Livestock and Manure Management. Equation 10.23.
run_emissions_manure_module,
calc_volatile_solids
run_emissions_manure_module,
calc_volatile_solids
calc_ch4_manure( ratio_m3CH4_to_kgCH4 = 0.67, volatile_solids = 2.024, mms_burned = c( manure_management_system_fraction = 0.020, methane_conversion_factor_mcf = 10, ch4_max_producing_capacity_bo = 0.13 ), mms_drylot = c( manure_management_system_fraction = 0.264, methane_conversion_factor_mcf = 2, ch4_max_producing_capacity_bo = 0.13 ), mms_pasture = c( manure_management_system_fraction = 0.310, methane_conversion_factor_mcf = 0.47, ch4_max_producing_capacity_bo = 0.19 ), mms_solid = c( manure_management_system_fraction = 0.406, methane_conversion_factor_mcf = 5, ch4_max_producing_capacity_bo = 0.13 ) )calc_ch4_manure( ratio_m3CH4_to_kgCH4 = 0.67, volatile_solids = 2.024, mms_burned = c( manure_management_system_fraction = 0.020, methane_conversion_factor_mcf = 10, ch4_max_producing_capacity_bo = 0.13 ), mms_drylot = c( manure_management_system_fraction = 0.264, methane_conversion_factor_mcf = 2, ch4_max_producing_capacity_bo = 0.13 ), mms_pasture = c( manure_management_system_fraction = 0.310, methane_conversion_factor_mcf = 0.47, ch4_max_producing_capacity_bo = 0.19 ), mms_solid = c( manure_management_system_fraction = 0.406, methane_conversion_factor_mcf = 5, ch4_max_producing_capacity_bo = 0.13 ) )
Calculates the contribution of an individual feed component to methane (CH4) emissions from rice cultivation in feed production, using feed-specific emission factors weighted by the component's share in the ration.
calc_ch4_ration_rice(feed_ration_fraction, ch4_feed_rice)calc_ch4_ration_rice(feed_ration_fraction, ch4_feed_rice)
feed_ration_fraction |
Numeric. Proportion of a specific feed component in the total ration, expressed as its fraction of diet dry matter intake (fraction). Within each herd_id and cohort, proportions should sum to 1. |
ch4_feed_rice |
Numeric. Methane (CH4) emission factor of a feed component, representing CH4 emissions from rice cultivation in feed production, expressed per kg of dry matter intake (g CH4/kg DM). |
The contribution is computed as:
This function is part of the run_emissions_ration_module().
Numeric. Contribution of an individual feed component to the diet-level average methane (CH4) emission factor from rice cultivation in feed production (g CH4/kg DM).
Calculates the contribution of an individual feed component to carbon dioxide (CO2) emissions from on-field agricultural activities in feed production (e.g., energy use for tillage and machinery operations), using feed-specific emission factors weighted by the component's share in the ration.
calc_co2_ration_crop_activities(feed_ration_fraction, co2_feed_crop_activities)calc_co2_ration_crop_activities(feed_ration_fraction, co2_feed_crop_activities)
feed_ration_fraction |
Numeric. Proportion of a specific feed component in the total ration, expressed as its fraction of diet dry matter intake (fraction). Within each herd_id and cohort, proportions should sum to 1. |
co2_feed_crop_activities |
Numeric. Carbon dioxide (CO2) emission factor of a feed component, representing CO2 emissions from on-field agricultural activities in feed production, expressed per kilogram of dry matter intake (kg CO2/kg DM). |
The contribution is computed as:
This function is part of the run_emissions_ration_module().
Numeric. Contribution of an individual feed component to the diet-level average carbon dioxide (CO2) emission factor from on-field agricultural activities in feed production (g CO2/kg DM).
Calculates the contribution of an individual feed component to carbon dioxide (CO2) emissions from fertilizer manufacture in feed production, using feed-specific emission factors weighted by the component's share in the ration.
calc_co2_ration_fertilizer(feed_ration_fraction, co2_feed_fertilizer)calc_co2_ration_fertilizer(feed_ration_fraction, co2_feed_fertilizer)
feed_ration_fraction |
Numeric. Proportion of a specific feed component in the total ration,as its fraction of diet dry matter intake (fraction). Within each herd_id and cohort, proportions should sum to 1. |
co2_feed_fertilizer |
Numeric. Carbon dioxide (CO2) emission factor of a feed component, representing CO2 emissions from fertilizer manufacture in feed production, expressed per kilogram of dry matter intake (g CO2/kg DM). |
The contribution is computed as:
This function is part of the run_emissions_ration_module().
Numeric. Contribution of an individual feed component to the diet-level average carbon dioxide (CO2) emission factor from fertilizer manufacture in feed production (g CO2/kg DM).
Calculates the contribution of an individual feed component to carbon dioxide (CO2) emissions from land-use change in feed production (excluding peatland drainage), using feed-specific emission factors weighted by the component's share in the ration.
calc_co2_ration_luc_nopeat(feed_ration_fraction, co2_feed_luc_nopeat)calc_co2_ration_luc_nopeat(feed_ration_fraction, co2_feed_luc_nopeat)
feed_ration_fraction |
Numeric. Proportion of a specific feed component in the total ration, expressed as its fraction of diet dry matter intake (fraction). Within each herd_id and cohort, proportions should sum to 1. |
co2_feed_luc_nopeat |
Numeric. Carbon dioxide (CO2) emission factor of a feed component, representing CO2 emissions from land-use change in feed production (excluding peatland drainage), expressed per kilogram of dry matter intake (g CO2/kg DM). |
The contribution is computed as:
This function is part of the run_emissions_ration_module().
Numeric. Contribution of an individual feed component to the diet-level average carbon dioxide (CO2) emission factor from land-use change (excluding peatland drainage) in feed production (g CO2/kg DM).
Calculates the contribution of an individual feed component to carbon dioxide (CO2) emissions from peatland drainage in feed production, using feed-specific emission factors weighted by the component's share in the ration.
calc_co2_ration_luc_peat(feed_ration_fraction, co2_feed_luc_peat)calc_co2_ration_luc_peat(feed_ration_fraction, co2_feed_luc_peat)
feed_ration_fraction |
Numeric. Proportion of a specific feed component in the total ration, expressed as its fraction of diet dry matter intake (fraction). Within each herd_id and cohort, proportions should sum to 1. |
co2_feed_luc_peat |
Numeric. Carbon dioxide (CO2) emission factor of a feed component, representing CO2 emissions from peatland drainage in feed production, expressed per kilogram of dry matter intake (g CO2/kg DM). |
The contribution is computed as:
This function is part of the run_emissions_ration_module().
Numeric. Contribution of an individual feed component to the diet-level average carbon dioxide (CO2) emission factor from peatland drainage in feed production (g CO2/kg DM).
Calculates the contribution of an individual feed component to carbon dioxide (CO2) emissions from pesticide manufacture in feed production, using feed-specific emission factors weighted by the component's share in the ration.
calc_co2_ration_pesticides(feed_ration_fraction, co2_feed_pesticides)calc_co2_ration_pesticides(feed_ration_fraction, co2_feed_pesticides)
feed_ration_fraction |
Numeric. Proportion of a specific feed component in the total ration, expressed as its fraction of diet dry matter intake (fraction). Within each herd_id and cohort, proportions should sum to 1. |
co2_feed_pesticides |
Numeric. Carbon dioxide (CO2) emission factor of a feed component, representing CO2 emissions from pesticide manufacture in feed production, expressed per kilogram of dry matter intake (g CO2/kg DM). |
The contribution is computed as:
Numeric. Contribution of an individual feed component to the diet-level average carbon dioxide (CO2) emission factor from pesticide manufacture in feed production (g CO2/kg DM).
Calculates CO2-equivalent (CO2eq) emissions for CH4 and N2O based on 100-year Global Warming Potentials (GWP) reported in IPCC assessment reports.
calc_co2eq(gas, value_allocated, global_warming_potential_set)calc_co2eq(gas, value_allocated, global_warming_potential_set)
gas |
Character. Gas type for each observation. Supported values:
|
value_allocated |
Numeric. Allocated emissions for each commodity–emission combination (kg gas). |
global_warming_potential_set |
Character. Settings for the 100-year Global Warming Potential (GWP-100) conversion factors used to express CH4 and N2O emissions as CO2eq. Must be one of:
|
CO2-equivalent emissions are calculated as:
where gwp is the gas-specific 100-year Global Warming Potential
factor from the selected IPCC assessment report.
This function is part of the run_aggregation_module().
List with elements:
Numeric vector. Emissions expressed as CO2-equivalents (kg CO2eq).
Numeric vector. Global Warming Potential factor applied to each observation (kg CO2eq/kg gas).
IPCC (2007). Climate Change 2007: The Physical Science Basis. Contribution of Working Group I to the Fourth Assessment Report of the Intergovernmental Panel on Climate Change.
IPCC (2013). Climate Change 2013: The Physical Science Basis. Contribution of Working Group I to the Fifth Assessment Report of the Intergovernmental Panel on Climate Change.
IPCC (2021). Climate Change 2021: The Physical Science Basis. Contribution of Working Group I to the Sixth Assessment Report of the Intergovernmental Panel on Climate Change.
This function aggregates a dataset from cohort level to herd level by summing specified variables over the defined 'id' columns.
calc_cohort_to_herd_aggregation( data_cohort, id_cols, vars_to_sum, cohort_short )calc_cohort_to_herd_aggregation( data_cohort, id_cols, vars_to_sum, cohort_short )
data_cohort |
Cohort-level dataset containing energy allocation variables and herd identifiers. Each row corresponds to a single sex–age cohort within a herd. |
id_cols |
Character. Unique identifier for the herd, repeated for each cohort belonging to the same herd. |
vars_to_sum |
Character vector. Names of numeric cohort-level variables to be summed across cohorts to produce herd-level totals (e.g., meat_allocation_energy, milk_allocation_energy, fibre_allocation_energy, work_allocation_energy, egg_allocation_energy) |
cohort_short |
Character. Sex- and age-specific cohort code describing the production stage of the animals. Supported values include:
|
A data.table at herd scale, in which selected cohort-level variables have been summed across all cohorts
belonging to the same herd, as defined by id_herd.
This function is part of the run_allocation_module() and run_aggregation_module().
run_allocation_module(),
run_aggregation_module()
Calculates the total value for each variable at the cohort level over the
full assessment period. Values are harmonized to a common unit
(kg/cohort/assessment duration) by accounting for cohort stock size
and simulation duration.
calc_cohort_totals( value, cohort_stock_size, ration_intake, feed_emissions_list, simulation_duration, variable_name, variable_type )calc_cohort_totals( value, cohort_stock_size, ration_intake, feed_emissions_list, simulation_duration, variable_name, variable_type )
value |
Numeric. Variable value expressed as (unit)/head/day for non-production variables and (unit)/cohort/assessment duration for production variables. Production variables can be explored from the list 'gleam_production_meta'. |
cohort_stock_size |
Numeric. Average population size in each of the 6 sex–age cohorts (# heads). (cohorts=FJ, FS, FA, MJ, MS, MA). |
ration_intake |
Numeric. Average daily dry matter intake of feed (kg DM/head/day). |
feed_emissions_list |
List of emission-source definitions for feed-related emissions. Each element is a list with two character fields:
|
simulation_duration |
Numeric. Length of the assessment period (days). |
variable_name |
Character. Names of emission variables to which allocation should be applied (e.g., "ch4_enteric", "ch4_manure_pasture", "ch4_manure_burned", "ch4_manure_other", "n2o_manure_pasture_direct", "n2o_manure_burned_direct", "n2o_manure_other_direct", "n2o_manure_burned_indirect", "n2o_manure_pasture_indirect", "n2o_manure_other_indirect", "co2_ration_fertilizer", "co2_ration_pesticides", "co2_ration_crop_activities", "co2_ration_luc_nopeat", "co2_ration_luc_peat", "n2o_ration_fertilizer", "n2o_ration_manure_applied", "n2o_ration_crop_residues", "ch4_ration_rice") |
variable_type |
Character. Variable group classification. Supported values include:
|
Production variables are already expressed at the cohort level for the entire assessment duration and are therefore returned unchanged. All other variables (emissions, feed, and nitrogen balance) are expressed per head per day and are scaled by cohort stock size and simulation duration to obtain cohort-level totals.
For production variables:
For emissions (except emissions from feed), feed, and nitrogen balance variables:
For feed emissions variables:
This function is part of the run_aggregation_module().
Numeric. Variable value expressed as (unit)/cohort/assessment duration for all variables.
Determines the initial, potential final, and slaughter live weights for a given sex–age cohort based on species‑specific biological parameters. The function assigns weights according to the animal's life stage (juvenile, subadult, adult) and the sex of the cohort.
calc_cohort_weights( cohort_short, live_weight_female_adult = NA_real_, live_weight_male_adult = NA_real_, live_weight_at_birth = NA_real_, live_weight_female_at_slaughter = NA_real_, live_weight_male_at_slaughter = NA_real_, live_weight_at_weaning = NA_real_ )calc_cohort_weights( cohort_short, live_weight_female_adult = NA_real_, live_weight_male_adult = NA_real_, live_weight_at_birth = NA_real_, live_weight_female_at_slaughter = NA_real_, live_weight_male_at_slaughter = NA_real_, live_weight_at_weaning = NA_real_ )
cohort_short |
Character. Sex- and age-specific cohort code describing the production stage of the animals. Supported values include:
|
live_weight_female_adult |
Numeric. Live weight of adult females (kg) |
live_weight_male_adult |
Numeric. Live weight of adult males (kg) |
live_weight_at_birth |
Numeric. Live weight of the animal at birth (kg). |
live_weight_female_at_slaughter |
Numeric. Slaughter weight of female sub-adult animals (kg). |
live_weight_male_at_slaughter |
Numeric. Slaughter weight of male sub-adult animals (kg). |
live_weight_at_weaning |
Numeric. Live weight of the animal at weaning (kg) |
The function attributes weights according to cohort and animal type:
Juveniles ("FJ", "MJ"):
live_weight_cohort_initial = live_weight_at_birth
live_weight_cohort_potential_final = live_weight_at_weaning
live_weight_cohort_at_slaughter = live_weight_at_weaning
Subadults ("FS", "MS"):
live_weight_cohort_initial = live_weight_at_weaning
live_weight_cohort_potential_final = adult weight for the cohort sex
(live_weight_female_adult for "FS", live_weight_male_adult for "MS")
live_weight_cohort_at_slaughter = subadult slaughter weight for the cohort sex
(live_weight_female_at_slaughter for "FS", live_weight_male_at_slaughter for "MS")
Adults ("FA", "MA"):
live_weight_cohort_initial = live_weight_female_adult for "FA",
and live_weight_cohort_initial = live_weight_male_adult for "MA"
live_weight_cohort_potential_final = adult weight for the cohort sex
live_weight_cohort_at_slaughter = adult weight for the cohort sex
This function is part of the run_weights_module().
A named list with:
Numeric. Live weight at the beginning of the cohort stage (kg).
Numeric. Potential final live weight attainable at the end of the cohort stage in the absence of offtake (kg). (For juveniles: equals weaning weight; For subadults: equals adult live weight; For adults: equals adult live weight)
Numeric. Live weight at slaughter for animals removed from the cohort (kg).
Numeric. Mature (adult) live weight that the animal can attain under given biological and management conditions (kg).
Calculates the methane conversion factor (ym, % of dietary gross energy in feed converted to methane) for a given species and cohort based on diet digestibility. Implements species- and cohort-specific rules consistent with IPCC Tier 2 approach.
calc_conversion_factor_ym( species_short, cohort_short, ration_digestibility_fraction )calc_conversion_factor_ym( species_short, cohort_short, ration_digestibility_fraction )
species_short |
Character. Code identifying the livestock species. Supported values include:
|
cohort_short |
Character. Sex- and age-specific cohort code describing the production stage of the animals. Supported values include:
|
ration_digestibility_fraction |
Numeric. Average digestibility of the feed ration, expressed as ratio of digestible (or metabolizable, for poultry) to gross energy content (fraction). |
ym is computed using species- and cohort-specific default relationships with diet digestibility (Opio et al., 2013).
ration_digestibility_fraction can be calculated with
calc_ration_digestibility - see also run_ration_quality_module.
For CTL and BFL:
For SHP, GTS and CML:
FA and MA cohorts:
FS and MS cohorts:
For PGS:
ym is assigned fixed values by cohort:
FA and MA cohorts:
FS and MS cohorts:
ym is returned as 0 for juvenile cohorts (FJ, MJ), assuming
negligible enteric methane production before weaning/rumen development.
This function is part of the run_emissions_enteric_module().
Numeric. Methane (CH4) conversion factor (ym), representing the percentage of gross energy of the feed ration that is converted to CH4 (percentage).
Opio, C., Gerber, P., Mottet, A., Falcucci, A., Tempio, G., MacLeod, M., Vellinga, T., Henderson, B. & Steinfeld, H. (2013). Greenhouse gas emissions from ruminant supply chains – A global life cycle assessment. Food and Agriculture Organization of the United Nations (FAO), Rome.
Jørgensen, H., Theil, P. K. & Knudsen, K. E. B. (2011). Enteric methane emission from pigs. In: Planet Earth 2011 – Global Warming Challenges and Opportunities for Policy and Practice (p. 610; Table 2). InTech.
IPCC. (2019). 2019 Refinement to the 2006 IPCC Guidelines for National Greenhouse Gas Inventories. Chapter 10: Emissions from Livestock and Manure Management, Equation 10.21.
IPCC. (2006). 2006 IPCC Guidelines for National Greenhouse Gas Inventories. Chapter 10: Emissions from Livestock and Manure Management, Equation 10.21.
run_emissions_enteric_module,
calc_ration_digestibility,
run_ration_quality_module
Calculates average daily weight gain for a given sex–age cohort based on the difference between potential final and initial live weights.
calc_daily_weight_gain( live_weight_cohort_potential_final, live_weight_cohort_initial, cohort_duration_days )calc_daily_weight_gain( live_weight_cohort_potential_final, live_weight_cohort_initial, cohort_duration_days )
live_weight_cohort_potential_final |
Numeric. Potential final live weight attainable at the end of the cohort stage in the absence of offtake (kg). (For juveniles: equals weaning weight; For subadults: equals adult live weight; For adults: equals adult live weight) |
live_weight_cohort_initial |
Numeric. Live weight at the beginning of the cohort stage (kg). |
cohort_duration_days |
Numeric. Amount of time that each animal spends in a specific cohort (days). |
Daily live weight gain is calculated as the difference between the potential final live weight and the initial live weight, divided by the duration of the cohort stage:
This function is part of the run_weights_module().
Numeric. Average live weight gain of the cohort over the cohort stage (kg/head/day).
Calculates the daily number of male and female offspring produced per adult female.
calc_fecundity_rates(parturition_rate, litter_size, birth_fraction_female)calc_fecundity_rates(parturition_rate, litter_size, birth_fraction_female)
parturition_rate |
Numeric. Average annual number of parturitions per female animal (# parturitions/adult female/year). A herd-level reproductive performance indicator calculated as the total number of parturitions (deliveries) occurring during a year divided by the number of adult females potentially able to give birth during that year. |
litter_size |
Numeric. Average number of offspring born per parturition (# offspring/parturition). This value can be calculated as the total number of offspring born divided by the total number of parturitions during the year. |
birth_fraction_female |
Numeric. Female birth fraction, defined as the probability that a newborn offspring is female (fraction). Can be calculated as the number of female offspring born divided by the total number of offspring born. |
A named list with two elements:
Numeric. Daily number of female offspring per adult female (# offspring/day)
Numeric. Daily number of male offspring per adult female (# offspring/day)
This function is part of the run_demographic_herd_module().
calc_fecundity_rates(parturition_rate = 0.8, litter_size = 2, birth_fraction_female = 0.5)calc_fecundity_rates(parturition_rate = 0.8, litter_size = 2, birth_fraction_female = 0.5)
Calculates species-specific feed digestibility fractions by feed component.
calc_feed_digestibility_fraction( feed_digestible_energy_ruminant, feed_digestible_energy_pigs, feed_gross_energy )calc_feed_digestibility_fraction( feed_digestible_energy_ruminant, feed_digestible_energy_pigs, feed_gross_energy )
feed_digestible_energy_ruminant |
Numeric. Digestible energy content of a feed component for ruminants, representing the energy absorbed by the animal after fecal losses (MJ/kg DM). |
feed_digestible_energy_pigs |
Numeric. Digestible energy content of a feed component for pigs, representing the energy absorbed by the animal after fecal losses (MJ/kg DM). |
feed_gross_energy |
Numeric. Gross energy content of a feed component, representing the total chemical energy released upon complete combustion of the feed (MJ/kg DM). |
Digestibility is computed as the ratio of usable energy to gross energy:
For ruminants and pigs, usable energy is represented by digestible_energy (DE),
which accounts for fecal energy losses.
This function is part of the run_ration_quality_module().
List with elements:
Numeric. Digestibility of a feed component for ruminants, expressed as the ratio of digestible energy to gross energy content (fraction).
Numeric. Digestibility of a feed component for pigs, expressed as the ratio of digestible energy to gross energy content (fraction).
Calculates the energy required for fibre production over the assessment period (MJ/cohort/assessment period), based on the daily energy requirement for fibre production, cohort size, and assessment duration.
calc_fibre_allocation_energy( species_short, cohort_stock_size = NA_real_, metabolic_energy_req_fibre_production = NA_real_, ratio_me_to_ne = NA_real_, simulation_duration = NA_real_ )calc_fibre_allocation_energy( species_short, cohort_stock_size = NA_real_, metabolic_energy_req_fibre_production = NA_real_, ratio_me_to_ne = NA_real_, simulation_duration = NA_real_ )
species_short |
Character. Code identifying the livestock species. Supported values include:
|
cohort_stock_size |
Numeric. Average population size in each of the 6 sex–age cohorts (# heads). (cohorts=FJ, FS, FA, MJ, MS, MA). |
metabolic_energy_req_fibre_production |
Numeric. Energy required for the synthesis of fibre for SHP, GTS and CML. Assumed to be 0 for other species. (MJ/head/day). Expressed as net energy for SHP and GTS and as metabolizable energy for CML. |
ratio_me_to_ne |
Numeric. Ratio of metabolizable energy converted to net energy (fraction). Used for species_short = CML. |
simulation_duration |
Numeric. Length of the assessment period (days). |
This function provides the fibre-related energy term used in a biophysical allocation framework to apportion emissions between milk and other co-products in multifunctional livestock production systems.
The approach implements the IDF (2022) standard, adapted from Thoma and Nemecek (2020), and is consistent with FAO LEAP livestock LCA guidelines (FAO, 2016a, 2016b, 2016c) and with ISO 14044:2006 (Section 4.3.4.2, Step 2).
In accordance with ISO 14044:2006 (Section 4.3.4.2, Step 2), known processing or biophysical relationships may be used to assign shared inputs and outputs of a single production unit to individual products or sub-units. In livestock systems, this includes apportioning shared feed and energy use according to physiological energy requirements (e.g., net energy for lactation, growth, etc.). If the resulting process remains multifunctional, these energy terms may subsequently be used to derive allocation factors among co-products.
Total fibre-related energy over the assessment period is computed for
fibre-producing species (CML, SHP,
GTS) and applicable cohorts ("FA", "FS", "MA",
"MS").
The fibre_allocation_energy is calculated as follows:
for camels (CML), and:
for sheep (SHP) and goats (GTS).
where metabolic_energy_req_fibre_production can be computed using
calc_metabolic_energy_req_fibre (see also
run_metabolic_energy_req_module).
This function is part of the run_allocation_module().
Numeric. Energy required to produce all fibre output by cohort (MJ/cohort/assessment period). Non-zero values are expected only for fibre-producing species (CML, SHP, GTS) and applicable cohorts ("FA", "FS", "MA", "MS").
ISO. (2006). Environmental management — Life cycle assessment — Requirements and guidelines (ISO 14044:2006). International Organization for Standardization, Geneva.
IDF. (2022). The IDF Global Carbon Footprint Standard for the Dairy Sector. Bulletin of the IDF No. 520/2022. International Dairy Federation, Brussels.
Thoma, G., and Nemecek, T. (2020). Allocation between milk and meat in dairy LCA: Critical discussion of the IDF’s standard methodology. In Proceedings of the 12th International Conference on Life Cycle Assessment of Food (LCAFood 2020) (pp. 83–89), 13–16 October, Berlin, Germany.
FAO. (2016a). Environmental performance of large ruminant supply chains: Guidelines for assessment. Livestock Environmental Assessment and Performance (LEAP) Partnership. FAO, Rome, Italy.
FAO. (2016b). Greenhouse gas emissions and fossil energy use from small ruminant supply chains: Guidelines for assessment. Livestock Environmental Assessment and Performance (LEAP) Partnership. FAO, Rome, Italy.
FAO. (2016c). Greenhouse gas emissions and fossil energy use from poultry supply chains: Guidelines for assessment. Livestock Environmental Assessment and Performance (LEAP) Partnership. FAO, Rome, Italy.
run_allocation_module,
calc_metabolic_energy_req_fibre,
run_metabolic_energy_req_module
Calculates fibre production for producing cohorts (FA, FS, MA, MS)
of fibre-producing species (CML, SHP, GTS) over the assessment period
(kg/cohort/assessment period).
calc_fibre_production( species_short, cohort_short, fibre_yield_year, simulation_duration, cohort_stock_size )calc_fibre_production( species_short, cohort_short, fibre_yield_year, simulation_duration, cohort_stock_size )
species_short |
Character. Code identifying the livestock species. Supported values include:
|
cohort_short |
Character. Sex- and age-specific cohort code describing the production stage of the animals. Supported values include:
|
fibre_yield_year |
Numeric. Annual production yield of fibre, such as wool, cashmere, mohair (kg/head/year). Required only for species = CML, SHP, and GTS. |
simulation_duration |
Numeric. Length of the assessment period (days). |
cohort_stock_size |
Numeric. Average population size in each of the 6 sex–age cohorts (# heads). (cohorts=FJ, FS, FA, MJ, MS, MA). |
Fibre production outputs are computed as follows:
Non-zero fibre outputs are only expected for producing cohorts (FA, FS, MA, MS)
of fibre-producing species (CML, SHP, GTS).
This function is part of the run_production_module().
Numeric. Total fibre produced over the assessment period by cohort (kg /cohort/assessment period).
Calculates the energy required for meat production over the assessment period (MJ/cohort/assessment period), based on total live weight gained by the cohort from birth to slaughter.
calc_meat_allocation_energy( species_short, cohort_short, meat_production_live_weight_cohort, live_weight_cohort_at_slaughter = NA_real_, live_weight_at_birth = NA_real_, ratio_me_to_ne = NA_real_ )calc_meat_allocation_energy( species_short, cohort_short, meat_production_live_weight_cohort, live_weight_cohort_at_slaughter = NA_real_, live_weight_at_birth = NA_real_, ratio_me_to_ne = NA_real_ )
species_short |
Character. Code identifying the livestock species. Supported values include:
|
cohort_short |
Character. Sex- and age-specific cohort code describing the production stage of the animals. Supported values include:
|
meat_production_live_weight_cohort |
Numeric. Total meat produced as live weight over the assessment period by cohort (kg/cohort/assessment period). |
live_weight_cohort_at_slaughter |
Numeric. Live weight at slaughter for animals removed from the cohort (kg). |
live_weight_at_birth |
Numeric. Live weight of the animal at birth (kg). |
ratio_me_to_ne |
Numeric. Ratio of metabolizable energy converted to net energy (fraction). Used for species_short = CML. |
This function provides the meat-related energy term used in a biophysical allocation framework to apportion emissions between milk and other co-products in multifunctional livestock production systems.
The approach implements the IDF (2022) standard, adapted from Thoma and Nemecek (2020), and is consistent with FAO LEAP livestock LCA guidelines (FAO, 2016a, 2016b, 2016c) and with ISO 14044:2006 (Section 4.3.4.2, Step 2).
In accordance with ISO 14044:2006, known biophysical relationships may be used to assign shared inputs and outputs of a production system to individual products or sub-units. In livestock systems, this includes apportioning shared feed and energy use according to physiological energy requirements such as growth, lactation, and maintenance. If the resulting process remains multifunctional, these energy terms may subsequently be used to derive allocation factors among co-products.
The meat_allocation_energy is calculated as follows:
where
specific_energy_meat is the average energy required to produce
one kilogram of live weight, accounting for species- and cohort-specific
growth characteristics (MJ/kg live weight).
meat_production_live_weight_cohort is the total live weight of
animals sold for meat over the assessment period. It can be computed using
calc_meat_production (see also
run_production_module).
Specific approaches by species:
For CTL, BFL, CML,
SHP, GTS:
Growth energy is calculated using species- and
cohort-specific biophysical relationships adapted from established growth
energy formulations (further details in calc_metabolic_energy_req_growth).
For PGS:
Growth energy is not calculated in this
function and 0 is returned. In downstream processing,
calc_allocation_shares assigns 100% of the allocation to the
edible meat commodity for pig systems.
This function is part of the run_allocation_module().
Numeric. Energy required by a given sex–age cohort for total meat output by cohort during the assessment
period,
equal to the energy needed to produce all live-weight gain to reach the target slaughter weight (MJ/cohort/assessment
period).
For pigs (PGS), the function returns 0 by design.
ISO. (2006). Environmental management — Life cycle assessment — Requirements and guidelines (ISO 14044:2006). International Organization for Standardization, Geneva.
IDF. (2022). The IDF Global Carbon Footprint Standard for the Dairy Sector. Bulletin of the IDF No. 520/2022. International Dairy Federation, Brussels.
Thoma, G., and Nemecek, T. (2020). Allocation between milk and meat in dairy LCA: Critical discussion of the IDF’s standard methodology. In Proceedings of the 12th International Conference on Life Cycle Assessment of Food (LCAFood 2020) (pp. 83–89), 13–16 October, Berlin, Germany.
FAO. (2016a). Environmental performance of large ruminant supply chains: Guidelines for assessment. Livestock Environmental Assessment and Performance (LEAP) Partnership. FAO, Rome, Italy.
FAO. (2016b). Greenhouse gas emissions and fossil energy use from small ruminant supply chains: Guidelines for assessment. Livestock Environmental Assessment and Performance (LEAP) Partnership. FAO, Rome, Italy.
FAO. (2016c). Greenhouse gas emissions and fossil energy use from poultry supply chains: Guidelines for assessment. Livestock Environmental Assessment and Performance (LEAP) Partnership. FAO, Rome, Italy.
run_allocation_module,
calc_meat_production,
run_production_module,
calc_allocation_shares
Calculates cohort-level meat production outputs over the assessment period based on the number of animals removed from the herd (offtake). The function returns multiple production metrics expressed in live weight, carcass weight, bone-free meat, and meat protein (kg/cohort/assessment period).
calc_meat_production( offtake_heads_assessment, live_weight_cohort_at_slaughter, carcass_dressing_fraction, bone_free_meat_fraction, meat_protein_fraction )calc_meat_production( offtake_heads_assessment, live_weight_cohort_at_slaughter, carcass_dressing_fraction, bone_free_meat_fraction, meat_protein_fraction )
offtake_heads_assessment |
Numeric. Total number of animals removed via offtake over the assessment period, aggregated to 6 sex–age cohorts (heads/assessment period) (cohorts = FJ, FS, FA, MJ, MS, MA). |
live_weight_cohort_at_slaughter |
Numeric. Live weight at slaughter for animals removed from the cohort (kg). |
carcass_dressing_fraction |
Numeric. Ratio of a slaughtered animal's carcass weight to its live weight (fraction). |
bone_free_meat_fraction |
Numeric. Ratio of bone-free-meat to carcass weight (fraction). |
meat_protein_fraction |
Numeric. Protein content of bone-free-meat (kg protein/kg bone-free-meat). |
Meat production outputs are computed as follows:
meat_production_live_weight_cohort is computed as:
meat_production_carcass_weight_cohort is computed as:
meat_production_bone_free_meat_cohort is computed as:
meat_production_protein_cohort is computed as:
This function is part of the run_production_module().
A named list with:
Numeric . Total meat produced as live weight over the assessment period by cohort (kg/cohort/assessment period).
Numeric. Total meat as carcass weight (excluding organs, and other by-products after dressing) produced over the assessment period by cohort (kg/cohort/assessment period).
Numeric. Total bone-free-meat (excluding bones, organs, and other by-products after dressing and bone removal) produced over the assessment period by cohort (kg/cohort/assessment period).
Numeric. Total meat protein (excluding bones, organs, and other by-products after dressing and bone removal) produced over the assessment period by cohort (kg protein/cohort/assessment period).
run_production_module,
run_demographic_herd_module,
run_weights_module
Calculates the energy requirement for activity by cohort (MJ/head/day), defined as the amount of energy needed to support animal movement and physical activity.
calc_metabolic_energy_req_activity( species_short, cohort_short, metabolic_energy_req_maintenance, live_weight_cohort_average, low_activity_fraction, high_activity_fraction )calc_metabolic_energy_req_activity( species_short, cohort_short, metabolic_energy_req_maintenance, live_weight_cohort_average, low_activity_fraction, high_activity_fraction )
species_short |
Character. Code identifying the livestock species. Supported values include:
|
cohort_short |
Character. Sex- and age-specific cohort code describing the production stage of the animals. Supported values include:
|
metabolic_energy_req_maintenance |
Numeric. Energy required for maintenance, defined as the amount of energy needed to keep the animal at equilibrium such that body energy is neither gained nor lost. Expressed as net energy for CTL, BFL, SHP, GTS and as metabolizable energy for CML and PGS (MJ/head/day). |
live_weight_cohort_average |
Numeric. Average live weight over the cohort stage. Computed by accounting for the share of offtaken animals within the cohort, using their slaughter weight, and the potential final weight of animals that remain in the cohort (kg). |
low_activity_fraction |
Numeric. Proportion of the assessment period during which the animal performs low-intensity movement typical of stall-feeding or near-field grazing, characterized by minimal walking distances and flat terrain (fraction). |
high_activity_fraction |
Numeric. Proportion of the assessment period during which the animal engages in sustained locomotion associated with herding or long-distance grazing, typically involving extended walking distances and/or uneven or hilly terrain (fraction). |
This approach follows the IPCC Tier 2 energy partitioning method and applies:
For SHP and GTS, activity energy is calculated as:
where
is an activity coefficient (dimensionless for CTL, BFL, PGS;
MJ/day/kg for SHP, GTS) that reflects the animal’s feeding and management conditions.
metabolic_energy_req_maintenance can be calculated using
calc_metabolic_energy_req_maintenance().
For CTL, BFL, SHP and GTS, is computed as a weighted average of activity levels
over the assessment period to account for variation in management and grazing intensity.
Specific coefficients by species and cohort:
CTL, BFL (NRC, 1996; AFRC, 1993):
low_activity_fraction:
high_activity_fraction:
CML (Wardeh, 2004):
all activity levels:
GTS (AFRC, 1993):
low_activity_fraction:
high_activity_fraction:
SHP (AFRC, 1993):
low_activity_fraction:
high_activity_fraction:
PGS (NRC, 1998):
all activity levels:
This function is part of the run_metabolic_energy_req_module().
Numeric. Energy required for activity, defined as the amount of energy needed to support animal movement and physical activity (MJ/head/day). Expressed as net energy for CTL, BFL, SHP, GTS and as metabolizable energy for CML and PGS.
NRC (1998). Nutrient Requirements of Swine, 10th Revised Edition. National Academies Press, Washington, DC.
NRC (1996). Nutrient Requirements of Beef Cattle, 7th Revised Edition. National Academies Press, Washington, DC.
AFRC (1993). Energy and Protein Requirements of Ruminants. An Advisory Manual Prepared by the AFRC Technical Committee on Responses to Nutrients. CAB International, Wallingford, UK.
IPCC. (2019). 2019 Refinement to the 2006 IPCC Guidelines for National Greenhouse Gas Inventories, Chapter 10: Emissions from Livestock and Manure Management, Equation 10.4; Table 10.5.
IPCC. (2006). 2006 IPCC Guidelines for National Greenhouse Gas Inventories, Chapter 10: Emissions from Livestock and Manure Management, Equation 10.4; Table 10.5.
Wardeh, M. F. (2004). The nutrient requirements of the dromedary camel. Journal of Camel Science, 1(1):37-45. The Camel Applied Research and Development Network (CARDN), Arab Center for the Studies of Arid Zones and Dry Lands (ACSAD).
run_metabolic_energy_req_module,
calc_metabolic_energy_req_maintenance,
calc_avg_weights
Calculates the energy requirement for fibre production (MJ/head/day), defined as the additional energy required for the synthesis of animal fibre (e.g. wool or hair).
calc_metabolic_energy_req_fibre( species_short, cohort_short, fibre_yield_year = NA_real_ )calc_metabolic_energy_req_fibre( species_short, cohort_short, fibre_yield_year = NA_real_ )
species_short |
Character. Code identifying the livestock species. Supported values include:
|
cohort_short |
Character. Sex- and age-specific cohort code describing the production stage of the animals. Supported values include:
|
fibre_yield_year |
Numeric. Annual production yield of fibre, such as wool, cashmere, mohair (kg/head/year). Required only for species = CML, SHP, and GTS. |
This component follows the IPCC Tier 2 partitioning approach and is applied
only to fibre-producing species and relevant cohorts, which are assumed to be FA, FS, MA, and MS.
Species-specific approach:
SHP and GTS (IPCC, 2006; IPCC, 2019):
For sheep and goats, fibre production energy is calculated assuming a fixed
net energy cost of MJ per kilogram of fibre produced. Annual fibre
production is converted to a daily requirement as:
where:
is annual fibre production
(kg/head/year),
is the net energy requirement per kilogram of fibre
(MJ/kg fibre),
division by converts annual production to a daily basis.
CML (AFRC, 1998; Cannas et al., 2007):
For camels, fibre energy requirements are first calculated on a net energy basis and then converted to metabolizable energy using a net-to-metabolizable energy efficiency coefficient:
where:
is the net energy requirement per kilogram of fibre
(MJ/kg fibre),
is the efficiency of conversion from metabolizable energy
to net energy for fibre production (fraction),
is annual fibre production per animal
(kg/head/year),
to convert annual production to a daily basis.
The efficiency coefficient of is adopted by analogy with goats,
assuming a dietary metabolizability of approximately 0.55, following AFRC
guidance and the synthesis by Cannas et al. (2007).
Other species: Fibre production energy is assumed to be zero.
This function is part of the run_metabolic_energy_req_module().
Numeric. Energy required for the synthesis of fibre for SHP, GTS and CML. Assumed to be 0 for other species. (MJ/head/day). Expressed as net energy for CTL, BFL, SHP, GTS and as metabolizable energy for CML and PGS (MJ/head/day).
AFRC (1998) The Nutrition of Goats. CAB International, Wallingford, UK.
AFRC (1993). Energy and Protein Requirements of Ruminants. An Advisory Manual Prepared by the AFRC Technical Committee on Responses to Nutrients. CAB International, Wallingford, UK.
Cannas, A., Atzori, A. S., Boe, F., & Teixeira, I. (2007). Energy and protein requirements of goats. In: Dairy sheep nutrition (pp. 31-49). CAB International, Wallingford, UK.
IPCC. (2019). 2019 Refinement to the 2006 IPCC Guidelines for National Greenhouse Gas Inventories. Chapter 10: Emissions from Livestock and Manure Management, Equation 10.12.
IPCC. (2006). 2006 IPCC Guidelines for National Greenhouse Gas Inventories. Chapter 10: Emissions from Livestock and Manure Management, Equation 10.12.
run_metabolic_energy_req_module,
Calculates the energy requirement for growth by cohort (MJ/head/day), defined as the energy required for body tissue accretion, corresponding to the retained energy component of live weight gain.
calc_metabolic_energy_req_growth( species_short, cohort_short, live_weight_cohort_average = NA_real_, live_weight_cohort_final = NA_real_, live_weight_cohort_initial = NA_real_, live_weight_mature_stage = NA_real_, daily_weight_gain = NA_real_, offtake_rate = NA_real_, cohort_duration_days = NA_real_ )calc_metabolic_energy_req_growth( species_short, cohort_short, live_weight_cohort_average = NA_real_, live_weight_cohort_final = NA_real_, live_weight_cohort_initial = NA_real_, live_weight_mature_stage = NA_real_, daily_weight_gain = NA_real_, offtake_rate = NA_real_, cohort_duration_days = NA_real_ )
species_short |
Character. Code identifying the livestock species. Supported values include:
|
cohort_short |
Character. Sex- and age-specific cohort code describing the production stage of the animals. Supported values include:
|
live_weight_cohort_average |
Numeric. Average live weight over the cohort stage. Computed by accounting for the share of offtaken animals within the cohort, using their slaughter weight, and the potential final weight of animals that remain in the cohort (kg). |
live_weight_cohort_final |
Numeric. Live weight at the end of the cohort stage, accounting for both surviving and offtaken animals. Computed as a weighted average of the potential final weight of surviving animals and the slaughter weight of offtaken animals, based on the offtake rate (kg). |
live_weight_cohort_initial |
Numeric. Live weight at the beginning of the cohort stage (kg). |
live_weight_mature_stage |
Numeric. Mature (adult) live weight that the animal can attain under given biological and management conditions (kg). |
daily_weight_gain |
Numeric. Average live weight gain of the cohort over the cohort stage (kg/head/day). |
offtake_rate |
Numeric. Annual proportion of animals removed from the herd for each sex-age cohort (fraction). |
cohort_duration_days |
Numeric. Amount of time that each animal spends in a specific cohort (days). |
This function follows the IPCC Tier 2 energy partitioning approach and applies species-specific equations for growth energy requirements.
In general, growth energy is computed only for growing cohorts (FJ, FS, MJ, MS);
in this implementation, growth is set to 0 for adult cohorts (FA, MA).
Species-specific approach:
CTL and BFL (NRC, 1996; IPCC, 2006; IPCC, 2019)
Growth energy is computed using a growth coefficient that differs between
castrated and intact males. For male cohorts, is calculated as a weighted average
using offtake_rate, assuming that animals removed from the herd are castrated and
animals remaining in the cohort are intact.
SHP and GTS (Gibbs et al., 2002; AFRC, 1993; IPCC, 2006; IPCC, 2019)
For sheep and goats, growth energy is calculated using a linear formulation with coefficients
and (MJ/kg live weight). For male cohorts, the coefficients differ between
castrated and intact males; the model computes a weighted average using offtake_rate,
assuming that offtaken animals are castrated.
CML (Al-Jassim, 2019)
Growth energy is represented using a simplified linear relationship with daily weight gain.
PGS (NRC, 1998)
For pigs, growth is assumed to consist exclusively of protein tissue and fat tissue, and growth energy requirements are expressed as metabolizable energy (ME).
The growth energy coefficient (MJ/kg live weight) is calculated as:
Total metabolizable energy required for growth is then:
where:
is the growth energy coefficient (MJ/kg live weight),
prot_tissue_frac = 0.65 is the fraction of protein tissue in daily weight gain,
meat_protein = 0.23 is the fraction of protein in protein tissue,
meat_protein_energy = 54.0 is the ME cost of protein deposition (MJ/kg protein),
fat_adipose_tissue_frac = 0.90 is the fraction of fat in adipose tissue,
meat_fat_energy = 52.3 is the ME cost of fat deposition (MJ/kg fat).
This function is part of the run_metabolic_energy_req_module().
Numeric. Energy required for growth (i.e., weight gain) (MJ/head/day). Expressed as net energy for CTL, BFL, SHP, GTS and as metabolizable energy for CML and PGS.
Al-Jassim, R. (2019). Metabolisable energy and protein requirements of the Arabian camel (Camelus dromedarius). Journal of Camelid Science (12) 33-45
NRC (1998). Nutrient Requirements of Swine, 10th Revised Edition. National Academies Press, Washington, DC.
NRC (1996). Nutrient Requirements of Beef Cattle, 7th Revised Edition. National Academies Press, Washington, DC.
AFRC (1993). Energy and Protein Requirements of Ruminants. An Advisory Manual Prepared by the AFRC Technical Committee on Responses to Nutrients. CAB International, Wallingford, UK.
Gibbs, M.J., Conneely, D., Johnson, D., Lassey, K.R. and Ulyatt, M.J. (2002). CH4 emissions from enteric fermentation. In: Background Papers: IPCC Expert Meetings on Good Practice Guidance and Uncertainty Management in National Greenhouse Gas Inventories, p 297–320. IPCC-NGGIP, Institute for Global Environmental Strategies (IGES), Hayama, Kanagawa, Japan.
IPCC. (2019). 2019 Refinement to the 2006 IPCC Guidelines for National Greenhouse Gas Inventories, Chapter 10: Emissions from Livestock and Manure Management, Equation 10.6 and 10.7; Table 10.6.
IPCC. (2006). 2006 IPCC Guidelines for National Greenhouse Gas Inventories, Chapter 10: Emissions from Livestock and Manure Management, Equation 10.6 and 10.7; Table 10.6.
run_metabolic_energy_req_module,
calc_cohort_weights,
calc_avg_weights,
calc_daily_weight_gain
Calculates the energy requirement for lactation by cohort (MJ/head/day), defined as the energy needed to support milk production by lactating females.
calc_metabolic_energy_req_lactation( species_short, cohort_short, lactating_females_fraction = NA_real_, milk_yield_day = NA_real_, milk_fat_fraction = NA_real_, non_productive_duration = NA_real_, pregnancy_duration = NA_real_, litter_size = NA_real_, death_rate_juvenile = NA_real_, live_weight_at_birth = NA_real_, live_weight_at_weaning = NA_real_, lactation_duration = NA_real_, parturition_rate = NA_real_ )calc_metabolic_energy_req_lactation( species_short, cohort_short, lactating_females_fraction = NA_real_, milk_yield_day = NA_real_, milk_fat_fraction = NA_real_, non_productive_duration = NA_real_, pregnancy_duration = NA_real_, litter_size = NA_real_, death_rate_juvenile = NA_real_, live_weight_at_birth = NA_real_, live_weight_at_weaning = NA_real_, lactation_duration = NA_real_, parturition_rate = NA_real_ )
species_short |
Character. Code identifying the livestock species. Supported values include:
|
cohort_short |
Character. Sex- and age-specific cohort code describing the production stage of the animals. Supported values include:
|
lactating_females_fraction |
Numeric. Proportion of adult females that are lactating during the assessment period (fraction). Required only for species = CML, CTL, BFL, SHP, and GTS. |
milk_yield_day |
Numeric. Average milk yield per milk-producing animal during the assessment duration (kg/head/day). This value is calculated as the total quantity of milk produced for human consumption by milk-producing animals during the assessment period, divided by the number of milk-producing animals, and the length of the assessment period (days). Required only for species = CML, CTL, BFL, SHP, and GTS. |
milk_fat_fraction |
Numeric. Milk fat fraction (kg fat/kg milk). Required only for species = CML, CTL, BFL, SHP, and GTS. |
non_productive_duration |
Numeric. Period during which the animal is not performing any productive physiological function such as pregnancy or lactation (days). Required only for PGS. |
pregnancy_duration |
Numeric. Duration of pregnancy period (days). |
litter_size |
Numeric. Average number of offspring born per parturition (# offspring/parturition). This value can be calculated as the total number of offspring born divided by the total number of parturitions during the year. |
death_rate_juvenile |
Numeric. Fraction of deaths in a herd over a year for juvenile cohorts (i.e. FJ and MJ), (fraction). |
live_weight_at_birth |
Numeric. Live weight of the animal at birth (kg). |
live_weight_at_weaning |
Numeric. Live weight of the animal at weaning (kg). |
lactation_duration |
Numeric. Duration of the lactation period, defined as the number of days during which the animal is lactating (days). Required only for PGS. |
parturition_rate |
Numeric. Average annual number of parturitions per female animal (# parturitions/adult female/year). A herd-level reproductive performance indicator calculated as the total number of parturitions (deliveries) occurring during a year divided by the number of adult females potentially able to give birth during that year. |
This approach follows the IPCC Tier 2 partitioning method and applies species-specific equations for lactation energy requirements as a function of the quantity of milk produced and a species-specific energy cost per unit of milk.
Requirements are calculated only for cohort = FA (adult females) and are scaled
by the proportion of lactating animals (lactating_females_fraction) or reproducing
females (parturition_rate) within the cohort.
Species-specific approach:
CTL, BFL, CML, SHP and GTS:
Total milk production includes:
milk extracted for human consumption (milk_yield)
milk consumed directly by offspring (milk_for_offspring)
In general form, lactation energy is computed as:
where:
energy_milk is a species-specific coefficient representing the
net energy cost of producing one kilogram of milk (MJ/kg milk).
Species-specific values of energy_milk are:
CTL, BFL: estimated as a function of milk fat content,
(NRC, 1989),
CML: (Wardeh, 2004),
SHP: (AFRC, 1993),
GTS: (AFRC, 1998).
milk_for_offspring is the daily amount of milk required to rear offspring
across the year (kg/day). It is calculated assuming that 5 kg of milk are
required for each kilogram of live-weight gain up to weaning:
For SHP and GTS, milk_for_offspring is multiplied by
litter_size to account for multiple offspring per birth.
PGS (NRC, 1998):
Lactation energy accounts only for the milk consumed directly by offspring
(milk_for_offspring), adjusted by the fraction of the reproductive cycle spent
in lactation (cadj):
where:
is the coefficient for lactation energy requirement
(MJ/g live weight),
is the coefficient for sow weight loss during lactation
(MJ/head/day),
is the efficiency of conversion of dietary intake to milk energy (fraction),
is the fraction of the reproductive cycle spent in lactation:
This function is part of the run_metabolic_energy_req_module().
Numeric. Energy required for lactation (MJ/head/day). Expressed as net energy for CTL, BFL, SHP, GTS and as metabolizable energy for CML and PGS.
AFRC (1998) The Nutrition of Goats. CAB International, Wallingford, UK.
AFRC (1993). Energy and Protein Requirements of Ruminants. An Advisory Manual Prepared by the AFRC Technical Committee on Responses to Nutrients. CAB International, Wallingford, UK.
IPCC. (2019). 2019 Refinement to the 2006 IPCC Guidelines for National Greenhouse Gas Inventories, Chapter 10: Emissions from Livestock and Manure Management, Equation 10.8-10.10.
IPCC. (2006). 2006 IPCC Guidelines for National Greenhouse Gas Inventories, Chapter 10: Emissions from Livestock and Manure Management, Equation 10.8-10.10.
NRC (1998). Nutrient Requirements of Swine, 10th Revised Edition. National Academies Press, Washington, DC.
NRC (1989) Nutrient Requirements of Dairy Cattle, 6th Ed. . Washington, D.C. U.S.A: National Academy Press.
Wardeh, M. F. (2004). The nutrient requirements of the dromedary camel. Journal of Camel Science, 1(1):37-45. The Camel Applied Research and Development Network (CARDN), Arab Center for the Studies of Arid Zones and Dry Lands (ACSAD).
run_metabolic_energy_req_module
Calculates the energy requirement for maintenance by cohort (MJ/head/day), defined as the energy required to maintain basal physiological functions at equilibrium, with no net gain or loss of body energy.
calc_metabolic_energy_req_maintenance( species_short, cohort_short, live_weight_cohort_average, lactating_females_fraction = NA_real_, offtake_rate = NA_real_, age_first_parturition = NA_real_ )calc_metabolic_energy_req_maintenance( species_short, cohort_short, live_weight_cohort_average, lactating_females_fraction = NA_real_, offtake_rate = NA_real_, age_first_parturition = NA_real_ )
species_short |
Character. Code identifying the livestock species. Supported values include:
|
cohort_short |
Character. Sex- and age-specific cohort code describing the production stage of the animals. Supported values include:
|
live_weight_cohort_average |
Numeric. Average live weight over the cohort stage. Computed by accounting for the share of offtaken animals within the cohort, using their slaughter weight, and the potential final weight of animals that remain in the cohort (kg). |
lactating_females_fraction |
Numeric. Proportion of adult females that are lactating during the assessment period (fraction). Required only for species = CML, CTL, BFL, SHP, and GTS. |
offtake_rate |
Numeric. Annual proportion of animals removed from the herd for each sex-age cohort (fraction). |
age_first_parturition |
Numeric. Age at first parturition for female breeding animals (days) |
This approach follows the IPCC Tier 2 partitioning method and applies:
where is a category-specific coefficient (MJ/day/kg) that reflects
basal metabolic requirements and varies by species, physiological status, and sex.
For selected cohorts, is computed as a weighted average to account for:
CTL, BFL: lactating vs. non-lactating females
CTL, BFL, SHP: intact vs. castrated males - Offtaken animals assumed castrated
SHP: animals below vs. above one year of age
Specific coefficients by species and cohort:
CTL and BFL (NRC, 1996; AFRC, 1993):
FA:
FS, FJ, MJ:
MA, MS:
CML (Wardeh, 2004):
All cohorts:
GTS (AFRC, 1993):
All cohorts:
SHP (AFRC, 1993):
FA:
FJ:
FS:
MA:
MJ:
MS:
PGS (NRC, 1998):
All cohorts:
This function is part of the run_metabolic_energy_req_module().
Numeric. Energy required for maintenance, defined as the amount of energy needed to keep the animal at equilibrium such that body energy is neither gained nor lost. Expressed as net energy for CTL, BFL, SHP, GTS and as metabolizable energy for CML and PGS (MJ/head/day).
NRC (1998). Nutrient Requirements of Swine, 10th Revised Edition. National Academies Press, Washington, DC.
NRC (1996). Nutrient Requirements of Beef Cattle, 7th Revised Edition. National Academies Press, Washington, DC.
AFRC (1993). Energy and Protein Requirements of Ruminants. An Advisory Manual Prepared by the AFRC Technical Committee on Responses to Nutrients. CAB International, Wallingford, UK.
IPCC. (2019). 2019 Refinement to the 2006 IPCC Guidelines for National Greenhouse Gas Inventories. Chapter 10: Emissions from Livestock and Manure Management, Equation 10.3; Table 10.4.
IPCC. (2006). 2006 IPCC Guidelines for National Greenhouse Gas Inventories. Chapter 10: Emissions from Livestock and Manure Management, Equation 10.3; Table 10.4.
Wardeh, M. F. (2004). The nutrient requirements of the dromedary camel. Journal of Camel Science, 1(1):37-45. The Camel Applied Research and Development Network (CARDN), Arab Center for the Studies of Arid Zones and Dry Lands (ACSAD).
run_metabolic_energy_req_module,
calc_avg_weights
Calculates the energy requirement for pregnancy by cohort (MJ/head/day) for pregnant females, defined as the additional energy needed to support gestation.
calc_metabolic_energy_req_pregnancy( species_short, cohort_short, metabolic_energy_req_maintenance = NA_real_, parturition_rate = NA_real_, litter_size = NA_real_, pregnancy_duration = NA_real_, non_productive_duration = NA_real_, lactation_duration = NA_real_, cohort_duration_days = NA_real_, offtake_rate = NA_real_ )calc_metabolic_energy_req_pregnancy( species_short, cohort_short, metabolic_energy_req_maintenance = NA_real_, parturition_rate = NA_real_, litter_size = NA_real_, pregnancy_duration = NA_real_, non_productive_duration = NA_real_, lactation_duration = NA_real_, cohort_duration_days = NA_real_, offtake_rate = NA_real_ )
species_short |
Character. Code identifying the livestock species. Supported values include:
|
cohort_short |
Character. Sex- and age-specific cohort code describing the production stage of the animals. Supported values include:
|
metabolic_energy_req_maintenance |
Numeric. Energy required for maintenance, defined as the amount of energy needed to keep the animal at equilibrium such that body energy is neither gained nor lost. Expressed as net energy for CTL, BFL, SHP, GTS and as metabolizable energy for CML and PGS (MJ/head/day). |
parturition_rate |
Numeric. Average annual number of parturitions per female animal (# parturitions/adult female/year). A herd-level reproductive performance indicator calculated as the total number of parturitions (deliveries) occurring during a year divided by the number of adult females potentially able to give birth during that year. |
litter_size |
Numeric. Average number of offspring born per parturition (# offspring/parturition). This value can be calculated as the total number of offspring born divided by the total number of parturitions during the year. |
pregnancy_duration |
Numeric. Duration of pregnancy period (days). |
non_productive_duration |
Numeric. Period during which the animal is not performing any productive physiological function such as pregnancy or lactation (days). Required only for PGS. |
lactation_duration |
Numeric. Duration of the lactation period, defined as the number of days during which the animal is lactating (days). Required only for PGS. |
cohort_duration_days |
Numeric. Amount of time that each animal spends in a specific cohort (days). |
offtake_rate |
Numeric. Annual proportion of animals removed from the herd for each sex-age cohort (fraction). |
This component follows the IPCC Tier 2 partitioning framework and is applied
only to female cohorts (FA and FS).
Pregnancy energy (metabolic_energy_req_pregnancy) represents the additional
energy required to support gestation. Requirements are computed as a fraction
of maintenance energy and are adjusted to reflect reproductive activity within
the cohort:
For FA, requirements are scaled by the annual parturition rate
(parturition_rate) and (when applicable) by the fraction of the reproductive cycle
spent in gestation
(pregnancy_duration/(pregnancy_duration+lactation_duration+non_productive_duration)).
For FS, only a fraction of animals is assumed to reach reproductive
age within the cohort; requirements are therefore scaled by the proportion
remaining in the cohort () and by the share of the
cohort duration spent pregnant (pregnancy_duration/cohort_duration_days).
General form
where
is a species-specific pregnancy coefficient,
is a scaling term that depends on cohort (FA vs FS).
can be calculated using calc_metabolic_energy_req_maintenance()
Specific coefficients by species and cohort:
CTL and BFL (IPCC, 2006, 2019):
Pregnancy energy is approximated as of maintenance energy.
FA:
FS:
CML (Wardeh, 2004):
Pregnancy energy is estimated as of maintenance energy.
FA:
FS:
SHP and GTS (IPCC 2006; 2019):
Pregnancy energy is calculated as a litter-size-dependent fraction of
maintenance energy ().
FA:
where is:
FS:
A single-birth coefficient is used () and scaled by the
proportion of reproductive individuals in the cohort:
PGS (NRC, 1998):
Pregnancy energy is expressed using a gestation coefficient
(MJ/piglet), with default .
FA:
FS:
This function is part of the run_metabolic_energy_req_module().
Numeric. Energy required for pregnancy for pregnant females (MJ/head/day). Expressed as net energy for CTL, BFL, SHP, GTS and as metabolizable energy for CML and PGS.
NRC (1998). Nutrient Requirements of Swine, 10th Revised Edition. National Academies Press, Washington, DC.
IPCC. (2019). 2019 Refinement to the 2006 IPCC Guidelines for National Greenhouse Gas Inventories. Chapter 10: Emissions from Livestock and Manure Management, Equation 10.13; Table 10.7.
IPCC. (2006). 2006 IPCC Guidelines for National Greenhouse Gas Inventories. Chapter 10: Emissions from Livestock and Manure Management, Equation 10.13; Table 10.7.
Wardeh, M. F. (2004). The nutrient requirements of the dromedary camel. Journal of Camel Science, 1(1):37-45. The Camel Applied Research and Development Network (CARDN), Arab Center for the Studies of Arid Zones and Dry Lands (ACSAD).
run_metabolic_energy_req_module,
calc_metabolic_energy_req_maintenance
Calculates the energy requirement for work (MJ/head/day), defined as the additional energy required to support draught power and work-related physical activity.
calc_metabolic_energy_req_work( species_short, cohort_short, metabolic_energy_req_maintenance = NA_real_, draught_work_hours_female = NA_real_, draught_work_hours_male = NA_real_, draught_fraction_female = NA_real_, draught_fraction_male = NA_real_ )calc_metabolic_energy_req_work( species_short, cohort_short, metabolic_energy_req_maintenance = NA_real_, draught_work_hours_female = NA_real_, draught_work_hours_male = NA_real_, draught_fraction_female = NA_real_, draught_fraction_male = NA_real_ )
species_short |
Character. Code identifying the livestock species. Supported values include:
|
cohort_short |
Character. Sex- and age-specific cohort code describing the production stage of the animals. Supported values include:
|
metabolic_energy_req_maintenance |
Numeric. Energy required for maintenance, defined as the amount of energy needed to keep the animal at equilibrium such that body energy is neither gained nor lost. Expressed as net energy for CTL, BFL, SHP, GTS and as metabolizable energy for CML and PGS (MJ/head/day). |
draught_work_hours_female |
Numeric. Average daily working time per adult female (hours/head/day). Required only for species = CML, CTL and BFL. |
draught_work_hours_male |
Numeric. Average daily working time per adult male (hours/head/day). Required only for species = CML, CTL and BFL. |
draught_fraction_female |
Numeric. Fraction of adult females involved in draught work (fraction). Required only for species = CML, CTL and BFL. |
draught_fraction_male |
Numeric. Fraction of adult males involved in draught work (fraction). Required only for species = CML, CTL and BFL. |
This approach follows the IPCC Tier 2 partitioning method and applies species-specific coefficients for draught work.
This energy component is calculated only for adult cohorts ( FA and MA) of draught-capable species
(CTL, BFL, and CML). It is scaled by
the fraction of adult animals involved in draught work
(draught_fraction_female, draught_fraction_male) and their average
daily working time (draught_work_hours_female, draught_work_hours_male).
Species-specific approach:
CTL and BFL - (Bamualim & Kartiarso, 1985; IPCC, 2006; IPCC 2019). Draught work energy is expressed as a proportion of net energy for maintenance:
where:
is net energy required for maintenance (MJ/head/day) and can be calculated using
calc_metabolic_energy_req_maintenance(),
represents a 10% increase in maintenance energy per hour of work,
is the mean number of hours worked per animal per day -
draught_work_hours_female (for FA) and draught_work_hours_male (for MA) and,
is the fraction of adult animals performing draught work -
draught_fraction_female (for FA) and draught_fraction_male (for MA)
CML - (Wilson, 1989) Draught work energy is calculated using a fixed metabolizable energy cost per hour of work:
where:
is the metabolizable energy requirement for draught work
(MJ/hour),
is the mean number of hours worked per animal per day -
draught_work_hours_female (for FA) and draught_work_hours_male (for MA) and,
is the fraction of adult animals performing draught work -
draught_fraction_female (for FA) and draught_fraction_male (for MA)
This function is part of the run_metabolic_energy_req_module().
Numeric. Energy required for work, used to estimate the energy required for draught power for CTL, BFL and CML (MJ/head/day). Assumed to be 0 for other species. Expressed as net energy for CTL, BFL, SHP, GTS and as metabolizable energy for CML and PGS.
Bamualim A., Kartiarso (1985). Nutrition of draught animals with special reference to Indonesia. In: Draught Animal Power for Production. Australian Centre for International agricultural Research (ACIAR), Proceedings Series No. 10, ed. JW Copland. Canberra, A.C.T., Australia: ACIAR.
IPCC. (2019). 2019 Refinement to the 2006 IPCC Guidelines for National Greenhouse Gas Inventories, Chapter 10: Emissions from Livestock and Manure Management, Equation 10.11.
IPCC. (2006). 2006 IPCC Guidelines for National Greenhouse Gas Inventories, Chapter 10: Emissions from Livestock and Manure Management, Equation 10.11.
Wilson (1989). The nutritional requirements of camel. In: Tisserand J.-L. (ed.). Séminaire sur la digestion, la nutrition et l'alimentation du dromadaire. Zaragoza : CIHEAM. (1989). p. 171-179 (Options Méditerranéennes : Série A. Séminaires Méditerranéens; n. 2)
run_metabolic_energy_req_module,
calc_metabolic_energy_req_maintenance
Calculates the energy required for milk production over the assessment period (MJ/cohort/assessment period), based on total fat- and protein-corrected milk (FPCM) produced by the cohort.
calc_milk_allocation_energy( milk_production_fpcm_cohort, milk_protein_fraction_standard, milk_fat_fraction_standard, milk_lactose_fraction_standard )calc_milk_allocation_energy( milk_production_fpcm_cohort, milk_protein_fraction_standard, milk_fat_fraction_standard, milk_lactose_fraction_standard )
milk_production_fpcm_cohort |
Numeric. Total fat-protein-corrected milk (FPCM) produced over the assessment period (kg/cohort/assessment period). Suggested standard fat, protein and lactose contents are 0.04, 0.033, and 0.048 respectively. |
milk_protein_fraction_standard |
Numeric. Standard protein content of milk, used to calculate Fat-protein-corrected milk (FPCM), (kg protein/kg milk). Suggested value = 0.033. |
milk_fat_fraction_standard |
Numeric. Standard fat content of milk, used to calculate Fat-protein-corrected milk (FPCM), (kg fat/kg milk). Suggested value = 0.04. |
milk_lactose_fraction_standard |
Numeric. Standard lactose content of milk, used to calculate Fat-protein-corrected milk (FPCM) , (kg lactose/kg milk). Suggested value = 0.048. |
This function provides the milk-related energy term used in a biophysical allocation framework to apportion emissions between milk and other co-products in multifunctional livestock production systems.
The approach implements the IDF (2022) standard, adapted from Thoma and Nemecek (2020), and is consistent with FAO LEAP livestock LCA guidelines (FAO, 2016a, 2016b, 2016c) and with ISO 14044:2006 (Section 4.3.4.2, Step 2).
In accordance with ISO 14044:2006, known biophysical relationships may be used to assign shared inputs and outputs of a production system to individual products or sub-units. In livestock systems, this includes apportioning shared feed and energy use according to physiological energy requirements such as lactation, growth, and maintenance. If the resulting process remains multifunctional, these energy terms may subsequently be used to derive allocation factors among co-products.
The milk_allocation_energy is calculated as follows:
where:
energy_standard is the energy content of standard milk,
calculated internally based on standard fat, protein, and lactose contents
following IDF (2022) (MJ/kg milk).
milk_production_fpcm_cohort is the total fat- and protein-corrected milk
(FPCM) produced over the assessment period (kg/assessment period). It can be computed using calc_milk_production
(see also run_production_module).
This function is part of the run_allocation_module().
Numeric. Energy required to produce total milk output by cohort (MJ/cohort/assessment period). Non-zero values are applicable only to milk-producing species and cohorts (species = CTL, BFL, CML, SHP, GTS; cohorts=FA). All other species–cohort combinations are assigned a value of 0.
ISO. (2006). Environmental management — Life cycle assessment — Requirements and guidelines (ISO 14044:2006). International Organization for Standardization, Geneva.
IDF. (2022). The IDF Global Carbon Footprint Standard for the Dairy Sector. Bulletin of the IDF No. 520/2022. International Dairy Federation, Brussels.
Thoma, G., and Nemecek, T. (2020). Allocation between milk and meat in dairy LCA: Critical discussion of the IDF’s standard methodology. In Proceedings of the 12th International Conference on Life Cycle Assessment of Food (LCAFood 2020) (pp. 83–89), 13–16 October, Berlin, Germany.
FAO. (2016a). Environmental performance of large ruminant supply chains: Guidelines for assessment. Livestock Environmental Assessment and Performance (LEAP) Partnership. FAO, Rome, Italy.
FAO. (2016b). Greenhouse gas emissions and fossil energy use from small ruminant supply chains: Guidelines for assessment. Livestock Environmental Assessment and Performance (LEAP) Partnership. FAO, Rome, Italy.
FAO. (2016c). Greenhouse gas emissions and fossil energy use from poultry supply chains: Guidelines for assessment. Livestock Environmental Assessment and Performance (LEAP) Partnership. FAO, Rome, Italy.
run_allocation_module,
calc_milk_production,
run_production_module
Calculates total milk production for the producing cohort (FA) of milk-producing species
(CML, CTL, BFL, SHP, GTS) over the assessment period and returns
multiple production metrics: total milk mass, milk protein, and fat-protein-corrected milk (FPCM)
(kg/cohort/assessment period).
calc_milk_production( species_short, cohort_short, milk_yield_day, simulation_duration, cohort_stock_size, lactating_females_fraction, milk_protein_fraction, milk_fat_fraction, milk_lactose_fraction, milk_protein_fraction_standard, milk_fat_fraction_standard, milk_lactose_fraction_standard )calc_milk_production( species_short, cohort_short, milk_yield_day, simulation_duration, cohort_stock_size, lactating_females_fraction, milk_protein_fraction, milk_fat_fraction, milk_lactose_fraction, milk_protein_fraction_standard, milk_fat_fraction_standard, milk_lactose_fraction_standard )
species_short |
Character. Code identifying the livestock species. Supported values include:
|
cohort_short |
Character. Sex- and age-specific cohort code describing the production stage of the animals. Supported values include:
|
milk_yield_day |
Numeric. Average milk yield per milk-producing animal during the assessment duration (kg/head/day). This value is calculated as the total quantity of milk produced for human consumption by milk-producing animals during the assessment period, divided by the number of milk-producing animals, and the length of the assessment period (days). Required only for species = CML, CTL, BFL, SHP, and GTS. |
simulation_duration |
Numeric. Length of the assessment period (days). |
cohort_stock_size |
Numeric. Average population size in each of the 6 sex–age cohorts (# heads). (cohorts=FJ, FS, FA, MJ, MS, MA). |
lactating_females_fraction |
Numeric. Proportion of adult females that are lactating during the assessment period (fraction). Required only for species: CML, CTL, BFL, SHP, and GTS. |
milk_protein_fraction |
Numeric. Milk protein fraction (kg protein/kg milk). Required only for species = CML, CTL, BFL, SHP, and GTS. |
milk_fat_fraction |
Numeric. Milk fat fraction (kg fat/kg milk). Required only for species = CML, CTL, BFL, SHP, and GTS. |
milk_lactose_fraction |
Numeric. Milk lactose fraction (kg lactose/kg milk). Required only for species = CML, CTL, BFL, SHP, and GTS. |
milk_protein_fraction_standard |
Numeric. Standard protein content of milk, used to calculate Fat-protein-corrected milk (FPCM), (kg protein/kg milk). Suggested value = 0.033. |
milk_fat_fraction_standard |
Numeric. Standard fat content of milk, used to calculate Fat-protein-corrected milk (FPCM), (kg fat/kg milk). Suggested value = 0.04. |
milk_lactose_fraction_standard |
Numeric. Standard lactose content of milk, used to calculate Fat-protein-corrected milk (FPCM), (kg lactose/kg milk). Suggested value = 0.048. |
Milk production outputs are computed as follows:
milk_production_mass_cohort is computed as:
milk_production_protein_cohort is computed as:
milk_production_fpcm_cohort is computed using the ratio of
energy content of actual versus standard milk:
where milk energy content (Mcal/kg) is computed as (IDF, 2022):
Non-zero milk outputs are only expected for adult female cohorts of milk-producing species.
This function is part of the run_production_module().
A named list with:
Numeric. Total milk production produced over the assessment period (kg/cohort/assessment period).
Numeric. Total milk protein production produced over the assessment period (kg protein/cohort/assessment period).
Numeric. Total fat-protein-corrected milk (FPCM) produced over the assessment period (kg/cohort/assessment period).
International Dairy Federation (IDF). 2022. The IDF Global Carbon Footprint Standard for the Dairy Sector. Bulletin of the IDF No. 520/2022. International Dairy Federation (ed.), Brussels, Belgium. Equation 10.
Calculates daily direct nitrous oxide (N2O) emissions from manure management using IPCC-based parameters and separates emissions from manure deposited on pasture, manure burned for fuel, and all other manure management systems.
calc_n2o_manure_direct(ratio_N2ON_to_N2O = 44/28, nitrogen_excretion, ...)calc_n2o_manure_direct(ratio_N2ON_to_N2O = 44/28, nitrogen_excretion, ...)
ratio_N2ON_to_N2O |
Numeric. Conversion factor from kg N2O–N to kg N2O, based on molecular weights. Defaults to 44/28. |
nitrogen_excretion |
Numeric. Daily nitrogen excretion (kg N/head/day). |
... |
A variable number of manure management system (MMS) arguments. Each MMS must be provided as a named numeric vector with exactly the following fields:
Two MMS names are treated explicitly when present:
All remaining MMS arguments are grouped and treated as other manure management systems. |
This calculation follows the Tier 2 methodology for direct nitrous oxide (N2O) emissions from manure management as defined in the IPCC Guidelines (Equation 10.25).
In the IPCC formulation, annual direct emissions are:
where:
Direct N2O emissions from Manure Management.
Conversion factor from N2O–N to N2O.
Nitrogen excreted (kg N).
Fraction of excreted nitrogen managed in manure
management system .
Direct emission factor for system
(kg N2O–N per kg N managed).
In this implementation, calculations are performed at daily,
per-head resolution using nitrogen_excretion
(kg N/head/day) - see also calc_nitrogen_excretion.
Daily emissions are computed as:
This function is part of the run_emissions_manure_module().
A named list with the following elements:
Numeric. Direct nitrous oxide (N2O) emissions from manure deposited on pasture (kg N2O/head/day).
Numeric. Direct nitrous oxide (N2O) emissions from manure burned for fuel (kg N2O/head/day).
Numeric. Direct nitrous oxide (N2O) emissions from manure management systems, excluding emissions from manure deposited on pasture and burned for fuel (kg N2O/head/day).
Numeric. Direct nitrous oxide (N2O) emissions from manure management systems, excluding manure burned for fuel (kg N2O/head/day).
IPCC. (2019). 2019 Refinement to the 2006 IPCC Guidelines for National Greenhouse Gas Inventories, Chapter 10: Emissions from Livestock and Manure Management. Equation 10.25.
IPCC. (2006). 2006 IPCC Guidelines for National Greenhouse Gas Inventories, Chapter 10: Emissions from Livestock and Manure Management. Equation 10.25.
calc_n2o_manure_direct( ratio_N2ON_to_N2O = 44 / 28, nitrogen_excretion = 0.9, mms_burned = c( manure_management_system_fraction = 0.020, n2o_ef3 = 0 ), mms_drylot = c( manure_management_system_fraction = 0.264, n2o_ef3 = 0.02 ), mms_pasture = c( manure_management_system_fraction = 0.310, n2o_ef3 = 0.02 ), mms_solid = c( manure_management_system_fraction = 0.406, n2o_ef3 = 0.005 ) )calc_n2o_manure_direct( ratio_N2ON_to_N2O = 44 / 28, nitrogen_excretion = 0.9, mms_burned = c( manure_management_system_fraction = 0.020, n2o_ef3 = 0 ), mms_drylot = c( manure_management_system_fraction = 0.264, n2o_ef3 = 0.02 ), mms_pasture = c( manure_management_system_fraction = 0.310, n2o_ef3 = 0.02 ), mms_solid = c( manure_management_system_fraction = 0.406, n2o_ef3 = 0.005 ) )
Calculates daily indirect nitrous oxide (N2O) emissions resulting from nitrogen leaching and runoff from manure management systems and separates emissions from manure deposited on pasture, manure burned for fuel, and all other manure management systems.
calc_n2o_manure_leaching(ratio_N2ON_to_N2O = 44/28, nitrogen_excretion, ...)calc_n2o_manure_leaching(ratio_N2ON_to_N2O = 44/28, nitrogen_excretion, ...)
ratio_N2ON_to_N2O |
Numeric. Conversion factor from kg N2O–N to kg N2O, based on molecular weights. Defaults to 44/28. |
nitrogen_excretion |
Numeric. Daily nitrogen excretion (kg N/head/day). |
... |
A variable number of manure management system (MMS) arguments. Each MMS must be provided as a named numeric vector with exactly the following fields:
Two MMS names are treated explicitly when present:
All remaining MMS arguments are grouped and treated as other manure management systems. |
This calculation follows the Tier 2 methodology for indirect N2O emissions from manure management as defined in Equations 10.28 (IPCC, 2006), 10.27 (IPCC, 2019), and 10.29 (IPCC, 2006, 2019).
In the IPCC formulation, indirect emissions associated with nitrogen leaching and runoff are calculated as:
where:
Indirect N2O emissions due to leaching and runoff from Manure Management.
Conversion factor from N2O–N to N2O.
Nitrogen excreted (kg N).
Fraction of excreted nitrogen managed in manure
management system .
Fraction of nitrogen lost through leaching and runoff in manure management system .
Emission factor for indirect N2O emissions from leaching and runoff (kg N2O–N per kg N leached or lost through runoff).
In this implementation, calculations are performed at daily, per-head
resolution using nitrogen_excretion (kg N/head/day):
This function is part of the run_emissions_manure_module().
A named list with the following elements
Numeric. Indirect nitrous oxide (N2O) emissions resulting from leaching and runoff of manure nitrogen from manure deposited on pasture (kg N2O/head/day).
Numeric. Indirect nitrous oxide (N2O) emissions resulting from leaching and runoff of manure nitrogen from manure burned for fuel (kg N2O/head/day).
Numeric. Indirect nitrous oxide (N2O) emissions resulting from leaching and runoff of manure nitrogen from manure management systems, excluding losses from manure deposited on pasture and manure burned for fuel (kg N2O/head/day).
Numeric. Indirect nitrous oxide (N2O) emissions resulting from leaching and runoff of manure nitrogen from manure management systems, excluding losses from manure burned for fuel (kg N2O/head/day).
IPCC. (2019). 2019 Refinement to the 2006 IPCC Guidelines for National Greenhouse Gas Inventories, Chapter 10: Emissions from Livestock and Manure Management. Equations 10.27; 10.29.
IPCC. (2006). 2006 IPCC Guidelines for National Greenhouse Gas Inventories, Volume 4, Chapter 10: Emissions from Livestock and Manure Management. Equations 10.28; 10.29.
calc_n2o_manure_leaching( ratio_N2ON_to_N2O = 44 / 28, nitrogen_excretion = 0.9, mms_burned = c( manure_management_system_fraction = 0.020, n2o_ef5 = 0.011, nitrogen_fracleach = 0 ), mms_drylot = c( manure_management_system_fraction = 0.264, n2o_ef5 = 0.011, nitrogen_fracleach = 0.035 ), mms_pasture = c( manure_management_system_fraction = 0.310, n2o_ef5 = 0.011, nitrogen_fracleach = 0.24 ), mms_solid = c( manure_management_system_fraction = 0.406, n2o_ef5 = 0.011, nitrogen_fracleach = 0.02 ) )calc_n2o_manure_leaching( ratio_N2ON_to_N2O = 44 / 28, nitrogen_excretion = 0.9, mms_burned = c( manure_management_system_fraction = 0.020, n2o_ef5 = 0.011, nitrogen_fracleach = 0 ), mms_drylot = c( manure_management_system_fraction = 0.264, n2o_ef5 = 0.011, nitrogen_fracleach = 0.035 ), mms_pasture = c( manure_management_system_fraction = 0.310, n2o_ef5 = 0.011, nitrogen_fracleach = 0.24 ), mms_solid = c( manure_management_system_fraction = 0.406, n2o_ef5 = 0.011, nitrogen_fracleach = 0.02 ) )
Aggregates direct and indirect nitrous oxide (N2O) emissions from manure, by manure management system group (deposited on pasture, burned for fuel, and all other systems). Indirect emissions include contributions from volatilization and from leaching and runoff.
calc_n2o_manure_total( n2o_manure_pasture_vol, n2o_manure_pasture_leach, n2o_manure_burned_vol, n2o_manure_burned_leach, n2o_manure_other_vol, n2o_manure_other_leach, n2o_manure_pasture_direct, n2o_manure_burned_direct, n2o_manure_other_direct )calc_n2o_manure_total( n2o_manure_pasture_vol, n2o_manure_pasture_leach, n2o_manure_burned_vol, n2o_manure_burned_leach, n2o_manure_other_vol, n2o_manure_other_leach, n2o_manure_pasture_direct, n2o_manure_burned_direct, n2o_manure_other_direct )
n2o_manure_pasture_vol |
Numeric. Indirect nitrous oxide (N2O) emissions resulting from atmospheric deposition of volatilised nitrogen (NH3 and NOx) from manure deposited on pasture (kg N2O/head/day). |
n2o_manure_pasture_leach |
Numeric. Indirect nitrous oxide (N2O) emissions resulting from leaching and runoff of manure nitrogen from manure deposited on pasture (kg N2O/head/day). |
n2o_manure_burned_vol |
Numeric. Indirect nitrous oxide (N2O) emissions resulting from atmospheric deposition of volatilised nitrogen (NH3 and NOx) from manure burned for fuel (kg N2O/head/day). |
n2o_manure_burned_leach |
Numeric. Indirect nitrous oxide (N2O) emissions resulting from leaching and runoff of manure nitrogen from manure burned for fuel (kg N2O/head/day). |
n2o_manure_other_vol |
Numeric. Indirect nitrous oxide (N2O) emissions resulting from atmospheric deposition of volatilised nitrogen (NH3 and NOx) from manure management systems, excluding manure deposited on pasture and manure burned for fuel (kg N2O/head/day). |
n2o_manure_other_leach |
Numeric. Indirect nitrous oxide (N2O) emissions resulting from leaching and runoff of manure nitrogen from manure management systems, excluding losses from manure deposited on pasture and manure burned for fuel (kg N2O/head/day). |
n2o_manure_pasture_direct |
Numeric. Direct nitrous oxide (N2O) emissions from manure deposited on pasture (kg N2O/head/day). |
n2o_manure_burned_direct |
Numeric. Direct nitrous oxide (N2O) emissions from manure burned for fuel (kg N2O/head/day). |
n2o_manure_other_direct |
Numeric. Direct nitrous oxide (N2O) emissions from manure management systems, excluding emissions from manure deposited on pasture and burned for fuel (kg N2O/head/day). |
The following aggregations are applied:
A named list with:
Numeric. Total indirect nitrous oxide (N2O) emissions from manure deposited on pasture. Includes emissions from atmospheric deposition of volatilised nitrogen (NH3 and NOx) and from leaching and runoff of manure nitrogen (kg N2O/head/day).
Numeric. Total indirect nitrous oxide (N2O) emissions originating from manure burned for fuel. Includes emissions from atmospheric deposition of volatilised nitrogen (NH3 and NOx) and from leaching and runoff of manure nitrogen (kg N2O/head/day).
Numeric. Total indirect nitrous oxide (N2O) emissions originating from manure management systems, excluding manure deposited on pasture and manure burned for fuel. Includes emissions from atmospheric deposition of volatilised nitrogen (NH3 and NOx) and from leaching and runoff of manure nitrogen (kg N2O/head/day).
Numeric. Total nitrous oxide (N2O) emissions from manure deposited on pasture. Includes direct emissions and indirect emissions from volatilisation, leaching, and runoff (kg N2O/head/day).
Numeric. Total nitrous oxide (N2O) emissions from manure burned for fuel. Includes direct emissions and indirect emissions from volatilisation, leaching, and runoff (kg N2O/head/day).
Numeric. Total nitrous oxide (N2O) emissions from manure management systems, excluding manure deposited on pasture and manure burned for fuel. Includes direct emissions and indirect emissions from volatilisation, leaching, and runoff (kg N2O/head/day).
This function is part of the run_emissions_manure_module().
calc_n2o_manure_total( n2o_manure_pasture_vol = 0.0129, n2o_manure_pasture_leach = 0.0012, n2o_manure_burned_vol = 0, n2o_manure_burned_leach = 0, n2o_manure_other_vol = 0.052, n2o_manure_other_leach = 0.00027, n2o_manure_pasture_direct = 0.009, n2o_manure_burned_direct = 0, n2o_manure_other_direct = 0.01033 )calc_n2o_manure_total( n2o_manure_pasture_vol = 0.0129, n2o_manure_pasture_leach = 0.0012, n2o_manure_burned_vol = 0, n2o_manure_burned_leach = 0, n2o_manure_other_vol = 0.052, n2o_manure_other_leach = 0.00027, n2o_manure_pasture_direct = 0.009, n2o_manure_burned_direct = 0, n2o_manure_other_direct = 0.01033 )
Calculates daily indirect nitrous oxide (N2O) emissions resulting from atmospheric deposition of volatilised nitrogen (NH3–N and NOx–N) from manure management systems and separates emissions from manure deposited on pasture, manure burned for fuel, and all other manure management systems.
calc_n2o_manure_volatilization( ratio_N2ON_to_N2O = 44/28, nitrogen_excretion, ... )calc_n2o_manure_volatilization( ratio_N2ON_to_N2O = 44/28, nitrogen_excretion, ... )
ratio_N2ON_to_N2O |
Numeric. Conversion factor from kg N2O–N to kg N2O, based on molecular weights. Defaults to 44/28. |
nitrogen_excretion |
Numeric. Daily nitrogen excretion (kg N/head/day). |
... |
A variable number of manure management system (MMS) arguments. Each MMS must be provided as a named numeric vector with exactly the following fields:
Two MMS names are treated explicitly when present:
All remaining MMS arguments are grouped and treated as other manure management systems. |
This calculation follows the Tier 2 methodology for indirect N2O emissions from manure management as defined in the IPCC Guidelines in Equations 10.26 (IPCC, 2006, 2019), 10.27 (IPCC, 2006) and 10.28 (IPCC, 2019).
In the IPCC formulation, indirect emissions from atmospheric deposition of volatilised nitrogen are calculated as:
where:
Indirect N2O emissions due to volatilization of N from Manure Management.
Conversion factor from N2O-N to N2O.
Nitrogen excreted (kg N).
Fraction of excreted nitrogen managed in manure
management system .
Fraction of nitrogen volatilised as NH3–N and NOx–N in manure management system .
Emission factor for indirect N2O emissions from atmospheric deposition (kg N2O-N per kg NH3–N + NOx–N).
In this implementation, calculations are performed at daily,
per-head resolution using nitrogen_excretion
(kg N/head/day):
This function is part of the run_emissions_manure_module().
A named list with the following elements:
Numeric. Indirect nitrous oxide (N2O) emissions resulting from atmospheric deposition of volatilised nitrogen (NH3 and NOx) from manure deposited on pasture (kg N2O/head/day).
Numeric. Indirect nitrous oxide (N2O) emissions resulting from atmospheric deposition of volatilised nitrogen (NH3 and NOx) from manure burned for fuel (kg N2O/head/day).
Numeric. Indirect nitrous oxide (N2O) emissions resulting from atmospheric deposition of volatilised nitrogen (NH3 and NOx) from manure management systems, excluding manure deposited on pasture and manure burned for fuel (kg N2O/head/day).
Numeric. Indirect nitrous oxide (N2O) emissions resulting from atmospheric deposition of volatilised nitrogen (NH3 and NOx) from manure management systems, excluding losses from manure burned for fuel (kg N2O/head/day).
IPCC. (2019). 2019 Refinement to the 2006 IPCC Guidelines for National Greenhouse Gas Inventories, Chapter 10: Emissions from Livestock and Manure Management. Equation 10.26; 10.28.
IPCC. (2006). 2006 IPCC Guidelines for National Greenhouse Gas Inventories, Chapter 10: Emissions from Livestock and Manure Management. Equation 10.26; 10.27.
calc_n2o_manure_volatilization( ratio_N2ON_to_N2O = 44 / 28, nitrogen_excretion = 0.9, mms_burned = c( manure_management_system_fraction = 0.020, n2o_ef4 = 0.14, nitrogen_fracgas = 0 ), mms_drylot = c( manure_management_system_fraction = 0.264, n2o_ef4 = 0.14, nitrogen_fracgas = 0.3 ), mms_pasture = c( manure_management_system_fraction = 0.310, n2o_ef4 = 0.14, nitrogen_fracgas = 0.21 ), mms_solid = c( manure_management_system_fraction = 0.406, n2o_ef4 = 0.14, nitrogen_fracgas = 0.45 ) )calc_n2o_manure_volatilization( ratio_N2ON_to_N2O = 44 / 28, nitrogen_excretion = 0.9, mms_burned = c( manure_management_system_fraction = 0.020, n2o_ef4 = 0.14, nitrogen_fracgas = 0 ), mms_drylot = c( manure_management_system_fraction = 0.264, n2o_ef4 = 0.14, nitrogen_fracgas = 0.3 ), mms_pasture = c( manure_management_system_fraction = 0.310, n2o_ef4 = 0.14, nitrogen_fracgas = 0.21 ), mms_solid = c( manure_management_system_fraction = 0.406, n2o_ef4 = 0.14, nitrogen_fracgas = 0.45 ) )
Calculates the contribution of an individual feed component to nitrous oxide (N2O) emissions from crop residues decomposition in feed production, using feed-specific emission factors weighted by the component's share in the ration.
calc_n2o_ration_crop_residues(feed_ration_fraction, n2o_feed_crop_residues)calc_n2o_ration_crop_residues(feed_ration_fraction, n2o_feed_crop_residues)
feed_ration_fraction |
Numeric. Proportion of a specific feed component in the total ration, expressed as its fraction of diet dry matter intake (fraction). Within each herd_id and cohort, proportions should sum to 1. |
n2o_feed_crop_residues |
Numeric. Nitrous oxide (N2O) emission factor of a feed component, representing N2O emissions from crop residues decomposition in feed production, expressed per kg of dry matter intake (g N2O/kg DM). |
The contribution is computed as:
This function is part of the run_emissions_ration_module().
Numeric. Contribution of an individual feed component to the diet-level average nitrous oxide (N2O) emission factor from crop residues decomposition in feed production (g N2O/kg DM).
Calculates the contribution of an individual feed component to nitrous oxide (N2O) emissions from synthetic fertilizer in feed production, using feed-specific emission factors weighted by the component's share in the ration.
calc_n2o_ration_fertilizer(feed_ration_fraction, n2o_feed_fertilizer)calc_n2o_ration_fertilizer(feed_ration_fraction, n2o_feed_fertilizer)
feed_ration_fraction |
Numeric. Proportion of a specific feed component in the total ration, expressed as its fraction of diet dry matter intake (fraction). Within each herd_id and cohort, proportions should sum to 1. |
n2o_feed_fertilizer |
Numeric. Nitrous oxide (N2O) emission factor of a feed component, representing N2O emissions from fertilizer use in feed production, expressed per kg of dry matter intake (g N2O/kg DM). |
The contribution is computed as:
This function is part of the run_emissions_ration_module().
Numeric. Contribution of an individual feed component to the diet-level average nitrous oxide (N2O) emission factor from fertilizer use in feed production (g N2O/kg DM).
Calculates the contribution of an individual feed component to nitrous oxide (N2O) emissions from manure application to or deposition on soil in feed production, using feed-specific emission factors weighted by the component's share in the ration.
calc_n2o_ration_manure(feed_ration_fraction, n2o_feed_manure_applied)calc_n2o_ration_manure(feed_ration_fraction, n2o_feed_manure_applied)
feed_ration_fraction |
Numeric. Proportion of a specific feed component in the total ration, expressed as its fraction of diet dry matter intake (fraction). Within each herd_id and cohort, proportions should sum to 1. |
n2o_feed_manure_applied |
Numeric. Nitrous oxide (N2O) emission factor of a feed component, representing N2O emissions from manure applied to or deposited on soil in feed production, expressed per kg of dry matter intake (g N2O/kg DM). |
The contribution is computed as:
This function is part of the run_emissions_ration_module().
Numeric. Contribution of an individual feed component to the diet-level average nitrous oxide (N2O) emission factor from manure applied to or deposited on soil in feed production (g N2O/kg DM).
Calculates daily nitrogen excretion per animal (kg N/head/day) as the difference between nitrogen intake and nitrogen retention.
calc_nitrogen_excretion(species_short, nitrogen_intake, nitrogen_retention)calc_nitrogen_excretion(species_short, nitrogen_intake, nitrogen_retention)
species_short |
Character. Code identifying the livestock species. Supported values include:
|
nitrogen_intake |
Numeric. Daily nitrogen intake (kg N/head/day). |
nitrogen_retention |
Numeric. Daily nitrogen retention in animal body tissues and products (e.g., growth, pregnancy, milk...) (kg N/head/day). |
Nitrogen excretion represents the fraction of consumed nitrogen that is not retained in animal tissues or products and is therefore excreted in urine and dung.
Nitrogen excretion is calculated as:
where all quantities are expressed in kg N/head/day.
This quantity forms the basis for subsequent calculations of nitrous oxide (N2O) emissions from manure management under the IPCC Tier 2 methodology.
Numeric. Daily nitrogen excretion (kg N/head/day).
IPCC. (2019). 2019 Refinement to the 2006 IPCC Guidelines for National Greenhouse Gas Inventories, Chapter 10: Emissions from Livestock and Manure Management. Equation 10.31A.
This function is part of the run_nitrogen_balance_module().
run_nitrogen_balance_module,
calc_nitrogen_retention
Calculates the daily nitrogen intake per head (kg N/head/day) as the product of feed dry matter intake (DMI) and diet nitrogen content.
calc_nitrogen_intake(ration_intake, ration_nitrogen)calc_nitrogen_intake(ration_intake, ration_nitrogen)
ration_intake |
Numeric. Average daily dry matter intake of feed (kg DM/head/day). |
ration_nitrogen |
Numeric. Average nitrogen content of diet (kg N/kg DM). |
This approach follows the IPCC Tier 2 approach and estimates ration_intake as follows:
This function is part of the run_nitrogen_balance_module().
Numeric. Daily nitrogen intake (kg N/head/day).
IPCC. (2019). 2019 Refinement to the 2006 IPCC Guidelines for National Greenhouse Gas Inventories, Chapter 10: Emissions from Livestock and Manure Management. Equation 10.32.
IPCC. (2006). 2006 IPCC Guidelines for National Greenhouse Gas Inventories, Chapter 10: Emissions from Livestock and Manure Management. Equation 10.32.
run_nitrogen_balance_module,
calc_ration_intake,
run_metabolic_energy_req_module,
calc_ration_nitrogen_content,
run_ration_quality_module
Calculates daily nitrogen retention per animal by species and cohort (kg N/head/day). Nitrogen retention represents the portion of consumed nitrogen that is incorporated into animal products or body tissues.
calc_nitrogen_retention( species_short, cohort_short, milk_protein_fraction = NA_real_, milk_yield_day = NA_real_, daily_weight_gain = NA_real_, fibre_yield_year = NA_real_, litter_size = NA_real_, parturition_rate = NA_real_, live_weight_at_weaning = NA_real_, live_weight_at_birth = NA_real_, pregnancy_duration = NA_real_, cohort_duration_days = NA_real_ )calc_nitrogen_retention( species_short, cohort_short, milk_protein_fraction = NA_real_, milk_yield_day = NA_real_, daily_weight_gain = NA_real_, fibre_yield_year = NA_real_, litter_size = NA_real_, parturition_rate = NA_real_, live_weight_at_weaning = NA_real_, live_weight_at_birth = NA_real_, pregnancy_duration = NA_real_, cohort_duration_days = NA_real_ )
species_short |
Character. Code identifying the livestock species. Supported values include:
|
cohort_short |
Character. Sex- and age-specific cohort code describing the production stage of the animals. Supported values include:
|
milk_protein_fraction |
Numeric. Milk protein fraction (kg protein / kg milk). Required only for species = CML, CTL, BFL, SHP, and GTS. |
milk_yield_day |
Numeric. Average milk yield per milk-producing animal during the assessment duration (kg/head/day). This value is calculated as the total quantity of milk produced for human consumption by milk-producing animals during the assessment period, divided by the number of milk-producing animals, and the length of the assessment period (days). Required only for species = CML, CTL, BFL, SHP, and GTS. |
daily_weight_gain |
Numeric. Average live weight gain of the cohort over the cohort stage (kg/head/day). |
fibre_yield_year |
Numeric. Annual production yield of fibre, such as wool, cashmere, mohair (kg/head/year). Required only for species = CML, SHP, and GTS. |
litter_size |
Numeric. Average number of offspring born per parturition (# offsprings/parturition). This value can be calculated as the total number of offspring born divided by the total number of parturitions during the year. |
parturition_rate |
Numeric. Average annual number of parturitions per female animal (# parturitions/adult female/year). A herd-level reproductive performance indicator calculated as the total number of parturitions (deliveries) occurring during a year divided by the number of adult females potentially able to give birth during that year. |
live_weight_at_weaning |
Numeric. Live weight of the animal at weaning (kg). |
live_weight_at_birth |
Numeric. Live weight of the animal at birth (kg). |
pregnancy_duration |
Numeric. Duration of pregnancy period (days). |
cohort_duration_days |
Numeric. Amount of time that each animal spends in a specific cohort (days). |
Species-specific nitrogen retention calculations are applied.
For CTL, BFL, SHP, GTS, and CML:
Nitrogen retained in products and tissues is computed consistent with the process described in the Technical paper from MPI (Ministry for Primary Industries (MPI), 2025), where nitrogen retention is calculated as the sum of:
nitrogen secreted in milk,
nitrogen retained in live weight gain (tissue),
nitrogen retained in fibre (for fibre-producing species).
Coefficients for nitrogen content of deposited tissue, fibre, and milk are derived from Chapter 5 (Nitrogen Excretion) of the MPI Technical paper.
The following constants are used:
Tissue nitrogen content (tissue_n)
CTL and BFL: 0.0326 kg N/kg live weight
SHP, GTS and CML:
0.026 kg N/kg live weight
Fibre nitrogen content (fibre_n)
SHP, GTS and CML:
0.134 kg N/kg fibre
Milk nitrogen content (milk_n):
CTL, BFL, SHP, GTS and CML:
derived from milk_protein_fraction using a protein-to-nitrogen conversion factor
of 6.25 kg protein/kg nitrogen
For PGS
Nitrogen retention is calculated following the IPCC (2019) Tier 2 equations for swine (Equations 10.33A and 10.33B).
Nitrogen retention includes nitrogen retained in:
live weight gain (tissue),
reproductive outputs (conceptus and weaned offspring).
In this implementation:
Nitrogen content of live weight gain is assumed to be
0.025 kg N/kg live weight.
Protein digestibility fraction is assumed to be
0.98 (dimensionless).
For breeding cohorts, the reproductive component is represented by annual nitrogen retention in conceptus and weaned offspring, expressed as a daily average by distributing the annual value uniformly over the year (365 days).
A constant factor of 0.806 (dimensionless)
is applied to piglets' live weight gain to correct for their higher nitrogen
content per unit of live weight gain, following IPCC (2019).
This function is part of the run_nitrogen_balance_module().
Numeric. Daily nitrogen retention in animal body tissues and products (e.g., growth, pregnancy, milk...) (kg N/head/day)
Ministry for Primary Industries (MPI). (2025). Detailed methodologies for agricultural greenhouse gas emission calculation: Methodology for calculation of New Zealand’s agricultural greenhouse gas emissions (Version 11). MPI Technical Paper, Wellington, New Zealand. Chapter 5.
IPCC. (2019). 2019 Refinement to the 2006 IPCC Guidelines for National Greenhouse Gas Inventories, Chapter 10: Emissions from Livestock and Manure Management. Equation 10.33A, 10.33B.
IPCC. (2006). 2006 IPCC Guidelines for National Greenhouse Gas Inventories, Chapter 10: Emissions from Livestock and Manure Management. Equation 10.33.
Calculates one year of population dynamics under steady-state assumptions using demographic parameters and returns population size statistics and offtake results. The steady state is defined as a constant sex–age cohort structure over time, with population size potentially growing or declining at a constant rate.
calc_projected_population_size( herd_size_total, fecundity_female, fecundity_male, probability_death, probability_offtake, probability_growth, growth_rate_herd, herd_structure, cohort_share )calc_projected_population_size( herd_size_total, fecundity_female, fecundity_male, probability_death, probability_offtake, probability_growth, growth_rate_herd, herd_structure, cohort_share )
herd_size_total |
Numeric. Total population size at the start of the year, including all cohorts (# heads) |
fecundity_female |
Numeric. Daily number of female offspring per adult female (# offspring/day) |
fecundity_male |
Numeric. Daily number of male offspring per adult female (# offspring/day) |
probability_death |
Named numeric vector of length 10. Probability of animal dying within the model time interval for 10 cohorts (fraction)
(cohorts= |
probability_offtake |
Named numeric vector of length 10. Probability that an animal will be removed from the herd within the model time interval for 10 cohorts (fraction).
(cohorts= |
probability_growth |
Named numeric vector of length 10. Probability of growing into the next age class for 10 cohorts (fraction)
(cohorts= |
growth_rate_herd |
Numeric. Annualized growth rate at which the herd reaches steady state (fraction) |
herd_structure |
Named numeric vector of length 8. Final steady-state share of each of 8 sex-age cohorts ( |
cohort_share |
Named numeric vector of length 6. Final steady-state share of 6 grouped sex-age cohorts ( |
A named list with:
Numeric vector of length 6. Population size in each of the 6 sex–age cohorts at the start of the year (# heads). (cohorts= FJ, FS, FA, MJ, MS, MA)
Numeric vector of length 6. Population size in each of the 6 sex–age cohorts at the end of the year, projected using the steady-state growth rate (# heads). (cohorts= FJ, FS, FA, MJ, MS, MA)
Numeric vector of length 10. Population size in each of 10 sex–age cohort at the end of the year, based on a demographic daily simulation over 365 days (# heads)
(cohorts= FB: Female Birth, FJ: Female Juvenile, FS: Female Sub-adult, FA: Female Adult, FC: Female Culling, MB: Male Birth, MJ: Male Juvenile, MS: Male Sub-adult, MA: Male Adult, MC: Male Culling)
Numeric vector of length 6. Average population size in each of the 6 sex–age cohorts over the year (# heads). Estimated from cohort_stock_start and cohort_stock_end_projected (cohorts= FJ, FS, FA, MJ, MS, MA)
Numeric vector of length 10. Total number of animals removed from the herd over the year, by 10 sex–age cohorts (heads/year)
(cohorts= FB: Female Birth, FJ: Female Juvenile, FS: Female Sub-adult, FA: Female Adult, FC: Female Culling, MB: Male Birth, MJ: Male Juvenile, MS: Male Sub-adult, MA: Male Adult, MC: Male Culling)
This function is part of the run_demographic_herd_module().
Calculates the contribution of a single feed component to diet ash content by weighting feed ash content by its ration composition share.
calc_ration_ash(feed_ration_fraction, feed_ash)calc_ration_ash(feed_ration_fraction, feed_ash)
feed_ration_fraction |
Numeric. Proportion of a specific feed component in the total ration, expressed as its fraction of diet dry matter intake (fraction). Within each herd_id and cohort, proportions should sum to 1. |
feed_ash |
Numeric. Average ash content by feed component, expressed as a fraction of the dry matter intake (g ash/100g DM). |
The ash contribution is defined as:
Ash content is expressed as a percentage (g/100g DM); the result is a fraction.
This function is part of the run_ration_quality_module().
Numeric. Contribution of the feed component to total diet ash content (kg ash/kg DM).
Applies species-specific digestibility parameters to a ration composition share to compute the contribution of a single feed component to total diet digestibility.
calc_ration_digestibility( species_short, feed_ration_fraction, feed_digestibility_fraction_ruminant = NA_real_, feed_digestibility_fraction_pigs = NA_real_ )calc_ration_digestibility( species_short, feed_ration_fraction, feed_digestibility_fraction_ruminant = NA_real_, feed_digestibility_fraction_pigs = NA_real_ )
species_short |
Character. Code identifying the livestock species. Supported values include:
|
feed_ration_fraction |
Numeric. Proportion of a specific feed component in the total ration, expressed as its fraction of diet dry matter intake (fraction). Within each herd_id and cohort, proportions should sum to 1. |
feed_digestibility_fraction_ruminant |
Numeric. Digestibility of a feed component for ruminants, expressed as the ratio of digestible energy to gross energy content (fraction). |
feed_digestibility_fraction_pigs |
Numeric. Digestibility of a feed component for pigs, expressed as the ratio of digestible energy to gross energy content (fraction). |
The digestibility contribution uses the animal-specific digestibility ratio:
Ruminants (CTL, BFL, CML, SHP, GTS):
feed_ration_fraction * feed_digestibility_fraction_ruminant
Pigs (PGS):
feed_ration_fraction * feed_digestibility_fraction_pigs
This function is part of the run_ration_quality_module().
Numeric. Contribution of the feed component to total diet digestibility (fraction).
Computes the contribution of a single feed component to diet gross energy content by weighting feed gross energy by its ration composition share.
calc_ration_gross_energy(feed_ration_fraction, feed_gross_energy)calc_ration_gross_energy(feed_ration_fraction, feed_gross_energy)
feed_ration_fraction |
Numeric. Proportion of a specific feed component in the total ration, expressed as its fraction of diet dry matter intake (fraction). Within each herd_id and cohort, proportions should sum to 1. |
feed_gross_energy |
Numeric. Gross energy content of a feed component, representing the total chemical energy released upon complete combustion of the feed (MJ/kg DM). |
The gross energy contribution is defined as:
This function is part of the run_ration_quality_module().
Numeric. Contribution of the feed component to total diet gross energy content (MJ/kg DM).
Calculates daily feed intake as dry matter intake (DMI) per animal (kg DM/head/day) from the animal's daily energy requirement and the diet energy density.
calc_ration_intake( species_short, metabolic_energy_req_total, ration_gross_energy, ration_metabolizable_energy )calc_ration_intake( species_short, metabolic_energy_req_total, ration_gross_energy, ration_metabolizable_energy )
species_short |
Character. Code identifying the livestock species. Supported values include:
|
metabolic_energy_req_total |
Numeric. Total daily energy requirement (MJ/head/day). For CTL, BFL, SHP and GTS this is expressed as gross energy intake requirement (GE). For CML and PGS the function returns the summed daily metabolizable energy requirement. |
ration_gross_energy |
Numeric. Average gross energy content of the diet (MJ/kg DM). |
ration_metabolizable_energy |
Numeric. Average metabolizable energy content of the diet (MJ/kg DM). |
This function follows the IPCC Tier 2 framework. DMI is computed by dividing the appropriate daily energy requirement by the corresponding diet energy content (MJ/kg DM).
Energy expressed as gross energy intake requirement -
CTL, BFL, SHP, GTS:
Energy expressed as metabolizable energy requirement -
CML, PGS:
This function is part of the run_metabolic_energy_req_module().
Numeric. Average daily dry matter intake of feed (kg DM/head/day).
IPCC. (2006). 2006 IPCC Guidelines for National Greenhouse Gas Inventories, Volume 4 (AFOLU), Chapter 10: Emissions from Livestock and Manure Management.
IPCC. (2019). 2019 Refinement to the 2006 IPCC Guidelines for National Greenhouse Gas Inventories, Volume 4 (AFOLU), Chapter 10: Emissions from Livestock and Manure Management.
run_metabolic_energy_req_module,
calc_total_metabolic_energy_req
calc_ration_gross_energy
calc_ration_metabolizable_energy
Applies species-specific metabolizable energy parameters to a ration composition share to compute the contribution of a single feed component to total diet metabolizable energy content.
calc_ration_metabolizable_energy( species_short, feed_ration_fraction, feed_metabolizable_energy_ruminant = NA_real_, feed_metabolizable_energy_pigs = NA_real_ )calc_ration_metabolizable_energy( species_short, feed_ration_fraction, feed_metabolizable_energy_ruminant = NA_real_, feed_metabolizable_energy_pigs = NA_real_ )
species_short |
Character. Code identifying the livestock species. Supported values include:
|
feed_ration_fraction |
Numeric. Proportion of a specific feed component in the total ration, expressed as its fraction of diet dry matter intake (fraction). Within each herd_id and cohort, proportions should sum to 1. |
feed_metabolizable_energy_ruminant |
Numeric. Metabolizable energy content of a feed component for ruminants, representing digestible energy minus energy losses in urine and gaseous products of digestion (MJ/kg DM). |
feed_metabolizable_energy_pigs |
Numeric. Metabolizable energy content of a feed component for pigs, representing digestible energy minus energy losses in urine and gaseous products of digestion (MJ/kg DM). |
The metabolizable energy contribution uses the animal-specific parameter:
Ruminants (CTL, BFL, CML, SHP, GTS):
feed_ration_fraction * feed_metabolizable_energy_ruminant
Pigs (PGS):
feed_ration_fraction * feed_metabolizable_energy_pigs
This function is part of the run_ration_quality_module().
Numeric. Contribution of the feed component to total diet metabolizable energy content (MJ/kg DM).
Calculates the contribution of a single feed component to diet nitrogen content by weighting feed nitrogen content by its ration composition share.
calc_ration_nitrogen_content(feed_ration_fraction, feed_nitrogen_content)calc_ration_nitrogen_content(feed_ration_fraction, feed_nitrogen_content)
feed_ration_fraction |
Numeric. Proportion of a specific feed component in the total ration, expressed as its fraction of diet dry matter intake (fraction). Within each herd_id and cohort, proportions should sum to 1. |
feed_nitrogen_content |
Numeric. Nitrogen content of a feed component (kg N/kg DM). |
The nitrogen contribution is defined as:
Numeric. Contribution of the feed component to total diet nitrogen content (kg N/kg DM).
Applies species-specific urinary energy fractions to a ration composition share to compute the contribution of a feed component to urinary energy losses.
calc_ration_urinary_energy_fraction( species_short, feed_ration_fraction, feed_urinary_energy_ruminant = NA_real_, feed_urinary_energy_pigs = NA_real_ )calc_ration_urinary_energy_fraction( species_short, feed_ration_fraction, feed_urinary_energy_ruminant = NA_real_, feed_urinary_energy_pigs = NA_real_ )
species_short |
Character. Code identifying the livestock species. Supported values include:
|
feed_ration_fraction |
Numeric. Proportion of a specific feed component in the total ration, expressed as its fraction of diet dry matter intake (fraction). Within each herd_id and cohort, proportions should sum to 1. |
feed_urinary_energy_ruminant |
Numeric. Fraction of feed's gross energy that is excreted in urine for ruminants (fraction). |
feed_urinary_energy_pigs |
Numeric. Fraction of feed's gross energy that is excreted in urine for pigs (fraction). |
The urinary energy fraction contribution uses the animal-specific parameter:
Ruminants (CTL, BFL, CML, SHP, GTS):
feed_ration_fraction * feed_urinary_energy_ruminant
Pigs (PGS):
feed_ration_fraction * feed_urinary_energy_pigs
This function is part of the run_ration_quality_module().
Numeric. Contribution of the feed component to the fraction of total diet gross energy that is excreted in urine (fraction).
Calculates the ratio of net energy available for growth to digestible energy consumed (fraction), which represents the efficiency with which digestible energy in the diet is converted into net energy retained as body tissue.
calc_reg_growth(species_short, ration_digestibility_fraction = NA_real_)calc_reg_growth(species_short, ration_digestibility_fraction = NA_real_)
species_short |
Character. Code identifying the livestock species. Supported values include:
|
ration_digestibility_fraction |
Numeric. Average digestibility of the feed ration, expressed as ratio of digestible to gross energy content (fraction). |
This component follows the IPCC Tier 2 partitioning approach and returns REG for
ruminants (CTL, BFL, SHP, GTS) as:
For Other species REG is not applicable and the function
returns NA_real_.
This function is part of the run_metabolic_energy_req_module().
Numeric. Ratio of net energy available for growth in the diet to digestible energy consumed (fraction).
Gibbs M.J., Johnson D.E. (1993) Livestock Emissions. In: International Methane Emissions. Washington, D.C., U.S.A: US Environmental Protection Agency, Climate Change Division.
IPCC. (2019). 2019 Refinement to the 2006 IPCC Guidelines for National Greenhouse Gas Inventories, Chapter 10: Emissions from Livestock and Manure Management, Equation 10.15.
IPCC. (2006). 2006 IPCC Guidelines for National Greenhouse Gas Inventories, Chapter 10: Emissions from Livestock and Manure Management, Equation 10.15.
run_metabolic_energy_req_module,
calc_ration_digestibility
calc_total_metabolic_energy_req
calc_ration_intake
Calculates the ratio of net energy available in the diet for maintenance to digestible energy.
calc_rem_maintenance(species_short, ration_digestibility_fraction = NA_real_)calc_rem_maintenance(species_short, ration_digestibility_fraction = NA_real_)
species_short |
Character. Code identifying the livestock species. Supported values include:
|
ration_digestibility_fraction |
Numeric. Average digestibility of the feed ration, expressed as ratio of digestible to gross energy content (fraction). |
This component follows the IPCC Tier 2 partitioning approach and it returns the value for
ruminants (CTL, BFL, SHP, GTS) calculated as follows:
For the Other species REM is not applicable and the function
returns NA_real_.
This function is part of the run_metabolic_energy_req_module().
Numeric. Ratio of net energy available for maintenance in the diet to digestible energy consumed (fraction).
Gibbs M.J., Johnson D.E. (1993) Livestock Emissions. In: International Methane Emissions. Washington, D.C., U.S.A: US Environmental Protection Agency, Climate Change Division.
IPCC. (2019). 2019 Refinement to the 2006 IPCC Guidelines for National Greenhouse Gas Inventories, Chapter 10: Emissions from Livestock and Manure Management, Equation 10.14.
IPCC. (2006). 2006 IPCC Guidelines for National Greenhouse Gas Inventories, Chapter 10: Emissions from Livestock and Manure Management, Equation 10.14.
run_metabolic_energy_req_module,
calc_ration_digestibility
calc_total_metabolic_energy_req
calc_ration_intake
Calculates population dynamics over time until a steady state is reached. The steady state is defined as a constant sex–age cohort structure over time, with population size potentially growing or declining at a constant rate. Tracks sex–age cohort structure and population growth based on survival, offtake, and fecundity parameters.
calc_steady_state_structure( initial_herd_structure, max_simulation_years, min_lambda_change, fecundity_female, fecundity_male, probability_death, probability_offtake, probability_growth )calc_steady_state_structure( initial_herd_structure, max_simulation_years, min_lambda_change, fecundity_female, fecundity_male, probability_death, probability_offtake, probability_growth )
initial_herd_structure |
Named numeric vector of length 6. Initial number of individuals in each of the 6 sex-age classes used
to bootstrap the steady-state simulation (# heads).
These values are used as starting points for the iterative simulation and do not affect the final steady-state results (only convergence speed).
Must be named with: |
max_simulation_years |
Numeric. Maximum number of years to simulate (years). |
min_lambda_change |
Numeric. Convergence threshold for changes in cohort-specific growth rates of sex–age cohort proportions (lambda). Iterations of the herd simulation stop when the absolute change in lambda between successive iterations falls below this threshold. |
fecundity_female |
Numeric. Daily number of female offspring per adult female (# offspring/day) |
fecundity_male |
Numeric. Daily number of male offspring per adult female (# offspring/day) |
probability_death |
Named numeric vector of length 10. Probability of animal dying within the model time interval for 10 cohorts (fraction)
(cohorts= |
probability_offtake |
Named numeric vector of length 10. Probability that an animal will be removed from the herd within the model time interval for 10 cohorts (fraction).
(cohorts= |
probability_growth |
Named numeric vector of length 10. Probability of growing into the next age class for 10 cohorts (fraction)
(cohorts= |
A named list with:
Numeric. Number of days required for the herd population structure to converge to a steady state, defined as the point at which successive iterations produce negligible changes in cohort proportions (days)
Named numeric vector of length 8. Final steady-state share of each of 8 sex-age cohorts (FB, FJ, FS, FA, MB, MJ, MS, MA) (fraction). Shares should sum to 1.
Named numeric vector of length 6. Final steady-state share of 6 grouped sex-age cohorts (FJ, FS, FA, MJ, MS, MA, where FJ = FB + FJ and MJ = MB + MJ) (fraction). Shares should sum to 1.
Numeric. Annualized growth rate at which the herd reaches steady state (fraction)
This function is part of the run_demographic_herd_module().
Calculates annual offtake quantities and rates, as well as stock variation and their combined values across 6 sex-age classes based on steady-state population projections. The steady state is defined as a constant sex–age cohort structure over time, with population size potentially growing or declining at a constant rate.
calc_summary_offtake( cohort_stock_start, cohort_stock_end_projected, cohort_stock_average, cohort_offtake_heads, simulation_duration )calc_summary_offtake( cohort_stock_start, cohort_stock_end_projected, cohort_stock_average, cohort_offtake_heads, simulation_duration )
cohort_stock_start |
Numeric vector of length 6. Population size in each of the 6 sex–age cohorts at the start of the year (# heads). (cohorts= |
cohort_stock_end_projected |
Numeric vector of length 6. Population size in each of the 6 sex–age cohorts at the end of the year, projected using the steady-state growth rate (# heads). (cohorts= |
cohort_stock_average |
Numeric vector of length 6. Average population size in each of the 6 sex–age cohorts over the year (# heads). Estimated from cohort_stock_start and cohort_stock_end_projected (cohorts= |
cohort_offtake_heads |
Numeric vector of length 10. Total number of animals removed from the herd over the year, by 10 sex–age cohorts (heads/year)
(cohorts= |
simulation_duration |
Numeric. Length of the assessment period (days) |
A named list with:
Numeric vector of length 6. Change in population size between the start and end of the year for each sex–age cohort (# heads) (cohorts= FJ, FS, FA, MJ, MS, MA).
Numeric vector of length 6. Total number of animals removed via offtake over the year, aggregated to 6 sex–age cohorts (heads/year) (cohorts= FJ, FS, FA, MJ, MS, MA)
Numeric vector of length 6. Total number of animals removed via offtake over the assessment period, aggregated to 6 sex–age cohorts (heads/assessment period) (cohorts= FJ, FS, FA, MJ, MS, MA)
Numeric vector of length 6. Offtake rate relative to the starting population size in each sex–age cohort (fraction) (cohorts= FJ, FS, FA, MJ, MS, MA)
Numeric vector of length 6. Offtake rate relative to the average population size in each sex–age cohort (fraction) (cohorts= FJ, FS, FA, MJ, MS, MA)
Numeric vector of length 6. Sum of offtake and stock variation for each sex–age cohort over the year (# heads) (cohorts= FJ, FS, FA, MJ, MS, MA)
Numeric vector of length 6. Offtake plus stock-variation rate relative to starting population size (fraction) (cohorts= FJ, FS, FA, MJ, MS, MA)
Numeric vector of length 6. Offtake plus stock-variation rate relative to average population size (fraction) (cohorts= FJ, FS, FA, MJ, MS, MA)
This function is part of the run_demographic_herd_module().
Calculates the total daily energy requirement (MJ/head/day) by summing relevant energy partitions (maintenance, activity, lactation, work, pregnancy, growth, fibre, egg deposition).
calc_total_metabolic_energy_req( species_short, metabolic_energy_req_maintenance, metabolic_energy_req_activity, metabolic_energy_req_lactation, metabolic_energy_req_work, metabolic_energy_req_pregnancy, net_energy_maintenance_digestible_energy_ratio, metabolic_energy_req_growth, metabolic_energy_req_fibre_production, metabolic_energy_req_egg_deposition, net_energy_growth_digestible_energy_ratio, ration_digestibility_fraction )calc_total_metabolic_energy_req( species_short, metabolic_energy_req_maintenance, metabolic_energy_req_activity, metabolic_energy_req_lactation, metabolic_energy_req_work, metabolic_energy_req_pregnancy, net_energy_maintenance_digestible_energy_ratio, metabolic_energy_req_growth, metabolic_energy_req_fibre_production, metabolic_energy_req_egg_deposition, net_energy_growth_digestible_energy_ratio, ration_digestibility_fraction )
species_short |
Character. Code identifying the livestock species. Supported values include:
|
metabolic_energy_req_maintenance |
Numeric. Energy required for maintenance, defined as the amount of energy needed to keep the animal at equilibrium such that body energy is neither gained nor lost (MJ/head/day). Expressed as net energy for CTL, BFL, SHP, GTS and as metabolizable energy for CML and PGS. |
metabolic_energy_req_activity |
Numeric. Energy required for activity, defined as the amount of energy needed to support animal movement and physical activity (MJ/head/day). Expressed as net energy for CTL, BFL, SHP, GTS and as metabolizable energy for CML and PGS. |
metabolic_energy_req_lactation |
Numeric. Energy required for lactation (MJ/head/day). Expressed as net energy for CTL, BFL, SHP, GTS and as metabolizable energy for CML and PGS. |
metabolic_energy_req_work |
Numeric. Energy required for work, used to estimate the energy required for draught power for CTL, BFL and CML (MJ/head/day). Assumed to be 0 for other species. Expressed as net energy for CTL, BFL, SHP, GTS and as metabolizable energy for CML and PGS. |
metabolic_energy_req_pregnancy |
Numeric. Energy required for pregnancy for pregnant females (MJ/head/day). Expressed as net energy for CTL, BFL, SHP, GTS and as metabolizable energy for CML and PGS. |
net_energy_maintenance_digestible_energy_ratio |
Ratio of net energy available for maintenance in the diet to digestible energy consumed (fraction). |
metabolic_energy_req_growth |
Numeric. Energy required for growth (i.e., weight gain) (MJ/head/day). Expressed as net energy for CTL, BFL, SHP, GTS and as metabolizable energy for CML and PGS. |
metabolic_energy_req_fibre_production |
Numeric. Energy required for the synthesis of fibre for SHP, GTS and CML. Assumed to be 0 for other species (MJ/head/day). Expressed as net energy for CTL, BFL, SHP, GTS and as metabolizable energy for CML and PGS (MJ/head/day). |
metabolic_energy_req_egg_deposition |
Numeric. Net energy for egg production (MJ/head/day). |
net_energy_growth_digestible_energy_ratio |
Numeric. Ratio of net energy available for growth in the diet to digestible energy consumed (fraction) |
ration_digestibility_fraction |
Numeric. Average digestibility of the feed ration, expressed as ratio of digestible to gross energy content (fraction). |
This component follows the IPCC Tier 2 partitioning approach and the calculation is computed differently depending on whether species energy requirements are expressed as net or metabolizable energy.
Species-specific approach:
Energy requirements expressed as net energy (CTL, BFL, SHP, GTS)
CTL and BFL:
SHP and GTS:
Energy requirements expressed as metabolizable energy (CML, PGS)
For these species, the total daily requirement is computed as the direct sum of relevant energy components (MJ/head/day).
CML:
PGS:
This function is part of the run_metabolic_energy_req_module().
Numeric. Total daily energy requirement (MJ/head/day). For CTL, BFL, SHP and GTS this is expressed as gross energy intake requirement (GE). For CML and PGS the function returns the summed daily metabolizable energy requirement.
IPCC. (2019). 2019 Refinement to the 2006 IPCC Guidelines for National Greenhouse Gas Inventories, Chapter 10: Emissions from Livestock and Manure Management, Equation 10.16.
IPCC. (2006). 2006 IPCC Guidelines for National Greenhouse Gas Inventories, Chapter 10: Emissions from Livestock and Manure Management, Equation 10.16.
run_metabolic_energy_req_module,
calc_metabolic_energy_req_maintenance
calc_metabolic_energy_req_activity
calc_metabolic_energy_req_growth
calc_metabolic_energy_req_lactation
calc_metabolic_energy_req_work
calc_metabolic_energy_req_fibre
calc_metabolic_energy_req_pregnancy
calc_rem_maintenance
calc_reg_growth
calc_ration_intake
Calculates hazard rates and daily transition probabilities (death, offtake, survival, and growth) across different sex-age cohorts. Converts annual inputs to daily hazards, then derives daily probabilities from those hazards.
calc_transition_probabilities(cohort_duration_days, offtake_rate, death_rate)calc_transition_probabilities(cohort_duration_days, offtake_rate, death_rate)
cohort_duration_days |
Numeric vector of length 6. Amount of time that each animal spends in a specific cohort (days). |
offtake_rate |
Numeric vector of length 6. Annual proportion of animals removed from the herd for each sex-age cohort (fraction). |
death_rate |
Numeric vector of length 6. Fraction of deaths in a herd over a year for each sex-age cohort (fraction) |
A named list with:
Numeric vector of length 6. Instantaneous mortality hazard rate for the 6 sex–age cohorts. Represents the risk of death per unit time (day) (cohorts= FJ, FS, FA, MJ, MS, MA)
Numeric vector of length 6. Instantaneous offtake hazard rate for the 6 sex-age cohorts. Represents the risk to leave the herd through planned removals per unit of time (day-1) (cohorts= FJ, FS, FA, MJ, MS, MA)
Named numeric vector of length 10. Probability of animal dying within the model time interval for 10 cohorts (fraction).
(cohorts= FB: Female Birth, FJ: Female Juvenile, FS: Female Sub-adult, FA: Female Adult, FC: Female Culling, MB: Male Birth, MJ: Male Juvenile, MS: Male Sub-adult, MA: Male Adult, MC: Male Culling)
Named numeric vector of length 10. Probability that an animal will be removed from the herd within the model time interval for 10 cohorts (fraction).
(cohorts= FB: Female Birth, FJ: Female Juvenile, FS: Female Sub-adult, FA: Female Adult, FC: Female Culling, MB: Male Birth, MJ: Male Juvenile, MS: Male Sub-adult, MA: Male Adult, MC: Male Culling)
Named numeric vector of length 10. Probability that an animal remains alive in the herd within the model time interval for 10 cohorts (fraction).
(cohorts= FB: Female Birth, FJ: Female Juvenile, FS: Female Sub-adult, FA: Female Adult, FC: Female Culling, MB: Male Birth, MJ: Male Juvenile, MS: Male Sub-adult, MA: Male Adult, MC: Male Culling)
Named numeric vector of length 10. Probability of growing into the next age class for 10 cohorts (fraction)
(cohorts= FB: Female Birth, FJ: Female Juvenile, FS: Female Sub-adult, FA: Female Adult, FC: Female Culling, MB: Male Birth, MJ: Male Juvenile, MS: Male Sub-adult, MA: Male Adult, MC: Male Culling)
This function is part of the run_demographic_herd_module().
Calculates daily volatile solids (VS) excretion in manure (kg VS/head/day). VS represent the organic fraction of manure dry matter, including both biodegradable and non-biodegradable organic material. VS is a key intermediate variable required for estimating methane (CH4) emissions from manure management systems under IPCC methodologies.
calc_volatile_solids( ration_intake, ration_digestibility_fraction, ration_urinary_energy_fraction, ration_ash )calc_volatile_solids( ration_intake, ration_digestibility_fraction, ration_urinary_energy_fraction, ration_ash )
ration_intake |
Numeric. Average daily dry matter intake of feed (kg DM/head/day). |
ration_digestibility_fraction |
Numeric. Average digestibility of the feed ration, expressed as ratio of digestible to gross energy content (fraction). |
ration_urinary_energy_fraction |
Numeric. Fraction of feed's gross energy that is excreted in urine (fraction). |
ration_ash |
Numeric. Average ash content of feed, calculated as a fraction of the dry matter intake (kg ash/kg DM). |
The IPCC recommends estimating volatile solids (VS) excretion from feed intake and digestibility when country-specific average daily VS excretion rates are not available. The core relationship is provided in IPCC Equation 10.24 (Volatile solids excretion rates), which estimates daily VS excretion as a function of:
Gross energy intake (gross_energy_intake, MJ/day)
Digestibility of the diet (ration_digestibility_fraction)
Urinary energy expressed as a fraction of GE (ration_urinary_energy_fraction)
Ash content of the diet (ration_ash, fraction of dry matter)
A conversion factor representing the average gross energy content of dry matter (18.45 MJ/kg DM)
The general structure of Eq. 10.24 partitions gross energy intake into digestible energy, urinary losses, and ash, and converts the remaining organic matter into volatile solids using the energy density of dry matter.
Implementation note. This function applies an algebraically simplified formulation from Equation 10.24 of IPCC.
In this implementation, the function takes ration_intake directly
as an input. It can be calculated upstream with
calc_ration_intake as a function of energy requirements and
the energy content of the diet.
This reflects the use of ration-specific energy content upstream and avoids assuming a fixed gross energy density of 18.45 MJ/kg DM, as in the IPCC default approach.
The volatile solids excretion is then calculated as:
The resulting calculations are algebraically equivalent to the IPCC approach and fully consistent with Equation 10.24.
This function is part of the run_emissions_manure_module().
Numeric. Total volatile solids (VS) excreted per animal per day, representing the organic material in livestock manure and consisting of both biodegradable and non-biodegradable fractions (kg VS/head/day).
IPCC. (2019). 2019 Refinement to the 2006 IPCC Guidelines for National Greenhouse Gas Inventories, Chapter 10: Emissions from Livestock and Manure Management. Equation 10.24.
IPCC. (2006). 2006 IPCC Guidelines for National Greenhouse Gas Inventories, Chapter 10: Emissions from Livestock and Manure Management. Equation 10.24.
calc_volatile_solids <- calc_volatile_solids( ration_intake = 5, ration_digestibility_fraction = 0.6, ration_urinary_energy_fraction = 0.04, ration_ash = 0.08 )calc_volatile_solids <- calc_volatile_solids( ration_intake = 5, ration_digestibility_fraction = 0.6, ration_urinary_energy_fraction = 0.04, ration_ash = 0.08 )
Calculates the energy required for animal work over the assessment period (MJ/cohort/assessment period), based on the daily energy requirement for work, cohort size, and assessment duration.
calc_work_allocation_energy( species_short, cohort_stock_size, metabolic_energy_req_work, simulation_duration, ratio_me_to_ne = NA_real_ )calc_work_allocation_energy( species_short, cohort_stock_size, metabolic_energy_req_work, simulation_duration, ratio_me_to_ne = NA_real_ )
species_short |
Character. Code identifying the livestock species. Supported values include:
|
cohort_stock_size |
Numeric. Population size in the cohort at the start of the assessment period (heads). |
metabolic_energy_req_work |
Numeric. Energy required for work, used to estimate the energy required for draught power for CTL, BFL and CML. (MJ/head/day) Assumed to be 0 for other species. Expressed as net energy for CTL, BFL, SHP, GTS and as metabolizable energy for CML and PGS. |
simulation_duration |
Numeric. Length of the assessment period (days). |
ratio_me_to_ne |
Numeric. Ratio of metabolizable energy converted to net energy (fraction). |
This function provides the work-related energy term used in a biophysical allocation framework to apportion emissions between milk and other co-products in multifunctional livestock production systems.
The approach implements the IDF (2022) standard, adapted from Thoma and Nemecek (2020), and is consistent with FAO LEAP livestock LCA guidelines (FAO, 2016a, 2016b, 2016c) and with ISO 14044:2006 (Section 4.3.4.2, Step 2).
In accordance with ISO 14044:2006 (Section 4.3.4.2, Step 2), known processing or biophysical relationships may be used to assign shared inputs and outputs of a single production unit to individual products or sub-units. In livestock systems, this includes apportioning shared feed and energy use according to physiological energy requirements (e.g., net energy for lactation, growth, etc.). If the resulting process remains multifunctional, these energy terms may subsequently be used to derive allocation factors among co-products.
Total work-related energy is computed for species (CTL, BFL, CML)
and cohorts (, FA, MA) assumed to be potentially involved in draught power generation.
The work_allocation_energy is calculated as follows:
for cattle (CTL) and buffalo (BFL), and:
for camels (CML).
where metabolic_energy_req_work can be computed using
calc_metabolic_energy_req_work (see also
run_metabolic_energy_req_module).
This function is part of the run_allocation_module().
Numeric. Energy required to provide all draught power (traction/work) by cohort (MJ/cohort/assessment period). Non-zero values are expected only for draught or work-producing species (CTL, BFL CML).
ISO. (2006). Environmental management — Life cycle assessment — Requirements and guidelines (ISO 14044:2006). International Organization for Standardization, Geneva.
IDF. (2022). The IDF Global Carbon Footprint Standard for the Dairy Sector. Bulletin of the IDF No. 520/2022. International Dairy Federation, Brussels.
Thoma, G., and Nemecek, T. (2020). Allocation between milk and meat in dairy LCA: Critical discussion of the IDF’s standard methodology. In Proceedings of the 12th International Conference on Life Cycle Assessment of Food (LCAFood 2020) (pp. 83–89), 13–16 October, Berlin, Germany.
FAO. (2016a). Environmental performance of large ruminant supply chains: Guidelines for assessment. Livestock Environmental Assessment and Performance (LEAP) Partnership. FAO, Rome, Italy.
FAO. (2016b). Greenhouse gas emissions and fossil energy use from small ruminant supply chains: Guidelines for assessment. Livestock Environmental Assessment and Performance (LEAP) Partnership. FAO, Rome, Italy.
FAO. (2016c). Greenhouse gas emissions and fossil energy use from poultry supply chains: Guidelines for assessment. Livestock Environmental Assessment and Performance (LEAP) Partnership. FAO, Rome, Italy.
run_allocation_module,
calc_metabolic_energy_req_work,
run_metabolic_energy_req_module
This function generates final herd-level results by aggregating key cohort-level outputs, scaling variables over the assessment duration, allocating emissions to commodities, and converting methane (CH4) and nitrous oxide (N2O) emissions to CO2-equivalents (CO2eq) using selected 100-year Global Warming Potential (GWP-100) factors.
run_aggregation_module( cohort_level_data, allocation_herd_long, simulation_duration = 365, global_warming_potential_set = "AR6", show_indicator = TRUE )run_aggregation_module( cohort_level_data, allocation_herd_long, simulation_duration = 365, global_warming_potential_set = "AR6", show_indicator = TRUE )
cohort_level_data |
data.table. Cohort-level input table with the following data requirement:
|
allocation_herd_long |
data.table. Herd-level allocation table in long format, typically generated by
|
simulation_duration |
Numeric. Length of the assessment period (days). |
global_warming_potential_set |
Character. Settings for the 100-year Global Warming Potential (GWP-100) conversion factors used to express CH4 and N2O emissions as CO2eq. Must be one of:
|
show_indicator |
Logical. Whether to display progress indicators during
the pipeline run. Defaults to |
This function represents the final step of the Global Livestock Environmental
Assessment Model (GLEAM) computational pipeline run_gleam() and performs the following calculation sequence:
Cohort-level variables are reshaped from wide to long format.
Variables are classified into "Feed", "NitrogenBalance", "Production", and "Emissions".
Cohort totals are calculated using calc_cohort_totals(). Production variables are retained as provided, whereas emissions,
feed, and nitrogen balance variables are scaled using cohort stock size and simulation duration.
Cohort totals are aggregated to herd level within each herd_id x species_short x variable_type x variable_name group.
Herd-level emissions are merged with commodity allocation shares from allocation_herd_long.
Emissions are allocated to commodities using calc_allocated_emissions().
Gas type is identified from the emission variable name as "CH4", "N2O", or "CO2".
Allocated CH4, N2O, and CO2 emissions are converted to CO2-equivalents (CO2eq) using calc_co2eq() and the selected GWP-100 option.
Final output tables are produced summarizing herd-level results for emissions, feed, production, and nitrogen balance variables.
A named list with the following elements:
A data.table containing herd-level emissions
scaled to the assessment duration and allocated to commodities. Includes gas type,
allocation shares, commodity metadata, GWP factors, and emissions expressed both as
allocated gas mass (kg gas) and as CO2-equivalents (kg CO2eq).
A data.table containing herd-level feed variables,
aggregated at herd level and scaled to the assessment duration.
A data.table containing herd-level production
variables aggregated from cohort-level values over the assessment duration.
A data.table containing herd-level nitrogen
balance variables aggregated from cohort-level values and scaled to the
assessment duration.
run_gleam(),
calc_cohort_totals(),
calc_cohort_to_herd_aggregation(),
calc_allocated_emissions(),
calc_co2eq(),
run_allocation_module()
# Load cohort-level aggregation input aggregation_chrt_dt <- data.table::fread(system.file( "extdata/run_modules_examples/aggregation_input_chrt_data.csv", package = "gleam" )) # Load allocation shares (herd-level, long format) allocation_long <- data.table::fread(system.file( "extdata/run_modules_examples/aggregation_allocation_input_data.csv", package = "gleam" )) # Run aggregation results <- run_aggregation_module( cohort_level_data = aggregation_chrt_dt, allocation_herd_long = allocation_long, simulation_duration = 365, global_warming_potential_set = "AR6" )# Load cohort-level aggregation input aggregation_chrt_dt <- data.table::fread(system.file( "extdata/run_modules_examples/aggregation_input_chrt_data.csv", package = "gleam" )) # Load allocation shares (herd-level, long format) allocation_long <- data.table::fread(system.file( "extdata/run_modules_examples/aggregation_allocation_input_data.csv", package = "gleam" )) # Run aggregation results <- run_aggregation_module( cohort_level_data = aggregation_chrt_dt, allocation_herd_long = allocation_long, simulation_duration = 365, global_warming_potential_set = "AR6" )
Calculates biophysical allocation shares for livestock commodities by computing cohort-level energy requirements for meat, milk, fibre, work, and eggs, aggregating these terms to herd level, and assigning allocation shares to emission sources.
run_allocation_module( cohort_level_data, herd_level_data, simulation_duration = 365, show_indicator = TRUE )run_allocation_module( cohort_level_data, herd_level_data, simulation_duration = 365, show_indicator = TRUE )
cohort_level_data |
Cohort-level input table with the following data requirement:
|
herd_level_data |
data.table. Herd-level input table (one row per
|
simulation_duration |
Numeric. Length of the assessment period (days). |
show_indicator |
Logical. Whether to display progress indicators during simulation.
Defaults to |
This function implements the allocation pipeline used to derive biophysical allocation shares for livestock commodities in multifunctional production systems.
The approach follows the IDF standard for the dairy sector, adapted for livestock systems in which emissions are apportioned among multiple products according to their physiological energy requirements. In accordance with ISO 14044:2006, known biophysical relationships may be used to assign shared inputs and outputs of a production system to individual products or sub-units.
This function represents the intermediate allocation module of the Global Livestock Environmental
Assessment Model (GLEAM) computational pipeline run_gleam() and performs the following calculation sequence:
Calculation of cohort-level energy allocation terms for meat, milk,
fibre, work, and eggs using
calc_meat_allocation_energy,
calc_milk_allocation_energy,
calc_fibre_allocation_energy,
calc_work_allocation_energy, and
calc_eggs_allocation_energy.
Aggregation of cohort-level energy terms to herd level using
calc_cohort_to_herd_aggregation.
Calculation of herd-level allocation shares for commodities using
calc_allocation_shares.
Reshaping of allocation shares to long format and assignment of shares
to emission sources using
assign_allocation_shares.
Commodity-specific allocation shares represent the fraction of total herd-level
energy requirements attributable to each commodity. These shares are then used
to assign emissions to meat, milk, fibre, work, eggs, or the residual category
"None".
Emissions from manure burned for fuel and manure deposited on pasture are not
allocated to livestock commodities. These flows are assigned fully to
"None" in accordance with the rules implemented in
assign_allocation_shares.
A named list of two data.table objects:
A data.table with the original
cohort-level input columns plus the following new variables:
Numeric. Energy required to produce total milk output by cohort (MJ/cohort/assessment period).
Numeric. Energy required by a given sex–age cohort for total meat output by cohort during the assessment period, equal to the energy needed to produce all live-weight gain to reach the target slaughter weight (MJ/cohort/assessment period).
Numeric. Energy required to produce all fibre output by cohort (MJ/cohort/assessment period).
Numeric. Energy required to provide all draught power (traction/work) by cohort (MJ/cohort/assessment period).
Numeric. Energy required for egg production over the assessment period (MJ/cohort/assessment period). Currently set to 0.
A herd-level data.table in long format with one
row per herd, commodity, and emission source combination, containing the
following columns:
Character. Unique identifier for the herd, repeated for each cohort belonging to the same herd.
Character. Code identifying the livestock species. Supported values include:
PGS: pigs
CML: camels
CTL: cattle
BFL: buffalo
SHP: sheep
GTS: goats
Character. Names of emission variables to which allocation should be applied (e.g.,"ch4_enteric", "ch4_manure_pasture", "ch4_manure_burned","ch4_manure_other", "n2o_manure_pasture_direct", "n2o_manure_burned_direct","n2o_manure_other_direct", "n2o_manure_burned_indirect","n2o_manure_pasture_indirect", "n2o_manure_other_indirect", "co2_ration_fertilizer", "co2_ration_pesticides", "co2_ration_crop_activities", "co2_ration_luc_nopeat", "co2_ration_luc_peat", "n2o_ration_fertilizer", "n2o_ration_manure_applied", "n2o_ration_crop_residues", "ch4_ration_rice")
Character. List of commodity categories to which emissions may be allocated. List=c("None","Milk","Meat","Fibre","Work","Eggs")
Character. Commodity (commodity_name) grouping, either
"Edible" or "Non-Edible".
Numeric. Allocation share assigned to the commodity for the corresponding emission source (fraction).
ISO. (2006). Environmental management — Life cycle assessment — Requirements and guidelines (ISO 14044:2006). International Organization for Standardization, Geneva.
IDF. (2022). The IDF Global Carbon Footprint Standard for the Dairy Sector. Bulletin of the IDF No. 520/2022. International Dairy Federation, Brussels.
Thoma, G., and Nemecek, T. (2020). Allocation between milk and meat in dairy LCA: Critical discussion of the IDF’s standard methodology. In Proceedings of the 12th International Conference on Life Cycle Assessment of Food (LCAFood 2020) (pp. 83–89), 13–16 October, Berlin, Germany.
FAO. (2016a). Environmental performance of large ruminant supply chains: Guidelines for assessment. Livestock Environmental Assessment and Performance (LEAP) Partnership. FAO, Rome, Italy.
FAO. (2016b). Greenhouse gas emissions and fossil energy use from small ruminant supply chains: Guidelines for assessment. Livestock Environmental Assessment and Performance (LEAP) Partnership. FAO, Rome, Italy.
FAO. (2016c). Greenhouse gas emissions and fossil energy use from poultry supply chains: Guidelines for assessment. Livestock Environmental Assessment and Performance (LEAP) Partnership. FAO, Rome, Italy.
run_gleam,
calc_milk_production,
calc_meat_production,
run_production_module,
calc_meat_allocation_energy,
calc_milk_allocation_energy,
calc_fibre_allocation_energy,
calc_work_allocation_energy,
calc_eggs_allocation_energy,
calc_cohort_to_herd_aggregation,
calc_allocation_shares,
assign_allocation_shares
# Load allocation inputs (cohort and herd-level) allocation_chrt_dt <- data.table::fread(system.file( "extdata/run_modules_examples/allocation_input_chrt_data.csv", package = "gleam" )) allocation_hrd_dt <- data.table::fread(system.file( "extdata/run_modules_examples/allocation_input_hrd_data.csv", package = "gleam" )) results <- run_allocation_module( cohort_level_data = allocation_chrt_dt, herd_level_data = allocation_hrd_dt ) head(results$allocation_long)# Load allocation inputs (cohort and herd-level) allocation_chrt_dt <- data.table::fread(system.file( "extdata/run_modules_examples/allocation_input_chrt_data.csv", package = "gleam" )) allocation_hrd_dt <- data.table::fread(system.file( "extdata/run_modules_examples/allocation_input_hrd_data.csv", package = "gleam" )) results <- run_allocation_module( cohort_level_data = allocation_chrt_dt, herd_level_data = allocation_hrd_dt ) head(results$allocation_long)
This function takes herd- and cohort-level demographic inputs and estimates a steady-state
sex–age herd structure compatible with downstream calculations in the Global Livestock
Environmental Assessment Model (GLEAM) computational pipeline run_gleam(). In addition to cohort population sizes, it derives
population growth rates, and offtake numbers.
The steady state is defined as a constant sex–age cohort structure over time,
with population size potentially growing or declining at a constant rate.
run_demographic_herd_module( cohort_level_data, herd_level_data, initial_herd_structure = c(FJ = 100, FS = 50, FA = 30, MJ = 100, MS = 50, MA = 30), max_simulation_years = 100, min_lambda_change = 1e-09, show_indicator = TRUE, simulation_duration = 365 )run_demographic_herd_module( cohort_level_data, herd_level_data, initial_herd_structure = c(FJ = 100, FS = 50, FA = 30, MJ = 100, MS = 50, MA = 30), max_simulation_years = 100, min_lambda_change = 1e-09, show_indicator = TRUE, simulation_duration = 365 )
cohort_level_data |
A
|
herd_level_data |
A
|
initial_herd_structure |
Named numeric vector of length 6. Initial number of individuals in each of the 6 sex-age cohorts used
to bootstrap the steady-state simulation (# heads).These values are used as starting points for the iterative simulation and
do not affect the final steady-state results (only convergence speed). Default is |
max_simulation_years |
Numeric. Maximum number of years to simulate (years). Defaults to |
min_lambda_change |
Numeric. Convergence threshold for changes in cohort-specific growth rates of sex–age cohort proportions (lambda).
Iterations of the herd simulation stop when the absolute change in lambda between successive iterations falls below this threshold. Defaults to |
show_indicator |
Logical. Whether to display progress indicators during simulation.
Defaults to |
simulation_duration |
Numeric. Length of the assessment period (days). |
The function operates under a steady-state assumption: demographic parameters are constant over time, so the population converges to a stable cohort composition and a constant annual growth rate. Once this regime is reached, the model computes cohort population sizes (start/end/average), cohort shares, and offtake totals.
A key feature of this implementation is that it applies demography at a daily resolution. Annual mortality and offtake inputs are converted into daily hazards and daily transition probabilities under competing risks (death vs. offtake vs. survival).
Conceptually, this corresponds to the steady-state demographic approach implemented in Dynmod STEADY1 (Lesnoff, 2013), adapted here to a daily time-step formulation within an R workflow and fully integrated into the GLEAM computational pipeline.
The population is divided by sex (female/male) and age class (juvenile/subadult/adult), represented by six cohorts:
FJ, FS, FA (female juvenile, subadult, adult)
MJ, MS, MA (male juvenile, subadult, adult)
Only adult females (FA) contribute to reproduction. Births are distributed between
females and males using birth_fraction_female. Reproduction is assumed to be
distributed over time (no birth pulse). Daily fecundity rates are computed in
calc_fecundity_rates.
Herd dynamics result from:
births (driven by parturition_rate and litter_size)
natural deaths (driven by death_rate)
removals by offtake (driven by offtake_rate)
cohort aging / growth transitions (driven by cohort_duration_days)
As in Dynmod, offtake_rate is interpreted as a net removal rate for the cohort
(e.g. slaughter), while death_rate represents
natural mortality excluding offtake.
Mortality and offtake are treated as competing risks within each cohort: at any time an
animal can survive, die, or be offtaken.Annual inputs are converted to daily hazards and then
daily transition probabilities in calc_transition_probabilities.
Internally, the model:
Converts annual mortality (death_rate) into a daily mortality hazard.
Solves for the daily offtake hazard such that the implied offtake probability matches
offtake_rate under competing risks.
Computes daily probabilities of death, offtake, and survival from the hazards.
Under constant parameters, the cohort structure converges to a stable composition and a
stable population growth rate. This function seeks that steady state by
iterating the demographic system (see calc_steady_state_structure) starting from initial_herd_structure until changes
in cohort-specific growth rates of sex–age cohort proportions () fall below min_lambda_change,
or until max_simulation_years is reached.
The steady-state solution obtained here provides:
cohort shares used to scale herd-level population sizes,
a stable annual herd growth rate,
internally consistent death, offtake, and survival probabilities.
These outputs are subsequently used to project one year of population dynamics
(calc_projected_population_size) and to summarise annual offtake and stock variation
(calc_summary_offtake).
A named list with two elements:
cohort_level_resultsA data.table with one row per herd and cohort containing all original
cohort_level_data columns plus the following simulation results:
cohort_stock_size - Numeric vector of length 6. Average population size in each of the 6 sex–age cohorts (# heads) (cohorts = (FJ, FS, FA, MJ, MS, MA)).
This corresponds to cohort_stock_start returned by calc_projected_population_size, as it reflects the size of the population by cohort while preserving the total population size (herd_size_total) provided in the inputs.
offtake_heads - Numeric vector of length 6. Total number of animals removed via offtake over the year, aggregated to 6 sex–age cohorts (heads/year) (cohorts = FJ, FS, FA, MJ, MS, MA).
offtake_heads_assessment - Numeric vector of length 6. Total number of animals removed via offtake over the assessment period, aggregated to 6 sex–age cohorts (heads/assessment period) (cohorts = FJ, FS, FA, MJ, MS, MA).
herd_level_resultsA data.table with one row per herd containing all original
herd_level_data columns plus the following herd-level simulation results:
growth_rate_herd - Numeric. Annualized growth rate at which the herd size reaches steady state (fraction).
Lesnoff, M. (2013). DYNMOD: A spreadsheet interface for demographic projections of tropical livestock populations, User's manual. CIRAD, Montpellier, France.
calc_fecundity_rates,
calc_transition_probabilities,
calc_steady_state_structure,
calc_projected_population_size,
calc_summary_offtake
# Load herd simulation inputs (cohort- and herd-level) herd_simulation_chrt_dt <- data.table::fread(system.file( "extdata/run_modules_examples/herd_simulation_input_chrt_data.csv", package = "gleam" )) herd_simulation_hrd_dt <- data.table::fread(system.file( "extdata/run_modules_examples/herd_simulation_input_hrd_data.csv", package = "gleam" )) # Run herd simulation results <- run_demographic_herd_module( cohort_level_data = herd_simulation_chrt_dt, herd_level_data = herd_simulation_hrd_dt, simulation_duration = 200 ) # Access results print(results$cohort_level_results) print(results$herd_level_results)# Load herd simulation inputs (cohort- and herd-level) herd_simulation_chrt_dt <- data.table::fread(system.file( "extdata/run_modules_examples/herd_simulation_input_chrt_data.csv", package = "gleam" )) herd_simulation_hrd_dt <- data.table::fread(system.file( "extdata/run_modules_examples/herd_simulation_input_hrd_data.csv", package = "gleam" )) # Run herd simulation results <- run_demographic_herd_module( cohort_level_data = herd_simulation_chrt_dt, herd_level_data = herd_simulation_hrd_dt, simulation_duration = 200 ) # Access results print(results$cohort_level_results) print(results$herd_level_results)
Calculates daily enteric methane emissions by cohort (kg CH4/head/day) using a Tier 2 IPCC approach, by applying species-, cohort- and diet-specific methane conversion factors (ym).
run_emissions_enteric_module(cohort_level_data, show_indicator = TRUE)run_emissions_enteric_module(cohort_level_data, show_indicator = TRUE)
cohort_level_data |
data.table. Cohort-level input table with the following data requirement:
|
show_indicator |
Logical. Whether to display progress indicators during calculations.
Defaults to |
This function represents the intermediate module of the Global Livestock Environmental
Assessment Model (GLEAM) computational pipeline run_gleam() to estimate enteric methane
emissions and performs the following calculation sequence:
If ch4_mitigation_factor is not provided in the input data, it is set to 1 (no mitigation).
The methane conversion factor (ym) is computed using calc_conversion_factor_ym.
Daily enteric methane emissions are computed using calc_ch4_enteric.
A data.table with the original input columns plus the following new variables:
Added by the function if not provided as input.
Numeric. Methane (CH4) conversion factor (ym), representing the percentage of gross energy of the feed ration that is converted to CH4 (percentage).
Numeric. Average daily enteric methane (CH4) emissions (kg CH4/head/day).
IPCC. (2019). 2019 Refinement to the 2006 IPCC Guidelines for National Greenhouse Gas Inventories. Chapter 10: Emissions from Livestock and Manure Management, Equation 10.21.
IPCC. (2006). 2006 IPCC Guidelines for National Greenhouse Gas Inventories. Chapter 10: Emissions from Livestock and Manure Management, Equation 10.21.
run_gleam,
calc_conversion_factor_ym,
calc_ch4_enteric
# Load example input (6 herd_ids, cohort-level; only required columns) input_path <- system.file( "extdata/run_modules_examples/emissions_enteric_input_chrt_data.csv", package = "gleam" ) emissions_enteric_input_chrt_data <- data.table::fread(input_path) results <- run_emissions_enteric_module( cohort_level_data = emissions_enteric_input_chrt_data )# Load example input (6 herd_ids, cohort-level; only required columns) input_path <- system.file( "extdata/run_modules_examples/emissions_enteric_input_chrt_data.csv", package = "gleam" ) emissions_enteric_input_chrt_data <- data.table::fread(input_path) results <- run_emissions_enteric_module( cohort_level_data = emissions_enteric_input_chrt_data )
Calculates methane (CH4) and nitrous oxide (N2O) emissions at cohort-level from manure management systems (MMS).
run_emissions_manure_module( cohort_level_data, manure_management_system_fraction, manure_management_system_factors, show_indicator = TRUE )run_emissions_manure_module( cohort_level_data, manure_management_system_fraction, manure_management_system_factors, show_indicator = TRUE )
cohort_level_data |
data.table. Cohort-level input table with the following minimum data requirement:
|
manure_management_system_fraction |
data.table. Cohort-level MMS fractions with:
|
manure_management_system_factors |
data.table. Herd-level MMS factors with:
|
show_indicator |
Logical. Whether to display progress indicators during
the calculation. Defaults to |
This function represents the intermediate module of the Global Livestock Environmental
Assessment Model (GLEAM) computational pipeline run_gleam() to estimate emissions from
manure management systems (MMS) and orchestrates a cohort-level implementation of the IPCC manure
management methodology.
The following calculation sequence is applied:
VS excretion is computed from nutritional parameters of the feed ration
(digestibility, urinary energy, and ash) using a simplified formulation of Equation 10.24
(IPCC 2006, 2019) - calc_volatile_solids
Methane (CH4) emissions from manure management are computed from VS
and MMS-specific factors (MCF and B0) and reported by MMS group (pasture, burned,
and other), consistently with Equation 10.23 (IPCC, 2006, 2019) - calc_ch4_manure
Direct nitrous oxide (N2O) emissions from manure management are
computed from nitrogen excretion and MMS-specific EF3 values, and reported
by MMS group, consistently with Equation 10.25 (IPCC, 2006, 2019) - calc_n2o_manure_direct
Indirect N2O emissions are computed as the sum of:
volatilisation-driven N2O using MMS-specific nitrogen losses
(FracGas) and EF4, consistently with Equations 10.26 (IPCC, 2006, 2019),
10.27 (IPCC, 2006), and 10.28 (IPCC, 2019) - calc_n2o_manure_volatilization
leaching/runoff-driven N2O using MMS-specific nitrogen losses
(FracLeach) and EF5, consistently with Equations 10.28 (IPCC, 2006),
10.27 (IPCC, 2019), and 10.29 (IPCC, 2006, 2019) - calc_n2o_manure_leaching
Total N2O emissions are aggregated by MMS group
(pasture, burned, other) - calc_n2o_manure_total
The approach corresponds to a Tier 2 implementation as:
VS is derived from ration-level inputs rather than using fixed daily excretion defaults, and
emissions are allocated across MMS categories using herd/cohort MMS fractions and MMS-specific parameters.
cohort_level_data data.table. Input cohort table with added manure emissions columns:
Numeric. Total volatile solids (VS) excreted per animal per day, representing the organic material in livestock manure and consisting of both biodegradable and non-biodegradable fractions (kg VS/head/day).
Numeric. Methane (CH4) emissions from manure deposited on pasture (kg CH4/head/day).
Numeric. Methane (CH4) emissions from manure burned for fuel (kg CH4/head/day).
Numeric. Methane (CH4) emissions from manure management systems, excluding emissions from manure deposited on pasture and burned for fuel (kg CH4/head/day).
Numeric. Methane (CH4) emissions from manure management systems, excluding manure burned for fuel (kg CH4/head/day).
Numeric. Direct nitrous oxide (N2O) emissions from manure deposited on pasture (kg N2O/head/day).
Numeric. Direct nitrous oxide (N2O) emissions from manure burned for fuel (kg N2O/head/day).
Numeric. Direct nitrous oxide (N2O) emissions from manure management systems, excluding emissions from manure deposited on pasture and burned for fuel (kg N2O/head/day).
Numeric. Direct nitrous oxide (N2O) emissions from manure management systems, excluding emissions from manure burned for fuel (kg N2O/head/day).
Numeric. Indirect nitrous oxide (N2O) emissions resulting from atmospheric deposition of volatilised nitrogen (NH3 and NOx) from manure deposited on pasture (kg N2O/head/day).
Numeric. Indirect nitrous oxide (N2O) emissions resulting from atmospheric deposition of volatilised nitrogen (NH3 and NOx) from manure burned for fuel (kg N2O/head/day).
Numeric. Indirect nitrous oxide (N2O) emissions resulting from atmospheric deposition of volatilised nitrogen (NH3 and NOx) from manure management systems, excluding manure deposited on pasture and manure burned for fuel (kg N2O/head/day).
Numeric. Indirect nitrous oxide (N2O) emissions resulting from atmospheric deposition of volatilised nitrogen (NH3 and NOx) from manure management systems, excluding losses from manure burned for fuel (kg N2O/head/day).
Numeric. Indirect nitrous oxide (N2O) emissions resulting from leaching and runoff of manure nitrogen from manure deposited on pasture (kg N2O/head/day).
Numeric. Indirect nitrous oxide (N2O) emissions resulting from leaching and runoff of manure nitrogen from manure burned for fuel (kg N2O/head/day).
Numeric. Indirect nitrous oxide (N2O) emissions resulting from leaching and runoff of manure nitrogen from manure management systems, excluding losses from manure deposited on pasture and manure burned for fuel (kg N2O/head/day).
Numeric. Indirect nitrous oxide (N2O) emissions resulting from leaching and runoff of manure nitrogen from manure management systems, excluding losses from manure burned for fuel (kg N2O/head/day).
Numeric. Total indirect nitrous oxide (N2O) emissions from manure deposited on pasture. Includes emissions from atmospheric deposition of volatilised nitrogen (NH3 and NOx) and from leaching and runoff of manure nitrogen (kg N2O/head/day).
Numeric. Total indirect nitrous oxide (N2O) emissions originating from manure burned for fuel. Includes emissions from atmospheric deposition of volatilised nitrogen (NH3 and NOx) and from leaching and runoff of manure nitrogen (kg N2O/head/day).
Numeric. Total indirect nitrous oxide (N2O) emissions originating from manure management systems, excluding manure deposited on pasture and burned for fuel. Includes emissions from atmospheric deposition of volatilised nitrogen (NH3 and NOx) and from leaching and runoff of manure nitrogen.
Numeric. Total nitrous oxide emissions from manure deposited on pasture. Includes direct emissions and indirect emissions from volatilisation, leaching, and runoff (kg N2O/head/day).
Numeric. Total nitrous oxide emissions (N2O) from manure burned for fuel. Includes direct emissions and indirect emissions from volatilisation, leaching, and runoff (kg N2O/head/day).
Numeric. Total nitrous oxide (N2O) emissions from manure management systems, excluding manure deposited on pasture and manure burned for fuel. Includes direct emissions and indirect emissions from volatilisation, leaching, and runoff (kg N2O/head/day).
A complete list of MMS names, definitions, and associated emission factors can be accessed in the GLEAM Data Explorer.
IPCC. (2019). 2019 Refinement to the 2006 IPCC Guidelines for National Greenhouse Gas Inventories, Volume 4, Chapter 10: Emissions from Livestock and Manure Management. Equations 10.23, 10.24, 10.25, 10.26, 10.27, 10.28, and 10.29.
IPCC. (2006). 2006 IPCC Guidelines for National Greenhouse Gas Inventories, Volume 4, Chapter 10: Emissions from Livestock and Manure Management. Equations 10.23, 10.24, 10.25, 10.26, 10.27, 10.28, and 10.29.
run_gleam,
calc_volatile_solids,
calc_ch4_manure,
calc_n2o_manure_direct,
calc_n2o_manure_volatilization,
calc_n2o_manure_leaching,
calc_n2o_manure_total
# Load emissions manure inputs (cohort-level and system lookups) emissions_manure_input_chrt_data <- data.table::fread(system.file( "extdata/run_modules_examples/emissions_manure_input_chrt_data.csv", package = "gleam" )) manure_management_system_factors <- data.table::fread(system.file( "extdata/run_modules_examples/manure_management_system_factors.csv", package = "gleam" )) manure_management_system_fraction <- data.table::fread(system.file( "extdata/run_modules_examples/manure_management_system_fraction.csv", package = "gleam" )) results <- run_emissions_manure_module( cohort_level_data = emissions_manure_input_chrt_data, manure_management_system_fraction = manure_management_system_fraction, manure_management_system_factors = manure_management_system_factors )# Load emissions manure inputs (cohort-level and system lookups) emissions_manure_input_chrt_data <- data.table::fread(system.file( "extdata/run_modules_examples/emissions_manure_input_chrt_data.csv", package = "gleam" )) manure_management_system_factors <- data.table::fread(system.file( "extdata/run_modules_examples/manure_management_system_factors.csv", package = "gleam" )) manure_management_system_fraction <- data.table::fread(system.file( "extdata/run_modules_examples/manure_management_system_fraction.csv", package = "gleam" )) results <- run_emissions_manure_module( cohort_level_data = emissions_manure_input_chrt_data, manure_management_system_fraction = manure_management_system_fraction, manure_management_system_factors = manure_management_system_factors )
Computes cohort-level average greenhouse gas (GHG) emission factors from feed production by weighting emission factors of individual feed components by diet composition. Returns diet-level average GHG emission factors by gas and emission source for each cohort.
run_emissions_ration_module( rations_share, feed_emissions, show_indicator = TRUE )run_emissions_ration_module( rations_share, feed_emissions, show_indicator = TRUE )
rations_share |
data.table. Cohort-level feed ration composition shares with the following minimum data requirement:
|
feed_emissions |
data.table. Emission factors of individual feed components with the following data requirement:
|
show_indicator |
Logical. Whether to display progress indicators during calculations.
Defaults to |
This function represents the intermediate module of the Global Livestock Environmental
Assessment Model (GLEAM) computational pipeline run_gleam() to estimate emissions from
feed production used in the animal's ration.
The function joins rations_share with feed_emissions by feed_id,
uses species_short directly, and computes ration-weighted emission
factors by cohort.
The following calculation sequence is applied:
Merge ration shares with emission factors at the feed-component level using merge on
feed_id (left join: all.x = TRUE).
Compute feed-component contributions (row-wise) for each emission source by
multiplying the ration share of each feed component (feed_ration_fraction)
by the corresponding feed emission factor.
Each contribution is computed using the specific helper below (called with by = .I):
CO2 fertilizer: calc_co2_ration_fertilizer
CO2 pesticides: calc_co2_ration_pesticides
CO2 crop operations: calc_co2_ration_crop_activities
CO2 land-use change (no peat): calc_co2_ration_luc_nopeat
CO2 land-use change (peat): calc_co2_ration_luc_peat
N2O fertilizer: calc_n2o_ration_fertilizer
N2O manure applied: calc_n2o_ration_manure
N2O crop residues: calc_n2o_ration_crop_residues
CH4 rice cultivation: calc_ch4_ration_rice
Aggregate to cohort-level diet emission factors by summing feed-component contributions
across all feeds within each group (herd_id, species_short, cohort_short).
For each emission source, cohort-level dietary emission factors are computed as:
data.table. Cohort-level emission factors summarized by herd_id,
species_short, and cohort_short with the following columns:
Numeric. Diet-level average carbon dioxide (CO2) emission factor from fertilizer manufacture in feed production (g CO2/kg DM).
Numeric. Diet-level average carbon dioxide (CO2) emission factor from pesticide manufacture in feed production (g CO2/kg DM).
Numeric. Diet-level average carbon dioxide (CO2) emission factor from on-field agricultural activities in feed production (g CO2/kg DM).
Numeric. Diet-level average carbon dioxide (CO2) emission factor from land-use change (excluding peatland drainage) in feed production (g CO2/kg DM).
Numeric. Diet-level average carbon dioxide (CO2) emission factor from peatland drainage in feed production (g CO2/kg DM).
Numeric. Diet-level average nitrous oxide (N2O) emission factor from fertilizer use in feed production (g N2O/kg DM).
Numeric. Diet-level average nitrous oxide (N2O) emission factor from manure applied to or deposited on soil in feed production (g N2O/kg DM).
Numeric. Diet-level average nitrous oxide (N2O) emission factor from crop residues decomposition in feed production (g N2O/kg DM).
Numeric. Diet-level average methane (CH4) emission factor from rice cultivation in feed production (g CH4/kg DM).
run_gleam,
calc_co2_ration_fertilizer,
calc_co2_ration_pesticides,
calc_co2_ration_crop_activities,
calc_co2_ration_luc_nopeat,
calc_co2_ration_luc_peat,
calc_n2o_ration_fertilizer,
calc_n2o_ration_manure,
calc_n2o_ration_crop_residues,
calc_ch4_ration_rice
# Load cleaned example input from the package and compute the calculation of feed emission factors # Load table with ration shares rations_share <- data.table::fread(system.file( "extdata/run_modules_examples/feed_rations_share_chrt.csv", package = "gleam" )) # Load table with feed emission factors feed_emissions <- data.table::fread(system.file( "extdata/run_modules_examples/feed_emission_factors.csv", package = "gleam" )) # Run the code result <- run_emissions_ration_module( rations_share = rations_share, feed_emissions = feed_emissions )# Load cleaned example input from the package and compute the calculation of feed emission factors # Load table with ration shares rations_share <- data.table::fread(system.file( "extdata/run_modules_examples/feed_rations_share_chrt.csv", package = "gleam" )) # Load table with feed emission factors feed_emissions <- data.table::fread(system.file( "extdata/run_modules_examples/feed_emission_factors.csv", package = "gleam" )) # Run the code result <- run_emissions_ration_module( rations_share = rations_share, feed_emissions = feed_emissions )
Runs the full GLEAM pipeline from master herd and cohort inputs through all
modules: herd (optional), weights, ration quality, energy requirements,
manure emissions, enteric fermentation, nitrogren balance, feed emissions, allocation, and aggregation.
Common identifiers:
Several input tables share the following identifier columns. Their supported
values are listed once here and referenced throughout.
species_short — Character. Species code:
CTL: Cattle
BFL: Buffalo
SHP: Sheep
GTS: Goats
PGS: Pigs
CML: Camels
cohort_short — Character. Sex- and age-specific cohort code:
FA: adult females (from age at first parturition)
FS: sub-adult females (from weaning to age at first parturition)
FJ: juvenile females (from birth to weaning)
MA: adult males (from age at first breeding)
MS: sub-adult males (from weaning to age at first breeding)
MJ: juvenile males (from birth to weaning)
run_gleam( has_herd_structure = FALSE, cohort_level_data, herd_level_data, feed_rations, feed_params, feed_emissions, manure_management_system_fraction, manure_management_system_factors, simulation_duration = 365, global_warming_potential_set = "AR6", show_indicator = TRUE )run_gleam( has_herd_structure = FALSE, cohort_level_data, herd_level_data, feed_rations, feed_params, feed_emissions, manure_management_system_fraction, manure_management_system_factors, simulation_duration = 365, global_warming_potential_set = "AR6", show_indicator = TRUE )
has_herd_structure |
Logical. If |
cohort_level_data |
data.table. Cohort-level master input table. Required columns:
Additional columns when
Additional columns when
Optional column (both cases):
|
herd_level_data |
data.table. Herd-level master input table (one row per
Additional columns when
|
feed_rations |
data.table. Cohort-level feed ration shares, also used by
|
feed_params |
data.table. Feed nutritional parameters. Required columns:
|
feed_emissions |
data.table. Emission factors per feed component. All emission factors are expressed per kg of feed dry matter intake. Required columns:
|
manure_management_system_fraction |
data.table. Cohort-level manure
management system fractions passed to
|
manure_management_system_factors |
data.table. Emission factors and
parameters per manure management system, passed to
|
simulation_duration |
Numeric. Assessment period length (days). Used by
the demographic herd simulation (when |
global_warming_potential_set |
Character. GWP-100 conversion factors for expressing CH4 and N2O as CO2-eq. One of:
|
show_indicator |
Logical. Whether to display progress indicators during calculations.
Defaults to |
The GLEAM package implements the core computational engine of the Global Livestock Environmental Assessment Model (GLEAM), developed by the Food and Agriculture Organization of the United Nations (FAO). It provides a modular workflow for quantifying greenhouse gas emissions from livestock systems using a Life Cycle Assessment (LCA) approach based on the IPCC Tier 2 methodology.
The pipeline covers seven species (CTL, BFL, CML, SHP, GTS, PGS). Within each herd, animals are organised into six sex-age cohorts (FJ, FS, FA, MJ, MS, MA). These identifiers are used consistently across all modules.
The assessment period is specified in days via simulation_duration
(typically 365). Intermediate per-head-per-day variables are carried through
the cohort workflow and scaled to cohort and herd totals in the final
aggregation step.
If has_herd_structure = FALSE, generate herd structure with
run_demographic_herd_module; otherwise use supplied tables
directly.
Compute cohort weights (run_weights_module).
Summarise ration quality (run_ration_quality_module)
and merge into the cohort table.
Compute energy requirements and dry matter intake
(run_metabolic_energy_req_module).
Compute enteric CH4
(run_emissions_enteric_module).
Compute nitrogen balance
(run_nitrogen_balance_module).
Compute manure emissions
(run_emissions_manure_module).
Summarise feed production emissions
(run_emissions_ration_module) and merge into the cohort
table.
Compute production outputs
(run_production_module).
Compute allocation (run_allocation_module).
Aggregate to herd-level results and CO2-eq
(run_aggregation_module).
All inputs containing herd_id must refer to the same herd set.
Validation blocks variables that are expected to be produced internally.
A named list with four elements:
A cohort-level data.table containing the
original input columns plus all variables generated across the pipeline.
Calculated variables are grouped below by module.
Computed when has_herd_structure = FALSE:
Numeric. Average population size in each of the 6 sex-age cohorts (# heads). (cohorts = FJ, FS, FA, MJ, MS, MA).
Numeric. Total number of animals removed via offtake over the year, aggregated to 6 sex-age cohorts (heads/year) (cohorts = FJ, FS, FA, MJ, MS, MA).
Numeric. Total number of animals removed via offtake over the assessment period, aggregated to 6 sex-age cohorts (heads/assessment period) (cohorts = FJ, FS, FA, MJ, MS, MA).
Numeric. Mature (adult) live weight that the animal can attain under given biological and management conditions (kg).
Numeric. Live weight at the beginning of the cohort stage (kg).
Numeric. Potential final live weight attainable at the end of the cohort stage in the absence of offtake (kg). (For juveniles: equals weaning weight; For subadults: equals adult live weight; For adults: equals adult live weight)
Numeric. Live weight at slaughter for animals removed from the cohort (kg).
Numeric. Average live weight over the cohort stage. Computed by accounting for the share of offtaken animals within the cohort, using their slaughter weight, and the potential final weight of animals that remain in the cohort (kg).
Numeric. Live weight at the end of the cohort stage, accounting for both surviving and offtaken animals. Computed as a weighted average of the potential final weight of surviving animals and the slaughter weight of offtaken animals, based on the offtake rate (kg).
Numeric. Average live weight gain of the cohort over the cohort stage (kg/head/day).
Numeric. Average gross energy content of the diet (MJ/kg DM).
Numeric. Average metabolizable energy content of the diet (MJ/kg DM).
Numeric. Average nitrogen content of diet (kg N/kg DM).
Numeric. Average digestibility of the feed ration, expressed as ratio of digestible (or metabolizable, for poultry) to gross energy content (fraction).
Numeric. Fraction of feed's gross energy that is excreted in urine (fraction).
Numeric. Average ash content of feed, calculated as a fraction of the dry matter intake (kg ash/kg DM).
Expressed as net energy for CTL, BFL, SHP, GTS and as metabolizable energy for CML and PGS unless stated otherwise.
Numeric. Energy required for maintenance, defined as the amount of energy needed to keep the animal at equilibrium such that body energy is neither gained nor lost (MJ/head/day). Expressed as net energy for CTL, BFL, SHP, GTS and as metabolizable energy for CML and PGS.
Numeric. Energy required for activity, defined as the amount of energy needed to support animal movement and physical activity (MJ/head/day). Expressed as net energy for CTL, BFL, SHP, GTS and as metabolizable energy for CML and PGS.
Numeric. Energy required for growth (i.e., weight gain) (MJ/head/day). Expressed as net energy for CTL, BFL, SHP, GTS and as metabolizable energy for CML and PGS.
Numeric. Energy required for lactation (MJ/head/day). Expressed as net energy for CTL, BFL, SHP, GTS and as metabolizable energy for CML and PGS.
Numeric. Energy required for work, used to estimate the energy required for draught power for CTL, BFL and CML (MJ/head/day). Assumed to be 0 for other species. Expressed as net energy for CTL, BFL, SHP, GTS and as metabolizable energy for CML and PGS.
Numeric. Energy required for the synthesis of fibre for SHP, GTS and CML. Assumed to be 0 for other species. (MJ/head/day). Expressed as net energy for CTL, BFL, SHP, GTS and as metabolizable energy for CML and PGS (MJ/head/day).
Numeric. Energy required for pregnancy for pregnant females (MJ/head/day). Expressed as net energy for CTL, BFL, SHP, GTS and as metabolizable energy for CML and PGS.
Numeric. Ratio of net energy available for maintenance in the diet to digestible energy consumed (fraction).
Numeric. Ratio of net energy available for growth in the diet to digestible energy consumed (fraction).
Numeric. Total daily energy requirement (MJ/head/day). For CTL, BFL, SHP and GTS this is expressed as gross energy intake requirement (GE). For CML and PGS the function returns the summed daily metabolizable energy requirement.
Numeric. Average daily dry matter intake of feed (kg DM/head/day).
Numeric. Multiplicative mitigation factor applied to baseline enteric methane (CH4) emissions (dimensionless). If not provided, a default value of 1 (no mitigation) is used.
Numeric. Methane (CH4) conversion factor (ym), representing the percentage of gross energy of the feed ration that is converted to CH4 (percentage).
Numeric. Average daily enteric methane (CH4) emissions (kg CH4/head/day).
Numeric. Daily nitrogen intake (kg N/head/day).
Numeric. Daily nitrogen retention in animal body tissues and products (e.g., growth, pregnancy, milk...) (kg N/head/day).
Numeric. Daily nitrogen excretion (kg N/head/day).
Numeric. Total volatile solids (VS) excreted per animal per day, representing the organic material in livestock manure and consisting of both biodegradable and non-biodegradable fractions (kg VS/head/day).
Numeric. Methane (CH4) emissions from manure deposited on pasture (kg CH4/head/day).
Numeric. Methane (CH4) emissions from manure burned for fuel (kg CH4/head/day).
Numeric. Methane (CH4) emissions from manure management systems, excluding emissions from manure deposited on pasture and burned for fuel (kg CH4/head/day).
Numeric. Methane (CH4) emissions from manure management systems, excluding manure burned for fuel (kg CH4/head/day).
Numeric. Direct nitrous oxide (N2O) emissions from manure deposited on pasture (kg N2O/head/day).
Numeric. Direct nitrous oxide (N2O) emissions from manure burned for fuel (kg N2O/head/day).
Numeric. Direct nitrous oxide (N2O) emissions from manure management systems, excluding emissions from manure deposited on pasture and burned for fuel (kg N2O/head/day).
Numeric. Direct nitrous oxide (N2O) emissions from manure management systems, excluding emissions from manure burned for fuel (kg N2O/head/day).
Numeric. Indirect nitrous oxide (N2O) emissions resulting from atmospheric deposition of volatilised nitrogen (NH3 and NOx) from manure deposited on pasture (kg N2O/head/day).
Numeric. Indirect nitrous oxide (N2O) emissions resulting from atmospheric deposition of volatilised nitrogen (NH3 and NOx) from manure burned for fuel (kg N2O/head/day).
Numeric. Indirect nitrous oxide (N2O) emissions resulting from atmospheric deposition of volatilised nitrogen (NH3 and NOx) from manure management systems, excluding manure deposited on pasture and manure burned for fuel (kg N2O/head/day).
Numeric. Indirect nitrous oxide (N2O) emissions resulting from atmospheric deposition of volatilised nitrogen (NH3 and NOx) from manure management systems, excluding losses from manure burned for fuel (kg N2O/head/day).
Numeric. Indirect nitrous oxide (N2O) emissions resulting from leaching and runoff of manure nitrogen from manure deposited on pasture (kg N2O/head/day).
Numeric. Indirect nitrous oxide (N2O) emissions resulting from leaching and runoff of manure nitrogen from manure burned for fuel (kg N2O/head/day).
Numeric. Indirect nitrous oxide (N2O) emissions resulting from leaching and runoff of manure nitrogen from manure management systems, excluding losses from manure deposited on pasture and manure burned for fuel (kg N2O/head/day).
Numeric. Indirect nitrous oxide (N2O) emissions resulting from leaching and runoff of manure nitrogen from manure management systems, excluding losses from manure burned for fuel (kg N2O/head/day).
Numeric. Total indirect nitrous oxide (N2O) emissions from manure deposited on pasture. Includes emissions from atmospheric deposition of volatilised nitrogen (NH3 and NOx) and from leaching and runoff of manure nitrogen (kg N2O/head/day).
Numeric. Total indirect nitrous oxide (N2O) emissions originating from manure burned for fuel. Includes emissions from atmospheric deposition of volatilised nitrogen (NH3 and NOx) and from leaching and runoff of manure nitrogen (kg N2O/head/day).
Numeric. Total indirect nitrous oxide (N2O) emissions originating from manure management systems, excluding manure deposited on pasture and burned for fuel. Includes emissions from atmospheric deposition of volatilised nitrogen (NH3 and NOx) and from leaching and runoff of manure nitrogen (kg N2O/head/day).
Numeric. Total nitrous oxide emissions from manure deposited on pasture. Includes direct emissions and indirect emissions from volatilisation, leaching, and runoff (kg N2O/head/day).
Numeric. Total nitrous oxide emissions (N2O) from manure burned for fuel. Includes direct emissions and indirect emissions from volatilisation, leaching, and runoff (kg N2O/head/day).
Numeric. Total nitrous oxide (N2O) emissions from manure management systems, excluding manure deposited on pasture and manure burned for fuel. Includes direct emissions and indirect emissions from volatilisation, leaching, and runoff (kg N2O/head/day).
Numeric. Diet-level average carbon dioxide (CO2) emission factor from fertilizer manufacture in feed production (g CO2/kg DM).
Numeric. Diet-level average carbon dioxide (CO2) emission factor from pesticide manufacture in feed production (g CO2/kg DM).
Numeric. Diet-level average carbon dioxide (CO2) emission factor from on-field agricultural activities in feed production (g CO2/kg DM).
Numeric. Diet-level average carbon dioxide (CO2) emission factor from land-use change (excluding peatland drainage) in feed production (g CO2/kg DM).
Numeric. Diet-level average carbon dioxide (CO2) emission factor from peatland drainage in feed production (g CO2/kg DM).
Numeric. Diet-level average nitrous oxide (N2O) emission factor from fertilizer use in feed production (g N2O/kg DM).
Numeric. Diet-level average nitrous oxide (N2O) emission factor from manure applied to or deposited on soil in feed production (g N2O/kg DM).
Numeric. Diet-level average nitrous oxide (N2O) emission factor from crop residues decomposition in feed production (g N2O/kg DM).
Numeric. Diet-level average methane (CH4) emission factor from rice cultivation in feed production (g CH4/kg DM).
Numeric. Total milk production produced over the assessment period (kg/cohort/assessment period).
Numeric. Total milk protein production produced over the assessment period (kg protein/cohort/assessment period).
Numeric. Total fat-protein-corrected milk (FPCM) produced over the assessment period (kg/cohort/assessment period).
Numeric. Total fibre produced over the assessment period by cohort (kg/cohort/assessment period).
Numeric. Total meat produced as live weight over the assessment period by cohort (kg/cohort/assessment period).
Numeric. Total meat as carcass weight (excluding organs, and other by-products after dressing) produced over the assessment period by cohort (kg/cohort/assessment period).
Numeric. Total bone-free-meat (excluding bones, organs, and other by-products after dressing and bone removal) produced over the assessment period by cohort (kg/cohort/assessment period).
Numeric. Total meat protein (excluding bones, organs, and other by-products after dressing and bone removal) produced over the assessment period by cohort (kg protein/cohort/assessment period).
Numeric. Energy required to produce total milk output by cohort (MJ/cohort/assessment period). Non-zero values are applicable only to milk-producing species and cohorts (species = CTL, BFL, CML, SHP, GTS; cohorts = FA). All other species-cohort combinations are assigned a value of 0.
Numeric. Energy required by a given sex-age cohort for total meat output by cohort during the assessment period, equal to the energy needed to produce all live-weight gain to reach the target slaughter weight (MJ/cohort/assessment period).
Numeric. Energy required to produce all fibre output by cohort (MJ/cohort/assessment period).
Numeric. Energy required to provide all draught power (traction/work) by cohort (MJ/cohort/assessment period).
Numeric. Energy required for egg production over the assessment period (MJ/cohort/assessment period). Currently set to 0.
A herd-level data.table. When
has_herd_structure = FALSE, the output from
run_demographic_herd_module, including:
Numeric. Annualized growth rate at which the herd reaches steady state (fraction).
When has_herd_structure = TRUE, the supplied
herd_level_data is returned unchanged.
A herd-level data.table in long format with
one row per herd commodity emission
source:
Character. Herd identifier.
Character. Species code.
Character. Emission variable name (e.g.
"ch4_enteric", "n2o_manure_pasture_direct").
Character. Commodity category: one of
"None", "Milk", "Meat", "Fibre",
"Work", "Eggs".
Character. "Edible" or
"Non-Edible".
Numeric. Allocation share for this commodity-emission combination (fraction).
A named list from
run_aggregation_module with elements
results_emissions, results_feed,
results_production, and results_nitrogen. These tables
summarise herd-level emissions, feed intake, production, and nitrogen
balance, all scaled to the assessment duration.
run_demographic_herd_module,
run_weights_module,
run_ration_quality_module,
run_metabolic_energy_req_module,
run_emissions_enteric_module,
run_nitrogen_balance_module,
run_emissions_manure_module,
run_emissions_ration_module,
run_production_module,
run_allocation_module,
run_aggregation_module
# Example 1: You do NOT have herd structure — use cohort input for herd simulation. # Pipeline runs herd simulation first, then the rest of the pipeline. path_run_gleam_examples <- system.file("extdata/run_gleam_examples", package = "gleam") master_chrt_lvl_no_structure_dt <- data.table::fread(file.path( path_run_gleam_examples, "master_chrt_lvl_no_structure_data.csv" )) master_hrd_lvl_dt <- data.table::fread( file.path(path_run_gleam_examples, "master_hrd_lvl_data.csv") ) feed_rations_chrt_dt <- data.table::fread( file.path(path_run_gleam_examples, "feed_rations_share_chrt.csv") ) feed_params_dt <- data.table::fread(system.file( "extdata/run_gleam_examples/feed_quality.csv", package = "gleam" )) feed_emissions_dt <- data.table::fread(system.file( "extdata/run_gleam_examples/feed_emission_factors.csv", package = "gleam" )) manure_management_system_fraction_dt <- data.table::fread( file.path(path_run_gleam_examples, "manure_management_system_fraction.csv") ) manure_management_system_factors_dt <- data.table::fread( file.path(path_run_gleam_examples, "manure_management_system_factors.csv") ) results <- run_gleam( has_herd_structure = FALSE, cohort_level_data = master_chrt_lvl_no_structure_dt, herd_level_data = master_hrd_lvl_dt, feed_rations = feed_rations_chrt_dt, feed_params = feed_params_dt, feed_emissions = feed_emissions_dt, manure_management_system_fraction = manure_management_system_fraction_dt, manure_management_system_factors = manure_management_system_factors_dt, simulation_duration = 365 ) print(results$cohort_level_results) print(results$allocation_long) # Example 2: You already HAVE herd structure — use cohort table and skip herd simulation. # Pipeline skips herd simulation and uses this as the starting cohort table. path_run_gleam_examples <- system.file("extdata/run_gleam_examples", package = "gleam") master_chrt_lvl_structure_dt <- data.table::fread(file.path( path_run_gleam_examples, "master_chrt_lvl_structure_data.csv" )) master_hrd_lvl_dt <- data.table::fread( file.path(path_run_gleam_examples, "master_hrd_lvl_data.csv") ) feed_rations_chrt_dt <- data.table::fread( file.path(path_run_gleam_examples, "feed_rations_share_chrt.csv") ) feed_params_dt <- data.table::fread(system.file( "extdata/run_gleam_examples/feed_quality.csv", package = "gleam" )) feed_emissions_dt <- data.table::fread(system.file( "extdata/run_gleam_examples/feed_emission_factors.csv", package = "gleam" )) manure_management_system_fraction_dt <- data.table::fread( file.path(path_run_gleam_examples, "manure_management_system_fraction.csv") ) manure_management_system_factors_dt <- data.table::fread( file.path(path_run_gleam_examples, "manure_management_system_factors.csv") ) results <- run_gleam( has_herd_structure = TRUE, cohort_level_data = master_chrt_lvl_structure_dt, herd_level_data = master_hrd_lvl_dt, feed_rations = feed_rations_chrt_dt, feed_params = feed_params_dt, feed_emissions = feed_emissions_dt, manure_management_system_fraction = manure_management_system_fraction_dt, manure_management_system_factors = manure_management_system_factors_dt, simulation_duration = 365, global_warming_potential_set = "AR6" ) print(results$cohort_level_results) print(results$allocation_long)# Example 1: You do NOT have herd structure — use cohort input for herd simulation. # Pipeline runs herd simulation first, then the rest of the pipeline. path_run_gleam_examples <- system.file("extdata/run_gleam_examples", package = "gleam") master_chrt_lvl_no_structure_dt <- data.table::fread(file.path( path_run_gleam_examples, "master_chrt_lvl_no_structure_data.csv" )) master_hrd_lvl_dt <- data.table::fread( file.path(path_run_gleam_examples, "master_hrd_lvl_data.csv") ) feed_rations_chrt_dt <- data.table::fread( file.path(path_run_gleam_examples, "feed_rations_share_chrt.csv") ) feed_params_dt <- data.table::fread(system.file( "extdata/run_gleam_examples/feed_quality.csv", package = "gleam" )) feed_emissions_dt <- data.table::fread(system.file( "extdata/run_gleam_examples/feed_emission_factors.csv", package = "gleam" )) manure_management_system_fraction_dt <- data.table::fread( file.path(path_run_gleam_examples, "manure_management_system_fraction.csv") ) manure_management_system_factors_dt <- data.table::fread( file.path(path_run_gleam_examples, "manure_management_system_factors.csv") ) results <- run_gleam( has_herd_structure = FALSE, cohort_level_data = master_chrt_lvl_no_structure_dt, herd_level_data = master_hrd_lvl_dt, feed_rations = feed_rations_chrt_dt, feed_params = feed_params_dt, feed_emissions = feed_emissions_dt, manure_management_system_fraction = manure_management_system_fraction_dt, manure_management_system_factors = manure_management_system_factors_dt, simulation_duration = 365 ) print(results$cohort_level_results) print(results$allocation_long) # Example 2: You already HAVE herd structure — use cohort table and skip herd simulation. # Pipeline skips herd simulation and uses this as the starting cohort table. path_run_gleam_examples <- system.file("extdata/run_gleam_examples", package = "gleam") master_chrt_lvl_structure_dt <- data.table::fread(file.path( path_run_gleam_examples, "master_chrt_lvl_structure_data.csv" )) master_hrd_lvl_dt <- data.table::fread( file.path(path_run_gleam_examples, "master_hrd_lvl_data.csv") ) feed_rations_chrt_dt <- data.table::fread( file.path(path_run_gleam_examples, "feed_rations_share_chrt.csv") ) feed_params_dt <- data.table::fread(system.file( "extdata/run_gleam_examples/feed_quality.csv", package = "gleam" )) feed_emissions_dt <- data.table::fread(system.file( "extdata/run_gleam_examples/feed_emission_factors.csv", package = "gleam" )) manure_management_system_fraction_dt <- data.table::fread( file.path(path_run_gleam_examples, "manure_management_system_fraction.csv") ) manure_management_system_factors_dt <- data.table::fread( file.path(path_run_gleam_examples, "manure_management_system_factors.csv") ) results <- run_gleam( has_herd_structure = TRUE, cohort_level_data = master_chrt_lvl_structure_dt, herd_level_data = master_hrd_lvl_dt, feed_rations = feed_rations_chrt_dt, feed_params = feed_params_dt, feed_emissions = feed_emissions_dt, manure_management_system_fraction = manure_management_system_fraction_dt, manure_management_system_factors = manure_management_system_factors_dt, simulation_duration = 365, global_warming_potential_set = "AR6" ) print(results$cohort_level_results) print(results$allocation_long)
Calculates cohort-level daily energy requirements (MJ/head/day) and ration dry matter intake (kg DM/head/day) by applying the IPCC Tier 2 energy partitioning functions.
run_metabolic_energy_req_module( cohort_level_data, herd_level_data, show_indicator = TRUE )run_metabolic_energy_req_module( cohort_level_data, herd_level_data, show_indicator = TRUE )
cohort_level_data |
data.table. Cohort-level input table with the following data requirement:
|
herd_level_data |
data.table. Herd-level input table (one row per
|
show_indicator |
Logical. Whether to display progress indicators during simulation.
Defaults to |
This function joins cohort_level_data with herd_level_data by herd_id,
uses species_short directly for all species-specific energy calculations,
and computes IPCC Tier 2 energy partition components and derived feed intake metrics by cohort.
Energy requirements are expressed as:
Net energy for CTL, BFL, SHP, GTS.
Metabolizable energy for CML and PGS.
This function represents the intermediate module of the Global Livestock Environmental
Assessment Model (GLEAM) computational pipeline run_gleam() to estimate
animals' metabolic energy requirements and dry matter intake and performs the following calculation sequence:
Maintenance energy is computed using calc_metabolic_energy_req_maintenance.
Activity energy is computed using calc_metabolic_energy_req_activity.
Growth energy is computed using calc_metabolic_energy_req_growth.
Lactation energy is computed using calc_metabolic_energy_req_lactation.
Work energy is computed using calc_metabolic_energy_req_work.
Fibre production energy is computed using calc_metabolic_energy_req_fibre.
Pregnancy energy is computed using calc_metabolic_energy_req_pregnancy.
Diet net energy ratios are computed using calc_rem_maintenance and
calc_reg_growth (ruminants only).
Total daily energy requirement is computed using
calc_total_metabolic_energy_req.
Daily dry matter intake is computed using calc_ration_intake.
A data.table with the original cohort-level input columns plus the following new variables:
Numeric. Energy required for maintenance, defined as the amount of energy needed to keep the animal at equilibrium such that body energy is neither gained nor lost. Expressed as net energy for CTL, BFL, SHP, GTS and as metabolizable energy for CML and PGS (MJ/head/day).
Numeric. Energy required for activity, defined as the amount of energy needed to support animal movement and physical activity (MJ/head/day). Expressed as net energy for CTL, BFL, SHP, GTS and as metabolizable energy for CML and PGS.
Numeric. Energy required for growth (i.e., weight gain) (MJ/head/day). Expressed as net energy for CTL, BFL, SHP, GTS and as metabolizable energy for CML and PGS.
Numeric. Energy required for lactation (MJ/head/day). Expressed as net energy for CTL, BFL, SHP, GTS and as metabolizable energy for CML and PGS.
Numeric. Energy required for work, used to estimate the energy required for draught power for CTL, BFL and CML (MJ/head/day). Assumed to be 0 for other species. Expressed as net energy for CTL, BFL, SHP, GTS and as metabolizable energy for CML and PGS.
Numeric. Energy required for the synthesis of fibre for SHP, GTS and CML. Assumed to be 0 for other species. (MJ/head/day). Expressed as net energy for CTL, BFL, SHP, GTS and as metabolizable energy for CML and PGS (MJ/head/day).
Numeric. Energy required for pregnancy for pregnant females (MJ/head/day). Expressed as net energy for CTL, BFL, SHP, GTS and as metabolizable energy for CML and PGS.
Numeric. Ratio of net energy available for maintenance in the diet to digestible energy consumed (fraction).
Numeric. Ratio of net energy available for growth in the diet to digestible energy consumed (fraction).
Numeric. Total daily energy requirement (MJ/head/day). For CTL, BFL, SHP and GTS this is expressed as gross energy intake requirement (GE). For CML and PGS the function returns the summed daily metabolizable energy requirement.
Numeric. Average daily dry matter intake of feed (kg DM/head/day).
run_gleam,
calc_metabolic_energy_req_maintenance,
calc_metabolic_energy_req_activity,
calc_metabolic_energy_req_growth,
calc_metabolic_energy_req_lactation,
calc_metabolic_energy_req_work,
calc_metabolic_energy_req_fibre,
calc_metabolic_energy_req_pregnancy,
calc_rem_maintenance,
calc_reg_growth,
calc_total_metabolic_energy_req,
calc_ration_intake
# Load metabolic energy requirements inputs (cohort and herd-level) metabolic_energy_req_chrt_dt <- data.table::fread(system.file( "extdata/run_modules_examples/metabolic_energy_req_input_chrt_data.csv", package = "gleam" )) metabolic_energy_req_hrd_dt <- data.table::fread(system.file( "extdata/run_modules_examples/metabolic_energy_req_input_hrd_data.csv", package = "gleam" )) # Run metabolic energy requirement and rations calculations results <- run_metabolic_energy_req_module( cohort_level_data = metabolic_energy_req_chrt_dt, herd_level_data = metabolic_energy_req_hrd_dt )# Load metabolic energy requirements inputs (cohort and herd-level) metabolic_energy_req_chrt_dt <- data.table::fread(system.file( "extdata/run_modules_examples/metabolic_energy_req_input_chrt_data.csv", package = "gleam" )) metabolic_energy_req_hrd_dt <- data.table::fread(system.file( "extdata/run_modules_examples/metabolic_energy_req_input_hrd_data.csv", package = "gleam" )) # Run metabolic energy requirement and rations calculations results <- run_metabolic_energy_req_module( cohort_level_data = metabolic_energy_req_chrt_dt, herd_level_data = metabolic_energy_req_hrd_dt )
Calculates cohort-level daily nitrogen intake, retention, and excretion (kg N/head/day) by applying IPCC Tier 2 approach.
run_nitrogen_balance_module( cohort_level_data, herd_level_data, show_indicator = TRUE )run_nitrogen_balance_module( cohort_level_data, herd_level_data, show_indicator = TRUE )
cohort_level_data |
data.table. Cohort-level input table with the following data requirement:
|
herd_level_data |
data.table. Herd-level input table (one row per
|
show_indicator |
Logical. Whether to display progress indicators during simulation.
Defaults to |
This function represents the intermediate module of the Global Livestock Environmental
Assessment Model (GLEAM) computational pipeline run_gleam() to compute the nitrogen balance.
The function joins cohort_level_data with herd_level_data by herd_id,
uses species_short directly for all species-specific nitrogen balance calculations,
and computes cohort-level nitrogen balance components following the IPCC Tier 2 structure.
The following calculation sequence is applied:
Daily nitrogen intake is computed using calc_nitrogen_intake
from ration_intake and ration_nitrogen.
Daily nitrogen retention is computed using calc_nitrogen_retention
from cohort-level and herd-level species parameters.
Daily nitrogen excretion is computed using calc_nitrogen_excretion
as intake minus retention (species-specific validation applied).
A data.table with the original cohort-level input columns plus the following new variables:
Numeric. Daily nitrogen intake (kg N/head/day).
Numeric. Daily nitrogen retention in animal body tissues and products (e.g., growth, pregnancy, milk...) (kg N/head/day)
Numeric. Daily nitrogen excretion (kg N/head/day).
run_gleam,
calc_nitrogen_intake,
calc_nitrogen_retention,
calc_nitrogen_excretion
# Load nitrogen balance inputs (cohort and herd-level) nitrogen_balance_chrt_dt <- data.table::fread(system.file( "extdata/run_modules_examples/nitrogen_balance_input_chrt_data.csv", package = "gleam" )) nitrogen_balance_hrd_dt <- data.table::fread(system.file( "extdata/run_modules_examples/nitrogen_balance_input_hrd_data.csv", package = "gleam" )) # Run nitrogen balance calculations results <- run_nitrogen_balance_module( cohort_level_data = nitrogen_balance_chrt_dt, herd_level_data = nitrogen_balance_hrd_dt )# Load nitrogen balance inputs (cohort and herd-level) nitrogen_balance_chrt_dt <- data.table::fread(system.file( "extdata/run_modules_examples/nitrogen_balance_input_chrt_data.csv", package = "gleam" )) nitrogen_balance_hrd_dt <- data.table::fread(system.file( "extdata/run_modules_examples/nitrogen_balance_input_hrd_data.csv", package = "gleam" )) # Run nitrogen balance calculations results <- run_nitrogen_balance_module( cohort_level_data = nitrogen_balance_chrt_dt, herd_level_data = nitrogen_balance_hrd_dt )
Calculates cohort-level production outputs over the assessment period by combining cohort-level herd structure inputs with herd-level production parameters. The function returns milk, fibre, and meat outputs for each cohort.
run_production_module( cohort_level_data, herd_level_data, simulation_duration = 365, show_indicator = TRUE )run_production_module( cohort_level_data, herd_level_data, simulation_duration = 365, show_indicator = TRUE )
cohort_level_data |
data.table. Cohort-level input table (one row per herd-cohort) with the following data requirement:
|
herd_level_data |
data.table. Herd-level input table (one row per
|
simulation_duration |
Numeric. Length of the assessment period (days). |
show_indicator |
Logical. Whether to display progress indicators during simulation.
Defaults to |
This function represents the intermediate module of the Global Livestock Environmental
Assessment Model (GLEAM) computational pipeline run_gleam() to estimate meat, milk and fibre
production outputs from livestock and performs the following calculation sequence:
Milk outputs are computed using calc_milk_production
Fibre outputs are computed using calc_fibre_production
Meat outputs are computed using calc_meat_production
For species/cohorts where milk or fibre production is not applicable, outputs are returned as zero.
A data.table with the original cohort-level input columns plus the following new variables:
Numeric. Total milk production produced over the assessment period (kg/cohort/assessment period).
Numeric. Total milk protein production produced over the assessment period (kg protein/cohort/assessment period).
Numeric. Total fat-protein-corrected milk (FPCM) produced over the assessment period (kg/cohort/assessment period).
Numeric. Total fibre produced over the assessment period by cohort (kg /cohort/assessment period).
Numeric . Total meat produced as live weight over the assessment period by cohort (kg/cohort/assessment period).
Numeric. Total meat as carcass weight (excluding organs, and other by-products after dressing) produced over the assessment period by cohort (kg/cohort/assessment period).
Numeric. Total bone-free-meat (excluding bones, organs, and other by-products after dressing and bone removal) produced over the assessment period by cohort (kg/cohort/assessment period).
Numeric. Total meat protein (excluding bones, organs, and other by-products after dressing and bone removal) produced over the assessment period by cohort (kg protein/cohort/assessment period).
run_gleam,
calc_milk_production,
calc_fibre_production,
calc_meat_production
# Load production inputs (cohort and herd-level) production_chrt_dt <- data.table::fread(system.file( "extdata/run_modules_examples/production_input_chrt_data.csv", package = "gleam" )) production_hrd_dt <- data.table::fread(system.file( "extdata/run_modules_examples/production_input_hrd_data.csv", package = "gleam" )) # Run production calculations results <- run_production_module( cohort_level_data = production_chrt_dt, herd_level_data = production_hrd_dt, simulation_duration = 365 )# Load production inputs (cohort and herd-level) production_chrt_dt <- data.table::fread(system.file( "extdata/run_modules_examples/production_input_chrt_data.csv", package = "gleam" )) production_hrd_dt <- data.table::fread(system.file( "extdata/run_modules_examples/production_input_hrd_data.csv", package = "gleam" )) # Run production calculations results <- run_production_module( cohort_level_data = production_chrt_dt, herd_level_data = production_hrd_dt, simulation_duration = 365 )
Calculates cohort-level diet nutritional metrics (gross and metabolizable energy content, digestibility, nitrogen content, urinary energy losses, and ash content) from cohort-level feed ration composition shares and feed component nutrient parameters.
run_ration_quality_module(rations_share, feed_params, show_indicator = TRUE)run_ration_quality_module(rations_share, feed_params, show_indicator = TRUE)
rations_share |
data.table. Cohort-level feed ration composition shares with the following minimum data requirement:
|
feed_params |
data.table. Feed nutritional parameters with the following minimum data requirement:
|
show_indicator |
Logical. Whether to display progress indicators during calculations.
Defaults to |
This function represents the intermediate module of the Global Livestock Environmental
Assessment Model (GLEAM) computational pipeline run_gleam() to estimate the nutritional
quality of the feed ration.
This function joins rations_share with feed_params by feed_id,
uses species_short directly, and computes ration-weighted nutritional
metrics by cohort.
The following calculation sequence is applied:
Species-specific digestibility ratios are computed from energy parameters
and feed_gross_energy using calc_feed_digestibility_fraction.
Contributions of each feed component are computed as ration-weighted values:
gross energy using calc_ration_gross_energy
nitrogen using calc_ration_nitrogen_content
digestibility using calc_ration_digestibility
metabolizable energy using calc_ration_metabolizable_energy
urinary energy fraction using calc_ration_urinary_energy_fraction
ash using calc_ration_ash
Cohort-level nutritional metrics are obtained for the whole feed ration by summing contributions across
feed components within each herd_id, species_short, and cohort_short.
data.table. Cohort-level nutritional metrics summarized by herd_id,
species_short, and cohort_short with the following columns:
Numeric. Average gross energy content of the diet (MJ/kg DM).
Numeric. Average metabolizable energy content of the diet (MJ/kg DM).
Numeric. Average nitrogen content of diet (kg N/kg DM).
Numeric. Average digestibility of the feed ration, expressed as ratio of digestible to gross energy content (fraction).
Numeric. Fraction of feed's gross energy that is excreted in urine (fraction).
Numeric. Average ash content of feed, calculated as a fraction of the dry matter intake (kg ash/kg DM).
run_gleam,
calc_feed_digestibility_fraction,
calc_ration_gross_energy,
calc_ration_nitrogen_content,
calc_ration_digestibility,
calc_ration_metabolizable_energy,
calc_ration_urinary_energy_fraction,
calc_ration_ash
# Load feed rations inputs (cohort-level shares and feed parameters) feed_rations_chrt_dt <- data.table::fread(system.file( "extdata/run_modules_examples/feed_rations_share_chrt.csv", package = "gleam" )) feed_params_dt <- data.table::fread(system.file( "extdata/run_modules_examples/feed_quality.csv", package = "gleam" )) result <- run_ration_quality_module( rations_share = feed_rations_chrt_dt, feed_params = feed_params_dt )# Load feed rations inputs (cohort-level shares and feed parameters) feed_rations_chrt_dt <- data.table::fread(system.file( "extdata/run_modules_examples/feed_rations_share_chrt.csv", package = "gleam" )) feed_params_dt <- data.table::fread(system.file( "extdata/run_modules_examples/feed_quality.csv", package = "gleam" )) result <- run_ration_quality_module( rations_share = feed_rations_chrt_dt, feed_params = feed_params_dt )
Calculates cohort-level live weight metrics by combining cohort-level inputs with herd-level biological parameters. The function appends cohort weights (initial, potential final, slaughter), then derives average and final live weights accounting for offtake, and finally computes average daily live weight gain over each cohort stage.
run_weights_module(cohort_level_data, herd_level_data, show_indicator = TRUE)run_weights_module(cohort_level_data, herd_level_data, show_indicator = TRUE)
cohort_level_data |
A
|
herd_level_data |
A
|
show_indicator |
Logical. Whether to display progress indicators during calculations.
Defaults to |
This function represents the intermediate module of the Global Livestock Environmental
Assessment Model (GLEAM) computational pipeline run_gleam() to estimate animals' live
weight and is composed of the following steps:
Cohort-stage weight assignment using calc_cohort_weights.
Herd-level biological parameters are matched to each cohort row by
herd_id via data.table joins.
Calculation of average and final live weights (accounting for offtake) using
calc_avg_weights.
Calculation of average daily live weight gain using
calc_daily_weight_gain.
A named list with two data.tables:
The input cohort_level_data with these
additional columns:
Numeric. Mature (adult) live weight that the animal can attain under given biological and management conditions (kg).
Numeric. Live weight at the beginning of the cohort stage (kg).
Numeric. Potential final live weight attainable at the end of the cohort stage in the absence of offtake (kg). (For juveniles: equals weaning weight; For subadults: equals adult live weight; For adults: equals adult live weight)
Numeric. Live weight at slaughter for animals removed from the cohort (kg).
Numeric. Average live weight over the cohort stage. Computed by accounting for the share of offtaken animals within the cohort, using their slaughter weight, and the potential final weight of animals that remain in the cohort (kg).
Numeric. Live weight at the end of the cohort stage, accounting for both surviving and offtaken animals. Computed as a weighted average of the potential final weight of surviving animals and the slaughter weight of offtaken animals, based on the offtake rate (kg).
Numeric. Average live weight gain of the cohort over the cohort stage (kg/head/day).
A copy of the input herd_level_data.
run_gleam,
calc_cohort_weights,
calc_avg_weights,
calc_daily_weight_gain,
# Load weights inputs (cohort- and herd-level) weights_chrt_dt <- data.table::fread(system.file( "extdata/run_modules_examples/weights_input_chrt_data.csv", package = "gleam" )) weights_hrd_dt <- data.table::fread(system.file( "extdata/run_modules_examples/weights_input_hrd_data.csv", package = "gleam" )) # Run weight calculations results <- run_weights_module( cohort_level_data = weights_chrt_dt, herd_level_data = weights_hrd_dt ) # Access results print(results$cohort_level_results) print(results$herd_level_results)# Load weights inputs (cohort- and herd-level) weights_chrt_dt <- data.table::fread(system.file( "extdata/run_modules_examples/weights_input_chrt_data.csv", package = "gleam" )) weights_hrd_dt <- data.table::fread(system.file( "extdata/run_modules_examples/weights_input_hrd_data.csv", package = "gleam" )) # Run weight calculations results <- run_weights_module( cohort_level_data = weights_chrt_dt, herd_level_data = weights_hrd_dt ) # Access results print(results$cohort_level_results) print(results$herd_level_results)