Skip to content
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
36 changes: 36 additions & 0 deletions config/default.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -707,6 +707,29 @@ cfg$gms$s21_trade_tariff_targetyear <- 2050
# * (inflated from default originally in USD05 using USD05 --> USD17 inflation rate:1.23)
cfg$gms$s21_min_trade_margin_forestry <- 62 # def = 50 * 1.23

# * ISO codes of the region(s) subject to the self-sufficiency floor below (e.g. "BRA");
# * default = all countries. Works exactly like policy_countries56: a region is included
# * only if all of its countries are listed, because the trade balance (like the cap) is a
# * hard region-level constraint and can't apply to only part of a region.
cfg$gms$policy_countries21 <- all_iso_countries # def = all_iso_countries

# * Minimum self-sufficiency floor: require production >= s21_forcesuff_value *
# * f21_self_suff * demand for the commodities in forcesuff21, in the regions selected
# * via policy_countries21, from sm_fix_SSP2 onwards. One-sided floor (binds only from
# * below). This subsumes the former wood-only switch: to force wood/woodfuel
# * self-sufficiency, include them in forcesuff21. 1 = on, 0 = unchanged develop behaviour.
cfg$gms$s21_force_selfsuff <- 0 # def = 0
# * Commodities subject to the floor (subset of k_trade). Empty by default (no-op);
# * populate to protect exports, e.g. for BRA net exporters:
# * "wood, woodfuel, soybean, oilcakes, oils, maiz, sugar, livst_rum, livst_chick".
cfg$gms$forcesuff21 <- "" # def = empty (no commodities)
# * Retention fraction of the 2025 baseline self-sufficiency (production / demand),
# * held as a floor for every future timestep when s21_force_selfsuff = 1. The floor
# * tracks f21_self_suff (constant over time), so it holds each commodity's 2025
# * export/import intensity. No baseline run needed.
# * 1 = freeze exactly at 2025; 0.9 = allow at most ~10% erosion below 2025.
cfg$gms$s21_forcesuff_value <- 1 # def = 1


# ***--------------------- 22_land_conservation --------------------------------------
# * (area_based_apr22): Area-based conservation (baseline and future)
Expand Down Expand Up @@ -1616,6 +1639,14 @@ cfg$gms$s56_emis_cap_start <- 2025
cfg$gms$s56_emis_cap_penalty <- 1e5
cfg$gms$c56_cap_policy <- "reddnatveg_nosoil"
cfg$gms$s56_source_bounds_on <- 0
# continuous parametric regional cap (overrides the cs3 path when =1; applied to
# the regions selected via policy_countries56). Free before start_year, linear
# ramp start_value -> target by target_year, held at target afterwards.
cfg$gms$s56_emis_cap_parametric <- 0 # def = 0 (cs3 path used)
cfg$gms$s56_emis_cap_start_year <- 2035 # def = 2035
cfg$gms$s56_emis_cap_start_value <- 600 # def = 600
cfg$gms$s56_emis_cap_target_year <- 2050 # def = 2050
cfg$gms$s56_emis_cap_target <- 0 # def = 0

# * Switch for scaling GHG price with development state (1=on 0=off)
cfg$gms$s56_ghgprice_devstate_scaling <- 0 # def = 0
Expand Down Expand Up @@ -1847,6 +1878,11 @@ cfg$gms$s57_maxmac_n_awms <- -1 # def = -1
cfg$gms$s57_maxmac_ch4_rice <- -1 # def = -1
cfg$gms$s57_maxmac_ch4_entferm <- -1 # def = -1
cfg$gms$s57_maxmac_ch4_awms <- -1 # def = -1
# optional linear fade-in of the prescribed s57_maxmac steps over time
# (fadein=0 reproduces the flat baseline; only relevant when s57_maxmac_* >= 0)
cfg$gms$s57_maxmac_fadein <- 0 # def = 0
cfg$gms$s57_maxmac_fadein_start <- 2025 # def = 2025
cfg$gms$s57_maxmac_fadein_end <- 2050 # def = 2050

# ***--------------------- 58_peatland ------------------------------------
# * (off): Peatland area and associated GHG emissions are assumed zero
Expand Down
1 change: 1 addition & 0 deletions modules/14_yields/managementcalib_aug19/declarations.gms
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ parameters
i14_lambda_yields(t,i,kcr) Scaling factor for non-linear management calibration (1)
i14_managementcalib(t,j,kcr,w) Regional management calibration factor accounting for FAO yield levels (1)
im_growing_stock(t,j,ac,land_timber) Harvestable stem biomass per ha by age class (tDM per ha)
im_growing_stock_ysf(t,j,ac) Harvestable stem biomass per ha by age class for young secondary forest on other land (tDM per ha)
pm_yields_semi_calib(j,kve,w) Potential yields calibrated to FAO regional levels (tDM per ha per yr)
i14_calib_yields_hist(i,w) Calibrated yields average over region and crop type at the historical reference year (tDM per ha per yr)
i14_calib_yields_ratio(i) Irrigated to rainfed yield ratio for calibrated yields (1)
Expand Down
20 changes: 20 additions & 0 deletions modules/14_yields/managementcalib_aug19/presolve.gms
Original file line number Diff line number Diff line change
Expand Up @@ -57,9 +57,29 @@ im_growing_stock(t,j,ac,"other") =
)
;

*' Young secondary forest on other land (`youngsecdf` in [35_natveg]) is forest
*' regrowth from natural succession. Its carbon stock follows the uncalibrated
*' natveg curve `pm_carbon_density_secdforest_ac_uncalib` (set in [52_carbon]),
*' NOT the FRA-calibrated secondary-forest curve. The harvestable growing stock
*' must be derived from the SAME (uncalibrated) curve so that wood yield and
*' carbon stock are consistent; using the calibrated `secdforest` growing stock
*' would decouple high wood yield from low booked carbon. The aboveground
*' fraction is that of secondary forest, because youngsecdf is forest biomass.

im_growing_stock_ysf(t,j,ac) =
(
pm_carbon_density_secdforest_ac_uncalib(t,j,ac,"vegc")
/ sm_carbon_fraction
* fm_aboveground_fraction("secdforest")
/ sum(clcl, pm_climate_class(j,clcl) * fm_ipcc_bef(clcl))
)
;

*' @stop

** Hard constraint to always have a positive number in im_growing_stock
im_growing_stock(t,j,ac,land_timber) = im_growing_stock(t,j,ac,land_timber)$(im_growing_stock(t,j,ac,land_timber) > 0) + 0.0001$(im_growing_stock(t,j,ac,land_timber) = 0);
im_growing_stock_ysf(t,j,ac) = im_growing_stock_ysf(t,j,ac)$(im_growing_stock_ysf(t,j,ac) > 0) + 0.0001$(im_growing_stock_ysf(t,j,ac) = 0);
** Set growing stock to 0 where it does not exceed a minimum for harvest
im_growing_stock(t,j,ac,land_natveg)$(im_growing_stock(t,j,ac,land_natveg) < s14_minimum_growing_stock) = 0;
im_growing_stock_ysf(t,j,ac)$(im_growing_stock_ysf(t,j,ac) < s14_minimum_growing_stock) = 0;
7 changes: 6 additions & 1 deletion modules/21_trade/selfsuff_reduced/declarations.gms
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,10 @@
*** | Contact: magpie@pik-potsdam.de

parameters
i21_trade_bal_reduction(t_all,k_trade) Trade balance reduction (1)
p21_country_switch(iso) Switch: country selected for the forced self-sufficiency floor (1)
p21_selfsuff_region(h) Superregions eligible for the self-sufficiency floor (1=fully selected via policy_countries21) (1)
i21_min_selfsuff(t_all,h,k_trade) Minimum self-sufficiency ratio floor applied to forcesuff21 commodities (1)
i21_trade_bal_reduction(t_all,h,k_trade) Trade balance reduction (1)
i21_exp_shr(t_all,h,k_trade) Trade export shr (1)
i21_trade_margin(h,k_trade) Trade margins (USD17MER per tDM)
i21_trade_tariff(h,k_trade) Trade tariffs (USD17MER per tDM)
Expand All @@ -28,6 +31,7 @@ equations
q21_notrade(h,k_notrade) Superregional production constraint of non-tradable commodities (mio. tDM per yr)
q21_trade_reg(h,k_trade) Superregional trade balances i.e. minimum self-sufficiency ratio (1)
q21_trade_reg_up(h,k_trade) Superregional trade balances i.e. maximum self-sufficiency ratio (1)
q21_min_selfsuff(h,k_trade) Superregional minimum self-sufficiency floor (mio. tDM per yr)
q21_excess_dem(k_trade) Global excess demand (mio. tDM per yr)
q21_excess_supply(h,k_trade) Superregional excess production (mio. tDM per yr)
q21_cost_trade_tariff(h) Superregional tariff costs (mio. USD17MER per yr)
Expand All @@ -47,6 +51,7 @@ parameters
oq21_notrade(t,h,k_notrade,type) Superregional production constraint of non-tradable commodities (mio. tDM per yr)
oq21_trade_reg(t,h,k_trade,type) Superregional trade balances i.e. minimum self-sufficiency ratio (1)
oq21_trade_reg_up(t,h,k_trade,type) Superregional trade balances i.e. maximum self-sufficiency ratio (1)
oq21_min_selfsuff(t,h,k_trade,type) Superregional minimum self-sufficiency floor (mio. tDM per yr)
oq21_excess_dem(t,k_trade,type) Global excess demand (mio. tDM per yr)
oq21_excess_supply(t,h,k_trade,type) Superregional excess production (mio. tDM per yr)
oq21_cost_trade_tariff(t,h,type) Superregional tariff costs (mio. USD17MER per yr)
Expand Down
15 changes: 13 additions & 2 deletions modules/21_trade/selfsuff_reduced/equations.gms
Original file line number Diff line number Diff line change
Expand Up @@ -31,15 +31,26 @@
q21_trade_reg(h2,k_trade)..
sum(supreg(h2,i2),vm_prod_reg(i2,k_trade)) =g=
m21_baseline_production(vm_supply, v21_excess_prod, f21_self_suff)
* sum(ct,i21_trade_bal_reduction(ct,k_trade))
* sum(ct,i21_trade_bal_reduction(ct,h2,k_trade))
- v21_import_for_feasibility(h2,k_trade);

*' Upper bound for production.

q21_trade_reg_up(h2,k_trade) ..
sum(supreg(h2,i2),vm_prod_reg(i2,k_trade)) =l=
m21_baseline_production(vm_supply, v21_excess_prod, f21_self_suff)
/ sum(ct,i21_trade_bal_reduction(ct,k_trade));
/ sum(ct,i21_trade_bal_reduction(ct,h2,k_trade));

*' Optional minimum self-sufficiency floor: for the commodities in `forcesuff21` and
*' the regions selected via `policy_countries21`, superregional production must cover
*' at least `i21_min_selfsuff` (= `s21_forcesuff_value` x the 2025 baseline
*' self-sufficiency) times superregional demand -- a one-sided lower bound holding each
*' commodity's 2025 trade intensity. Inactive (`i21_min_selfsuff` = 0) leaves develop
*' behaviour unchanged.

q21_min_selfsuff(h2,k_trade)$(sum(ct,i21_min_selfsuff(ct,h2,k_trade)) > 0)..
sum(supreg(h2,i2),vm_prod_reg(i2,k_trade)) =g=
sum(ct,i21_min_selfsuff(ct,h2,k_trade)) * sum(supreg(h2,i2),vm_supply(i2,k_trade));

*' The global excess demand of each tradable good `v21_excess_demad` equals to
*' the sum over all the imports of importing superregions.
Expand Down
32 changes: 32 additions & 0 deletions modules/21_trade/selfsuff_reduced/input.gms
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,44 @@ $setglobal c21_trade_liberalization l909090r808080
sets
k_import21(k_trade) Commodities that can have additional imports to maintain feasibility
/ wood, woodfuel /

forcesuff21(k_trade) Commodities forced to a minimum self-sufficiency floor for the (fully selected) regions in policy_countries21 (empty by default)
/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,VNM,VUT,WLF,WSM,YEM,ZAF,ZMB,ZWE /
;

scalars
s21_trade_tariff Trade tariff switch (1=on 0=off) (1) / 1 /
s21_cost_import Cost for additional imports to maintain feasibility (USD17MER per tDM) / 1500 /
s21_min_trade_margin_forestry Minimum trade margin for forestry products (USD17MER per tDM) / 62 /
s21_force_selfsuff Force a minimum self-sufficiency floor (s21_forcesuff_value) on the forcesuff21 commodities for the regions selected via policy_countries21 (1=on 0=off) (1) / 0 /
s21_forcesuff_value Fraction of the 2025 baseline self-sufficiency (f21_self_suff) held as a floor when s21_force_selfsuff=1 (1=freeze exports and imports at their 2025 intensity) (1) / 1 /
;

table f21_trade_bal_reduction(t_all,trade_groups21,trade_regime21) Share of inelastic trade pool (1)
Expand Down
4 changes: 4 additions & 0 deletions modules/21_trade/selfsuff_reduced/postsolve.gms
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
oq21_notrade(t,h,k_notrade,"marginal") = q21_notrade.m(h,k_notrade);
oq21_trade_reg(t,h,k_trade,"marginal") = q21_trade_reg.m(h,k_trade);
oq21_trade_reg_up(t,h,k_trade,"marginal") = q21_trade_reg_up.m(h,k_trade);
oq21_min_selfsuff(t,h,k_trade,"marginal") = q21_min_selfsuff.m(h,k_trade);
oq21_excess_dem(t,k_trade,"marginal") = q21_excess_dem.m(k_trade);
oq21_excess_supply(t,h,k_trade,"marginal") = q21_excess_supply.m(h,k_trade);
oq21_cost_trade_tariff(t,h,"marginal") = q21_cost_trade_tariff.m(h);
Expand All @@ -31,6 +32,7 @@
oq21_notrade(t,h,k_notrade,"level") = q21_notrade.l(h,k_notrade);
oq21_trade_reg(t,h,k_trade,"level") = q21_trade_reg.l(h,k_trade);
oq21_trade_reg_up(t,h,k_trade,"level") = q21_trade_reg_up.l(h,k_trade);
oq21_min_selfsuff(t,h,k_trade,"level") = q21_min_selfsuff.l(h,k_trade);
oq21_excess_dem(t,k_trade,"level") = q21_excess_dem.l(k_trade);
oq21_excess_supply(t,h,k_trade,"level") = q21_excess_supply.l(h,k_trade);
oq21_cost_trade_tariff(t,h,"level") = q21_cost_trade_tariff.l(h);
Expand All @@ -46,6 +48,7 @@
oq21_notrade(t,h,k_notrade,"upper") = q21_notrade.up(h,k_notrade);
oq21_trade_reg(t,h,k_trade,"upper") = q21_trade_reg.up(h,k_trade);
oq21_trade_reg_up(t,h,k_trade,"upper") = q21_trade_reg_up.up(h,k_trade);
oq21_min_selfsuff(t,h,k_trade,"upper") = q21_min_selfsuff.up(h,k_trade);
oq21_excess_dem(t,k_trade,"upper") = q21_excess_dem.up(k_trade);
oq21_excess_supply(t,h,k_trade,"upper") = q21_excess_supply.up(h,k_trade);
oq21_cost_trade_tariff(t,h,"upper") = q21_cost_trade_tariff.up(h);
Expand All @@ -61,6 +64,7 @@
oq21_notrade(t,h,k_notrade,"lower") = q21_notrade.lo(h,k_notrade);
oq21_trade_reg(t,h,k_trade,"lower") = q21_trade_reg.lo(h,k_trade);
oq21_trade_reg_up(t,h,k_trade,"lower") = q21_trade_reg_up.lo(h,k_trade);
oq21_min_selfsuff(t,h,k_trade,"lower") = q21_min_selfsuff.lo(h,k_trade);
oq21_excess_dem(t,k_trade,"lower") = q21_excess_dem.lo(k_trade);
oq21_excess_supply(t,h,k_trade,"lower") = q21_excess_supply.lo(h,k_trade);
oq21_cost_trade_tariff(t,h,"lower") = q21_cost_trade_tariff.lo(h);
Expand Down
28 changes: 24 additions & 4 deletions modules/21_trade/selfsuff_reduced/preloop.gms
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,34 @@
*' with sm_fix_SSP2 to keep values matching historical data until then.
loop(t_all,
if(m_year(t_all) <= sm_fix_SSP2,
i21_trade_bal_reduction(t_all,k_trade)=f21_trade_bal_reduction(t_all,"easytrade","l909090r808080");
i21_trade_bal_reduction(t_all,k_hardtrade21)=f21_trade_bal_reduction(t_all,"hardtrade","l909090r808080");
i21_trade_bal_reduction(t_all,h,k_trade)=f21_trade_bal_reduction(t_all,"easytrade","l909090r808080");
i21_trade_bal_reduction(t_all,h,k_hardtrade21)=f21_trade_bal_reduction(t_all,"hardtrade","l909090r808080");
else
i21_trade_bal_reduction(t_all,k_trade)=f21_trade_bal_reduction(t_all,"easytrade","%c21_trade_liberalization%");
i21_trade_bal_reduction(t_all,k_hardtrade21)=f21_trade_bal_reduction(t_all,"hardtrade","%c21_trade_liberalization%");
i21_trade_bal_reduction(t_all,h,k_trade)=f21_trade_bal_reduction(t_all,"easytrade","%c21_trade_liberalization%");
i21_trade_bal_reduction(t_all,h,k_hardtrade21)=f21_trade_bal_reduction(t_all,"hardtrade","%c21_trade_liberalization%");
);
);

*' Region mask for the optional self-sufficiency floor (below): a superregion h is
*' eligible only if ALL its countries are in policy_countries21 (forcing self-sufficiency
*' on a partial superregion is not meaningful) -- i.e. every country in every region it
*' contains (supreg(h,i), i_to_iso(i,iso)) is selected; an empty / partially-selected
*' superregion makes it a no-op. Mirrors the region mask in module 56.
p21_country_switch(iso) = 0;
p21_country_switch(policy_countries21) = 1;
p21_selfsuff_region(h) = 1$(sum((supreg(h,i), i_to_iso(i,iso)), 1 - p21_country_switch(iso)) = 0);

*' Optional minimum self-sufficiency floor: for the commodities in forcesuff21 (empty by
*' default) and the fully-selected regions in policy_countries21, hold self-sufficiency at
*' (s21_forcesuff_value x) its 2025 baseline level from sm_fix_SSP2 onwards, enforced by
*' q21_min_selfsuff. The floor tracks the input f21_self_suff (constant over time), so it
*' holds each commodity's 2025 export/import intensity. This subsumes the former wood-only
*' switch: to force wood/woodfuel self-sufficiency simply include them in forcesuff21.
*' s21_forcesuff_value = 1 freezes exactly at 2025; < 1 allows some erosion. Empty
*' forcesuff21 / s21_force_selfsuff = 0 keeps develop behaviour unchanged.
i21_min_selfsuff(t_all,h,k_trade) = 0;
i21_min_selfsuff(t_all,h,forcesuff21)$(s21_force_selfsuff = 1 AND p21_selfsuff_region(h) AND m_year(t_all) > sm_fix_SSP2) = s21_forcesuff_value * f21_self_suff(t_all,h,forcesuff21);

i21_exports(t_all,h,k_trade) = ((f21_self_suff(t_all,h,k_trade) * f21_dom_supply(t_all,h,k_trade)) - f21_dom_supply(t_all,h,k_trade))$(f21_self_suff(t_all,h,k_trade) > 1);
i21_exp_glo(t_all,k_trade) = sum(h, i21_exports(t_all,h,k_trade));
i21_exp_shr(t_all,h,k_trade) = i21_exports(t_all,h,k_trade) / (i21_exp_glo(t_all,k_trade) + 0.001$(i21_exp_glo(t_all,k_trade) = 0));
Expand Down
2 changes: 1 addition & 1 deletion modules/35_natveg/pot_forest_may24/equations.gms
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@ q35_prod_other(j2)..
sum(kforestry, vm_prod_natveg(j2,"other",kforestry))
=e=
(sum(ac_sub, v35_hvarea_other(j2,"othernat",ac_sub) * sum(ct, im_growing_stock(ct,j2,ac_sub,"other")))
+ sum(ac_sub, v35_hvarea_other(j2,"youngsecdf",ac_sub) * sum(ct, im_growing_stock(ct,j2,ac_sub,"secdforest"))))
+ sum(ac_sub, v35_hvarea_other(j2,"youngsecdf",ac_sub) * sum(ct, im_growing_stock_ysf(ct,j2,ac_sub))))
/ m_timestep_length_forestry
;

Expand Down
2 changes: 2 additions & 0 deletions modules/56_ghg_policy/cap_apr26_reg/declarations.gms
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@ parameters
p56_gwp(pollutants) AR5 GWP factors for CO2eq conversion (Tg CO2eq per Tg native unit)
p56_cap_mask(emis_source,pollutants) Policy mask for cap scope: 1=included 0=excluded (1)
p56_emis_cap(t_all,i) Active regional AFOLU cap per region (Tg CO2eq per yr)
p56_cap_region(i) Regions the parametric cap applies to (1=capped derived from policy_countries56) (1)
p56_emis_cap_param(t_all) Parametric cap trajectory over time (Tg CO2eq per yr)
p56_emis_cap_slack(t,i) Regional slack level — platform infeasibility signal (Tg CO2eq per yr)
* ov56_emis_co2eq declared here (not in R section) because it is computed manually
* in postsolve rather than copied from a GAMS variable attribute (.l/.m/.up/.lo).
Expand Down
Loading