Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add "fbask_jan16_sticky" realization to livestock module #678

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).

### added
- **scripts** added output report `EU_report.R` that uses `EU_report.Rmd`
- **70_livestock** added realization `fbask_jan16_sticky`

### removed
-
Expand Down
5 changes: 5 additions & 0 deletions CITATION.cff
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,11 @@ authors:
affiliation: "Potsdam Institute for Climate Impact Research"
email: [email protected]

- family-names: Hötten
given-names: David
affiliation: "Potsdam Institute for Climate Impact Research"
email: [email protected]

- family-names: Lotze-Campen
given-names: Hermann
orcid: https://orcid.org/0000-0002-0003-5508
Expand Down
4 changes: 4 additions & 0 deletions config/default.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -1905,6 +1905,7 @@ cfg$gms$s62_midpoint_dem_bioplastic <- 2050 # def = 2050

# ***--------------------- 70_livestock -----------------------------------
# * (fbask_jan16): default feed basket realization
# * (fbask_jan16_sticky): feed basket realization using capital stocks as in sticky_feb18
cfg$gms$livestock <- "fbask_jan16" # def = fbask_jan16

# * Year until the pasture management factor is fixed to 1
Expand Down Expand Up @@ -1939,6 +1940,9 @@ cfg$gms$s70_feed_substitution_target <- 2050 # def = 2050
# * for consistency.
cfg$gms$c70_fac_req_regr <- "glo" # def = glo

# Settings only for realization `fbask_jan16_sticky`
cfg$gms$s70_multiplicator_capital_need <- 1 # def = 1

# ***--------------------- 71_disagg_lvst -----------------------------------
# * (off): default
# * (foragebased_aug18): Disaggregation of livestock to cells
Expand Down
2 changes: 2 additions & 0 deletions modules/70_livestock/fbask_jan16/not_used.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
name,type,reason
pm_interest,input,Since no capital stocks are implemented there is no need to consider interest rates.
61 changes: 61 additions & 0 deletions modules/70_livestock/fbask_jan16_sticky/declarations.gms
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
*** | (C) 2008-2024 Potsdam Institute for Climate Impact Research (PIK)
*** | authors, and contributors see CITATION.cff file. This file is part
*** | of MAgPIE and licensed under AGPL-3.0-or-later. Under Section 7 of
*** | AGPL-3.0, you are granted additional permissions described in the
*** | MAgPIE License Exception, version 1.0 (see LICENSE file).
*** | Contact: [email protected]


positive variables
vm_dem_feed(i,kap,kall) Regional feed demand including byproducts (mio. tDM per yr)
vm_cost_prod_livst(i,factors) Livestock factor costs (mio. USD05MER per yr)
vm_cost_prod_fish(i) Fish factor costs (mio. USD05MER per yr)
v70_investment(i,kli) Investment in immobile farm capital (mio USD05MER per yr)
;

equations
q70_feed(i,kap,kall) Regional feed demand
q70_cost_prod_liv_labor(i) Regional labor costs for livestock production
q70_cost_prod_liv_capital(i) Regional investment costs in farm capital
q70_investment(i,kli) Regional investments into farm capital
q70_cost_prod_fish(i) Regional factor input costs for fish production
;

parameters
im_slaughter_feed_share(t_all,i,kap,attributes) Share of feed that is incorporated in animal biomass (1)
i70_livestock_productivity(t_all,i,sys) Productivity indicator for livestock production (t FM per animal per yr)
im_feed_baskets(t_all,i,kap,kall) Feed baskets in tDM per tDM livestock product (1)
p70_cattle_stock_proxy(t,i) Proxy for cattle stocks needed to fullfil food demand for ruminant meat (mio. animals per yr)
p70_milk_cow_proxy(t,i) Proxy for milk cows needed to fullfil food demand for milk (mio. animals per yr)
p70_cattle_feed_pc_proxy(t,i,kli_rd) Proxy for daily per capita feed demand for pasture biomass driven by demand for beef and dairy products (tDM per capita per day)
p70_incr_cattle(t,i) Change in estimated cattle stocks attributed to food demand projections (1)
pm_past_mngmnt_factor(t,i) Regional pasture management intensification factor (1)
i70_cereal_scp_fadeout(t_all,i) Cereal feed fadeout (share 0-1) to be replaced by SCP (1)
i70_foddr_scp_fadeout(t_all,i) Fodder fadeout (share 0-1) to be replaced by SCP (1)
p70_country_dummy(iso) Dummy parameter indicating whether country is affected by feed scenarios (1)
p70_feedscen_region_shr(t_all,i) Weighted share of region with regards to feed scenario of countries (1)
p70_cost_share_livst(t,i,factors) Capital and labor shares of the regional factor costs for plant production for livestock (1)
p70_cost_share_calibration(i) Summation factor used to calibrate calculated capital shares with historical values (1)
i70_cost_regr(i,kap,cost_regr) Regression coefficients for livestock factor requirements (1)
i70_fac_req_livst(t_all,i,kli) Factor requirements (USD05MER per tDM)
p70_cereal_subst_fader(t_all) Cereal feed substitution with SCP fader (1)
p70_foddr_subst_fader(t_all) Foddr substitution with SCP fader (1)
p70_capital_need(t,i,kli) Capital requirements per unit of output (USD05MER per ton DM)
p70_capital(t,i,kli) Preexisting immobile capital stocks before investment (mio USD05MER)
p70_initial_1995_prod(i,kli) Initial regional production of livestock products taken from 1995 (mio ton DM)
;


*#################### R SECTION START (OUTPUT DECLARATIONS) ####################
parameters
ov_dem_feed(t,i,kap,kall,type) Regional feed demand including byproducts (mio. tDM per yr)
ov_cost_prod_livst(t,i,factors,type) Livestock factor costs (mio. USD05MER per yr)
ov_cost_prod_fish(t,i,type) Fish factor costs (mio. USD05MER per yr)
ov70_investment(t,i,kli,type) Investment in immobile farm capital (mio USD05MER per yr)
oq70_feed(t,i,kap,kall,type) Regional feed demand
oq70_cost_prod_liv_labor(t,i,type) Regional labor costs for livestock production
oq70_cost_prod_liv_capital(t,i,type) Regional investment costs in farm capital
oq70_investment(t,i,kli,type) Regional investments into farm capital
oq70_cost_prod_fish(t,i,type) Regional factor input costs for fish production
;
*##################### R SECTION END (OUTPUT DECLARATIONS) #####################
59 changes: 59 additions & 0 deletions modules/70_livestock/fbask_jan16_sticky/equations.gms
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
*** | (C) 2008-2023 Potsdam Institute for Climate Impact Research (PIK)
*** | authors, and contributors see CITATION.cff file. This file is part
*** | of MAgPIE and licensed under AGPL-3.0-or-later. Under Section 7 of
*** | AGPL-3.0, you are granted additional permissions described in the
*** | MAgPIE License Exception, version 1.0 (see LICENSE file).
*** | Contact: [email protected]

*' @equations

*' Demand for different feed items is derived by multiplying the regional
*' livestock production with the respective feed baskets. Additionally,
*' inconsistencies with the FAO inventory of national feed use in the case of
*' crops as well as consideration of alternative feed sources that reduce e.g.
*' the demand for grazed biomass like scavenging and roadside grazing are
*' balanced out by the parameter `fm_feed_balanceflow`.

q70_feed(i2,kap,kall) ..
vm_dem_feed(i2,kap,kall) =g= vm_prod_reg(i2,kap)
*sum(ct,im_feed_baskets(ct,i2,kap,kall))
+sum(ct,fm_feed_balanceflow(ct,i2,kap,kall));

*' Factor requirement costs (e.g. labour, capital, but without costs for feed)
*' of livestock production depend on the amount of production and the per-unit
*' costs. For ruminant products (milk and meet), we use a regression of per-unit
*' factor costs from the GTAP database [@narayanan_gtap7_2008] and livestock
*' productivity. Here, factor costs rise with intensification. The per-unit
*' costs for non-ruminants and fish are assumed to be independent from
*' productivity trajectories for simplification. Therefore,
*' `i70_cost_regr(i,kli,"cost_regr_b")` is set to zero in the case of livestock
*' products generated in monogastric systems.

*' To account for increased hourly labor costs and producitivity in case of an external
*' wage scenario, the total labor costs are scaled by the corresponding increase in hourly
*' labor costs and the related productivity gain from [36_employment].

q70_cost_prod_liv_labor(i2) ..
vm_cost_prod_livst(i2,"labor") =e= sum(kli, vm_prod_reg(i2,kli) * sum(ct, i70_fac_req_livst(ct,i2,kli)))
*sum(ct, p70_cost_share_livst(ct,i2,"labor"))
*sum(ct, (1/pm_productivity_gain_from_wages(ct,i2)) * (pm_hourly_costs(ct,i2,"scenario") / pm_hourly_costs(ct,i2,"baseline")));


q70_cost_prod_fish(i2) ..
vm_cost_prod_fish(i2) =e=
vm_prod_reg(i2,"fish")*i70_cost_regr(i2,"fish","cost_regr_a");

*** Section implementing the "sticky" part of the realization
*' Investment costs are calculated analogously to the `sticky_feb18` realization. The costs are annuitized,
*' and corrected to make sure that the annual depreciation of the current time-step is accounted for.
q70_cost_prod_liv_capital(i2)..
vm_cost_prod_livst(i2,"capital") =e= sum(kli,v70_investment(i2,kli))
* ((1-s70_depreciation_rate)*sum(ct,pm_interest(ct,i2)/(1+pm_interest(ct,i2))) + s70_depreciation_rate);

*' Each livestock activity requires a certain capital stock that depends on the production.
*' The following equations make sure that new land expansion is equipped
*' with capital stock, and that depreciation of pre-existing capital is replaced.
q70_investment(i2,kli)..
v70_investment(i2,kli) =g= vm_prod_reg(i2,kli)
* sum(ct, p70_capital_need(ct,i2,kli))
- sum(ct, p70_capital(ct,i2,kli));
127 changes: 127 additions & 0 deletions modules/70_livestock/fbask_jan16_sticky/input.gms
Original file line number Diff line number Diff line change
@@ -0,0 +1,127 @@
*** | (C) 2008-2024 Potsdam Institute for Climate Impact Research (PIK)
*** | authors, and contributors see CITATION.cff file. This file is part
*** | of MAgPIE and licensed under AGPL-3.0-or-later. Under Section 7 of
*** | AGPL-3.0, you are granted additional permissions described in the
*** | MAgPIE License Exception, version 1.0 (see LICENSE file).
*** | Contact: [email protected]

$setglobal c70_feed_scen ssp2
* options: SSP: ssp1, ssp2, ssp3, ssp4, ssp5
* SDP: SDP, SDP_EI, SDP_MC, SDP_RC
* other: constant

* Feed substitution scenarios including functional forms, targets and transition periods
* options: constant,
* lin_zero_10_50, lin_zero_20_50, lin_zero_20_30, lin_50pc_20_50, lin_50pc_20_50_extend65, lin_50pc_20_50_extend80,
* lin_50pc_10_50_extend90, lin_75pc_10_50_extend90, lin_80pc_20_50, lin_80pc_20_50_extend95, lin_90pc_20_50_extend95,
* lin_99-98-90pc_20_50-60-100, sigmoid_20pc_20_50, sigmoid_50pc_20_50, sigmoid_80pc_20_50
$setglobal c70_cereal_scp_scen constant
$setglobal c70_foddr_scp_scen constant

$setglobal c70_fac_req_regr glo
* options: glo, reg

scalars
s70_pyld_intercept Intercept of linear relationship determining pasture intensification (1) / 0.24 /
s70_past_mngmnt_factor_fix Year until the pasture management factor is fixed to 1 / 2005 /
s70_subst_functional_form Switch for functional form of feed substitution scenario fader (1) / 1 /
s70_feed_substitution_start Feed substitution start year / 2025 /
s70_feed_substitution_target Feed substitution target year / 2050 /
s70_cereal_scp_substitution Cereal feed substitution with SCP share (1) / 0 /
s70_foddr_scp_substitution Fodder substitution with SCP share (1) / 0 /
s70_depreciation_rate Yearly depreciation rate for capital stocks / 0.05 /
s70_multiplicator_capital_need Multiplicator for capital need in livestock production / 1 /
;

table f70_feed_baskets(t_all,i,kap,kall,feed_scen70) Feed baskets in tDM per tDM livestock product (1)
$ondelim
$include "./modules/70_livestock/fbask_jan16_sticky/input/f70_feed_baskets.cs3"
$offdelim;

table fm_feed_balanceflow(t_all,i,kap,kall) Balanceflow balance difference between estimated feed baskets and FAO (mio. tDM)
$ondelim
$include "./modules/70_livestock/fbask_jan16_sticky/input/f70_feed_balanceflow.cs3"
$offdelim;

table f70_livestock_productivity(t_all,i,sys,feed_scen70) Productivity indicator for livestock production (t FM per animal)
$ondelim
$include "./modules/70_livestock/fbask_jan16_sticky/input/f70_livestock_productivity.cs3"
$offdelim;

table f70_cost_regr(kap,cost_regr) Factor requirements livestock (USD04 per tDM (A) and USD (B))
$ondelim
$include "./modules/70_livestock/fbask_jan16_sticky/input/f70_capit_liv_regr.csv"
$offdelim
;

parameter f70_slaughter_feed_share(t_all,i,kap,attributes,feed_scen70) Share of feed that is incorprated in animal biomass (1)
/
$ondelim
$include "./modules/70_livestock/fbask_jan16_sticky/input/f70_slaughter_feed_share.cs4"
$offdelim
/
;

parameter f70_pyld_slope_reg(i) Regional slope of linear relationship determining pasture intensification (1)
/
$ondelim
$include "./modules/70_livestock/fbask_jan16_sticky/input/f70_pyld_slope_reg.cs4"
$offdelim
/;

parameter f70_cap_share_reg(share_regr) Parameters for regression
/
$ondelim
$include "./modules/70_livestock/fbask_jan16_sticky/input/f70_cap_share_reg.csv"
$offdelim
/
;

table f70_hist_cap_share(t_all,i) Historical capital share
$ondelim
$include "./modules/70_livestock/fbask_jan16_sticky/input/f70_hist_cap_share.csv"
$offdelim
;

table f70_hist_factor_costs_livst(t_all,i,kli) Historical factor costs in livestock production (mio. USD05MER)
$ondelim
$include "./modules/70_livestock/fbask_jan16_sticky/input/f70_hist_factor_costs_livst.cs3"
$offdelim
;

table f70_hist_prod_livst(t_all,i,kli,attributes) Historical production quantity of livestock products (mio. t)
$ondelim
$include "./modules/70_livestock/fbask_jan16_sticky/input/f70_hist_prod_livst.cs3"
$offdelim
;

* Set-switch for countries affected by country-specific exogenous diet scenario
* Default: all iso countries selected
sets
scen_countries70(iso) countries to be affected by selected feed sceanrio /
ABW,AFG,AGO,AIA,ALA,ALB,AND,ARE,ARG,ARM,
ASM,ATA,ATF,ATG,AUS,AUT,AZE,BDI,BEL,BEN,
BES,BFA,BGD,BGR,BHR,BHS,BIH,BLM,BLR,BLZ,
BMU,BOL,BRA,BRB,BRN,BTN,BVT,BWA,CAF,CAN,
CCK,CHN,CHE,CHL,CIV,CMR,COD,COG,COK,COL,
COM,CPV,CRI,CUB,CUW,CXR,CYM,CYP,CZE,DEU,
DJI,DMA,DNK,DOM,DZA,ECU,EGY,ERI,ESH,ESP,
EST,ETH,FIN,FJI,FLK,FRA,FRO,FSM,GAB,GBR,
GEO,GGY,GHA,GIB,GIN,GLP,GMB,GNB,GNQ,GRC,
GRD,GRL,GTM,GUF,GUM,GUY,HKG,HMD,HND,HRV,
HTI,HUN,IDN,IMN,IND,IOT,IRL,IRN,IRQ,ISL,
ISR,ITA,JAM,JEY,JOR,JPN,KAZ,KEN,KGZ,KHM,
KIR,KNA,KOR,KWT,LAO,LBN,LBR,LBY,LCA,LIE,
LKA,LSO,LTU,LUX,LVA,MAC,MAF,MAR,MCO,MDA,
MDG,MDV,MEX,MHL,MKD,MLI,MLT,MMR,MNE,MNG,
MNP,MOZ,MRT,MSR,MTQ,MUS,MWI,MYS,MYT,NAM,
NCL,NER,NFK,NGA,NIC,NIU,NLD,NOR,NPL,NRU,
NZL,OMN,PAK,PAN,PCN,PER,PHL,PLW,PNG,POL,
PRI,PRK,PRT,PRY,PSE,PYF,QAT,REU,ROU,RUS,
RWA,SAU,SDN,SEN,SGP,SGS,SHN,SJM,SLB,SLE,
SLV,SMR,SOM,SPM,SRB,SSD,STP,SUR,SVK,SVN,
SWE,SWZ,SXM,SYC,SYR,TCA,TCD,TGO,THA,TJK,
TKL,TKM,TLS,TON,TTO,TUN,TUR,TUV,TWN,TZA,
UGA,UKR,UMI,URY,USA,UZB,VAT,VCT,VEN,VGB,
VIR,VNM,VUT,WLF,WSM,YEM,ZAF,ZMB,ZWE /
;
11 changes: 11 additions & 0 deletions modules/70_livestock/fbask_jan16_sticky/input/files
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
* list of files that are required here
f70_feed_baskets.cs3
f70_feed_balanceflow.cs3
f70_livestock_productivity.cs3
f70_capit_liv_regr.csv
f70_slaughter_feed_share.cs4
f70_pyld_slope_reg.cs4
f70_cap_share_reg.csv
f70_hist_cap_share.csv
f70_hist_factor_costs_livst.cs3
f70_hist_prod_livst.cs3
49 changes: 49 additions & 0 deletions modules/70_livestock/fbask_jan16_sticky/postsolve.gms
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
*** | (C) 2008-2024 Potsdam Institute for Climate Impact Research (PIK)
*** | authors, and contributors see CITATION.cff file. This file is part
*** | of MAgPIE and licensed under AGPL-3.0-or-later. Under Section 7 of
*** | AGPL-3.0, you are granted additional permissions described in the
*** | MAgPIE License Exception, version 1.0 (see LICENSE file).
*** | Contact: [email protected]

*' Capital update from the last investment
p70_capital(t+1,i,kli) = p70_capital(t,i,kli) + v70_investment.l(i,kli);

*#################### R SECTION START (OUTPUT DEFINITIONS) #####################
ov_dem_feed(t,i,kap,kall,"marginal") = vm_dem_feed.m(i,kap,kall);
ov_cost_prod_livst(t,i,factors,"marginal") = vm_cost_prod_livst.m(i,factors);
ov_cost_prod_fish(t,i,"marginal") = vm_cost_prod_fish.m(i);
ov70_investment(t,i,kli,"marginal") = v70_investment.m(i,kli);
oq70_feed(t,i,kap,kall,"marginal") = q70_feed.m(i,kap,kall);
oq70_cost_prod_liv_labor(t,i,"marginal") = q70_cost_prod_liv_labor.m(i);
oq70_cost_prod_liv_capital(t,i,"marginal") = q70_cost_prod_liv_capital.m(i);
oq70_investment(t,i,kli,"marginal") = q70_investment.m(i,kli);
oq70_cost_prod_fish(t,i,"marginal") = q70_cost_prod_fish.m(i);
ov_dem_feed(t,i,kap,kall,"level") = vm_dem_feed.l(i,kap,kall);
ov_cost_prod_livst(t,i,factors,"level") = vm_cost_prod_livst.l(i,factors);
ov_cost_prod_fish(t,i,"level") = vm_cost_prod_fish.l(i);
ov70_investment(t,i,kli,"level") = v70_investment.l(i,kli);
oq70_feed(t,i,kap,kall,"level") = q70_feed.l(i,kap,kall);
oq70_cost_prod_liv_labor(t,i,"level") = q70_cost_prod_liv_labor.l(i);
oq70_cost_prod_liv_capital(t,i,"level") = q70_cost_prod_liv_capital.l(i);
oq70_investment(t,i,kli,"level") = q70_investment.l(i,kli);
oq70_cost_prod_fish(t,i,"level") = q70_cost_prod_fish.l(i);
ov_dem_feed(t,i,kap,kall,"upper") = vm_dem_feed.up(i,kap,kall);
ov_cost_prod_livst(t,i,factors,"upper") = vm_cost_prod_livst.up(i,factors);
ov_cost_prod_fish(t,i,"upper") = vm_cost_prod_fish.up(i);
ov70_investment(t,i,kli,"upper") = v70_investment.up(i,kli);
oq70_feed(t,i,kap,kall,"upper") = q70_feed.up(i,kap,kall);
oq70_cost_prod_liv_labor(t,i,"upper") = q70_cost_prod_liv_labor.up(i);
oq70_cost_prod_liv_capital(t,i,"upper") = q70_cost_prod_liv_capital.up(i);
oq70_investment(t,i,kli,"upper") = q70_investment.up(i,kli);
oq70_cost_prod_fish(t,i,"upper") = q70_cost_prod_fish.up(i);
ov_dem_feed(t,i,kap,kall,"lower") = vm_dem_feed.lo(i,kap,kall);
ov_cost_prod_livst(t,i,factors,"lower") = vm_cost_prod_livst.lo(i,factors);
ov_cost_prod_fish(t,i,"lower") = vm_cost_prod_fish.lo(i);
ov70_investment(t,i,kli,"lower") = v70_investment.lo(i,kli);
oq70_feed(t,i,kap,kall,"lower") = q70_feed.lo(i,kap,kall);
oq70_cost_prod_liv_labor(t,i,"lower") = q70_cost_prod_liv_labor.lo(i);
oq70_cost_prod_liv_capital(t,i,"lower") = q70_cost_prod_liv_capital.lo(i);
oq70_investment(t,i,kli,"lower") = q70_investment.lo(i,kli);
oq70_cost_prod_fish(t,i,"lower") = q70_cost_prod_fish.lo(i);
*##################### R SECTION END (OUTPUT DEFINITIONS) ######################

Loading
Loading