Skip to content

CropProduction

The CropProduction module calculates mass of harvested crop products (crop_prod) generated from cultivating a crop on a given area. Each production unit is specified by a crop, production system (prod_system; e.g. conventional or organic), and region. The model allows for parametrising multiple crops producing the same product (e.g. winter and spring wheat) as well as a single crop producing multiple products (i.e. to represent intercropping). The main parameter in this module is crop yields, but it also takes parameters for seeding density, above and below ground crop residues, etc.

The .scale() method scales all CropProduction´s data attributes with the scalable=True flag based on new crop areas.


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


flowchart TD

  %% -------------------------
  %% Main
  %% -------------------------

  A["<b>CropProduction</b>"]:::mod_main
  A --> C["<b>.calculate()</b>"]:::method
  A --> SC["<b>.scale()</b>"]:::method

  R["<b>Regions</b>"]:::mod_main --> A

  %% -------------------------
  %% Calculate() sequence
  %% -------------------------

  P_Y["<b>CropProduction.par.</b>
yield, crop_dm"]:::param --> C

  C --> DA_C["<b>CropProduction.data_attr.</b>
area, harvest, harvest_dm"]:::data

  CP["<b>.calculate_production()</b>"]:::method
  CR["<b>.calculate_crop_residues()</b>"]:::method
  SD["<b>.calculate_seed_demand()</b>"]:::method

  %% -------------------------
  %% Production (crop -> crop_prod mapping)
  %% -------------------------

  P_C2P["<b>CropProduction.par.</b>
crop_to_prod"]:::param --> CP
  DA_C ---> CP
  CP --> DA_P["<b>CropProduction.data_attr.</b>
production"]:::data

  %% -------------------------
  %% Crop residues (above/below ground)
  %% -------------------------

  P_RES["<b>CropProduction.par.</b>
ag_resid, bg_resid, frac_renew, crop_dm"]:::param --> CR
  DA_C ---> CR
  CR --> DA_CR["<b>CropProduction.data_attr.</b>
crop_residues, below_ground_biomass_C"]:::data

  %% -------------------------
  %% Seed demand
  %% -------------------------

  P_SEED["<b>CropProduction.par.</b>
seed"]:::param --> SD
  DA_C ---> SD
  SD --> DA_SD["<b>CropProduction.data_attr.</b>
seed_demand"]:::data


  %% -------------------------
  %% 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
View Docstring
Signature:
CropProduction(
    par: ParameterRetriever,
    regions: Regions,
    index: pd.MultiIndex
)

Docstring:
Main module that handles crop production

Parameters
----------
par : ParameterRetriever object
regions : Regions object, default None
    Regions object used to build Index for rows based on 'x0_crops'
index : pandas.Index or pandas.MultiIndex, default None
    Index for the rows. Should have levels ('crop', 'prod_system', 'region')

Only one of regions or index should be passed. If a Regions object is passed
the index is built based on 'x0_crops' and is rebuilt on .calculate() to include
any additional crops added in a scenario. So, it is recomended to pass a Regions
object rather than an Index.

File: CIBUSmod/main_modules/crop_prod.py