Skip to content

Overview of modules

CIBUSmod is built in a modular fashion, with independent modules handling different parts of the calculations, The modules are organised into “main modules”, which store all model output, and “management (mgmt) modules” that perform specific calculations without storing output data. The flowchart below provides an overview of all main modules (green) and some of the central mgmt modules (blue) and how they are interconnected. When running the model each module is calculated in consecutive order by calling its .calculate() method. The modules need to be run in a specific order, which is indicated by numbers in brackets in the flow chart.

Tip

It is possible to zoom and pan in the flowcharts by holding down the Alt or Option () key.


%%{init: {
  "flowchart": {
    "nodeSpacing": 10,
    "rankSpacing": 20,
    "padding": 3,
    "curve": "linear"
  },
  "themeVariables": {
    "fontSize": "12px"
  }
}}%%


graph TD
  R["<b>(1) Regions</b>"]:::mod_main
  DAC["<b>(2) DemandAndConversions</b>"]:::mod_main
  CP["<b>(3) CropProduction</b>"]:::mod_main
  AH["<b>(4) AnimalHerd</b>"]:::mod_main

  FD["<b>(5) FeedDistributor</b>"]:::mod_opt

  CPsc["<b>CropProduction</b>.scale()"]:::mod_main
  AHsc["<b>AnimalHerd</b>.scale()"]:::mod_main
  FM["<b>(6) FeedMgmt</b>"]:::mod_mgmt
  MM["<b>(7) ManureMgmt</b>"]:::mod_mgmt
  WAC["<b>(8) WasteAndCircularity</b>"]:::mod_main
  PNM["<b>(9) PlantNutrientMgmt</b>"]:::mod_mgmt


  R --> dR1["Index for
  crops (crop, prod_system, region) and animals (sepcies, breed, sub_system, prod_system, region)"]:::data
  R --> dR2["x0_crp, x0_ani, max_land_use, etc."]:::data
  DAC --> dDAC1["Demand for crop_prod, animal_prod and generated by_prod"]:::data
  DAC --> dDAC2["Diets, imports/exports, waste, etc."]:::data

  CP --> dCP1["crop_prod per x_crp"]:::data
  AH --> dAH1["animal_prod per x_ani"]:::data

  FD --> dFD1["x_crp"]:::data
  FD --> dFD2["x_ani"]:::data
  FD --> dFD3["x_fds"]:::data

  AHsc --> dAH2["Animal heads, slaughter, etc."]:::data
  CPsc --> dCP2["Crop areas, etc."]:::data

  FM --> dFM["Feed demand, composition, enteric CH4, etc."]:::data

  MM --> dMM1["Available manure"]:::data
  MM --> dMM2["Manure emissions"]:::data
  WAC --> dWAC1["Emissions etc. from waste management"]:::data
  WAC --> dWAC2["Available organic fertilisers"]:::data
  PNM --> dPNM["Mineral fertiliser req., application emissions, etc."]:::data

  dR1 --> CP
  dR1 --> AH

  dR2 --> FD
  dDAC1 --> FD
  dCP1 --> FD
  dAH1 --> FD

  dFD1 --> CPsc
  dFD2 --> AHsc
  dFD3 --> FM

  dDAC2 --> WAC

  dAH2 --> MM
  dFM --> MM

  dMM1 --> PNM
  dWAC2 --> PNM
  dCP2 --> PNM


  %% -------------------------
  %% Styles
  %% -------------------------
  classDef mod_main fill:#509e2f80,stroke:#203f13,stroke-width:2px,font-size:13,color:#203f13;
  classDef mod_mgmt fill:#6ad1e380,stroke:#125560,stroke-width:2px,font-size:13,color:#125560;
  classDef mod_opt  fill:#d9d9d680,stroke:#43433e,stroke-width:2px,font-size:13,color:#43433e;

  classDef data  fill:#fee8c880,stroke:#b30000,stroke-width:0.5px,font-size:11,color:#b30000;
  classDef param fill:#d7f4ee80,stroke:#165044,stroke-width:0.5px,font-size:11,color:#165044;

  classDef method   fill:#ffffff80,stroke:#000000,stroke-width:1px,font-size:12,color:#000000;
  classDef helper   fill:#f5f5f580,stroke:#616161,stroke-width:2px,font-size:12,color:#212121;
  classDef settings fill:#ffd5f680,stroke:#aa0088,stroke-width:1px,font-size:11,color:#aa0088;
Hold "Alt" / "Option" to enable pan & zoom

List of modules

Main modules
Regions Handles initial crop areas and animal numbers, climate and soil variables, etc.
DemandAndConversions Handles demand, conversion factors and waste generation
CropProduction Handles crop production
AnimalHerd Handles animal production
WasteAndCircularity Handles waste management and recirculation of plant nutrients
Mgmt modules
FeedMgmt Handles feed production and composition
ManureMgmt Handles manure generation and losses
ByProductMgmt Balances supply and demand for by-products
CropResidueMgmt Handles crop residues
CoverCropsMgmt Handles cover crops
PlantNutrientMgmt Handles crop nutrient requirements and allocation of manure and other fertilisers
MachineryAndEnergyMgmt Handles energy use and emissions
InputsMgmt Handles supply chain emissions from fertilisers, energy use, etc.
Optimisation modules
GeoDistributor Main optimisation module that distribute crop areas and animal numbers across regions
FeedDistributor As GeoDistributor but also includes feed rations as variables in the model