Livestock & Grazing¶
Overview¶
The livestock module models animal product production (meat, dairy, eggs) through two distinct production systems:
Grazing-based: Animals feed on managed grasslands
Feed-based: Animals consume crops as concentrated feed
Animal Products¶
The model includes seven major animal product categories configured in config/default.yaml:
animal_products:
include:
- meat-cattle
- meat-pig
- meat-chicken
- dairy
- eggs
- dairy-buffalo
- meat-sheep
# Feed conversion efficiency mode (how much feed is required per unit product)
# Source: Wirsenius (2000) regional feed energy requirements
# Options:
# - List of regions: average efficiencies across those regions (all countries use same values)
# - null: use country-specific regional efficiencies based on geographic mapping
# Available regions: East Asia, East Europe, Latin America & Caribbean,
# North Africa & West Asia, North America & Oceania, South & Central Asia,
# Sub-Saharan Africa, West Europe
feed_efficiency_regions:
- North America & Oceania
- West Europe
# Ruminant net-to-metabolizable energy conversion efficiency factors
# Used to convert net energy (NE) requirements to metabolizable energy (ME) requirements
# Based on NRC (2000) typical values for mixed diets
# ME_required = NE_m/k_m + NE_g/k_g (+ NE_l/k_l for dairy)
# TODO: Should check the reference for this.
net_to_metabolizable_energy_conversion:
k_m: 0.60 # Maintenance efficiency
k_g: 0.40 # Growth efficiency
k_l: 0.60 # Lactation efficiency (dairy)
# Carcass-to-retail meat conversion factors
carcass_to_retail_meat:
meat-cattle: 0.67 # kg boneless retail beef per kg carcass (OECD-FAO 2023)
meat-pig: 0.73 # kg boneless retail pork per kg carcass (OECD-FAO 2023)
meat-chicken: 0.60 # kg boneless retail chicken per kg carcass (OECD-FAO 2023)
eggs: 1.00 # No conversion needed (whole egg = retail product)
dairy: 1.00 # No conversion needed (whole milk = retail product)
meat-sheep: 0.63 # kg boneless retail lamb per kg carcass (slightly lower than beef)
dairy-buffalo: 1.00 # No conversion needed (whole milk = retail product)
# FAOSTAT QCL item names to aggregate for each model product.
# First item is the primary product; additional items are proxied species
# whose production is lumped into the model product.
faostat_items:
dairy:
- "Raw milk of cattle"
- "Raw milk of goats" # proxy: goat milk → dairy
- "Raw milk of sheep" # proxy: sheep milk → dairy
- "Raw milk of camel" # proxy: camel milk → dairy
meat-cattle:
- "Meat of cattle with the bone, fresh or chilled"
- "Meat of buffalo, fresh or chilled" # proxy: buffalo → cattle
meat-pig:
- "Meat of pig with the bone, fresh or chilled"
meat-chicken:
- "Meat of chickens, fresh or chilled"
- "Meat of ducks, fresh or chilled" # proxy: duck → chicken
- "Meat of turkeys, fresh or chilled" # proxy: turkey → chicken
- "Meat of pigeons and other birds n.e.c., fresh, chilled or frozen"
eggs:
- "Hen eggs in shell, fresh"
dairy-buffalo:
- "Raw milk of buffalo"
meat-sheep:
- "Meat of sheep, fresh or chilled"
- "Meat of goat, fresh or chilled" # proxy: goat → sheep
feed_proxy_map:
dairy-buffalo: dairy
meat-sheep: meat-cattle
feed_efficiency_calibration:
enabled: true
generate: false
source: "data/curated/feed_efficiency_calibration.csv"
max_multiplier: 2.0
scenario: "default" # Which scenario's solved model to generate calibration from
residue_crops:
- banana
- barley
- chickpea
- cowpea
- dry-pea
- dryland-rice
- foxtail-millet
- gram
- maize
- oat
- pearl-millet
- phaseolus-bean
- pigeonpea
- rye
- sorghum
- sugarcane
- wetland-rice
- wheat
grazing:
enabled: true
isimip_utilization_rate: 0.50 # Applied to ISIMIP yields in merge step
forage_overlap_subtraction_alpha: 0.0 # Subtract alpha * modeled forage-crop supply from LUIcube grass supply by country
forage_overlap_crops:
- alfalfa
- silage-maize
- biomass-sorghum
grassland_forage_calibration:
enabled: true
generate: false
source: "data/curated/grassland_forage_calibration.csv"
scenario: "default"
Each product can be produced via either production system, with different feed requirements and efficiencies.
Production Systems¶
Grazing-Based Production¶
Concept: Animals graze on managed grasslands, converting grass biomass to animal products.
- Inputs:
Land (per region and resource class, similar to cropland)
Managed grassland yields from ISIMIP LPJmL model
- Process:
Grassland yields (t dry matter/ha/year) are computed per region and resource class
Feed conversion ratios translate grass biomass → animal products
Land allocation to grazing competes with cropland expansion
Configuration: Enable/disable grazing with grazing.enabled: true
Feed-Based Production¶
Concept: Animals consume crops (grains, soybeans, etc.) as concentrated feed.
- Inputs:
Crops from crop production buses
Feed conversion ratios (kg crop → kg animal product)
- Process:
Crops are allocated to animal feed (competing with direct human consumption)
Feed conversion links transform crop inputs to animal products
Multiple crops can contribute (e.g., maize + soybean for poultry)
Grassland Yields¶
Grazing supply is determined by managed grassland yields from the ISIMIP LPJmL historical simulation.
Data Source¶
Dataset: ISIMIP2b managed grassland yields (historical)
Resolution: 0.5° × 0.5° gridded annual yields
Variable: Above-ground dry matter production (t/ha/year)
Processing: workflow/scripts/build_grassland_yields.py
Aggregation follows the same resource class structure as crops:
Load grassland yield NetCDF
Aggregate by (region, resource_class) using area-weighted means
Output CSV with yields in t/ha/year
Pasture Utilization¶
The model assumes that only a portion of the total grassland biomass production is available for grazing livestock. This reflects the need to leave biomass for regrowth, soil protection, and ecosystem function (“take half, leave half” principle). The correction is applied upstream in the merge_grassland_yields step so that the yield column in the merged output is already effective feed yield:
LUIcube rows: yield is multiplied by the per-cell
grazing_intensityfrom LUIcube data.ISIMIP rows: yield is multiplied by a fixed utilization rate (default 50%).
Parameter:
grazing.isimip_utilization_ratein configuration (applied to ISIMIP fallback yields).
This value is consistent with the GLOBIOM model, which assumes a 50% grazing efficiency for grass in native grasslands [3]. While intensive dairy systems can achieve higher utilization (up to 70-80%), global rangeland management guidelines typically recommend utilization rates below 50% to prevent degradation.
Global distribution of managed grassland yield potential (tonnes dry matter per hectare per year) from ISIMIP LPJmL historical simulations¶
Feed Conversion¶
The model uses feed conversion ratios to link feed inputs to animal outputs, with explicit categorization by feed quality to enable accurate CH₄ emissions tracking.
Feed System Architecture¶
The feed system uses seven distinct feed pools that combine animal type with feed quality:
Ruminant pools:
ruminant_roughage,ruminant_forage,ruminant_grain,ruminant_proteinMonogastric pools:
monogastric_low_quality,monogastric_grain,monogastric_protein
This categorization enables the model to:
Differentiate methane emissions using GLEAM feed digestibility classes (roughage/forage vs. grain/protein)
Route crops, residues, and processing byproducts to appropriate feed pools based on nutritional properties
Model production system choices (e.g., roughage-dominated beef vs. high-grain finishing rations)
Distinguish between grazing (grassland) and confinement feeding systems for nitrogen management
Feed Properties (Generated from GLEAM)¶
Feed properties (digestibility, metabolizable energy, protein content) are automatically generated from GLEAM 3.0 data during workflow execution. The workflow produces two files in processing/{name}/:
ruminant_feed_properties.csv: Properties for all feeds used by ruminantsmonogastric_feed_properties.csv: Properties for all feeds used by monogastrics
Each file contains:
feed_item: Item name (e.g., “maize”, “wheat-bran”)source_type: Either “crop” or “food” (byproduct)digestibility: Digestible fraction (0-1)ME_MJ_per_kg_DM: Metabolizable energy (MJ per kg dry matter)CP_pct_DM: Crude protein (% of dry matter)ash_pct_DM: Ash content (% of dry matter)NDF_pct_DM: Neutral detergent fiber (% of dry matter)
These properties are extracted from the GLEAM 3.0 supplement using data/curated/gleam_feed_mapping.csv to map between model feed items and GLEAM feed categories.
Feed quality categories (assigned based on nitrogen content and digestibility):
Ruminant feeds:
Protein: High nitrogen content (>50 g N/kg DM) - protein meals such as rapeseed-meal, oilseed-meal, soybean meal (assigned by N content; takes precedence over digestibility)
Roughage: Low digestibility (<0.55), high-fiber forages (crop residues, straw)
Forage: Medium digestibility (0.55-0.70), improved forages and grassland (silage maize, alfalfa, pasture)
Grain: High digestibility (0.70-0.90), energy concentrates (maize, wheat, barley)
Monogastric feeds:
Protein: High nitrogen content (>35 g N/kg DM) - protein meals such as soybean meal, fish meal, rapeseed-meal (assigned by N content; takes precedence over energy)
Low quality: Low metabolizable energy (<11 MJ/kg DM), bulky feeds and byproducts
Grain: Medium energy (11-15.5 MJ/kg DM), cereal grains
Energy: High energy (>15.5 MJ/kg DM), fats and high-energy feeds
Categorization logic: Both ruminant and monogastric feeds prioritize nitrogen content to identify protein feeds, ensuring high-protein oilseed meals are correctly classified regardless of digestibility. For feeds below the nitrogen threshold, ruminants use digestibility ranges while monogastrics use metabolizable energy thresholds.
Byproducts from food processing (with source_type=food) are automatically excluded from human consumption and can only be used as animal feed.
Feed Conversion Efficiencies¶
Feed conversion efficiencies (tonnes retail product per tonne feed DM) are generated automatically from Wirsenius (2000) regional feed energy requirements combined with GLEAM 3.0 feed category energy values.
Proxy Products: Buffalo milk (dairy-buffalo) and sheep meat (meat-sheep) use cattle feed requirements as proxies, since Wirsenius (2000) does not provide separate regional estimates for these products. Buffalo milk inherits dairy cattle parameters, while sheep meat inherits beef cattle parameters with adjustments for the different carcass-to-retail conversion factor (0.63 for sheep vs 0.67 for cattle).
In this calculation, we have to account for the following units: * Feed inputs: Dry matter (tonnes DM) * Animal product outputs: Fresh weight, retail meat (tonnes fresh weight)
For meats: retail/edible meat weight (boneless, trimmed) - NOT carcass weight
For dairy: whole milk (fresh weight)
For eggs: whole eggs (fresh weight)
Wirsenius (2000) [1] provides feed requirements per kg carcass weight (dressed, bone-in). We apply carcass-to-retail conversion factors to obtain feed requirements per kg retail meat, from OECD-FAO Agricultural Outlook 2023-2032, Box 6.1 [2]:
Cattle meat: 0.67 kg boneless retail per kg carcass
Sheep meat: 0.63 kg boneless retail per kg carcass
Pig meat: 0.73 kg boneless retail per kg carcass
Chicken meat: 0.60 kg boneless retail per kg carcass
Eggs, dairy, & buffalo milk: 1.00 (no conversion, already retail products)
Generation workflow:
Regional feed energy requirements from Wirsenius (2000) provide MJ per kg carcass output for eight world regions
Carcass-to-retail conversion: Convert MJ per kg carcass → MJ per kg retail meat
For meats: ME_retail = ME_carcass / carcass_to_retail_factor
For dairy/eggs: No conversion (already retail products)
Energy conversion for ruminants: Net energy (NE) requirements converted to metabolizable energy (ME) using NRC (2000) efficiency factors:
k_m = 0.60 (maintenance)
k_g = 0.40 (growth)
k_l = 0.60 (lactation)
Feed category energy content from GLEAM 3.0 provides ME (MJ per kg DM) for each feed quality category
Efficiency calculation: efficiency = ME_feed / ME_retail (tonnes retail product per tonne feed DM)
Output: processing/{name}/feed_to_animal_products_uncalibrated.csv with columns:
country: ISO 3166-1 alpha-3 country codeproduct: Product name (e.g., “meat-cattle”, “dairy”)feed_category: Feed pool (e.g.,ruminant_forage,ruminant_grain,monogastric_grain)efficiency: Feed conversion efficiency (t product / t feed DM)notes: Description with inverse feed requirement
Configuration: The feed_efficiency_regions setting controls how feed conversion efficiencies are assigned:
animal_products:
# Option 1: Average specific regions (all countries use same values)
feed_efficiency_regions:
- North America & Oceania
- West Europe
# Option 2: Use country-specific regional values (set to null)
# feed_efficiency_regions: null
Available regions (from Wirsenius 2000): East Asia, East Europe, Latin America & Caribbean, North Africa & West Asia, North America & Oceania, South & Central Asia, Sub-Saharan Africa, West Europe
When feed_efficiency_regions is null, each country uses the feed conversion efficiencies from its geographic region. The mapping from countries to Wirsenius regions is defined in data/curated/country_wirsenius_region.csv.
Example efficiencies (North America & Oceania + West Europe average, with carcass-to-retail conversion):
Cattle meat from forage: ~0.026 t/t (~38 t DM feed per tonne retail beef)
Cattle meat from grain: ~0.035 t/t (~28 t DM feed per tonne retail beef)
Dairy from forage: ~0.480 t/t (~2.1 t DM feed per tonne milk)
Pig meat from grain: ~0.110 t/t (~9.1 t DM feed per tonne retail pork)
Chicken meat from grain: ~0.226 t/t (~4.4 t DM feed per tonne retail chicken)
Note: Carcass-to-retail conversion increases feed requirements per kg retail meat by ~33-50% compared to per kg carcass, reflecting bone removal and trimming losses.
This structure allows modeling different production systems for the same product (grass-fed vs. grain-finished beef, pasture vs. intensive dairy, etc.).
Regional Feed Energy Requirements¶
Feed requirements vary significantly by region due to differences in production systems, genetics, and environmental conditions. Wirsenius (2000) [1] provides estimated feed energy requirements per unit of commodity output:
Commodity |
Unit |
East Asia |
East Europe |
Latin America & Carib. |
North Africa & W. Asia |
North America & Oc. |
South & Central Asia |
Sub- Saharan Africa |
West Europe |
|---|---|---|---|---|---|---|---|---|---|
Cattle milk & cow carcass (MJ per kg whole milk & carcass as-is) |
NE_l NE_m NE_g |
8.2 2.3 0.46 |
8.2 1.3 0.45 |
11 1.9 0.30 |
12 2.0 0.32 |
5.3 1.1 0.50 |
11 2.5 0.32 |
23 5.4 0.70 |
5.6 1.3 0.52 |
Dairy bulls & heifers carcass (MJ per kg carcass as-is) |
NE_m NE_g |
187 22 |
47 14 |
143 24 |
130 21 |
53 16 |
344 19 |
211 20 |
41 16 |
Beef carcass (MJ per kg carcass as-is) |
NE_m NE_g |
288 25 |
141 19 |
236 28 |
262 23 |
109 23 |
479 20 |
352 21 |
103 23 |
Pig carcass (MJ per kg carcass-side as-is) |
ME |
86 |
84 |
131 |
86 |
65 |
115 |
123 |
64 |
Eggs & hen carcass (MJ per kg whole egg & carcass as-is) |
ME |
43 |
42 |
39 |
43 |
32 |
53 |
56 |
30 |
Meat-type chicken carcass (MJ per kg eviscerated carcass as-is) |
ME |
60 |
56 |
51 |
61 |
42 |
72 |
77 |
38 |
- Energy types:
NE_l: Net energy for lactation (dairy production)
NE_m: Net energy for maintenance (basic metabolism)
NE_g: Net energy for growth (body mass gain)
ME: Metabolizable energy (for monogastrics)
- Notes:
Values calculated from productivity estimates in Wirsenius (2000) Table 3.8
Regional variation reflects differences in production systems, breed genetics, climate, and management practices
Sub-Saharan Africa shows significantly higher requirements due to less intensive production systems
North America and Western Europe have lowest requirements, reflecting highly optimized industrial systems
Baseline Feed Intake¶
To ground the livestock module in observed feed flows, the model constructs a country-level baseline from GLEAM 2.0 (Mottet et al. 2017 [4]) that describes how much dry-matter feed of each category each animal product consumed in the reference year. In validation mode this baseline can pin the model to observed feed mixes; in optimisation runs it serves as a reference point for comparison with solved results.
The script workflow/scripts/prepare_feed_baseline.py produces
processing/{name}/feed_baseline_uncalibrated.csv.
Data Sources¶
GLEAM 2.0 SI Table 2 (
data/curated/gleam_tables/gleam_2_0_si2_global_livestock_feed_intake.csv): Global dry-matter feed intake by species (Cattle & buffaloes, Small Ruminants, Poultry, Pigs), production system (Grazing, Mixed, Feedlots, Layers, Broilers, Backyard, Intermediate, Industrial), and feed type (Roughages, Cereal grains, Brans, Soybean cakes, Oil seed cakes, Other edible, Other non-edible, Swill). Totals are reported separately for OECD and Non-OECD country groups.GLEAM 2.0 SI Tables 4–5 (
gleam_2_0_si4_dairy_cattle_composition.csv,gleam_2_0_si5_beef_cattle_composition.csv): Percentage breakdown of ruminant roughage into components (fresh grass, hay, legumes & silage, crop residues, etc.) by GLEAM region, used to decompose the aggregate “Roughages” entry into model-specific feed pools.FAOSTAT QCL: National animal product output for 2010 (the GLEAM reference year), the model’s configured reference year (
validation.production_year), and the calibration year (validation.gleam_calibration_year). Used to disaggregate GLEAM totals to individual countries, scale the baseline forward in time, and calibrate the efficiency correction.Wirsenius (2000) [1]_ feed energy requirements: Regional metabolizable energy demand per unit of product output, used to split feed between co-products in multi-product production systems.
Disaggregation Pipeline¶
Global GLEAM totals are converted to a country × product × feed-category matrix through seven sequential steps.
Step 1 — Country disaggregation
GLEAM Table 2 reports totals for OECD and Non-OECD groups. Each country is assigned to one group, and its share of the group’s total species-level output in 2010 (from FAOSTAT) determines how much of the group’s feed is allocated to it:
Step 2 — Product split for multi-product systems
Several GLEAM systems serve more than one model product simultaneously: cattle Grazing and Mixed systems supply dairy, dairy-buffalo, and meat-cattle; poultry Backyard systems supply both eggs and meat-chicken. Feed is allocated between co-products in proportion to their energy demand, using ME requirements from Wirsenius (2000):
Countries with no reported production for a co-product fall back to equal sharing.
Step 3 — Roughage decomposition
GLEAM Table 2 lumps all ruminant roughage into a single “Roughages” entry. SI Tables 4 and 5 supply regional percentage breakdowns of this roughage into specific components. These percentages are applied to country-level roughage totals and the components are mapped to model feed categories:
Roughage component |
Model feed category |
|---|---|
Fresh grass, Hay |
|
Legumes and silage |
|
Crop residues, Sugarcane tops |
|
Leaves (tree leaves/browse) |
|
Dairy and dairy-buffalo products use Table 4 (dairy cattle composition); meat-cattle and meat-sheep use Table 5 (beef cattle composition).
Tree leaves and forest browse are mapped to ruminant_roughage but
tracked separately via the exogenous_mt_dm column, since the model
has no endogenous production route for these feeds.
Step 4 — Mapping remaining GLEAM feed types
Swill (food waste recycled as animal feed) is mapped to
monogastric_low_quality for monogastrics and ruminant_grain for
ruminants, with the full amount marked as exogenous since swill is not
produced endogenously by the model.
Feed types other than “Roughages” and “Swill” (handled above) are mapped
to model feed categories via a two-step chain: each GLEAM SI2 feed type is
first mapped to a representative model feed item, and that item’s
category is then looked up from the authoritative
ruminant_feed_mapping.csv / monogastric_feed_mapping.csv produced by
the categorize_feeds rule. This avoids a second hardcoded source of
truth for feed categorisation.
GLEAM feed type |
Rum. item |
Rum. category |
Mono. item |
Mono. category |
|---|---|---|---|---|
Cereal grains |
maize |
|
maize |
|
2nd grade grain |
— |
— |
maize |
|
Brans, spent brewer & biofuel grains |
wheat-bran |
|
wheat-bran |
|
Soybean cakes |
oilseed-meal |
|
oilseed-meal |
|
Other oil seed cakes |
rapeseed-meal |
|
rapeseed-meal |
|
Other edible |
sugarbeet |
|
cassava |
|
Other non-edible |
barley |
|
wheat-bran |
|
Step 5 — Scaling to the reference year and normalization
The GLEAM baseline reflects 2010 conditions. Country- and product-level feed intakes are scaled to the configured reference year using FAO production trends:
After scaling, totals within each OECD/Non-OECD group are normalized to match the scaled GLEAM group total, correcting for countries with incomplete FAOSTAT coverage.
Step 6 — Efficiency calibration
The production-based scaling in Step 5 assumes constant feed conversion efficiency, but efficiencies improved between 2010 and the reference year. GLEAM 3.0 (FAO 2023 [5]) reports a global feed total of approximately 6.2 Gt DM for its 2015 baseline, whereas naively scaling the 6.0 Gt DM GLEAM 2.0 total (2010) by production growth predicts a substantially higher figure—roughly 6.7 Gt for 2015.
The pipeline calibrates against this known data point. First, a constant-efficiency prediction for the calibration year is computed using species-level production growth from FAOSTAT:
The ratio of the known GLEAM 3.0 total to this naive prediction yields the cumulative efficiency improvement at the calibration year. Assuming a constant annual rate, the correction for the reference year is:
All feed values are multiplied by this correction factor. The two
configuration keys validation.gleam_calibration_year (default: 2015) and
validation.gleam_calibration_total_gt_dm (default: 6.2) control the
calibration data point.
Step 7 — Production-based feed scaling
After scaling to the reference year and applying the efficiency calibration, the pipeline rescales feed quantities per (country, product) so that the implied animal output matches FAOSTAT production data. This preserves GLEAM’s feed composition (the relative split across feed categories) while correcting absolute feed levels to observed production:
The efficiencies used here are the uncalibrated values from
feed_to_animal_products_uncalibrated.csv. Scale factors outside the
range [0.3, 3.0] are logged as potential data inconsistencies in the GLEAM
disaggregation (e.g., a mismatch between GLEAM’s regional feed totals and
FAOSTAT’s country-level production data). If FAOSTAT reports zero production
for a (country, product) pair, all feed is set to zero; if the implied
production is zero but FAOSTAT is positive, the scale factor defaults to 1.0
and a warning is logged.
Output¶
processing/{name}/feed_baseline_uncalibrated.csv contains one row per
(country, product, feed category) combination:
country: ISO 3166-1 alpha-3 country codeproduct: Animal product (dairy,dairy-buffalo,meat-cattle,meat-sheep,eggs,meat-chicken,meat-pig)feed_category: Feed pool (e.g.,ruminant_forage,ruminant_grain,monogastric_protein)feed_use_mt_dm: Dry-matter feed consumption (Mt DM) in the reference yearexogenous_mt_dm: Portion of feed demand that must be supplied exogenously (Mt DM) — tree leaves/browse for ruminants and swill for monogastrics
All (country, product, feed category) combinations are always present, including zeros, so every animal production link in the model has an explicit baseline entry.
When feed efficiency calibration is enabled (see Calibration),
the calibrated baseline is written to
processing/{name}/feed_baseline.csv and the calibrated efficiencies to
processing/{name}/feed_to_animal_products.csv.
Model Integration¶
The baseline participates in the model in two distinct ways:
Validation mode: When
validation.enforce_baseline_feed: true, the baseline feed quantities are imposed as equality constraints on the model, fixing the feed mix to GLEAM-derived estimates. This removes a degree of freedom and is useful for diagnosing supply-side inconsistencies—any imbalance shows up as feed slack (see Feed Breakdown).Optimisation mode: The model is free to choose any feed mix within the bounds set by available supply and feed conversion efficiencies. The baseline is not enforced but is available for post-hoc comparison with solved solutions.
Exogenous Feed Supply¶
Some GLEAM feed types have no endogenous supply route in the model:
Tree leaves/browse (~100–150 Mt DM globally): Forest browse consumed by ruminants, mapped to
ruminant_roughage.Swill (~75 Mt DM globally): Food waste recycled as pig/poultry feed, mapped to
monogastric_low_quality(orruminant_grainfor ruminants).
These are tracked in the exogenous_mt_dm column of the baseline and
supplied via exogenous_feed generators on the corresponding feed buses
(named supply:exogenous_{category}:{country}).
In validation mode, these generators are fixed at the baseline amount (forced dispatch). In optimisation mode, they are extendable up to the baseline amount at zero marginal cost, allowing the solver to use them if beneficial but not requiring it.
Calibration¶
The uncalibrated baseline and feed efficiencies inevitably produce supply–demand gaps when tested in the full model: missing feed sources, regional mismatches between grassland output and ruminant forage demand, and approximate feed conversion efficiencies all contribute. The calibration pipeline uses a validation solve to diagnose these gaps via slack variables and compute corrections. Two independent calibration systems address different gap sources.
Feed Efficiency Calibration¶
Feed efficiency calibration adjusts feed conversion efficiencies upward in (country, feed-category) combinations where the validation solve reveals positive feed slack — i.e. where the model cannot supply enough feed through its endogenous routes.
Algorithm (implemented in
workflow/scripts/compute_feed_efficiency_calibration.py):
Solve the model with uncalibrated inputs and
validation.enforce_baseline_feed: true. The solved model containsslack_positive_feedgenerators on each feed bus.Extract positive feed slack per (country, feed_category) from the solved network.
Compute the calibration multiplier:
\[\begin{split}\begin{aligned} \text{supply}_{c,f} &= \text{baseline}_{c,f} - \text{slack}_{c,f} \\[6pt] \text{multiplier}_{c,f} &= \min\!\left( \frac{\text{baseline}_{c,f}}{\text{supply}_{c,f}},\; \text{max_multiplier} \right) \end{aligned}\end{split}\]where \(\text{max_multiplier}\) (default 2.0) caps extreme adjustments.
Apply to efficiencies: \(\text{efficiency}_\text{cal} = \text{efficiency}_\text{uncal} \times \text{multiplier}\)
Adjust baseline feed quantities to preserve implied production:
\[\text{adj}_{c,p} = \frac{\sum_f \text{feed}_{c,p,f} \times \text{eff}_\text{uncal}} {\sum_f \text{feed}_{c,p,f} \times \text{eff}_\text{cal}}\]This ensures that the calibrated baseline still implies the same animal output as the uncalibrated version.
The calibration step is carried out by
workflow/scripts/apply_feed_calibration.py, which writes the calibrated
files feed_baseline.csv and feed_to_animal_products.csv.
Configuration:
animal_products:
feed_efficiency_calibration:
enabled: true # Apply pre-computed calibration
generate: false # Set true to trigger generation from a solve
source: "data/curated/feed_efficiency_calibration.csv"
max_multiplier: 2.0 # Cap on per-(country, category) multiplier
scenario: "default" # Scenario whose solved model is used
The figure below should be read as a diagnostic view of where feed
efficiency assumptions were too strict in the uncalibrated system. Each dot
is a (country, feed-category) pair that needed an upward adjustment
(multiplier != 1), with marker size proportional to that country’s animal
production volume in the category. The right-side x/total labels show how
many countries in each category were adjusted.
Feed efficiency calibration multipliers by category and country. The reference line at 1.0 marks “no adjustment”; values to the right indicate upward efficiency corrections required to remove positive feed slack in the validation solve.¶
Grassland Forage Calibration¶
Grassland forage calibration addresses mismatches between grassland output and ruminant forage demand that persist after feed efficiency calibration. In some countries grassland yields exceed forage demand (surplus), while in others demand exceeds what grasslands can supply (deficit).
Algorithm (implemented in
workflow/scripts/compute_grassland_calibration.py):
Solve the model with calibrated feed efficiencies but uncalibrated grassland parameters.
Per country, extract forage slack from
feed:ruminant_forage:{country}buses:Negative slack (surplus): grassland output exceeds forage demand. Reduce effective yield:
\[\text{yield_correction}_c = \frac{\max(0,\; \text{output}_c - \text{surplus}_c)}{\text{output}_c}\]Positive slack (deficit): forage demand exceeds grassland output. Supply the gap via an exogenous forage source:
\[\text{exogenous_forage}_c = \text{deficit}_c\]
yield_correction(in [0, 1]) scales grassland yields downward;exogenous_forage_mt_dmadds an external forage supply for countries where grassland alone cannot meet ruminant forage requirements.
Configuration:
grazing:
grassland_forage_calibration:
enabled: true # Apply pre-computed calibration
generate: false # Set true to trigger generation from a solve
source: "data/curated/grassland_forage_calibration.csv"
scenario: "default" # Scenario whose solved model is used
This second figure complements the feed-efficiency plot by separating
grassland-specific calibration effects. yield_correction is one-sided:
values run from 0 to 1 and only reduce effective grassland yield (never
increase it). Countries with forage deficits are additionally flagged via
hatching, indicating reliance on exogenous_forage_mt_dm after endogenous
grassland supply is exhausted.
Grassland forage calibration by country. Colour indicates the
yield_correction factor applied to grassland yields (1.0 = no
adjustment; lower values = stronger downward correction). Countries
receiving exogenous forage (exogenous_forage_mt_dm > 0) are marked with
hatching.¶
Taken together, the two figures show that calibration corrects two distinct issues: feed conversion mismatches across feed categories (first figure) and country-level forage balance mismatches in grassland systems (second figure).
Calibration Pipeline¶
The two calibration systems run sequentially within the Snakemake workflow. The pipeline avoids circular dependencies by defining dedicated scenarios whose effective configuration disables the calibration being computed:
Phase 1 — Feed efficiency calibration: The
uncalibratedscenario setsfeed_efficiency_calibration.enabled: falseandgrassland_forage_calibration.enabled: false. Building and solving this scenario produces the uncalibrated model from which feed slack is extracted.compute_feed_efficiency_calibrationwrites the multipliers to the configuredsourcepath (by defaultdata/curated/feed_efficiency_calibration.csv).Phase 2 — Grassland forage calibration: The
feed_calibratedscenario applies feed efficiency calibration but setsgrassland_forage_calibration.enabled: false. Building and solving this scenario produces a model with calibrated efficiencies from which forage slack is extracted.compute_grassland_calibrationwrites yield corrections and exogenous forage amounts to the configuredsourcepath (by defaultdata/curated/grassland_forage_calibration.csv).Phase 3 — Calibrated model: All other scenarios (including
default) apply both calibrations.apply_feed_calibrationreads the pre-computed multipliers and writes the calibratedfeed_baseline.csvandfeed_to_animal_products.csv.
Pre-computed calibration files are stored under data/curated/ so they
can be reused across configurations without re-running the validation
solves. Set generate: true in the relevant configuration block to
re-generate them (requires a full validation solve).
Model Implementation¶
In workflow/scripts/build_model.py, livestock production is represented as multi-bus links:
Grazing Links¶
- Inputs:
bus0: Grassland (land bus for region/class)
- Outputs:
bus1: Ruminant forage feed pool (feed_ruminant_forage)bus2: CO₂ emissions from land-use change (if configured)
Efficiency: Grassland yield (t DM/ha)
Grassland production is routed to the feed_ruminant_forage pool, alongside legumes and silage from crop-based forage. Manure management for all ruminant feed categories uses Mixed LPS parameters.
Note
Validation runs that set validation.use_actual_production: true also pin grassland production to present-day managed areas. The dataset processing/{name}/luc/current_grassland_area_by_class.csv is derived from the land-cover fractions prepared for LUC calculations and caps each grazing link at the observed area, forcing the solver to reproduce current grazing output.
In standard optimisation runs, current grassland is split into two pools per region/resource class: land:existing_grassland_convertible:* (cropland-suitable) and land:existing_grassland_marginal:* (grazing-only). The total current grassland comes from build_current_grassland_area, while build_grazing_only_land provides the marginal subset. All hectares from both pools flow into the land:pasture:* pool via existing_grassland_to_pasture links. Grassland production links consume from that pooled pasture bus, together with land supplied from existing cropland and new conversion.
When demand falls and grazing links release land, spare_existing_grassland_* links allow the model to rewild formerly grazed hectares and credit the associated CO₂ removal using the same LUC emission factors that apply to cropland-suitable land.
Crop Residue Feed Supply¶
Crop residues (e.g., straw, stover, pulse haulms) are now generated explicitly using the new Snakemake rule build_crop_residue_yields:
Configuration: Select residue crops via
animal_products.residue_cropsinconfig/default.yaml. Only crops present inconfig.cropsare processed.Data sources: - GLEAM Supplement S1 Table S.3.1 (slope/intercept) and Tables 3.3 / 3.6 (FUE factors) - GLEAM feed codes → model mapping in
data/curated/gleam_feed_mapping.csvOutputs: Per-crop CSVs at
processing/{name}/crop_residue_yields/{crop}.csvwith net dry-matter residue yields (t/ha) by region, resource class, and water supply.Integration:
build_modelreads all residue CSVs, addsresidue_{feed_item}_{country}buses, and attaches them as additional outputs on crop production links. Residues flow through the same feed supply logic as crops/foods and enter the appropriate feed pools or soil incorporation.
Residue Removal Limits for Feed¶
To maintain soil health and prevent land degradation, the model constrains the fraction of crop residues that can be removed for animal feed. The majority of residues must be left on the field and incorporated into the soil to maintain organic matter and nutrient cycling.
Constraint formulation:
Maximum feed removal: 30% of generated residues (configurable via
residues.max_feed_fraction; override per ISO3 country or M49 region/sub-region viaresidues.max_feed_fraction_by_regionwith country > sub-region > region)Minimum soil incorporation: 70% of generated residues
The optimization model implements this as a constraint between residue feed use and soil incorporation for each residue type and country:
With the default 30% limit:
This ensures that for every 3 units of residue used as feed, at least 7 units are incorporated into the soil. The constraint is applied during model solving (in solve_model.py) after the network structure is built.
Environmental implications: Residues incorporated into soil generate direct N₂O emissions according to the IPCC EF1 emission factor applied to their nitrogen content (see Environmental Impacts). The model therefore balances:
Feed benefits: Residues reduce demand for dedicated feed crops (reducing land use and associated emissions)
Soil incorporation costs: Incorporated residues produce N₂O emissions but maintain soil health
Feed Supply Links¶
The add_feed_supply_links() function creates links from crops, crop residues, and food byproducts to the seven feed pools:
- Item-to-Feed-Pool Links:
Inputs: Crop, residue, or food byproduct buses (
bus0)Outputs: One of eight feed pool buses (
bus1) - Ruminants:feed_ruminant_roughage,feed_ruminant_forage,feed_ruminant_grain,feed_ruminant_protein- Monogastrics:feed_monogastric_low_quality,feed_monogastric_grain,feed_monogastric_proteinEfficiency: 1.0 (feed buses are in tonnes dry matter intake; digestibility is applied later in feed-to-animal efficiencies and emissions)
Routing: Each feed item is mapped via
processing/{name}/ruminant_feed_mapping.csvandprocessing/{name}/monogastric_feed_mapping.csv(generated bycategorize_feeds.py) to the relevant pool(s)Crops compete between human consumption, food processing, and animal feed use; residues and byproducts are exclusive to feed use
- Example flow:
Wheat grain →
feed_ruminant_grain+feed_monogastric_grain(digestibility from GLEAM)Wheat straw (residue) →
feed_ruminant_roughage(low digestibility)Wheat bran (byproduct) →
feed_ruminant_grain+feed_monogastric_low_quality
Feed-to-Animal-Product Links¶
The add_feed_to_animal_product_links() function converts feed pools to animal products with CH₄ emissions:
- Feed-Pool-to-Product Links:
Inputs: Feed pool bus (
bus0, e.g.,feed_ruminant_forage)Outputs:
Animal product bus (
bus1, e.g.,food_cattle_meat)CH₄ emissions bus (
bus2) - all animal products
Efficiency: Feed conversion ratio (tonnes product per tonne feed DM)
CH₄ calculation: Combines enteric fermentation (ruminants) and manure management (all animals)
\[\text{CH}_4\text{/t feed} = \text{MY}_\text{enteric} + \text{MY}_\text{manure}\]where methane yields (MY) are in kg CH₄ per kg dry matter intake.
- Example: Grass-fed beef from forage feed with enteric MY 23.3 g/kg and manure MY 2.2 g/kg:
Total CH₄ = 23.3 + 2.2 = 25.5 g CH₄ per kg feed DM
For 1 tonne feed → 0.0255 t CH₄ emissions
See Emissions from Livestock for detailed methodology and data sources.
Emissions from Livestock¶
Livestock production generates significant greenhouse gas emissions from two primary sources:
Enteric fermentation (CH₄): Ruminants produce methane through digestive fermentation
Manure management (CH₄, N₂O): All livestock produce emissions from manure storage and handling
For detailed methodology, data sources, and IPCC calculations, see Environmental Impacts (sections on Enteric Fermentation (CH₄) and Manure Management (CH₄)).
Enteric Fermentation (CH₄)¶
Ruminants (cattle, sheep) produce methane through digestive fermentation. The model uses IPCC Tier 2 methodology based on methane yields (MY) per unit dry matter intake (DMI).
Summary¶
Enteric fermentation produces CH₄ in ruminants during digestion
Methane yield (MY) varies by feed quality (roughage > forage > grain > protein)
Model uses IPCC Tier 2 methodology with feed-specific emission factors
See Enteric Fermentation (CH₄) for full details
Data Sources¶
data/curated/ipcc_enteric_methane_yields.csv: IPCC methane yields by feed categoryprocessing/{name}/ruminant_feed_categories.csv: Feed categories with MY values (generated from GLEAM 3.0 data)
Manure Management (CH₄, N₂O)¶
All livestock produce emissions from manure storage, handling, and application:
CH₄: From anaerobic decomposition (especially liquid systems like lagoons)
N₂O: From nitrogen in manure (direct and indirect emissions)
Manure CH₄ emissions are calculated for all animal products (ruminants and monogastrics) and combined with enteric emissions in the model. See Manure Management (CH₄) for full methodology.
Production Costs¶
The model incorporates livestock production costs to represent the economic considerations of animal farming beyond feed and land costs. Costs include labor, veterinary services, energy, housing, and other operational expenses, while excluding feed (modeled endogenously) and land rent (implicit opportunity cost).
Livestock costs are applied as marginal costs on feed-to-product conversion links in the optimization model. The costs are sourced from USDA (United States) and FADN (European Union) agricultural accounting data, processed to per-tonne product costs, then converted to per-tonne feed costs using feed conversion efficiencies.
Grazing costs are handled separately from general livestock production costs. These costs represent the economic expenses specific to pasture-based feed production and are applied directly to grassland feed links rather than animal production links.
For comprehensive details on production cost data sources, processing methodology, and model application, see:
Production Costs - Complete documentation of all production costs (crops, livestock, and grazing)
The livestock-specific sections include:
Data sources: USDA and FADN livestock cost data
Processing methodology: Allocation by output value, yield calculations, and unit conversions
Grazing costs: Separation, processing, and application to grassland feed
Model application: How costs are applied as marginal costs on production links
Quick reference for livestock cost workflow:
retrieve_usda_animal_costs: Processes USDA livestock cost data (US)retrieve_fadn_animal_costs: Processes FADN livestock cost data (EU)merge_animal_costs: Combines sources and applies fallback mappingsOutput:
processing/{name}/animal_costs.csvwith columns:product: Animal product namecost_per_mt_usd_{base_year}: Production cost excluding grazing (USD/tonne)grazing_cost_per_mt_usd_{base_year}: Grazing-specific cost (USD/tonne)
Configuration Parameters¶
animal_products:
include:
- meat-cattle
- meat-pig
- meat-chicken
- dairy
- eggs
- dairy-buffalo
- meat-sheep
# Feed conversion efficiency mode (how much feed is required per unit product)
# Source: Wirsenius (2000) regional feed energy requirements
# Options:
# - List of regions: average efficiencies across those regions (all countries use same values)
# - null: use country-specific regional efficiencies based on geographic mapping
# Available regions: East Asia, East Europe, Latin America & Caribbean,
# North Africa & West Asia, North America & Oceania, South & Central Asia,
# Sub-Saharan Africa, West Europe
feed_efficiency_regions:
- North America & Oceania
- West Europe
# Ruminant net-to-metabolizable energy conversion efficiency factors
# Used to convert net energy (NE) requirements to metabolizable energy (ME) requirements
# Based on NRC (2000) typical values for mixed diets
# ME_required = NE_m/k_m + NE_g/k_g (+ NE_l/k_l for dairy)
# TODO: Should check the reference for this.
net_to_metabolizable_energy_conversion:
k_m: 0.60 # Maintenance efficiency
k_g: 0.40 # Growth efficiency
k_l: 0.60 # Lactation efficiency (dairy)
# Carcass-to-retail meat conversion factors
carcass_to_retail_meat:
meat-cattle: 0.67 # kg boneless retail beef per kg carcass (OECD-FAO 2023)
meat-pig: 0.73 # kg boneless retail pork per kg carcass (OECD-FAO 2023)
meat-chicken: 0.60 # kg boneless retail chicken per kg carcass (OECD-FAO 2023)
eggs: 1.00 # No conversion needed (whole egg = retail product)
dairy: 1.00 # No conversion needed (whole milk = retail product)
meat-sheep: 0.63 # kg boneless retail lamb per kg carcass (slightly lower than beef)
dairy-buffalo: 1.00 # No conversion needed (whole milk = retail product)
# FAOSTAT QCL item names to aggregate for each model product.
# First item is the primary product; additional items are proxied species
# whose production is lumped into the model product.
faostat_items:
dairy:
- "Raw milk of cattle"
- "Raw milk of goats" # proxy: goat milk → dairy
- "Raw milk of sheep" # proxy: sheep milk → dairy
- "Raw milk of camel" # proxy: camel milk → dairy
meat-cattle:
- "Meat of cattle with the bone, fresh or chilled"
- "Meat of buffalo, fresh or chilled" # proxy: buffalo → cattle
meat-pig:
- "Meat of pig with the bone, fresh or chilled"
meat-chicken:
- "Meat of chickens, fresh or chilled"
- "Meat of ducks, fresh or chilled" # proxy: duck → chicken
- "Meat of turkeys, fresh or chilled" # proxy: turkey → chicken
- "Meat of pigeons and other birds n.e.c., fresh, chilled or frozen"
eggs:
- "Hen eggs in shell, fresh"
dairy-buffalo:
- "Raw milk of buffalo"
meat-sheep:
- "Meat of sheep, fresh or chilled"
- "Meat of goat, fresh or chilled" # proxy: goat → sheep
feed_proxy_map:
dairy-buffalo: dairy
meat-sheep: meat-cattle
feed_efficiency_calibration:
enabled: true
generate: false
source: "data/curated/feed_efficiency_calibration.csv"
max_multiplier: 2.0
scenario: "default" # Which scenario's solved model to generate calibration from
residue_crops:
- banana
- barley
- chickpea
- cowpea
- dry-pea
- dryland-rice
- foxtail-millet
- gram
- maize
- oat
- pearl-millet
- phaseolus-bean
- pigeonpea
- rye
- sorghum
- sugarcane
- wetland-rice
- wheat
grazing:
enabled: true
isimip_utilization_rate: 0.50 # Applied to ISIMIP yields in merge step
forage_overlap_subtraction_alpha: 0.0 # Subtract alpha * modeled forage-crop supply from LUIcube grass supply by country
forage_overlap_crops:
- alfalfa
- silage-maize
- biomass-sorghum
grassland_forage_calibration:
enabled: true
generate: false
source: "data/curated/grassland_forage_calibration.csv"
scenario: "default"
Disabling grazing (enabled: false) forces all animal products to come from feed-based systems or imports, useful for exploring intensification scenarios.
Workflow Rules¶
- build_grassland_yields
Input: ISIMIP grassland yield NetCDF, resource classes, regions
Output:
processing/{name}/grassland_yields.csvScript:
workflow/scripts/build_grassland_yields.py
- prepare_feed_baseline
Input: GLEAM SI tables, FAOSTAT QCL, feed mappings, uncalibrated efficiencies
Output:
processing/{name}/feed_baseline_uncalibrated.csvScript:
workflow/scripts/prepare_feed_baseline.py
- apply_feed_calibration
Input: Uncalibrated baseline and efficiencies, calibration multipliers
Output:
processing/{name}/feed_baseline.csv,processing/{name}/feed_to_animal_products.csvScript:
workflow/scripts/apply_feed_calibration.py
- compute_feed_efficiency_calibration
Input: Solved network (uncalibrated scenario), uncalibrated baseline and efficiencies
Output:
data/curated/feed_efficiency_calibration.csvScript:
workflow/scripts/compute_feed_efficiency_calibration.py
- compute_grassland_calibration
Input: Solved network (feed-calibrated scenario)
Output:
data/curated/grassland_forage_calibration.csvScript:
workflow/scripts/compute_grassland_calibration.py
Livestock production is then integrated into the build_model rule using the grassland yields and feed conversion CSVs.