From 03930265b5fd55d4e9ffd5d8b2b1cd68190d4e11 Mon Sep 17 00:00:00 2001 From: David Hoetten Date: Wed, 22 May 2024 17:18:09 +0200 Subject: [PATCH 1/8] added sticky livestock realization --- modules/70_livestock/fbask_jan16/not_used.txt | 2 + .../fbask_jan16_sticky/declarations.gms | 61 +++++++++ .../fbask_jan16_sticky/equations.gms | 59 ++++++++ .../70_livestock/fbask_jan16_sticky/input.gms | 127 ++++++++++++++++++ .../fbask_jan16_sticky/input/files | 11 ++ .../fbask_jan16_sticky/postsolve.gms | 49 +++++++ .../fbask_jan16_sticky/preloop.gms | 88 ++++++++++++ .../fbask_jan16_sticky/presolve.gms | 92 +++++++++++++ .../fbask_jan16_sticky/realization.gms | 108 +++++++++++++++ .../70_livestock/fbask_jan16_sticky/sets.gms | 46 +++++++ modules/70_livestock/module.gms | 1 + 11 files changed, 644 insertions(+) create mode 100644 modules/70_livestock/fbask_jan16/not_used.txt create mode 100644 modules/70_livestock/fbask_jan16_sticky/declarations.gms create mode 100644 modules/70_livestock/fbask_jan16_sticky/equations.gms create mode 100644 modules/70_livestock/fbask_jan16_sticky/input.gms create mode 100644 modules/70_livestock/fbask_jan16_sticky/input/files create mode 100644 modules/70_livestock/fbask_jan16_sticky/postsolve.gms create mode 100644 modules/70_livestock/fbask_jan16_sticky/preloop.gms create mode 100644 modules/70_livestock/fbask_jan16_sticky/presolve.gms create mode 100644 modules/70_livestock/fbask_jan16_sticky/realization.gms create mode 100644 modules/70_livestock/fbask_jan16_sticky/sets.gms diff --git a/modules/70_livestock/fbask_jan16/not_used.txt b/modules/70_livestock/fbask_jan16/not_used.txt new file mode 100644 index 0000000000..c6ba37d1b9 --- /dev/null +++ b/modules/70_livestock/fbask_jan16/not_used.txt @@ -0,0 +1,2 @@ +name,type,reason +pm_interest,input,Since no capital stocks are implemented there is no need to consider interest rates. diff --git a/modules/70_livestock/fbask_jan16_sticky/declarations.gms b/modules/70_livestock/fbask_jan16_sticky/declarations.gms new file mode 100644 index 0000000000..3a5219f12d --- /dev/null +++ b/modules/70_livestock/fbask_jan16_sticky/declarations.gms @@ -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: magpie@pik-potsdam.de + + +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 costs 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 for livestock production + oq70_investment(t,i,kli,type) Cellular immobile investments into farm capital (mio USD05MER) + oq70_cost_prod_fish(t,i,type) Regional factor input costs for fish production +; +*##################### R SECTION END (OUTPUT DECLARATIONS) ##################### diff --git a/modules/70_livestock/fbask_jan16_sticky/equations.gms b/modules/70_livestock/fbask_jan16_sticky/equations.gms new file mode 100644 index 0000000000..5febb63386 --- /dev/null +++ b/modules/70_livestock/fbask_jan16_sticky/equations.gms @@ -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: magpie@pik-potsdam.de + +*' @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)); diff --git a/modules/70_livestock/fbask_jan16_sticky/input.gms b/modules/70_livestock/fbask_jan16_sticky/input.gms new file mode 100644 index 0000000000..9981c2e4bb --- /dev/null +++ b/modules/70_livestock/fbask_jan16_sticky/input.gms @@ -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: magpie@pik-potsdam.de + +$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 / +; diff --git a/modules/70_livestock/fbask_jan16_sticky/input/files b/modules/70_livestock/fbask_jan16_sticky/input/files new file mode 100644 index 0000000000..ca00704e44 --- /dev/null +++ b/modules/70_livestock/fbask_jan16_sticky/input/files @@ -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 diff --git a/modules/70_livestock/fbask_jan16_sticky/postsolve.gms b/modules/70_livestock/fbask_jan16_sticky/postsolve.gms new file mode 100644 index 0000000000..cb862b38bb --- /dev/null +++ b/modules/70_livestock/fbask_jan16_sticky/postsolve.gms @@ -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: magpie@pik-potsdam.de + +*' 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) ###################### + diff --git a/modules/70_livestock/fbask_jan16_sticky/preloop.gms b/modules/70_livestock/fbask_jan16_sticky/preloop.gms new file mode 100644 index 0000000000..1d8248a79d --- /dev/null +++ b/modules/70_livestock/fbask_jan16_sticky/preloop.gms @@ -0,0 +1,88 @@ +*** | (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: magpie@pik-potsdam.de +loop(t_all, + if(m_year(t_all) <= sm_fix_SSP2, + im_slaughter_feed_share(t_all,i,kap,attributes) = f70_slaughter_feed_share(t_all,i,kap,attributes,"ssp2"); + i70_livestock_productivity(t_all,i,sys) = f70_livestock_productivity(t_all,i,sys,"ssp2"); + im_feed_baskets(t_all,i,kap,kall) = f70_feed_baskets(t_all,i,kap,kall,"ssp2"); + else + im_slaughter_feed_share(t_all,i,kap,attributes) = f70_slaughter_feed_share(t_all,i,kap,attributes,"%c70_feed_scen%"); + i70_livestock_productivity(t_all,i,sys) = f70_livestock_productivity(t_all,i,sys,"%c70_feed_scen%"); + im_feed_baskets(t_all,i,kap,kall) = f70_feed_baskets(t_all,i,kap,kall,"%c70_feed_scen%"); + ); +); + +* set default livestock productivity to avoid division of zero in presolve.gms +i70_livestock_productivity(t_all,i,sys)$(i70_livestock_productivity(t_all,i,sys)=0) = 0.02; + +* Switch to determine countries for which feed substitution scenarios shall be applied. +* In the default case, the food scenario affects all countries when activated. +p70_country_dummy(iso) = 0; +p70_country_dummy(scen_countries70) = 1; + + +* Because MAgPIE is not run at country-level, but at region level, a region +* share is calculated that translates the countries' influence to regional level. +* Countries are weighted by their population size. +p70_feedscen_region_shr(t_all,i) = sum(i_to_iso(i,iso), p70_country_dummy(iso) * im_pop_iso(t_all,iso)) / sum(i_to_iso(i,iso), im_pop_iso(t_all,iso)); + + +if (s70_subst_functional_form = 1, + + m_linear_time_interpol(p70_cereal_subst_fader,s70_feed_substitution_start,s70_feed_substitution_target,0,s70_cereal_scp_substitution); + m_linear_time_interpol(p70_foddr_subst_fader,s70_feed_substitution_start,s70_feed_substitution_target,0,s70_foddr_scp_substitution); + +elseif s70_subst_functional_form = 2, + + m_sigmoid_time_interpol(p70_cereal_subst_fader,s70_feed_substitution_start,s70_feed_substitution_target,0,s70_cereal_scp_substitution); + m_sigmoid_time_interpol(p70_foddr_subst_fader,s70_feed_substitution_start,s70_feed_substitution_target,0,s70_foddr_scp_substitution); + +); + +* Feed substitution scenarios including functional forms, targets and transition periods +* Note: p70_feedscen_region_shr(t,i) is 1 in the default case) +i70_cereal_scp_fadeout(t_all,i) = 1 - p70_feedscen_region_shr(t_all,i)*p70_cereal_subst_fader(t_all); +i70_foddr_scp_fadeout(t_all,i) = 1 - p70_feedscen_region_shr(t_all,i)*p70_foddr_subst_fader(t_all); + + +*** Substitution of cereal feed (kcer70) with single-cell protein (SCP) based on Nr +* Before the substitution, kcer70 is converted from DM to Nr +* using fm_attributes("nr",kcer70). +* After the substitution of kcer70 with SCP (1-i70_cereal_scp_fadeout), SCP is converted +* back DM fm_attributes("nr","scp"). +im_feed_baskets(t_all,i,kap,"scp") = im_feed_baskets(t_all,i,kap,"scp") + + sum(kcer70, im_feed_baskets(t_all,i,kap,kcer70) * (1-i70_cereal_scp_fadeout(t_all,i)) * + fm_attributes("nr",kcer70)) / fm_attributes("nr","scp"); +im_feed_baskets(t_all,i,kap,kcer70) = + im_feed_baskets(t_all,i,kap,kcer70) * i70_cereal_scp_fadeout(t_all,i); + +*** Substitution of foddr feed with single-cell protein (SCP) based on Nr +* Before the substitution, foddr is converted from DM to Nr +* using fm_attributes("nr","foddr"). +* After the substitution of foddr with SCP (1-i70_foddr_scp_fadeout), SCP is converted +* back DM fm_attributes("nr","scp"). +im_feed_baskets(t_all,i,kap,"scp") = im_feed_baskets(t_all,i,kap,"scp") + + (im_feed_baskets(t_all,i,kap,"foddr") * (1-i70_foddr_scp_fadeout(t_all,i)) * + fm_attributes("nr","foddr")) / fm_attributes("nr","scp"); +im_feed_baskets(t_all,i,kap,"foddr") = + im_feed_baskets(t_all,i,kap,"foddr") * i70_foddr_scp_fadeout(t_all,i); + + +*** choosing between reginal and global factor requirements +$if "%c70_fac_req_regr%" == "glo" i70_cost_regr(i,kli,"cost_regr_a") = f70_cost_regr(kli,"cost_regr_a"); +$if "%c70_fac_req_regr%" == "reg" i70_cost_regr(i,kli,"cost_regr_a") = sum(t_past$(ord(t_past) eq card(t_past)), (f70_hist_factor_costs_livst(t_past,i,kli) / f70_hist_prod_livst(t_past,i,kli,"dm")) - f70_cost_regr(kli,"cost_regr_b") * sum(sys_to_kli(sys,kli),i70_livestock_productivity(t_past,i,sys))); + +i70_cost_regr(i,"fish",cost_regr) = f70_cost_regr("fish",cost_regr); +i70_cost_regr(i,kap,"cost_regr_b") = f70_cost_regr(kap,"cost_regr_b"); + +i70_fac_req_livst(t_all,i,kli) = i70_cost_regr(i,kli,"cost_regr_b") * sum(sys_to_kli(sys,kli), i70_livestock_productivity(t_all,i,sys)) + i70_cost_regr(i,kli,"cost_regr_a"); +* use historic livestock factor requirements for t_past if regional switch is on. Once regression has been updated this could also be included for global factor requirements +$if "%c70_fac_req_regr%" == "reg" i70_fac_req_livst(t_all,i,kli)$(m_year(t_all) <= sum(t_past$(ord(t_past) eq card(t_past)), m_year(t_past)) and m_year(t_all) > 1990) = (f70_hist_factor_costs_livst(t_all,i,kli) / f70_hist_prod_livst(t_all,i,kli,"dm")); + +*** Section implementing the "sticky" part of the realization +* Get the initial production from the historic data +p70_initial_1995_prod(i,kli) = f70_hist_prod_livst("y1995",i,kli,"dm"); \ No newline at end of file diff --git a/modules/70_livestock/fbask_jan16_sticky/presolve.gms b/modules/70_livestock/fbask_jan16_sticky/presolve.gms new file mode 100644 index 0000000000..528f02b6f4 --- /dev/null +++ b/modules/70_livestock/fbask_jan16_sticky/presolve.gms @@ -0,0 +1,92 @@ +*** | (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: magpie@pik-potsdam.de + + +*' @code +*' This realization of the livestock module also estimates an exogenous +*' pasture management factor `pm_past_mngmnt_factor` that is used to scale +*' biophysical pasture yields in the module [14_yields]. + +*' The exogenous calculation of pasture management requires information on +*' changes in the number of cattle reared to fulfil the food demand for ruminant +*' livestock products: + +p70_cattle_stock_proxy(t,i) = im_pop(t,i)*pm_kcal_pc_initial(t,i,"livst_rum") + /i70_livestock_productivity(t,i,"sys_beef"); + +p70_milk_cow_proxy(t,i) = im_pop(t,i)*pm_kcal_pc_initial(t,i,"livst_milk") + /i70_livestock_productivity(t,i,"sys_dairy"); + +*' The lower bound for `p70_cattle_stock_proxy` and `p70_milk_cow_proxy` is +*' set to 20% of initial values in 1995: + +p70_cattle_stock_proxy(t,i)$(p70_cattle_stock_proxy(t,i) < 0.2*p70_cattle_stock_proxy("y1995",i)) = 0.2*p70_cattle_stock_proxy("y1995",i); +p70_milk_cow_proxy(t,i)$(p70_milk_cow_proxy(t,i) < 0.2*p70_milk_cow_proxy("y1995",i)) = 0.2*p70_milk_cow_proxy("y1995",i); + +*' The parameter `p70_cattle_feed_pc_proxy` is a proxy for regional daily per capita +*' feed demand for pasture biomass driven by demand for beef and dairy products, +*' which is later used for weighted aggregation. +p70_cattle_feed_pc_proxy(t,i,kli_rd) = pm_kcal_pc_initial(t,i,kli_rd)*im_feed_baskets(t,i,kli_rd,"pasture")/(fm_nutrition_attributes(t,kli_rd,"kcal") * 10**6); + +*' The parameter `p70_incr_cattle` describes the changes in the number of cattle +*' relative to the previous time step: + +if (ord(t)>1, + p70_incr_cattle(t,i) = ( (p70_cattle_feed_pc_proxy(t,i,"livst_rum") + 10**(-6))* (p70_cattle_stock_proxy(t,i)/p70_cattle_stock_proxy(t-1,i)) + + (p70_cattle_feed_pc_proxy(t,i,"livst_milk") + 10**(-6)) * (p70_milk_cow_proxy(t,i)/p70_milk_cow_proxy(t-1,i)) ) + / sum(kli_rd, p70_cattle_feed_pc_proxy(t,i,kli_rd) + 10**(-6)); +else + p70_incr_cattle(t,i) = 1; +); + +*' The pasture management factor is calculated by applying a linear relationship +*' that links changes in pasture management with changes in the number of cattle: + +if (m_year(t) <= s70_past_mngmnt_factor_fix, + pm_past_mngmnt_factor(t,i) = 1; +else + pm_past_mngmnt_factor(t,i) = ( (s70_pyld_intercept + f70_pyld_slope_reg(i)*p70_incr_cattle(t,i)**(5/(m_year(t)-m_year(t-1))) + )**((m_year(t)-m_year(t-1))/5) )*pm_past_mngmnt_factor(t-1,i); + ); + +*' @stop + +p70_cost_share_calibration(i) = f70_hist_cap_share("y2010",i)-(f70_cap_share_reg("slope")*log10(sum(i_to_iso(i,iso),im_gdp_pc_ppp_iso("y2010",iso)))+f70_cap_share_reg("intercept")); + +if (m_year(t)<2010, + p70_cost_share_livst(t,i,"capital") = f70_hist_cap_share(t,i); + p70_cost_share_livst(t,i,"labor") = 1 - f70_hist_cap_share(t,i); + +elseif (m_year(t)>=2010), + p70_cost_share_livst(t,i,"capital") = f70_cap_share_reg("slope")*log10(sum(i_to_iso(i,iso),im_gdp_pc_ppp_iso(t,iso)))+f70_cap_share_reg("intercept")+p70_cost_share_calibration(i); + p70_cost_share_livst(t,i,"labor") = 1 - p70_cost_share_livst(t,i,"capital"); +); + + +*** Section implementing the "sticky" part of the realization +*' The capital need per unit of production is based on the capital share of the factor requirements, +*' as well as the interest and the depreciation rates, analogously to the `sticky_feb18` realization. +*' In addition `s70_multiplicator_capital_need` can be used to increase the capital need. + +p70_capital_need(t,i,kli) = i70_fac_req_livst(t,i,kli) + * p70_cost_share_livst(t,i,"capital") + / (pm_interest(t,i)+s70_depreciation_rate) + * s70_multiplicator_capital_need; + +if (ord(t) = 1, + +*' Estimate capital stock based on initial production. + + p70_capital(t,i,kli) = p70_capital_need(t,i,kli) * p70_initial_1995_prod(i,kli); + +else + +*' Update of existing stocks due to depreciation + + p70_capital(t,i,kli) = p70_capital(t,i,kli) * (1-s70_depreciation_rate)**(m_timestep_length); + +); diff --git a/modules/70_livestock/fbask_jan16_sticky/realization.gms b/modules/70_livestock/fbask_jan16_sticky/realization.gms new file mode 100644 index 0000000000..e293d21386 --- /dev/null +++ b/modules/70_livestock/fbask_jan16_sticky/realization.gms @@ -0,0 +1,108 @@ +*** | (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: magpie@pik-potsdam.de + +*' @description The fbask_jan16_sticky realization of the livestock module is based on +*' the fbask_jan16 realization, and only differs from it by implementing capital stocks +*' as introduced in the `sticky_feb18` factor cost module realization. +*' +*' The methodology of fbask_jan16 is described in @weindl_livestock_2017 and +*' @weindl_livestock_2017-1. An important part of the feed demand calculations +*' is conducted outside of the core MAgPIE-GAMS code. Livestock products +*' (ruminant meat, whole-milk, pork, poultry meat and eggs) are supplied by five +*' animal food systems (beef cattle, dairy cattle, pigs, broilers and laying +*' hens). The parameterization of the livestock sector in the initial year is +*' consistent with FAO statistics regarding livestock production, livestock +*' productivity and concentrate feed use. + +*' The fbask_jan16 realization requires regional and product-specific feed +*' baskets that are calculated by a set of preprocessing routines outside of the +*' MAgPIE-GAMS code. Following the methodology of @wirsenius_human_2000, feed +*' conversion (total feed input per product output in dry matter) and feed +*' baskets (demand for different feed types per product output in dry matter) +*' are derived by compiling system-specific feed energy balances. For the +*' establishment of these balances, we apply feed energy requirements per output, +*' as estimated by wirsenius_human_2000 for each animal function and animal food +*' system. These estimates are based on standardized bio-energetic equations and +*' include the minimum energy requirements for maintenance, growth, lactation, +*' reproduction and other basic biological functions of the animals. Moreover, +*' they comprise a general allowance for basic activity and temperature effects. + +*' By distributing the available feed at country level to animal food systems +*' according to their feed energy demand and dividing resulting dry matter feed +*' use by the production volume of the respective systems, we obtain both +*' estimates for feed conversion and feed baskets across different animal food +*' systems and countries. + +*' To facilitate projections of feed conversion and feed baskets, we create +*' regression models with livestock productivity (annual production per animal +*' [ton fresh matter/animal/year]) as predictor, which permit the construction +*' of livestock feeding scenarios. Currently, feeding scenarios are derived +*' based on exogenous livestock productivity scenarios consistent with the +*' storylines of the Shared Socioeconomic Pathways (SSPs). For beef cattle, pigs +*' and broilers, livestock productivity is defined as meat production per +*' animals in stock (e.g. total cattle herd) and for dairy cattle and laying hen +*' as milk or egg production per producing animals (e.g. milk cows). + +*' A power function is used to describe the functional relation between feed +*' conversion and livestock productivity: + +*' ![Relationship between feed conversion and livestock productivity +*' [@weindl_livestock_2017].](feed_conv.jpg){ width=100% } + +*' In the case of feed composition, we use an additional proxy parameter in our +*' analysis. What type of biomass is used to feed animals is to a certain extent +*' influenced by universal aspects (e.g. the need for more energy-rich feed at +*' higher productivity levels), whereas other aspects are strongly influenced by +*' geographical location (e.g. availability and costs of permanent pasture +*' compared to cropland feed, agro-ecological and climatic conditions that +*' favour selected feed items; socio-cultural determinants etc.). For cattle +*' systems the proxy (climate-zone specific factor) was determined by +*' calculating the share of the national population living in arid and cold +*' climate zones. + +*' ![Relationship between the share of crop residues, occasional feed and grazed +*' biomass in feed baskets and livestock productivity for beef cattle systems +*' [@weindl_livestock_2017].](feed_comp_beef.jpg){ width=60% } + +*' ![Relationship between the share of crop residues, occasional feed and grazed +*' biomass in feed baskets and livestock productivity for diary cattle systems +*' [@weindl_livestock_2017].](feed_comp_dairy.jpg){ width=60% } + +*' These relationships between feed baskets and livestock productivity are used +*' to construct feeding scenarios that reflect the narratives of the SSPs. The +*' resulting feed baskets enter the MAgPIE model as scenario-dependent input data +*' and are crucial for the feed demand calculations in the livestock module. + +*' +*' In this realization the capital share of livestock production cost does not have +*' to be paid every timestep, but is fulfilled by having a corresponding capital stock, +*' which mostly persists across timesteps. +*' This means that the production becomes cheaper in regions with +*' higher capital shares and existing corresponding capital stocks, +*' wich makes the livestock production "stick" to some degree to existing levels. +*' Another effect is that production increases are more likely to occure regions +*' of more capital intensive livestock systems with established stocks. +*' +*' The realization is based on the `sticky_feb18` factor cost realization, but +*' also differs from it in some ways. At the creation time the main differences where: +*' 1. capital stocks are on the regional level not on cluster level +*' 2. no differentiation of mobile and immobile captital - all captital stocks are immobile +*' +*' @limitations Intensification of livestock production and related changes in +*' livestock feeding are modelled exogenously. Therefore, the livestock sector +*' does not endogenously respond to demand and climate shocks and policies, e.g. +*' targeting climate protection. + +*####################### R SECTION START (PHASES) ############################## +$Ifi "%phase%" == "sets" $include "./modules/70_livestock/fbask_jan16_sticky/sets.gms" +$Ifi "%phase%" == "declarations" $include "./modules/70_livestock/fbask_jan16_sticky/declarations.gms" +$Ifi "%phase%" == "input" $include "./modules/70_livestock/fbask_jan16_sticky/input.gms" +$Ifi "%phase%" == "equations" $include "./modules/70_livestock/fbask_jan16_sticky/equations.gms" +$Ifi "%phase%" == "preloop" $include "./modules/70_livestock/fbask_jan16_sticky/preloop.gms" +$Ifi "%phase%" == "presolve" $include "./modules/70_livestock/fbask_jan16_sticky/presolve.gms" +$Ifi "%phase%" == "postsolve" $include "./modules/70_livestock/fbask_jan16_sticky/postsolve.gms" +*######################## R SECTION END (PHASES) ############################### diff --git a/modules/70_livestock/fbask_jan16_sticky/sets.gms b/modules/70_livestock/fbask_jan16_sticky/sets.gms new file mode 100644 index 0000000000..2382b598f7 --- /dev/null +++ b/modules/70_livestock/fbask_jan16_sticky/sets.gms @@ -0,0 +1,46 @@ +*** | (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: magpie@pik-potsdam.de + +sets + + cost_regr Cost regression parameters + /cost_regr_a,cost_regr_b/ + + share_regr regression parameters for capital share calculation + /slope, intercept/ + + feed_scen70 scenarios + / ssp1, ssp2, ssp3, ssp4, ssp5, constant, + SDP, SDP_EI, SDP_MC, SDP_RC / + + sys Livestock production systems + /sys_pig, sys_beef, sys_chicken, sys_hen, sys_dairy/ + + sys_meat(sys) Livestock meat production systems + /sys_pig, sys_beef, sys_chicken/ + + sys_nonmeat(sys) Livestock non-meat production systems + /sys_hen, sys_dairy/ + + + sys_to_kli(sys,kli) Mapping between livestock producton systems and livestock products + /sys_pig . livst_pig + sys_beef . livst_rum + sys_chicken . livst_chick + sys_hen . livst_egg + sys_dairy .livst_milk + / + + kcer70(kall) Cereals + / tece, maiz, trce, rice_pro / + + fadeoutscen70 Feed substitution scenarios including functional forms with targets and transition periods + / constant, + lin_zero_10_50, lin_zero_20_50, lin_zero_20_30, lin_zero_20_70, 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 / +; diff --git a/modules/70_livestock/module.gms b/modules/70_livestock/module.gms index e3275b943b..6706c76329 100644 --- a/modules/70_livestock/module.gms +++ b/modules/70_livestock/module.gms @@ -24,4 +24,5 @@ *###################### R SECTION START (MODULETYPES) ########################## $Ifi "%livestock%" == "fbask_jan16" $include "./modules/70_livestock/fbask_jan16/realization.gms" +$Ifi "%livestock%" == "fbask_jan16_sticky" $include "./modules/70_livestock/fbask_jan16_sticky/realization.gms" *###################### R SECTION END (MODULETYPES) ############################ From e8208bf373d5471bc331cd0e3183c8033c8d9bbb Mon Sep 17 00:00:00 2001 From: David Hoetten Date: Wed, 22 May 2024 17:40:43 +0200 Subject: [PATCH 2/8] improved documentation --- .../70_livestock/fbask_jan16_sticky/realization.gms | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/modules/70_livestock/fbask_jan16_sticky/realization.gms b/modules/70_livestock/fbask_jan16_sticky/realization.gms index e293d21386..b65ae629c8 100644 --- a/modules/70_livestock/fbask_jan16_sticky/realization.gms +++ b/modules/70_livestock/fbask_jan16_sticky/realization.gms @@ -80,17 +80,17 @@ *' *' In this realization the capital share of livestock production cost does not have *' to be paid every timestep, but is fulfilled by having a corresponding capital stock, -*' which mostly persists across timesteps. +*' which mostly persists across timesteps. (See `s70_depreciation_rate`) *' This means that the production becomes cheaper in regions with *' higher capital shares and existing corresponding capital stocks, -*' wich makes the livestock production "stick" to some degree to existing levels. -*' Another effect is that production increases are more likely to occure regions -*' of more capital intensive livestock systems with established stocks. +*' which makes the livestock production "stick" to some degree to existing levels. +*' Another effect is that production increases are more likely to occur in regions +*' of more capital intensive livestock systems with already established stocks. *' *' The realization is based on the `sticky_feb18` factor cost realization, but *' also differs from it in some ways. At the creation time the main differences where: *' 1. capital stocks are on the regional level not on cluster level -*' 2. no differentiation of mobile and immobile captital - all captital stocks are immobile +*' 2. no differentiation of mobile and immobile capital - all capital stocks are immobile *' *' @limitations Intensification of livestock production and related changes in *' livestock feeding are modelled exogenously. Therefore, the livestock sector From 7239af1f48128d54b449ca5289b4dbfa775da19e Mon Sep 17 00:00:00 2001 From: David Hoetten Date: Thu, 23 May 2024 13:37:04 +0200 Subject: [PATCH 3/8] updated default.cfg and changelog --- CHANGELOG.md | 1 + config/default.cfg | 4 ++++ 2 files changed, 5 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index f3b75a1cb3..6189f3facc 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). ## [Unreleased] ### changed +- **70_livestock** added realization `fbask_jan16_sticky` - **22_land_conservation and default.cfg** Added options for baseline protection - **15_food, default.cfg and scenario_config.csv** changed fader setup and introduced new switches for specifying food substitution scenarios and exogeneous food intake scenarios - **70_livestock, default.cfg and scenario_config.csv** changed fader setup and introduced new switches for specifying feed substitution with SCP scenarios diff --git a/config/default.cfg b/config/default.cfg index f4ec0404f4..d51079889b 100644 --- a/config/default.cfg +++ b/config/default.cfg @@ -1816,6 +1816,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 captial stocks as in sticky_feb18 cfg$gms$livestock <- "fbask_jan16" # def = fbask_jan16 # * Year until the pasture management factor is fixed to 1 @@ -1850,6 +1851,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 From a963021d59bc11ecef8d3813b23f90b0ce9b0a0c Mon Sep 17 00:00:00 2001 From: David Hoetten Date: Mon, 27 May 2024 16:35:02 +0200 Subject: [PATCH 4/8] moved changelog entry to added --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 6189f3facc..3006273180 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,7 +7,6 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). ## [Unreleased] ### changed -- **70_livestock** added realization `fbask_jan16_sticky` - **22_land_conservation and default.cfg** Added options for baseline protection - **15_food, default.cfg and scenario_config.csv** changed fader setup and introduced new switches for specifying food substitution scenarios and exogeneous food intake scenarios - **70_livestock, default.cfg and scenario_config.csv** changed fader setup and introduced new switches for specifying feed substitution with SCP scenarios @@ -17,6 +16,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). - **scripts** start/test_runs.R added 2 more test runs from FSEC ### added +- **70_livestock** added realization `fbask_jan16_sticky` - **default.cfg** added cropland growth constraint `cfg$gms$s30_annual_max_growth` - **default.cfg** added technical cost for missing BII increase `cfg$gms$s44_cost_bii_missing` - **default.cfg** added settings for new price-driven bioenergy realization `1st2ndgen_priced_feb24`: `cfg$gms$s60_2ndgen_bioenergy_dem_min_post_fix`, `cfg$gms$c60_bioenergy_subsidy_fix_SSP2`, `s60_bioenergy_gj_price_1st`, From 32e2b079579b721b340d0ca18c74dec89b413aa9 Mon Sep 17 00:00:00 2001 From: David Hoetten Date: Mon, 27 May 2024 16:38:18 +0200 Subject: [PATCH 5/8] added R generated updated of sections of modules --- .../fbask_jan16_sticky/declarations.gms | 18 ++--- .../fbask_jan16_sticky/postsolve.gms | 72 +++++++++---------- .../fbask_jan16_sticky/preloop.gms | 2 +- 3 files changed, 46 insertions(+), 46 deletions(-) diff --git a/modules/70_livestock/fbask_jan16_sticky/declarations.gms b/modules/70_livestock/fbask_jan16_sticky/declarations.gms index 3a5219f12d..87bfd6c37e 100644 --- a/modules/70_livestock/fbask_jan16_sticky/declarations.gms +++ b/modules/70_livestock/fbask_jan16_sticky/declarations.gms @@ -48,14 +48,14 @@ parameters *#################### 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 costs 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 for livestock production - oq70_investment(t,i,kli,type) Cellular immobile investments into farm capital (mio USD05MER) - oq70_cost_prod_fish(t,i,type) Regional factor input costs for fish production + 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) ##################### diff --git a/modules/70_livestock/fbask_jan16_sticky/postsolve.gms b/modules/70_livestock/fbask_jan16_sticky/postsolve.gms index cb862b38bb..f1607d9519 100644 --- a/modules/70_livestock/fbask_jan16_sticky/postsolve.gms +++ b/modules/70_livestock/fbask_jan16_sticky/postsolve.gms @@ -9,41 +9,41 @@ 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); + 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) ###################### diff --git a/modules/70_livestock/fbask_jan16_sticky/preloop.gms b/modules/70_livestock/fbask_jan16_sticky/preloop.gms index 1d8248a79d..1e223d4a72 100644 --- a/modules/70_livestock/fbask_jan16_sticky/preloop.gms +++ b/modules/70_livestock/fbask_jan16_sticky/preloop.gms @@ -85,4 +85,4 @@ $if "%c70_fac_req_regr%" == "reg" i70_fac_req_livst(t_all,i,kli)$(m_year(t_all) *** Section implementing the "sticky" part of the realization * Get the initial production from the historic data -p70_initial_1995_prod(i,kli) = f70_hist_prod_livst("y1995",i,kli,"dm"); \ No newline at end of file +p70_initial_1995_prod(i,kli) = f70_hist_prod_livst("y1995",i,kli,"dm"); From 0c6897fe5cd0adf8ad4c83856c1a09b95200e47d Mon Sep 17 00:00:00 2001 From: David Hoetten Date: Tue, 28 May 2024 10:36:05 +0200 Subject: [PATCH 6/8] =?UTF-8?q?added=20David=20H=C3=B6tten=20as=20author?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- CITATION.cff | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/CITATION.cff b/CITATION.cff index dfdfa23a75..051c1c18dc 100644 --- a/CITATION.cff +++ b/CITATION.cff @@ -125,6 +125,11 @@ authors: affiliation: "Potsdam Institute for Climate Impact Research" email: janstein@pik-potsdam.de + - family-names: Hötten + given-names: David + affiliation: "Potsdam Institute for Climate Impact Research" + email: davidho@pik-potsdam.de + - family-names: Lotze-Campen given-names: Hermann orcid: https://orcid.org/0000-0002-0003-5508 From 2f09d7f29837ffae0f3d681a0f5442f8af816967 Mon Sep 17 00:00:00 2001 From: DavidhoPIK <101278418+DavidhoPIK@users.noreply.github.com> Date: Tue, 28 May 2024 10:48:16 +0200 Subject: [PATCH 7/8] Update modules/70_livestock/fbask_jan16_sticky/realization.gms Co-authored-by: Jan Dietrich --- modules/70_livestock/fbask_jan16_sticky/realization.gms | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/70_livestock/fbask_jan16_sticky/realization.gms b/modules/70_livestock/fbask_jan16_sticky/realization.gms index b65ae629c8..46ff7d5323 100644 --- a/modules/70_livestock/fbask_jan16_sticky/realization.gms +++ b/modules/70_livestock/fbask_jan16_sticky/realization.gms @@ -88,7 +88,7 @@ *' of more capital intensive livestock systems with already established stocks. *' *' The realization is based on the `sticky_feb18` factor cost realization, but -*' also differs from it in some ways. At the creation time the main differences where: +*' also differs from it in some ways. At the creation time the main differences were: *' 1. capital stocks are on the regional level not on cluster level *' 2. no differentiation of mobile and immobile capital - all capital stocks are immobile *' From c26b75f839fbd6c8db9fb4ed105e5465b5eaaa51 Mon Sep 17 00:00:00 2001 From: DavidhoPIK <101278418+DavidhoPIK@users.noreply.github.com> Date: Fri, 21 Jun 2024 11:56:27 +0200 Subject: [PATCH 8/8] corrected type --- config/default.cfg | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config/default.cfg b/config/default.cfg index dea1e9fa64..8113d8b4e3 100644 --- a/config/default.cfg +++ b/config/default.cfg @@ -1905,7 +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 captial stocks as in sticky_feb18 +# * (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