From 3ffe1fc10d6e0d3e620560329e057c532f8b70fc Mon Sep 17 00:00:00 2001 From: David Chen Date: Sat, 31 Aug 2024 13:43:20 +0200 Subject: [PATCH 001/206] update units to 2017USD --- CHANGELOG.md | 3 ++ config/default.cfg | 44 +++++++++---------- modules/09_drivers/aug17/declarations.gms | 22 +++++----- modules/09_drivers/aug17/input.gms | 4 +- .../10_land/landmatrix_dec18/declarations.gms | 8 ++-- modules/10_land/landmatrix_dec18/input.gms | 2 +- modules/11_costs/default/declarations.gms | 16 +++---- modules/13_tc/endo_jan22/declarations.gms | 26 +++++------ modules/13_tc/exo/declarations.gms | 10 ++--- .../15_food/anthro_iso_jun22/declarations.gms | 26 +++++------ modules/15_food/anthro_iso_jun22/input.gms | 2 +- .../15_food/anthropometrics_jan18/input.gms | 2 +- .../flexcluster_jul23/declarations.gms | 8 ++-- .../18_residues/flexcluster_jul23/input.gms | 2 +- .../flexreg_apr16/declarations.gms | 8 ++-- modules/18_residues/flexreg_apr16/input.gms | 2 +- modules/18_residues/off/declarations.gms | 4 +- .../substitution_may21/declarations.gms | 14 +++--- .../substitution_may21/input.gms | 2 +- modules/21_trade/exo/declarations.gms | 4 +- modules/21_trade/free_apr16/declarations.gms | 8 ++-- modules/21_trade/off/declarations.gms | 4 +- .../selfsuff_reduced/declarations.gms | 20 ++++----- modules/21_trade/selfsuff_reduced/input.gms | 8 ++-- .../declarations.gms | 36 +++++++-------- .../selfsuff_reduced_bilateral22/input.gms | 8 ++-- .../29_cropland/detail_apr24/declarations.gms | 28 ++++++------ modules/29_cropland/detail_apr24/input.gms | 10 ++--- .../29_cropland/simple_apr24/declarations.gms | 4 +- .../30_croparea/detail_apr24/declarations.gms | 20 ++++----- modules/30_croparea/detail_apr24/input.gms | 4 +- .../30_croparea/simple_apr24/declarations.gms | 10 ++--- modules/30_croparea/simple_apr24/input.gms | 2 +- modules/31_past/endo_jun13/declarations.gms | 8 ++-- modules/31_past/endo_jun13/input.gms | 2 +- .../31_past/grasslands_apr22/declarations.gms | 16 +++---- modules/31_past/grasslands_apr22/input.gms | 4 +- .../31_past/grasslands_apr22/realization.gms | 2 +- modules/34_urban/exo_nov21/input.gms | 2 +- modules/36_employment/exo_may22/input.gms | 6 +-- .../per_ton_fao_may22/declarations.gms | 14 +++--- .../per_ton_fao_may22/input.gms | 4 +- .../sticky_feb18/declarations.gms | 38 ++++++++-------- .../38_factor_costs/sticky_feb18/input.gms | 4 +- .../sticky_labor/declarations.gms | 42 +++++++++--------- .../38_factor_costs/sticky_labor/input.gms | 4 +- .../39_landconversion/calib/declarations.gms | 12 ++--- modules/39_landconversion/calib/input.gms | 10 ++--- .../40_transport/gtap_nov12/declarations.gms | 8 ++-- modules/40_transport/gtap_nov12/input.gms | 4 +- modules/40_transport/off/declarations.gms | 4 +- .../agr_sector_aug13/declarations.gms | 10 ++--- .../agr_sector_aug13/input.gms | 2 +- .../all_sectors_aug13/declarations.gms | 10 ++--- .../all_sectors_aug13/input.gms | 2 +- .../macceff_aug22/declarations.gms | 8 ++-- .../50_nr_soil_budget/macceff_aug22/input.gms | 2 +- modules/54_phosphorus/off/declarations.gms | 4 +- .../price_aug22/declarations.gms | 42 +++++++++--------- modules/56_ghg_policy/price_aug22/input.gms | 8 ++-- modules/57_maccs/on_aug22/input.gms | 2 +- modules/58_peatland/off/declarations.gms | 4 +- modules/58_peatland/v2/declarations.gms | 26 +++++------ modules/58_peatland/v2/input.gms | 12 ++--- .../1st2ndgen_priced_feb24/declarations.gms | 14 +++--- .../1st2ndgen_priced_feb24/input.gms | 8 ++-- .../1stgen_priced_dec18/declarations.gms | 8 ++-- .../1stgen_priced_dec18/input.gms | 2 +- .../70_livestock/fbask_jan16/declarations.gms | 10 ++--- modules/70_livestock/fbask_jan16/input.gms | 2 +- .../fbask_jan16_sticky/declarations.gms | 18 ++++---- .../70_livestock/fbask_jan16_sticky/input.gms | 2 +- .../foragebased_aug18/declarations.gms | 10 ++--- .../foragebased_jul23/declarations.gms | 10 ++--- modules/71_disagg_lvst/off/declarations.gms | 4 +- .../lp_nlp_apr17/declarations.gms | 2 +- 76 files changed, 390 insertions(+), 387 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 41ce60ac3a..d8e63c0ff3 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -14,6 +14,9 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). - **80_optimization** abort GAMS in case of execution errors - **script** updated EATLancet project start scripts - **script** replaced gdx package with gdx2 package calls +- **inputdata** changed GDP base year from 2005USD to 2017USD +- **config** changed default input data to use 2017USD +- **module_documentation** all references to USD05 changed to USD17 ### added - **scripts** added output report `EU_report.R` that uses `EU_report.Rmd` diff --git a/config/default.cfg b/config/default.cfg index 5766d8a374..1bc02d6040 100644 --- a/config/default.cfg +++ b/config/default.cfg @@ -206,7 +206,7 @@ cfg$gms$sm_fix_cc <- 2025 # * (landmatrix_dec18): includes a land transition matrix cfg$gms$land <- "landmatrix_dec18" # def = landmatrix_dec18 -# * Artificial cost for balance variables (USD05MER per ha) +# * Artificial cost for balance variables (USD17MER per ha) # * The balance variables in the land module avoid infeasibilities due to # * differences in accuracy between parameters and variables in GAMS. # * High costs make sure that the balance variables are only used as a last resort. @@ -585,7 +585,7 @@ cfg$gms$trade <- "selfsuff_reduced" # def = selfsuff_reduced # * options for `selfsuff_reduced` and `selfsuff_reduced_bilateral22` realizations: # * Commodities that can have additional imports to maintain feasibility cfg$gms$k_import21 <- "wood, woodfuel" -# * Cost for additional imports to maintain feasibility in USD05MER per tDM +# * Cost for additional imports to maintain feasibility in USD17MER per tDM cfg$gms$s21_cost_import <- 10000 # def = 10000 # * trade balance reduction scenario @@ -619,7 +619,7 @@ cfg$gms$s21_trade_tariff_startyear <- 2025 # * end year of fadeout if s21_trade_tariff_fadeout = 1 # def = 2050 cfg$gms$s21_trade_tariff_targetyear <- 2050 -# * Minimum trade margin for forestry products (USD05MER per tDM) +# * Minimum trade margin for forestry products (USD17MER per tDM) cfg$gms$s21_min_trade_margin_forestry <- 50 # def = 50 @@ -757,13 +757,13 @@ cfg$gms$s29_treecover_max <- 0.4 # def = 0.4 cfg$gms$s29_treecover_scenario_start <- 2025 # def = 2025 # * Target year of fader (year when full implementation is reached) cfg$gms$s29_treecover_scenario_target <- 2050 # def = 2050 -# * Penalty for violation of treecover target before scenario start (USD05MER per ha) +# * Penalty for violation of treecover target before scenario start (USD17MER per ha) cfg$gms$s29_treecover_penalty_before <- 5000 # def = 5000 -# * Penalty for violation of treecover target after scenario start (USD05MER per ha) +# * Penalty for violation of treecover target after scenario start (USD17MER per ha) cfg$gms$s29_treecover_penalty <- 5000 # def = 5000 -# * Tree cover establishment cost (USD05MER per ha) +# * Tree cover establishment cost (USD17MER per ha) cfg$gms$s29_cost_treecover_est <- 2000 # def = 2000 -# * Tree cover recurring cost (USD05MER per ha) +# * Tree cover recurring cost (USD17MER per ha) cfg$gms$s29_cost_treecover_recur <- 500 # def = 500 # * Sigmoid fader for minimum area share of fallow land on total cropland at cluster level @@ -775,7 +775,7 @@ cfg$gms$s29_fallow_max <- 0.4 # def = 0.4 cfg$gms$s29_fallow_scenario_start <- 2025 # def = 2025 # * Target year of fader (year when full implementation is reached) cfg$gms$s29_fallow_scenario_target <- 2050 # def = 2050 -# * Penalty for violation of fallow land target (USD05MER per ha) +# * Penalty for violation of fallow land target (USD17MER per ha) cfg$gms$s29_fallow_penalty <- 500 # def = 500 # ***--------------------- 30_croparea --------------------------------------- @@ -814,7 +814,7 @@ cfg$gms$s30_betr_target_noselect <- 0 # def = 0 cfg$gms$s30_betr_scenario_start <- 2025 # def = 2025 # * Target year of fader (year when full implementation is reached) cfg$gms$s30_betr_scenario_target <- 2050 # def = 2050 -# * Penalty for violation of the target (USD05MER per ha) +# * Penalty for violation of the target (USD17MER per ha) cfg$gms$s30_betr_penalty <- 2000 # def = 2000 # * Allowed annual cropland growth per year per region, relative to the current cropland level @@ -1161,15 +1161,15 @@ cfg$gms$s38_target_fulfillment <- 0.5 # default 0.5 # * (calib): Costs for cropland expansion are scaled with a regional calibration factor # * Costs for pasture and forestry expansion are global static cfg$gms$landconversion <- "calib" # def = calib -# * Cost for cropland expansion before calibration (USD05MER per hectare) +# * Cost for cropland expansion before calibration (USD17MER per hectare) cfg$gms$s39_cost_establish_crop <- 10000 #def = 10000 -# * Reward for cropland reduction before calibration (USD05MER per hectare) +# * Reward for cropland reduction before calibration (USD17MER per hectare) cfg$gms$s39_reward_crop_reduction <- 6000 -# * Cost for pasture land expansion (USD05MER per hectare) +# * Cost for pasture land expansion (USD17MER per hectare) cfg$gms$s39_cost_establish_past <- 8000 #def = 8000 -# * Cost for foresty land expansion (USD05MER per hectare) +# * Cost for foresty land expansion (USD17MER per hectare) cfg$gms$s39_cost_establish_forestry <- 1000 #def = 1000 -# * Cost for urban land expansion (USD05MER per hectare) +# * Cost for urban land expansion (USD17MER per hectare) cfg$gms$s39_cost_establish_urban <- 10000 #def = 10000 # * Switch for ignoring land conversion cost calibration factors # * Options: 1 (ignore calibration factors) @@ -1629,11 +1629,11 @@ cfg$gms$s56_c_price_exp_aff <- 50 # def = 50 # * Values > 0 will reduce the incentive for c-price-induced re/afforestation cfg$gms$s56_buffer_aff <- 0.5 # def = 0.5 -# * Upper limit for CH4 and N2O GHG price (USD05MER per tC) +# * Upper limit for CH4 and N2O GHG price (USD17MER per tC) # * Limits GHG prices selected in c56_pollutant_prices to the chosen value. -# * CH4 and N2O GHG prices are limited by default to 4000 USD05MER per tC equivalent, +# * CH4 and N2O GHG prices are limited by default to 4000 USD17MER per tC equivalent, # * which induces the maximum abatement possible with c57_macc_version = "PBL_2022" -# * Beyond 4000 USD05MER per tC equivalent no further technical mitigation is possible +# * Beyond 4000 USD17MER per tC equivalent no further technical mitigation is possible # * but would increase agricultural prices. # * Suggested limits for different c57_macc_version settings # * PBL_2007: 1000 (200 steps, 5 USD each) @@ -1719,18 +1719,18 @@ cfg$gms$peatland <- "v2" # def = v2 # * Inf (on) cfg$gms$s58_rewetting_switch <- Inf # def = Inf -# * One-time and recurring costs for peatland rewetting (USD05MER per ha) +# * One-time and recurring costs for peatland rewetting (USD17MER per ha) cfg$gms$s58_cost_rewet_onetime <- 7000 # def = 7000 cfg$gms$s58_cost_rewet_recur <- 200 # def = 200 -# * One-time and recurring costs for peatland drainage (USD05MER per ha) +# * One-time and recurring costs for peatland drainage (USD17MER per ha) # * One-time costs apply on the drainage of intact and rewetted peatland # * Recurring costs apply on the level of drained and managed peatland cfg$gms$s58_cost_drain_intact_onetime <- 0 # def = 0 cfg$gms$s58_cost_drain_rewet_onetime <- 0 # def = 0 cfg$gms$s58_cost_drain_recur <- 0 # def = 0 -# * Penalty for technical peatland balance term (USD05MER) +# * Penalty for technical peatland balance term (USD17MER) cfg$gms$s58_balance_penalty <- 1000000 # def = 1000000 # * Switch for fixing peatland area until the year given by s58_fix_peatland to historic levels (not available in `off`). @@ -1875,7 +1875,7 @@ cfg$gms$c60_biodem_level <- 1 # def = 1 # * Therefore, the minimum demand is of particular importance for the coupling with REMIND. cfg$gms$s60_2ndgen_bioenergy_dem_min <- 1 # def = 1 -# * t DM-based first generation bioenergy subsidy (USD05MER per ton) +# * t DM-based first generation bioenergy subsidy (USD17MER per ton) # * (1stgen_priced_dec18): c60_bioenergy_subsidy is applied constant over historic and model horizon, c60_bioenergy_subsidy_fix_SSP2 has no effect # * (1st2ndgen_priced_feb24): c60_bioenergy_subsidy_fix_SSP2 is applied constant to historic time steps (up until sm_fix_SSP2). # * c60_bioenergy_subsidy is applied constant to model horizon (after sm_fix_SSP2) @@ -1890,7 +1890,7 @@ cfg$gms$c60_bioenergy_subsidy_fix_SSP2 <- 300 # def = 300 # * This can be used to set model horizon minimum demand to 0 for price-driven runs cfg$gms$s60_2ndgen_bioenergy_dem_min_post_fix <- 1 # def = 1 -# * GJ-based bioenergy subsidy (USD05MER per GJ), only used in 1st2ndgen_priced_feb24 +# * GJ-based bioenergy subsidy (USD17MER per GJ), only used in 1st2ndgen_priced_feb24 # * Target prices for 1st and 2nd gen bioenergy cfg$gms$s60_bioenergy_gj_price_1st <- 0 # def = 0 cfg$gms$s60_bioenergy_price_2nd <- 0 # def = 0 diff --git a/modules/09_drivers/aug17/declarations.gms b/modules/09_drivers/aug17/declarations.gms index 004c7bc854..1b4ec2307a 100644 --- a/modules/09_drivers/aug17/declarations.gms +++ b/modules/09_drivers/aug17/declarations.gms @@ -12,21 +12,21 @@ parameters i09_pop_raw(t_all,i,pop_gdp_scen09) Population (mio. per yr) * GDP in MER - i09_gdp_mer_iso(t_all,iso) Income in market exchange rates (mio. USD05MER per yr) - im_gdp_pc_mer_iso(t_all,iso) Income in market exchange rates (mio. USD05MER per yr) - i09_gdp_mer_raw(t_all,i,pop_gdp_scen09) Income in market exchange rates (mio. USD05MER per yr) + i09_gdp_mer_iso(t_all,iso) Income in market exchange rates (mio. USD17MER per yr) + im_gdp_pc_mer_iso(t_all,iso) Income in market exchange rates (mio. USD17MER per yr) + i09_gdp_mer_raw(t_all,i,pop_gdp_scen09) Income in market exchange rates (mio. USD17MER per yr) - i09_gdp_pc_mer_raw(t_all,i,pop_gdp_scen09) Per capita income in market exchange rates (USD05MER per cap per yr) - im_gdp_pc_mer(t_all,i) Per capita income in market exchange rates (USD05MER per cap per yr) - i09_gdp_pc_mer_iso_raw(t_all,iso,pop_gdp_scen09) Per capita income in market exchange rates (USD05MER per cap per yr) + i09_gdp_pc_mer_raw(t_all,i,pop_gdp_scen09) Per capita income in market exchange rates (USD17MER per cap per yr) + im_gdp_pc_mer(t_all,i) Per capita income in market exchange rates (USD17MER per cap per yr) + i09_gdp_pc_mer_iso_raw(t_all,iso,pop_gdp_scen09) Per capita income in market exchange rates (USD17MER per cap per yr) * GDP in PPP - i09_gdp_ppp_iso(t_all,iso) Income in purchasing power parity (mio. USD05PPP per yr) - i09_gdp_ppp_raw(t_all,i,pop_gdp_scen09) Income in purchasing power parity (mio. USD05PPP per yr) + i09_gdp_ppp_iso(t_all,iso) Income in purchasing power parity (mio. USD17PPP per yr) + i09_gdp_ppp_raw(t_all,i,pop_gdp_scen09) Income in purchasing power parity (mio. USD17PPP per yr) - i09_gdp_pc_ppp_raw(t_all,i,pop_gdp_scen09) Per capita income in purchasing power parity (USD05PPP per cap per yr) - i09_gdp_pc_ppp_iso_raw(t_all,iso,pop_gdp_scen09) Per capita income in purchasing power parity (USD05PPP per cap per yr) - im_gdp_pc_ppp_iso(t_all,iso) Per capita income in purchasing power parity (USD05PPP per cap per yr) + i09_gdp_pc_ppp_raw(t_all,i,pop_gdp_scen09) Per capita income in purchasing power parity (USD17PPP per cap per yr) + i09_gdp_pc_ppp_iso_raw(t_all,iso,pop_gdp_scen09) Per capita income in purchasing power parity (USD17PPP per cap per yr) + im_gdp_pc_ppp_iso(t_all,iso) Per capita income in purchasing power parity (USD17PPP per cap per yr) * Development State im_development_state(t_all,i) Development state according to the World Bank definition where 0=low income country 1=high income country in high income level (1) diff --git a/modules/09_drivers/aug17/input.gms b/modules/09_drivers/aug17/input.gms index 627d78607b..ce21e4d51e 100644 --- a/modules/09_drivers/aug17/input.gms +++ b/modules/09_drivers/aug17/input.gms @@ -23,12 +23,12 @@ parameters sm_fix_cc year until which all parameters affected by cc are fixed to historical values (year) / 2025 / ; -table f09_gdp_ppp_iso(t_all,iso,pop_gdp_scen09) Income in purchasing power parity (mio. USD05PPP per yr) +table f09_gdp_ppp_iso(t_all,iso,pop_gdp_scen09) Income in purchasing power parity (mio. USD17PPP per yr) $ondelim $include "./modules/09_drivers/input/f09_gdp_ppp_iso.csv" $offdelim; -table f09_gdp_mer_iso(t_all,iso,pop_gdp_scen09) Income in market exchange rates (mio. USD05MER per yr) +table f09_gdp_mer_iso(t_all,iso,pop_gdp_scen09) Income in market exchange rates (mio. USD17MER per yr) $ondelim $include "./modules/09_drivers/input/f09_gdp_mer_iso.csv" $offdelim; diff --git a/modules/10_land/landmatrix_dec18/declarations.gms b/modules/10_land/landmatrix_dec18/declarations.gms index 8a7737a301..172ec3792d 100644 --- a/modules/10_land/landmatrix_dec18/declarations.gms +++ b/modules/10_land/landmatrix_dec18/declarations.gms @@ -19,7 +19,7 @@ positive variables vm_land(j,land) Land area of the different land types (mio. ha) vm_landexpansion(j,land) Land expansion (mio. ha) vm_landreduction(j,land) Land reduction (mio. ha) - vm_cost_land_transition(j) Costs for lu transitions (mio. USD05MER per yr) + vm_cost_land_transition(j) Costs for lu transitions (mio. USD17MER per yr) vm_lu_transitions(j,land_from,land_to) Land transitions between time steps (mio. ha) v10_balance_positive(j) Balance variable for land transitions (mio. ha) v10_balance_negative(j) Balance variable for land transitions (mio. ha) @@ -31,7 +31,7 @@ equations q10_transition_from(j,land_from) Land transition constraint from (mio. ha) q10_landexpansion(j,land_to) Land expansion constraint (mio. ha) q10_landreduction(j,land_from) Land reduction constraint (mio. ha) - q10_cost(j) Costs for lu transitions (mio. USD05MER per yr) + q10_cost(j) Costs for lu transitions (mio. USD17MER per yr) q10_landdiff Land difference constraint (mio. ha) ; @@ -41,7 +41,7 @@ parameters ov_land(t,j,land,type) Land area of the different land types (mio. ha) ov_landexpansion(t,j,land,type) Land expansion (mio. ha) ov_landreduction(t,j,land,type) Land reduction (mio. ha) - ov_cost_land_transition(t,j,type) Costs for lu transitions (mio. USD05MER per yr) + ov_cost_land_transition(t,j,type) Costs for lu transitions (mio. USD17MER per yr) ov_lu_transitions(t,j,land_from,land_to,type) Land transitions between time steps (mio. ha) ov10_balance_positive(t,j,type) Balance variable for land transitions (mio. ha) ov10_balance_negative(t,j,type) Balance variable for land transitions (mio. ha) @@ -50,7 +50,7 @@ parameters oq10_transition_from(t,j,land_from,type) Land transition constraint from (mio. ha) oq10_landexpansion(t,j,land_to,type) Land expansion constraint (mio. ha) oq10_landreduction(t,j,land_from,type) Land reduction constraint (mio. ha) - oq10_cost(t,j,type) Costs for lu transitions (mio. USD05MER per yr) + oq10_cost(t,j,type) Costs for lu transitions (mio. USD17MER per yr) oq10_landdiff(t,type) Land difference constraint (mio. ha) ; *##################### R SECTION END (OUTPUT DECLARATIONS) ##################### diff --git a/modules/10_land/landmatrix_dec18/input.gms b/modules/10_land/landmatrix_dec18/input.gms index 092ae72b41..d0c305c988 100644 --- a/modules/10_land/landmatrix_dec18/input.gms +++ b/modules/10_land/landmatrix_dec18/input.gms @@ -6,7 +6,7 @@ *** | Contact: magpie@pik-potsdam.de scalars - s10_cost_balance Artificial cost for balance variable (USD05MER per ha) / 1e+06 / + s10_cost_balance Artificial cost for balance variable (USD17MER per ha) / 1e+06 / ; table f10_land(t_ini10,j,land) Different land type areas (mio. ha) diff --git a/modules/11_costs/default/declarations.gms b/modules/11_costs/default/declarations.gms index fd1a7dba6a..f118c86d89 100644 --- a/modules/11_costs/default/declarations.gms +++ b/modules/11_costs/default/declarations.gms @@ -6,20 +6,20 @@ *** | Contact: magpie@pik-potsdam.de variables - vm_cost_glo Total costs of production (mio. USD05MER per yr) - v11_cost_reg(i) Regional costs (mio. USD05MER per yr) + vm_cost_glo Total costs of production (mio. USD17MER per yr) + v11_cost_reg(i) Regional costs (mio. USD17MER per yr) ; equations - q11_cost_glo Objective function (mio. USD05MER per yr) - q11_cost_reg(i) Regional cost constraint (mio. USD05MER per yr) + q11_cost_glo Objective function (mio. USD17MER per yr) + q11_cost_reg(i) Regional cost constraint (mio. USD17MER per yr) ; *#################### R SECTION START (OUTPUT DECLARATIONS) #################### parameters - ov_cost_glo(t,type) Total costs of production (mio. USD05MER per yr) - ov11_cost_reg(t,i,type) Regional costs (mio. USD05MER per yr) - oq11_cost_glo(t,type) Objective function (mio. USD05MER per yr) - oq11_cost_reg(t,i,type) Regional cost constraint (mio. USD05MER per yr) + ov_cost_glo(t,type) Total costs of production (mio. USD17MER per yr) + ov11_cost_reg(t,i,type) Regional costs (mio. USD17MER per yr) + oq11_cost_glo(t,type) Objective function (mio. USD17MER per yr) + oq11_cost_reg(t,i,type) Regional cost constraint (mio. USD17MER per yr) ; *##################### R SECTION END (OUTPUT DECLARATIONS) ##################### diff --git a/modules/13_tc/endo_jan22/declarations.gms b/modules/13_tc/endo_jan22/declarations.gms index b3b04bc8fa..91c9b1ed85 100644 --- a/modules/13_tc/endo_jan22/declarations.gms +++ b/modules/13_tc/endo_jan22/declarations.gms @@ -7,33 +7,33 @@ positive variable vm_tau(h,tautype) Agricultural land use intensity tau (1) - vm_tech_cost(i) Total Annuitized costs of TC (mio. USD05PPP per yr) - v13_cost_tc(i,tautype) Technical change costs per region (mio. USD05PPP) - v13_tech_cost(i,tautype) Annuitized costs of TC for crops and pasture (mio. USD05PPP per yr) + vm_tech_cost(i) Total Annuitized costs of TC (mio. USD17PPP per yr) + v13_cost_tc(i,tautype) Technical change costs per region (mio. USD17PPP) + v13_tech_cost(i,tautype) Annuitized costs of TC for crops and pasture (mio. USD17PPP per yr) ; equations - q13_tech_cost(i, tautype) Total annuitized costs for TC (mio. USD05PPP) - q13_cost_tc(i, tautype) Costs for TC (mio. USD05PPP per yr) - q13_tech_cost_sum(i) Total Total annuitized costs for TC (mio. USD05PPP per yr) + q13_tech_cost(i, tautype) Total annuitized costs for TC (mio. USD17PPP) + q13_cost_tc(i, tautype) Costs for TC (mio. USD17PPP per yr) + q13_tech_cost_sum(i) Total Total annuitized costs for TC (mio. USD17PPP per yr) ; parameters pc13_land(i, tautype) Crop and grass land area per region (mio ha) pcm_tau(h, tautype) Tau factor of the previous time step (1) pc13_tcguess(h, tautype) Guess for annual tc rates in the next time step (1) - i13_tc_factor(t) Regression factor (USD05PPP per ha) + i13_tc_factor(t) Regression factor (USD17PPP per ha) i13_tc_exponent(t) Regression exponent (1) ; *#################### R SECTION START (OUTPUT DECLARATIONS) #################### parameters ov_tau(t,h,tautype,type) Agricultural land use intensity tau (1) - ov_tech_cost(t,i,type) Total Annuitized costs of TC (mio. USD05PPP per yr) - ov13_cost_tc(t,i,tautype,type) Technical change costs per region (mio. USD05PPP) - ov13_tech_cost(t,i,tautype,type) Annuitized costs of TC for crops and pasture (mio. USD05PPP per yr) - oq13_tech_cost(t,i,tautype,type) Total annuitized costs for TC (mio. USD05PPP) - oq13_cost_tc(t,i,tautype,type) Costs for TC (mio. USD05PPP per yr) - oq13_tech_cost_sum(t,i,type) Total Total annuitized costs for TC (mio. USD05PPP per yr) + ov_tech_cost(t,i,type) Total Annuitized costs of TC (mio. USD17PPP per yr) + ov13_cost_tc(t,i,tautype,type) Technical change costs per region (mio. USD17PPP) + ov13_tech_cost(t,i,tautype,type) Annuitized costs of TC for crops and pasture (mio. USD17PPP per yr) + oq13_tech_cost(t,i,tautype,type) Total annuitized costs for TC (mio. USD17PPP) + oq13_cost_tc(t,i,tautype,type) Costs for TC (mio. USD17PPP per yr) + oq13_tech_cost_sum(t,i,type) Total Total annuitized costs for TC (mio. USD17PPP per yr) ; *##################### R SECTION END (OUTPUT DECLARATIONS) ##################### diff --git a/modules/13_tc/exo/declarations.gms b/modules/13_tc/exo/declarations.gms index 3309d3dc41..72710b5fdf 100644 --- a/modules/13_tc/exo/declarations.gms +++ b/modules/13_tc/exo/declarations.gms @@ -7,21 +7,21 @@ positive variable vm_tau(h,tautype) Agricultural land use intensity tau (1) - vm_tech_cost(i) Costs of TC (mio. USD05PPP per yr) + vm_tech_cost(i) Costs of TC (mio. USD17PPP per yr) ; parameters - p13_cost_tc(i,tautype) Technical change costs per region (mio. USD05PPP) + p13_cost_tc(i,tautype) Technical change costs per region (mio. USD17PPP) pc13_land(i,tautype) Crop and grass land area per region (mio ha) pcm_tau(h,tautype) Tau factor of the previous time step (1) - i13_tc_factor(t) Regression factor (USD05PPP per ha) + i13_tc_factor(t) Regression factor (USD17PPP per ha) i13_tc_exponent(t) Regression exponent (1) - p13_tech_cost(i,tautype) Annuitized costs of TC for crops and pasture (mio. USD05PPP per yr) + p13_tech_cost(i,tautype) Annuitized costs of TC for crops and pasture (mio. USD17PPP per yr) ; *#################### R SECTION START (OUTPUT DECLARATIONS) #################### parameters ov_tau(t,h,tautype,type) Agricultural land use intensity tau (1) - ov_tech_cost(t,i,type) Costs of TC (mio. USD05PPP per yr) + ov_tech_cost(t,i,type) Costs of TC (mio. USD17PPP per yr) ; *##################### R SECTION END (OUTPUT DECLARATIONS) ##################### diff --git a/modules/15_food/anthro_iso_jun22/declarations.gms b/modules/15_food/anthro_iso_jun22/declarations.gms index 07f5ef4621..7d9fc7a1f9 100644 --- a/modules/15_food/anthro_iso_jun22/declarations.gms +++ b/modules/15_food/anthro_iso_jun22/declarations.gms @@ -17,8 +17,8 @@ positive variables *** #### Food Demand Model equations - q15_aim Objective function of food demand model (mio. USD05PPP) - q15_budget(iso) Household budget constraint (USD05PPP per cap per day) + q15_aim Objective function of food demand model (mio. USD17PPP) + q15_budget(iso) Household budget constraint (USD17PPP per cap per day) q15_regr_bmi_shr(iso,sex,agegroup15,bmi_tree15) Estimates regression parameters for BMI regression shares (1) q15_bmi_shr_verylow(iso,sex,agegroup15) Estimates BMI share for population groups with low BMI (1) @@ -43,8 +43,8 @@ positive variables v15_kcal_regr(iso,kfo) Uncalibrated regression estimates of calorie demand (kcal per cap per day) v15_kcal_regr_total(iso) Uncalibrated regression estimates of total per cap calories (kcal per cap per day) v15_demand_regr(iso, regr15) Uncalibrated regression estimates of kcal shares (1) - v15_income_pc_real_ppp_iso(iso) Real income per cap (USD05PPP per cap) - v15_income_balance(iso) Balance variable to balance cases in which reduction in income is larger than the per capita GDP (USD05PPP per cap per yr) + v15_income_pc_real_ppp_iso(iso) Real income per cap (USD17PPP per cap) + v15_income_balance(iso) Balance variable to balance cases in which reduction in income is larger than the per capita GDP (USD17PPP per cap per yr) v15_kcal_intake_total_regr(iso) Food intake (kcal per cap per day) v15_regr_overgroups(iso,sex,agegroup15,bmi_tree15) Hierarchical tree parameter regressions (1) v15_bmi_shr_regr(iso,sex,age,bmi_group15) Uncalibrated share of population groups belonging to a certain BMI group (1) @@ -52,7 +52,7 @@ positive variables ; variables - v15_objective Objective term (USD05PPP) + v15_objective Objective term (USD17PPP) ; scalars @@ -80,8 +80,8 @@ parameters p15_exo_food_scenario_fader(t_all) Exogenous diet scenario fader (1) * prices - p15_prices_kcal(t,iso,kfo,iter15) Prices from MAgPIE after optimization (USD05PPP per kcal) - i15_prices_initial_kcal(iso,kfo) Initial prices that capture the approximate level of prices in 1961-2010 (USD05PPP per kcal) + p15_prices_kcal(t,iso,kfo,iter15) Prices from MAgPIE after optimization (USD17PPP per kcal) + i15_prices_initial_kcal(iso,kfo) Initial prices that capture the approximate level of prices in 1961-2010 (USD17PPP per kcal) * anthropometrics p15_bodyheight(t,iso,sex,age,estimates15) Body height (cm per cap) @@ -179,7 +179,7 @@ parameters p15_country_dummy(iso) Dummy parameter indicating whether country is affected by diet scenarios (1) * calculate diet iteration breakpoint - p15_income_pc_real_ppp(t,i) Regional per capita income after price shock on regional level (USD05PPP per capita) + p15_income_pc_real_ppp(t,i) Regional per capita income after price shock on regional level (USD17PPP per capita) p15_delta_income(t,i,iter15) Regional change in per capita income due to price shock on regional level (1) ; @@ -235,16 +235,16 @@ parameters ov15_kcal_regr(t,iso,kfo,type) Uncalibrated regression estimates of calorie demand (kcal per cap per day) ov15_kcal_regr_total(t,iso,type) Uncalibrated regression estimates of total per cap calories (kcal per cap per day) ov15_demand_regr(t,iso,regr15,type) Uncalibrated regression estimates of kcal shares (1) - ov15_income_pc_real_ppp_iso(t,iso,type) Real income per cap (USD05PPP per cap) - ov15_income_balance(t,iso,type) Balance variable to balance cases in which reduction in income is larger than the per capita GDP (USD05PPP per cap per yr) + ov15_income_pc_real_ppp_iso(t,iso,type) Real income per cap (USD17PPP per cap) + ov15_income_balance(t,iso,type) Balance variable to balance cases in which reduction in income is larger than the per capita GDP (USD17PPP per cap per yr) ov15_kcal_intake_total_regr(t,iso,type) Food intake (kcal per cap per day) ov15_regr_overgroups(t,iso,sex,agegroup15,bmi_tree15,type) Hierarchical tree parameter regressions (1) ov15_bmi_shr_regr(t,iso,sex,age,bmi_group15,type) Uncalibrated share of population groups belonging to a certain BMI group (1) ov15_bmi_shr_overgroups(t,iso,sex,agegroup15,bmi_group15,type) Uncalibrated share of population groups belonging to a certain BMI group (1) - ov15_objective(t,type) Objective term (USD05PPP) + ov15_objective(t,type) Objective term (USD17PPP) oq15_food_demand(t,i,kfo,type) Food demand (mio. kcal) - oq15_aim(t,type) Objective function of food demand model (mio. USD05PPP) - oq15_budget(t,iso,type) Household budget constraint (USD05PPP per cap per day) + oq15_aim(t,type) Objective function of food demand model (mio. USD17PPP) + oq15_budget(t,iso,type) Household budget constraint (USD17PPP per cap per day) oq15_regr_bmi_shr(t,iso,sex,agegroup15,bmi_tree15,type) Estimates regression parameters for BMI regression shares (1) oq15_bmi_shr_verylow(t,iso,sex,agegroup15,type) Estimates BMI share for population groups with low BMI (1) oq15_bmi_shr_low(t,iso,sex,agegroup15,type) Estimates BMI share for population groups with very low BMI (1) diff --git a/modules/15_food/anthro_iso_jun22/input.gms b/modules/15_food/anthro_iso_jun22/input.gms index e890b03251..23f7215e44 100644 --- a/modules/15_food/anthro_iso_jun22/input.gms +++ b/modules/15_food/anthro_iso_jun22/input.gms @@ -163,7 +163,7 @@ $include "./modules/15_food/input/f15_intake_pc_observed_iso.cs3" $offdelim; -parameter f15_prices_initial(kall) Food prices in initialization period (USD05MER per t DM) +parameter f15_prices_initial(kall) Food prices in initialization period (USD17MER per t DM) / $ondelim $include "./modules/15_food/input/f15_prices_initial.csv" diff --git a/modules/15_food/anthropometrics_jan18/input.gms b/modules/15_food/anthropometrics_jan18/input.gms index b24efd5ebd..f51b796b63 100644 --- a/modules/15_food/anthropometrics_jan18/input.gms +++ b/modules/15_food/anthropometrics_jan18/input.gms @@ -142,7 +142,7 @@ $include "./modules/15_food/input/f15_intake_pc_observed_iso.cs3" $offdelim; -parameter f15_prices_initial(kall) Food prices in initialization period (USD05MER per t DM) +parameter f15_prices_initial(kall) Food prices in initialization period (USD17MER per t DM) / $ondelim $include "./modules/15_food/input/f15_prices_initial.csv" diff --git a/modules/18_residues/flexcluster_jul23/declarations.gms b/modules/18_residues/flexcluster_jul23/declarations.gms index 6a88c3208c..d4b62c1c20 100644 --- a/modules/18_residues/flexcluster_jul23/declarations.gms +++ b/modules/18_residues/flexcluster_jul23/declarations.gms @@ -18,7 +18,7 @@ positive variables vm_res_ag_burn(i,kcr,attributes) Regional residues burned on fields in respective attribute units DM GJ Nr P K WM C (mio. tX) vm_res_recycling(i,npk) Residues recycled to croplands in respective nutrients Nr P K units (mio. tX) - vm_cost_prod_kres(i,kres) Production costs of harvesting crop residues (mio. USD05MER per yr) + vm_cost_prod_kres(i,kres) Production costs of harvesting crop residues (mio. USD17MER per yr) ; equations @@ -36,7 +36,7 @@ equations q18_res_recycling_nr(i) Nutrient recycling of reaactive nitrogen (mio. tNr) q18_res_recycling_pk(i,pk18) Nutrient recycling of phosphorus and potash (mio. tX) - q18_cost_prod_res(i,kres) Production costs of harvesting crop residues (mio. USD05MER) + q18_cost_prod_res(i,kres) Production costs of harvesting crop residues (mio. USD17MER) q18_prod_res_reg(i,kall) Regional production of residues (mio. tDM) @@ -57,7 +57,7 @@ parameters ov18_res_ag_recycling(t,i,kcr,attributes,type) Recycling of crop residues to soils in respective attribute units DM GJ Nr P K WM C (mio. tX) ov_res_ag_burn(t,i,kcr,attributes,type) Regional residues burned on fields in respective attribute units DM GJ Nr P K WM C (mio. tX) ov_res_recycling(t,i,npk,type) Residues recycled to croplands in respective nutrients Nr P K units (mio. tX) - ov_cost_prod_kres(t,i,kres,type) Production costs of harvesting crop residues (mio. USD05MER per yr) + ov_cost_prod_kres(t,i,kres,type) Production costs of harvesting crop residues (mio. USD17MER per yr) oq18_prod_res_ag_clust(t,j,kcr,type) Cluster-level production constraint of aboveground residues (mio. tDM) oq18_prod_res_ag_reg(t,i,kcr,attributes,type) Regional production constraint of aboveground residues (mio. tDM) oq18_prod_res_bg_clust(t,i,kcr,dm_nr,type) Cluster-level production constraint of belowground residues (mio. tDM) @@ -68,7 +68,7 @@ parameters oq18_translate(t,j,kres,attributes,type) Transformation of the multiple crop residues into supply balance crop residues in respective attribute units DM GJ Nr P K WM C (mio. tX) oq18_res_recycling_nr(t,i,type) Nutrient recycling of reaactive nitrogen (mio. tNr) oq18_res_recycling_pk(t,i,pk18,type) Nutrient recycling of phosphorus and potash (mio. tX) - oq18_cost_prod_res(t,i,kres,type) Production costs of harvesting crop residues (mio. USD05MER) + oq18_cost_prod_res(t,i,kres,type) Production costs of harvesting crop residues (mio. USD17MER) oq18_prod_res_reg(t,i,kall,type) Regional production of residues (mio. tDM) ; *##################### R SECTION END (OUTPUT DECLARATIONS) ##################### diff --git a/modules/18_residues/flexcluster_jul23/input.gms b/modules/18_residues/flexcluster_jul23/input.gms index 2f28619264..a5923f2aa4 100644 --- a/modules/18_residues/flexcluster_jul23/input.gms +++ b/modules/18_residues/flexcluster_jul23/input.gms @@ -41,7 +41,7 @@ $include "./modules/18_residues/input/f18_res_combust_eff.cs4" $offdelim /; -parameter f18_fac_req_kres(kres) Factor requirements (USD05MER per tDM) +parameter f18_fac_req_kres(kres) Factor requirements (USD17MER per tDM) / $ondelim $include "./modules/18_residues/flexcluster_jul23/input/f18_fac_req_kres.csv" diff --git a/modules/18_residues/flexreg_apr16/declarations.gms b/modules/18_residues/flexreg_apr16/declarations.gms index 432df99796..a84eac5eaa 100644 --- a/modules/18_residues/flexreg_apr16/declarations.gms +++ b/modules/18_residues/flexreg_apr16/declarations.gms @@ -14,7 +14,7 @@ positive variables v18_res_ag_recycling(i,kcr,attributes) Recylcing of crop residues to soils in respective attribute units DM GJ Nr P K WM C (mio. tX) vm_res_ag_burn(i,kcr,attributes) Residues burned on fields in respective attribute units DM GJ Nr P K WM C (mio. tX) vm_res_recycling(i,npk) Residues recycled to croplands in respective nutrients Nr P K units (mio. tX) - vm_cost_prod_kres(i,kres) Production costs of harvesting crop residues (mio. USD05MER per yr) + vm_cost_prod_kres(i,kres) Production costs of harvesting crop residues (mio. USD17MER per yr) ; equations @@ -29,7 +29,7 @@ equations q18_res_recycling_nr(i) Nutrient recycling of reaactive nitrogen (mio. tNr) q18_res_recycling_pk(i,pk18) Nutrient recycling of phosphorus and potash (mio. tX) - q18_cost_prod_res(i,kres) Production costs of harvesting crop residues (mio. USD05MER) + q18_cost_prod_res(i,kres) Production costs of harvesting crop residues (mio. USD17MER) ; @@ -46,7 +46,7 @@ parameters ov18_res_ag_recycling(t,i,kcr,attributes,type) Recylcing of crop residues to soils in respective attribute units DM GJ Nr P K WM C (mio. tX) ov_res_ag_burn(t,i,kcr,attributes,type) Residues burned on fields in respective attribute units DM GJ Nr P K WM C (mio. tX) ov_res_recycling(t,i,npk,type) Residues recycled to croplands in respective nutrients Nr P K units (mio. tX) - ov_cost_prod_kres(t,i,kres,type) Production costs of harvesting crop residues (mio. USD05MER per yr) + ov_cost_prod_kres(t,i,kres,type) Production costs of harvesting crop residues (mio. USD17MER per yr) oq18_prod_res_ag_reg(t,i,kcr,attributes,type) Production constraint of aboveground residues (mio. tDM) oq18_prod_res_bg_reg(t,i,kcr,dm_nr,type) Production constraint of belowground residues (mio. tDM) oq18_res_field_balance(t,i,kcr,attributes,type) Calculation of the residues amount recycled to soils (mio. tDM) @@ -55,7 +55,7 @@ parameters oq18_prod_res_cell(t,j,kres,type) Allows for distribution of residues to cellular level (mio. tDM) oq18_res_recycling_nr(t,i,type) Nutrient recycling of reaactive nitrogen (mio. tNr) oq18_res_recycling_pk(t,i,pk18,type) Nutrient recycling of phosphorus and potash (mio. tX) - oq18_cost_prod_res(t,i,kres,type) Production costs of harvesting crop residues (mio. USD05MER) + oq18_cost_prod_res(t,i,kres,type) Production costs of harvesting crop residues (mio. USD17MER) ; *##################### R SECTION END (OUTPUT DECLARATIONS) ##################### diff --git a/modules/18_residues/flexreg_apr16/input.gms b/modules/18_residues/flexreg_apr16/input.gms index 1ee2c089fe..9ab7245ace 100644 --- a/modules/18_residues/flexreg_apr16/input.gms +++ b/modules/18_residues/flexreg_apr16/input.gms @@ -41,7 +41,7 @@ $include "./modules/18_residues/input/f18_res_combust_eff.cs4" $offdelim /; -parameter f18_fac_req_kres(kres) Factor requirements (USD05MER per tDM) +parameter f18_fac_req_kres(kres) Factor requirements (USD17MER per tDM) / $ondelim $include "./modules/18_residues/flexreg_apr16/input/f18_fac_req_kres.csv" diff --git a/modules/18_residues/off/declarations.gms b/modules/18_residues/off/declarations.gms index 8329f0d299..320ee7a062 100644 --- a/modules/18_residues/off/declarations.gms +++ b/modules/18_residues/off/declarations.gms @@ -11,7 +11,7 @@ positive variables vm_res_biomass_bg(i,kcr,dm_nr) production of belowground residues in each region (mio. tDM) vm_res_recycling(i,npk) residues recycled to croplands (mio tons nutrients) vm_res_ag_burn(i,kcr,attributes) Residues burned on fields in respective attribute units DM GJ Nr P K WM C (mio. tX) - vm_cost_prod_kres(i,kres) Production costs of harvesting crop residues (mio. USD05MER per yr) + vm_cost_prod_kres(i,kres) Production costs of harvesting crop residues (mio. USD17MER per yr) ; @@ -21,7 +21,7 @@ parameters ov_res_biomass_bg(t,i,kcr,dm_nr,type) production of belowground residues in each region (mio. tDM) ov_res_recycling(t,i,npk,type) residues recycled to croplands (mio tons nutrients) ov_res_ag_burn(t,i,kcr,attributes,type) Residues burned on fields in respective attribute units DM GJ Nr P K WM C (mio. tX) - ov_cost_prod_kres(t,i,kres,type) Production costs of harvesting crop residues (mio. USD05MER per yr) + ov_cost_prod_kres(t,i,kres,type) Production costs of harvesting crop residues (mio. USD17MER per yr) ; *##################### R SECTION END (OUTPUT DECLARATIONS) ##################### diff --git a/modules/20_processing/substitution_may21/declarations.gms b/modules/20_processing/substitution_may21/declarations.gms index 72d97ed3cf..8c4a5ed686 100644 --- a/modules/20_processing/substitution_may21/declarations.gms +++ b/modules/20_processing/substitution_may21/declarations.gms @@ -8,7 +8,7 @@ parameters i20_processing_shares(t_all,i,ksd,kpr) Shares of secondary products coming from a primary product (1) i20_processing_conversion_factors(t_all,processing20,ksd,kpr) Conversion factors of primary products into secondary products (1) - i20_processing_unitcosts(ksd,kpr) Costs of transforming x units kpr into 1 unit ksd (USD05MER per tDM) + i20_processing_unitcosts(ksd,kpr) Costs of transforming x units kpr into 1 unit ksd (USD17MER per tDM) ; @@ -17,11 +17,11 @@ positive variables v20_dem_processing(i,processing_subst20,kpr) Demand for processing use by process (mio. tDM per yr) v20_secondary_substitutes(i,ksd,kpr) Substitutes for inferior secondary products (mio. tDM per yr) vm_secondary_overproduction(i,kall,kpr) Overproduction of secondary couple products (mio. tDM per yr) - vm_cost_processing(i) Processing costs (mio. USD05MER per yr) + vm_cost_processing(i) Processing costs (mio. USD17MER per yr) ; variables - vm_processing_substitution_cost(i) Costs or benefits of substituting one product by another (mio. USD05MER per yr) + vm_processing_substitution_cost(i) Costs or benefits of substituting one product by another (mio. USD17MER per yr) ; equations @@ -33,7 +33,7 @@ equations q20_processing_substitution_brans(i) Substitution of brans by cereals (mio. tNr per yr) q20_processing_substitution_sugar(i) Substitution of molasses by sugar (mio. tDM per yr) q20_processing_substitution_protein(i) Substitution of protein products by other protein products (mio. tNr per yr) - q20_processing_costs(i) Processing costs (mio. USD05MER per yr) + q20_processing_costs(i) Processing costs (mio. USD17MER per yr) q20_substitution_utility_loss(i) Utility loss when one product has to be substituted by another (mio. t Nr per year) ; @@ -43,8 +43,8 @@ parameters ov20_dem_processing(t,i,processing_subst20,kpr,type) Demand for processing use by process (mio. tDM per yr) ov20_secondary_substitutes(t,i,ksd,kpr,type) Substitutes for inferior secondary products (mio. tDM per yr) ov_secondary_overproduction(t,i,kall,kpr,type) Overproduction of secondary couple products (mio. tDM per yr) - ov_cost_processing(t,i,type) Processing costs (mio. USD05MER per yr) - ov_processing_substitution_cost(t,i,type) Costs or benefits of substituting one product by another (mio. USD05MER per yr) + ov_cost_processing(t,i,type) Processing costs (mio. USD17MER per yr) + ov_processing_substitution_cost(t,i,type) Costs or benefits of substituting one product by another (mio. USD17MER per yr) oq20_processing(t,i,kpr,ksd,type) Processing equation (mio. tDM per yr) oq20_processing_aggregation_nocereals(t,i,kpr,type) Connecting processing activity to processing flows (mio. tDM per yr) oq20_processing_aggregation_cereals(t,i,kcereals20,type) Connecting processing activity to food use for milling (mio. tDM per yr) @@ -53,7 +53,7 @@ parameters oq20_processing_substitution_brans(t,i,type) Substitution of brans by cereals (mio. tNr per yr) oq20_processing_substitution_sugar(t,i,type) Substitution of molasses by sugar (mio. tDM per yr) oq20_processing_substitution_protein(t,i,type) Substitution of protein products by other protein products (mio. tNr per yr) - oq20_processing_costs(t,i,type) Processing costs (mio. USD05MER per yr) + oq20_processing_costs(t,i,type) Processing costs (mio. USD17MER per yr) oq20_substitution_utility_loss(t,i,type) Utility loss when one product has to be substituted by another (mio. t Nr per year) ; *##################### R SECTION END (OUTPUT DECLARATIONS) ##################### diff --git a/modules/20_processing/substitution_may21/input.gms b/modules/20_processing/substitution_may21/input.gms index 65a320e6de..fea6b7bb54 100644 --- a/modules/20_processing/substitution_may21/input.gms +++ b/modules/20_processing/substitution_may21/input.gms @@ -22,7 +22,7 @@ $ondelim $include "./modules/20_processing/input/f20_processing_shares.cs3" $offdelim ; -table f20_processing_unitcosts(ksd,kpr) Costs of transforming x units kpr into 1 unit ksd (USD05MER per tDM) +table f20_processing_unitcosts(ksd,kpr) Costs of transforming x units kpr into 1 unit ksd (USD17MER per tDM) $ondelim $include "./modules/20_processing/input/f20_processing_unitcosts.cs3" $offdelim ; diff --git a/modules/21_trade/exo/declarations.gms b/modules/21_trade/exo/declarations.gms index 67b0151950..cb13b215e1 100644 --- a/modules/21_trade/exo/declarations.gms +++ b/modules/21_trade/exo/declarations.gms @@ -6,7 +6,7 @@ *** | Contact: magpie@pik-potsdam.de positive variables - vm_cost_trade(i) Regional trade costs (mio. USD05MER per yr) + vm_cost_trade(i) Regional trade costs (mio. USD17MER per yr) ; equations @@ -15,7 +15,7 @@ equations *#################### R SECTION START (OUTPUT DECLARATIONS) #################### parameters - ov_cost_trade(t,i,type) Regional trade costs (mio. USD05MER per yr) + ov_cost_trade(t,i,type) Regional trade costs (mio. USD17MER per yr) oq21_notrade(t,h,kall,type) Superregional production constraint of non-tradable commodities (mio. tDM per yr) ; *##################### R SECTION END (OUTPUT DECLARATIONS) ##################### diff --git a/modules/21_trade/free_apr16/declarations.gms b/modules/21_trade/free_apr16/declarations.gms index 811b4f5676..a13a97b6bb 100644 --- a/modules/21_trade/free_apr16/declarations.gms +++ b/modules/21_trade/free_apr16/declarations.gms @@ -7,12 +7,12 @@ parameters i21_trade_bal_reduction(t_all,k_trade) Trade balance reduction (1) - i21_trade_margin(h,k_trade) Trade margins (USD05MER per tDM) - i21_trade_tariff(h,k_trade) Trade tariffs (USD05MER per tDM) + i21_trade_margin(h,k_trade) Trade margins (USD17MER per tDM) + i21_trade_tariff(h,k_trade) Trade tariffs (USD17MER per tDM) ; positive variables - vm_cost_trade(i) Regional trade costs (mio. USD05MER per yr) + vm_cost_trade(i) Regional trade costs (mio. USD17MER per yr) ; equations @@ -22,7 +22,7 @@ equations *#################### R SECTION START (OUTPUT DECLARATIONS) #################### parameters - ov_cost_trade(t,i,type) Regional trade costs (mio. USD05MER per yr) + ov_cost_trade(t,i,type) Regional trade costs (mio. USD17MER per yr) oq21_trade_glo(t,k_trade,type) Global production constraint (mio. tDM per yr) oq21_notrade(t,h,k_notrade,type) Superregional production constraint of non-tradable commodities (mio. tDM per yr) ; diff --git a/modules/21_trade/off/declarations.gms b/modules/21_trade/off/declarations.gms index 5488673ee2..a66f2d5dd9 100644 --- a/modules/21_trade/off/declarations.gms +++ b/modules/21_trade/off/declarations.gms @@ -6,7 +6,7 @@ *** | Contact: magpie@pik-potsdam.de positive variables - vm_cost_trade(i) Regional trade costs (mio. USD05MER per yr) + vm_cost_trade(i) Regional trade costs (mio. USD17MER per yr) ; equations @@ -15,7 +15,7 @@ equations *#################### R SECTION START (OUTPUT DECLARATIONS) #################### parameters - ov_cost_trade(t,i,type) Regional trade costs (mio. USD05MER per yr) + ov_cost_trade(t,i,type) Regional trade costs (mio. USD17MER per yr) oq21_notrade(t,h,kall,type) Superregional production constraint of non-tradable commodities (mio. tDM per yr) ; *##################### R SECTION END (OUTPUT DECLARATIONS) ##################### diff --git a/modules/21_trade/selfsuff_reduced/declarations.gms b/modules/21_trade/selfsuff_reduced/declarations.gms index 59bc20b4d9..fbc984e246 100644 --- a/modules/21_trade/selfsuff_reduced/declarations.gms +++ b/modules/21_trade/selfsuff_reduced/declarations.gms @@ -7,15 +7,15 @@ parameters i21_trade_bal_reduction(t_all,k_trade) Trade balance reduction (1) - i21_trade_margin(h,k_trade) Trade margins (USD05MER per tDM) - i21_trade_tariff(h,k_trade) Trade tariffs (USD05MER per tDM) + i21_trade_margin(h,k_trade) Trade margins (USD17MER per tDM) + i21_trade_tariff(h,k_trade) Trade tariffs (USD17MER per tDM) ; positive variables v21_excess_dem(k_trade) Global excess demand (mio. tDM per yr) v21_excess_prod(h,k_trade) Superregional excess production (mio. tDM per yr) - vm_cost_trade(i) Regional trade costs (mio. USD05MER per yr) - v21_cost_trade_reg(h,k_trade) Superregional trade costs for each tradable commodity (mio. USD05MER per yr) + vm_cost_trade(i) Regional trade costs (mio. USD17MER per yr) + v21_cost_trade_reg(h,k_trade) Superregional trade costs for each tradable commodity (mio. USD17MER per yr) v21_import_for_feasibility(h,k_trade) Additional imports to maintain feasibility (mio. tDM per yr) ; @@ -26,16 +26,16 @@ equations q21_trade_reg_up(h,k_trade) Superregional trade balances i.e. maximum self-sufficiency ratio (1) 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(h) Superregional trade costs (mio. USD05MER per yr) - q21_cost_trade_reg(h,k_trade) Superregional trade costs for each tradable commodity (mio. USD05MER per yr) + q21_cost_trade(h) Superregional trade costs (mio. USD17MER per yr) + q21_cost_trade_reg(h,k_trade) Superregional trade costs for each tradable commodity (mio. USD17MER per yr) ; *#################### R SECTION START (OUTPUT DECLARATIONS) #################### parameters ov21_excess_dem(t,k_trade,type) Global excess demand (mio. tDM per yr) ov21_excess_prod(t,h,k_trade,type) Superregional excess production (mio. tDM per yr) - ov_cost_trade(t,i,type) Regional trade costs (mio. USD05MER per yr) - ov21_cost_trade_reg(t,h,k_trade,type) Superregional trade costs for each tradable commodity (mio. USD05MER per yr) + ov_cost_trade(t,i,type) Regional trade costs (mio. USD17MER per yr) + ov21_cost_trade_reg(t,h,k_trade,type) Superregional trade costs for each tradable commodity (mio. USD17MER per yr) ov21_import_for_feasibility(t,h,k_trade,type) Additional imports to maintain feasibility (mio. tDM per yr) oq21_trade_glo(t,k_trade,type) Global production constraint (mio. tDM per yr) oq21_notrade(t,h,k_notrade,type) Superregional production constraint of non-tradable commodities (mio. tDM per yr) @@ -43,7 +43,7 @@ parameters oq21_trade_reg_up(t,h,k_trade,type) Superregional trade balances i.e. maximum self-sufficiency ratio (1) 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(t,h,type) Superregional trade costs (mio. USD05MER per yr) - oq21_cost_trade_reg(t,h,k_trade,type) Superregional trade costs for each tradable commodity (mio. USD05MER per yr) + oq21_cost_trade(t,h,type) Superregional trade costs (mio. USD17MER per yr) + oq21_cost_trade_reg(t,h,k_trade,type) Superregional trade costs for each tradable commodity (mio. USD17MER per yr) ; *##################### R SECTION END (OUTPUT DECLARATIONS) ##################### diff --git a/modules/21_trade/selfsuff_reduced/input.gms b/modules/21_trade/selfsuff_reduced/input.gms index 19a8d28d00..8589115320 100644 --- a/modules/21_trade/selfsuff_reduced/input.gms +++ b/modules/21_trade/selfsuff_reduced/input.gms @@ -15,8 +15,8 @@ sets scalars s21_trade_tariff Trade tariff switch (1=on 0=off) (1) / 1 / - s21_cost_import Cost for additional imports to maintain feasibility (USD05MER per tDM) / 10000 / - s21_min_trade_margin_forestry Minimum trade margin for forestry products (USD05MER per tDM) / 50 / + s21_cost_import Cost for additional imports to maintain feasibility (USD17MER per tDM) / 10000 / + s21_min_trade_margin_forestry Minimum trade margin for forestry products (USD17MER per tDM) / 50 / ; table f21_trade_bal_reduction(t_all,trade_groups21,trade_regime21) Share of inelastic trade pool (1) @@ -39,13 +39,13 @@ $ondelim $include "./modules/21_trade/input/f21_trade_balanceflow.cs3" $offdelim; -table f21_trade_margin(h,kall) Costs of freight and insurance (USD05MER per tDM) +table f21_trade_margin(h,kall) Costs of freight and insurance (USD17MER per tDM) $ondelim $include "./modules/21_trade/input/f21_trade_margin.cs3" $offdelim ; -table f21_trade_tariff(h,kall) Specific duty tariffs (USD05MER per tDM) +table f21_trade_tariff(h,kall) Specific duty tariffs (USD17MER per tDM) $ondelim $include "./modules/21_trade/input/f21_trade_tariff.cs3" $offdelim diff --git a/modules/21_trade/selfsuff_reduced_bilateral22/declarations.gms b/modules/21_trade/selfsuff_reduced_bilateral22/declarations.gms index 52bfeefb13..3df42f1cd1 100644 --- a/modules/21_trade/selfsuff_reduced_bilateral22/declarations.gms +++ b/modules/21_trade/selfsuff_reduced_bilateral22/declarations.gms @@ -7,18 +7,18 @@ parameters i21_trade_bal_reduction(t_all,k_trade) Trade balance reduction (1) - i21_trade_margin(i_ex,i_im,k_trade) Trade transport and admin costs (USD05MER per tDM) - i21_trade_tariff(t_all, i_ex,i_im,k_trade) Trade tariffs (USD05MER per tDM) + i21_trade_margin(i_ex,i_im,k_trade) Trade transport and admin costs (USD17MER per tDM) + i21_trade_tariff(t_all, i_ex,i_im,k_trade) Trade tariffs (USD17MER per tDM) ; positive variables v21_excess_dem(k_trade) Demand exceeding the minimum self-sufficiency (mio. tDM per yr) v21_excess_prod(h,k_trade) Superregional production exceeding the minimum self-sufficiency production (mio. tDM per yr) v21_trade(i_ex,i_im,k_trade) Amounts traded bilaterally (mio. tDM per yr) - v21_cost_tariff_reg(i,k_trade) Regional trade tariffs for each tradable commodity (mio. USD05MER per yr) - v21_cost_margin_reg(i,k_trade) Rregional trade margins for each tradable commodity (mio. USD05MER per yr) - vm_cost_trade(i) Regional trade costs (mio. USD05MER per yr) - v21_cost_trade_reg(i,k_trade) Superregional trade costs for each tradable commodity (mio. USD05MER per yr) + v21_cost_tariff_reg(i,k_trade) Regional trade tariffs for each tradable commodity (mio. USD17MER per yr) + v21_cost_margin_reg(i,k_trade) Rregional trade margins for each tradable commodity (mio. USD17MER per yr) + vm_cost_trade(i) Regional trade costs (mio. USD17MER per yr) + v21_cost_trade_reg(i,k_trade) Superregional trade costs for each tradable commodity (mio. USD17MER per yr) v21_import_for_feasibility(h,k_trade) Additional imports to maintain feasibility (mio. tDM per yr) ; @@ -30,11 +30,11 @@ equations 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_trade_bilat(h, k_trade) Superregional bilateral trade requirements (mio. tDM per yr) - q21_costs_tariffs(i, k_trade) Regional trade tariff costs (mio. USD05MER per yr) + q21_costs_tariffs(i, k_trade) Regional trade tariff costs (mio. USD17MER per yr) q21_costs_margins(i,k_trade) Regional bilateral trade requirements - q21_cost_trade_reg(i,k_trade) Regional trade costs for each tradable commodity (mio. USD05MER per yr) - q21_cost_trade_reg(i,k_trade) Superregional trade costs for each tradable commodity (mio. USD05MER per yr) - q21_cost_trade(i) Superregional trade costs (mio. USD05MER per yr) + q21_cost_trade_reg(i,k_trade) Regional trade costs for each tradable commodity (mio. USD17MER per yr) + q21_cost_trade_reg(i,k_trade) Superregional trade costs for each tradable commodity (mio. USD17MER per yr) + q21_cost_trade(i) Superregional trade costs (mio. USD17MER per yr) ; *#################### R SECTION START (OUTPUT DECLARATIONS) #################### @@ -42,10 +42,10 @@ parameters ov21_excess_dem(t,k_trade,type) Demand exceeding the minimum self-sufficiency (mio. tDM per yr) ov21_excess_prod(t,h,k_trade,type) Superregional production exceeding the minimum self-sufficiency production (mio. tDM per yr) ov21_trade(t,i_ex,i_im,k_trade,type) Amounts traded bilaterally (mio. tDM per yr) - ov21_cost_tariff_reg(t,i,k_trade,type) Regional trade tariffs for each tradable commodity (mio. USD05MER per yr) - ov21_cost_margin_reg(t,i,k_trade,type) Rregional trade margins for each tradable commodity (mio. USD05MER per yr) - ov_cost_trade(t,i,type) Regional trade costs (mio. USD05MER per yr) - ov21_cost_trade_reg(t,i,k_trade,type) Superregional trade costs for each tradable commodity (mio. USD05MER per yr) + ov21_cost_tariff_reg(t,i,k_trade,type) Regional trade tariffs for each tradable commodity (mio. USD17MER per yr) + ov21_cost_margin_reg(t,i,k_trade,type) Rregional trade margins for each tradable commodity (mio. USD17MER per yr) + ov_cost_trade(t,i,type) Regional trade costs (mio. USD17MER per yr) + ov21_cost_trade_reg(t,i,k_trade,type) Superregional trade costs for each tradable commodity (mio. USD17MER per yr) ov21_import_for_feasibility(t,h,k_trade,type) Additional imports to maintain feasibility (mio. tDM per yr) oq21_trade_glo(t,k_trade,type) Global production constraint (mio. tDM per yr) oq21_notrade(t,h,k_notrade,type) Superregional production constraint of non-tradable commodities (mio. tDM per yr) @@ -54,10 +54,10 @@ parameters 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_trade_bilat(t,h,k_trade,type) Superregional bilateral trade requirements (mio. tDM per yr) - oq21_costs_tariffs(t,i,k_trade,type) Regional trade tariff costs (mio. USD05MER per yr) + oq21_costs_tariffs(t,i,k_trade,type) Regional trade tariff costs (mio. USD17MER per yr) oq21_costs_margins(t,i,k_trade,type) Regional bilateral trade requirements - oq21_cost_trade_reg(t,i,k_trade,type) Regional trade costs for each tradable commodity (mio. USD05MER per yr) - oq21_cost_trade_reg(t,i,k_trade,type) Superregional trade costs for each tradable commodity (mio. USD05MER per yr) - oq21_cost_trade(t,i,type) Superregional trade costs (mio. USD05MER per yr) + oq21_cost_trade_reg(t,i,k_trade,type) Regional trade costs for each tradable commodity (mio. USD17MER per yr) + oq21_cost_trade_reg(t,i,k_trade,type) Superregional trade costs for each tradable commodity (mio. USD17MER per yr) + oq21_cost_trade(t,i,type) Superregional trade costs (mio. USD17MER per yr) ; *##################### R SECTION END (OUTPUT DECLARATIONS) ##################### diff --git a/modules/21_trade/selfsuff_reduced_bilateral22/input.gms b/modules/21_trade/selfsuff_reduced_bilateral22/input.gms index e73d9007a3..fe6459f2b5 100644 --- a/modules/21_trade/selfsuff_reduced_bilateral22/input.gms +++ b/modules/21_trade/selfsuff_reduced_bilateral22/input.gms @@ -18,8 +18,8 @@ scalars s21_trade_tariff_fadeout fadeout scenario setting for trade tariffs / 0 / s21_trade_tariff_startyear year to start fading out trade tariffs / 2025 / s21_trade_tariff_targetyear year to finish fading out trade tariffs / 2050 / - s21_cost_import Cost for additional imports to maintain feasibility (USD05MER per tDM) / 10000 / - s21_min_trade_margin_forestry Minimum trade margin for forestry products (USD05MER per tDM) / 50 / + s21_cost_import Cost for additional imports to maintain feasibility (USD17MER per tDM) / 10000 / + s21_min_trade_margin_forestry Minimum trade margin for forestry products (USD17MER per tDM) / 50 / ; table f21_trade_bal_reduction(t_all,trade_groups21,trade_regime21) Share of inelastic trade pool (1) @@ -42,14 +42,14 @@ $ondelim $include "./modules/21_trade/input/f21_trade_balanceflow.cs3" $offdelim; -parameter f21_trade_margin(i_ex,i_im,kall) Costs of freight and insurance (USD05MER per tDM) +parameter f21_trade_margin(i_ex,i_im,kall) Costs of freight and insurance (USD17MER per tDM) / $ondelim $include "./modules/21_trade/selfsuff_reduced_bilateral22/input/f21_trade_margin_bilat.cs5" $offdelim /; -parameter f21_trade_tariff(i_ex,i_im,kall) Specific duty tariffs (USD05MER per tDM) +parameter f21_trade_tariff(i_ex,i_im,kall) Specific duty tariffs (USD17MER per tDM) / $ondelim $include "./modules/21_trade/selfsuff_reduced_bilateral22/input/f21_trade_tariff_bilat.cs5" diff --git a/modules/29_cropland/detail_apr24/declarations.gms b/modules/29_cropland/detail_apr24/declarations.gms index bfa7e79f98..d43f24181c 100644 --- a/modules/29_cropland/detail_apr24/declarations.gms +++ b/modules/29_cropland/detail_apr24/declarations.gms @@ -22,7 +22,7 @@ parameters i29_treecover_scenario_fader(t_all) Cropland treecover scenario fader (1) i29_treecover_target(t,j) Target share for treecover on total cropland (1) - i29_treecover_penalty(t) Penalty for violation of treecover target (USD05MER per ha) + i29_treecover_penalty(t) Penalty for violation of treecover target (USD17MER per ha) p29_treecover_bii_coeff(bii_class_secd,potnatveg) BII coefficient for cropland treecover (1) p29_carbon_density_ac(t,j,ac,ag_pools) Carbon density for ac and ag_pools (tC per ha) p29_treecover(t,j,ac) Cropland tree cover per age class (mio. ha) @@ -31,16 +31,16 @@ parameters i29_fallow_scenario_fader(t_all) Fallow land scenario fader (1) i29_fallow_target(t) Target share for fallow land on total cropland (1) - i29_fallow_penalty(t) Penalty for violation of fallow target (USD05MER per ha) + i29_fallow_penalty(t) Penalty for violation of fallow target (USD17MER per ha) ; positive variables - vm_cost_cropland(j) Cost for total cropland (mio. USD05MER per yr) + vm_cost_cropland(j) Cost for total cropland (mio. USD17MER per yr) vm_treecover(j) Cropland tree cover (mio. ha) v29_treecover(j,ac) Cropland tree cover per age class (mio. ha) v29_treecover_missing(j) Missing treecover area towards target (mio. ha) - v29_cost_treecover_est(j) Establishment cost for cropland tree cover (mio. USD05MER per yr) - v29_cost_treecover_recur(j) Recurring cost for cropland tree cover (mio. USD05MER per yr) + v29_cost_treecover_est(j) Establishment cost for cropland tree cover (mio. USD17MER per yr) + v29_cost_treecover_recur(j) Recurring cost for cropland tree cover (mio. USD17MER per yr) vm_fallow(j) Fallow land is temporarily fallow cropland (mio. ha) v29_fallow_missing(j) Missing fallow land towards target (mio. ha) ; @@ -48,7 +48,7 @@ positive variables equations q29_cropland(j) Total cropland calculation (mio. ha) q29_avl_cropland(j) Available cropland constraint (mio. ha) - q29_cost_cropland(j) Costs and benefits related to agroforestry (mio. USD05MER per yr) + q29_cost_cropland(j) Costs and benefits related to agroforestry (mio. USD17MER per yr) q29_carbon(j,ag_pools,stockType) Cropland above ground carbon content calculation (mio. tC) q29_land_snv(j) Land constraint for the SNV policy in cropland areas (mio. ha) q29_land_snv_trans(j) Land transition constraint for SNV policy in cropland areas (mio. ha) @@ -59,24 +59,24 @@ equations q29_treecover_min(j) Missing treecover area towards target (mio. ha) q29_treecover_max(j) Maximum treecover area (mio. ha) q29_treecover_bv(j,potnatveg) Biodiversity value for cropland treecover (mio. ha) - q29_cost_treecover_est(j) Establishment cost for cropland tree cover (mio. USD05MER per yr) - q29_cost_treecover_recur(j) Recurring cost for cropland tree cover (mio. USD05MER per yr) + q29_cost_treecover_est(j) Establishment cost for cropland tree cover (mio. USD17MER per yr) + q29_cost_treecover_recur(j) Recurring cost for cropland tree cover (mio. USD17MER per yr) q29_treecover_est(j,ac) Cropland treecover establishment (mio. ha) ; *#################### R SECTION START (OUTPUT DECLARATIONS) #################### parameters - ov_cost_cropland(t,j,type) Cost for total cropland (mio. USD05MER per yr) + ov_cost_cropland(t,j,type) Cost for total cropland (mio. USD17MER per yr) ov_treecover(t,j,type) Cropland tree cover (mio. ha) ov29_treecover(t,j,ac,type) Cropland tree cover per age class (mio. ha) ov29_treecover_missing(t,j,type) Missing treecover area towards target (mio. ha) - ov29_cost_treecover_est(t,j,type) Establishment cost for cropland tree cover (mio. USD05MER per yr) - ov29_cost_treecover_recur(t,j,type) Recurring cost for cropland tree cover (mio. USD05MER per yr) + ov29_cost_treecover_est(t,j,type) Establishment cost for cropland tree cover (mio. USD17MER per yr) + ov29_cost_treecover_recur(t,j,type) Recurring cost for cropland tree cover (mio. USD17MER per yr) ov_fallow(t,j,type) Fallow land is temporarily fallow cropland (mio. ha) ov29_fallow_missing(t,j,type) Missing fallow land towards target (mio. ha) oq29_cropland(t,j,type) Total cropland calculation (mio. ha) oq29_avl_cropland(t,j,type) Available cropland constraint (mio. ha) - oq29_cost_cropland(t,j,type) Costs and benefits related to agroforestry (mio. USD05MER per yr) + oq29_cost_cropland(t,j,type) Costs and benefits related to agroforestry (mio. USD17MER per yr) oq29_carbon(t,j,ag_pools,stockType,type) Cropland above ground carbon content calculation (mio. tC) oq29_land_snv(t,j,type) Land constraint for the SNV policy in cropland areas (mio. ha) oq29_land_snv_trans(t,j,type) Land transition constraint for SNV policy in cropland areas (mio. ha) @@ -87,8 +87,8 @@ parameters oq29_treecover_min(t,j,type) Missing treecover area towards target (mio. ha) oq29_treecover_max(t,j,type) Maximum treecover area (mio. ha) oq29_treecover_bv(t,j,potnatveg,type) Biodiversity value for cropland treecover (mio. ha) - oq29_cost_treecover_est(t,j,type) Establishment cost for cropland tree cover (mio. USD05MER per yr) - oq29_cost_treecover_recur(t,j,type) Recurring cost for cropland tree cover (mio. USD05MER per yr) + oq29_cost_treecover_est(t,j,type) Establishment cost for cropland tree cover (mio. USD17MER per yr) + oq29_cost_treecover_recur(t,j,type) Recurring cost for cropland tree cover (mio. USD17MER per yr) oq29_treecover_est(t,j,ac,type) Cropland treecover establishment (mio. ha) ; *##################### R SECTION END (OUTPUT DECLARATIONS) ##################### diff --git a/modules/29_cropland/detail_apr24/input.gms b/modules/29_cropland/detail_apr24/input.gms index 163dc134e1..c52396e2e4 100644 --- a/modules/29_cropland/detail_apr24/input.gms +++ b/modules/29_cropland/detail_apr24/input.gms @@ -15,8 +15,8 @@ scalars s29_snv_scenario_target SNV scenario target year / 2050 / s29_snv_relocation_data_x1 First reference value in SNV target cropland data (1) / 0.2 / s29_snv_relocation_data_x2 Second reference value in SNV target cropland data (1) / 0.5 / - s29_cost_treecover_est Tree cover establishment cost (USD05MER per ha) / 2000 / - s29_cost_treecover_recur Tree cover recurring cost (USD05MER per ha) / 500 / + s29_cost_treecover_est Tree cover establishment cost (USD17MER per ha) / 2000 / + s29_cost_treecover_recur Tree cover recurring cost (USD17MER per ha) / 500 / s29_treecover_plantation Growth curve switch for tree cover on cropland 0=natveg 1=plantations (1) / 0 / s29_treecover_bii_coeff BII coefficent to be used for tree cover on cropland 0=secondary vegetation 1=timber plantations (1) / 0 / s29_treecover_scenario_start Cropland treecover scenario start year / 2025 / @@ -25,13 +25,13 @@ scalars s29_treecover_target_noselect Minimum share of treecover on total cropland in target year (1) / 0 / s29_treecover_keep Avoid loss of existing treecover (1=yes 0=no) / 1 / s29_treecover_max Maximum share of treecover on total cropland (1) / 0.4 / - s29_treecover_penalty_before Penalty for violation of treecover target before scenario start (USD05MER per ha) / 5000 / - s29_treecover_penalty Penalty for violation of treecover target after sceanrio start (USD05MER per ha) / 5000 / + s29_treecover_penalty_before Penalty for violation of treecover target before scenario start (USD17MER per ha) / 5000 / + s29_treecover_penalty Penalty for violation of treecover target after sceanrio start (USD17MER per ha) / 5000 / s29_fallow_scenario_start Fallow land scenario start year / 2025 / s29_fallow_scenario_target Fallow land scenario target year / 2050 / s29_fallow_target Minimum share of fallow land on total cropland in target year (1) / 0 / s29_fallow_max Maximum share of fallow land on total cropland (1) / 0.4 / - s29_fallow_penalty Penalty for violation of fallow target (USD05MER per ha) / 500 / + s29_fallow_penalty Penalty for violation of fallow target (USD17MER per ha) / 500 / ; diff --git a/modules/29_cropland/simple_apr24/declarations.gms b/modules/29_cropland/simple_apr24/declarations.gms index 625f819b2c..a9e37fac6e 100644 --- a/modules/29_cropland/simple_apr24/declarations.gms +++ b/modules/29_cropland/simple_apr24/declarations.gms @@ -18,7 +18,7 @@ parameters ; positive variables - vm_cost_cropland(j) Cost for total cropland (mio. USD05MER per yr) + vm_cost_cropland(j) Cost for total cropland (mio. USD17MER per yr) vm_fallow(j) Fallow land is temporarily fallow cropland (mio. ha) vm_treecover(j) Cropland tree cover (mio. ha) ; @@ -33,7 +33,7 @@ equations *#################### R SECTION START (OUTPUT DECLARATIONS) #################### parameters - ov_cost_cropland(t,j,type) Cost for total cropland (mio. USD05MER per yr) + ov_cost_cropland(t,j,type) Cost for total cropland (mio. USD17MER per yr) ov_fallow(t,j,type) Fallow land is temporarily fallow cropland (mio. ha) ov_treecover(t,j,type) Cropland tree cover (mio. ha) oq29_cropland(t,j,type) Total cropland calculation (mio. ha) diff --git a/modules/30_croparea/detail_apr24/declarations.gms b/modules/30_croparea/detail_apr24/declarations.gms index 749c03c37b..f5eedf4e2b 100644 --- a/modules/30_croparea/detail_apr24/declarations.gms +++ b/modules/30_croparea/detail_apr24/declarations.gms @@ -7,22 +7,22 @@ parameters i30_rotation_rules(t_all,rota30) Rotational constraints (1) - i30_rotation_incentives(t_all,rota30) Penalty for violating rotational constraints (USD05MER per ha) + i30_rotation_incentives(t_all,rota30) Penalty for violating rotational constraints (USD17MER per ha) i30_rotation_scenario_fader(t_all) Crop rotation scenario fader (1) i30_implementation Switch for rule-based (1) or penalty-based (0) implementation of rotation scenarios i30_betr_scenario_fader(t_all) Bioenergy land scenario fader (1) i30_betr_target(t,j) Target share for bioenergy land on total cropland (1) - i30_betr_penalty(t) Penalty for violation of betr target (USD05MER per ha) + i30_betr_penalty(t) Penalty for violation of betr target (USD17MER per ha) p30_country_weight(i) Policy country weight per region (1) p30_country_dummy(iso) Dummy parameter indicating whether country is affected by selected policy (1) ; positive variables vm_area(j,kcr,w) Agricultural production area (mio. ha) - vm_rotation_penalty(i) Penalty for violating rotational constraints (mio. USD05MER) + vm_rotation_penalty(i) Penalty for violating rotational constraints (mio. USD17MER) vm_carbon_stock_croparea(j,ag_pools) Carbon stock in croparea (tC) - v30_penalty_max_irrig(j,rotamax30) Penalty for violating max rotational constraints on irrigated land (mio. USD05MER) - v30_penalty(j,rota30) Penalty for violating rotational constraints (mio. USD05MER) + v30_penalty_max_irrig(j,rotamax30) Penalty for violating max rotational constraints on irrigated land (mio. USD17MER) + v30_penalty(j,rota30) Penalty for violating rotational constraints (mio. USD17MER) v30_betr_missing(j) Missing bioenergy tree land towards target (mio. ha) v30_crop_area(i) Total regional crop production area (mio. ha) ; @@ -30,7 +30,7 @@ positive variables equations q30_prod(j,kcr) Production of cropped products (mio. tDM) q30_betr_missing(j) Missing bioenergy tree land towards target (mio. ha) - q30_rotation_penalty(i) Total penalty for rotational constraint violations (mio. USD05MER) + q30_rotation_penalty(i) Total penalty for rotational constraint violations (mio. USD17MER) q30_rotation_max(j,rotamax30) Local maximum rotational constraints (mio. ha) q30_rotation_min(j,rotamin30) Local minimum rotational constraints (mio. ha) q30_rotation_max2(j,rotamax30) Local maximum rotational constraints (mio. ha) @@ -45,15 +45,15 @@ equations *#################### R SECTION START (OUTPUT DECLARATIONS) #################### parameters ov_area(t,j,kcr,w,type) Agricultural production area (mio. ha) - ov_rotation_penalty(t,i,type) Penalty for violating rotational constraints (mio. USD05MER) + ov_rotation_penalty(t,i,type) Penalty for violating rotational constraints (mio. USD17MER) ov_carbon_stock_croparea(t,j,ag_pools,type) Carbon stock in croparea (tC) - ov30_penalty_max_irrig(t,j,rotamax30,type) Penalty for violating max rotational constraints on irrigated land (mio. USD05MER) - ov30_penalty(t,j,rota30,type) Penalty for violating rotational constraints (mio. USD05MER) + ov30_penalty_max_irrig(t,j,rotamax30,type) Penalty for violating max rotational constraints on irrigated land (mio. USD17MER) + ov30_penalty(t,j,rota30,type) Penalty for violating rotational constraints (mio. USD17MER) ov30_betr_missing(t,j,type) Missing bioenergy tree land towards target (mio. ha) ov30_crop_area(t,i,type) Total regional crop production area (mio. ha) oq30_prod(t,j,kcr,type) Production of cropped products (mio. tDM) oq30_betr_missing(t,j,type) Missing bioenergy tree land towards target (mio. ha) - oq30_rotation_penalty(t,i,type) Total penalty for rotational constraint violations (mio. USD05MER) + oq30_rotation_penalty(t,i,type) Total penalty for rotational constraint violations (mio. USD17MER) oq30_rotation_max(t,j,rotamax30,type) Local maximum rotational constraints (mio. ha) oq30_rotation_min(t,j,rotamin30,type) Local minimum rotational constraints (mio. ha) oq30_rotation_max2(t,j,rotamax30,type) Local maximum rotational constraints (mio. ha) diff --git a/modules/30_croparea/detail_apr24/input.gms b/modules/30_croparea/detail_apr24/input.gms index 47c979fc0e..e803e0133b 100644 --- a/modules/30_croparea/detail_apr24/input.gms +++ b/modules/30_croparea/detail_apr24/input.gms @@ -28,7 +28,7 @@ scalars s30_betr_start_noselect Share of bioenergy land on total cropland in start year (1) / 0 / s30_betr_target Share of bioenergy land on total cropland in target year (1) / 0 / s30_betr_target_noselect Share of bioenergy land on total cropland in target year (1) / 0 / - s30_betr_penalty Penalty for violation of betr target (USD05MER per ha) / 2000 / + s30_betr_penalty Penalty for violation of betr target (USD17MER per ha) / 2000 / s30_annual_max_growth Max annual cropland growth as share of previous cropland (1) / Inf / ; @@ -82,7 +82,7 @@ m_fillmissingyears(fm_croparea,"j,w,kcr"); ********* CROP-ROTATIONAL CONSTRAINT ******************************************* -table f30_rotation_incentives(rota30,incentscen30) penalties for violating rotation rules (USD05MER) +table f30_rotation_incentives(rota30,incentscen30) penalties for violating rotation rules (USD17MER) $ondelim $include "./modules/30_croparea/detail_apr24/input/f30_rotation_incentives.csv" $offdelim diff --git a/modules/30_croparea/simple_apr24/declarations.gms b/modules/30_croparea/simple_apr24/declarations.gms index cc118fa84a..3cfdfb3833 100644 --- a/modules/30_croparea/simple_apr24/declarations.gms +++ b/modules/30_croparea/simple_apr24/declarations.gms @@ -9,14 +9,14 @@ parameters i30_rotation_scenario_fader(t_all) Crop rotation scenario fader (1) i30_betr_scenario_fader(t_all) Bioenergy land scenario fader (1) i30_betr_target(t,j) Target share for bioenergy land on total cropland (1) - i30_betr_penalty(t) Penalty for violation of betr target (USD05MER per ha) + i30_betr_penalty(t) Penalty for violation of betr target (USD17MER per ha) p30_country_weight(i) Policy country weight per region (1) p30_country_dummy(iso) Dummy parameter indicating whether country is affected by selected policy (1) ; positive variables vm_area(j,kcr,w) Agricultural production area (mio. ha) - vm_rotation_penalty(i) Penalty for violating rotational constraints (mio. USD05MER) + vm_rotation_penalty(i) Penalty for violating rotational constraints (mio. USD17MER) vm_carbon_stock_croparea(j,ag_pools) Carbon stock in croparea (tC) v30_betr_missing(j) Missing bioenergy tree land towards target (mio. ha) v30_crop_area(i) Total regional crop production area (mio. ha) @@ -25,7 +25,7 @@ positive variables equations q30_prod(j,kcr) Production of cropped products (mio. tDM) q30_betr_missing(j) Missing bioenergy tree land towards target (mio. ha) - q30_cost(i) Cost (mio. USD05MER) + q30_cost(i) Cost (mio. USD17MER) q30_rotation_max(j,crp30,w) Local maximum rotational constraints (mio. ha) q30_rotation_min(j,crp30,w) Local minimum rotational constraints (mio. ha) q30_carbon(j,ag_pools) Croplarea above ground carbon content calculation (mio. tC) @@ -37,13 +37,13 @@ equations *#################### R SECTION START (OUTPUT DECLARATIONS) #################### parameters ov_area(t,j,kcr,w,type) Agricultural production area (mio. ha) - ov_rotation_penalty(t,i,type) Penalty for violating rotational constraints (mio. USD05MER) + ov_rotation_penalty(t,i,type) Penalty for violating rotational constraints (mio. USD17MER) ov_carbon_stock_croparea(t,j,ag_pools,type) Carbon stock in croparea (tC) ov30_betr_missing(t,j,type) Missing bioenergy tree land towards target (mio. ha) ov30_crop_area(t,i,type) Total regional crop production area (mio. ha) oq30_prod(t,j,kcr,type) Production of cropped products (mio. tDM) oq30_betr_missing(t,j,type) Missing bioenergy tree land towards target (mio. ha) - oq30_cost(t,i,type) Cost (mio. USD05MER) + oq30_cost(t,i,type) Cost (mio. USD17MER) oq30_rotation_max(t,j,crp30,w,type) Local maximum rotational constraints (mio. ha) oq30_rotation_min(t,j,crp30,w,type) Local minimum rotational constraints (mio. ha) oq30_carbon(t,j,ag_pools,type) Croplarea above ground carbon content calculation (mio. tC) diff --git a/modules/30_croparea/simple_apr24/input.gms b/modules/30_croparea/simple_apr24/input.gms index e99a128cb0..aba93e5c08 100644 --- a/modules/30_croparea/simple_apr24/input.gms +++ b/modules/30_croparea/simple_apr24/input.gms @@ -23,7 +23,7 @@ scalars s30_betr_start_noselect Share of bioenergy land on total cropland in start year (1) / 0 / s30_betr_target Share of bioenergy land on total cropland in target year (1) / 0 / s30_betr_target_noselect Share of bioenergy land on total cropland in target year (1) / 0 / - s30_betr_penalty Penalty for violation of betr target (USD05MER per ha) / 2000 / + s30_betr_penalty Penalty for violation of betr target (USD17MER per ha) / 2000 / s30_annual_max_growth Max annual cropland growth as share of previous cropland (1) / Inf / ; diff --git a/modules/31_past/endo_jun13/declarations.gms b/modules/31_past/endo_jun13/declarations.gms index 69c530d44e..2630ffc3e0 100644 --- a/modules/31_past/endo_jun13/declarations.gms +++ b/modules/31_past/endo_jun13/declarations.gms @@ -9,20 +9,20 @@ equations q31_prod(j) Cellular pasture production constraint (mio. tDM per yr) q31_carbon(j,ag_pools,stockType) Above ground carbon content calculation for pasture (mio tC) - q31_cost_prod_past(i) Costs for putting animals on pastures (mio. USD05MER per yr) + q31_cost_prod_past(i) Costs for putting animals on pastures (mio. USD17MER per yr) q31_bv_manpast(j,potnatveg) Biodiversity value for managed pastures (Mha) q31_bv_rangeland(j,potnatveg) Biodiversity value for rangeland (Mha) ; positive variables - vm_cost_prod_past(i) Costs for putting animals on pastures (mio. USD05MER per yr) + vm_cost_prod_past(i) Costs for putting animals on pastures (mio. USD17MER per yr) ; *#################### R SECTION START (OUTPUT DECLARATIONS) #################### parameters - ov_cost_prod_past(t,i,type) Costs for putting animals on pastures (mio. USD05MER per yr) + ov_cost_prod_past(t,i,type) Costs for putting animals on pastures (mio. USD17MER per yr) oq31_prod(t,j,type) Cellular pasture production constraint (mio. tDM per yr) oq31_carbon(t,j,ag_pools,stockType,type) Above ground carbon content calculation for pasture (mio tC) - oq31_cost_prod_past(t,i,type) Costs for putting animals on pastures (mio. USD05MER per yr) + oq31_cost_prod_past(t,i,type) Costs for putting animals on pastures (mio. USD17MER per yr) oq31_bv_manpast(t,j,potnatveg,type) Biodiversity value for managed pastures (Mha) oq31_bv_rangeland(t,j,potnatveg,type) Biodiversity value for rangeland (Mha) ; diff --git a/modules/31_past/endo_jun13/input.gms b/modules/31_past/endo_jun13/input.gms index b2055729cd..766e8e479f 100644 --- a/modules/31_past/endo_jun13/input.gms +++ b/modules/31_past/endo_jun13/input.gms @@ -7,5 +7,5 @@ scalars - s31_fac_req_past Factor requirements (USD05MER per tDM) / 1 / + s31_fac_req_past Factor requirements (USD17MER per tDM) / 1 / ; diff --git a/modules/31_past/grasslands_apr22/declarations.gms b/modules/31_past/grasslands_apr22/declarations.gms index fa3568dee3..55b632c120 100644 --- a/modules/31_past/grasslands_apr22/declarations.gms +++ b/modules/31_past/grasslands_apr22/declarations.gms @@ -8,18 +8,18 @@ equations q31_carbon(j,ag_pools,stockType) Above ground carbon content calculation for pasture (mio tC) -q31_cost_prod_past(i) Costs for putting animals on grasslands and shifting between grassland types (mio. USD05MER per yr) +q31_cost_prod_past(i) Costs for putting animals on grasslands and shifting between grassland types (mio. USD17MER per yr) q31_bv_manpast(j,potnatveg) Biodiversity value for managed pastures (Mha) q31_bv_rangeland(j,potnatveg) Biodiversity value for rangeland (Mha) q31_pasture_areas(j) Total grassland calculation (mio. ha) q31_prod_pm(j) Cellular grass production constraint (mio. tDM per yr) -q31_expansion_cost(j, grassland) Grassland expansion cost constraint (mio. USD05MER) +q31_expansion_cost(j, grassland) Grassland expansion cost constraint (mio. USD17MER) ; positive variables v31_grass_area(j,grassland) Grassland areas (mio. ha) -v31_cost_grass_expansion(j, grassland) Costs of grassland expansion (mio. USD05MER) -vm_cost_prod_past(i) Costs for putting animals on grasslands and shifting between grassland types (mio. USD05MER per yr) +v31_cost_grass_expansion(j, grassland) Costs of grassland expansion (mio. USD17MER) +vm_cost_prod_past(i) Costs for putting animals on grasslands and shifting between grassland types (mio. USD17MER per yr) ; parameters @@ -37,15 +37,15 @@ i31_grass_hist_yld(t_all,i, grassland) FAO gassland yields (tDM *#################### R SECTION START (OUTPUT DECLARATIONS) #################### parameters ov31_grass_area(t,j,grassland,type) Grassland areas (mio. ha) - ov31_cost_grass_expansion(t,j,grassland,type) Costs of grassland expansion (mio. USD05MER) - ov_cost_prod_past(t,i,type) Costs for putting animals on grasslands and shifting between grassland types (mio. USD05MER per yr) + ov31_cost_grass_expansion(t,j,grassland,type) Costs of grassland expansion (mio. USD17MER) + ov_cost_prod_past(t,i,type) Costs for putting animals on grasslands and shifting between grassland types (mio. USD17MER per yr) oq31_carbon(t,j,ag_pools,stockType,type) Above ground carbon content calculation for pasture (mio tC) - oq31_cost_prod_past(t,i,type) Costs for putting animals on grasslands and shifting between grassland types (mio. USD05MER per yr) + oq31_cost_prod_past(t,i,type) Costs for putting animals on grasslands and shifting between grassland types (mio. USD17MER per yr) oq31_bv_manpast(t,j,potnatveg,type) Biodiversity value for managed pastures (Mha) oq31_bv_rangeland(t,j,potnatveg,type) Biodiversity value for rangeland (Mha) oq31_pasture_areas(t,j,type) Total grassland calculation (mio. ha) oq31_prod_pm(t,j,type) Cellular grass production constraint (mio. tDM per yr) - oq31_expansion_cost(t,j,grassland,type) Grassland expansion cost constraint (mio. USD05MER) + oq31_expansion_cost(t,j,grassland,type) Grassland expansion cost constraint (mio. USD17MER) ; *##################### R SECTION END (OUTPUT DECLARATIONS) ##################### diff --git a/modules/31_past/grasslands_apr22/input.gms b/modules/31_past/grasslands_apr22/input.gms index e0b33a5632..f5d0dd3463 100644 --- a/modules/31_past/grasslands_apr22/input.gms +++ b/modules/31_past/grasslands_apr22/input.gms @@ -7,8 +7,8 @@ scalars - s31_cost_expansion Grasslands expansion costs (USD05MER per hectare) / 1 / - s31_cost_grass_prod Grasslands factor costs (USD05MER per tDM) / 1 / + s31_cost_expansion Grasslands expansion costs (USD17MER per hectare) / 1 / + s31_cost_grass_prod Grasslands factor costs (USD17MER per tDM) / 1 / ; $setglobal c31_grassl_yld_scenario cc diff --git a/modules/31_past/grasslands_apr22/realization.gms b/modules/31_past/grasslands_apr22/realization.gms index c9bdd9650d..389b2e95c0 100644 --- a/modules/31_past/grasslands_apr22/realization.gms +++ b/modules/31_past/grasslands_apr22/realization.gms @@ -25,7 +25,7 @@ *' We currently do not accout for specific differences within intensive *' pasture management systems and related degradation of grasslands for both *' rangelands or managed pastures. Grass production costs and conversion costs between -*' grassland types are set 1 USD05MER per unit due to lack of data. +*' grassland types are set 1 USD17MER per unit due to lack of data. diff --git a/modules/34_urban/exo_nov21/input.gms b/modules/34_urban/exo_nov21/input.gms index abff7533dc..bb9a18190c 100644 --- a/modules/34_urban/exo_nov21/input.gms +++ b/modules/34_urban/exo_nov21/input.gms @@ -10,7 +10,7 @@ $setglobal c34_urban_scenario SSP2 scalars - s34_urban_deviation_cost Artificial cost for urban deviation variables (USD05MER per ha) / 1e+06 / + s34_urban_deviation_cost Artificial cost for urban deviation variables (USD17MER per ha) / 1e+06 / ; table f34_urbanland(t_all, j, urban_scen34) Urban land diff --git a/modules/36_employment/exo_may22/input.gms b/modules/36_employment/exo_may22/input.gms index 953dc62543..7005029c52 100644 --- a/modules/36_employment/exo_may22/input.gms +++ b/modules/36_employment/exo_may22/input.gms @@ -23,7 +23,7 @@ $include "./modules/36_employment/exo_may22/input/f36_weekly_hours_iso.csv" $offdelim ; -table f36_hist_hourly_costs(t_all,iso) Historical values of hourly labor costs in agriculture (USD05MER per h) +table f36_hist_hourly_costs(t_all,iso) Historical values of hourly labor costs in agriculture (USD17MER per h) $ondelim $include "./modules/36_employment/exo_may22/input/f36_historic_hourly_labor_costs.csv" $offdelim @@ -43,13 +43,13 @@ $include "./modules/36_employment/exo_may22/input/f36_historic_ag_employment.csv $offdelim ; -table f36_unspecified_subsidies(t_all,i) Factor cost share of unspecified subsidies not included in MAgPIE labor costs (mio. USD05MER) +table f36_unspecified_subsidies(t_all,i) Factor cost share of unspecified subsidies not included in MAgPIE labor costs (mio. USD17MER) $ondelim $include "./modules/36_employment/exo_may22/input/f36_unspecified_subsidies.csv" $offdelim ; -table f36_nonmagpie_factor_costs(t_all,i) Factor cost share of VoP from ag commodities not mapped to MAgPIE (mio. USD05MER) +table f36_nonmagpie_factor_costs(t_all,i) Factor cost share of VoP from ag commodities not mapped to MAgPIE (mio. USD17MER) $ondelim $include "./modules/36_employment/exo_may22/input/f36_nonmagpie_factor_costs.csv" $offdelim diff --git a/modules/38_factor_costs/per_ton_fao_may22/declarations.gms b/modules/38_factor_costs/per_ton_fao_may22/declarations.gms index d79d5b957a..29f31dba80 100644 --- a/modules/38_factor_costs/per_ton_fao_may22/declarations.gms +++ b/modules/38_factor_costs/per_ton_fao_may22/declarations.gms @@ -6,24 +6,24 @@ *** | Contact: magpie@pik-potsdam.de equations -q38_cost_prod_crop_labor(i) Regional labor costs for crop production (mio. USD05MER per yr) -q38_cost_prod_crop_capital(i) Regional capital costs for crop production (mio. USD05MER per yr) +q38_cost_prod_crop_labor(i) Regional labor costs for crop production (mio. USD17MER per yr) +q38_cost_prod_crop_capital(i) Regional capital costs for crop production (mio. USD17MER per yr) ; positive variables -vm_cost_prod_crop(i,factors) Regional factor costs of capital and labor for crop production (mio. USD05MER per yr) +vm_cost_prod_crop(i,factors) Regional factor costs of capital and labor for crop production (mio. USD17MER per yr) ; parameter pm_cost_share_crops(t,i,factors) Capital and labor shares of the regional factor costs for crop production (1) p38_share_calibration(i) Summation factor used to calibrate calculated capital shares with historical values (1) -i38_fac_req(t_all,i,kcr) Factor requirements (USD05MER per tDM) +i38_fac_req(t_all,i,kcr) Factor requirements (USD17MER per tDM) ; *#################### R SECTION START (OUTPUT DECLARATIONS) #################### parameters - ov_cost_prod_crop(t,i,factors,type) Regional factor costs of capital and labor for crop production (mio. USD05MER per yr) - oq38_cost_prod_crop_labor(t,i,type) Regional labor costs for crop production (mio. USD05MER per yr) - oq38_cost_prod_crop_capital(t,i,type) Regional capital costs for crop production (mio. USD05MER per yr) + ov_cost_prod_crop(t,i,factors,type) Regional factor costs of capital and labor for crop production (mio. USD17MER per yr) + oq38_cost_prod_crop_labor(t,i,type) Regional labor costs for crop production (mio. USD17MER per yr) + oq38_cost_prod_crop_capital(t,i,type) Regional capital costs for crop production (mio. USD17MER per yr) ; *##################### R SECTION END (OUTPUT DECLARATIONS) ##################### diff --git a/modules/38_factor_costs/per_ton_fao_may22/input.gms b/modules/38_factor_costs/per_ton_fao_may22/input.gms index bdb4cdd2a2..f04303aa89 100644 --- a/modules/38_factor_costs/per_ton_fao_may22/input.gms +++ b/modules/38_factor_costs/per_ton_fao_may22/input.gms @@ -8,7 +8,7 @@ $setglobal c38_fac_req glo * spatial disaggregation of factor requirements (options: glo, reg) -parameter f38_fac_req(kcr) Factor requirement costs in 2005 (USD05MER per tDM) +parameter f38_fac_req(kcr) Factor requirement costs in 2005 (USD17MER per tDM) / $ondelim $include "./modules/38_factor_costs/input/f38_fac_req_fao.csv" @@ -16,7 +16,7 @@ $offdelim / ; -parameter f38_fac_req_fao_reg(t_all,i,kcr) Factor requirement costs (USD05MER per tDM) +parameter f38_fac_req_fao_reg(t_all,i,kcr) Factor requirement costs (USD17MER per tDM) / $ondelim $include "./modules/38_factor_costs/input/f38_fac_req_fao_regional.cs4" diff --git a/modules/38_factor_costs/sticky_feb18/declarations.gms b/modules/38_factor_costs/sticky_feb18/declarations.gms index 22a97df414..744328c67d 100644 --- a/modules/38_factor_costs/sticky_feb18/declarations.gms +++ b/modules/38_factor_costs/sticky_feb18/declarations.gms @@ -6,41 +6,41 @@ *** | Contact: magpie@pik-potsdam.de equations - q38_cost_prod_labor(i) Regional labor input costs for crop production (mio USD05MER) - q38_cost_prod_capital(i) Regional capital input costs for crop production (mio USD05MER) - q38_investment_immobile(j,kcr) Cellular immobile investments into farm capital (mio USD05MER) - q38_investment_mobile(j) Cellular mobile investments into farm capital (mio USD05MER) + q38_cost_prod_labor(i) Regional labor input costs for crop production (mio USD17MER) + q38_cost_prod_capital(i) Regional capital input costs for crop production (mio USD17MER) + q38_investment_immobile(j,kcr) Cellular immobile investments into farm capital (mio USD17MER) + q38_investment_mobile(j) Cellular mobile investments into farm capital (mio USD17MER) ; positive variables - vm_cost_prod_crop(i,factors) Regional factor costs of capital and labor for crop production (mio USD05MER per yr) - v38_investment_immobile(j,kcr) Investment costs in immobile farm capital (mio USD05MER per yr) - v38_investment_mobile(j) Investment costs in mobile farm capital (mio USD05MER per yr) + vm_cost_prod_crop(i,factors) Regional factor costs of capital and labor for crop production (mio USD17MER per yr) + v38_investment_immobile(j,kcr) Investment costs in immobile farm capital (mio USD17MER per yr) + v38_investment_mobile(j) Investment costs in mobile farm capital (mio USD17MER per yr) ; parameters - p38_labor_need(t,i,kcr) Labor input costs per unit of output (USD05MER per ton DM) - p38_capital_need(t,i,kcr,mobil38) Capital requirements per unit of output (USD05MER per ton DM) - p38_capital_immobile(t,j,kcr) Preexisting immobile capital stocks before investment (mio USD05MER) - p38_capital_mobile(t,j) Preexisting mobile capital stocks before investment (mio USD05MER) + p38_labor_need(t,i,kcr) Labor input costs per unit of output (USD17MER per ton DM) + p38_capital_need(t,i,kcr,mobil38) Capital requirements per unit of output (USD17MER per ton DM) + p38_capital_immobile(t,j,kcr) Preexisting immobile capital stocks before investment (mio USD17MER) + p38_capital_mobile(t,j) Preexisting mobile capital stocks before investment (mio USD17MER) pm_cost_share_crops(t,i,factors) Capital and labor shares of the regional factor costs for crop production (1) p38_share_calibration(i) Summation factor used to calibrate calculated capital shares with historical values (1) p38_croparea_start(j,w,kcr) Agricultural land initialization area (mio. ha) - i38_fac_req(t_all,i,kcr) Factor requirements (USD05MER per tDM) + i38_fac_req(t_all,i,kcr) Factor requirements (USD17MER per tDM) ; *#################### R SECTION START (OUTPUT DECLARATIONS) #################### parameters - ov_cost_prod_crop(t,i,factors,type) Regional factor costs of capital and labor for crop production (mio USD05MER per yr) - ov38_investment_immobile(t,j,kcr,type) Investment costs in immobile farm capital (mio USD05MER per yr) - ov38_investment_mobile(t,j,type) Investment costs in mobile farm capital (mio USD05MER per yr) - oq38_cost_prod_labor(t,i,type) Regional labor input costs for crop production (mio USD05MER) - oq38_cost_prod_capital(t,i,type) Regional capital input costs for crop production (mio USD05MER) - oq38_investment_immobile(t,j,kcr,type) Cellular immobile investments into farm capital (mio USD05MER) - oq38_investment_mobile(t,j,type) Cellular mobile investments into farm capital (mio USD05MER) + ov_cost_prod_crop(t,i,factors,type) Regional factor costs of capital and labor for crop production (mio USD17MER per yr) + ov38_investment_immobile(t,j,kcr,type) Investment costs in immobile farm capital (mio USD17MER per yr) + ov38_investment_mobile(t,j,type) Investment costs in mobile farm capital (mio USD17MER per yr) + oq38_cost_prod_labor(t,i,type) Regional labor input costs for crop production (mio USD17MER) + oq38_cost_prod_capital(t,i,type) Regional capital input costs for crop production (mio USD17MER) + oq38_investment_immobile(t,j,kcr,type) Cellular immobile investments into farm capital (mio USD17MER) + oq38_investment_mobile(t,j,type) Cellular mobile investments into farm capital (mio USD17MER) ; *##################### R SECTION END (OUTPUT DECLARATIONS) ##################### diff --git a/modules/38_factor_costs/sticky_feb18/input.gms b/modules/38_factor_costs/sticky_feb18/input.gms index 7f2a513613..73d26f6d04 100644 --- a/modules/38_factor_costs/sticky_feb18/input.gms +++ b/modules/38_factor_costs/sticky_feb18/input.gms @@ -15,7 +15,7 @@ s38_depreciation_rate depreciation rate (share of costs) / 0.05 / s38_immobile immobile capital (share) / 1 / ; -parameter f38_fac_req(kcr) Factor requirement costs in 2005 (USD05MER per tDM) +parameter f38_fac_req(kcr) Factor requirement costs in 2005 (USD17MER per tDM) / $ondelim $include "./modules/38_factor_costs/input/f38_fac_req_fao.csv" @@ -23,7 +23,7 @@ $offdelim / ; -parameter f38_fac_req_fao_reg(t_all,i,kcr) Factor requirement costs (USD05MER per tDM) +parameter f38_fac_req_fao_reg(t_all,i,kcr) Factor requirement costs (USD17MER per tDM) / $ondelim $include "./modules/38_factor_costs/input/f38_fac_req_fao_regional.cs4" diff --git a/modules/38_factor_costs/sticky_labor/declarations.gms b/modules/38_factor_costs/sticky_labor/declarations.gms index 61a9dd1ebb..3d926064b4 100644 --- a/modules/38_factor_costs/sticky_labor/declarations.gms +++ b/modules/38_factor_costs/sticky_labor/declarations.gms @@ -6,28 +6,28 @@ *** | Contact: magpie@pik-potsdam.de equations - q38_cost_prod_labor(i) Regional labor input costs for crop production (mio USD05MER) - q38_cost_prod_capital(i) Regional capital input costs for crop production (mio USD05MER) - q38_investment_immobile(j,kcr) Cellular immobile investments into farm capital (mio USD05MER) - q38_investment_mobile(j) Cellular mobile investments into farm capital (mio USD05MER) + q38_cost_prod_labor(i) Regional labor input costs for crop production (mio USD17MER) + q38_cost_prod_capital(i) Regional capital input costs for crop production (mio USD17MER) + q38_investment_immobile(j,kcr) Cellular immobile investments into farm capital (mio USD17MER) + q38_investment_mobile(j) Cellular mobile investments into farm capital (mio USD17MER) q38_ces_prodfun(j,kcr) CES production function for one unit of output (1) q38_labor_share_target(j) Enforces minimum labor cost share out of factor costs (1) ; positive variables - vm_cost_prod_crop(i,factors) Regional factor costs of capital and labor for crop production (mio USD05MER per yr) - v38_investment_immobile(j,kcr) Investment costs in immobile farm capital (mio USD05MER per yr) - v38_investment_mobile(j) Investment costs in mobile farm capital (mio USD05MER per yr) + vm_cost_prod_crop(i,factors) Regional factor costs of capital and labor for crop production (mio USD17MER per yr) + v38_investment_immobile(j,kcr) Investment costs in immobile farm capital (mio USD17MER per yr) + v38_investment_mobile(j) Investment costs in mobile farm capital (mio USD17MER per yr) v38_laborhours_need(j,kcr) Labor required per unit of output (hours per ton DM) - v38_capital_need(j,kcr,mobil38) Captial required per unit of output (USD05MER per ton DM) + v38_capital_need(j,kcr,mobil38) Captial required per unit of output (USD17MER per ton DM) v38_relax_CES_lp(j,kcr) Variable to make CES function feasible in linearized model (1) ; parameters - p38_labor_need(t,i,kcr) Labor input costs per unit of output (USD05MER per ton DM) - p38_capital_need(t,i,kcr,mobil38) Capital requirements per unit of output (USD05MER per ton DM) - p38_capital_immobile(t,j,kcr) Preexisting immobile capital stocks before investment (mio USD05MER) - p38_capital_mobile(t,j) Preexisting mobile capital stocks before investment (mio USD05MER) + p38_labor_need(t,i,kcr) Labor input costs per unit of output (USD17MER per ton DM) + p38_capital_need(t,i,kcr,mobil38) Capital requirements per unit of output (USD17MER per ton DM) + p38_capital_immobile(t,j,kcr) Preexisting immobile capital stocks before investment (mio USD17MER) + p38_capital_mobile(t,j) Preexisting mobile capital stocks before investment (mio USD17MER) pm_cost_share_crops(t,i,factors) Capital and labor shares of the regional factor costs for crop production (1) p38_share_calibration(i) Summation factor used to calibrate calculated capital shares with historical values (1) @@ -40,7 +40,7 @@ parameters p38_intr_depr(t,i) Factor from interest and depreciation rate (1) - i38_fac_req(t_all,i,kcr) Factor requirements (USD05MER per tDM) + i38_fac_req(t_all,i,kcr) Factor requirements (USD17MER per tDM) ; scalars @@ -49,16 +49,16 @@ scalars *#################### R SECTION START (OUTPUT DECLARATIONS) #################### parameters - ov_cost_prod_crop(t,i,factors,type) Regional factor costs of capital and labor for crop production (mio USD05MER per yr) - ov38_investment_immobile(t,j,kcr,type) Investment costs in immobile farm capital (mio USD05MER per yr) - ov38_investment_mobile(t,j,type) Investment costs in mobile farm capital (mio USD05MER per yr) + ov_cost_prod_crop(t,i,factors,type) Regional factor costs of capital and labor for crop production (mio USD17MER per yr) + ov38_investment_immobile(t,j,kcr,type) Investment costs in immobile farm capital (mio USD17MER per yr) + ov38_investment_mobile(t,j,type) Investment costs in mobile farm capital (mio USD17MER per yr) ov38_laborhours_need(t,j,kcr,type) Labor required per unit of output (hours per ton DM) - ov38_capital_need(t,j,kcr,mobil38,type) Captial required per unit of output (USD05MER per ton DM) + ov38_capital_need(t,j,kcr,mobil38,type) Captial required per unit of output (USD17MER per ton DM) ov38_relax_CES_lp(t,j,kcr,type) Variable to make CES function feasible in linearized model (1) - oq38_cost_prod_labor(t,i,type) Regional labor input costs for crop production (mio USD05MER) - oq38_cost_prod_capital(t,i,type) Regional capital input costs for crop production (mio USD05MER) - oq38_investment_immobile(t,j,kcr,type) Cellular immobile investments into farm capital (mio USD05MER) - oq38_investment_mobile(t,j,type) Cellular mobile investments into farm capital (mio USD05MER) + oq38_cost_prod_labor(t,i,type) Regional labor input costs for crop production (mio USD17MER) + oq38_cost_prod_capital(t,i,type) Regional capital input costs for crop production (mio USD17MER) + oq38_investment_immobile(t,j,kcr,type) Cellular immobile investments into farm capital (mio USD17MER) + oq38_investment_mobile(t,j,type) Cellular mobile investments into farm capital (mio USD17MER) oq38_ces_prodfun(t,j,kcr,type) CES production function for one unit of output (1) oq38_labor_share_target(t,j,type) Enforces minimum labor cost share out of factor costs (1) ; diff --git a/modules/38_factor_costs/sticky_labor/input.gms b/modules/38_factor_costs/sticky_labor/input.gms index f19986da00..0e96a2a567 100644 --- a/modules/38_factor_costs/sticky_labor/input.gms +++ b/modules/38_factor_costs/sticky_labor/input.gms @@ -20,7 +20,7 @@ s38_targetyear_labor_share Year for which the target labor share should be set ( s38_target_fulfillment Share by which a region moves from its baseline labor share towards the target value (1) / 0.5 / ; -parameter f38_fac_req(kcr) Factor requirement costs in 2005 (USD05MER per tDM) +parameter f38_fac_req(kcr) Factor requirement costs in 2005 (USD17MER per tDM) / $ondelim $include "./modules/38_factor_costs/input/f38_fac_req_fao.csv" @@ -28,7 +28,7 @@ $offdelim / ; -parameter f38_fac_req_fao_reg(t_all,i,kcr) Factor requirement costs (USD05MER per tDM) +parameter f38_fac_req_fao_reg(t_all,i,kcr) Factor requirement costs (USD17MER per tDM) / $ondelim $include "./modules/38_factor_costs/input/f38_fac_req_fao_regional.cs4" diff --git a/modules/39_landconversion/calib/declarations.gms b/modules/39_landconversion/calib/declarations.gms index 0e083ba71b..aab3f9d382 100644 --- a/modules/39_landconversion/calib/declarations.gms +++ b/modules/39_landconversion/calib/declarations.gms @@ -6,22 +6,22 @@ *** | Contact: magpie@pik-potsdam.de equations - q39_cost_landcon(j,land) Calculation of cellular landconversion costs (mio. USD05MER per yr) + q39_cost_landcon(j,land) Calculation of cellular landconversion costs (mio. USD17MER per yr) ; variables - vm_cost_landcon(j,land) Costs for land expansion and reduction (mio. USD05MER per yr) + vm_cost_landcon(j,land) Costs for land expansion and reduction (mio. USD17MER per yr) ; parameters - i39_cost_establish(t,i,land) Land expansion costs (USD05MER per hectare) - i39_reward_reduction(t,i,land) Reward for land reduction (USD05MER per hectare) + i39_cost_establish(t,i,land) Land expansion costs (USD17MER per hectare) + i39_reward_reduction(t,i,land) Reward for land reduction (USD17MER per hectare) i39_calib(t,i,type39) Calibration factor for costs of cropland expansion and rewards for cropland reduction (1) ; *#################### R SECTION START (OUTPUT DECLARATIONS) #################### parameters - ov_cost_landcon(t,j,land,type) Costs for land expansion and reduction (mio. USD05MER per yr) - oq39_cost_landcon(t,j,land,type) Calculation of cellular landconversion costs (mio. USD05MER per yr) + ov_cost_landcon(t,j,land,type) Costs for land expansion and reduction (mio. USD17MER per yr) + oq39_cost_landcon(t,j,land,type) Calculation of cellular landconversion costs (mio. USD17MER per yr) ; *##################### R SECTION END (OUTPUT DECLARATIONS) ##################### diff --git a/modules/39_landconversion/calib/input.gms b/modules/39_landconversion/calib/input.gms index 2c1e0e0493..f8aaf29384 100644 --- a/modules/39_landconversion/calib/input.gms +++ b/modules/39_landconversion/calib/input.gms @@ -6,11 +6,11 @@ *** | Contact: magpie@pik-potsdam.de scalars - s39_cost_establish_crop Cost for cropland expansion before calibration (USD05MER per hectare) / 10000 / - s39_reward_crop_reduction Reward for cropland reduction before calibration (USD05MER per hectare) / 6000 / - s39_cost_establish_past Cost for pasture land expansion (USD05MER per hectare) / 8000 / - s39_cost_establish_forestry Cost for foresty land expansion (USD05MER per hectare) / 1000 / - s39_cost_establish_urban Cost for urban land expansion (USD05MER per hectare) / 10000 / + s39_cost_establish_crop Cost for cropland expansion before calibration (USD17MER per hectare) / 10000 / + s39_reward_crop_reduction Reward for cropland reduction before calibration (USD17MER per hectare) / 6000 / + s39_cost_establish_past Cost for pasture land expansion (USD17MER per hectare) / 8000 / + s39_cost_establish_forestry Cost for foresty land expansion (USD17MER per hectare) / 1000 / + s39_cost_establish_urban Cost for urban land expansion (USD17MER per hectare) / 10000 / s39_ignore_calib Switch for ignoring calibration factors (1) / 0 / ; diff --git a/modules/40_transport/gtap_nov12/declarations.gms b/modules/40_transport/gtap_nov12/declarations.gms index e6fd78ef46..b701c8730d 100644 --- a/modules/40_transport/gtap_nov12/declarations.gms +++ b/modules/40_transport/gtap_nov12/declarations.gms @@ -6,16 +6,16 @@ *** | Contact: magpie@pik-potsdam.de equation -q40_cost_transport(j,k) Cellular transport costs for k (mio. USD05MER per yr) +q40_cost_transport(j,k) Cellular transport costs for k (mio. USD17MER per yr) ; variables - vm_cost_transp(j,k) Transportation costs (mio. USD05MER per yr) + vm_cost_transp(j,k) Transportation costs (mio. USD17MER per yr) ; *#################### R SECTION START (OUTPUT DECLARATIONS) #################### parameters - ov_cost_transp(t,j,k,type) Transportation costs (mio. USD05MER per yr) - oq40_cost_transport(t,j,k,type) Cellular transport costs for k (mio. USD05MER per yr) + ov_cost_transp(t,j,k,type) Transportation costs (mio. USD17MER per yr) + oq40_cost_transport(t,j,k,type) Cellular transport costs for k (mio. USD17MER per yr) ; *##################### R SECTION END (OUTPUT DECLARATIONS) ##################### diff --git a/modules/40_transport/gtap_nov12/input.gms b/modules/40_transport/gtap_nov12/input.gms index 1839f20fc1..e52e0eec26 100644 --- a/modules/40_transport/gtap_nov12/input.gms +++ b/modules/40_transport/gtap_nov12/input.gms @@ -7,7 +7,7 @@ scalars - s40_pasture_transport_costs Transport costs for pasture (USD05MER per tDM per min) / 0 / + s40_pasture_transport_costs Transport costs for pasture (USD17MER per tDM per min) / 0 / ; @@ -20,7 +20,7 @@ $offdelim / ; -parameter f40_transport_costs(kall) Relative transport costs (USD05MER per tDM per min) +parameter f40_transport_costs(kall) Relative transport costs (USD17MER per tDM per min) / $ondelim $include "./modules/40_transport/gtap_nov12/input/f40_transport_costs.csv" diff --git a/modules/40_transport/off/declarations.gms b/modules/40_transport/off/declarations.gms index 16668b9512..8a2e5b87f8 100644 --- a/modules/40_transport/off/declarations.gms +++ b/modules/40_transport/off/declarations.gms @@ -7,11 +7,11 @@ variables - vm_cost_transp(j,k) Transportation costs (mio. USD05MER) + vm_cost_transp(j,k) Transportation costs (mio. USD17MER) ; *#################### R SECTION START (OUTPUT DECLARATIONS) #################### parameters - ov_cost_transp(t,j,k,type) Transportation costs (mio. USD05MER) + ov_cost_transp(t,j,k,type) Transportation costs (mio. USD17MER) ; *##################### R SECTION END (OUTPUT DECLARATIONS) ##################### diff --git a/modules/42_water_demand/agr_sector_aug13/declarations.gms b/modules/42_water_demand/agr_sector_aug13/declarations.gms index c4a2326d97..3562706f56 100644 --- a/modules/42_water_demand/agr_sector_aug13/declarations.gms +++ b/modules/42_water_demand/agr_sector_aug13/declarations.gms @@ -16,27 +16,27 @@ parameters p42_efp_fader(t_all) Determines the fading in of environmental flow policy (1) p42_country_dummy(iso) Dummy parameter indicating whether country is affected by EFP (1) p42_EFP_region_shr(t_all,i) Weighted share of region with regards to EFP (1) - ic42_pumping_cost(i) Parameter to capture values for pumping costs in a particular time step (USD05MER per m^3) + ic42_pumping_cost(i) Parameter to capture values for pumping costs in a particular time step (USD17MER per m^3) i42_watdem_total(t,j,watdem_ineldo,wtype) Non-agricultural water demand for entire year used in post-processing (mio. m^3 per yr) ; equations q42_water_demand(wat_dem,j) Water withdrawals of different sectors (mio. m^3 per yr) - q42_water_cost(i) Total cost of pumping irrigation water (USD05MER per yr) + q42_water_cost(i) Total cost of pumping irrigation water (USD17MER per yr) ; positive variables vm_watdem(wat_dem,j) Water demand from different sectors (mio. m^3 per yr) v42_irrig_eff(j) Irrigation efficiency (1) - vm_water_cost(i) Cost of irrigation water (USD05MER per m^3) + vm_water_cost(i) Cost of irrigation water (USD17MER per m^3) ; *#################### R SECTION START (OUTPUT DECLARATIONS) #################### parameters ov_watdem(t,wat_dem,j,type) Water demand from different sectors (mio. m^3 per yr) ov42_irrig_eff(t,j,type) Irrigation efficiency (1) - ov_water_cost(t,i,type) Cost of irrigation water (USD05MER per m^3) + ov_water_cost(t,i,type) Cost of irrigation water (USD17MER per m^3) oq42_water_demand(t,wat_dem,j,type) Water withdrawals of different sectors (mio. m^3 per yr) - oq42_water_cost(t,i,type) Total cost of pumping irrigation water (USD05MER per yr) + oq42_water_cost(t,i,type) Total cost of pumping irrigation water (USD17MER per yr) ; *##################### R SECTION END (OUTPUT DECLARATIONS) ##################### diff --git a/modules/42_water_demand/agr_sector_aug13/input.gms b/modules/42_water_demand/agr_sector_aug13/input.gms index 30d9b37dfc..61ff52999b 100644 --- a/modules/42_water_demand/agr_sector_aug13/input.gms +++ b/modules/42_water_demand/agr_sector_aug13/input.gms @@ -109,7 +109,7 @@ sets * Costs of pumping are calculated for India as per methodology in forthcoming paper by Singh et.al. parameter -f42_pumping_cost(t_all,i) Cost of pumping irrigation water (USD05MER per m^3) +f42_pumping_cost(t_all,i) Cost of pumping irrigation water (USD17MER per m^3) / $ondelim $include "./modules/42_water_demand/input/f42_pumping_cost.cs4" diff --git a/modules/42_water_demand/all_sectors_aug13/declarations.gms b/modules/42_water_demand/all_sectors_aug13/declarations.gms index e94a089e6a..1fa50b6846 100644 --- a/modules/42_water_demand/all_sectors_aug13/declarations.gms +++ b/modules/42_water_demand/all_sectors_aug13/declarations.gms @@ -16,27 +16,27 @@ parameters p42_efp_fader(t_all) Determines the fading in of environmental flow policy (1) p42_country_dummy(iso) Dummy parameter indicating whether country is affected by EFP (1) p42_EFP_region_shr(t_all,i) Weighted share of region with regards to EFP (1) - ic42_pumping_cost(i) Parameter to capture values for pumping costs in a particular time step (USD05MER per m^3) + ic42_pumping_cost(i) Parameter to capture values for pumping costs in a particular time step (USD17MER per m^3) i42_watdem_total(t,j,watdem_ineldo,wtype) Non-agricultural water demand for entire year used in post-processing (mio. m^3 per yr) ; equations q42_water_demand(wat_dem,j) Water withdrawals of different sectors (mio. m^3 per yr) - q42_water_cost(i) Total cost of pumping irrigation water (USD05MER per yr) + q42_water_cost(i) Total cost of pumping irrigation water (USD17MER per yr) ; positive variables vm_watdem(wat_dem,j) Amount of water needed in different sectors (mio. m^3 per yr) v42_irrig_eff(j) Irrigation efficiency (1) - vm_water_cost(i) Cost of irrigation water (USD05MER per m^3) + vm_water_cost(i) Cost of irrigation water (USD17MER per m^3) ; *#################### R SECTION START (OUTPUT DECLARATIONS) #################### parameters ov_watdem(t,wat_dem,j,type) Amount of water needed in different sectors (mio. m^3 per yr) ov42_irrig_eff(t,j,type) Irrigation efficiency (1) - ov_water_cost(t,i,type) Cost of irrigation water (USD05MER per m^3) + ov_water_cost(t,i,type) Cost of irrigation water (USD17MER per m^3) oq42_water_demand(t,wat_dem,j,type) Water withdrawals of different sectors (mio. m^3 per yr) - oq42_water_cost(t,i,type) Total cost of pumping irrigation water (USD05MER per yr) + oq42_water_cost(t,i,type) Total cost of pumping irrigation water (USD17MER per yr) ; *##################### R SECTION END (OUTPUT DECLARATIONS) ##################### diff --git a/modules/42_water_demand/all_sectors_aug13/input.gms b/modules/42_water_demand/all_sectors_aug13/input.gms index ba297acdfd..6f370d255d 100644 --- a/modules/42_water_demand/all_sectors_aug13/input.gms +++ b/modules/42_water_demand/all_sectors_aug13/input.gms @@ -123,7 +123,7 @@ $setglobal c42_env_flow_policy off * Costs of pumping are calculated for India as per methodology in forthcoming paper by Singh et.al. parameter -f42_pumping_cost(t_all,i) Cost of pumping irrigation water (USD05MER per m^3) +f42_pumping_cost(t_all,i) Cost of pumping irrigation water (USD17MER per m^3) / $ondelim $include "./modules/42_water_demand/input/f42_pumping_cost.cs4" diff --git a/modules/50_nr_soil_budget/macceff_aug22/declarations.gms b/modules/50_nr_soil_budget/macceff_aug22/declarations.gms index a4b41a4606..51180277ef 100644 --- a/modules/50_nr_soil_budget/macceff_aug22/declarations.gms +++ b/modules/50_nr_soil_budget/macceff_aug22/declarations.gms @@ -8,7 +8,7 @@ positive variables vm_nr_inorg_fert_reg(i,land_ag) Inorganic fertilizer application (Tg N per yr) - vm_nr_inorg_fert_costs(i) Cost of inorganic fertilizers (mio. USD05MER per yr) + vm_nr_inorg_fert_costs(i) Cost of inorganic fertilizers (mio. USD17MER per yr) vm_nr_eff(i) Cropland nutrient uptake efficiency (Tg N per yr) vm_nr_eff_pasture(i) Pasture nutrient uptake efficiency (Tg N per yr) v50_nr_inputs(i) Total inputs to croplands (Tg N per yr) @@ -21,7 +21,7 @@ positive variables ; equations - q50_nr_cost_fert(i) Fertilizer costs (mio. USD05MER per yr) + q50_nr_cost_fert(i) Fertilizer costs (mio. USD17MER per yr) q50_nr_bal_crp(i) Cropland nutrient inputs have to equal withdrawals and losses (Tg N per yr) q50_nr_withdrawals(i,kcr) Calculating nr withdrawals (Tg N per yr) q50_nr_inputs(i) Calculating nr withdrawals (Tg N per yr) @@ -49,7 +49,7 @@ parameters *#################### R SECTION START (OUTPUT DECLARATIONS) #################### parameters ov_nr_inorg_fert_reg(t,i,land_ag,type) Inorganic fertilizer application (Tg N per yr) - ov_nr_inorg_fert_costs(t,i,type) Cost of inorganic fertilizers (mio. USD05MER per yr) + ov_nr_inorg_fert_costs(t,i,type) Cost of inorganic fertilizers (mio. USD17MER per yr) ov_nr_eff(t,i,type) Cropland nutrient uptake efficiency (Tg N per yr) ov_nr_eff_pasture(t,i,type) Pasture nutrient uptake efficiency (Tg N per yr) ov50_nr_inputs(t,i,type) Total inputs to croplands (Tg N per yr) @@ -59,7 +59,7 @@ parameters ov50_nr_withdrawals_pasture(t,i,type) Withdrawals of Nr from pasture soils (Tg N per yr) ov50_nr_surplus_pasture(t,i,type) Total Nr surplus on pasture soils (Tg N per yr) ov50_nr_deposition(t,i,land,type) Atmospheric deposition (Tg N per yr) - oq50_nr_cost_fert(t,i,type) Fertilizer costs (mio. USD05MER per yr) + oq50_nr_cost_fert(t,i,type) Fertilizer costs (mio. USD17MER per yr) oq50_nr_bal_crp(t,i,type) Cropland nutrient inputs have to equal withdrawals and losses (Tg N per yr) oq50_nr_withdrawals(t,i,kcr,type) Calculating nr withdrawals (Tg N per yr) oq50_nr_inputs(t,i,type) Calculating nr withdrawals (Tg N per yr) diff --git a/modules/50_nr_soil_budget/macceff_aug22/input.gms b/modules/50_nr_soil_budget/macceff_aug22/input.gms index 6f36b439c9..6bee1433da 100644 --- a/modules/50_nr_soil_budget/macceff_aug22/input.gms +++ b/modules/50_nr_soil_budget/macceff_aug22/input.gms @@ -26,7 +26,7 @@ $setglobal c50_dep_scen history * options: history scalar - s50_fertilizer_costs Costs of fertilizer (USD05MER per tN) / 600 / + s50_fertilizer_costs Costs of fertilizer (USD17MER per tN) / 600 / s50_maccs_global_ef Do maccs assume global emission factor (binary) /1/ s50_maccs_implicit_nue_glo Global nitrogen use efficiency implicit to MACCs /0.5/ ; diff --git a/modules/54_phosphorus/off/declarations.gms b/modules/54_phosphorus/off/declarations.gms index 92e20738f7..95fdfadbd0 100644 --- a/modules/54_phosphorus/off/declarations.gms +++ b/modules/54_phosphorus/off/declarations.gms @@ -7,11 +7,11 @@ variables - vm_p_fert_costs(i) costs for mineral fertilizers (mio. USD05MER per yr) + vm_p_fert_costs(i) costs for mineral fertilizers (mio. USD17MER per yr) ; *#################### R SECTION START (OUTPUT DECLARATIONS) #################### parameters - ov_p_fert_costs(t,i,type) costs for mineral fertilizers (mio. USD05MER per yr) + ov_p_fert_costs(t,i,type) costs for mineral fertilizers (mio. USD17MER per yr) ; *##################### R SECTION END (OUTPUT DECLARATIONS) ##################### diff --git a/modules/56_ghg_policy/price_aug22/declarations.gms b/modules/56_ghg_policy/price_aug22/declarations.gms index 70e98e4264..2c10d62171 100644 --- a/modules/56_ghg_policy/price_aug22/declarations.gms +++ b/modules/56_ghg_policy/price_aug22/declarations.gms @@ -6,9 +6,9 @@ *** | Contact: magpie@pik-potsdam.de parameters - im_pollutant_prices(t_all,i,pollutants,emis_source) Certificate prices for N2O-N CH4 CO2-C used in the model (USD05MER per Mg) - p56_pollutant_prices_input(t_all,i,pollutants,emis_source) Certificate prices for N2O-N CH4 CO2-C from input files (USD05MER per Mg) - p56_c_price_aff(t_all,i,ac) C price used for afforestation decision-making (USD05MER per tC) + im_pollutant_prices(t_all,i,pollutants,emis_source) Certificate prices for N2O-N CH4 CO2-C used in the model (USD17MER per Mg) + p56_pollutant_prices_input(t_all,i,pollutants,emis_source) Certificate prices for N2O-N CH4 CO2-C from input files (USD17MER per Mg) + p56_c_price_aff(t_all,i,ac) C price used for afforestation decision-making (USD17MER per tC) pc56_c_price_induced_aff Helper for fixing C price driven afforestation to zero for historic time steps (binary) p56_region_price_shr(t_all,i) GHG price share of the region (1) p56_country_dummy(iso) Dummy parameter indicating whether country is affected by selected GHG policy (1) @@ -19,11 +19,11 @@ parameters ; equations - q56_emission_costs(i) Calculation of total emission costs (mio. USD05MER per yr) - q56_emission_cost_annual(i,emis_annual) Calculation of regional costs for annual emissions (mio. USD05MER per yr) - q56_emission_cost_oneoff(i,emis_oneoff) Calculation of regional costs for emissions occuring only once in time (mio. USD05MER per yr) - q56_reward_cdr_aff_reg(i) Regional revenues for carbon captured by afforestation (mio. USD05MER per yr) - q56_reward_cdr_aff(j) Cellular revenues for carbon captured by afforestation (mio. USD05MER per yr) + q56_emission_costs(i) Calculation of total emission costs (mio. USD17MER per yr) + q56_emission_cost_annual(i,emis_annual) Calculation of regional costs for annual emissions (mio. USD17MER per yr) + q56_emission_cost_oneoff(i,emis_oneoff) Calculation of regional costs for emissions occuring only once in time (mio. USD17MER per yr) + q56_reward_cdr_aff_reg(i) Regional revenues for carbon captured by afforestation (mio. USD17MER per yr) + q56_reward_cdr_aff(j) Cellular revenues for carbon captured by afforestation (mio. USD17MER per yr) q56_emis_pricing(i,pollutants,emis_source) Calculation of annual CO2 emissions for pricing (Tg per yr) q56_emis_pricing_co2(i,emis_oneoff) Calculation of annual CO2 emissions for pricing (Tg per yr) ; @@ -34,28 +34,28 @@ positive variables variables - vm_emission_costs(i) Costs for emission rights for pollutants and greenhouse gases (mio. USD05MER per yr) + vm_emission_costs(i) Costs for emission rights for pollutants and greenhouse gases (mio. USD17MER per yr) vm_emissions_reg(i,emis_source,pollutants) Regional emissions by source and gas after technical mitigation N CH4 C (Tg per yr) v56_emis_pricing(i,emis_source,pollutants) Regional emissions by source and gas after technical mitigation N CH4 C (Tg per yr) - v56_emission_cost(i,emis_source) GHG emissions cost (mio. USD05MER per yr) - vm_reward_cdr_aff(i) Regional average annual expected revenue from afforestation (mio. USD05MER per yr) - v56_reward_cdr_aff(j) Cellular average annual expected revenue from afforestation (mio. USD05MER per yr) + v56_emission_cost(i,emis_source) GHG emissions cost (mio. USD17MER per yr) + vm_reward_cdr_aff(i) Regional average annual expected revenue from afforestation (mio. USD17MER per yr) + v56_reward_cdr_aff(j) Cellular average annual expected revenue from afforestation (mio. USD17MER per yr) ; *#################### R SECTION START (OUTPUT DECLARATIONS) #################### parameters ov_carbon_stock(t,j,land,c_pools,stockType,type) Carbon stock in vegetation soil and litter for different land types (mio. tC) - ov_emission_costs(t,i,type) Costs for emission rights for pollutants and greenhouse gases (mio. USD05MER per yr) + ov_emission_costs(t,i,type) Costs for emission rights for pollutants and greenhouse gases (mio. USD17MER per yr) ov_emissions_reg(t,i,emis_source,pollutants,type) Regional emissions by source and gas after technical mitigation N CH4 C (Tg per yr) ov56_emis_pricing(t,i,emis_source,pollutants,type) Regional emissions by source and gas after technical mitigation N CH4 C (Tg per yr) - ov56_emission_cost(t,i,emis_source,type) GHG emissions cost (mio. USD05MER per yr) - ov_reward_cdr_aff(t,i,type) Regional average annual expected revenue from afforestation (mio. USD05MER per yr) - ov56_reward_cdr_aff(t,j,type) Cellular average annual expected revenue from afforestation (mio. USD05MER per yr) - oq56_emission_costs(t,i,type) Calculation of total emission costs (mio. USD05MER per yr) - oq56_emission_cost_annual(t,i,emis_annual,type) Calculation of regional costs for annual emissions (mio. USD05MER per yr) - oq56_emission_cost_oneoff(t,i,emis_oneoff,type) Calculation of regional costs for emissions occuring only once in time (mio. USD05MER per yr) - oq56_reward_cdr_aff_reg(t,i,type) Regional revenues for carbon captured by afforestation (mio. USD05MER per yr) - oq56_reward_cdr_aff(t,j,type) Cellular revenues for carbon captured by afforestation (mio. USD05MER per yr) + ov56_emission_cost(t,i,emis_source,type) GHG emissions cost (mio. USD17MER per yr) + ov_reward_cdr_aff(t,i,type) Regional average annual expected revenue from afforestation (mio. USD17MER per yr) + ov56_reward_cdr_aff(t,j,type) Cellular average annual expected revenue from afforestation (mio. USD17MER per yr) + oq56_emission_costs(t,i,type) Calculation of total emission costs (mio. USD17MER per yr) + oq56_emission_cost_annual(t,i,emis_annual,type) Calculation of regional costs for annual emissions (mio. USD17MER per yr) + oq56_emission_cost_oneoff(t,i,emis_oneoff,type) Calculation of regional costs for emissions occuring only once in time (mio. USD17MER per yr) + oq56_reward_cdr_aff_reg(t,i,type) Regional revenues for carbon captured by afforestation (mio. USD17MER per yr) + oq56_reward_cdr_aff(t,j,type) Cellular revenues for carbon captured by afforestation (mio. USD17MER per yr) oq56_emis_pricing(t,i,pollutants,emis_source,type) Calculation of annual CO2 emissions for pricing (Tg per yr) oq56_emis_pricing_co2(t,i,emis_oneoff,type) Calculation of annual CO2 emissions for pricing (Tg per yr) ; diff --git a/modules/56_ghg_policy/price_aug22/input.gms b/modules/56_ghg_policy/price_aug22/input.gms index 004c68d53a..392bd13573 100644 --- a/modules/56_ghg_policy/price_aug22/input.gms +++ b/modules/56_ghg_policy/price_aug22/input.gms @@ -67,7 +67,7 @@ pollutants_fader(pollutants) pollutants affected by GHG policy fader / co2_c, ch ; scalars - s56_limit_ch4_n2o_price Upper limit for CH4 and N2O GHG prices (USD05MER per tC) / 4000 / + s56_limit_ch4_n2o_price Upper limit for CH4 and N2O GHG prices (USD17MER per tC) / 4000 / s56_cprice_red_factor Reduction factor for CO2 price (-) / 1 / s56_minimum_cprice Minium C price for future time steps (USD per tC) / 0 / s56_ghgprice_devstate_scaling Switch for scaling GHG price with development state (1=on 0=off) / 0 / @@ -93,19 +93,19 @@ $setglobal c56_mute_ghgprices_until y2030 $setglobal c56_carbon_stock_pricing actualNoAcEst * options: actual, actualNoAcEst -table f56_pollutant_prices(t_all,i,pollutants,ghgscen56) GHG certificate prices for N2O-N CH4 CO2-C (USD05MER per t) +table f56_pollutant_prices(t_all,i,pollutants,ghgscen56) GHG certificate prices for N2O-N CH4 CO2-C (USD17MER per t) $ondelim $include "./modules/56_ghg_policy/input/f56_pollutant_prices.cs3" $offdelim ; -$if "%c56_pollutant_prices%" == "coupling" table f56_pollutant_prices_coupling(t_all,i,pollutants) Regional ghg certificate prices for N2O-N CH4 CO2-C (USD05MER per t) +$if "%c56_pollutant_prices%" == "coupling" table f56_pollutant_prices_coupling(t_all,i,pollutants) Regional ghg certificate prices for N2O-N CH4 CO2-C (USD17MER per t) $if "%c56_pollutant_prices%" == "coupling" $ondelim $if "%c56_pollutant_prices%" == "coupling" $include "./modules/56_ghg_policy/input/f56_pollutant_prices_coupling.cs3" $if "%c56_pollutant_prices%" == "coupling" $offdelim $if "%c56_pollutant_prices%" == "coupling" ; -$if "%c56_pollutant_prices%" == "emulator" table f56_pollutant_prices_emulator(t_all,i,pollutants) Global ghg certificate prices for N2O-N CH4 CO2-C (USD05MER per t) +$if "%c56_pollutant_prices%" == "emulator" table f56_pollutant_prices_emulator(t_all,i,pollutants) Global ghg certificate prices for N2O-N CH4 CO2-C (USD17MER per t) $if "%c56_pollutant_prices%" == "emulator" $ondelim $if "%c56_pollutant_prices%" == "emulator" $include "./modules/56_ghg_policy/input/f56_pollutant_prices_emulator.cs3" $if "%c56_pollutant_prices%" == "emulator" $offdelim diff --git a/modules/57_maccs/on_aug22/input.gms b/modules/57_maccs/on_aug22/input.gms index aa6ed24d82..95e6be943c 100644 --- a/modules/57_maccs/on_aug22/input.gms +++ b/modules/57_maccs/on_aug22/input.gms @@ -17,7 +17,7 @@ scalars s57_maxmac_ch4_entferm activate enteric fermentation CH4 mitigation independent of pollutant price (step of MACC and -1 is inactive) / -1 / s57_maxmac_ch4_awms activate awms CH4 mitigation independent of pollutant price (step of MACC and -1 is inactive) / -1 / s57_implicit_emis_factor emission factor for direct soil emissions implicit to MACC curves (tN2ON per tN) / 0.01 / - s57_implicit_fert_cost fertilizer costs implicit to MACC curves (USD05MER per ton N) / 600 / + s57_implicit_fert_cost fertilizer costs implicit to MACC curves (USD17MER per ton N) / 600 / ; $onEmpty diff --git a/modules/58_peatland/off/declarations.gms b/modules/58_peatland/off/declarations.gms index c39a5314fa..2983b10a78 100644 --- a/modules/58_peatland/off/declarations.gms +++ b/modules/58_peatland/off/declarations.gms @@ -6,13 +6,13 @@ *** | Contact: magpie@pik-potsdam.de positive variables - vm_peatland_cost(j) One-time and recurring cost of managed peatland (mio. USD05MER per yr) + vm_peatland_cost(j) One-time and recurring cost of managed peatland (mio. USD17MER per yr) ; *#################### R SECTION START (OUTPUT DECLARATIONS) #################### parameters - ov_peatland_cost(t,j,type) One-time and recurring cost of managed peatland (mio. USD05MER per yr) + ov_peatland_cost(t,j,type) One-time and recurring cost of managed peatland (mio. USD17MER per yr) ; *##################### R SECTION END (OUTPUT DECLARATIONS) ##################### diff --git a/modules/58_peatland/v2/declarations.gms b/modules/58_peatland/v2/declarations.gms index a33ac2a46b..f9598060ff 100644 --- a/modules/58_peatland/v2/declarations.gms +++ b/modules/58_peatland/v2/declarations.gms @@ -10,11 +10,11 @@ parameters pc58_manLand(j,manPeat58) Managed land area (mio. ha) p58_scalingFactorRed(t,j,manPeat58) Scaling factor for peatland reduction (1) p58_mapping_cell_climate(j,clcl58) Mapping between cells and climate regions (binary) - i58_cost_rewet_recur(t) Recurring costs for rewetted peatland (USD05MER per ha) - i58_cost_rewet_onetime(t) One-time costs for peatland rewetting (USD05MER per ha) - i58_cost_drain_recur(t) Recurring costs for drained and managed peatlands (USD05MER per ha) - i58_cost_drain_intact_onetime(t) One-time costs for drainage of intact peatland (USD05MER per ha) - i58_cost_drain_rewet_onetime(t) One-time costs for drainage of rewetted peatland (USD05MER per ha) + i58_cost_rewet_recur(t) Recurring costs for rewetted peatland (USD17MER per ha) + i58_cost_rewet_onetime(t) One-time costs for peatland rewetting (USD17MER per ha) + i58_cost_drain_recur(t) Recurring costs for drained and managed peatlands (USD17MER per ha) + i58_cost_drain_intact_onetime(t) One-time costs for drainage of intact peatland (USD17MER per ha) + i58_cost_drain_rewet_onetime(t) One-time costs for drainage of rewetted peatland (USD17MER per ha) ; equations @@ -25,15 +25,15 @@ equations q58_manLandRed(j,manPeat58) Managed land area reduction (mio. ha) q58_peatlandMan(j,manPeat58) Change of managed peatland area (mio. ha) q58_scalingFactorExp(j,manPeat58) Scaling factor for peatland expansion (1) - q58_peatland_cost(j) One-time and recurring cost of peatland conversion and management (mio. USD05MER per yr) - q58_peatland_cost_annuity(j,cost58) Annuity costs for peatland conversion in the current timestep (mio. USD05MER per yr) + q58_peatland_cost(j) One-time and recurring cost of peatland conversion and management (mio. USD17MER per yr) + q58_peatland_cost_annuity(j,cost58) Annuity costs for peatland conversion in the current timestep (mio. USD17MER per yr) q58_peatland_emis_detail(j,land58,emis58) Detailed GHG emissions from peatlands (Tg per yr) q58_peatland_emis(i,poll58) GHG emissions from managed peatland (Tg per yr) ; variables v58_peatlandChange(j,land58) Peatland area change (mio. ha) - vm_peatland_cost(j) One-time and recurring cost of peatland conversion and management (mio. USD05MER per yr) + vm_peatland_cost(j) One-time and recurring cost of peatland conversion and management (mio. USD17MER per yr) v58_peatland_emis(j,land58,emis58) Detailed GHG peatland GHG emissions (Tg per yr) ; @@ -44,13 +44,13 @@ positive variables v58_manLandRed(j,manPeat58) Managed land area reduction (mio. ha) v58_scalingFactorExp(j,manPeat58) Scaling factor for peatland expansion (1) v58_balance(j,manPeat58) Technical balance term for peatland scaling factor (1) - v58_peatland_cost_annuity(j,cost58) Annuity costs for peatland conversion in the current timestep (mio. USD05MER per yr) + v58_peatland_cost_annuity(j,cost58) Annuity costs for peatland conversion in the current timestep (mio. USD17MER per yr) ; *#################### R SECTION START (OUTPUT DECLARATIONS) #################### parameters ov58_peatlandChange(t,j,land58,type) Peatland area change (mio. ha) - ov_peatland_cost(t,j,type) One-time and recurring cost of peatland conversion and management (mio. USD05MER per yr) + ov_peatland_cost(t,j,type) One-time and recurring cost of peatland conversion and management (mio. USD17MER per yr) ov58_peatland_emis(t,j,land58,emis58,type) Detailed GHG peatland GHG emissions (Tg per yr) ov58_peatland(t,j,land58,type) Peatland area (mio. ha) ov58_manLand(t,j,manPeat58,type) Managed land area (mio. ha) @@ -58,7 +58,7 @@ parameters ov58_manLandRed(t,j,manPeat58,type) Managed land area reduction (mio. ha) ov58_scalingFactorExp(t,j,manPeat58,type) Scaling factor for peatland expansion (1) ov58_balance(t,j,manPeat58,type) Technical balance term for peatland scaling factor (1) - ov58_peatland_cost_annuity(t,j,cost58,type) Annuity costs for peatland conversion in the current timestep (mio. USD05MER per yr) + ov58_peatland_cost_annuity(t,j,cost58,type) Annuity costs for peatland conversion in the current timestep (mio. USD17MER per yr) oq58_peatland(t,j,type) Constraint for total peatland area (mio. ha) oq58_peatlandChange(t,j,land58,type) Peatland area change (mio. ha) oq58_manLand(t,j,manPeat58,type) Managed land area (mio. ha) @@ -66,8 +66,8 @@ parameters oq58_manLandRed(t,j,manPeat58,type) Managed land area reduction (mio. ha) oq58_peatlandMan(t,j,manPeat58,type) Change of managed peatland area (mio. ha) oq58_scalingFactorExp(t,j,manPeat58,type) Scaling factor for peatland expansion (1) - oq58_peatland_cost(t,j,type) One-time and recurring cost of peatland conversion and management (mio. USD05MER per yr) - oq58_peatland_cost_annuity(t,j,cost58,type) Annuity costs for peatland conversion in the current timestep (mio. USD05MER per yr) + oq58_peatland_cost(t,j,type) One-time and recurring cost of peatland conversion and management (mio. USD17MER per yr) + oq58_peatland_cost_annuity(t,j,cost58,type) Annuity costs for peatland conversion in the current timestep (mio. USD17MER per yr) oq58_peatland_emis_detail(t,j,land58,emis58,type) Detailed GHG emissions from peatlands (Tg per yr) oq58_peatland_emis(t,i,poll58,type) GHG emissions from managed peatland (Tg per yr) ; diff --git a/modules/58_peatland/v2/input.gms b/modules/58_peatland/v2/input.gms index 99c9207abf..20a7ce0c3e 100644 --- a/modules/58_peatland/v2/input.gms +++ b/modules/58_peatland/v2/input.gms @@ -6,14 +6,14 @@ *** | Contact: magpie@pik-potsdam.de scalars - s58_cost_rewet_recur Recurring costs for rewetted peatland (USD05MER per ha) / 200 / - s58_cost_rewet_onetime One-time costs for peatland rewetting (USD05MER per ha) / 7000 / - s58_cost_drain_recur Recurring costs for drained and managed peatlands (USD05MER per ha) / 0 / - s58_cost_drain_intact_onetime One-time costs for drainage of intact peatland (USD05MER per ha) / 0 / - s58_cost_drain_rewet_onetime One-time costs for drainage of rewetted peatland (USD05MER per ha) / 0 / + s58_cost_rewet_recur Recurring costs for rewetted peatland (USD17MER per ha) / 200 / + s58_cost_rewet_onetime One-time costs for peatland rewetting (USD17MER per ha) / 7000 / + s58_cost_drain_recur Recurring costs for drained and managed peatlands (USD17MER per ha) / 0 / + s58_cost_drain_intact_onetime One-time costs for drainage of intact peatland (USD17MER per ha) / 0 / + s58_cost_drain_rewet_onetime One-time costs for drainage of rewetted peatland (USD17MER per ha) / 0 / s58_rewetting_switch Peatland rewetting on (Inf) or off (0) / Inf / s58_fix_peatland Year indicating until when peatland area should be fixed (year) / 2020 / - s58_balance_penalty Penalty for technical peatland balance term (USD05MER) / 1e+06 / + s58_balance_penalty Penalty for technical peatland balance term (USD17MER) / 1e+06 / ; *Peatland area based on Global Peatland Map 2.0 and Global Peatland Database diff --git a/modules/60_bioenergy/1st2ndgen_priced_feb24/declarations.gms b/modules/60_bioenergy/1st2ndgen_priced_feb24/declarations.gms index d0bfaffac5..d3efbe17da 100644 --- a/modules/60_bioenergy/1st2ndgen_priced_feb24/declarations.gms +++ b/modules/60_bioenergy/1st2ndgen_priced_feb24/declarations.gms @@ -10,9 +10,9 @@ parameters i60_bioenergy_dem(t,i) Regional bioenergy demand per year (mio. GJ per yr) i60_res_2ndgenBE_dem(t,i) Regional residue demand for 2nd generation bioenergy per year (mio. GJ per yr) i60_1stgen_bioenergy_dem(t,i,kall) Regional 1st generation bioenergy demand (mio. GJ per yr) - i60_1stgen_bioenergy_subsidy_tdm(t) Global 1st generation bioenergy subsidy per tDM (USD05MER per tDM) - i60_1stgen_bioenergy_subsidy_gj(t) Global 1st generation bioenergy subsidy per GJ (USD05MER per GJ) - i60_2ndgen_bioenergy_subsidy(t) Global 2nd generation bioenergy subsidy (USD05MER per GHJ) + i60_1stgen_bioenergy_subsidy_tdm(t) Global 1st generation bioenergy subsidy per tDM (USD17MER per tDM) + i60_1stgen_bioenergy_subsidy_gj(t) Global 1st generation bioenergy subsidy per GJ (USD17MER per GJ) + i60_2ndgen_bioenergy_subsidy(t) Global 2nd generation bioenergy subsidy (USD17MER per GHJ) p60_region_BE_shr(t_all,i) Bioenergy demand share of the region (1) p60_country_dummy(iso) Dummy parameter indicating whether country is selected for selected bioenergy demand scenario (1) ; @@ -24,7 +24,7 @@ positive variables ; variables - vm_bioenergy_utility(i) Utility as negative costs for producing bioenergy (USD05MER per yr) + vm_bioenergy_utility(i) Utility as negative costs for producing bioenergy (USD17MER per yr) ; equations @@ -32,7 +32,7 @@ equations q60_bioenergy_glo Global 2nd generation dedicated bioenergy demand (mio. GJ per yr) q60_bioenergy_reg(i) Regional 2nd generation dedicated bioenergy demand (mio. GJ per yr) q60_res_2ndgenBE(i) Regional residue demand for 2nd generation bioenergy (mio. GJ per yr) - q60_bioenergy_incentive(i) Incentive to produce bioenergy (mio. USD05MER per yr) + q60_bioenergy_incentive(i) Incentive to produce bioenergy (mio. USD17MER per yr) ; *#################### R SECTION START (OUTPUT DECLARATIONS) #################### @@ -40,11 +40,11 @@ parameters ov_dem_bioen(t,i,kall,type) Regional bioenergy demand (mio. tDM per yr) ov60_2ndgen_bioenergy_dem_dedicated(t,i,kall,type) Bioenergy demand which can come from different regions (mio. GJ per yr) ov60_2ndgen_bioenergy_dem_residues(t,i,kall,type) Bioenergy demand which can come from different product types (mio. GJ per yr) - ov_bioenergy_utility(t,i,type) Utility as negative costs for producing bioenergy (USD05MER per yr) + ov_bioenergy_utility(t,i,type) Utility as negative costs for producing bioenergy (USD17MER per yr) oq60_bioenergy(t,i,kall,type) Global total bioenergy demand (mio. GJ per yr) oq60_bioenergy_glo(t,type) Global 2nd generation dedicated bioenergy demand (mio. GJ per yr) oq60_bioenergy_reg(t,i,type) Regional 2nd generation dedicated bioenergy demand (mio. GJ per yr) oq60_res_2ndgenBE(t,i,type) Regional residue demand for 2nd generation bioenergy (mio. GJ per yr) - oq60_bioenergy_incentive(t,i,type) Incentive to produce bioenergy (mio. USD05MER per yr) + oq60_bioenergy_incentive(t,i,type) Incentive to produce bioenergy (mio. USD17MER per yr) ; *##################### R SECTION END (OUTPUT DECLARATIONS) ##################### diff --git a/modules/60_bioenergy/1st2ndgen_priced_feb24/input.gms b/modules/60_bioenergy/1st2ndgen_priced_feb24/input.gms index da938046e9..208e4485d5 100644 --- a/modules/60_bioenergy/1st2ndgen_priced_feb24/input.gms +++ b/modules/60_bioenergy/1st2ndgen_priced_feb24/input.gms @@ -35,10 +35,10 @@ sets scalars c60_biodem_level bioenergy demand level indicator 1 for regional and 0 for global demand (1) / 1 / - c60_bioenergy_subsidy_fix_SSP2 first generation bioenergy subsidy during fix_SSP period (USD05MER per ton) / 300 / - c60_bioenergy_subsidy first generation bioenergy subsidy (USD05MER per ton) / 300 / - s60_bioenergy_gj_price_1st first generation bioenergy per-GJ price (USD05MER per GJ) / 0 / - s60_bioenergy_price_2nd second generation bioenergy price (USD05MER per GJ) / 0 / + c60_bioenergy_subsidy_fix_SSP2 first generation bioenergy subsidy during fix_SSP period (USD17MER per ton) / 300 / + c60_bioenergy_subsidy first generation bioenergy subsidy (USD17MER per ton) / 300 / + s60_bioenergy_gj_price_1st first generation bioenergy per-GJ price (USD17MER per GJ) / 0 / + s60_bioenergy_price_2nd second generation bioenergy price (USD17MER per GJ) / 0 / s60_2ndgen_bioenergy_dem_min Minimum dedicated 2nd generation bioenergy demand assumed in each region during SSP2-fix (mio. GJ per yr) / 1 / s60_2ndgen_bioenergy_dem_min_post_fix Minimum dedicated 2nd generation bioenergy demand assumed in each region after SSP2-fix (mio. GJ per yr) / 1 / ; diff --git a/modules/60_bioenergy/1stgen_priced_dec18/declarations.gms b/modules/60_bioenergy/1stgen_priced_dec18/declarations.gms index 9eb2009b59..9894f55c98 100644 --- a/modules/60_bioenergy/1stgen_priced_dec18/declarations.gms +++ b/modules/60_bioenergy/1stgen_priced_dec18/declarations.gms @@ -21,7 +21,7 @@ positive variables ; variables - vm_bioenergy_utility(i) Utility as negative costs for producing bioenergy (USD05MER per yr) + vm_bioenergy_utility(i) Utility as negative costs for producing bioenergy (USD17MER per yr) ; equations @@ -29,7 +29,7 @@ equations q60_bioenergy_glo Global 2nd generation dedicated bioenergy demand (mio. GJ per yr) q60_bioenergy_reg(i) Regional 2nd generation dedicated bioenergy demand (mio. GJ per yr) q60_res_2ndgenBE(i) Regional residue demand for 2nd generation bioenergy (mio. GJ per yr) - q60_bioenergy_incentive(i) Incentive to produce bioenergy (mio. USD05MER per yr) + q60_bioenergy_incentive(i) Incentive to produce bioenergy (mio. USD17MER per yr) ; *#################### R SECTION START (OUTPUT DECLARATIONS) #################### @@ -37,11 +37,11 @@ parameters ov_dem_bioen(t,i,kall,type) Regional bioenergy demand (mio. tDM per yr) ov60_2ndgen_bioenergy_dem_dedicated(t,i,kall,type) Bioenergy demand which can come from different regions (mio. GJ per yr) ov60_2ndgen_bioenergy_dem_residues(t,i,kall,type) Bioenergy demand which can come from different product types (mio. GJ per yr) - ov_bioenergy_utility(t,i,type) Utility as negative costs for producing bioenergy (USD05MER per yr) + ov_bioenergy_utility(t,i,type) Utility as negative costs for producing bioenergy (USD17MER per yr) oq60_bioenergy(t,i,kall,type) Global total bioenergy demand (mio. GJ per yr) oq60_bioenergy_glo(t,type) Global 2nd generation dedicated bioenergy demand (mio. GJ per yr) oq60_bioenergy_reg(t,i,type) Regional 2nd generation dedicated bioenergy demand (mio. GJ per yr) oq60_res_2ndgenBE(t,i,type) Regional residue demand for 2nd generation bioenergy (mio. GJ per yr) - oq60_bioenergy_incentive(t,i,type) Incentive to produce bioenergy (mio. USD05MER per yr) + oq60_bioenergy_incentive(t,i,type) Incentive to produce bioenergy (mio. USD17MER per yr) ; *##################### R SECTION END (OUTPUT DECLARATIONS) ##################### diff --git a/modules/60_bioenergy/1stgen_priced_dec18/input.gms b/modules/60_bioenergy/1stgen_priced_dec18/input.gms index 5e43819c25..1a17ee46b3 100644 --- a/modules/60_bioenergy/1stgen_priced_dec18/input.gms +++ b/modules/60_bioenergy/1stgen_priced_dec18/input.gms @@ -35,7 +35,7 @@ sets scalars c60_biodem_level bioenergy demand level indicator 1 for regional and 0 for global demand (1) / 1 / - c60_bioenergy_subsidy first generation bioenergy subsidy (USD05MER per ton) / 300 / + c60_bioenergy_subsidy first generation bioenergy subsidy (USD17MER per ton) / 300 / s60_2ndgen_bioenergy_dem_min Minimum dedicated 2nd generation bioenergy demand assumed in each region (mio. GJ per yr) / 1 / ; diff --git a/modules/70_livestock/fbask_jan16/declarations.gms b/modules/70_livestock/fbask_jan16/declarations.gms index c824516eb4..2641126d57 100644 --- a/modules/70_livestock/fbask_jan16/declarations.gms +++ b/modules/70_livestock/fbask_jan16/declarations.gms @@ -8,8 +8,8 @@ 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) + vm_cost_prod_livst(i,factors) Livestock factor costs (mio. USD17MER per yr) + vm_cost_prod_fish(i) Fish factor costs (mio. USD17MER per yr) ; equations @@ -35,7 +35,7 @@ parameters 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) + i70_fac_req_livst(t_all,i,kli) Factor requirements (USD17MER 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) ; @@ -44,8 +44,8 @@ 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) + ov_cost_prod_livst(t,i,factors,type) Livestock factor costs (mio. USD17MER per yr) + ov_cost_prod_fish(t,i,type) Fish factor costs (mio. USD17MER 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 capital costs for livestock production diff --git a/modules/70_livestock/fbask_jan16/input.gms b/modules/70_livestock/fbask_jan16/input.gms index a3acdbac2f..85419c8398 100644 --- a/modules/70_livestock/fbask_jan16/input.gms +++ b/modules/70_livestock/fbask_jan16/input.gms @@ -81,7 +81,7 @@ $include "./modules/70_livestock/fbask_jan16/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) +table f70_hist_factor_costs_livst(t_all,i,kli) Historical factor costs in livestock production (mio. USD17MER) $ondelim $include "./modules/70_livestock/fbask_jan16/input/f70_hist_factor_costs_livst.cs3" $offdelim diff --git a/modules/70_livestock/fbask_jan16_sticky/declarations.gms b/modules/70_livestock/fbask_jan16_sticky/declarations.gms index 87bfd6c37e..0ea7887eea 100644 --- a/modules/70_livestock/fbask_jan16_sticky/declarations.gms +++ b/modules/70_livestock/fbask_jan16_sticky/declarations.gms @@ -8,9 +8,9 @@ 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) + vm_cost_prod_livst(i,factors) Livestock factor costs (mio. USD17MER per yr) + vm_cost_prod_fish(i) Fish factor costs (mio. USD17MER per yr) + v70_investment(i,kli) Investment in immobile farm capital (mio USD17MER per yr) ; equations @@ -37,11 +37,11 @@ parameters 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) + i70_fac_req_livst(t_all,i,kli) Factor requirements (USD17MER 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_capital_need(t,i,kli) Capital requirements per unit of output (USD17MER per ton DM) + p70_capital(t,i,kli) Preexisting immobile capital stocks before investment (mio USD17MER) p70_initial_1995_prod(i,kli) Initial regional production of livestock products taken from 1995 (mio ton DM) ; @@ -49,9 +49,9 @@ 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 in immobile farm capital (mio USD05MER per yr) + ov_cost_prod_livst(t,i,factors,type) Livestock factor costs (mio. USD17MER per yr) + ov_cost_prod_fish(t,i,type) Fish factor costs (mio. USD17MER per yr) + ov70_investment(t,i,kli,type) Investment in immobile farm capital (mio USD17MER 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 diff --git a/modules/70_livestock/fbask_jan16_sticky/input.gms b/modules/70_livestock/fbask_jan16_sticky/input.gms index 9981c2e4bb..df5083ba8b 100644 --- a/modules/70_livestock/fbask_jan16_sticky/input.gms +++ b/modules/70_livestock/fbask_jan16_sticky/input.gms @@ -83,7 +83,7 @@ $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) +table f70_hist_factor_costs_livst(t_all,i,kli) Historical factor costs in livestock production (mio. USD17MER) $ondelim $include "./modules/70_livestock/fbask_jan16_sticky/input/f70_hist_factor_costs_livst.cs3" $offdelim diff --git a/modules/71_disagg_lvst/foragebased_aug18/declarations.gms b/modules/71_disagg_lvst/foragebased_aug18/declarations.gms index 7b9b964599..2a56b7fc4d 100644 --- a/modules/71_disagg_lvst/foragebased_aug18/declarations.gms +++ b/modules/71_disagg_lvst/foragebased_aug18/declarations.gms @@ -8,7 +8,7 @@ positive variables v71_prod_rum(j,kli_rum,kforage) Production of forage fed ruminants within a cell (mio. tDM per yr) v71_additional_mon(j, kli_mon) Additional punished production of monogastric livestock (mio. tDM per yr) - vm_costs_additional_mon(i) Punishment cost for additionally transported monogastric livst_egg (mio. USD05MER per yr) + vm_costs_additional_mon(i) Punishment cost for additionally transported monogastric livst_egg (mio. USD17MER per yr) ; variables @@ -20,7 +20,7 @@ equations q71_balanceflow_constraint(j,kli_rum,kforage) Nonlinear balanceflow constraint for cellular forage feed products (mio. tDM per yr) q71_sum_rum_liv(j,kli_rum) Total production of forage fed ruminants (mio. tDM per yr) q71_prod_mon_liv(j,kli_mon) Production constraint for monogastric livestock products (mio. tDM per yr) - q71_punishment_mon(i) Punishment for additional monogastrics (mio. USD05MER per yr) + q71_punishment_mon(i) Punishment for additional monogastrics (mio. USD17MER per yr) ; parameters @@ -29,19 +29,19 @@ parameters scalars s71_scale_mon Scalar for flexible distribution of monogastrics (1) - s71_punish_additional_mon Scaling factor for transport punishment (USD05MER per tDM) + s71_punish_additional_mon Scaling factor for transport punishment (USD17MER per tDM) ; *#################### R SECTION START (OUTPUT DECLARATIONS) #################### parameters ov71_prod_rum(t,j,kli_rum,kforage,type) Production of forage fed ruminants within a cell (mio. tDM per yr) ov71_additional_mon(t,j,kli_mon,type) Additional punished production of monogastric livestock (mio. tDM per yr) - ov_costs_additional_mon(t,i,type) Punishment cost for additionally transported monogastric livst_egg (mio. USD05MER per yr) + ov_costs_additional_mon(t,i,type) Punishment cost for additionally transported monogastric livst_egg (mio. USD17MER per yr) ov71_feed_balanceflow_share(t,j,kli_rum,kforage,type) Cellular feed balanceflow multiplier for forage feed for ruminant livestock (1) oq71_feed_rum_liv(t,j,kforage,type) Production constraint for ruminant livestock products (mio. tDM per yr) oq71_balanceflow_constraint(t,j,kli_rum,kforage,type) Nonlinear balanceflow constraint for cellular forage feed products (mio. tDM per yr) oq71_sum_rum_liv(t,j,kli_rum,type) Total production of forage fed ruminants (mio. tDM per yr) oq71_prod_mon_liv(t,j,kli_mon,type) Production constraint for monogastric livestock products (mio. tDM per yr) - oq71_punishment_mon(t,i,type) Punishment for additional monogastrics (mio. USD05MER per yr) + oq71_punishment_mon(t,i,type) Punishment for additional monogastrics (mio. USD17MER per yr) ; *##################### R SECTION END (OUTPUT DECLARATIONS) ##################### diff --git a/modules/71_disagg_lvst/foragebased_jul23/declarations.gms b/modules/71_disagg_lvst/foragebased_jul23/declarations.gms index e49d436e04..0144c4973e 100644 --- a/modules/71_disagg_lvst/foragebased_jul23/declarations.gms +++ b/modules/71_disagg_lvst/foragebased_jul23/declarations.gms @@ -8,7 +8,7 @@ positive variables v71_feed_forage(j, kforage) Production of forage within a cell (mio. tDM per yr) v71_additional_mon(j, kli_mon) Additional punished production of monogastric livestock (mio. tDM per yr) - vm_costs_additional_mon(i) Punishment cost for additionally transported monogastric livst_egg (mio. USD05MER per yr) + vm_costs_additional_mon(i) Punishment cost for additionally transported monogastric livst_egg (mio. USD17MER per yr) ; variables @@ -21,7 +21,7 @@ equations q71_feed_balanceflow_nlp(j) Non-linear balanceflow constraint for forage feed products (mio. tDM per yr) q71_feed_balanceflow_lp(i) Linear balanceflow constraint for forage feed products (mio. tDM per yr) q71_prod_mon_liv(j,kli_mon) Production constraint for monogastric livestock products (mio. tDM per yr) - q71_punishment_mon(i) Punishment for additional monogastrics (mio. USD05MER per yr) + q71_punishment_mon(i) Punishment for additional monogastrics (mio. USD17MER per yr) ; parameters @@ -31,20 +31,20 @@ parameters scalars s71_lp_fix Switch to fix equations to linear relation (Logical) s71_scale_mon Scalar for flexible distribution of monogastrics (1) - s71_punish_additional_mon Scaling factor for transport punishment (USD05MER per tDM) + s71_punish_additional_mon Scaling factor for transport punishment (USD17MER per tDM) ; *#################### R SECTION START (OUTPUT DECLARATIONS) #################### parameters ov71_feed_forage(t,j,kforage,type) Production of forage within a cell (mio. tDM per yr) ov71_additional_mon(t,j,kli_mon,type) Additional punished production of monogastric livestock (mio. tDM per yr) - ov_costs_additional_mon(t,i,type) Punishment cost for additionally transported monogastric livst_egg (mio. USD05MER per yr) + ov_costs_additional_mon(t,i,type) Punishment cost for additionally transported monogastric livst_egg (mio. USD17MER per yr) ov71_feed_balanceflow(t,j,kforage,type) Cellular feed balanceflow for forage feed for ruminant livestock (mio. tDM per yr) oq71_feed_rum_liv(t,j,kforage,type) Production constraint for ruminant livestock products (mio. tDM per yr) oq71_feed_forage(t,j,type) Forage feed constraint (mio. tDM per yr) oq71_feed_balanceflow_nlp(t,j,type) Non-linear balanceflow constraint for forage feed products (mio. tDM per yr) oq71_feed_balanceflow_lp(t,i,type) Linear balanceflow constraint for forage feed products (mio. tDM per yr) oq71_prod_mon_liv(t,j,kli_mon,type) Production constraint for monogastric livestock products (mio. tDM per yr) - oq71_punishment_mon(t,i,type) Punishment for additional monogastrics (mio. USD05MER per yr) + oq71_punishment_mon(t,i,type) Punishment for additional monogastrics (mio. USD17MER per yr) ; *##################### R SECTION END (OUTPUT DECLARATIONS) ##################### diff --git a/modules/71_disagg_lvst/off/declarations.gms b/modules/71_disagg_lvst/off/declarations.gms index a239efbfba..85cd6bce1c 100644 --- a/modules/71_disagg_lvst/off/declarations.gms +++ b/modules/71_disagg_lvst/off/declarations.gms @@ -6,10 +6,10 @@ *** | Contact: magpie@pik-potsdam.de positive variables - vm_costs_additional_mon(i) Punishment cost for additionally transported monogastric livst_egg (mio. USD05MER per yr) + vm_costs_additional_mon(i) Punishment cost for additionally transported monogastric livst_egg (mio. USD17MER per yr) ; *#################### R SECTION START (OUTPUT DECLARATIONS) #################### parameters - ov_costs_additional_mon(t,i,type) Punishment cost for additionally transported monogastric livst_egg (mio. USD05MER per yr) + ov_costs_additional_mon(t,i,type) Punishment cost for additionally transported monogastric livst_egg (mio. USD17MER per yr) ; *##################### R SECTION END (OUTPUT DECLARATIONS) ##################### diff --git a/modules/80_optimization/lp_nlp_apr17/declarations.gms b/modules/80_optimization/lp_nlp_apr17/declarations.gms index 18bc7ca4d9..514d7bd6fa 100644 --- a/modules/80_optimization/lp_nlp_apr17/declarations.gms +++ b/modules/80_optimization/lp_nlp_apr17/declarations.gms @@ -12,5 +12,5 @@ parameters scalars s80_counter counter (1) - s80_obj_linear linear objective value (mio. USD05MER per yr) + s80_obj_linear linear objective value (mio. USD17MER per yr) ; From 0fc701cffa12eabddf74868350e2fe6a72dea07e Mon Sep 17 00:00:00 2001 From: David Chen Date: Thu, 5 Sep 2024 09:54:16 +0200 Subject: [PATCH 002/206] update monetary unit to 2017 base year --- config/default.cfg | 86 +++++++++++-------- modules/21_trade/selfsuff_reduced/input.gms | 4 +- modules/29_cropland/detail_apr24/input.gms | 10 +-- modules/30_croparea/detail_apr24/input.gms | 2 +- modules/30_croparea/simple_apr24/input.gms | 2 +- modules/32_forestry/dynamic_may24/input.gms | 10 +-- modules/35_natveg/pot_forest_may24/input.gms | 6 +- modules/39_landconversion/calib/input.gms | 10 +-- .../endo_apr13/declarations.gms | 10 +-- .../endo_apr13/input.gms | 4 +- .../static/declarations.gms | 4 +- .../bii_target/declarations.gms | 8 +- modules/44_biodiversity/bii_target/input.gms | 2 +- .../bii_target_apr24/declarations.gms | 8 +- .../bii_target_apr24/input.gms | 2 +- .../bv_btc_mar21/declarations.gms | 10 +-- .../44_biodiversity/bv_btc_mar21/input.gms | 4 +- .../50_nr_soil_budget/macceff_aug22/input.gms | 2 +- modules/56_ghg_policy/price_aug22/input.gms | 4 +- modules/58_peatland/v2/input.gms | 4 +- .../1st2ndgen_priced_feb24/input.gms | 2 +- .../1stgen_priced_dec18/input.gms | 2 +- modules/73_timber/default/input.gms | 9 +- 23 files changed, 112 insertions(+), 93 deletions(-) diff --git a/config/default.cfg b/config/default.cfg index 1bc02d6040..9428d0edee 100644 --- a/config/default.cfg +++ b/config/default.cfg @@ -586,7 +586,7 @@ cfg$gms$trade <- "selfsuff_reduced" # def = selfsuff_reduced # * Commodities that can have additional imports to maintain feasibility cfg$gms$k_import21 <- "wood, woodfuel" # * Cost for additional imports to maintain feasibility in USD17MER per tDM -cfg$gms$s21_cost_import <- 10000 # def = 10000 +cfg$gms$s21_cost_import <- 12300 # def = 10000 * 1.23 # * trade balance reduction scenario # * (l909090r808080): 10 percent trade liberalisation for secondary and @@ -619,8 +619,9 @@ cfg$gms$s21_trade_tariff_startyear <- 2025 # * end year of fadeout if s21_trade_tariff_fadeout = 1 # def = 2050 cfg$gms$s21_trade_tariff_targetyear <- 2050 -# * Minimum trade margin for forestry products (USD17MER per tDM) -cfg$gms$s21_min_trade_margin_forestry <- 50 # def = 50 +# * Minimum trade margin for forestry products (USD17MER per tDM) +# * (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 # ***--------------------- 22_land_conservation -------------------------------------- @@ -758,13 +759,16 @@ cfg$gms$s29_treecover_scenario_start <- 2025 # def = 2025 # * Target year of fader (year when full implementation is reached) cfg$gms$s29_treecover_scenario_target <- 2050 # def = 2050 # * Penalty for violation of treecover target before scenario start (USD17MER per ha) -cfg$gms$s29_treecover_penalty_before <- 5000 # def = 5000 -# * Penalty for violation of treecover target after scenario start (USD17MER per ha) -cfg$gms$s29_treecover_penalty <- 5000 # def = 5000 +# * (inflated from default originally in USD05 using USD05 --> USD17 inflation rate:1.23) +cfg$gms$s29_treecover_penalty_before <- 6150 # def = 5000 * 1.23 +# * Penalty for violation of treecover target after scenario start (USD17MER per ha) +# * (inflated from default originally in USD05 using USD05 --> USD17 inflation rate: 1.23) +cfg$gms$s29_treecover_penalty <- 6150 # def = 5000 * 1.23 # * Tree cover establishment cost (USD17MER per ha) -cfg$gms$s29_cost_treecover_est <- 2000 # def = 2000 +# * (inflated from default originally in USD05 using USD05 --> USD17 inflation rate:1.23) +cfg$gms$s29_cost_treecover_est <- 2460 # def = 2000 * 1.23 # * Tree cover recurring cost (USD17MER per ha) -cfg$gms$s29_cost_treecover_recur <- 500 # def = 500 +cfg$gms$s29_cost_treecover_recur <- 620 # def = 500 * 1.23 # * Sigmoid fader for minimum area share of fallow land on total cropland at cluster level # * Minimum area share of fallow land on total cropland in target year @@ -776,7 +780,8 @@ cfg$gms$s29_fallow_scenario_start <- 2025 # def = 2025 # * Target year of fader (year when full implementation is reached) cfg$gms$s29_fallow_scenario_target <- 2050 # def = 2050 # * Penalty for violation of fallow land target (USD17MER per ha) -cfg$gms$s29_fallow_penalty <- 500 # def = 500 +# * (inflated from default originally in USD05 using USD05 --> USD17 inflation rate: 1.23) +cfg$gms$s29_fallow_penalty <- 615 # def = 500 * 1.23 # ***--------------------- 30_croparea --------------------------------------- # * 30_croparea defines the croparea, which is a subcomponent of total cropland defined in 29_cropland. @@ -815,7 +820,8 @@ cfg$gms$s30_betr_scenario_start <- 2025 # def = 2025 # * Target year of fader (year when full implementation is reached) cfg$gms$s30_betr_scenario_target <- 2050 # def = 2050 # * Penalty for violation of the target (USD17MER per ha) -cfg$gms$s30_betr_penalty <- 2000 # def = 2000 +# * (inflated from default originally in USD05 using USD05 --> USD17 inflation rate: 1.23) +cfg$gms$s30_betr_penalty <- 2460 # def = 2000 * 1.23 # * Allowed annual cropland growth per year per region, relative to the current cropland level # * e.g., 0.02: 2% annual growth, compounded to 10.4% growth for five-years timestep @@ -858,7 +864,7 @@ cfg$gms$s30_rotation_scenario_target <- 2050 # def = 2050 # NOTE: It is recommended to recalibrate the model when changing this setting! cfg$gms$past <- "endo_jun13" # def = endo_jun13 -# * Factor requirements (USD04 per ton DM) +# * Factor requirements (USD17 per ton DM) cfg$gms$s31_fac_req_past <- 1 # def = 1 # * switch for unequal (1) or equal (0) sign in pasture production constraint q31_prod. @@ -988,10 +994,12 @@ cfg$gms$s32_forestry_int_rate <- 0.05 # def = 0.05 cfg$gms$s32_demand_establishment <- 1 # def = 1 # Establishment cost for plantations (USD per ha) -cfg$gms$s32_est_cost_plant <- 2000 # def = 2000 +# * (inflated from default originally in USD05 using USD05 --> USD17 inflation rate: 1.23) +cfg$gms$s32_est_cost_plant <- 2460 # def = 2000 * 1.23 # Establishment cost for natural vegetation (USD per ha) -cfg$gms$s32_est_cost_natveg <- 2000 # def = 2000 +# * (inflated from default originally in USD05 using USD05 --> USD17 inflation rate: 1.23) +cfg$gms$s32_est_cost_natveg <- 2460 # def = 2000 * 1.23 # Harvesting switch for timber production # * 0 = No harvested area from plantations, no age-class shifting (area held constant at 1995 levels) @@ -1086,7 +1094,7 @@ cfg$gms$c35_pot_forest_scenario <- "cc" # def = "cc" # * optimization cfg$gms$employment <- "exo_may22" # default = "exo_may22" -# * global minimum wage in USDMER05 per hour that needs to be reached in all countries by 2050 +# * global minimum wage in USD17MER per hour that needs to be reached in all countries by 2050 cfg$gms$s36_minimum_wage <- 0 # default = 0 (no minimum wage) # * A scenario that increases wages can either be fully related to productivity increase @@ -1162,15 +1170,20 @@ cfg$gms$s38_target_fulfillment <- 0.5 # default 0.5 # * Costs for pasture and forestry expansion are global static cfg$gms$landconversion <- "calib" # def = calib # * Cost for cropland expansion before calibration (USD17MER per hectare) -cfg$gms$s39_cost_establish_crop <- 10000 #def = 10000 +# * (inflated from default originally in USD05 using USD05 --> USD17 inflation rate: 1.23) +cfg$gms$s39_cost_establish_crop <- 12300 #def = 10000 * 1.23 # * Reward for cropland reduction before calibration (USD17MER per hectare) -cfg$gms$s39_reward_crop_reduction <- 6000 +# * (inflated from default originally in USD05 using USD05 --> USD17 inflation rate: 1.23) +cfg$gms$s39_reward_crop_reduction <- 7380 #def = 6000 * 1.23 # * Cost for pasture land expansion (USD17MER per hectare) -cfg$gms$s39_cost_establish_past <- 8000 #def = 8000 +# * (inflated from default originally in USD05 using USD05 --> USD17 inflation rate: 1.23) +cfg$gms$s39_cost_establish_past <- 9840 #def = 8000 * 1.23 # * Cost for foresty land expansion (USD17MER per hectare) -cfg$gms$s39_cost_establish_forestry <- 1000 #def = 1000 +# * (inflated from default originally in USD05 using USD05 --> USD17 inflation rate: 1.23) +cfg$gms$s39_cost_establish_forestry <- 1120 #def = 1000 * 1.23 # * Cost for urban land expansion (USD17MER per hectare) -cfg$gms$s39_cost_establish_urban <- 10000 #def = 10000 +# * (inflated from default originally in USD05 using USD05 --> USD17 inflation rate: 1.23) +cfg$gms$s39_cost_establish_urban <- 12300 #def = 10000 * 1.23 # * Switch for ignoring land conversion cost calibration factors # * Options: 1 (ignore calibration factors) # * 0 (use calibration factors) @@ -1631,15 +1644,16 @@ cfg$gms$s56_buffer_aff <- 0.5 # def = 0.5 # * Upper limit for CH4 and N2O GHG price (USD17MER per tC) # * Limits GHG prices selected in c56_pollutant_prices to the chosen value. -# * CH4 and N2O GHG prices are limited by default to 4000 USD17MER per tC equivalent, +# * CH4 and N2O GHG prices are limited by default to 4920 USD17MER per tC equivalent, # * which induces the maximum abatement possible with c57_macc_version = "PBL_2022" -# * Beyond 4000 USD17MER per tC equivalent no further technical mitigation is possible +# * Beyond 4920 USD17MER per tC equivalent no further technical mitigation is possible # * but would increase agricultural prices. # * Suggested limits for different c57_macc_version settings -# * PBL_2007: 1000 (200 steps, 5 USD each) -# * PBL_2019: 4000 (200 steps, 20 USD each) -# * PBL_2022: 4000 (200 steps, 20 USD each) -cfg$gms$s56_limit_ch4_n2o_price <- 4000 # def = 4000 +# * PBL_2007: 1230 (200 steps, 5.615 USD each) +# * PBL_2019: 4920 (200 steps, 24.6 USD each) +# * PBL_2022: 4920 (200 steps, 24.6 USD each) +# * (values above are inflated from default originally in USD05 using USD05 --> USD17 inflation rate: 1.23) +cfg$gms$s56_limit_ch4_n2o_price <- 4920 # def = 4000 * 1.23 # * NOTE: The following 2 options for emission pricing have strong interactions in runs with CO2 prices and should only be changed by experienced users. # * The main purpose of these options is to regulate the pricing of positive emissions. Note that re/afforestation is covered by a separate mechanism. @@ -1720,8 +1734,9 @@ cfg$gms$peatland <- "v2" # def = v2 cfg$gms$s58_rewetting_switch <- Inf # def = Inf # * One-time and recurring costs for peatland rewetting (USD17MER per ha) -cfg$gms$s58_cost_rewet_onetime <- 7000 # def = 7000 -cfg$gms$s58_cost_rewet_recur <- 200 # def = 200 +# * (inflated from default originally in USD05 using USD05 --> USD17 inflation rate:1.23) +cfg$gms$s58_cost_rewet_onetime <- 8610 # def = 7000 * 1.23 +cfg$gms$s58_cost_rewet_recur <- 246 # def = 200 * 1.23 # * One-time and recurring costs for peatland drainage (USD17MER per ha) # * One-time costs apply on the drainage of intact and rewetted peatland @@ -1880,8 +1895,9 @@ cfg$gms$s60_2ndgen_bioenergy_dem_min <- 1 # def = 1 # * (1st2ndgen_priced_feb24): c60_bioenergy_subsidy_fix_SSP2 is applied constant to historic time steps (up until sm_fix_SSP2). # * c60_bioenergy_subsidy is applied constant to model horizon (after sm_fix_SSP2) # * If GJ-based prices are used (setting below), c60_bioenergy_subsidy should be set to 0. -cfg$gms$c60_bioenergy_subsidy <- 300 # def = 300 -cfg$gms$c60_bioenergy_subsidy_fix_SSP2 <- 300 # def = 300 +# * (inflated from default originally in USD05 using USD05 --> USD17 inflation rate:1.23) +cfg$gms$c60_bioenergy_subsidy <- 369 # def = 300 * 1.23 +cfg$gms$c60_bioenergy_subsidy_fix_SSP2 <- 369 # def = 300 * 1.23 # ** Options for realization `1st2ndgen_priced_feb24` @@ -1984,11 +2000,13 @@ cfg$gms$timber <- "default" # def = default # * 0=off cfg$gms$s73_timber_demand_switch <- 1 # def = 1 -# harvesting cost per ton of dry matter produced (USD/tDM) -s73_timber_prod_cost <- 2000 # def = 2000 +# harvesting cost per ton of dry matter produced (USD17MER/tDM) +# * (inflated from default originally in USD05 using USD05 --> USD17 inflation rate: 1.23) +s73_timber_prod_cost <- 2460 # def = 2000 * 1.23 -# harvesting cost per ha of forests (USD/ha) -s73_timber_harvest_cost <- 2000 # def = 2000 +# harvesting cost per ha of forests (USD17MER/ha) +# * (inflated from default originally in USD05 using USD05 --> USD17 inflation rate: 1.23) +s73_timber_harvest_cost <- 2460 # def = 2000 * 1.23 # Cost multiplier for harvesting costs to make natural vegetation harvest expensive # than timber plantation harvest. This provides a signal to the model to harvest @@ -1998,7 +2016,7 @@ s73_cost_multiplier <- 1.5 # def = 1.5 # Cost of production without using any land in case the model is running into infeasibilities. # This is a last ditch effort for the model and the variable associated with this cost # should not be used in a normally feasible model run (USD/tDM) -s73_free_prod_cost <- 1000000 # def = 1000000 +s73_free_prod_cost <- 1230000 # def = 1000000 * 1.23 # Switch for modifying woody biomass demand starting in 2035 # * ("default") = Default paper demand diff --git a/modules/21_trade/selfsuff_reduced/input.gms b/modules/21_trade/selfsuff_reduced/input.gms index 8589115320..f170ff39f0 100644 --- a/modules/21_trade/selfsuff_reduced/input.gms +++ b/modules/21_trade/selfsuff_reduced/input.gms @@ -15,8 +15,8 @@ sets 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) / 10000 / - s21_min_trade_margin_forestry Minimum trade margin for forestry products (USD17MER per tDM) / 50 / + s21_cost_import Cost for additional imports to maintain feasibility (USD17MER per tDM) / 12300 / + s21_min_trade_margin_forestry Minimum trade margin for forestry products (USD17MER per tDM) / 62 / ; table f21_trade_bal_reduction(t_all,trade_groups21,trade_regime21) Share of inelastic trade pool (1) diff --git a/modules/29_cropland/detail_apr24/input.gms b/modules/29_cropland/detail_apr24/input.gms index c52396e2e4..99ec527367 100644 --- a/modules/29_cropland/detail_apr24/input.gms +++ b/modules/29_cropland/detail_apr24/input.gms @@ -15,8 +15,8 @@ scalars s29_snv_scenario_target SNV scenario target year / 2050 / s29_snv_relocation_data_x1 First reference value in SNV target cropland data (1) / 0.2 / s29_snv_relocation_data_x2 Second reference value in SNV target cropland data (1) / 0.5 / - s29_cost_treecover_est Tree cover establishment cost (USD17MER per ha) / 2000 / - s29_cost_treecover_recur Tree cover recurring cost (USD17MER per ha) / 500 / + s29_cost_treecover_est Tree cover establishment cost (USD17MER per ha) / 2460 / + s29_cost_treecover_recur Tree cover recurring cost (USD17MER per ha) / 615 / s29_treecover_plantation Growth curve switch for tree cover on cropland 0=natveg 1=plantations (1) / 0 / s29_treecover_bii_coeff BII coefficent to be used for tree cover on cropland 0=secondary vegetation 1=timber plantations (1) / 0 / s29_treecover_scenario_start Cropland treecover scenario start year / 2025 / @@ -25,13 +25,13 @@ scalars s29_treecover_target_noselect Minimum share of treecover on total cropland in target year (1) / 0 / s29_treecover_keep Avoid loss of existing treecover (1=yes 0=no) / 1 / s29_treecover_max Maximum share of treecover on total cropland (1) / 0.4 / - s29_treecover_penalty_before Penalty for violation of treecover target before scenario start (USD17MER per ha) / 5000 / - s29_treecover_penalty Penalty for violation of treecover target after sceanrio start (USD17MER per ha) / 5000 / + s29_treecover_penalty_before Penalty for violation of treecover target before scenario start (USD17MER per ha) / 6150 / + s29_treecover_penalty Penalty for violation of treecover target after sceanrio start (USD17MER per ha) / 6150 / s29_fallow_scenario_start Fallow land scenario start year / 2025 / s29_fallow_scenario_target Fallow land scenario target year / 2050 / s29_fallow_target Minimum share of fallow land on total cropland in target year (1) / 0 / s29_fallow_max Maximum share of fallow land on total cropland (1) / 0.4 / - s29_fallow_penalty Penalty for violation of fallow target (USD17MER per ha) / 500 / + s29_fallow_penalty Penalty for violation of fallow target (USD17MER per ha) / 615 / ; diff --git a/modules/30_croparea/detail_apr24/input.gms b/modules/30_croparea/detail_apr24/input.gms index e803e0133b..ec84dd5d8f 100644 --- a/modules/30_croparea/detail_apr24/input.gms +++ b/modules/30_croparea/detail_apr24/input.gms @@ -28,7 +28,7 @@ scalars s30_betr_start_noselect Share of bioenergy land on total cropland in start year (1) / 0 / s30_betr_target Share of bioenergy land on total cropland in target year (1) / 0 / s30_betr_target_noselect Share of bioenergy land on total cropland in target year (1) / 0 / - s30_betr_penalty Penalty for violation of betr target (USD17MER per ha) / 2000 / + s30_betr_penalty Penalty for violation of betr target (USD17MER per ha) / 2460 / s30_annual_max_growth Max annual cropland growth as share of previous cropland (1) / Inf / ; diff --git a/modules/30_croparea/simple_apr24/input.gms b/modules/30_croparea/simple_apr24/input.gms index aba93e5c08..5c22a85779 100644 --- a/modules/30_croparea/simple_apr24/input.gms +++ b/modules/30_croparea/simple_apr24/input.gms @@ -23,7 +23,7 @@ scalars s30_betr_start_noselect Share of bioenergy land on total cropland in start year (1) / 0 / s30_betr_target Share of bioenergy land on total cropland in target year (1) / 0 / s30_betr_target_noselect Share of bioenergy land on total cropland in target year (1) / 0 / - s30_betr_penalty Penalty for violation of betr target (USD17MER per ha) / 2000 / + s30_betr_penalty Penalty for violation of betr target (USD17MER per ha) / 2460 / s30_annual_max_growth Max annual cropland growth as share of previous cropland (1) / Inf / ; diff --git a/modules/32_forestry/dynamic_may24/input.gms b/modules/32_forestry/dynamic_may24/input.gms index 4561adace6..8e2bde9fea 100644 --- a/modules/32_forestry/dynamic_may24/input.gms +++ b/modules/32_forestry/dynamic_may24/input.gms @@ -24,15 +24,15 @@ $setglobal c32_shock_scenario none scalars s32_hvarea Flag for harvested area and establishemt (0=zero 1=exognous 2=endogneous) / 2 / - s32_est_cost_plant Establishment cost for plantations (USD per ha) / 2000 / - s32_est_cost_natveg Establishment cost for natural vegetation (USD per ha) / 2000 / - s32_recurring_cost Recurring costs (USD per ha) / 500 / - s32_harvesting_cost Harvesting cost (USD per ha) / 2000 / + s32_est_cost_plant Establishment cost for plantations (USD per ha) / 2460 / + s32_est_cost_natveg Establishment cost for natural vegetation (USD per ha) / 2460 / + s32_recurring_cost Recurring costs (USD per ha) / 615 / + s32_harvesting_cost Harvesting cost (USD per ha) / 2460 / s32_planing_horizon Afforestation planing horizon (years) / 50 / s32_rotation_extension Rotation extension factor 1=original rotations 2=100 percent increase in rotations etc (1) / 1 / s32_faustmann_rotation Switch to activate faustmann rotations (1=on 0=off) / 0 / s32_initial_distribution Switch to Activate ageclass distribution in plantations 0=off 1=equal distribution / 1 / - s32_price Price for timber (USD) / 45 / + s32_price Price for timber (USD) / 55 / s32_free_land_cost Penalty for technial area balance term (USD per ha) / 1e+06 / s32_max_aff_area Maximum total global afforestation (mio. ha) / Inf / s32_aff_plantation Switch for using growth curves for afforestation 0=natveg 1=plantations (1) / 0 / diff --git a/modules/35_natveg/pot_forest_may24/input.gms b/modules/35_natveg/pot_forest_may24/input.gms index d4922eae94..95cfbab45b 100644 --- a/modules/35_natveg/pot_forest_may24/input.gms +++ b/modules/35_natveg/pot_forest_may24/input.gms @@ -19,9 +19,9 @@ s35_hvarea Flag for harvested area (0=zero 1=exognous 2=endogneous) / 2 / s35_hvarea_secdforest annual secdforest harvest rate for s35_hvarea equals 1 (percent per year) / 0 / s35_hvarea_primforest annual primforest harvest rate for s35_hvarea equals 1 (percent per year) / 0 / s35_hvarea_other annual other land harvest rate for s35_hvarea equals 1 (percent per year) / 0 / -s35_timber_harvest_cost_secdforest Cost for harvesting from secondary forest (USD per ha) / 2000/ -s35_timber_harvest_cost_other Cost for harvesting from other land (USD per ha) / 1500 / -s35_timber_harvest_cost_primforest Cost for harvesting from primary forest (USD per ha) / 3000/ +s35_timber_harvest_cost_secdforest Cost for harvesting from secondary forest (USD17MER per ha) / 2460/ +s35_timber_harvest_cost_other Cost for harvesting from other land (USD17MER per ha) / 1845 / +s35_timber_harvest_cost_primforest Cost for harvesting from primary forest (USD17MER per ha) / 3690/ s35_natveg_harvest_shr Constrains the allowed wood harvest from natural vegetation (1=unconstrained) (1) /1/ s35_secdf_distribution Flag for secdf initialization (0=all secondary forest in highest age class 1=Equal distribution among all age classes 2=Poulter distribution from MODIS satellite data) (1) / 2 / s35_forest_damage Damage simulation in forests (0=none 1=shifting agriculture 2= Damage from shifting agriculture is faded out by c35_forest_damage_end 4= f35_forest_shock scenario) / 2 / diff --git a/modules/39_landconversion/calib/input.gms b/modules/39_landconversion/calib/input.gms index f8aaf29384..3846fa87ae 100644 --- a/modules/39_landconversion/calib/input.gms +++ b/modules/39_landconversion/calib/input.gms @@ -6,11 +6,11 @@ *** | Contact: magpie@pik-potsdam.de scalars - s39_cost_establish_crop Cost for cropland expansion before calibration (USD17MER per hectare) / 10000 / - s39_reward_crop_reduction Reward for cropland reduction before calibration (USD17MER per hectare) / 6000 / - s39_cost_establish_past Cost for pasture land expansion (USD17MER per hectare) / 8000 / - s39_cost_establish_forestry Cost for foresty land expansion (USD17MER per hectare) / 1000 / - s39_cost_establish_urban Cost for urban land expansion (USD17MER per hectare) / 10000 / + s39_cost_establish_crop Cost for cropland expansion before calibration (USD17MER per hectare) / 12300 / + s39_reward_crop_reduction Reward for cropland reduction before calibration (USD17MER per hectare) / 7380 / + s39_cost_establish_past Cost for pasture land expansion (USD17MER per hectare) / 9840 / + s39_cost_establish_forestry Cost for foresty land expansion (USD17MER per hectare) / 1230 / + s39_cost_establish_urban Cost for urban land expansion (USD17MER per hectare) / 12300 / s39_ignore_calib Switch for ignoring calibration factors (1) / 0 / ; diff --git a/modules/41_area_equipped_for_irrigation/endo_apr13/declarations.gms b/modules/41_area_equipped_for_irrigation/endo_apr13/declarations.gms index 54e955eca7..16584f9f33 100644 --- a/modules/41_area_equipped_for_irrigation/endo_apr13/declarations.gms +++ b/modules/41_area_equipped_for_irrigation/endo_apr13/declarations.gms @@ -8,11 +8,11 @@ parameters p41_AEI_start(t,j) Area equipped for irrigation at the beginning of each time step (mio. ha) pc41_AEI_start(j) Area equipped for irrigation at the beginning of current time step (mio. ha) - pc41_unitcost_AEI(i) Unit cost of AEI expansion (USD04MER per ha) + pc41_unitcost_AEI(i) Unit cost of AEI expansion (USD17MER per ha) ; variables - vm_cost_AEI(i) Annuitized irrigation expansion costs (mio. USD04MER per yr) + vm_cost_AEI(i) Annuitized irrigation expansion costs (mio. USD17MER per yr) ; positive variables @@ -21,14 +21,14 @@ positive variables equations q41_area_irrig(j) Irrigation area constraint (mio. ha) - q41_cost_AEI(i) Calculation of costs of irrigation area expansion (mio. USD04MER) + q41_cost_AEI(i) Calculation of costs of irrigation area expansion (mio. USD17MER) ; *#################### R SECTION START (OUTPUT DECLARATIONS) #################### parameters - ov_cost_AEI(t,i,type) Annuitized irrigation expansion costs (mio. USD04MER per yr) + ov_cost_AEI(t,i,type) Annuitized irrigation expansion costs (mio. USD17MER per yr) ov_AEI(t,j,type) Area equipped for irrigation in each grid cell (mio. ha) oq41_area_irrig(t,j,type) Irrigation area constraint (mio. ha) - oq41_cost_AEI(t,i,type) Calculation of costs of irrigation area expansion (mio. USD04MER) + oq41_cost_AEI(t,i,type) Calculation of costs of irrigation area expansion (mio. USD17MER) ; *##################### R SECTION END (OUTPUT DECLARATIONS) ##################### diff --git a/modules/41_area_equipped_for_irrigation/endo_apr13/input.gms b/modules/41_area_equipped_for_irrigation/endo_apr13/input.gms index de669f4257..33c1d8281a 100644 --- a/modules/41_area_equipped_for_irrigation/endo_apr13/input.gms +++ b/modules/41_area_equipped_for_irrigation/endo_apr13/input.gms @@ -8,10 +8,10 @@ $setglobal c41_initial_irrigation_area LUH2v2 scalars -s41_AEI_depreciation Depreciation rate in capital value of irrigation infrastructure (USD05PPP per USD05PPP) / 0 / +s41_AEI_depreciation Depreciation rate in capital value of irrigation infrastructure (USD17PPP per USD17PPP) / 0 / ; -table f41_c_irrig(t_all,i) Irrigation investment costs (USD04MER per ha) +table f41_c_irrig(t_all,i) Irrigation investment costs (USD17MER per ha) $ondelim $include "./modules/41_area_equipped_for_irrigation/endo_apr13/input/f41_c_irrig.csv" $offdelim diff --git a/modules/41_area_equipped_for_irrigation/static/declarations.gms b/modules/41_area_equipped_for_irrigation/static/declarations.gms index 02bab0eb4d..221448d797 100644 --- a/modules/41_area_equipped_for_irrigation/static/declarations.gms +++ b/modules/41_area_equipped_for_irrigation/static/declarations.gms @@ -6,7 +6,7 @@ *** | Contact: magpie@pik-potsdam.de variables - vm_cost_AEI(i) Irrigation expansion costs (mio. USD04MER) + vm_cost_AEI(i) Irrigation expansion costs (mio. USD17MER) ; positive variables @@ -19,7 +19,7 @@ equations *#################### R SECTION START (OUTPUT DECLARATIONS) #################### parameters - ov_cost_AEI(t,i,type) Irrigation expansion costs (mio. USD04MER) + ov_cost_AEI(t,i,type) Irrigation expansion costs (mio. USD17MER) ov_AEI(t,j,type) Area equipped for irrigation in each grid cell (mio. ha) oq41_area_irrig(t,j,type) Irrigation area constraint (mio. ha) ; diff --git a/modules/44_biodiversity/bii_target/declarations.gms b/modules/44_biodiversity/bii_target/declarations.gms index feea2001ee..c73b4a6f04 100644 --- a/modules/44_biodiversity/bii_target/declarations.gms +++ b/modules/44_biodiversity/bii_target/declarations.gms @@ -7,7 +7,7 @@ positive variables - vm_cost_bv_loss(j) Biodiversity cost (mio USD) + vm_cost_bv_loss(j) Biodiversity cost (mio USD17MER) vm_bv(j,landcover44,potnatveg) Biodiversity stock for all land cover classes (Mha) v44_bii(i,biome44) Biodiversity Intactness Index BII (1) v44_bii_missing(i,biome44) Missing BII increase for compliance with BII target (1) @@ -22,19 +22,19 @@ parameters equations q44_bii(i,biome44) Biodiversity Intactness Index BII (1) q44_bii_target(i,biome44) Missing BII increase for compliance with BII target (1) - q44_cost(i) Biodiversity cost (mio USD) + q44_cost(i) Biodiversity cost (mio USD17MER) ; *#################### R SECTION START (OUTPUT DECLARATIONS) #################### parameters - ov_cost_bv_loss(t,j,type) Biodiversity cost (mio USD) + ov_cost_bv_loss(t,j,type) Biodiversity cost (mio USD17MER) ov_bv(t,j,landcover44,potnatveg,type) Biodiversity stock for all land cover classes (Mha) ov44_bii(t,i,biome44,type) Biodiversity Intactness Index BII (1) ov44_bii_missing(t,i,biome44,type) Missing BII increase for compliance with BII target (1) oq44_bii(t,i,biome44,type) Biodiversity Intactness Index BII (1) oq44_bii_target(t,i,biome44,type) Missing BII increase for compliance with BII target (1) - oq44_cost(t,i,type) Biodiversity cost (mio USD) + oq44_cost(t,i,type) Biodiversity cost (mio USD17MER) ; *##################### R SECTION END (OUTPUT DECLARATIONS) ##################### diff --git a/modules/44_biodiversity/bii_target/input.gms b/modules/44_biodiversity/bii_target/input.gms index 26deafacfd..624e4e8799 100644 --- a/modules/44_biodiversity/bii_target/input.gms +++ b/modules/44_biodiversity/bii_target/input.gms @@ -10,7 +10,7 @@ scalars c44_bii_decrease Implementation of lower bound for BII (binary) / 1 / s44_target_year Year in which the BII lower bound is reached (1) / 2100 / s44_start_year Start year for interpolation towards BII lower bound (1) / 2025 / - s44_cost_bii_missing Technical costs for missing BII increase (USD per unit of BII) / 1e+06 / + s44_cost_bii_missing Technical costs for missing BII increase (USD17MER per unit of BII) / 1e+06 / ; diff --git a/modules/44_biodiversity/bii_target_apr24/declarations.gms b/modules/44_biodiversity/bii_target_apr24/declarations.gms index 419d24471c..8beb0dabed 100644 --- a/modules/44_biodiversity/bii_target_apr24/declarations.gms +++ b/modules/44_biodiversity/bii_target_apr24/declarations.gms @@ -7,7 +7,7 @@ positive variables - vm_cost_bv_loss(j) Biodiversity cost (mio USD) + vm_cost_bv_loss(j) Biodiversity cost (mio USD17MER) vm_bv(j,landcover44,potnatveg) Biodiversity stock for all land cover classes (Mha) v44_bii(i,biome44) Biodiversity Intactness Index BII (1) v44_bii_missing(i,biome44) Missing BII increase for compliance with BII target (1) @@ -22,19 +22,19 @@ parameters equations q44_bii(i,biome44) Biodiversity Intactness Index BII (1) q44_bii_target(i,biome44) Missing BII increase for compliance with BII target (1) - q44_cost(i) Biodiversity cost (mio USD) + q44_cost(i) Biodiversity cost (mio USD17MER) ; *#################### R SECTION START (OUTPUT DECLARATIONS) #################### parameters - ov_cost_bv_loss(t,j,type) Biodiversity cost (mio USD) + ov_cost_bv_loss(t,j,type) Biodiversity cost (mio USD17MER) ov_bv(t,j,landcover44,potnatveg,type) Biodiversity stock for all land cover classes (Mha) ov44_bii(t,i,biome44,type) Biodiversity Intactness Index BII (1) ov44_bii_missing(t,i,biome44,type) Missing BII increase for compliance with BII target (1) oq44_bii(t,i,biome44,type) Biodiversity Intactness Index BII (1) oq44_bii_target(t,i,biome44,type) Missing BII increase for compliance with BII target (1) - oq44_cost(t,i,type) Biodiversity cost (mio USD) + oq44_cost(t,i,type) Biodiversity cost (mio USD17MER) ; *##################### R SECTION END (OUTPUT DECLARATIONS) ##################### diff --git a/modules/44_biodiversity/bii_target_apr24/input.gms b/modules/44_biodiversity/bii_target_apr24/input.gms index f5d19800c5..b04e933504 100644 --- a/modules/44_biodiversity/bii_target_apr24/input.gms +++ b/modules/44_biodiversity/bii_target_apr24/input.gms @@ -10,7 +10,7 @@ scalars c44_bii_decrease Implementation of lower bound for BII (binary) / 1 / s44_target_year Year in which the BII lower bound is reached (1) / 2100 / s44_start_year Start year for interpolation towards BII lower bound (1) / 2025 / - s44_cost_bii_missing Technical costs for missing BII increase (USD per unit of BII) / 1e+06 / + s44_cost_bii_missing Technical costs for missing BII increase (USD17MER per unit of BII) / 1e+06 / ; diff --git a/modules/44_biodiversity/bv_btc_mar21/declarations.gms b/modules/44_biodiversity/bv_btc_mar21/declarations.gms index 5f6df38c0d..63185c6a10 100644 --- a/modules/44_biodiversity/bv_btc_mar21/declarations.gms +++ b/modules/44_biodiversity/bv_btc_mar21/declarations.gms @@ -6,12 +6,12 @@ *** | Contact: magpie@pik-potsdam.de parameters - p44_price_bv_loss(t_all) Price (subsidy) for biodiversity stock loss (gain) (USD per ha) + p44_price_bv_loss(t_all) Price (subsidy) for biodiversity stock loss (gain) (USD17MER per ha) ; variables v44_bv_loss(j) Change in biodiversity stock (Mha per year) - vm_cost_bv_loss(j) Biodiversity cost (mio USD) + vm_cost_bv_loss(j) Biodiversity cost (mio USD17MER) ; positive variables @@ -22,19 +22,19 @@ positive variables equations q44_bv_loss(j) Change in biodiversity stock (Mha per year) q44_bv_weighted(j) Range-rarity weighted biodiversity stock (Mha) - q44_cost_bv_loss(j) Cost of biodiversity loss (mio USD) + q44_cost_bv_loss(j) Cost of biodiversity loss (mio USD17MER) ; *#################### R SECTION START (OUTPUT DECLARATIONS) #################### parameters ov44_bv_loss(t,j,type) Change in biodiversity stock (Mha per year) - ov_cost_bv_loss(t,j,type) Biodiversity cost (mio USD) + ov_cost_bv_loss(t,j,type) Biodiversity cost (USD17MER) ov_bv(t,j,landcover44,potnatveg,type) Biodiversity stock for all land cover classes (Mha) ov44_bv_weighted(t,j,type) Range-rarity weighted biodiversity stock (Mha) oq44_bv_loss(t,j,type) Change in biodiversity stock (Mha per year) oq44_bv_weighted(t,j,type) Range-rarity weighted biodiversity stock (Mha) - oq44_cost_bv_loss(t,j,type) Cost of biodiversity loss (mio USD) + oq44_cost_bv_loss(t,j,type) Cost of biodiversity loss (USD17MER) ; *##################### R SECTION END (OUTPUT DECLARATIONS) ##################### diff --git a/modules/44_biodiversity/bv_btc_mar21/input.gms b/modules/44_biodiversity/bv_btc_mar21/input.gms index 66046b9a37..5336cf271b 100644 --- a/modules/44_biodiversity/bv_btc_mar21/input.gms +++ b/modules/44_biodiversity/bv_btc_mar21/input.gms @@ -8,8 +8,8 @@ scalars s44_start_year Start year of biodiversity price (1) / 2025 / s44_target_year Target year of biodiversity price (1) / 2100 / - s44_start_price Price for biodiversity stock loss in start year (USD per ha) / 0 / - s44_target_price Price for biodiversity stock loss in target year (USD per ha) / 0 / + s44_start_price Price for biodiversity stock loss in start year (USD17MER per ha) / 0 / + s44_target_price Price for biodiversity stock loss in target year (USD17MER per ha) / 0 / ; table fm_bii_coeff(bii_class44,potnatveg) Biodiversity Intactness Index coefficients (unitless) diff --git a/modules/50_nr_soil_budget/macceff_aug22/input.gms b/modules/50_nr_soil_budget/macceff_aug22/input.gms index 6bee1433da..68bc8f50eb 100644 --- a/modules/50_nr_soil_budget/macceff_aug22/input.gms +++ b/modules/50_nr_soil_budget/macceff_aug22/input.gms @@ -26,7 +26,7 @@ $setglobal c50_dep_scen history * options: history scalar - s50_fertilizer_costs Costs of fertilizer (USD17MER per tN) / 600 / + s50_fertilizer_costs Costs of fertilizer (USD17MER per tN) / 738 / s50_maccs_global_ef Do maccs assume global emission factor (binary) /1/ s50_maccs_implicit_nue_glo Global nitrogen use efficiency implicit to MACCs /0.5/ ; diff --git a/modules/56_ghg_policy/price_aug22/input.gms b/modules/56_ghg_policy/price_aug22/input.gms index 392bd13573..fefaeaa640 100644 --- a/modules/56_ghg_policy/price_aug22/input.gms +++ b/modules/56_ghg_policy/price_aug22/input.gms @@ -67,9 +67,9 @@ pollutants_fader(pollutants) pollutants affected by GHG policy fader / co2_c, ch ; scalars - s56_limit_ch4_n2o_price Upper limit for CH4 and N2O GHG prices (USD17MER per tC) / 4000 / + s56_limit_ch4_n2o_price Upper limit for CH4 and N2O GHG prices (USD17MER per tC) / 4920 / s56_cprice_red_factor Reduction factor for CO2 price (-) / 1 / - s56_minimum_cprice Minium C price for future time steps (USD per tC) / 0 / + s56_minimum_cprice Minium C price for future time steps (USD17MER per tC) / 0 / s56_ghgprice_devstate_scaling Switch for scaling GHG price with development state (1=on 0=off) / 0 / s56_c_price_induced_aff Switch for C price driven re-afforestation (1=on 0=off) / 1 / s56_c_price_exp_aff Time horizon of CO2 price expectation for re-afforestation (years) / 50 / diff --git a/modules/58_peatland/v2/input.gms b/modules/58_peatland/v2/input.gms index 20a7ce0c3e..87e2c3ffce 100644 --- a/modules/58_peatland/v2/input.gms +++ b/modules/58_peatland/v2/input.gms @@ -6,8 +6,8 @@ *** | Contact: magpie@pik-potsdam.de scalars - s58_cost_rewet_recur Recurring costs for rewetted peatland (USD17MER per ha) / 200 / - s58_cost_rewet_onetime One-time costs for peatland rewetting (USD17MER per ha) / 7000 / + s58_cost_rewet_recur Recurring costs for rewetted peatland (USD17MER per ha) / 246 / + s58_cost_rewet_onetime One-time costs for peatland rewetting (USD17MER per ha) / 8610 / s58_cost_drain_recur Recurring costs for drained and managed peatlands (USD17MER per ha) / 0 / s58_cost_drain_intact_onetime One-time costs for drainage of intact peatland (USD17MER per ha) / 0 / s58_cost_drain_rewet_onetime One-time costs for drainage of rewetted peatland (USD17MER per ha) / 0 / diff --git a/modules/60_bioenergy/1st2ndgen_priced_feb24/input.gms b/modules/60_bioenergy/1st2ndgen_priced_feb24/input.gms index 208e4485d5..b34cff737b 100644 --- a/modules/60_bioenergy/1st2ndgen_priced_feb24/input.gms +++ b/modules/60_bioenergy/1st2ndgen_priced_feb24/input.gms @@ -35,7 +35,7 @@ sets scalars c60_biodem_level bioenergy demand level indicator 1 for regional and 0 for global demand (1) / 1 / - c60_bioenergy_subsidy_fix_SSP2 first generation bioenergy subsidy during fix_SSP period (USD17MER per ton) / 300 / + c60_bioenergy_subsidy_fix_SSP2 first generation bioenergy subsidy during fix_SSP period (USD17MER per ton) / 369 / c60_bioenergy_subsidy first generation bioenergy subsidy (USD17MER per ton) / 300 / s60_bioenergy_gj_price_1st first generation bioenergy per-GJ price (USD17MER per GJ) / 0 / s60_bioenergy_price_2nd second generation bioenergy price (USD17MER per GJ) / 0 / diff --git a/modules/60_bioenergy/1stgen_priced_dec18/input.gms b/modules/60_bioenergy/1stgen_priced_dec18/input.gms index 1a17ee46b3..3ce1668a2c 100644 --- a/modules/60_bioenergy/1stgen_priced_dec18/input.gms +++ b/modules/60_bioenergy/1stgen_priced_dec18/input.gms @@ -35,7 +35,7 @@ sets scalars c60_biodem_level bioenergy demand level indicator 1 for regional and 0 for global demand (1) / 1 / - c60_bioenergy_subsidy first generation bioenergy subsidy (USD17MER per ton) / 300 / + c60_bioenergy_subsidy first generation bioenergy subsidy (USD17MER per ton) / 369 / s60_2ndgen_bioenergy_dem_min Minimum dedicated 2nd generation bioenergy demand assumed in each region (mio. GJ per yr) / 1 / ; diff --git a/modules/73_timber/default/input.gms b/modules/73_timber/default/input.gms index 91d789b5a2..afb194f52b 100644 --- a/modules/73_timber/default/input.gms +++ b/modules/73_timber/default/input.gms @@ -15,13 +15,14 @@ scalars * 60 EUR/m3 = 72 USD/m3 * 72 USD/m3 / 0.6 = 120 USD/tDM * https://unece.org/forests/prices - s73_timber_prod_cost_wood Cost for producing one unit of wood (USD per tDM) / 120 / - s73_timber_prod_cost_woodfuel Cost for prodcing one unit of woodfuel (USD per tDM) / 60 / - s73_free_prod_cost Very high cost for settling demand without production (USD per tDM) / 20000 / +* inflated using USD05 --> USD17 rate of 1.23 + s73_timber_prod_cost_wood Cost for producing one unit of wood (USD17MER per tDM) / 148 / + s73_timber_prod_cost_woodfuel Cost for prodcing one unit of woodfuel (USD17MER per tDM) / 74 / + s73_free_prod_cost Very high cost for settling demand without production (USD per tDM) / 24600 / s73_timber_demand_switch Logical switch to turn on or off timber demand 1=on 0=off (1) / 1 / s73_increase_ceiling Limiter for not allowing a demand jump between time steps beyond a certain limit (1) / 1.025 / s73_residue_ratio Proportion of overall industrial roundwood production which ends up as residue during harvest (1) / 0.15 / - s73_reisdue_removal_cost Cost of removing residues left after industrial roundwood harvest (USD per tDM) / 2 / + s73_reisdue_removal_cost Cost of removing residues left after industrial roundwood harvest (USD17MER per tDM) / 2.5 / s73_expansion Construction wood demand expansion factor by end of century based on industrial roundwood demand as base (1=100 percent increase) / 0 / ; From 875028e36a0cd89ddf81b80453ac0c419bd4a09b Mon Sep 17 00:00:00 2001 From: Singh Date: Fri, 6 Sep 2024 17:00:42 +0530 Subject: [PATCH 003/206] Changed water equation and add start script --- main.gms | 12 ++++----- modules/11_costs/default/equations.gms | 2 +- scripts/start/waterTestDefault.R | 34 ++++++++++++++++++++++++++ 3 files changed, 40 insertions(+), 8 deletions(-) create mode 100644 scripts/start/waterTestDefault.R diff --git a/main.gms b/main.gms index b3dc7e93f8..6817d2533d 100644 --- a/main.gms +++ b/main.gms @@ -150,20 +150,19 @@ $title magpie * * Used data set: rev4.109_h12_magpie.tgz * md5sum: NA -* Repository: scp://cluster.pik-potsdam.de/p/projects/rd3mod/inputdata/output +* Repository: https://rse.pik-potsdam.de/data/magpie/public * * Used data set: rev4.109_h12_fd712c0b_cellularmagpie_c200_MRI-ESM2-0-ssp370_lpjml-8e6c5eb1.tgz * md5sum: NA -* Repository: scp://cluster.pik-potsdam.de/p/projects/rd3mod/inputdata/output +* Repository: https://rse.pik-potsdam.de/data/magpie/public * * Used data set: rev4.109_h12_validation.tgz * md5sum: NA -* Repository: scp://cluster.pik-potsdam.de/p/projects/rd3mod/inputdata/output +* Repository: https://rse.pik-potsdam.de/data/magpie/public * -* Used data set: additional_data_rev4.50.tgz +* Used data set: additional_data_rev4.51.tgz * md5sum: NA * Repository: https://rse.pik-potsdam.de/data/magpie/public - * * Used data set: calibration_H12_26Mar24.tgz * md5sum: NA @@ -196,8 +195,7 @@ $title magpie * * Call: withCallingHandlers(expr, message = messageHandler, warning = warningHandler, error = errorHandler) * * -* Last modification (input data): Tue Jun 18 09:52:31 2024 - +* Last modification (input data): Fri Sep 6 16:05:34 2024 * *###################### R SECTION END (VERSION INFO) ########################### diff --git a/modules/11_costs/default/equations.gms b/modules/11_costs/default/equations.gms index c3d758a20d..f032c9171b 100644 --- a/modules/11_costs/default/equations.gms +++ b/modules/11_costs/default/equations.gms @@ -40,7 +40,7 @@ + sum(cell(i2,j2), vm_cost_cropland(j2)) + sum(cell(i2,j2),vm_cost_bv_loss(j2)) + sum(cell(i2,j2),vm_cost_urban(j2)) - + sum(cell(i2,j2),vm_water_cost(i2)) + + vm_water_cost(i2) ; *' The total regional production cost calculation is based on the sum of different diff --git a/scripts/start/waterTestDefault.R b/scripts/start/waterTestDefault.R new file mode 100644 index 0000000000..a0f1d479ea --- /dev/null +++ b/scripts/start/waterTestDefault.R @@ -0,0 +1,34 @@ +#description: Pumping cost implementation for India (11_cost>default>equations.gms updated manually) + +# Load start_run(cfg) function which is needed to start MAgPIE runs +library(gms) +library(magclass) +library(gdx2) +library(luscale) +library(magpie4) +source("scripts/start_functions.R") +source("config/default.cfg") + +codeCheck <- FALSE + +## Basic settings: + +basic_settings <- function(title) { + + source("config/default.cfg") + + cfg$force_download <- FALSE + cfg$info$flag <- "060924" + cfg$title <- paste(cfg$info$flag,title,sep="_") + cfg$results_folder <- "output/:title:" + cfg$recalibrate <- FALSE + return(cfg) +} + + +cfg <- basic_settings(title = "WaterTestBug") + +# * Switch to activate pumping costs (only available for India currently), Set to 1 if want to use for India +cfg$gms$s42_pumping <- 1 # def = 0 + +start_run(cfg, codeCheck=FALSE) From d669334fa70f491ca8d031929771af6289e20a08 Mon Sep 17 00:00:00 2001 From: Singh Date: Mon, 9 Sep 2024 15:55:22 +0530 Subject: [PATCH 004/206] Need to change multiplier value also to 1 for pumping cost to work --- scripts/start/waterTestDefault.R | 1 + 1 file changed, 1 insertion(+) diff --git a/scripts/start/waterTestDefault.R b/scripts/start/waterTestDefault.R index a0f1d479ea..572f867cb4 100644 --- a/scripts/start/waterTestDefault.R +++ b/scripts/start/waterTestDefault.R @@ -30,5 +30,6 @@ cfg <- basic_settings(title = "WaterTestBug") # * Switch to activate pumping costs (only available for India currently), Set to 1 if want to use for India cfg$gms$s42_pumping <- 1 # def = 0 +cfg$gms$s42_multiplier <- 1 # def = 0 start_run(cfg, codeCheck=FALSE) From dad292d859eb8552b9d58fff964728da0a62ca61 Mon Sep 17 00:00:00 2001 From: Singh Date: Mon, 9 Sep 2024 16:04:32 +0530 Subject: [PATCH 005/206] Updated with develop --- scripts/start/waterTestDefault.R | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/start/waterTestDefault.R b/scripts/start/waterTestDefault.R index 572f867cb4..2b493c0d02 100644 --- a/scripts/start/waterTestDefault.R +++ b/scripts/start/waterTestDefault.R @@ -17,7 +17,7 @@ basic_settings <- function(title) { source("config/default.cfg") - cfg$force_download <- FALSE + cfg$force_download <- TRUE cfg$info$flag <- "060924" cfg$title <- paste(cfg$info$flag,title,sep="_") cfg$results_folder <- "output/:title:" From 3e224739b8318e455777a625c48d2781d0edd4bd Mon Sep 17 00:00:00 2001 From: caviddhen Date: Tue, 10 Sep 2024 12:39:33 +0200 Subject: [PATCH 006/206] update to 2017 base year --- main.gms | 38 +++++++++---------- modules/09_drivers/aug17/declarations.gms | 2 +- modules/09_drivers/aug17/input.gms | 7 ++++ modules/09_drivers/input/files | 1 + .../15_food/anthro_iso_jun22/equations.gms | 8 ++-- .../anthropometrics_jan18/equations.gms | 8 ++-- modules/21_trade/input/files | 2 - .../selfsuff_reduced_bilateral22/input.gms | 4 +- modules/29_cropland/detail_apr24/input.gms | 2 +- modules/39_landconversion/calib/input.gms | 2 +- .../bv_btc_mar21/declarations.gms | 4 +- .../1st2ndgen_priced_feb24/input.gms | 2 +- modules/70_livestock/fbask_jan16/presolve.gms | 4 +- .../fbask_jan16_sticky/presolve.gms | 4 +- 14 files changed, 46 insertions(+), 42 deletions(-) diff --git a/main.gms b/main.gms index b3dc7e93f8..32bf2a6992 100644 --- a/main.gms +++ b/main.gms @@ -148,26 +148,25 @@ $title magpie *##################### R SECTION START (VERSION INFO) ########################## * -* Used data set: rev4.109_h12_magpie.tgz -* md5sum: NA -* Repository: scp://cluster.pik-potsdam.de/p/projects/rd3mod/inputdata/output +* Used data set: rev4.112DC_GDP2017_h12_magpie.tgz +* md5sum: 86f9d7b7efb543e017959f3c69380a55 +* Repository: /p/projects/rd3mod/inputdata/output_1.27 * -* Used data set: rev4.109_h12_fd712c0b_cellularmagpie_c200_MRI-ESM2-0-ssp370_lpjml-8e6c5eb1.tgz -* md5sum: NA -* Repository: scp://cluster.pik-potsdam.de/p/projects/rd3mod/inputdata/output +* Used data set: rev4.112DC_GDP2017_h12_fd712c0b_cellularmagpie_c200_MRI-ESM2-0-ssp370_lpjml-8e6c5eb1.tgz +* md5sum: 9023d9affc5e0ad1ee7c5f8d40cb5baf +* Repository: /p/projects/rd3mod/inputdata/output_1.27 * -* Used data set: rev4.109_h12_validation.tgz -* md5sum: NA -* Repository: scp://cluster.pik-potsdam.de/p/projects/rd3mod/inputdata/output +* Used data set: rev4.112DC_GDP2017_h12_validation.tgz +* md5sum: a2a8886d20c347ed26d3562c6ba8809f +* Repository: /p/projects/rd3mod/inputdata/output_1.27 * -* Used data set: additional_data_rev4.50.tgz -* md5sum: NA -* Repository: https://rse.pik-potsdam.de/data/magpie/public - +* Used data set: additional_data_rev4.53devGDP2017.tgz +* md5sum: dbc43a67f3a803c8a6aa4aa251fdc18f +* Repository: /p/projects/landuse/data/input/archive * * Used data set: calibration_H12_26Mar24.tgz -* md5sum: NA -* Repository: https://rse.pik-potsdam.de/data/magpie/public +* md5sum: d295e7ff0c65d97c1e0b84c440d0056b +* Repository: /p/projects/rd3mod/mirror/rse.pik-potsdam.de/data/magpie/public * * Low resolution: c200 * High resolution: 0.5 @@ -180,11 +179,11 @@ $title magpie * * Regionscode: 62eff8f7 * -* Regions data revision: 4.109 +* Regions data revision: 4.112 * * lpj2magpie settings: * * LPJmL data: MRI-ESM2-0:ssp370 -* * Revision: 4.109 +* * Revision: 4.112 * * aggregation settings: * * Input resolution: 0.5 @@ -196,8 +195,7 @@ $title magpie * * Call: withCallingHandlers(expr, message = messageHandler, warning = warningHandler, error = errorHandler) * * -* Last modification (input data): Tue Jun 18 09:52:31 2024 - +* Last modification (input data): Fri Sep 6 15:10:50 2024 * *###################### R SECTION END (VERSION INFO) ########################### @@ -223,7 +221,7 @@ $offlisting $setglobal c_timesteps coup2100 $setglobal c_past till_2010 -$setglobal c_title default +$setglobal c_title DC4GDP2017_2017USD_oldCalib scalars s_use_gdx use of gdx files / 0 / diff --git a/modules/09_drivers/aug17/declarations.gms b/modules/09_drivers/aug17/declarations.gms index 1b4ec2307a..d58fb9c2b7 100644 --- a/modules/09_drivers/aug17/declarations.gms +++ b/modules/09_drivers/aug17/declarations.gms @@ -27,7 +27,7 @@ parameters i09_gdp_pc_ppp_raw(t_all,i,pop_gdp_scen09) Per capita income in purchasing power parity (USD17PPP per cap per yr) i09_gdp_pc_ppp_iso_raw(t_all,iso,pop_gdp_scen09) Per capita income in purchasing power parity (USD17PPP per cap per yr) im_gdp_pc_ppp_iso(t_all,iso) Per capita income in purchasing power parity (USD17PPP per cap per yr) - + * Development State im_development_state(t_all,i) Development state according to the World Bank definition where 0=low income country 1=high income country in high income level (1) im_physical_inactivity(t_all,iso,sex,age) Share of population which is physically inactive (1) diff --git a/modules/09_drivers/aug17/input.gms b/modules/09_drivers/aug17/input.gms index ce21e4d51e..490be58bdc 100644 --- a/modules/09_drivers/aug17/input.gms +++ b/modules/09_drivers/aug17/input.gms @@ -52,3 +52,10 @@ table f09_physical_inactivity(t_all,iso,pop_gdp_scen09,sex,age) Share of populat $ondelim $include "./modules/09_drivers/input/f09_physical_inactivity.cs3" $offdelim; + +parameter fm_gdp_defl_ppp(iso) GDP deflator +/ +$ondelim +$include "./modules/09_drivers/input/fm_gdp_defl_ppp.cs4" +$offdelim +/; diff --git a/modules/09_drivers/input/files b/modules/09_drivers/input/files index 752a896349..cac0468831 100644 --- a/modules/09_drivers/input/files +++ b/modules/09_drivers/input/files @@ -6,3 +6,4 @@ f09_pop_iso.csv f09_urban_iso.csv f09_demography.cs3 f09_physical_inactivity.cs3 +fm_gdp_defl_ppp.cs4 diff --git a/modules/15_food/anthro_iso_jun22/equations.gms b/modules/15_food/anthro_iso_jun22/equations.gms index 7094915a69..2ae2d6014b 100644 --- a/modules/15_food/anthro_iso_jun22/equations.gms +++ b/modules/15_food/anthro_iso_jun22/equations.gms @@ -72,8 +72,8 @@ q15_regr_bmi_shr(iso,sex,agegroup15,bmi_tree15) .. v15_regr_overgroups(iso,sex,agegroup15,bmi_tree15) =e= i15_bmi_intercept(sex,agegroup15,bmi_tree15) - + (i15_bmi_saturation(sex,agegroup15,bmi_tree15) * v15_income_pc_real_ppp_iso(iso)) - / (i15_bmi_halfsat(sex,agegroup15,bmi_tree15) + v15_income_pc_real_ppp_iso(iso)); + + (i15_bmi_saturation(sex,agegroup15,bmi_tree15) * (v15_income_pc_real_ppp_iso(iso) * fm_gdp_defl_ppp(iso))) + / (i15_bmi_halfsat(sex,agegroup15,bmi_tree15) + (v15_income_pc_real_ppp_iso(iso) * fm_gdp_defl_ppp(iso))); *' Then, these regression shares are applied to parameterize the *' hierarchical tree structure: @@ -169,8 +169,8 @@ q15_regr_kcal(iso) .. q15_regr(iso, regr15) .. v15_demand_regr(iso, regr15) =e= i15_dem_intercept(iso,regr15) - + (i15_dem_saturation(iso,regr15) * v15_income_pc_real_ppp_iso(iso)) - / (i15_dem_halfsat(iso,regr15) + v15_income_pc_real_ppp_iso(iso)**i15_dem_nonsat(iso,regr15)); + + (i15_dem_saturation(iso,regr15) * (v15_income_pc_real_ppp_iso(iso) * fm_gdp_defl_ppp(iso))) + / (i15_dem_halfsat(iso,regr15) + (v15_income_pc_real_ppp_iso(iso) * fm_gdp_defl_ppp(iso) )**i15_dem_nonsat(iso,regr15)); *' In the subsequent equations, those parameters *' are used to determine the dietary composition using a hierachical tree: diff --git a/modules/15_food/anthropometrics_jan18/equations.gms b/modules/15_food/anthropometrics_jan18/equations.gms index 7094915a69..0506f61ff2 100644 --- a/modules/15_food/anthropometrics_jan18/equations.gms +++ b/modules/15_food/anthropometrics_jan18/equations.gms @@ -72,8 +72,8 @@ q15_regr_bmi_shr(iso,sex,agegroup15,bmi_tree15) .. v15_regr_overgroups(iso,sex,agegroup15,bmi_tree15) =e= i15_bmi_intercept(sex,agegroup15,bmi_tree15) - + (i15_bmi_saturation(sex,agegroup15,bmi_tree15) * v15_income_pc_real_ppp_iso(iso)) - / (i15_bmi_halfsat(sex,agegroup15,bmi_tree15) + v15_income_pc_real_ppp_iso(iso)); + + (i15_bmi_saturation(sex,agegroup15,bmi_tree15) * (v15_income_pc_real_ppp_iso(iso) * fm_gdp_defl_ppp(iso) )) + / (i15_bmi_halfsat(sex,agegroup15,bmi_tree15) + (v15_income_pc_real_ppp_iso(iso) * fm_gdp_defl_ppp(iso) )); *' Then, these regression shares are applied to parameterize the *' hierarchical tree structure: @@ -169,8 +169,8 @@ q15_regr_kcal(iso) .. q15_regr(iso, regr15) .. v15_demand_regr(iso, regr15) =e= i15_dem_intercept(iso,regr15) - + (i15_dem_saturation(iso,regr15) * v15_income_pc_real_ppp_iso(iso)) - / (i15_dem_halfsat(iso,regr15) + v15_income_pc_real_ppp_iso(iso)**i15_dem_nonsat(iso,regr15)); + + (i15_dem_saturation(iso,regr15) * (v15_income_pc_real_ppp_iso(iso) * fm_gdp_defl_ppp(iso))) + / (i15_dem_halfsat(iso,regr15) + (v15_income_pc_real_ppp_iso(iso) * fm_gp_defl_ppp(iso))**i15_dem_nonsat(iso,regr15)); *' In the subsequent equations, those parameters *' are used to determine the dietary composition using a hierachical tree: diff --git a/modules/21_trade/input/files b/modules/21_trade/input/files index a2dc71b741..dbc4131c7f 100644 --- a/modules/21_trade/input/files +++ b/modules/21_trade/input/files @@ -4,7 +4,5 @@ f21_trade_export_share.cs3 f21_trade_balanceflow.cs3 f21_trade_margin.cs3 f21_trade_tariff.cs3 -f21_trade_tariff_export.cs3 -f21_trade_tariff_import.cs3 f21_trade_balance.cs3 f21_trade_bal_reduction.cs3 diff --git a/modules/21_trade/selfsuff_reduced_bilateral22/input.gms b/modules/21_trade/selfsuff_reduced_bilateral22/input.gms index fe6459f2b5..69e1830f27 100644 --- a/modules/21_trade/selfsuff_reduced_bilateral22/input.gms +++ b/modules/21_trade/selfsuff_reduced_bilateral22/input.gms @@ -18,8 +18,8 @@ scalars s21_trade_tariff_fadeout fadeout scenario setting for trade tariffs / 0 / s21_trade_tariff_startyear year to start fading out trade tariffs / 2025 / s21_trade_tariff_targetyear year to finish fading out trade tariffs / 2050 / - s21_cost_import Cost for additional imports to maintain feasibility (USD17MER per tDM) / 10000 / - s21_min_trade_margin_forestry Minimum trade margin for forestry products (USD17MER per tDM) / 50 / + s21_cost_import Cost for additional imports to maintain feasibility (USD17MER per tDM) / 12300 / + s21_min_trade_margin_forestry Minimum trade margin for forestry products (USD17MER per tDM) / 62 / ; table f21_trade_bal_reduction(t_all,trade_groups21,trade_regime21) Share of inelastic trade pool (1) diff --git a/modules/29_cropland/detail_apr24/input.gms b/modules/29_cropland/detail_apr24/input.gms index 99ec527367..741f2bd583 100644 --- a/modules/29_cropland/detail_apr24/input.gms +++ b/modules/29_cropland/detail_apr24/input.gms @@ -16,7 +16,7 @@ scalars s29_snv_relocation_data_x1 First reference value in SNV target cropland data (1) / 0.2 / s29_snv_relocation_data_x2 Second reference value in SNV target cropland data (1) / 0.5 / s29_cost_treecover_est Tree cover establishment cost (USD17MER per ha) / 2460 / - s29_cost_treecover_recur Tree cover recurring cost (USD17MER per ha) / 615 / + s29_cost_treecover_recur Tree cover recurring cost (USD17MER per ha) / 620 / s29_treecover_plantation Growth curve switch for tree cover on cropland 0=natveg 1=plantations (1) / 0 / s29_treecover_bii_coeff BII coefficent to be used for tree cover on cropland 0=secondary vegetation 1=timber plantations (1) / 0 / s29_treecover_scenario_start Cropland treecover scenario start year / 2025 / diff --git a/modules/39_landconversion/calib/input.gms b/modules/39_landconversion/calib/input.gms index 3846fa87ae..d3bc1f7d24 100644 --- a/modules/39_landconversion/calib/input.gms +++ b/modules/39_landconversion/calib/input.gms @@ -9,7 +9,7 @@ scalars s39_cost_establish_crop Cost for cropland expansion before calibration (USD17MER per hectare) / 12300 / s39_reward_crop_reduction Reward for cropland reduction before calibration (USD17MER per hectare) / 7380 / s39_cost_establish_past Cost for pasture land expansion (USD17MER per hectare) / 9840 / - s39_cost_establish_forestry Cost for foresty land expansion (USD17MER per hectare) / 1230 / + s39_cost_establish_forestry Cost for foresty land expansion (USD17MER per hectare) / 1120 / s39_cost_establish_urban Cost for urban land expansion (USD17MER per hectare) / 12300 / s39_ignore_calib Switch for ignoring calibration factors (1) / 0 / ; diff --git a/modules/44_biodiversity/bv_btc_mar21/declarations.gms b/modules/44_biodiversity/bv_btc_mar21/declarations.gms index 63185c6a10..37dbf62bdc 100644 --- a/modules/44_biodiversity/bv_btc_mar21/declarations.gms +++ b/modules/44_biodiversity/bv_btc_mar21/declarations.gms @@ -29,12 +29,12 @@ equations *#################### R SECTION START (OUTPUT DECLARATIONS) #################### parameters ov44_bv_loss(t,j,type) Change in biodiversity stock (Mha per year) - ov_cost_bv_loss(t,j,type) Biodiversity cost (USD17MER) + ov_cost_bv_loss(t,j,type) Biodiversity cost (mio USD17MER) ov_bv(t,j,landcover44,potnatveg,type) Biodiversity stock for all land cover classes (Mha) ov44_bv_weighted(t,j,type) Range-rarity weighted biodiversity stock (Mha) oq44_bv_loss(t,j,type) Change in biodiversity stock (Mha per year) oq44_bv_weighted(t,j,type) Range-rarity weighted biodiversity stock (Mha) - oq44_cost_bv_loss(t,j,type) Cost of biodiversity loss (USD17MER) + oq44_cost_bv_loss(t,j,type) Cost of biodiversity loss (mio USD17MER) ; *##################### R SECTION END (OUTPUT DECLARATIONS) ##################### diff --git a/modules/60_bioenergy/1st2ndgen_priced_feb24/input.gms b/modules/60_bioenergy/1st2ndgen_priced_feb24/input.gms index b34cff737b..d368538417 100644 --- a/modules/60_bioenergy/1st2ndgen_priced_feb24/input.gms +++ b/modules/60_bioenergy/1st2ndgen_priced_feb24/input.gms @@ -36,7 +36,7 @@ sets scalars c60_biodem_level bioenergy demand level indicator 1 for regional and 0 for global demand (1) / 1 / c60_bioenergy_subsidy_fix_SSP2 first generation bioenergy subsidy during fix_SSP period (USD17MER per ton) / 369 / - c60_bioenergy_subsidy first generation bioenergy subsidy (USD17MER per ton) / 300 / + c60_bioenergy_subsidy first generation bioenergy subsidy (USD17MER per ton) / 369 / s60_bioenergy_gj_price_1st first generation bioenergy per-GJ price (USD17MER per GJ) / 0 / s60_bioenergy_price_2nd second generation bioenergy price (USD17MER per GJ) / 0 / s60_2ndgen_bioenergy_dem_min Minimum dedicated 2nd generation bioenergy demand assumed in each region during SSP2-fix (mio. GJ per yr) / 1 / diff --git a/modules/70_livestock/fbask_jan16/presolve.gms b/modules/70_livestock/fbask_jan16/presolve.gms index ad6b37a10a..5d1dda4fee 100644 --- a/modules/70_livestock/fbask_jan16/presolve.gms +++ b/modules/70_livestock/fbask_jan16/presolve.gms @@ -55,14 +55,14 @@ else *' @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")); +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) * fm_gdp_defl_ppp(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,"capital") = f70_cap_share_reg("slope")*log10(sum(i_to_iso(i,iso),(im_gdp_pc_ppp_iso(t,iso) * fm_gdp_defl_ppp(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"); ); diff --git a/modules/70_livestock/fbask_jan16_sticky/presolve.gms b/modules/70_livestock/fbask_jan16_sticky/presolve.gms index 528f02b6f4..020e7eb26d 100644 --- a/modules/70_livestock/fbask_jan16_sticky/presolve.gms +++ b/modules/70_livestock/fbask_jan16_sticky/presolve.gms @@ -55,14 +55,14 @@ else *' @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")); +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) * fm_gdp_defl_ppp)))+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,"capital") = f70_cap_share_reg("slope")*log10(sum(i_to_iso(i,iso),(im_gdp_pc_ppp_iso(t,iso) * fm_gdp_defl_ppp))))+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"); ); From 41cf111e55d8ee25928f2c22b401fc365ba44c71 Mon Sep 17 00:00:00 2001 From: caviddhen Date: Tue, 10 Sep 2024 13:31:28 +0200 Subject: [PATCH 007/206] update config --- config/default.cfg | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/config/default.cfg b/config/default.cfg index d82d08144f..ef10ab0c7b 100644 --- a/config/default.cfg +++ b/config/default.cfg @@ -22,10 +22,10 @@ cfg$model <- "main.gms" #def = "main.gms" #### input settings #### # which input data sets should be used? -cfg$input <- c(regional = "rev4.111_h12_magpie.tgz", - cellular = "rev4.111_h12_fd712c0b_cellularmagpie_c200_MRI-ESM2-0-ssp370_lpjml-8e6c5eb1.tgz", - validation = "rev4.111_h12_validation.tgz", - additional = "additional_data_rev4.51.tgz", +cfg$input <- c(regional = "rev4.112_h12_magpie.tgz", + cellular = "rev4.112_h12_fd712c0b_cellularmagpie_c200_MRI-ESM2-0-ssp370_lpjml-8e6c5eb1.tgz", + validation = "rev4.112_h12_validation.tgz", + additional = "additional_data_rev4.53devGDP2017.tgz", calibration = "calibration_H12_26Mar24.tgz") # NOTE: It is recommended to recalibrate the model when changing cellular input data From 9b25c761a21b91a9fa86e54d3d78e4426e728600 Mon Sep 17 00:00:00 2001 From: VartikaSingh Date: Wed, 11 Sep 2024 06:15:12 +0200 Subject: [PATCH 008/206] Updated test start script --- scripts/start/waterTestDefault.R | 35 -------------------------------- 1 file changed, 35 deletions(-) delete mode 100644 scripts/start/waterTestDefault.R diff --git a/scripts/start/waterTestDefault.R b/scripts/start/waterTestDefault.R deleted file mode 100644 index 2b493c0d02..0000000000 --- a/scripts/start/waterTestDefault.R +++ /dev/null @@ -1,35 +0,0 @@ -#description: Pumping cost implementation for India (11_cost>default>equations.gms updated manually) - -# Load start_run(cfg) function which is needed to start MAgPIE runs -library(gms) -library(magclass) -library(gdx2) -library(luscale) -library(magpie4) -source("scripts/start_functions.R") -source("config/default.cfg") - -codeCheck <- FALSE - -## Basic settings: - -basic_settings <- function(title) { - - source("config/default.cfg") - - cfg$force_download <- TRUE - cfg$info$flag <- "060924" - cfg$title <- paste(cfg$info$flag,title,sep="_") - cfg$results_folder <- "output/:title:" - cfg$recalibrate <- FALSE - return(cfg) -} - - -cfg <- basic_settings(title = "WaterTestBug") - -# * Switch to activate pumping costs (only available for India currently), Set to 1 if want to use for India -cfg$gms$s42_pumping <- 1 # def = 0 -cfg$gms$s42_multiplier <- 1 # def = 0 - -start_run(cfg, codeCheck=FALSE) From bb16e1d6d38b09b4138303f8f25dc000bf37209b Mon Sep 17 00:00:00 2001 From: florianh Date: Mon, 23 Sep 2024 09:50:53 +0200 Subject: [PATCH 009/206] bugfixes --- CHANGELOG.md | 4 +++- config/default.cfg | 6 +++--- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 8ecf219d9b..90c515b565 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -26,7 +26,9 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). - **scripts** `.nc` files are no longer created by default after disaggregation - **config** `cfg$gms$land_snv`changed from "secdforest, forestry, past, other" to "secdforest, other" - **config** Submissions with high memory requirements now get 16 CPUs and 80GB of memory to account for the new specifications of PIK's new HPC 'Foote'. `maxMem` was renamed to `highMem`, because 80GB of memory does not correspond to the maximum available memory of a compute node. - +- **inputdata** changed GDP base year from 2005USD to 2017USD +- **config** changed default input data to use 2017USD +- **module_documentation** all references to USD05 changed to USD17 ### added - **scripts** added output script converting all grid-level .mz files to .nc (netCDF) diff --git a/config/default.cfg b/config/default.cfg index 9fa0d8a1f3..19548b4bba 100644 --- a/config/default.cfg +++ b/config/default.cfg @@ -22,9 +22,9 @@ cfg$model <- "main.gms" #def = "main.gms" #### input settings #### # which input data sets should be used? -cfg$input <- c(regional = "rev4.112_h12_magpie.tgz", - cellular = "rev4.112_h12_fd712c0b_cellularmagpie_c200_MRI-ESM2-0-ssp370_lpjml-8e6c5eb1.tgz", - validation = "rev4.112_h12_validation.tgz", +cfg$input <- c(regional = "rev4.112DC_GDP2017_h12_magpie.tgz", + cellular = "rev4.112DC_GDP2017_h12_fd712c0b_cellularmagpie_c200_MRI-ESM2-0-ssp370_lpjml-8e6c5eb1.tgz", + validation = "rev4.112DC_GDP2017_h12_magpie.tgz", additional = "additional_data_rev4.53devGDP2017.tgz", calibration = "calibration_H12_26Mar24_fixed.tgz") From 01d91af29f8b12468155f797289f911c316b2963 Mon Sep 17 00:00:00 2001 From: florianh Date: Mon, 23 Sep 2024 09:54:03 +0200 Subject: [PATCH 010/206] revert default title --- main.gms | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/main.gms b/main.gms index 32bf2a6992..c3c10d1914 100644 --- a/main.gms +++ b/main.gms @@ -221,7 +221,7 @@ $offlisting $setglobal c_timesteps coup2100 $setglobal c_past till_2010 -$setglobal c_title DC4GDP2017_2017USD_oldCalib +$setglobal c_title default scalars s_use_gdx use of gdx files / 0 / From 84546b8b803f27bf8028da7dc75fb9b0f7eab599 Mon Sep 17 00:00:00 2001 From: Singh Date: Mon, 23 Sep 2024 15:45:55 +0530 Subject: [PATCH 011/206] Removed start test script for water bug --- scripts/start/waterTestDefault.R | 35 -------------------------------- 1 file changed, 35 deletions(-) delete mode 100644 scripts/start/waterTestDefault.R diff --git a/scripts/start/waterTestDefault.R b/scripts/start/waterTestDefault.R deleted file mode 100644 index 2b493c0d02..0000000000 --- a/scripts/start/waterTestDefault.R +++ /dev/null @@ -1,35 +0,0 @@ -#description: Pumping cost implementation for India (11_cost>default>equations.gms updated manually) - -# Load start_run(cfg) function which is needed to start MAgPIE runs -library(gms) -library(magclass) -library(gdx2) -library(luscale) -library(magpie4) -source("scripts/start_functions.R") -source("config/default.cfg") - -codeCheck <- FALSE - -## Basic settings: - -basic_settings <- function(title) { - - source("config/default.cfg") - - cfg$force_download <- TRUE - cfg$info$flag <- "060924" - cfg$title <- paste(cfg$info$flag,title,sep="_") - cfg$results_folder <- "output/:title:" - cfg$recalibrate <- FALSE - return(cfg) -} - - -cfg <- basic_settings(title = "WaterTestBug") - -# * Switch to activate pumping costs (only available for India currently), Set to 1 if want to use for India -cfg$gms$s42_pumping <- 1 # def = 0 -cfg$gms$s42_multiplier <- 1 # def = 0 - -start_run(cfg, codeCheck=FALSE) From 134ada76dbb4b77aa78549cfb3d98f95c1337d0f Mon Sep 17 00:00:00 2001 From: Pascal Sauer <156898545+pascal-sauer@users.noreply.github.com> Date: Tue, 24 Sep 2024 12:07:51 +0200 Subject: [PATCH 012/206] pkgType --- .Rprofile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.Rprofile b/.Rprofile index 43d47c62c3..bc514ec1fa 100644 --- a/.Rprofile +++ b/.Rprofile @@ -37,5 +37,5 @@ if (isTRUE(rownames(installed.packages(priority = "NA")) == "renv")) { # in case bootstrapping fails halfway, install piamenv and rely on requirement auto-fixing if (tryCatch(utils::packageVersion("piamenv") < "0.5.5", error = function(error) TRUE)) { - renv::install("piamenv", type = getOption("pkgType"), prompt = FALSE) + renv::install("piamenv", prompt = FALSE) } From 8dc7d4642fc70f08938a3d9809833b45066e989b Mon Sep 17 00:00:00 2001 From: Singh Date: Tue, 24 Sep 2024 17:05:15 +0530 Subject: [PATCH 013/206] Updated change log --- CHANGELOG.md | 328 ++++++++++++++++++++++++++++++--------------------- 1 file changed, 194 insertions(+), 134 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 8ecf219d9b..e36ae321d7 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,10 +3,10 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). - -## [Unreleased] +## [Unreleased][Unreleased] ### changed + - **config** The default realization for the 38_factor_costs module was switched to `sticky_feb18`. In this realization, capital stocks and their depreciation are tracked, giving some inertia to random relocation of production, improving high resolution outputs. - **21_trade** refactor equations for enhanced readablility and improve documentation - **scripts** rewrite of merge_report.R based on rds files and rbind, which allows for more flexibility when merging reports. Avoid inconsistent use of "GLO" instead of "World" in report.rds files. @@ -26,9 +26,10 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). - **scripts** `.nc` files are no longer created by default after disaggregation - **config** `cfg$gms$land_snv`changed from "secdforest, forestry, past, other" to "secdforest, other" - **config** Submissions with high memory requirements now get 16 CPUs and 80GB of memory to account for the new specifications of PIK's new HPC 'Foote'. `maxMem` was renamed to `highMem`, because 80GB of memory does not correspond to the maximum available memory of a compute node. - +- **11_costs** changed equation to fix bug in total water cost calculation ### added + - **scripts** added output script converting all grid-level .mz files to .nc (netCDF) - **scripts** added output report `EU_report.R` that uses `EU_report.Rmd` - **scripts** added out of bounds check as output script @@ -45,17 +46,17 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). ### removed - ### fixed + - **scripts** fixing an error in start.R and output.R which occurred if more than one slurm job was submitted at the same time. - **15_food** fixing parameter declaration of i15_processed_kcal_structure_iso - **80_optimization** bugfix for variables levels not obeying the bounds in nlp_par, `conopt` changed to `conopt3` - **35_natveg** bugfix secdforest and other land restoration to avoid double-counting of restoration in equation `q29_land_snv` - -## [4.8.1] - 2024-06-19 +## [4.8.1][4.8.1] - 2024-06-19 ### changed + - **29_ageclass** module 29_ageclass has been renamed to 28_ageclass to make space for `29_cropland` just before `30_croparea` - **30_crop** module `30_crop` renamed to `30_croparea`, which now only accounts for crop area. - **30_crop** Semi-Natural Vegetation (SNV) implementation has been moved from `30_crop` to `29_cropland` @@ -66,25 +67,27 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). - **scripts** updated EL2p0 start scripts ### added + - **10_land** added interface `pm_land_hist` with historic land use patterns - **29_cropland** new module `29_cropland` accounting for crop area, fallow cropland and tree cover on cropland with two realizations: `detail_apr24` and `simple_apr24` (default). - **42_water_demand** added non-agricultural water demand for entire year ### removed + - **32_forestry** removed technical balance term `v32_land_missing_ndc` ### fixed + - **22_land_conservation** avoid infeasibilities due to very small numbers, account for cropland tree cover and lower bound of cropland - **32_forestry** avoid infeasibilities due to very small numbers - **35_natveg** avoid infeasibilities due to very small numbers - **44_biodiversity** Fixing to SSP2 parameters until 2025 was not working - **config** update to input data rev4.109. In the previous rev4.108, MER GDP was wrong and was identical to PPP GDP - - -## [4.8.0] - 2024-06-10 +## [4.8.0][4.8.0] - 2024-06-10 ### changed + - **14_yields** revised timber yield calculations - **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 - **22_land_conservation and default.cfg** Added options for baseline protection @@ -104,6 +107,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 + - **15_food** added additional sigmoid food substition scenarios `sigmoid_75pc_25_50`, `sigmoid_50pc_25_50` and `sigmoid_25pc_25_50` - **21_trade** Minimum trade margin for forestry products `s21_min_trade_margin_forestry` - **30_crop** added regional cropland equation `q30_crop_reg` and presolve growth constraint @@ -120,9 +124,10 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). - **scripts** added "checkSummation" output script for consistency checking a report.mif - **scripts** added automatic set writer for new bioenergy realization to `start_functions` - **scripts** added start scripts for the GENIE project -`s60_bioenergy_price_2nd`, `c60_price_implementation` + `s60_bioenergy_price_2nd`, `c60_price_implementation` ### removed + - **14_yields** removed interface `pm_timber_yield_initial` - **21_trade** removed interface `pm_selfsuff_ext`, removed `v21_manna_from_heaven` - **32_forestry** removed interface `pm_representative_rotation` @@ -133,6 +138,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). - **scripts/output/extra** removed scripts disaggregation_cropsplit and disaggregation_transitions ### fixed + - **14_yields** fix division by zero in preloop of managementcalib_aug19 - **44_biodiversity** avoid division by zero - **58_peatland** Added balance variable to avoid random infeasibilites @@ -143,10 +149,10 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). - **scripts/start/test_runs.R** include all default output script, in particular disaggregation.R, which is needed for BII - **start/projects/fsec.R** scenario settings - -## [4.7.3] - 2024-04-12 +## [4.7.3][4.7.3] - 2024-04-12 ### changed + - **21_trade** Revision of trade module. Replaced `cfg$gms$s21_trade_bal_damper` in favour of `cfg$gms$k_import21`, which allows for additional imports to maintain feasibility - **21_trade** v21_import_for_feasibility now available for all countries, not just for importers - **70_livestock** if `c70_fac_req_regr` is set to `reg`: use of USDA/FAO values for historic factor requirements for livestock instead of using regression values and change of calibration year from 2005 to 2010 for regional factor requirements regression @@ -157,6 +163,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). - **scripts/calibration/landconversion_cost.R** Revised calibration approach for conversion costs for cropland. Information from all calibration time steps in combination with a lowpass filter is now used for deriving the calibration factors, which avoids the previous zickzack pattern. The previous option `cfg$damping_factor_landconversion_cost` has been removed in favor of `cfg$lowpass_filter_landconversion_cost`. ### added + - **14_yields** added minimum threshold for wood yields. Below this threshold, wood yields are set to zero. - **config** added switch for minimum timber yields - **56_ghg_policy** added NDC scenarios @@ -164,16 +171,17 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). - **scripts** start script for EAT2p0 Deep Dive project ### fixed + - **15_food** Small number rather 0 in condition checking calorie balancing - **34_urban** `static` realization was not working because `vm_carbon_stock` was referenced without the set `stockType` - **52_carbon** removing jump of carbon content into fully grown forest when a forest changes from second-last age class to last age-class. - **58_peatland** Equation `q58_scalingFactorExp` revised to avoid division by zero. - **80_optimization** duplicated solve statement in all instances to avoid non-matchting left- and right-hand sides of equations - -## [4.7.2] - 2024-04-02 +## [4.7.2][4.7.2] - 2024-04-02 ### changed + - **21_trade** Revision of trade module. Replaced `cfg$gms$s21_trade_bal_damper` in favour of `cfg$gms$k_import21`, which allows for additional imports to maintain feasibility - **58_peatland** Threshold in equations changed from 1e-10 to 1e-8 to avoid rare divisions by zero - **70_livestock** if `c70_fac_req_regr` is set to `reg`: use of USDA/FAO values for historic factor requirements for livestock instead of using regression values and change of calibration year from 2005 to 2010 for regional factor requirements regression @@ -181,22 +189,25 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). - **scripts** modified output reporting for SEALS to account for forestry plantations ### added + - **30_crop** Improved representation of cropland requiring relocation in response to introducing semi-natural habitat at the 1 km level based on high-resolution satellite imagery. - **config** added `.codeCheck` with additonal configuration when running `gms::codeCheck` - **scripts** add additional BII reporting variables in FSDP_collect.R - **scripts** added a new validation_cell.R output script that generates a pdf with the comparison of magpie land use and crop type outputs with LUH and MAPSPAM historical data at cellular resolution. ### removed + - **core** removed no longer needed set `si` Suitability classes ### fixed + - **52_carbon** i52_land_carbon_sink was not identical before 2020 for different RCPs. Fixed by setting to RCPBU until the year defined in sm_fix_cc. - **inputdata** currency fixed in historic value of production for crops and livestock which affects e.g. total labor costs and in turn hourly labor costs, bugfix in aggregation weight of capital cost share out of factor costs - -## [4.7.1] - 2024-02-28 +## [4.7.1][4.7.1] - 2024-02-28 ### changed + - **15_food** Added improved EAT Lancet diet implementation (EAT 2p0) - **21_trade** s21_trade_bal_damper for roundwood changed from 0.75 to 0.65 - **31_past** in grasslands_apr22 realization: changed structure of f31_pastr_suitability to align with ssp-rcp specific input data formulation. Changed input filename from cs3 to cs2. Added `cc`, `nocc` and `nocc_hist` options for `i31_manpast_suit` and changed input gams code from table to parameter. Climate scenario assignment moved from preloop.gms to input.gms. Removed pastSuit set in sets.gms as not needed anymore. Adjusted not_used.txt in both grasslands_apr22 and static realizations. @@ -212,16 +223,19 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). - **start_functions** Check if cfg$recalibrate is consistent with cfg$gms$s14_use_yield_calib ### added + - **32_forestry** new interfaces `vm_land_forestry`, `pcm_land_forestry` `vm_landexpansion_forestry` and `vm_landreduction_forestry` - **56_ghg_policy_** added new trajectories for R32M46 - **60_bioenergy** added new trajectories for R32M46 - **scripts** added peatland to output/extra/disaggregation.R ### removed + - **58_peatland** removed realization "on" - **default.cfg** Removed description of cfg$gms$c31_past_suit_scen since no longer needed due to changes in 31_past described below. Its function is now done by cfg$gms$c31_grassl_yld_scenario. ### fixed + - **21_trade** introduced s21_manna_from_heaven for fixing v21_manna_from_heaven to zero. Without fixing to zero, v21_manna_from_heaven was used unnecessarily in runs started with highres.R - **32_forestry** bugfix unit p32_observed_gs_reg - **32_forestry** keep c-density for timber plantations constant after rotation length to avoid unrealistic carbon sequestration in unharvested timber plantation @@ -234,10 +248,10 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). - **scripts** fixed memory spike leading to crashes in disaggregation.R - **scripts** fixed writing of NetCDF files in output/reportMAgPIE2SEALS.R - -## [4.7.0] - 2023-12-11 +## [4.7.0][4.7.0] - 2023-12-11 ### changed + - **14_yields_and_config** The new default is to not use yield calibration factors from a calibration run. The switch s14_use_yield_calib can optionally reenable the use of yield calibration factors. - **36_employment** regression between hourly labor regression and GDP pc changed from linear to log-log - **inputdata** Now using inputdata rev4.94 which is based on 67420 cells (67k, previously 59k) @@ -245,56 +259,61 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). - **scripts** LUH2_disaggregation output script was modified. Specifically, flooded area was made compatible with the LUH definition, cropland and grazing land were added to the states.nc file, and specific naming/details (datatype, zname, xname, and yname) were added when creating the .nc files. ### added + - **14_yields/config** Added option for considering impacts of land degradation on yields. If `s14_degradation` is switched to 1, MAgPIE will include cluster-specific information on the state of nature's contributions to people relevant for yields `./modules/14_yields/input/f14_yld_ncp_report.cs3`. - **18_residues** Included cluster-level residue realization, for cluster-level production of residues (but balancing of recycling and burning budgets remains at region-level, for computational lightness) - **32_forestry** new interface `vm_land_forestry` - **58_peatland** added realization "v2" with updated peatland map and GHG emission factors ### fixed + - **inputdata** There was a major bug (related to proj/terra) in the rev4.91 inputdata that was fixed with rev4.92 - **inputdata** There was another bug (terra default na.rm changed) in the inputdata that was fixed with rev4.93 - **scripts** Fixed a bug in NPI/NDC calculations leading to missing AD policies when run with 67k - -## [4.6.11] - 2023-09-05 +## [4.6.11][4.6.11] - 2023-09-05 ### changed + - **scripts** All time steps between 2015 and 2050 are now reported to SEALS ### fixed -- **70_livestock** fixed division by zero that could occur depending on the scenario set-up +- **70_livestock** fixed division by zero that could occur depending on the scenario set-up -## [4.6.10] - 2023-08-16 +## [4.6.10][4.6.10] - 2023-08-16 ### changed + - **config** update preprocessing to newest input data v4.88 with new transport costs - **GitHub action** the github action is now faster, because it installs binary packages from Posit Package Manager - **scenario_config.csv** update preprocessing to newest input data v4.88 - **scripts** output.R is now faster, because it no longer searches runfolder renvs for full.gms files ### fixed + - **scripts** check_config does not warn about c_input_gdx_path anymore while running empty model - **scripts** fixed erronoeous if clause in output.R - **scripts** fixed output/extra/disaggregation_LUH2.R. The script was not working any more because magpie4::protectedArea was changed to return protected area for all land types. Moreover, the script now also works for runs without dynamic forestry (default run) but with a warning message. - -## [4.6.9] - 2023-07-27 +## [4.6.9][4.6.9] - 2023-07-27 ### fixed + - **70_livestock** consideration of milk demand in the calculation of the pasture management factor - **scripts** Fixed inaccuracies and inconsistent application of SNV policies during disaggregation in luscale::interpolateAvlCroplandWeighted(), which is called in extra/disaggregation.R - -## [4.6.8] - 2023-07-17 +## [4.6.8][4.6.8] - 2023-07-17 ### changed + - **41_area_equipped_for_irrigation** new AEI data (Mehta2022) replacing old Siebert data - **80_optimization** printing of solprint when solver status is 7 re-activated - **scripts** start_functions.R can now handle clusters per region flexibly - **scripts** the REMIND-MAgPIE coupling now uses renv ### added + - **31_past** added `cc`, `nocc` and `nocc_hist` options for `c31_past_suit_scen` and `c31_grassl_yld_scenario` - **32_carbon** added `nocc` and `nocc_hist` option for `c52_land_carbon_sink_rcp` - **71_disagg_lvst** added new realisation `foragebased_jul23` which solves GAMS issues at higher spatial resolutions @@ -304,20 +323,22 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). - **scripts** New output script for reporting disaggregated land use patterns to the SEALS (Spatial Economic Allocation Landscape Simulator) downscaling model ### removed + - **config** `s80_num_nonopt_allowed` - **scripts** removed .snapshot.Rprofile and the Rprofile.R script, renv now fully supersedes snapshots ### fixed + - **30_crop** corrected q30_cropland in module realization rotation_apr22, where fallow land was on the wrong side of the equation - **71_disagg_lvst** reworked `foragebased_aug18` (including removal of linear version and correction of balance flow calculation) - **80_optimization** resolve was not working in nlp_par realization due to `s80_num_nonopt_allowed` - **config** corrected wrong names of parameters for peatland costs - **config** updated scenario configs to newest preprocessing (4.87) - -## [4.6.7] - 2023-05-10 +## [4.6.7][4.6.7] - 2023-05-10 ### changed + - **09_drivers** Harmonization of sets for population, gdp, pal and demography - **56_ghg_policy** added emission policies without GHG emissions from peatlands - **config** added scenario `SSP2EU` in scenario_config.csv @@ -328,20 +349,21 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). - **scripts** NDC/NPI calculations can now handle 59k and 67k cell inputs ### added -- **15_food** added an option in `s15_exo_diet` to allow for exogenous diet scenario for India +- **15_food** added an option in `s15_exo_diet` to allow for exogenous diet scenario for India -## [4.6.6] - 2023-05-10 +## [4.6.6][4.6.6] - 2023-05-10 ### changed + - **config** updated scenario_fsec.csv to reflect new GST validation - **scripts** included new output indicator for water - **scripts** updated global surface temperature maps to new RCPs per scenario - -## [4.6.5] - 2023-03-29 +## [4.6.5][4.6.5] - 2023-03-29 ### changed + - **22_land_conservation** Replaced old options for land conservation by new conservation priority areas. These include among others a new 30by30 template (based on Key Biodiversity Areas, unprotected habitat in Biodiversity Hotspots, Ecoregions with a high beta-diversity from the Global Safety Net (Dinerstein et al. 2020) and critical connectivity areas (Brennan et al. 2022), a new Half Earth template based on the Global Safety Net (Dinerstein et al. 2020) and land conservation of irrecoverable carbon (Noon et al. 2022). - **56_ghg_policy** renamed `cfg$mute_ghgprices_until` to `cfg$gms$c56_mute_ghgprices_until` and changed the default to `y2030`, i.e. no GHG emission pricing in the AFOLU sector before (and including) 2030. This setting will be also used in coupled REMIND-MAgPIE runs. - **config** input data revision to rev4.82 to include new conservation priority areas @@ -351,23 +373,26 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). - **scripts** Disaggregation of land use to 0.5° now takes land conservation into account - i.e. cropland expansion is not mapped to areas that are subject to land conservation ### added + - **56_ghg_policy** added switch `s56_minimum_cprice` - **config** minimum CO2 price (`s56_minimum_cprice`) of 5 USD per tCO2 (18 USD per tC) for all future time steps in case of NDC policy to guide land-use decisions - **scripts** added output script which writes landuse data on cluster resolution to a shapefile ### removed + - **56_ghg_policy** removed `s56_ghgprice_phase_in` and `s56_ghgprice_start` - **scripts** removed argument `mute_ghgprices_until`, now handeld in GAMS code ### fixed + - **31_past** fixed pasture suitability to SSP2 before and including 2020 (only relevant for grassland implementation) - **56_ghg_policy** the renamed switch `c56_mute_ghgprices_until` is now always used for coupled as well as standalone runs. - **scripts** Fixed occasional memory failure in the disaggregation script - -## [4.6.4] - 2023-02-22 +## [4.6.4][4.6.4] - 2023-02-22 ### changed + - **15_food** Interpret EAT-Lancet guidelines not as target but as lower/upper limits - **config** changed order of output scripts. Some functions in rds_report require gridded outputs. - **config** input data revision to rev4.81 for trade margin bugfix @@ -382,6 +407,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). - **sticky_labor** renamed equation `q38_labor_capital_ratio` to `q38_labor_share_target` ### added + - **15_food** half_overweight scenario added - **21_trade** New Bilateral trade realization selfsuff_reduced_bilat22 for bilateral trade within selffsuff constraints - **32_forestry** added switch `s32_aff_prot` for protection of afforested areas (0=until end of planning horizon 1=forever) @@ -394,9 +420,11 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). - **sticky_labor** `nl_fix`, `nl_relax` and `nl_release` added ### removed + - **42_water_demand** removed fm_multicropping factor because of fallow inconsistency ### fixed + - **14_yields** nl_fix updated to current equation - **32_forestry** pm_land_conservation(t,j,"secdforest","restore") now accounts for the rotation length in timber plantations to avoid infeasibilities - **44_biodiversity** added regional layer `i` in `bii_target` realisation to make it compatible with the high-resolution parallel optimization output script @@ -404,10 +432,10 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). - **scripts** fixed a bug where renvs for high resolution runs were missing some packages - **scripts** fixed in the calc_calib.R script the saving of calib_factors used in each iteration to ensure that they correspond to the divergence reported. Changed divergence from zero to NA for those iterations where calib_factors are above the limit. The best_calib selection criterion was changed from selecting the factors of the iteration with the lowest standard deviation to the selection, for each region, of the factor of the iteration with the lowest divergence. Also, factors from the first iteration are now not considered, and if two different factors had the same divergence for a region, the one of the latest iteration is picked. - -## [4.6.3] - 2023-01-19 +## [4.6.3][4.6.3] - 2023-01-19 ### changed + - **15_food** changed `anthro_iso_jun22` realisation such that results in case of `exo_diet = 1/0` and `exo_waste = 1/0` are identical until 2020 - **30_crop** identical assumptions for bioenergy until 2020 - **38_factor_costs** changed name of set `req` to `factors` (also used in 11_costs, 57_maccs, 70_livestock) @@ -418,17 +446,19 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). - **config** update input data to rev4.79 ### added + - **31_past** added additional limitation (single climate scenario input) for **grasslands_apr22** - **59_som** added new **cellpool_jan23** realization with updated 2019 IPCC guidelines values - **scripts** added start script which starts an empty model just regenerating a previous run ### fixed -- **scripts** make sure that `c_title` in the GAMS code is not containing dots which otherwise could lead to compilation errors +- **scripts** make sure that `c_title` in the GAMS code is not containing dots which otherwise could lead to compilation errors -## [4.6.2] - 2023-01-12 +## [4.6.2][4.6.2] - 2023-01-12 ### changed + - **36_employment** include labor costs from MACCs in employment - **38_factor_cots** renamed `p36_cost_shares` to `pm_cost_share_crops` - **57_maccs** split costs into labor and capital @@ -437,15 +467,16 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). - **scripts** FSDP_collect FSDP_process fsec.R updates ### added + - **renv** MAgPIE now runs in an isolated, stable, reproducible R package environment - **scripts** added output script that generates a short mif containing only variables relevant for the REMIND coupling - **scripts** added output script that generates subnational validation outputs for fable_India projects - **setup** required R packages are automatically installed - -## [4.6.1] - 2022-12-13 +## [4.6.1][4.6.1] - 2022-12-13 ### changed + - **42_water_demand** replaced `f42_env_flow_policy` with macro - **30_crop** replaced `f30_scenario_fader` with macro - **30_crop/config** changed switch `c30_rotation_scenario_speed` to `s30_rotation_scenario_target` @@ -453,6 +484,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). - **config** changed default value for `c30_marginal_land` from `'all_marginal'` to `'q33_marginal'` for better spatial cropland patterns ### added + - **10_land** added `vm_lu_transitions` as interface - **10_land** added interface `fm_land_iso` for consistency - **30_crop/config** added switch `s30_rotation_scenario_start` @@ -461,6 +493,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). - **39_landconversion** scalar `s39_reward_crop_reduction` provides a cropland reduction reward ### removed + - **10_land** removed `feb15` realization - **10_land** removed the interfaces `vm_croplandexpansion` and `vm_croplandreduction` - **30_crop** removed `f30_scenario_fader.csv`input @@ -469,14 +502,15 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). - **scripts** removed remind2::deletePlus in coupling interface of start_function ### fixed + - **59_som** fixed land use change tracking for non-cropland pools in the `cellpool_aug16` realization - **config** changed default value for s56_limit_ch4_n2o_price from 1000 to 4000 for consistency with c57_macc_version = "PBL_2022" - **scripts** rewrite of land conversion cost calibration script `landconversion_cost.R` - -## [4.6.0] - 2022-11-09 +## [4.6.0][4.6.0] - 2022-11-09 ### changed + - **18_residues** bugfix in `q18_cost_prod_res` - **36_employment** included calculations for minimum wage scenario - **38_factor_costs** included labor cost scaling in case of wage scenario @@ -513,6 +547,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). - **scripts/start** cleanup of old start scripts ### added + - **14_yields** added input file containing AQUASTAT yield calibration factors and switch `s14_calib_ir2rf` in default.cfg to activate this yield calibration - **15_food** added new realization with country level exogenous diets, product-specific intake estimates, new scenarios for exogenous BMI and decomposition switches for EAT Lancet diets. Simplified code and improved iteration procedure. - **50_nr_soil_budget** new module realization for more consistent MACCs implementation. change of interface from vm_btm_reg to vm_emissions_reg @@ -534,6 +569,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). - **scripts** added water output script for FSEC model runs ### removed + - **15_food** removed read-in of non-needed input file "f15_calib_factor_FAOfsupply_iso" - **38_factor_costs** removed `mixed_reg_feb17` realization - **50_nr_soil_budget** old inconsistent module realizations @@ -542,15 +578,16 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). - **57_maccs** old inconsistent module realizations ### fixed + - **38_factor_costs** fixed calibration of share parameter in `sticky_labor` realization - **43_water_availability** added missing years after 2100 in "f43_wat_avail" to avoid infeasibilities in coupled runs with less_ts timesteps - **59_som** corrected the som pool due to the carbon transfer from other and primary forest to secondary forest before optimization (presolve) - **scripts** fixed some bugs related to background execution of start/output scripts - -## [4.5.0] - 2022-07-07 +## [4.5.0][4.5.0] - 2022-07-07 ### changed + - **09_drivers** separation of GDP and population scenarios - **09_drivers** changed `i09_gdp_pc_mer_iso` to `im_gdp_pc_mer_iso` - **11_costs** Split of production costs per sector, addded new separated costs to the costs function. @@ -558,10 +595,10 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). - **13_tc** Replace endo_jan18 realization by endo_jan22. The new realization adds a new dimension to vm_tau separating crop from managed pastures tau. - **15_food** added more options to define convergence towards exogenous food intake and waste scenarios accounting for different transition periods - **18_residues** The variable that include production costs vm_cost_prod for residues changed to a new independent variable called vm_cost_prod_kres -(specific to residues). + (specific to residues). - **30_crop** renamed switch `s30_set_aside_shr`, `s30_set_aside_shr_noselect` and `c30_set_aside_target` to `s30_snv_shr`, `s30_snv_shr_noselect` and `c30_snv_target`. - **31_past** The variable that include production costs vm_cost_prod for pasture changed to a new independent variable called vm_cost_prod_past -(specific to past). + (specific to past). - **31_past** added new realization implementing the separation of rangelands and managed pastures for the production of grass biomass. - **32_forestry** simplification and bugfix of afforestation limit. `c32_max_aff_area_glo` renamed to `s32_max_aff_area_glo` in default.cfg. - **34_urban** added set urban_scen34 and the switch c34_urban_scenario @@ -595,6 +632,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). - **scripts** scripts/output/extra/emulator.R Remove dependency on deprecated R package "magpie" ### added + - **core** macros for linear and sigmoidal time interpolation - **22_land_conservation** added new module and realisation for land conservation. The realisation also includes a new WDPA initialisation data set (from 1995 to 2020) for protected areas under legal protection, meeting IUCN and CBD protected area definitions. The module also adds the interface `pm_land_conservation`. - **30_crop** new module realizations including crop rotation scenarios by strict constraints (`rotation_apr22`) and by penalties (`penalty_apr22`) @@ -607,11 +645,11 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). - **config** added option for CO2 emission pricing `cfg$gms$c56_carbon_stock_pricing` - **config** added cfg$gms$s70_past_mngmnt_factor_fix with default 2005 (previous default was 2010). The previous setting caused a strong spike in CO2 emissions from pasture expansion in SSA. With 2005, this can be avoided. - **inputs** New input files added: - f13_pastr_tau_hist.csv -> historical tau for managed pastures. - f31_pastr_suitability.cs3 -> Managed pasture suitability - f31_LUH2v2.cs3 -> LUH2v2 land classes separating rangelands from managed pastures - f31_grassl_yld.cs3 -> Rangelands and managed pastures grass yields - f31_grass_bio_hist.cs3 -> Historical grass biomass demand + f13_pastr_tau_hist.csv -> historical tau for managed pastures. + f31_pastr_suitability.cs3 -> Managed pasture suitability + f31_LUH2v2.cs3 -> LUH2v2 land classes separating rangelands from managed pastures + f31_grassl_yld.cs3 -> Rangelands and managed pastures grass yields + f31_grass_bio_hist.cs3 -> Historical grass biomass demand - **modules** New dimension in `vm_carbon_stock` for different carbon stock types (actual, previousLandPattern, previousCarbonDensity) - **scripts** output/projects/FSEC_StevenLord.R to create output for Steven Lord in the FSEC context - **scripts** output/projects/FSEC_costs.R to create costs ouput for the FSEC project @@ -621,9 +659,11 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). - **scripts** `start/projects/test_rotations.R` testscript for different rotation scenario settings ### removed + - **38_factor_costs** mixed_feb17 and fixed_per_ton_mar18 realizations removed because they are not being used at the moment. ### fixed + - **09_drivers** bugfix concerning the use of the switch c09_gdp_scenario for defining population assumptions - **09_drivers** introduced new sets for PAL and demography scenarios to account for only partial coverage of available socio-economic gdp and population scenarios - **18_residues** off realization; missing variable declarations @@ -642,10 +682,10 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). - **scripts** fixed configuration error in FSEC output scripts, FSEC_dietaryIndicators.R and FSEC_environmentalPollutants.R - **scripts** scripts/start/extra/emulator.R Throw an error if no file can be found to take the GHG prices from - -## [4.4.0] - 2021-12-13 +## [4.4.0][4.4.0] - 2021-12-13 ### changed + - **additional_data** NDCs for Chinas afforestation now start earlier (1995) in line with observed afforestation. - **config** comments added for correct use of nitrogen switches - **inputs** new default LPJmL version with growing season adaptation (gsadapt) on @@ -685,6 +725,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). - **scripts** start/test_runs.R added SSP1, SSP2 and SSP5 as default test runs ### added + - **34_urban** New exo_nov21 exogenous realization of urban land expansion - **21_trade** Missing interface parameter for failing exo realization runs - **59_som** exogenous pathway for vm_nr_som via f59_som_exogenous @@ -707,6 +748,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). - **output.R** added SLURM standby maxMem and SLURM priority maxMem; needed for some output scripts (e.g. disaggregation_LUH2.R) ### removed + - **32_foresty** Removed static realization - **35_natveg** Removed static realization - **scripts** lpjml_addon script is removed and all calls within dependend starting scripts @@ -719,6 +761,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). - **39_landconversion_cost** removed realizations "global_static_aug18" and "devstate" ### fixed + - **80_optimization** Improved solve logic in "nlp_apr17" and "nlp_par" realization, multiple bugfixes and switch to solvelink=3 in "nlp_par" - **58_peatland** fixed rare infeasibility in "on" realization - **10_land** fixed rare infeasibility in "landmatrix_dec18" realization @@ -733,10 +776,10 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). - **73_timber** plausible cost for balance variable in case of s73_timber_demand_switch = 0 to avoid cost distortion - **56_ghg_policy** choose the correct scenario for fixing the GHG prices until sm_fix_SSP2 - -## [4.3.5] - 2021-09-02 +## [4.3.5][4.3.5] - 2021-09-02 ### changed + - **13_tc** added switch to ignore historic tau patterns in historic time steps (new default) - **16_demand** Moved most of cropping related set definitions (k, kve, kcr) from **16_demand** to **14_yield** - **32_foresty** Added option to choose a rotation length calculation criteria @@ -752,8 +795,8 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). - **inputs** Changed file format from cs2 to cs2b for cellular input files with a single data column - **scenario_config** added RCPs as columns for use with setSceanrio function. This required the addition of "gms$" in the 1st column. - ### added + - **73_timber** Added construction wood demand scenarios based on Churkina et al. 2020 - **script(s)** Added scripts to replicate runs for Mishra et al. 2021 (in review : https://doi.org/10.5194/gmd-2021-76) - **13_tc** Added new interfaces for tau factor of the previous time step (`pcm_tau`) @@ -774,10 +817,12 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). - **sets** added superregional layer `h` as additional spatial layer and moved constraints in **13_tc** and **21_trade** partly to the superregional level. ### removed + - **13_tc** Removed disfuctional setting c13_tccost = "mixed" - **core** removed sets ac_young and ac_mature (no longer needed due to changes in 44_biodiversity) ### fixed + - **32_foresty** BII coefficients for CO2 price driven afforestation - **32_foresty** growth curve CO2 price driven afforestation - **32_foresty** NPI/NDC afforestation infeasibility @@ -785,27 +830,29 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). - **35_natveg** option to fade out damage from shifting agriculture by 2030 - **44_biodiversity** ac0 included in pricing of biodiversity loss - -## [4.3.4] - 2021-04-30 +## [4.3.4][4.3.4] - 2021-04-30 ### changed + - **51_nitrogen** New calculations for emissions from agricultural residues (vm_res_ag_burn) - **53_methane** New calculations for emissions from agricultural residues (vm_res_ag_burn) - **citation file** added new contributors ### added + - **config** The set "kfo_rd" (livst_rum, livst_milk), which is used in the food substitution scenarios c15_rumdairy_scp_scen and c15_rumdairyscen, has been added to the default.cfg file. This allows for sensitivity scenarios (e.g. only livst_milk or only livst_rum). - A new scenario (nocc_hist) was added to the cc/nocc switch. In this scenario, parameters affected by the cc/nocc switch in **14_yields**,**42_water_demand**,**43_water_availability**,**52_carbon**,**59_som** keep their historical/variable values up to the year defined by sm_fix_cc. Afterwards, sm_fix_cc values are kept constant for the overall run horizon. ### fixed + - **09_drivers** migration of sm_fix_SSP2 and sm_fix_cc declaration from the core declarations to the drivers module. This will allow to set the scalars properly . - - **15_food** single-cell protein substitution scenarios included in intersolve.gms. - **20_processing** The "mixed" scenario for single-cell protein production (c20_scp_type) was not working as expected. The corresponding code in 20_processing has been updated. - -## [4.3.3] - 2021-03-30 +## [4.3.3][4.3.3] - 2021-03-30 ### added + - **15_food*** added 3 sigmoid food substitution scenarios - **44_biodiversity** New biodiversity module. The realization bv_btc_mar21 now allows to calculate an area-based biodiversity value across all land types. Switch `c44_price_bv_loss` to implement cost for biodiversity loss. - **56_ghg_policy** Automatic sets for scenarios @@ -816,12 +863,13 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). - **scripts** Added pre-commit hook ### fixed -- **60_bioenergy** Minimal bioenergy demand +- **60_bioenergy** Minimal bioenergy demand -## [4.3.2] - 2021-03-17 +## [4.3.2][4.3.2] - 2021-03-17 ### changed + - **12_interest_rate** Interest fader changed to csv - **15_food** better documentation of parameters over model iterations - **15_food** added scenario switch for ruminant and dairy replacement by Single-Cell Protein @@ -834,6 +882,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). - **tests** Replaced TravisCI with GithubActions ### added + - **15_food** Added the option to fade out livestock demand towards a target level in kcal/cap/day. - **21_trade** Added scalar `s21_trade_bal_damper` and new set `k_trade_excl_timber` - **29_ageclass** New age-class module @@ -854,29 +903,32 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). - **scripts** added output script for disaggregation of land transitions ### removed + - **32_forestry** Removed previous default realization - **35_natveg** Removed previous default realization - **73_timber** Removed previous default realization ### fixed + - **32_forestry** Bugfixes for "ac_est" and carbon treshold afforestation; removed plantations from "vm_cdr_aff". - **core** bugfix m_fillmissingyears macro; was running over t before; now running over t_all_ - -## [4.3.1] - 2020-11-03 +## [4.3.1][4.3.1] - 2020-11-03 ### added + - **main** Added Dockerfile for running MAgPIE in a container ### fixed + - **35_natveg** Bugfix "v35_secdforest_expansion" - **52_carbon** Bugfix "p52_scaling_factor" for climate change runs - **73_timber** New scenario switch `c73_wood_scen`. - -## [4.3.0] - 2020-09-15 +## [4.3.0][4.3.0] - 2020-09-15 ### added + - **38_factor_costs** Added the new "sticky" realization to the factor costs module. The realization "sticky_feb18" favors expansion in cells with preexisting farmland and capital based on capital investment decisions. - **modules** added endogenous implementation of local biophysical (bph) impacts of afforestation to existing realizations in modules 32_forestry (dynamic_oct19) and 56_ghg_policy (price_jan20). default = off - **73_timber** Added timber module which brings the ability of producing woody biomass for timber plantations and natural vegetation. Default = off. New switch: `s73_foresight`. New scalars : `s73_timber_prod_cost`, `s73_timber_harvest_cost`,`s73_cost_multiplier`,`s73_free_prod_cost` @@ -888,129 +940,138 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). - **scripts** added start script for making timber production runs (forestry.R). ### changed + - **scripts** updated selection routine for start and output scripts - **scripts** replaced lucode dependency with newer packages lucode2 and gms - **32_forestry** include new datasets of the bph effect of afforestation / replaced the bph ageclass switch with a fade-in between ac10 and ac30 in (dynamic_may20) - - **13_tc**, **39_landconversion**, **41_area_equipped_for_irrigation** and **58_peatland**. For the current time step, the optimization costs only include now the annuity of the present investment. magpie4's reportCosts() function was modified to consider these changes. +- **13_tc**, **39_landconversion**, **41_area_equipped_for_irrigation** and **58_peatland**. For the current time step, the optimization costs only include now the annuity of the present investment. magpie4's reportCosts() function was modified to consider these changes. ### removed - - **scripts** deleted outdated start and output scripts + +- **scripts** deleted outdated start and output scripts ### fixed - - **32_forestry** Rotation length calculation based on correct marginals of growth function in timber plantations. Clearer calculations for harvested area for timber production. - - **35_natveg** Clearer calculations for harvested area for timber production. - - **52_carbon** Fix to the Carbon densities received from LPJmL for timber plantations. +- **32_forestry** Rotation length calculation based on correct marginals of growth function in timber plantations. Clearer calculations for harvested area for timber production. +- **35_natveg** Clearer calculations for harvested area for timber production. +- **52_carbon** Fix to the Carbon densities received from LPJmL for timber plantations. -## [4.2.1] - 2020-05-15 +## [4.2.1][4.2.1] - 2020-05-15 ### added - - **modules** added option of regional scenario switches in modules 12_interest_rate, 15_food, 42_water_demand, 50_nr_soil_budget, 55_awms, 56_ghg_policy, 60_bioenergy - - **58_peatland** added peatland module. Two realizations: off (=default) and on. - - **80_optimization** added realization for parallel optimization of regions in combination with fixed trade patterns. - - **metadata** added .zenodo.json metadata file for proper metadata information in ZENODO releases + +- **modules** added option of regional scenario switches in modules 12_interest_rate, 15_food, 42_water_demand, 50_nr_soil_budget, 55_awms, 56_ghg_policy, 60_bioenergy +- **58_peatland** added peatland module. Two realizations: off (=default) and on. +- **80_optimization** added realization for parallel optimization of regions in combination with fixed trade patterns. +- **metadata** added .zenodo.json metadata file for proper metadata information in ZENODO releases ### changed - - **12_interest_rate** merged the two realizations (glo_jan16 and reg_feb18) into one (select_apr20) with same functionality and add on of option to choose different interest rate scenarios for different regions selected via country switch select_countries12 - - **scripts** streamlined and improved performance of NPI/NDC preprocessing + +- **12_interest_rate** merged the two realizations (glo_jan16 and reg_feb18) into one (select_apr20) with same functionality and add on of option to choose different interest rate scenarios for different regions selected via country switch select_countries12 +- **scripts** streamlined and improved performance of NPI/NDC preprocessing ### fixed - - **56_ghg_policy and 60_bioenergy** update of GHG prices and 2nd generation bioenergy demand from SSPDB to most recent snapshot - - **NPI/NDC policy calculations** revision of calculation method +- **56_ghg_policy and 60_bioenergy** update of GHG prices and 2nd generation bioenergy demand from SSPDB to most recent snapshot +- **NPI/NDC policy calculations** revision of calculation method -## [4.2.0] - 2020-04-15 +## [4.2.0][4.2.0] - 2020-04-15 -This release version is focussed on consistency between the MAgPIE setup and the [REMIND model] and result of a validation exercise of the coupled (REMIND 2.1)-(MAgPIE 4.2) system. +This release version is focussed on consistency between the MAgPIE setup and the [REMIND model][REMIND model] and result of a validation exercise of the coupled (REMIND 2.1)-(MAgPIE 4.2) system. ### added - - **config** Added new socioeconomic scenario (SDP) to scenario_config.csv (which include all switches to define among others the SSP scenarios). For the parametrization of the new SDP (Sustainable Development Pathway) scenario, the list of scenario switches was extended to account for a broad range of sustainability dimensions. - - **10_land** added new land realization landmatrix_dec18 to directly track land transition between land use types - - **15_food** stronger ruminant fade out in India - - **15_food** Added exogenous food substitution scenarios that can be selected via settings in the config-file, defining speed of convergence, scenario targets and transition periods (applied after the food demand model is executed). Among these scenarios are the substitution of livestock products with plant-based food commodities and the substitution of beef or fish with poultry. The food substitution scenarios are based on the model-native, regression-based calculation of food intake and demand. - - **15_food** Added exogenous EAT Lancet diet scenarios: It is now possible to define in the config-file exogenous diet scenarios that replace the regression-based calculation of food intake and demand. Possible settings are the target for total calorie intake (e.g. according to a healthy BMI) and variants of the EAT Lancet diet (e.g. in addition to the flexitarian a vegetarian or vegan variant). - - **15_food** Added exogenous food waste scenarios which can be defined via settings in the config-file, including scenario targets for the ratio between food demand and intake and the year in which full transition to the target should be achieved. - - **30_crop** added crop specific land use initialization pattern (used as interface for other modules) - - **50_nr_soil_budget and 55_awms** Additional inputs for the GoodPractice Scenario. - - **52_carbon** Added new forest growth curve parameters based on Braakhekke et al. 2019. Growth curves are now differentiated between natural vegetation (default) and plantations. - - **59_som** added new realization static_jan19 (new default) including all soil carbon related calculations. Before all carbon pools were updated in the specific land use type modules. This still holds true for the above ground pools (vegetation and litter carbon) - - **.gitattributes** file added to set line ending handling to auto for all text files - - **scaling** added scaling.gms files for several modules to improve optimization (based on gdx::calc_scaling) - - **scripts** added output scripts for global soil carbon maps (SoilMaps.R). + +- **config** Added new socioeconomic scenario (SDP) to scenario_config.csv (which include all switches to define among others the SSP scenarios). For the parametrization of the new SDP (Sustainable Development Pathway) scenario, the list of scenario switches was extended to account for a broad range of sustainability dimensions. +- **10_land** added new land realization landmatrix_dec18 to directly track land transition between land use types +- **15_food** stronger ruminant fade out in India +- **15_food** Added exogenous food substitution scenarios that can be selected via settings in the config-file, defining speed of convergence, scenario targets and transition periods (applied after the food demand model is executed). Among these scenarios are the substitution of livestock products with plant-based food commodities and the substitution of beef or fish with poultry. The food substitution scenarios are based on the model-native, regression-based calculation of food intake and demand. +- **15_food** Added exogenous EAT Lancet diet scenarios: It is now possible to define in the config-file exogenous diet scenarios that replace the regression-based calculation of food intake and demand. Possible settings are the target for total calorie intake (e.g. according to a healthy BMI) and variants of the EAT Lancet diet (e.g. in addition to the flexitarian a vegetarian or vegan variant). +- **15_food** Added exogenous food waste scenarios which can be defined via settings in the config-file, including scenario targets for the ratio between food demand and intake and the year in which full transition to the target should be achieved. +- **30_crop** added crop specific land use initialization pattern (used as interface for other modules) +- **50_nr_soil_budget and 55_awms** Additional inputs for the GoodPractice Scenario. +- **52_carbon** Added new forest growth curve parameters based on Braakhekke et al. 2019. Growth curves are now differentiated between natural vegetation (default) and plantations. +- **59_som** added new realization static_jan19 (new default) including all soil carbon related calculations. Before all carbon pools were updated in the specific land use type modules. This still holds true for the above ground pools (vegetation and litter carbon) +- **.gitattributes** file added to set line ending handling to auto for all text files +- **scaling** added scaling.gms files for several modules to improve optimization (based on gdx::calc_scaling) +- **scripts** added output scripts for global soil carbon maps (SoilMaps.R). ### changed - - **config** new default ghg emission pricing policy "redd+_nosoil" in c56_emis_policy. Includes all pools included in the previous default "SSP_nosoil", and in addition "forestry". - - **13_tau** lower bound for vm_tau for historical time steps - - **50_nr_soil_budget** atmospheric deposition is now estimated on the cluster-level instead of the region level to improve spatial patterns. - - **56_ghg_policy** updated scenarios in f56_emis_policy: none, all natural (called 'ssp') and all land use change emissions (pure co2) being included in greenhouse gas pricing. ssp and all also featuring additional scenarios excluding soil carbon pricing (marked with '_nosoil' postscript). - - **56_ghg_policy** Several changes regarding afforestation: use of detailed formula for incentive calculation instead of simplified Hotelling formula, 50 year planning horizon (instead of 80 years), phase-in of GHG prices deactivated by default (now done in REMIND), CO2 price reduction factor deactivated by default, introduced buffer reduction factor of 20% for afforestation. - - **59_som** updated cellpool_aug16 realization to use new interfaces from land module on land use type specific land expansion and reduction as well as crop type specific land initialization pattern. Additionally added irrigation as stock change factor sub-type. N fertilizer from soil organic matter decomposition is truncated after threshold to avoid unrealistically high fertilization rates. - - **80_optimization** write extended run information in list file in the case that the final solution is infeasible - - **modules** modular structure updated from version 1 to version 2 - - **line endings** changed to unix-style for all text files + +- **config** new default ghg emission pricing policy "redd+_nosoil" in c56_emis_policy. Includes all pools included in the previous default "SSP_nosoil", and in addition "forestry". +- **13_tau** lower bound for vm_tau for historical time steps +- **50_nr_soil_budget** atmospheric deposition is now estimated on the cluster-level instead of the region level to improve spatial patterns. +- **56_ghg_policy** updated scenarios in f56_emis_policy: none, all natural (called 'ssp') and all land use change emissions (pure co2) being included in greenhouse gas pricing. ssp and all also featuring additional scenarios excluding soil carbon pricing (marked with '_nosoil' postscript). +- **56_ghg_policy** Several changes regarding afforestation: use of detailed formula for incentive calculation instead of simplified Hotelling formula, 50 year planning horizon (instead of 80 years), phase-in of GHG prices deactivated by default (now done in REMIND), CO2 price reduction factor deactivated by default, introduced buffer reduction factor of 20% for afforestation. +- **59_som** updated cellpool_aug16 realization to use new interfaces from land module on land use type specific land expansion and reduction as well as crop type specific land initialization pattern. Additionally added irrigation as stock change factor sub-type. N fertilizer from soil organic matter decomposition is truncated after threshold to avoid unrealistically high fertilization rates. +- **80_optimization** write extended run information in list file in the case that the final solution is infeasible +- **modules** modular structure updated from version 1 to version 2 +- **line endings** changed to unix-style for all text files ### fixed - - **modules** Fixing of all parameters to SSP2 values until 2020 (switch sm_fix_SSP2) for having identical outcomes in all scenarios (SDP, SSP1-5) until 2020. - - **21_trade** Bugfix kall instead of k in exo realization; Bufix begr/betr trade in default realization; Bugfix sets in free realization - - **32_forestry** NPI/NDC afforestation targets are now counted towards the global afforestation limit, which can be set for specific scenarios via the switch *s32maxaff_area* and constrains the potential for carbon-price induced endogenous afforestation. - - **56_ghg_policy** bugfix full soil carbon loss in default setting, renamed it from ssp to ssp_nosoil, indicating, that soil carbon losses are not priced. - - **56_ghg_policy** bugfix afforestation: vmbtm_cell was a free variable for some sources and pollutants, which could result in GHG cost neutral shifting of age classes to ac0 (e.g. from ac55 to ac0). - - **80_optimization** added fallback routine for CONOPT4 failure (fatal system error) +- **modules** Fixing of all parameters to SSP2 values until 2020 (switch sm_fix_SSP2) for having identical outcomes in all scenarios (SDP, SSP1-5) until 2020. +- **21_trade** Bugfix kall instead of k in exo realization; Bufix begr/betr trade in default realization; Bugfix sets in free realization +- **32_forestry** NPI/NDC afforestation targets are now counted towards the global afforestation limit, which can be set for specific scenarios via the switch *s32maxaff_area* and constrains the potential for carbon-price induced endogenous afforestation. +- **56_ghg_policy** bugfix full soil carbon loss in default setting, renamed it from ssp to ssp_nosoil, indicating, that soil carbon losses are not priced. +- **56_ghg_policy** bugfix afforestation: vmbtm_cell was a free variable for some sources and pollutants, which could result in GHG cost neutral shifting of age classes to ac0 (e.g. from ac55 to ac0). +- **80_optimization** added fallback routine for CONOPT4 failure (fatal system error) -## [4.1.1] - 2020-03-09 +## [4.1.1][4.1.1] - 2020-03-09 This version provides the model version used for the publication starved, stuffed and wasteful. It provides a few technical updates compared to the 4.1 release, which include ### added + - **scripts** a startscript that allows the exchange of model parameters as a sensitivity analysis ### changed + - **core** allow for flexible calibration period of the model, which allows for uncalibrated runs of the past for validation purposes - **15_food** Parameters for bodyheight regressions were included explicitly as input parameters - **config** updated input data of the drivers and food demand regressions ### fixed -- **15_food** Precision of iteration convergence criterium for magpie-demandmodel-iteration is calculated more precisely, avoiding unnecessary iterations. +- **15_food** Precision of iteration convergence criterium for magpie-demandmodel-iteration is calculated more precisely, avoiding unnecessary iterations. -## [4.1.0] - 2019-05-02 +## [4.1.0][4.1.0] - 2019-05-02 -This release version is focussed on consistency between the MAgPIE setup and the [REMIND model] and result of a validation exercise of the coupled REMIND-MAgPIE system. +This release version is focussed on consistency between the MAgPIE setup and the [REMIND model][REMIND model] and result of a validation exercise of the coupled REMIND-MAgPIE system. ### added - - **80_optimization** added support for GAMS version 26.x.x - - **scripts** added new start and output scripts - - **license** added exception to the applied AGPL license to clarify handling of required GAMS environment, solver libraries and R libraries + +- **80_optimization** added support for GAMS version 26.x.x +- **scripts** added new start and output scripts +- **license** added exception to the applied AGPL license to clarify handling of required GAMS environment, solver libraries and R libraries ### changed - - **56_ghg_policy** apply reduction factor on CO2 price to account for potential negative side effects; lowers the economic incentive for CO2 emission reduction (avoided deforestation) and afforestation - - **56_ghg_policy** non-linar phase-in of GHG prices over 20 year period - - **56_ghg_policy** multiply GHG prices with development state to account for institutional requirements needed for implementing a GHG pricing scheme - - **40_transport** introduced transport costs for monogastric livestock products - - **NPI/NDC scripts** added forest protection policy for Brazilian Atlantic Forest in default NDC and NPI scenarios - - **NPI/NDC scripts** harmonized the starting year of the NDC policies 2020. - - **interpolation scripts** changed output files to seven magpie land use types, added additional cropsplit script for more detailed cropland output - - **15_food** clean-up and cosmetic changes (correction of comments, parameter names, structure of code); update BMI share calculations with the values of the last consistent MAgPIE/food-demand-model iteration + +- **56_ghg_policy** apply reduction factor on CO2 price to account for potential negative side effects; lowers the economic incentive for CO2 emission reduction (avoided deforestation) and afforestation +- **56_ghg_policy** non-linar phase-in of GHG prices over 20 year period +- **56_ghg_policy** multiply GHG prices with development state to account for institutional requirements needed for implementing a GHG pricing scheme +- **40_transport** introduced transport costs for monogastric livestock products +- **NPI/NDC scripts** added forest protection policy for Brazilian Atlantic Forest in default NDC and NPI scenarios +- **NPI/NDC scripts** harmonized the starting year of the NDC policies 2020. +- **interpolation scripts** changed output files to seven magpie land use types, added additional cropsplit script for more detailed cropland output +- **15_food** clean-up and cosmetic changes (correction of comments, parameter names, structure of code); update BMI share calculations with the values of the last consistent MAgPIE/food-demand-model iteration ### fixed - - **42_water_demand** bugfix environmental flow policy harmonization for historic period - - **57_maccs** correction of cost calculation; Conversion from USD per ton C to USD per ton N and USD per ton CH4 was missing. - - **71_diagg_lvst** adjusted monogastric disaggregation for more flexiblity to avoid infeasibilities with EFPs (see 42_water_demand) - - **15_food** correction regarding the convergence measure of the iterative execution of the food demand model and MAgPIE; correction accounting for unusual time step length in body height calculations; body height regression parameters updated +- **42_water_demand** bugfix environmental flow policy harmonization for historic period +- **57_maccs** correction of cost calculation; Conversion from USD per ton C to USD per ton N and USD per ton CH4 was missing. +- **71_diagg_lvst** adjusted monogastric disaggregation for more flexiblity to avoid infeasibilities with EFPs (see 42_water_demand) +- **15_food** correction regarding the convergence measure of the iterative execution of the food demand model and MAgPIE; correction accounting for unusual time step length in body height calculations; body height regression parameters updated -## [4.0.1] - 2018-10-05 +## [4.0.1][4.0.1] - 2018-10-05 ### fixed - - **FABLE** adapted FABLE-specific configuration so that it works with MAgPIE 4.0 +- **FABLE** adapted FABLE-specific configuration so that it works with MAgPIE 4.0 -## [4.0.0] - 2018-10-04 +## [4.0.0][4.0.0] - 2018-10-04 First open source release of the framework. See [MAgPIE 4.0 paper](https://doi.org/10.5194/gmd-12-1299-2019) for more information. - [Unreleased]: https://github.com/magpiemodel/magpie/compare/v4.8.1...develop [4.8.1]: https://github.com/magpiemodel/magpie/compare/v4.8.0...v4.8.1 [4.8.0]: https://github.com/magpiemodel/magpie/compare/v4.7.3...v4.8.0 @@ -1044,5 +1105,4 @@ First open source release of the framework. See [MAgPIE 4.0 paper](https://doi.o [4.1.0]: https://github.com/magpiemodel/magpie/compare/v4.0.1...v4.1.0 [4.0.1]: https://github.com/magpiemodel/magpie/compare/v4.0...v4.0.1 [4.0.0]: https://github.com/magpiemodel/magpie/releases/tag/v4.0 - [REMIND model]: https://www.pik-potsdam.de/research/transformation-pathways/models/remind From 88503ba62c35096f9a95be19225166b26720342a Mon Sep 17 00:00:00 2001 From: Jake Tommey Date: Tue, 24 Sep 2024 14:10:17 +0200 Subject: [PATCH 014/206] merge master into develop --- .zenodo.json | 2 +- CHANGELOG.md | 15 +++++++++++++++ CITATION.cff | 2 +- 3 files changed, 17 insertions(+), 2 deletions(-) diff --git a/.zenodo.json b/.zenodo.json index b2f362ae35..35a98995c9 100644 --- a/.zenodo.json +++ b/.zenodo.json @@ -1,6 +1,6 @@ { "title": "MAgPIE - An Open Source land-use modeling framework", - "version": "4.8.2", + "version": "4.8.2dev", "creators": [ { "name": "Dietrich, Jan Philipp", diff --git a/CHANGELOG.md b/CHANGELOG.md index 566893809e..100fbbb5cf 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,21 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). +## [Unreleased] + +### changed +- + +### added +- + +### removed +- + +### fixed +- + + ## [4.8.2] - 2024-09-24 ### changed diff --git a/CITATION.cff b/CITATION.cff index 1b89aa711d..d33ccc484f 100644 --- a/CITATION.cff +++ b/CITATION.cff @@ -156,7 +156,7 @@ abstract: The *Model of Agricultural Production and its Impact on the Environmen exogenously given population in 10 food energy categories, based on regional diets. Future trends in food demand are derived from a cross-country regression analysis, based on future scenarios on GDP and population growth. -version: 4.8.2 +version: 4.8.2dev date-released: 2024-09-24 repository-code: https://github.com/magpiemodel/magpie keywords: From 62dfe6c9cb6c253f84fa4f25473b9672dd368deb Mon Sep 17 00:00:00 2001 From: florianh Date: Tue, 24 Sep 2024 15:17:20 +0200 Subject: [PATCH 015/206] GDP2017 input file update rev4.112 --- config/default.cfg | 8 ++++---- config/projects/scenario_config_el2.csv | 2 +- config/projects/scenario_config_fsec.csv | 6 +++--- config/scenario_config.csv | 2 +- scripts/start/projects/paper_peatlandTax.R | 10 +++++----- scripts/start/projects/project_ABCDR.R | 12 ++++++------ scripts/start/projects/project_EAT2p0.R | 2 +- 7 files changed, 21 insertions(+), 21 deletions(-) diff --git a/config/default.cfg b/config/default.cfg index 19548b4bba..9e39c88696 100644 --- a/config/default.cfg +++ b/config/default.cfg @@ -22,10 +22,10 @@ cfg$model <- "main.gms" #def = "main.gms" #### input settings #### # which input data sets should be used? -cfg$input <- c(regional = "rev4.112DC_GDP2017_h12_magpie.tgz", - cellular = "rev4.112DC_GDP2017_h12_fd712c0b_cellularmagpie_c200_MRI-ESM2-0-ssp370_lpjml-8e6c5eb1.tgz", - validation = "rev4.112DC_GDP2017_h12_magpie.tgz", - additional = "additional_data_rev4.53devGDP2017.tgz", +cfg$input <- c(regional = "rev4.112_h12_magpie.tgz", + cellular = "rev4.112_h12_fd712c0b_cellularmagpie_c200_MRI-ESM2-0-ssp370_lpjml-8e6c5eb1.tgz", + validation = "rev4.112_h12_magpie.tgz", + additional = "additional_data_rev4.54.tgz", calibration = "calibration_H12_26Mar24_fixed.tgz") # NOTE: It is recommended to recalibrate the model when changing cellular input data diff --git a/config/projects/scenario_config_el2.csv b/config/projects/scenario_config_el2.csv index a1f87bde9b..d8dc50c837 100644 --- a/config/projects/scenario_config_el2.csv +++ b/config/projects/scenario_config_el2.csv @@ -19,5 +19,5 @@ gms$s15_exo_alcohol;1;1;1 gms$s15_alc_scen;0;0;0 gms$factor_costs;sticky_labor;sticky_labor;sticky_labor gms$c70_feed_scen;ssp1;ssp2;ssp2 -input['cellular'];rev4.111EL2_h12_c6a7458f_cellularmagpie_c200_IPSL-CM6A-LR-ssp370_lpjml-8e6c5eb1.tgz;; +input['cellular'];rev4.112EL2_h12_c6a7458f_cellularmagpie_c200_IPSL-CM6A-LR-ssp370_lpjml-8e6c5eb1.tgz;; magicc_emis_scen;REMIND_generic_C_SSP2EU-DSPkB650-DS_betax_DeepDive_noNDC-rem-12.mif;REMIND_generic_C_SSP2EU-DSPkB650-DS_betax_DeepDive_noNDC-rem-12.mif;REMIND_generic_C_SSP2EU-DSPkB650-DS_betax_DeepDive_noNDC-rem-12.mif diff --git a/config/projects/scenario_config_fsec.csv b/config/projects/scenario_config_fsec.csv index f986caf4c6..8fb692e285 100644 --- a/config/projects/scenario_config_fsec.csv +++ b/config/projects/scenario_config_fsec.csv @@ -76,9 +76,9 @@ gms$s62_max_dem_bioplastic;0;;;;400;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; gms$c70_fac_req_regr;reg;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; gms$c70_feed_scen;;;;;;;;;;;;;;;;;;ssp1;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; gms$c73_build_demand;;;;;;;;;;;;;;;;;;;;;;;;50pc;;;;;;;;;;;;;;;;;;;;;;;;;;; -input['cellular'];rev4.111_FSEC_3c888fa5_cellularmagpie_c200_MRI-ESM2-0-ssp460_lpjml-8e6c5eb1.tgz;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;rev4.111_FSEC_0bd54110_cellularmagpie_c200_MRI-ESM2-0-ssp119_lpjml-8e6c5eb1.tgz;rev4.111_FSEC_6819938d_cellularmagpie_c200_MRI-ESM2-0-ssp126_lpjml-8e6c5eb1.tgz;;rev4.111_FSEC_1b5c3817_cellularmagpie_c200_MRI-ESM2-0-ssp245_lpjml-8e6c5eb1.tgz;rev4.111_FSEC_3c888fa5_cellularmagpie_c200_MRI-ESM2-0-ssp460_lpjml-8e6c5eb1.tgz;rev4.111_FSEC_fd712c0b_cellularmagpie_c200_MRI-ESM2-0-ssp370_lpjml-8e6c5eb1.tgz;rev4.111_FSEC_09a63995_cellularmagpie_c200_MRI-ESM2-0-ssp585_lpjml-8e6c5eb1.tgz;;; -input['regional'];rev4.111_FSEC_magpie.tgz;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -input['validation'];rev4.111_FSEC_validation.tgz;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +input['cellular'];rev4.112_FSEC_3c888fa5_cellularmagpie_c200_MRI-ESM2-0-ssp460_lpjml-8e6c5eb1.tgz;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;rev4.112_FSEC_0bd54110_cellularmagpie_c200_MRI-ESM2-0-ssp119_lpjml-8e6c5eb1.tgz;rev4.112_FSEC_6819938d_cellularmagpie_c200_MRI-ESM2-0-ssp126_lpjml-8e6c5eb1.tgz;;rev4.112_FSEC_1b5c3817_cellularmagpie_c200_MRI-ESM2-0-ssp245_lpjml-8e6c5eb1.tgz;rev4.112_FSEC_3c888fa5_cellularmagpie_c200_MRI-ESM2-0-ssp460_lpjml-8e6c5eb1.tgz;rev4.112_FSEC_fd712c0b_cellularmagpie_c200_MRI-ESM2-0-ssp370_lpjml-8e6c5eb1.tgz;rev4.112_FSEC_09a63995_cellularmagpie_c200_MRI-ESM2-0-ssp585_lpjml-8e6c5eb1.tgz;;; +input['regional'];rev4.112_FSEC_magpie.tgz;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +input['validation'];rev4.112_FSEC_validation.tgz;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; input['additional'];additional_data_rev4.51.tgz;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; input['calibration'];calibration_FSEC_26Mar24.tgz;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; magicc_emis_scen;bjoernAR6_C_SSP2-NDC.mif;;;bjoernAR6_C_SSP2-PkBudg900.mif;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;bjoernAR6_C_SSP1-NDC.mif;;;;;;;;;;;;bjoernAR6_C_RemSDP-900-MagSSP1.mif;; diff --git a/config/scenario_config.csv b/config/scenario_config.csv index afe1469f1b..bb43320836 100755 --- a/config/scenario_config.csv +++ b/config/scenario_config.csv @@ -74,4 +74,4 @@ gms$c60_biodem_level;;;;;;;;;;;;;;;;;1;0;;;;;;;;;;;; gms$c60_res_2ndgenBE_dem;;;;ssp1;ssp2;ssp2;ssp3;ssp4;ssp5;sdp;ssp2;sdp;sdp;;;;;;;;;;;;;;;;; gms$c70_feed_scen;;;;ssp1;ssp2;ssp2;ssp3;ssp4;ssp5;ssp1;ssp5;ssp1;ssp1;;;;;;;;;;;;;;;;; gms$s73_timber_demand_switch;;;;;;;;;;;;;;;;;;;;;;1;1;0;;;;;; -input['cellular'];;;;;;;;;;;;;;;;;;;;;;;;;rev4.111_h12_0bd54110_cellularmagpie_c200_MRI-ESM2-0-ssp119_lpjml-8e6c5eb1.tgz;rev4.111_h12_6819938d_cellularmagpie_c200_MRI-ESM2-0-ssp126_lpjml-8e6c5eb1.tgz;rev4.111_h12_1b5c3817_cellularmagpie_c200_MRI-ESM2-0-ssp245_lpjml-8e6c5eb1.tgz;rev4.111_h12_3c888fa5_cellularmagpie_c200_MRI-ESM2-0-ssp460_lpjml-8e6c5eb1.tgz;rev4.111_h12_fd712c0b_cellularmagpie_c200_MRI-ESM2-0-ssp370_lpjml-8e6c5eb1.tgz;rev4.111_h12_09a63995_cellularmagpie_c200_MRI-ESM2-0-ssp585_lpjml-8e6c5eb1.tgz +input['cellular'];;;;;;;;;;;;;;;;;;;;;;;;;rev4.112_h12_0bd54110_cellularmagpie_c200_MRI-ESM2-0-ssp119_lpjml-8e6c5eb1.tgz;rev4.112_h12_6819938d_cellularmagpie_c200_MRI-ESM2-0-ssp126_lpjml-8e6c5eb1.tgz;rev4.112_h12_1b5c3817_cellularmagpie_c200_MRI-ESM2-0-ssp245_lpjml-8e6c5eb1.tgz;rev4.112_h12_3c888fa5_cellularmagpie_c200_MRI-ESM2-0-ssp460_lpjml-8e6c5eb1.tgz;rev4.112_h12_fd712c0b_cellularmagpie_c200_MRI-ESM2-0-ssp370_lpjml-8e6c5eb1.tgz;rev4.112_h12_09a63995_cellularmagpie_c200_MRI-ESM2-0-ssp585_lpjml-8e6c5eb1.tgz diff --git a/scripts/start/projects/paper_peatlandTax.R b/scripts/start/projects/paper_peatlandTax.R index 91824915f5..f38e4a9b48 100644 --- a/scripts/start/projects/paper_peatlandTax.R +++ b/scripts/start/projects/paper_peatlandTax.R @@ -44,10 +44,10 @@ cfg$repositories <- append( getOption("magpie_repos") ) -cfg$input['regional'] <- "rev4.111_36f73207_magpie.tgz" -cfg$input['validation'] <- "rev4.111_36f73207_validation.tgz" +cfg$input['regional'] <- "rev4.112_36f73207_magpie.tgz" +cfg$input['validation'] <- "rev4.112_36f73207_validation.tgz" cfg$input['calibration'] <- "calibration_H16_14Jun24.tgz" -cfg$input['cellular'] <- "rev4.111_36f73207_44a213b6_cellularmagpie_c400_MRI-ESM2-0-ssp370_lpjml-8e6c5eb1_clusterweight-ba4466a8.tgz" +cfg$input['cellular'] <- "rev4.112_36f73207_44a213b6_cellularmagpie_c400_MRI-ESM2-0-ssp370_lpjml-8e6c5eb1_clusterweight-ba4466a8.tgz" download_and_update(cfg) ## Create patch file for GHG prices @@ -147,9 +147,9 @@ cfg$gms$s56_c_price_induced_aff <- 0 ## Start scenarios for (res in c("c400")) { if (res == "c400") - cfg$input['cellular'] <- "rev4.111_36f73207_44a213b6_cellularmagpie_c400_MRI-ESM2-0-ssp370_lpjml-8e6c5eb1_clusterweight-ba4466a8.tgz" + cfg$input['cellular'] <- "rev4.112_36f73207_44a213b6_cellularmagpie_c400_MRI-ESM2-0-ssp370_lpjml-8e6c5eb1_clusterweight-ba4466a8.tgz" else if (res == "c1000") { - cfg$input['cellular'] <- "rev4.111_36f73207_10f98ac1_cellularmagpie_c1000_MRI-ESM2-0-ssp370_lpjml-8e6c5eb1_clusterweight-ba4466a8.tgz" + cfg$input['cellular'] <- "rev4.112_36f73207_10f98ac1_cellularmagpie_c1000_MRI-ESM2-0-ssp370_lpjml-8e6c5eb1_clusterweight-ba4466a8.tgz" } ## Ref scenario cfg$title <- .title(cfg, paste(res, ssp, "Ref", sep = "-")) diff --git a/scripts/start/projects/project_ABCDR.R b/scripts/start/projects/project_ABCDR.R index 8b1480c537..2e016ab271 100644 --- a/scripts/start/projects/project_ABCDR.R +++ b/scripts/start/projects/project_ABCDR.R @@ -31,10 +31,10 @@ cfg$qos <- "standby_highMem_dayMax" .title <- function(cfg, ...) return(paste(cfg$info$flag, sep="_",...)) -cfg$input['regional'] <- "rev4.111_36f73207_magpie.tgz" -cfg$input['validation'] <- "rev4.111_36f73207_validation.tgz" +cfg$input['regional'] <- "rev4.112_36f73207_magpie.tgz" +cfg$input['validation'] <- "rev4.112_36f73207_validation.tgz" cfg$input['calibration'] <- "calibration_H16_14Jun24.tgz" -cfg$input['cellular'] <- "rev4.111_36f73207_44a213b6_cellularmagpie_c400_MRI-ESM2-0-ssp370_lpjml-8e6c5eb1_clusterweight-ba4466a8.tgz" +cfg$input['cellular'] <- "rev4.112_36f73207_44a213b6_cellularmagpie_c400_MRI-ESM2-0-ssp370_lpjml-8e6c5eb1_clusterweight-ba4466a8.tgz" ssp <- "SSP2" @@ -60,19 +60,19 @@ for (pol in c("NDC","1p5deg","1p5deg-Diet")) { cfg$title <- .title(cfg, paste(ssp,pol,paste0("AFS_tree_",sub("\\.","p",as.character(shr*100))),sep="-")) if (pol == "NDC") { cfg <- setScenario(cfg,c(ssp,"NDC","rcp4p5")) - cfg$input['cellular'] <- "rev4.111_36f73207_30c9dc61_cellularmagpie_c400_MRI-ESM2-0-ssp245_lpjml-8e6c5eb1_clusterweight-ba4466a8.tgz" + cfg$input['cellular'] <- "rev4.112_36f73207_30c9dc61_cellularmagpie_c400_MRI-ESM2-0-ssp245_lpjml-8e6c5eb1_clusterweight-ba4466a8.tgz" cfg$gms$c56_mute_ghgprices_until <- "y2150" cfg$gms$c56_pollutant_prices <- paste0("R32M46-", if (ssp=="SSP2") "SSP2EU" else ssp,"-NDC") cfg$gms$c60_2ndgen_biodem <- paste0("R32M46-", if (ssp=="SSP2") "SSP2EU" else ssp,"-NDC") } else if (pol == "1p5deg") { cfg <- setScenario(cfg,c(ssp,"NDC","rcp1p9")) - cfg$input['cellular'] <- "rev4.111_36f73207_bc624950_cellularmagpie_c400_MRI-ESM2-0-ssp119_lpjml-8e6c5eb1_clusterweight-ba4466a8.tgz" + cfg$input['cellular'] <- "rev4.112_36f73207_bc624950_cellularmagpie_c400_MRI-ESM2-0-ssp119_lpjml-8e6c5eb1_clusterweight-ba4466a8.tgz" cfg$gms$c56_mute_ghgprices_until <- "y2030" cfg$gms$c56_pollutant_prices <- paste0("R32M46-", if (ssp=="SSP2") "SSP2EU" else ssp,"-PkBudg650") cfg$gms$c60_2ndgen_biodem <- paste0("R32M46-", if (ssp=="SSP2") "SSP2EU" else ssp,"-PkBudg650") } else if (pol == "1p5deg-Diet") { cfg <- setScenario(cfg,c(ssp,"NDC","rcp1p9","eat_lancet_diet_v1")) - cfg$input['cellular'] <- "rev4.111_36f73207_bc624950_cellularmagpie_c400_MRI-ESM2-0-ssp119_lpjml-8e6c5eb1_clusterweight-ba4466a8.tgz" + cfg$input['cellular'] <- "rev4.112_36f73207_bc624950_cellularmagpie_c400_MRI-ESM2-0-ssp119_lpjml-8e6c5eb1_clusterweight-ba4466a8.tgz" cfg$gms$c56_mute_ghgprices_until <- "y2030" cfg$gms$c56_pollutant_prices <- paste0("R32M46-", if (ssp=="SSP2") "SSP2EU" else ssp,"-PkBudg650") cfg$gms$c60_2ndgen_biodem <- paste0("R32M46-", if (ssp=="SSP2") "SSP2EU" else ssp,"-PkBudg650") diff --git a/scripts/start/projects/project_EAT2p0.R b/scripts/start/projects/project_EAT2p0.R index 83c759c07b..ae7c3e06c8 100644 --- a/scripts/start/projects/project_EAT2p0.R +++ b/scripts/start/projects/project_EAT2p0.R @@ -90,7 +90,7 @@ bau <- function(cfg) { cfg$gms$c60_2ndgen_biodem <- "R21M42-SSP2-NPi" # default # Climate Change - cfg$input["cellular"] <- "rev4.111EL2_h12_c6a7458f_cellularmagpie_c200_IPSL-CM6A-LR-ssp370_lpjml-8e6c5eb1.tgz" + cfg$input["cellular"] <- "rev4.112EL2_h12_c6a7458f_cellularmagpie_c200_IPSL-CM6A-LR-ssp370_lpjml-8e6c5eb1.tgz" return(cfg) } From 50aaaddb6efef07ec24e5de33be71b91905d32ad Mon Sep 17 00:00:00 2001 From: Singh Date: Tue, 24 Sep 2024 20:01:20 +0530 Subject: [PATCH 016/206] Edited changelog --- CHANGELOG.md | 2 +- main.gms | 16 ++++++++-------- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index e36ae321d7..1e7a16f24f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,7 +3,7 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). -## [Unreleased][Unreleased] +## [Unreleased] ### changed diff --git a/main.gms b/main.gms index 6817d2533d..e8f0d20e67 100644 --- a/main.gms +++ b/main.gms @@ -148,23 +148,23 @@ $title magpie *##################### R SECTION START (VERSION INFO) ########################## * -* Used data set: rev4.109_h12_magpie.tgz +* Used data set: rev4.111_h12_magpie.tgz * md5sum: NA * Repository: https://rse.pik-potsdam.de/data/magpie/public * -* Used data set: rev4.109_h12_fd712c0b_cellularmagpie_c200_MRI-ESM2-0-ssp370_lpjml-8e6c5eb1.tgz +* Used data set: rev4.111_h12_fd712c0b_cellularmagpie_c200_MRI-ESM2-0-ssp370_lpjml-8e6c5eb1.tgz * md5sum: NA * Repository: https://rse.pik-potsdam.de/data/magpie/public * -* Used data set: rev4.109_h12_validation.tgz +* Used data set: rev4.111_h12_validation.tgz * md5sum: NA * Repository: https://rse.pik-potsdam.de/data/magpie/public * -* Used data set: additional_data_rev4.51.tgz +* Used data set: additional_data_rev4.53.tgz * md5sum: NA * Repository: https://rse.pik-potsdam.de/data/magpie/public * -* Used data set: calibration_H12_26Mar24.tgz +* Used data set: calibration_H12_26Mar24_fixed.tgz * md5sum: NA * Repository: https://rse.pik-potsdam.de/data/magpie/public * @@ -179,11 +179,11 @@ $title magpie * * Regionscode: 62eff8f7 * -* Regions data revision: 4.109 +* Regions data revision: 4.111 * * lpj2magpie settings: * * LPJmL data: MRI-ESM2-0:ssp370 -* * Revision: 4.109 +* * Revision: 4.111 * * aggregation settings: * * Input resolution: 0.5 @@ -195,7 +195,7 @@ $title magpie * * Call: withCallingHandlers(expr, message = messageHandler, warning = warningHandler, error = errorHandler) * * -* Last modification (input data): Fri Sep 6 16:05:34 2024 +* Last modification (input data): Tue Sep 24 17:20:08 2024 * *###################### R SECTION END (VERSION INFO) ########################### From 7e22298fec109dfb55188625cdfe09625a792cc0 Mon Sep 17 00:00:00 2001 From: florianh Date: Tue, 24 Sep 2024 17:20:08 +0200 Subject: [PATCH 017/206] count-up start script --- scripts/start/projects/paper_peatlandTax.R | 2 +- scripts/start/projects/project_ABCDR.R | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/start/projects/paper_peatlandTax.R b/scripts/start/projects/paper_peatlandTax.R index f38e4a9b48..2d607939a6 100644 --- a/scripts/start/projects/paper_peatlandTax.R +++ b/scripts/start/projects/paper_peatlandTax.R @@ -23,7 +23,7 @@ source("scripts/start_functions.R") source("config/default.cfg") # create additional information to describe the runs -cfg$info$flag <- "PTax24" +cfg$info$flag <- "PTax25" cfg$results_folder <- "output/:title:" cfg$results_folder_highres <- "output" diff --git a/scripts/start/projects/project_ABCDR.R b/scripts/start/projects/project_ABCDR.R index 2e016ab271..e296416e38 100644 --- a/scripts/start/projects/project_ABCDR.R +++ b/scripts/start/projects/project_ABCDR.R @@ -19,7 +19,7 @@ source("config/default.cfg") #download_and_update(cfg) # create additional information to describe the runs -cfg$info$flag <- "ABCDR08" +cfg$info$flag <- "ABCDR09" cfg$results_folder <- "output/:title:" cfg$force_replace <- TRUE From 6b932275268a8b9b457310d27660a32b18cbe2dd Mon Sep 17 00:00:00 2001 From: florianh Date: Tue, 24 Sep 2024 17:33:22 +0200 Subject: [PATCH 018/206] bugfix --- modules/70_livestock/fbask_jan16_sticky/presolve.gms | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/modules/70_livestock/fbask_jan16_sticky/presolve.gms b/modules/70_livestock/fbask_jan16_sticky/presolve.gms index 020e7eb26d..b0f81f8b02 100644 --- a/modules/70_livestock/fbask_jan16_sticky/presolve.gms +++ b/modules/70_livestock/fbask_jan16_sticky/presolve.gms @@ -55,14 +55,14 @@ else *' @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) * fm_gdp_defl_ppp)))+f70_cap_share_reg("intercept")); +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) * fm_gdp_defl_ppp(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) * fm_gdp_defl_ppp))))+f70_cap_share_reg("intercept")+p70_cost_share_calibration(i); + 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) * fm_gdp_defl_ppp(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"); ); From e7eb67c7339b2e66d312c8555b46787178b26e5d Mon Sep 17 00:00:00 2001 From: Singh Date: Wed, 25 Sep 2024 09:27:45 +0530 Subject: [PATCH 019/206] Fixed gti conflict in Changelog --- CHANGELOG.md | 379 ++++++++++++++++++++++----------------------------- 1 file changed, 162 insertions(+), 217 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 1e7a16f24f..bd2b5718a3 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,57 +6,60 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). ## [Unreleased] ### changed +- **11_costs** changed equation to fix bug in total water cost calculation -- **config** The default realization for the 38_factor_costs module was switched to `sticky_feb18`. In this realization, capital stocks and their depreciation are tracked, giving some inertia to random relocation of production, improving high resolution outputs. -- **21_trade** refactor equations for enhanced readablility and improve documentation -- **scripts** rewrite of merge_report.R based on rds files and rbind, which allows for more flexibility when merging reports. Avoid inconsistent use of "GLO" instead of "World" in report.rds files. + + +## [4.8.2] - 2024-09-24 + +### changed - **15_food** revision of MP/SCP implementation for milk and meat alternatives. Added demand for fat and sugar as ingredients for MP-based milk alternatives. Added optional demand for fat as ingredient for MP-based meat alternatives. -- **script** scripts/start_functions.R decide individually for demand and price whether they are read from a REMIND report. +- **21_trade** refactor equations for enhanced readablility and improve documentation +- **29_cropland** added option for linear and sigmoidal faders +- **32_forestry** Interfaces `vm_landexpansion_forestry` and `vm_landreduction_forestry` have been corrected by harvested and replanted timber plantation area +- **58_peatland** variable `v58_scalingFactorExp` converted into parameter `p58_scalingFactorExp` to avoid infeasibilites. `p58_scalingFactorRed` has been revised. - **80_optimization** abort GAMS in case of execution errors, added threads = 1 as default to avoid infeasibilites and Flg_NoDefc = TRUE as option +- **config** `cfg$gms$land_snv`changed from "secdforest, forestry, past, other" to "secdforest, other" +- **config** additional data update additional_data_rev4.53.tgz - **config** default settings for 58_peatland revised -- **58_peatland** variable `v58_scalingFactorExp` converted into parameter `p58_scalingFactorExp` to avoid infeasibilites. `p58_scalingFactorRed` has been revised. -- **32_forestry** Interfaces `vm_landexpansion_forestry` and `vm_landreduction_forestry` have been corrected by harvested and replanted timber plantation area -- **script** updated EATLancet project start scripts -- **script** replaced gdx package with gdx2 package calls -- **config** split scenario_config into project-specific configs - **config** initial treecover on cropland starts from zero -- **config** additional data update additional_data_rev4.53.tgz -- **29_cropland** added option for linear and sigmoidal faders -- **scripts** output/extra/highres.R use default 13_tc realization -- **scripts** `.nc` files are no longer created by default after disaggregation -- **config** `cfg$gms$land_snv`changed from "secdforest, forestry, past, other" to "secdforest, other" +- **config** split scenario_config into project-specific configs - **config** Submissions with high memory requirements now get 16 CPUs and 80GB of memory to account for the new specifications of PIK's new HPC 'Foote'. `maxMem` was renamed to `highMem`, because 80GB of memory does not correspond to the maximum available memory of a compute node. -- **11_costs** changed equation to fix bug in total water cost calculation +- **config** The default realization for the 38_factor_costs module was switched to `sticky_feb18`. In this realization, capital stocks and their depreciation are tracked, giving some inertia to random relocation of production, improving high resolution outputs. +- **script** replaced gdx package with gdx2 package calls +- **script** scripts/start_functions.R decide individually for demand and price whether they are read from a REMIND report. +- **script** updated EATLancet project start scripts +- **scripts** `.nc` files are no longer created by default after disaggregation +- **scripts** output/extra/highres.R use default 13_tc realization +- **scripts** rewrite of merge_report.R based on rds files and rbind, which allows for more flexibility when merging reports. Avoid inconsistent use of "GLO" instead of "World" in report.rds files. -### added -- **scripts** added output script converting all grid-level .mz files to .nc (netCDF) -- **scripts** added output report `EU_report.R` that uses `EU_report.Rmd` -- **scripts** added out of bounds check as output script -- **70_livestock** added realization `fbask_jan16_sticky` -- **script** check of variables needed in piamInterfaces in report_rds.R +### added - **42_water_demand** added water abstraction type dimension for non-ag uses - **56_ghg_policy** added optional temporal and regional fader for GHG emission pricing policy +- **70_livestock** added realization `fbask_jan16_sticky` +- **config** added `scenario_config_year_fix.csv` for choosing until when parameters are fixed to SSP2 values - **cropland** added option for discarding initial treecover on cropland - **script** added output script for conversion of validation.mif file into validation.rds +- **script** check of variables needed in piamInterfaces in report_rds.R - **script** for downscaling to 0.25 deg using LUH2v2h as reference via mrdownscale -- **config** added `scenario_config_year_fix.csv` for choosing until when parameters are fixed to SSP2 values -- **scripts** added start script for 'Healthly Landscapes' paper `paper_healthyLscps.R` +- **scripts** added out of bounds check as output script +- **scripts** added output report `EU_report.R` that uses `EU_report.Rmd` +- **scripts** added output script converting all grid-level .mz files to .nc (netCDF) - **scripts** added script for automatic submission of SEALS allocation runs `./extra/runSEALSallocation.R` +- **scripts** added start script for 'Healthly Landscapes' paper `paper_healthyLscps.R` -### removed ### fixed - -- **scripts** fixing an error in start.R and output.R which occurred if more than one slurm job was submitted at the same time. - **15_food** fixing parameter declaration of i15_processed_kcal_structure_iso -- **80_optimization** bugfix for variables levels not obeying the bounds in nlp_par, `conopt` changed to `conopt3` - **35_natveg** bugfix secdforest and other land restoration to avoid double-counting of restoration in equation `q29_land_snv` +- **80_optimization** bugfix for variables levels not obeying the bounds in nlp_par, `conopt` changed to `conopt3` +- **scripts** fixing an error in start.R and output.R which occurred if more than one slurm job was submitted at the same time. -## [4.8.1][4.8.1] - 2024-06-19 -### changed +## [4.8.1] - 2024-06-19 +### changed - **29_ageclass** module 29_ageclass has been renamed to 28_ageclass to make space for `29_cropland` just before `30_croparea` - **30_crop** module `30_crop` renamed to `30_croparea`, which now only accounts for crop area. - **30_crop** Semi-Natural Vegetation (SNV) implementation has been moved from `30_crop` to `29_cropland` @@ -67,27 +70,25 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). - **scripts** updated EL2p0 start scripts ### added - - **10_land** added interface `pm_land_hist` with historic land use patterns - **29_cropland** new module `29_cropland` accounting for crop area, fallow cropland and tree cover on cropland with two realizations: `detail_apr24` and `simple_apr24` (default). - **42_water_demand** added non-agricultural water demand for entire year ### removed - - **32_forestry** removed technical balance term `v32_land_missing_ndc` ### fixed - - **22_land_conservation** avoid infeasibilities due to very small numbers, account for cropland tree cover and lower bound of cropland - **32_forestry** avoid infeasibilities due to very small numbers - **35_natveg** avoid infeasibilities due to very small numbers - **44_biodiversity** Fixing to SSP2 parameters until 2025 was not working - **config** update to input data rev4.109. In the previous rev4.108, MER GDP was wrong and was identical to PPP GDP -## [4.8.0][4.8.0] - 2024-06-10 -### changed +## [4.8.0] - 2024-06-10 + +### changed - **14_yields** revised timber yield calculations - **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 - **22_land_conservation and default.cfg** Added options for baseline protection @@ -107,7 +108,6 @@ 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 - - **15_food** added additional sigmoid food substition scenarios `sigmoid_75pc_25_50`, `sigmoid_50pc_25_50` and `sigmoid_25pc_25_50` - **21_trade** Minimum trade margin for forestry products `s21_min_trade_margin_forestry` - **30_crop** added regional cropland equation `q30_crop_reg` and presolve growth constraint @@ -124,10 +124,9 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). - **scripts** added "checkSummation" output script for consistency checking a report.mif - **scripts** added automatic set writer for new bioenergy realization to `start_functions` - **scripts** added start scripts for the GENIE project - `s60_bioenergy_price_2nd`, `c60_price_implementation` +`s60_bioenergy_price_2nd`, `c60_price_implementation` ### removed - - **14_yields** removed interface `pm_timber_yield_initial` - **21_trade** removed interface `pm_selfsuff_ext`, removed `v21_manna_from_heaven` - **32_forestry** removed interface `pm_representative_rotation` @@ -138,7 +137,6 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). - **scripts/output/extra** removed scripts disaggregation_cropsplit and disaggregation_transitions ### fixed - - **14_yields** fix division by zero in preloop of managementcalib_aug19 - **44_biodiversity** avoid division by zero - **58_peatland** Added balance variable to avoid random infeasibilites @@ -149,10 +147,10 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). - **scripts/start/test_runs.R** include all default output script, in particular disaggregation.R, which is needed for BII - **start/projects/fsec.R** scenario settings -## [4.7.3][4.7.3] - 2024-04-12 -### changed +## [4.7.3] - 2024-04-12 +### changed - **21_trade** Revision of trade module. Replaced `cfg$gms$s21_trade_bal_damper` in favour of `cfg$gms$k_import21`, which allows for additional imports to maintain feasibility - **21_trade** v21_import_for_feasibility now available for all countries, not just for importers - **70_livestock** if `c70_fac_req_regr` is set to `reg`: use of USDA/FAO values for historic factor requirements for livestock instead of using regression values and change of calibration year from 2005 to 2010 for regional factor requirements regression @@ -163,7 +161,6 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). - **scripts/calibration/landconversion_cost.R** Revised calibration approach for conversion costs for cropland. Information from all calibration time steps in combination with a lowpass filter is now used for deriving the calibration factors, which avoids the previous zickzack pattern. The previous option `cfg$damping_factor_landconversion_cost` has been removed in favor of `cfg$lowpass_filter_landconversion_cost`. ### added - - **14_yields** added minimum threshold for wood yields. Below this threshold, wood yields are set to zero. - **config** added switch for minimum timber yields - **56_ghg_policy** added NDC scenarios @@ -171,17 +168,16 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). - **scripts** start script for EAT2p0 Deep Dive project ### fixed - - **15_food** Small number rather 0 in condition checking calorie balancing - **34_urban** `static` realization was not working because `vm_carbon_stock` was referenced without the set `stockType` - **52_carbon** removing jump of carbon content into fully grown forest when a forest changes from second-last age class to last age-class. - **58_peatland** Equation `q58_scalingFactorExp` revised to avoid division by zero. - **80_optimization** duplicated solve statement in all instances to avoid non-matchting left- and right-hand sides of equations -## [4.7.2][4.7.2] - 2024-04-02 -### changed +## [4.7.2] - 2024-04-02 +### changed - **21_trade** Revision of trade module. Replaced `cfg$gms$s21_trade_bal_damper` in favour of `cfg$gms$k_import21`, which allows for additional imports to maintain feasibility - **58_peatland** Threshold in equations changed from 1e-10 to 1e-8 to avoid rare divisions by zero - **70_livestock** if `c70_fac_req_regr` is set to `reg`: use of USDA/FAO values for historic factor requirements for livestock instead of using regression values and change of calibration year from 2005 to 2010 for regional factor requirements regression @@ -189,25 +185,22 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). - **scripts** modified output reporting for SEALS to account for forestry plantations ### added - - **30_crop** Improved representation of cropland requiring relocation in response to introducing semi-natural habitat at the 1 km level based on high-resolution satellite imagery. - **config** added `.codeCheck` with additonal configuration when running `gms::codeCheck` - **scripts** add additional BII reporting variables in FSDP_collect.R - **scripts** added a new validation_cell.R output script that generates a pdf with the comparison of magpie land use and crop type outputs with LUH and MAPSPAM historical data at cellular resolution. ### removed - - **core** removed no longer needed set `si` Suitability classes ### fixed - - **52_carbon** i52_land_carbon_sink was not identical before 2020 for different RCPs. Fixed by setting to RCPBU until the year defined in sm_fix_cc. - **inputdata** currency fixed in historic value of production for crops and livestock which affects e.g. total labor costs and in turn hourly labor costs, bugfix in aggregation weight of capital cost share out of factor costs -## [4.7.1][4.7.1] - 2024-02-28 -### changed +## [4.7.1] - 2024-02-28 +### changed - **15_food** Added improved EAT Lancet diet implementation (EAT 2p0) - **21_trade** s21_trade_bal_damper for roundwood changed from 0.75 to 0.65 - **31_past** in grasslands_apr22 realization: changed structure of f31_pastr_suitability to align with ssp-rcp specific input data formulation. Changed input filename from cs3 to cs2. Added `cc`, `nocc` and `nocc_hist` options for `i31_manpast_suit` and changed input gams code from table to parameter. Climate scenario assignment moved from preloop.gms to input.gms. Removed pastSuit set in sets.gms as not needed anymore. Adjusted not_used.txt in both grasslands_apr22 and static realizations. @@ -223,19 +216,16 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). - **start_functions** Check if cfg$recalibrate is consistent with cfg$gms$s14_use_yield_calib ### added - - **32_forestry** new interfaces `vm_land_forestry`, `pcm_land_forestry` `vm_landexpansion_forestry` and `vm_landreduction_forestry` - **56_ghg_policy_** added new trajectories for R32M46 - **60_bioenergy** added new trajectories for R32M46 - **scripts** added peatland to output/extra/disaggregation.R ### removed - - **58_peatland** removed realization "on" - **default.cfg** Removed description of cfg$gms$c31_past_suit_scen since no longer needed due to changes in 31_past described below. Its function is now done by cfg$gms$c31_grassl_yld_scenario. ### fixed - - **21_trade** introduced s21_manna_from_heaven for fixing v21_manna_from_heaven to zero. Without fixing to zero, v21_manna_from_heaven was used unnecessarily in runs started with highres.R - **32_forestry** bugfix unit p32_observed_gs_reg - **32_forestry** keep c-density for timber plantations constant after rotation length to avoid unrealistic carbon sequestration in unharvested timber plantation @@ -248,10 +238,10 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). - **scripts** fixed memory spike leading to crashes in disaggregation.R - **scripts** fixed writing of NetCDF files in output/reportMAgPIE2SEALS.R -## [4.7.0][4.7.0] - 2023-12-11 -### changed +## [4.7.0] - 2023-12-11 +### changed - **14_yields_and_config** The new default is to not use yield calibration factors from a calibration run. The switch s14_use_yield_calib can optionally reenable the use of yield calibration factors. - **36_employment** regression between hourly labor regression and GDP pc changed from linear to log-log - **inputdata** Now using inputdata rev4.94 which is based on 67420 cells (67k, previously 59k) @@ -259,61 +249,56 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). - **scripts** LUH2_disaggregation output script was modified. Specifically, flooded area was made compatible with the LUH definition, cropland and grazing land were added to the states.nc file, and specific naming/details (datatype, zname, xname, and yname) were added when creating the .nc files. ### added - - **14_yields/config** Added option for considering impacts of land degradation on yields. If `s14_degradation` is switched to 1, MAgPIE will include cluster-specific information on the state of nature's contributions to people relevant for yields `./modules/14_yields/input/f14_yld_ncp_report.cs3`. - **18_residues** Included cluster-level residue realization, for cluster-level production of residues (but balancing of recycling and burning budgets remains at region-level, for computational lightness) - **32_forestry** new interface `vm_land_forestry` - **58_peatland** added realization "v2" with updated peatland map and GHG emission factors ### fixed - - **inputdata** There was a major bug (related to proj/terra) in the rev4.91 inputdata that was fixed with rev4.92 - **inputdata** There was another bug (terra default na.rm changed) in the inputdata that was fixed with rev4.93 - **scripts** Fixed a bug in NPI/NDC calculations leading to missing AD policies when run with 67k -## [4.6.11][4.6.11] - 2023-09-05 -### changed +## [4.6.11] - 2023-09-05 +### changed - **scripts** All time steps between 2015 and 2050 are now reported to SEALS ### fixed - - **70_livestock** fixed division by zero that could occur depending on the scenario set-up -## [4.6.10][4.6.10] - 2023-08-16 -### changed +## [4.6.10] - 2023-08-16 +### changed - **config** update preprocessing to newest input data v4.88 with new transport costs - **GitHub action** the github action is now faster, because it installs binary packages from Posit Package Manager - **scenario_config.csv** update preprocessing to newest input data v4.88 - **scripts** output.R is now faster, because it no longer searches runfolder renvs for full.gms files ### fixed - - **scripts** check_config does not warn about c_input_gdx_path anymore while running empty model - **scripts** fixed erronoeous if clause in output.R - **scripts** fixed output/extra/disaggregation_LUH2.R. The script was not working any more because magpie4::protectedArea was changed to return protected area for all land types. Moreover, the script now also works for runs without dynamic forestry (default run) but with a warning message. -## [4.6.9][4.6.9] - 2023-07-27 -### fixed +## [4.6.9] - 2023-07-27 +### fixed - **70_livestock** consideration of milk demand in the calculation of the pasture management factor - **scripts** Fixed inaccuracies and inconsistent application of SNV policies during disaggregation in luscale::interpolateAvlCroplandWeighted(), which is called in extra/disaggregation.R -## [4.6.8][4.6.8] - 2023-07-17 -### changed +## [4.6.8] - 2023-07-17 +### changed - **41_area_equipped_for_irrigation** new AEI data (Mehta2022) replacing old Siebert data - **80_optimization** printing of solprint when solver status is 7 re-activated - **scripts** start_functions.R can now handle clusters per region flexibly - **scripts** the REMIND-MAgPIE coupling now uses renv ### added - - **31_past** added `cc`, `nocc` and `nocc_hist` options for `c31_past_suit_scen` and `c31_grassl_yld_scenario` - **32_carbon** added `nocc` and `nocc_hist` option for `c52_land_carbon_sink_rcp` - **71_disagg_lvst** added new realisation `foragebased_jul23` which solves GAMS issues at higher spatial resolutions @@ -323,22 +308,20 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). - **scripts** New output script for reporting disaggregated land use patterns to the SEALS (Spatial Economic Allocation Landscape Simulator) downscaling model ### removed - - **config** `s80_num_nonopt_allowed` - **scripts** removed .snapshot.Rprofile and the Rprofile.R script, renv now fully supersedes snapshots ### fixed - - **30_crop** corrected q30_cropland in module realization rotation_apr22, where fallow land was on the wrong side of the equation - **71_disagg_lvst** reworked `foragebased_aug18` (including removal of linear version and correction of balance flow calculation) - **80_optimization** resolve was not working in nlp_par realization due to `s80_num_nonopt_allowed` - **config** corrected wrong names of parameters for peatland costs - **config** updated scenario configs to newest preprocessing (4.87) -## [4.6.7][4.6.7] - 2023-05-10 -### changed +## [4.6.7] - 2023-05-10 +### changed - **09_drivers** Harmonization of sets for population, gdp, pal and demography - **56_ghg_policy** added emission policies without GHG emissions from peatlands - **config** added scenario `SSP2EU` in scenario_config.csv @@ -349,21 +332,20 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). - **scripts** NDC/NPI calculations can now handle 59k and 67k cell inputs ### added - - **15_food** added an option in `s15_exo_diet` to allow for exogenous diet scenario for India -## [4.6.6][4.6.6] - 2023-05-10 -### changed +## [4.6.6] - 2023-05-10 +### changed - **config** updated scenario_fsec.csv to reflect new GST validation - **scripts** included new output indicator for water - **scripts** updated global surface temperature maps to new RCPs per scenario -## [4.6.5][4.6.5] - 2023-03-29 -### changed +## [4.6.5] - 2023-03-29 +### changed - **22_land_conservation** Replaced old options for land conservation by new conservation priority areas. These include among others a new 30by30 template (based on Key Biodiversity Areas, unprotected habitat in Biodiversity Hotspots, Ecoregions with a high beta-diversity from the Global Safety Net (Dinerstein et al. 2020) and critical connectivity areas (Brennan et al. 2022), a new Half Earth template based on the Global Safety Net (Dinerstein et al. 2020) and land conservation of irrecoverable carbon (Noon et al. 2022). - **56_ghg_policy** renamed `cfg$mute_ghgprices_until` to `cfg$gms$c56_mute_ghgprices_until` and changed the default to `y2030`, i.e. no GHG emission pricing in the AFOLU sector before (and including) 2030. This setting will be also used in coupled REMIND-MAgPIE runs. - **config** input data revision to rev4.82 to include new conservation priority areas @@ -373,26 +355,23 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). - **scripts** Disaggregation of land use to 0.5° now takes land conservation into account - i.e. cropland expansion is not mapped to areas that are subject to land conservation ### added - - **56_ghg_policy** added switch `s56_minimum_cprice` - **config** minimum CO2 price (`s56_minimum_cprice`) of 5 USD per tCO2 (18 USD per tC) for all future time steps in case of NDC policy to guide land-use decisions - **scripts** added output script which writes landuse data on cluster resolution to a shapefile ### removed - - **56_ghg_policy** removed `s56_ghgprice_phase_in` and `s56_ghgprice_start` - **scripts** removed argument `mute_ghgprices_until`, now handeld in GAMS code ### fixed - - **31_past** fixed pasture suitability to SSP2 before and including 2020 (only relevant for grassland implementation) - **56_ghg_policy** the renamed switch `c56_mute_ghgprices_until` is now always used for coupled as well as standalone runs. - **scripts** Fixed occasional memory failure in the disaggregation script -## [4.6.4][4.6.4] - 2023-02-22 -### changed +## [4.6.4] - 2023-02-22 +### changed - **15_food** Interpret EAT-Lancet guidelines not as target but as lower/upper limits - **config** changed order of output scripts. Some functions in rds_report require gridded outputs. - **config** input data revision to rev4.81 for trade margin bugfix @@ -407,7 +386,6 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). - **sticky_labor** renamed equation `q38_labor_capital_ratio` to `q38_labor_share_target` ### added - - **15_food** half_overweight scenario added - **21_trade** New Bilateral trade realization selfsuff_reduced_bilat22 for bilateral trade within selffsuff constraints - **32_forestry** added switch `s32_aff_prot` for protection of afforested areas (0=until end of planning horizon 1=forever) @@ -420,11 +398,9 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). - **sticky_labor** `nl_fix`, `nl_relax` and `nl_release` added ### removed - - **42_water_demand** removed fm_multicropping factor because of fallow inconsistency ### fixed - - **14_yields** nl_fix updated to current equation - **32_forestry** pm_land_conservation(t,j,"secdforest","restore") now accounts for the rotation length in timber plantations to avoid infeasibilities - **44_biodiversity** added regional layer `i` in `bii_target` realisation to make it compatible with the high-resolution parallel optimization output script @@ -432,10 +408,10 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). - **scripts** fixed a bug where renvs for high resolution runs were missing some packages - **scripts** fixed in the calc_calib.R script the saving of calib_factors used in each iteration to ensure that they correspond to the divergence reported. Changed divergence from zero to NA for those iterations where calib_factors are above the limit. The best_calib selection criterion was changed from selecting the factors of the iteration with the lowest standard deviation to the selection, for each region, of the factor of the iteration with the lowest divergence. Also, factors from the first iteration are now not considered, and if two different factors had the same divergence for a region, the one of the latest iteration is picked. -## [4.6.3][4.6.3] - 2023-01-19 -### changed +## [4.6.3] - 2023-01-19 +### changed - **15_food** changed `anthro_iso_jun22` realisation such that results in case of `exo_diet = 1/0` and `exo_waste = 1/0` are identical until 2020 - **30_crop** identical assumptions for bioenergy until 2020 - **38_factor_costs** changed name of set `req` to `factors` (also used in 11_costs, 57_maccs, 70_livestock) @@ -446,19 +422,17 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). - **config** update input data to rev4.79 ### added - - **31_past** added additional limitation (single climate scenario input) for **grasslands_apr22** - **59_som** added new **cellpool_jan23** realization with updated 2019 IPCC guidelines values - **scripts** added start script which starts an empty model just regenerating a previous run ### fixed - - **scripts** make sure that `c_title` in the GAMS code is not containing dots which otherwise could lead to compilation errors -## [4.6.2][4.6.2] - 2023-01-12 -### changed +## [4.6.2] - 2023-01-12 +### changed - **36_employment** include labor costs from MACCs in employment - **38_factor_cots** renamed `p36_cost_shares` to `pm_cost_share_crops` - **57_maccs** split costs into labor and capital @@ -467,16 +441,15 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). - **scripts** FSDP_collect FSDP_process fsec.R updates ### added - - **renv** MAgPIE now runs in an isolated, stable, reproducible R package environment - **scripts** added output script that generates a short mif containing only variables relevant for the REMIND coupling - **scripts** added output script that generates subnational validation outputs for fable_India projects - **setup** required R packages are automatically installed -## [4.6.1][4.6.1] - 2022-12-13 -### changed +## [4.6.1] - 2022-12-13 +### changed - **42_water_demand** replaced `f42_env_flow_policy` with macro - **30_crop** replaced `f30_scenario_fader` with macro - **30_crop/config** changed switch `c30_rotation_scenario_speed` to `s30_rotation_scenario_target` @@ -484,7 +457,6 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). - **config** changed default value for `c30_marginal_land` from `'all_marginal'` to `'q33_marginal'` for better spatial cropland patterns ### added - - **10_land** added `vm_lu_transitions` as interface - **10_land** added interface `fm_land_iso` for consistency - **30_crop/config** added switch `s30_rotation_scenario_start` @@ -493,7 +465,6 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). - **39_landconversion** scalar `s39_reward_crop_reduction` provides a cropland reduction reward ### removed - - **10_land** removed `feb15` realization - **10_land** removed the interfaces `vm_croplandexpansion` and `vm_croplandreduction` - **30_crop** removed `f30_scenario_fader.csv`input @@ -502,15 +473,14 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). - **scripts** removed remind2::deletePlus in coupling interface of start_function ### fixed - - **59_som** fixed land use change tracking for non-cropland pools in the `cellpool_aug16` realization - **config** changed default value for s56_limit_ch4_n2o_price from 1000 to 4000 for consistency with c57_macc_version = "PBL_2022" - **scripts** rewrite of land conversion cost calibration script `landconversion_cost.R` -## [4.6.0][4.6.0] - 2022-11-09 -### changed +## [4.6.0] - 2022-11-09 +### changed - **18_residues** bugfix in `q18_cost_prod_res` - **36_employment** included calculations for minimum wage scenario - **38_factor_costs** included labor cost scaling in case of wage scenario @@ -547,7 +517,6 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). - **scripts/start** cleanup of old start scripts ### added - - **14_yields** added input file containing AQUASTAT yield calibration factors and switch `s14_calib_ir2rf` in default.cfg to activate this yield calibration - **15_food** added new realization with country level exogenous diets, product-specific intake estimates, new scenarios for exogenous BMI and decomposition switches for EAT Lancet diets. Simplified code and improved iteration procedure. - **50_nr_soil_budget** new module realization for more consistent MACCs implementation. change of interface from vm_btm_reg to vm_emissions_reg @@ -569,7 +538,6 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). - **scripts** added water output script for FSEC model runs ### removed - - **15_food** removed read-in of non-needed input file "f15_calib_factor_FAOfsupply_iso" - **38_factor_costs** removed `mixed_reg_feb17` realization - **50_nr_soil_budget** old inconsistent module realizations @@ -578,16 +546,15 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). - **57_maccs** old inconsistent module realizations ### fixed - - **38_factor_costs** fixed calibration of share parameter in `sticky_labor` realization - **43_water_availability** added missing years after 2100 in "f43_wat_avail" to avoid infeasibilities in coupled runs with less_ts timesteps - **59_som** corrected the som pool due to the carbon transfer from other and primary forest to secondary forest before optimization (presolve) - **scripts** fixed some bugs related to background execution of start/output scripts -## [4.5.0][4.5.0] - 2022-07-07 -### changed +## [4.5.0] - 2022-07-07 +### changed - **09_drivers** separation of GDP and population scenarios - **09_drivers** changed `i09_gdp_pc_mer_iso` to `im_gdp_pc_mer_iso` - **11_costs** Split of production costs per sector, addded new separated costs to the costs function. @@ -595,10 +562,10 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). - **13_tc** Replace endo_jan18 realization by endo_jan22. The new realization adds a new dimension to vm_tau separating crop from managed pastures tau. - **15_food** added more options to define convergence towards exogenous food intake and waste scenarios accounting for different transition periods - **18_residues** The variable that include production costs vm_cost_prod for residues changed to a new independent variable called vm_cost_prod_kres - (specific to residues). +(specific to residues). - **30_crop** renamed switch `s30_set_aside_shr`, `s30_set_aside_shr_noselect` and `c30_set_aside_target` to `s30_snv_shr`, `s30_snv_shr_noselect` and `c30_snv_target`. - **31_past** The variable that include production costs vm_cost_prod for pasture changed to a new independent variable called vm_cost_prod_past - (specific to past). +(specific to past). - **31_past** added new realization implementing the separation of rangelands and managed pastures for the production of grass biomass. - **32_forestry** simplification and bugfix of afforestation limit. `c32_max_aff_area_glo` renamed to `s32_max_aff_area_glo` in default.cfg. - **34_urban** added set urban_scen34 and the switch c34_urban_scenario @@ -632,7 +599,6 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). - **scripts** scripts/output/extra/emulator.R Remove dependency on deprecated R package "magpie" ### added - - **core** macros for linear and sigmoidal time interpolation - **22_land_conservation** added new module and realisation for land conservation. The realisation also includes a new WDPA initialisation data set (from 1995 to 2020) for protected areas under legal protection, meeting IUCN and CBD protected area definitions. The module also adds the interface `pm_land_conservation`. - **30_crop** new module realizations including crop rotation scenarios by strict constraints (`rotation_apr22`) and by penalties (`penalty_apr22`) @@ -645,11 +611,11 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). - **config** added option for CO2 emission pricing `cfg$gms$c56_carbon_stock_pricing` - **config** added cfg$gms$s70_past_mngmnt_factor_fix with default 2005 (previous default was 2010). The previous setting caused a strong spike in CO2 emissions from pasture expansion in SSA. With 2005, this can be avoided. - **inputs** New input files added: - f13_pastr_tau_hist.csv -> historical tau for managed pastures. - f31_pastr_suitability.cs3 -> Managed pasture suitability - f31_LUH2v2.cs3 -> LUH2v2 land classes separating rangelands from managed pastures - f31_grassl_yld.cs3 -> Rangelands and managed pastures grass yields - f31_grass_bio_hist.cs3 -> Historical grass biomass demand + f13_pastr_tau_hist.csv -> historical tau for managed pastures. + f31_pastr_suitability.cs3 -> Managed pasture suitability + f31_LUH2v2.cs3 -> LUH2v2 land classes separating rangelands from managed pastures + f31_grassl_yld.cs3 -> Rangelands and managed pastures grass yields + f31_grass_bio_hist.cs3 -> Historical grass biomass demand - **modules** New dimension in `vm_carbon_stock` for different carbon stock types (actual, previousLandPattern, previousCarbonDensity) - **scripts** output/projects/FSEC_StevenLord.R to create output for Steven Lord in the FSEC context - **scripts** output/projects/FSEC_costs.R to create costs ouput for the FSEC project @@ -659,11 +625,9 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). - **scripts** `start/projects/test_rotations.R` testscript for different rotation scenario settings ### removed - - **38_factor_costs** mixed_feb17 and fixed_per_ton_mar18 realizations removed because they are not being used at the moment. ### fixed - - **09_drivers** bugfix concerning the use of the switch c09_gdp_scenario for defining population assumptions - **09_drivers** introduced new sets for PAL and demography scenarios to account for only partial coverage of available socio-economic gdp and population scenarios - **18_residues** off realization; missing variable declarations @@ -682,10 +646,10 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). - **scripts** fixed configuration error in FSEC output scripts, FSEC_dietaryIndicators.R and FSEC_environmentalPollutants.R - **scripts** scripts/start/extra/emulator.R Throw an error if no file can be found to take the GHG prices from -## [4.4.0][4.4.0] - 2021-12-13 -### changed +## [4.4.0] - 2021-12-13 +### changed - **additional_data** NDCs for Chinas afforestation now start earlier (1995) in line with observed afforestation. - **config** comments added for correct use of nitrogen switches - **inputs** new default LPJmL version with growing season adaptation (gsadapt) on @@ -725,7 +689,6 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). - **scripts** start/test_runs.R added SSP1, SSP2 and SSP5 as default test runs ### added - - **34_urban** New exo_nov21 exogenous realization of urban land expansion - **21_trade** Missing interface parameter for failing exo realization runs - **59_som** exogenous pathway for vm_nr_som via f59_som_exogenous @@ -748,7 +711,6 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). - **output.R** added SLURM standby maxMem and SLURM priority maxMem; needed for some output scripts (e.g. disaggregation_LUH2.R) ### removed - - **32_foresty** Removed static realization - **35_natveg** Removed static realization - **scripts** lpjml_addon script is removed and all calls within dependend starting scripts @@ -761,7 +723,6 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). - **39_landconversion_cost** removed realizations "global_static_aug18" and "devstate" ### fixed - - **80_optimization** Improved solve logic in "nlp_apr17" and "nlp_par" realization, multiple bugfixes and switch to solvelink=3 in "nlp_par" - **58_peatland** fixed rare infeasibility in "on" realization - **10_land** fixed rare infeasibility in "landmatrix_dec18" realization @@ -776,10 +737,10 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). - **73_timber** plausible cost for balance variable in case of s73_timber_demand_switch = 0 to avoid cost distortion - **56_ghg_policy** choose the correct scenario for fixing the GHG prices until sm_fix_SSP2 -## [4.3.5][4.3.5] - 2021-09-02 -### changed +## [4.3.5] - 2021-09-02 +### changed - **13_tc** added switch to ignore historic tau patterns in historic time steps (new default) - **16_demand** Moved most of cropping related set definitions (k, kve, kcr) from **16_demand** to **14_yield** - **32_foresty** Added option to choose a rotation length calculation criteria @@ -795,8 +756,8 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). - **inputs** Changed file format from cs2 to cs2b for cellular input files with a single data column - **scenario_config** added RCPs as columns for use with setSceanrio function. This required the addition of "gms$" in the 1st column. -### added +### added - **73_timber** Added construction wood demand scenarios based on Churkina et al. 2020 - **script(s)** Added scripts to replicate runs for Mishra et al. 2021 (in review : https://doi.org/10.5194/gmd-2021-76) - **13_tc** Added new interfaces for tau factor of the previous time step (`pcm_tau`) @@ -817,12 +778,10 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). - **sets** added superregional layer `h` as additional spatial layer and moved constraints in **13_tc** and **21_trade** partly to the superregional level. ### removed - - **13_tc** Removed disfuctional setting c13_tccost = "mixed" - **core** removed sets ac_young and ac_mature (no longer needed due to changes in 44_biodiversity) ### fixed - - **32_foresty** BII coefficients for CO2 price driven afforestation - **32_foresty** growth curve CO2 price driven afforestation - **32_foresty** NPI/NDC afforestation infeasibility @@ -830,29 +789,27 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). - **35_natveg** option to fade out damage from shifting agriculture by 2030 - **44_biodiversity** ac0 included in pricing of biodiversity loss -## [4.3.4][4.3.4] - 2021-04-30 -### changed +## [4.3.4] - 2021-04-30 +### changed - **51_nitrogen** New calculations for emissions from agricultural residues (vm_res_ag_burn) - **53_methane** New calculations for emissions from agricultural residues (vm_res_ag_burn) - **citation file** added new contributors ### added - - **config** The set "kfo_rd" (livst_rum, livst_milk), which is used in the food substitution scenarios c15_rumdairy_scp_scen and c15_rumdairyscen, has been added to the default.cfg file. This allows for sensitivity scenarios (e.g. only livst_milk or only livst_rum). - A new scenario (nocc_hist) was added to the cc/nocc switch. In this scenario, parameters affected by the cc/nocc switch in **14_yields**,**42_water_demand**,**43_water_availability**,**52_carbon**,**59_som** keep their historical/variable values up to the year defined by sm_fix_cc. Afterwards, sm_fix_cc values are kept constant for the overall run horizon. ### fixed - - **09_drivers** migration of sm_fix_SSP2 and sm_fix_cc declaration from the core declarations to the drivers module. This will allow to set the scalars properly . - - **15_food** single-cell protein substitution scenarios included in intersolve.gms. - **20_processing** The "mixed" scenario for single-cell protein production (c20_scp_type) was not working as expected. The corresponding code in 20_processing has been updated. -## [4.3.3][4.3.3] - 2021-03-30 -### added +## [4.3.3] - 2021-03-30 +### added - **15_food*** added 3 sigmoid food substitution scenarios - **44_biodiversity** New biodiversity module. The realization bv_btc_mar21 now allows to calculate an area-based biodiversity value across all land types. Switch `c44_price_bv_loss` to implement cost for biodiversity loss. - **56_ghg_policy** Automatic sets for scenarios @@ -863,13 +820,12 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). - **scripts** Added pre-commit hook ### fixed - - **60_bioenergy** Minimal bioenergy demand -## [4.3.2][4.3.2] - 2021-03-17 -### changed +## [4.3.2] - 2021-03-17 +### changed - **12_interest_rate** Interest fader changed to csv - **15_food** better documentation of parameters over model iterations - **15_food** added scenario switch for ruminant and dairy replacement by Single-Cell Protein @@ -882,7 +838,6 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). - **tests** Replaced TravisCI with GithubActions ### added - - **15_food** Added the option to fade out livestock demand towards a target level in kcal/cap/day. - **21_trade** Added scalar `s21_trade_bal_damper` and new set `k_trade_excl_timber` - **29_ageclass** New age-class module @@ -903,32 +858,29 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). - **scripts** added output script for disaggregation of land transitions ### removed - - **32_forestry** Removed previous default realization - **35_natveg** Removed previous default realization - **73_timber** Removed previous default realization ### fixed - - **32_forestry** Bugfixes for "ac_est" and carbon treshold afforestation; removed plantations from "vm_cdr_aff". - **core** bugfix m_fillmissingyears macro; was running over t before; now running over t_all_ -## [4.3.1][4.3.1] - 2020-11-03 -### added +## [4.3.1] - 2020-11-03 +### added - **main** Added Dockerfile for running MAgPIE in a container ### fixed - - **35_natveg** Bugfix "v35_secdforest_expansion" - **52_carbon** Bugfix "p52_scaling_factor" for climate change runs - **73_timber** New scenario switch `c73_wood_scen`. -## [4.3.0][4.3.0] - 2020-09-15 -### added +## [4.3.0] - 2020-09-15 +### added - **38_factor_costs** Added the new "sticky" realization to the factor costs module. The realization "sticky_feb18" favors expansion in cells with preexisting farmland and capital based on capital investment decisions. - **modules** added endogenous implementation of local biophysical (bph) impacts of afforestation to existing realizations in modules 32_forestry (dynamic_oct19) and 56_ghg_policy (price_jan20). default = off - **73_timber** Added timber module which brings the ability of producing woody biomass for timber plantations and natural vegetation. Default = off. New switch: `s73_foresight`. New scalars : `s73_timber_prod_cost`, `s73_timber_harvest_cost`,`s73_cost_multiplier`,`s73_free_prod_cost` @@ -940,139 +892,131 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). - **scripts** added start script for making timber production runs (forestry.R). ### changed - - **scripts** updated selection routine for start and output scripts - **scripts** replaced lucode dependency with newer packages lucode2 and gms - **32_forestry** include new datasets of the bph effect of afforestation / replaced the bph ageclass switch with a fade-in between ac10 and ac30 in (dynamic_may20) -- **13_tc**, **39_landconversion**, **41_area_equipped_for_irrigation** and **58_peatland**. For the current time step, the optimization costs only include now the annuity of the present investment. magpie4's reportCosts() function was modified to consider these changes. + - **13_tc**, **39_landconversion**, **41_area_equipped_for_irrigation** and **58_peatland**. For the current time step, the optimization costs only include now the annuity of the present investment. magpie4's reportCosts() function was modified to consider these changes. ### removed - -- **scripts** deleted outdated start and output scripts + - **scripts** deleted outdated start and output scripts ### fixed + - **32_forestry** Rotation length calculation based on correct marginals of growth function in timber plantations. Clearer calculations for harvested area for timber production. + - **35_natveg** Clearer calculations for harvested area for timber production. + - **52_carbon** Fix to the Carbon densities received from LPJmL for timber plantations. -- **32_forestry** Rotation length calculation based on correct marginals of growth function in timber plantations. Clearer calculations for harvested area for timber production. -- **35_natveg** Clearer calculations for harvested area for timber production. -- **52_carbon** Fix to the Carbon densities received from LPJmL for timber plantations. -## [4.2.1][4.2.1] - 2020-05-15 +## [4.2.1] - 2020-05-15 ### added - -- **modules** added option of regional scenario switches in modules 12_interest_rate, 15_food, 42_water_demand, 50_nr_soil_budget, 55_awms, 56_ghg_policy, 60_bioenergy -- **58_peatland** added peatland module. Two realizations: off (=default) and on. -- **80_optimization** added realization for parallel optimization of regions in combination with fixed trade patterns. -- **metadata** added .zenodo.json metadata file for proper metadata information in ZENODO releases + - **modules** added option of regional scenario switches in modules 12_interest_rate, 15_food, 42_water_demand, 50_nr_soil_budget, 55_awms, 56_ghg_policy, 60_bioenergy + - **58_peatland** added peatland module. Two realizations: off (=default) and on. + - **80_optimization** added realization for parallel optimization of regions in combination with fixed trade patterns. + - **metadata** added .zenodo.json metadata file for proper metadata information in ZENODO releases ### changed - -- **12_interest_rate** merged the two realizations (glo_jan16 and reg_feb18) into one (select_apr20) with same functionality and add on of option to choose different interest rate scenarios for different regions selected via country switch select_countries12 -- **scripts** streamlined and improved performance of NPI/NDC preprocessing + - **12_interest_rate** merged the two realizations (glo_jan16 and reg_feb18) into one (select_apr20) with same functionality and add on of option to choose different interest rate scenarios for different regions selected via country switch select_countries12 + - **scripts** streamlined and improved performance of NPI/NDC preprocessing ### fixed + - **56_ghg_policy and 60_bioenergy** update of GHG prices and 2nd generation bioenergy demand from SSPDB to most recent snapshot + - **NPI/NDC policy calculations** revision of calculation method -- **56_ghg_policy and 60_bioenergy** update of GHG prices and 2nd generation bioenergy demand from SSPDB to most recent snapshot -- **NPI/NDC policy calculations** revision of calculation method -## [4.2.0][4.2.0] - 2020-04-15 +## [4.2.0] - 2020-04-15 -This release version is focussed on consistency between the MAgPIE setup and the [REMIND model][REMIND model] and result of a validation exercise of the coupled (REMIND 2.1)-(MAgPIE 4.2) system. +This release version is focussed on consistency between the MAgPIE setup and the [REMIND model] and result of a validation exercise of the coupled (REMIND 2.1)-(MAgPIE 4.2) system. ### added - -- **config** Added new socioeconomic scenario (SDP) to scenario_config.csv (which include all switches to define among others the SSP scenarios). For the parametrization of the new SDP (Sustainable Development Pathway) scenario, the list of scenario switches was extended to account for a broad range of sustainability dimensions. -- **10_land** added new land realization landmatrix_dec18 to directly track land transition between land use types -- **15_food** stronger ruminant fade out in India -- **15_food** Added exogenous food substitution scenarios that can be selected via settings in the config-file, defining speed of convergence, scenario targets and transition periods (applied after the food demand model is executed). Among these scenarios are the substitution of livestock products with plant-based food commodities and the substitution of beef or fish with poultry. The food substitution scenarios are based on the model-native, regression-based calculation of food intake and demand. -- **15_food** Added exogenous EAT Lancet diet scenarios: It is now possible to define in the config-file exogenous diet scenarios that replace the regression-based calculation of food intake and demand. Possible settings are the target for total calorie intake (e.g. according to a healthy BMI) and variants of the EAT Lancet diet (e.g. in addition to the flexitarian a vegetarian or vegan variant). -- **15_food** Added exogenous food waste scenarios which can be defined via settings in the config-file, including scenario targets for the ratio between food demand and intake and the year in which full transition to the target should be achieved. -- **30_crop** added crop specific land use initialization pattern (used as interface for other modules) -- **50_nr_soil_budget and 55_awms** Additional inputs for the GoodPractice Scenario. -- **52_carbon** Added new forest growth curve parameters based on Braakhekke et al. 2019. Growth curves are now differentiated between natural vegetation (default) and plantations. -- **59_som** added new realization static_jan19 (new default) including all soil carbon related calculations. Before all carbon pools were updated in the specific land use type modules. This still holds true for the above ground pools (vegetation and litter carbon) -- **.gitattributes** file added to set line ending handling to auto for all text files -- **scaling** added scaling.gms files for several modules to improve optimization (based on gdx::calc_scaling) -- **scripts** added output scripts for global soil carbon maps (SoilMaps.R). + - **config** Added new socioeconomic scenario (SDP) to scenario_config.csv (which include all switches to define among others the SSP scenarios). For the parametrization of the new SDP (Sustainable Development Pathway) scenario, the list of scenario switches was extended to account for a broad range of sustainability dimensions. + - **10_land** added new land realization landmatrix_dec18 to directly track land transition between land use types + - **15_food** stronger ruminant fade out in India + - **15_food** Added exogenous food substitution scenarios that can be selected via settings in the config-file, defining speed of convergence, scenario targets and transition periods (applied after the food demand model is executed). Among these scenarios are the substitution of livestock products with plant-based food commodities and the substitution of beef or fish with poultry. The food substitution scenarios are based on the model-native, regression-based calculation of food intake and demand. + - **15_food** Added exogenous EAT Lancet diet scenarios: It is now possible to define in the config-file exogenous diet scenarios that replace the regression-based calculation of food intake and demand. Possible settings are the target for total calorie intake (e.g. according to a healthy BMI) and variants of the EAT Lancet diet (e.g. in addition to the flexitarian a vegetarian or vegan variant). + - **15_food** Added exogenous food waste scenarios which can be defined via settings in the config-file, including scenario targets for the ratio between food demand and intake and the year in which full transition to the target should be achieved. + - **30_crop** added crop specific land use initialization pattern (used as interface for other modules) + - **50_nr_soil_budget and 55_awms** Additional inputs for the GoodPractice Scenario. + - **52_carbon** Added new forest growth curve parameters based on Braakhekke et al. 2019. Growth curves are now differentiated between natural vegetation (default) and plantations. + - **59_som** added new realization static_jan19 (new default) including all soil carbon related calculations. Before all carbon pools were updated in the specific land use type modules. This still holds true for the above ground pools (vegetation and litter carbon) + - **.gitattributes** file added to set line ending handling to auto for all text files + - **scaling** added scaling.gms files for several modules to improve optimization (based on gdx::calc_scaling) + - **scripts** added output scripts for global soil carbon maps (SoilMaps.R). ### changed - -- **config** new default ghg emission pricing policy "redd+_nosoil" in c56_emis_policy. Includes all pools included in the previous default "SSP_nosoil", and in addition "forestry". -- **13_tau** lower bound for vm_tau for historical time steps -- **50_nr_soil_budget** atmospheric deposition is now estimated on the cluster-level instead of the region level to improve spatial patterns. -- **56_ghg_policy** updated scenarios in f56_emis_policy: none, all natural (called 'ssp') and all land use change emissions (pure co2) being included in greenhouse gas pricing. ssp and all also featuring additional scenarios excluding soil carbon pricing (marked with '_nosoil' postscript). -- **56_ghg_policy** Several changes regarding afforestation: use of detailed formula for incentive calculation instead of simplified Hotelling formula, 50 year planning horizon (instead of 80 years), phase-in of GHG prices deactivated by default (now done in REMIND), CO2 price reduction factor deactivated by default, introduced buffer reduction factor of 20% for afforestation. -- **59_som** updated cellpool_aug16 realization to use new interfaces from land module on land use type specific land expansion and reduction as well as crop type specific land initialization pattern. Additionally added irrigation as stock change factor sub-type. N fertilizer from soil organic matter decomposition is truncated after threshold to avoid unrealistically high fertilization rates. -- **80_optimization** write extended run information in list file in the case that the final solution is infeasible -- **modules** modular structure updated from version 1 to version 2 -- **line endings** changed to unix-style for all text files + - **config** new default ghg emission pricing policy "redd+_nosoil" in c56_emis_policy. Includes all pools included in the previous default "SSP_nosoil", and in addition "forestry". + - **13_tau** lower bound for vm_tau for historical time steps + - **50_nr_soil_budget** atmospheric deposition is now estimated on the cluster-level instead of the region level to improve spatial patterns. + - **56_ghg_policy** updated scenarios in f56_emis_policy: none, all natural (called 'ssp') and all land use change emissions (pure co2) being included in greenhouse gas pricing. ssp and all also featuring additional scenarios excluding soil carbon pricing (marked with '_nosoil' postscript). + - **56_ghg_policy** Several changes regarding afforestation: use of detailed formula for incentive calculation instead of simplified Hotelling formula, 50 year planning horizon (instead of 80 years), phase-in of GHG prices deactivated by default (now done in REMIND), CO2 price reduction factor deactivated by default, introduced buffer reduction factor of 20% for afforestation. + - **59_som** updated cellpool_aug16 realization to use new interfaces from land module on land use type specific land expansion and reduction as well as crop type specific land initialization pattern. Additionally added irrigation as stock change factor sub-type. N fertilizer from soil organic matter decomposition is truncated after threshold to avoid unrealistically high fertilization rates. + - **80_optimization** write extended run information in list file in the case that the final solution is infeasible + - **modules** modular structure updated from version 1 to version 2 + - **line endings** changed to unix-style for all text files ### fixed + - **modules** Fixing of all parameters to SSP2 values until 2020 (switch sm_fix_SSP2) for having identical outcomes in all scenarios (SDP, SSP1-5) until 2020. + - **21_trade** Bugfix kall instead of k in exo realization; Bufix begr/betr trade in default realization; Bugfix sets in free realization + - **32_forestry** NPI/NDC afforestation targets are now counted towards the global afforestation limit, which can be set for specific scenarios via the switch *s32maxaff_area* and constrains the potential for carbon-price induced endogenous afforestation. + - **56_ghg_policy** bugfix full soil carbon loss in default setting, renamed it from ssp to ssp_nosoil, indicating, that soil carbon losses are not priced. + - **56_ghg_policy** bugfix afforestation: vmbtm_cell was a free variable for some sources and pollutants, which could result in GHG cost neutral shifting of age classes to ac0 (e.g. from ac55 to ac0). + - **80_optimization** added fallback routine for CONOPT4 failure (fatal system error) -- **modules** Fixing of all parameters to SSP2 values until 2020 (switch sm_fix_SSP2) for having identical outcomes in all scenarios (SDP, SSP1-5) until 2020. -- **21_trade** Bugfix kall instead of k in exo realization; Bufix begr/betr trade in default realization; Bugfix sets in free realization -- **32_forestry** NPI/NDC afforestation targets are now counted towards the global afforestation limit, which can be set for specific scenarios via the switch *s32maxaff_area* and constrains the potential for carbon-price induced endogenous afforestation. -- **56_ghg_policy** bugfix full soil carbon loss in default setting, renamed it from ssp to ssp_nosoil, indicating, that soil carbon losses are not priced. -- **56_ghg_policy** bugfix afforestation: vmbtm_cell was a free variable for some sources and pollutants, which could result in GHG cost neutral shifting of age classes to ac0 (e.g. from ac55 to ac0). -- **80_optimization** added fallback routine for CONOPT4 failure (fatal system error) -## [4.1.1][4.1.1] - 2020-03-09 +## [4.1.1] - 2020-03-09 This version provides the model version used for the publication starved, stuffed and wasteful. It provides a few technical updates compared to the 4.1 release, which include ### added - - **scripts** a startscript that allows the exchange of model parameters as a sensitivity analysis ### changed - - **core** allow for flexible calibration period of the model, which allows for uncalibrated runs of the past for validation purposes - **15_food** Parameters for bodyheight regressions were included explicitly as input parameters - **config** updated input data of the drivers and food demand regressions ### fixed - - **15_food** Precision of iteration convergence criterium for magpie-demandmodel-iteration is calculated more precisely, avoiding unnecessary iterations. -## [4.1.0][4.1.0] - 2019-05-02 -This release version is focussed on consistency between the MAgPIE setup and the [REMIND model][REMIND model] and result of a validation exercise of the coupled REMIND-MAgPIE system. +## [4.1.0] - 2019-05-02 -### added +This release version is focussed on consistency between the MAgPIE setup and the [REMIND model] and result of a validation exercise of the coupled REMIND-MAgPIE system. -- **80_optimization** added support for GAMS version 26.x.x -- **scripts** added new start and output scripts -- **license** added exception to the applied AGPL license to clarify handling of required GAMS environment, solver libraries and R libraries +### added + - **80_optimization** added support for GAMS version 26.x.x + - **scripts** added new start and output scripts + - **license** added exception to the applied AGPL license to clarify handling of required GAMS environment, solver libraries and R libraries ### changed - -- **56_ghg_policy** apply reduction factor on CO2 price to account for potential negative side effects; lowers the economic incentive for CO2 emission reduction (avoided deforestation) and afforestation -- **56_ghg_policy** non-linar phase-in of GHG prices over 20 year period -- **56_ghg_policy** multiply GHG prices with development state to account for institutional requirements needed for implementing a GHG pricing scheme -- **40_transport** introduced transport costs for monogastric livestock products -- **NPI/NDC scripts** added forest protection policy for Brazilian Atlantic Forest in default NDC and NPI scenarios -- **NPI/NDC scripts** harmonized the starting year of the NDC policies 2020. -- **interpolation scripts** changed output files to seven magpie land use types, added additional cropsplit script for more detailed cropland output -- **15_food** clean-up and cosmetic changes (correction of comments, parameter names, structure of code); update BMI share calculations with the values of the last consistent MAgPIE/food-demand-model iteration + - **56_ghg_policy** apply reduction factor on CO2 price to account for potential negative side effects; lowers the economic incentive for CO2 emission reduction (avoided deforestation) and afforestation + - **56_ghg_policy** non-linar phase-in of GHG prices over 20 year period + - **56_ghg_policy** multiply GHG prices with development state to account for institutional requirements needed for implementing a GHG pricing scheme + - **40_transport** introduced transport costs for monogastric livestock products + - **NPI/NDC scripts** added forest protection policy for Brazilian Atlantic Forest in default NDC and NPI scenarios + - **NPI/NDC scripts** harmonized the starting year of the NDC policies 2020. + - **interpolation scripts** changed output files to seven magpie land use types, added additional cropsplit script for more detailed cropland output + - **15_food** clean-up and cosmetic changes (correction of comments, parameter names, structure of code); update BMI share calculations with the values of the last consistent MAgPIE/food-demand-model iteration ### fixed + - **42_water_demand** bugfix environmental flow policy harmonization for historic period + - **57_maccs** correction of cost calculation; Conversion from USD per ton C to USD per ton N and USD per ton CH4 was missing. + - **71_diagg_lvst** adjusted monogastric disaggregation for more flexiblity to avoid infeasibilities with EFPs (see 42_water_demand) + - **15_food** correction regarding the convergence measure of the iterative execution of the food demand model and MAgPIE; correction accounting for unusual time step length in body height calculations; body height regression parameters updated -- **42_water_demand** bugfix environmental flow policy harmonization for historic period -- **57_maccs** correction of cost calculation; Conversion from USD per ton C to USD per ton N and USD per ton CH4 was missing. -- **71_diagg_lvst** adjusted monogastric disaggregation for more flexiblity to avoid infeasibilities with EFPs (see 42_water_demand) -- **15_food** correction regarding the convergence measure of the iterative execution of the food demand model and MAgPIE; correction accounting for unusual time step length in body height calculations; body height regression parameters updated -## [4.0.1][4.0.1] - 2018-10-05 +## [4.0.1] - 2018-10-05 ### fixed + - **FABLE** adapted FABLE-specific configuration so that it works with MAgPIE 4.0 -- **FABLE** adapted FABLE-specific configuration so that it works with MAgPIE 4.0 -## [4.0.0][4.0.0] - 2018-10-04 +## [4.0.0] - 2018-10-04 First open source release of the framework. See [MAgPIE 4.0 paper](https://doi.org/10.5194/gmd-12-1299-2019) for more information. -[Unreleased]: https://github.com/magpiemodel/magpie/compare/v4.8.1...develop + +[Unreleased]: https://github.com/magpiemodel/magpie/compare/v4.8.2...develop +[4.8.2]: https://github.com/magpiemodel/magpie/compare/v4.8.1...v4.8.2 [4.8.1]: https://github.com/magpiemodel/magpie/compare/v4.8.0...v4.8.1 [4.8.0]: https://github.com/magpiemodel/magpie/compare/v4.7.3...v4.8.0 [4.7.3]: https://github.com/magpiemodel/magpie/compare/v4.7.2...v4.7.3 @@ -1105,4 +1049,5 @@ First open source release of the framework. See [MAgPIE 4.0 paper](https://doi.o [4.1.0]: https://github.com/magpiemodel/magpie/compare/v4.0.1...v4.1.0 [4.0.1]: https://github.com/magpiemodel/magpie/compare/v4.0...v4.0.1 [4.0.0]: https://github.com/magpiemodel/magpie/releases/tag/v4.0 + [REMIND model]: https://www.pik-potsdam.de/research/transformation-pathways/models/remind From 63dd571798f90d5af0adc33793258b1e3b250318 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Florian=20Humpen=C3=B6der?= Date: Thu, 26 Sep 2024 12:30:25 +0200 Subject: [PATCH 020/206] Update config/default.cfg Co-authored-by: Jan Dietrich --- config/default.cfg | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config/default.cfg b/config/default.cfg index 9e39c88696..ab34ba45cc 100644 --- a/config/default.cfg +++ b/config/default.cfg @@ -767,7 +767,7 @@ cfg$gms$s29_treecover_scenario_start <- 2025 # def = 2025 cfg$gms$s29_treecover_scenario_target <- 2050 # def = 2050 # * Penalty for violation of treecover target before scenario start (USD17MER per ha) # * (inflated from default originally in USD05 using USD05 --> USD17 inflation rate:1.23) -cfg$gms$s29_treecover_penalty_before <- 0 # def = 0 * 1.23 +cfg$gms$s29_treecover_penalty_before <- 0 # def = 0 # * Penalty for violation of treecover target after scenario start (USD17MER per ha) # * (inflated from default originally in USD05 using USD05 --> USD17 inflation rate: 1.23) cfg$gms$s29_treecover_penalty <- 6150 # def = 5000 * 1.23 From 51b94fcf159d36877a057cc351ec437307fb69b6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Florian=20Humpen=C3=B6der?= Date: Thu, 26 Sep 2024 12:30:54 +0200 Subject: [PATCH 021/206] Update config/default.cfg Co-authored-by: Pascal Sauer <156898545+pascal-sauer@users.noreply.github.com> --- config/default.cfg | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config/default.cfg b/config/default.cfg index ab34ba45cc..7f67b80c2c 100644 --- a/config/default.cfg +++ b/config/default.cfg @@ -775,7 +775,7 @@ cfg$gms$s29_treecover_penalty <- 6150 # def = 5000 * 1.23 # * (inflated from default originally in USD05 using USD05 --> USD17 inflation rate:1.23) cfg$gms$s29_cost_treecover_est <- 2460 # def = 2000 * 1.23 # * Tree cover recurring cost (USD17MER per ha) -cfg$gms$s29_cost_treecover_recur <- 620 # def = 500 * 1.23 +cfg$gms$s29_cost_treecover_recur <- 615 # def = 500 * 1.23 # * Sigmoid fader for minimum area share of fallow land on total cropland at cluster level # * Minimum area share of fallow land on total cropland in target year From 8b03f07fbd5591a0364ee05dca34fe6790ef662d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Florian=20Humpen=C3=B6der?= Date: Thu, 26 Sep 2024 12:31:05 +0200 Subject: [PATCH 022/206] Update modules/39_landconversion/calib/input.gms Co-authored-by: Pascal Sauer <156898545+pascal-sauer@users.noreply.github.com> --- modules/39_landconversion/calib/input.gms | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/39_landconversion/calib/input.gms b/modules/39_landconversion/calib/input.gms index d3bc1f7d24..3846fa87ae 100644 --- a/modules/39_landconversion/calib/input.gms +++ b/modules/39_landconversion/calib/input.gms @@ -9,7 +9,7 @@ scalars s39_cost_establish_crop Cost for cropland expansion before calibration (USD17MER per hectare) / 12300 / s39_reward_crop_reduction Reward for cropland reduction before calibration (USD17MER per hectare) / 7380 / s39_cost_establish_past Cost for pasture land expansion (USD17MER per hectare) / 9840 / - s39_cost_establish_forestry Cost for foresty land expansion (USD17MER per hectare) / 1120 / + s39_cost_establish_forestry Cost for foresty land expansion (USD17MER per hectare) / 1230 / s39_cost_establish_urban Cost for urban land expansion (USD17MER per hectare) / 12300 / s39_ignore_calib Switch for ignoring calibration factors (1) / 0 / ; From 672a0f780df4de494df605e8e70241b002368001 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Florian=20Humpen=C3=B6der?= Date: Thu, 26 Sep 2024 12:31:15 +0200 Subject: [PATCH 023/206] Update modules/29_cropland/detail_apr24/input.gms Co-authored-by: Pascal Sauer <156898545+pascal-sauer@users.noreply.github.com> --- modules/29_cropland/detail_apr24/input.gms | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/29_cropland/detail_apr24/input.gms b/modules/29_cropland/detail_apr24/input.gms index b386089991..404b7ad5f7 100644 --- a/modules/29_cropland/detail_apr24/input.gms +++ b/modules/29_cropland/detail_apr24/input.gms @@ -16,7 +16,7 @@ scalars s29_snv_relocation_data_x1 First reference value in SNV target cropland data (1) / 0.2 / s29_snv_relocation_data_x2 Second reference value in SNV target cropland data (1) / 0.5 / s29_cost_treecover_est Tree cover establishment cost (USD17MER per ha) / 2460 / - s29_cost_treecover_recur Tree cover recurring cost (USD17MER per ha) / 620 / + s29_cost_treecover_recur Tree cover recurring cost (USD17MER per ha) / 615 / s29_treecover_plantation Growth curve switch for tree cover on cropland 0=natveg 1=plantations (1) / 0 / s29_treecover_bii_coeff BII coefficent to be used for tree cover on cropland 0=secondary vegetation 1=timber plantations (1) / 0 / s29_treecover_scenario_start Cropland treecover scenario start year / 2025 / From ea4ed1fca4304f0e5659f18f98d2664b0828a95f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Florian=20Humpen=C3=B6der?= Date: Thu, 26 Sep 2024 12:31:26 +0200 Subject: [PATCH 024/206] Update config/default.cfg Co-authored-by: Pascal Sauer <156898545+pascal-sauer@users.noreply.github.com> --- config/default.cfg | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config/default.cfg b/config/default.cfg index 7f67b80c2c..2ff44d7977 100644 --- a/config/default.cfg +++ b/config/default.cfg @@ -1187,7 +1187,7 @@ cfg$gms$s39_reward_crop_reduction <- 7380 #def = 6000 * 1.23 cfg$gms$s39_cost_establish_past <- 9840 #def = 8000 * 1.23 # * Cost for foresty land expansion (USD17MER per hectare) # * (inflated from default originally in USD05 using USD05 --> USD17 inflation rate: 1.23) -cfg$gms$s39_cost_establish_forestry <- 1120 #def = 1000 * 1.23 +cfg$gms$s39_cost_establish_forestry <- 1230 #def = 1000 * 1.23 # * Cost for urban land expansion (USD17MER per hectare) # * (inflated from default originally in USD05 using USD05 --> USD17 inflation rate: 1.23) cfg$gms$s39_cost_establish_urban <- 12300 #def = 10000 * 1.23 From 13ab4a16b091cfcdc330885b6294551dcbd3b771 Mon Sep 17 00:00:00 2001 From: florianh Date: Thu, 26 Sep 2024 12:41:43 +0200 Subject: [PATCH 025/206] update TC module and monetary units --- config/default.cfg | 16 ++++++------ modules/13_tc/endo_jan22/declarations.gms | 26 +++++++++---------- modules/13_tc/endo_jan22/input.gms | 2 +- modules/13_tc/exo/declarations.gms | 10 +++---- modules/13_tc/exo/input.gms | 2 +- .../flexcluster_jul23/equations.gms | 4 +-- .../18_residues/flexreg_apr16/equations.gms | 4 +-- .../substitution_may21/input.gms | 4 +-- .../dynamic_may24/declarations.gms | 14 +++++----- modules/32_forestry/dynamic_may24/input.gms | 12 ++++----- modules/56_ghg_policy/price_aug22/preloop.gms | 6 ++--- modules/73_timber/default/declarations.gms | 10 +++---- modules/73_timber/default/input.gms | 2 +- 13 files changed, 56 insertions(+), 56 deletions(-) diff --git a/config/default.cfg b/config/default.cfg index 2ff44d7977..5d65a338e5 100644 --- a/config/default.cfg +++ b/config/default.cfg @@ -25,7 +25,7 @@ cfg$model <- "main.gms" #def = "main.gms" cfg$input <- c(regional = "rev4.112_h12_magpie.tgz", cellular = "rev4.112_h12_fd712c0b_cellularmagpie_c200_MRI-ESM2-0-ssp370_lpjml-8e6c5eb1.tgz", validation = "rev4.112_h12_magpie.tgz", - additional = "additional_data_rev4.54.tgz", + additional = "additional_data_rev4.55.tgz", calibration = "calibration_H12_26Mar24_fixed.tgz") # NOTE: It is recommended to recalibrate the model when changing cellular input data @@ -1000,11 +1000,11 @@ cfg$gms$s32_forestry_int_rate <- 0.05 # def = 0.05 # * 1 = forward looking (establishment based on future demand according to rotation length) cfg$gms$s32_demand_establishment <- 1 # def = 1 -# Establishment cost for plantations (USD per ha) +# Establishment cost for plantations (USD17MER per ha) # * (inflated from default originally in USD05 using USD05 --> USD17 inflation rate: 1.23) cfg$gms$s32_est_cost_plant <- 2460 # def = 2000 * 1.23 -# Establishment cost for natural vegetation (USD per ha) +# Establishment cost for natural vegetation (USD17MER per ha) # * (inflated from default originally in USD05 using USD05 --> USD17 inflation rate: 1.23) cfg$gms$s32_est_cost_natveg <- 2460 # def = 2000 * 1.23 @@ -1363,12 +1363,12 @@ cfg$gms$s44_bii_lower_bound <- 0 #def = 0 # * Note: The BII constraint is defined as a minimum constraint. Therefore, the actual BII can be higher than the lower bound. cfg$gms$c44_bii_decrease <- 1 #def = 1 -# * Technical costs for missing BII increase (USD per unit of BII) +# * Technical costs for missing BII increase (USD17MER per unit of BII) cfg$gms$s44_cost_bii_missing <- 1000000 #def = 1000000 # ** Options for realization `bv_btc_mar21` -# * Price for biodiversity stock loss/gain in target year (USD per ha) +# * Price for biodiversity stock loss/gain in target year (USD17MER per ha) # * Plausible range: 0-10000 # * Indicative outcomes # * 0: decrease of BII @@ -1377,7 +1377,7 @@ cfg$gms$s44_cost_bii_missing <- 1000000 #def = 1000000 # * 10000: stronger increase of BII cfg$gms$s44_target_price <- 0 #def = 0 -# * Price for biodiversity stock loss/gain in start year (USD per ha) +# * Price for biodiversity stock loss/gain in start year (USD17MER per ha) cfg$gms$s44_start_price <- 0 #def = 0 @@ -1613,8 +1613,8 @@ cfg$path_to_report_ghgprices <- NA # * Note: minimum C price (see below) will be set regardless of this setting cfg$gms$c56_mute_ghgprices_until <- "y2030" # def = y2030 -# * Minium C price (USD per tC) for future time steps until (and including) the year defined in `c56_mute_ghgprices_until` -# * Note: in case of NDC policy a C price of 18 USD per tC (5 USD per tCO2) is used to guide land-use decisions (set via scenario_config.csv) +# * Minium C price (USD17MER per tC) for future time steps until (and including) the year defined in `c56_mute_ghgprices_until` +# * Note: in case of NDC policy a C price of 18 USD17MER per tC (5 USD17MER per tCO2) is used to guide land-use decisions (set via scenario_config.csv) cfg$gms$s56_minimum_cprice <- 0 # def = 0 # * Switch and specification of countries for which pollutant pricing in diff --git a/modules/13_tc/endo_jan22/declarations.gms b/modules/13_tc/endo_jan22/declarations.gms index 91c9b1ed85..dd653afdc9 100644 --- a/modules/13_tc/endo_jan22/declarations.gms +++ b/modules/13_tc/endo_jan22/declarations.gms @@ -7,33 +7,33 @@ positive variable vm_tau(h,tautype) Agricultural land use intensity tau (1) - vm_tech_cost(i) Total Annuitized costs of TC (mio. USD17PPP per yr) - v13_cost_tc(i,tautype) Technical change costs per region (mio. USD17PPP) - v13_tech_cost(i,tautype) Annuitized costs of TC for crops and pasture (mio. USD17PPP per yr) + vm_tech_cost(i) Total Annuitized costs of TC (mio. USD17MER per yr) + v13_cost_tc(i,tautype) Technical change costs per region (mio. USD17MER) + v13_tech_cost(i,tautype) Annuitized costs of TC for crops and pasture (mio. USD17MER per yr) ; equations - q13_tech_cost(i, tautype) Total annuitized costs for TC (mio. USD17PPP) - q13_cost_tc(i, tautype) Costs for TC (mio. USD17PPP per yr) - q13_tech_cost_sum(i) Total Total annuitized costs for TC (mio. USD17PPP per yr) + q13_tech_cost(i, tautype) Total annuitized costs for TC (mio. USD17MER) + q13_cost_tc(i, tautype) Costs for TC (mio. USD17MER per yr) + q13_tech_cost_sum(i) Total Total annuitized costs for TC (mio. USD17MER per yr) ; parameters pc13_land(i, tautype) Crop and grass land area per region (mio ha) pcm_tau(h, tautype) Tau factor of the previous time step (1) pc13_tcguess(h, tautype) Guess for annual tc rates in the next time step (1) - i13_tc_factor(t) Regression factor (USD17PPP per ha) + i13_tc_factor(t) Regression factor (USD17MER per ha) i13_tc_exponent(t) Regression exponent (1) ; *#################### R SECTION START (OUTPUT DECLARATIONS) #################### parameters ov_tau(t,h,tautype,type) Agricultural land use intensity tau (1) - ov_tech_cost(t,i,type) Total Annuitized costs of TC (mio. USD17PPP per yr) - ov13_cost_tc(t,i,tautype,type) Technical change costs per region (mio. USD17PPP) - ov13_tech_cost(t,i,tautype,type) Annuitized costs of TC for crops and pasture (mio. USD17PPP per yr) - oq13_tech_cost(t,i,tautype,type) Total annuitized costs for TC (mio. USD17PPP) - oq13_cost_tc(t,i,tautype,type) Costs for TC (mio. USD17PPP per yr) - oq13_tech_cost_sum(t,i,type) Total Total annuitized costs for TC (mio. USD17PPP per yr) + ov_tech_cost(t,i,type) Total Annuitized costs of TC (mio. USD17MER per yr) + ov13_cost_tc(t,i,tautype,type) Technical change costs per region (mio. USD17MER) + ov13_tech_cost(t,i,tautype,type) Annuitized costs of TC for crops and pasture (mio. USD17MER per yr) + oq13_tech_cost(t,i,tautype,type) Total annuitized costs for TC (mio. USD17MER) + oq13_cost_tc(t,i,tautype,type) Costs for TC (mio. USD17MER per yr) + oq13_tech_cost_sum(t,i,type) Total Total annuitized costs for TC (mio. USD17MER per yr) ; *##################### R SECTION END (OUTPUT DECLARATIONS) ##################### diff --git a/modules/13_tc/endo_jan22/input.gms b/modules/13_tc/endo_jan22/input.gms index 67867ebe2e..f9a37ab622 100644 --- a/modules/13_tc/endo_jan22/input.gms +++ b/modules/13_tc/endo_jan22/input.gms @@ -27,7 +27,7 @@ $offdelim $setglobal c13_tccost medium -table f13_tc_factor(t_all,scen13) Regression factor (USD05PPP per ha) +table f13_tc_factor(t_all,scen13) Regression factor (USD17MER per ha) $ondelim $include "./modules/13_tc/input/f13_tc_factor.cs3" $offdelim diff --git a/modules/13_tc/exo/declarations.gms b/modules/13_tc/exo/declarations.gms index 72710b5fdf..969660738f 100644 --- a/modules/13_tc/exo/declarations.gms +++ b/modules/13_tc/exo/declarations.gms @@ -7,21 +7,21 @@ positive variable vm_tau(h,tautype) Agricultural land use intensity tau (1) - vm_tech_cost(i) Costs of TC (mio. USD17PPP per yr) + vm_tech_cost(i) Costs of TC (mio. USD17MER per yr) ; parameters - p13_cost_tc(i,tautype) Technical change costs per region (mio. USD17PPP) + p13_cost_tc(i,tautype) Technical change costs per region (mio. USD17MER) pc13_land(i,tautype) Crop and grass land area per region (mio ha) pcm_tau(h,tautype) Tau factor of the previous time step (1) - i13_tc_factor(t) Regression factor (USD17PPP per ha) + i13_tc_factor(t) Regression factor (USD17MER per ha) i13_tc_exponent(t) Regression exponent (1) - p13_tech_cost(i,tautype) Annuitized costs of TC for crops and pasture (mio. USD17PPP per yr) + p13_tech_cost(i,tautype) Annuitized costs of TC for crops and pasture (mio. USD17MER per yr) ; *#################### R SECTION START (OUTPUT DECLARATIONS) #################### parameters ov_tau(t,h,tautype,type) Agricultural land use intensity tau (1) - ov_tech_cost(t,i,type) Costs of TC (mio. USD17PPP per yr) + ov_tech_cost(t,i,type) Costs of TC (mio. USD17MER per yr) ; *##################### R SECTION END (OUTPUT DECLARATIONS) ##################### diff --git a/modules/13_tc/exo/input.gms b/modules/13_tc/exo/input.gms index bfabfea188..f5743743e1 100644 --- a/modules/13_tc/exo/input.gms +++ b/modules/13_tc/exo/input.gms @@ -15,7 +15,7 @@ $offdelim $setglobal c13_tccost medium -table f13_tc_factor(t_all,scen13) Regression factor (USD05PPP per ha) +table f13_tc_factor(t_all,scen13) Regression factor (USD17MER per ha) $ondelim $include "./modules/13_tc/input/f13_tc_factor.cs3" $offdelim diff --git a/modules/18_residues/flexcluster_jul23/equations.gms b/modules/18_residues/flexcluster_jul23/equations.gms index cd54aa85ad..00ebf68911 100644 --- a/modules/18_residues/flexcluster_jul23/equations.gms +++ b/modules/18_residues/flexcluster_jul23/equations.gms @@ -130,10 +130,10 @@ ); *' Costs of residues production are determined as factor costs per ton -*' assuming 15 USD per ton, using the lower range from +*' assuming 15 USD17MER per ton, using the lower range from *' [this source](hwww1.agric.gov.ab.ca/$Department/deptdocs.nsf/All/faq7514), *' 10USD baling costs per large round bale plus 2USD pro bale stocking and hauling, -*' 1 large round bale is approximately 500 kg, resulting in 24USD per ton, +*' 1 large round bale is approximately 500 kg, resulting in 24USD17MER per ton, *' for developing prices see [here](citeseerx.ist.psu.edu/viewdoc/download?doi=10.1.1.557.5823&rep=rep1&type=pdf). *' Tha calcuated factor costs per ton are therefore 24 for `res_cereals`, `res_fibrous` *' and `res_nonfibrous`. diff --git a/modules/18_residues/flexreg_apr16/equations.gms b/modules/18_residues/flexreg_apr16/equations.gms index 70d151afd8..97608539d8 100644 --- a/modules/18_residues/flexreg_apr16/equations.gms +++ b/modules/18_residues/flexreg_apr16/equations.gms @@ -108,10 +108,10 @@ ); *' Costs of residues production are determined as factor costs per ton -*' assuming 15 USD per ton, using the lower range from +*' assuming 15 USD17MER per ton, using the lower range from *' [this source](hwww1.agric.gov.ab.ca/$Department/deptdocs.nsf/All/faq7514), *' 10USD baling costs per large round bale plus 2USD pro bale stocking and hauling, -*' 1 large round bale is approximately 500 kg, resulting in 24USD per ton, +*' 1 large round bale is approximately 500 kg, resulting in 24USD17MER per ton, *' for developing prices see [here](citeseerx.ist.psu.edu/viewdoc/download?doi=10.1.1.557.5823&rep=rep1&type=pdf). *' Tha calcuated factor costs per ton are therefore 24 for `res_cereals`, `res_fibrous` *' and `res_nonfibrous`. diff --git a/modules/20_processing/substitution_may21/input.gms b/modules/20_processing/substitution_may21/input.gms index fea6b7bb54..f4292d5a5e 100644 --- a/modules/20_processing/substitution_may21/input.gms +++ b/modules/20_processing/substitution_may21/input.gms @@ -27,7 +27,7 @@ $ondelim $include "./modules/20_processing/input/f20_processing_unitcosts.cs3" $offdelim ; -table f20_quality_cost(ksd,kpr) Costs for difference in quality between secondary products from diverging origins (USD per tDM) +table f20_quality_cost(ksd,kpr) Costs for difference in quality between secondary products from diverging origins (USD17MER per tDM) $ondelim $include "./modules/20_processing/substitution_may21/input/f20_quality_cost.cs3" $offdelim ; @@ -42,7 +42,7 @@ $ondelim $include "./modules/20_processing/input/f20_scp_processing_shares.csv" $offdelim; -parameter f20_scp_unitcosts(scptype) Costs of production of one unit of SCP exclusive of feedstock costs (USD per tDM) +parameter f20_scp_unitcosts(scptype) Costs of production of one unit of SCP exclusive of feedstock costs (USD17MER per tDM) / $ondelim $include "./modules/20_processing/input/f20_scp_unitcosts.csv" diff --git a/modules/32_forestry/dynamic_may24/declarations.gms b/modules/32_forestry/dynamic_may24/declarations.gms index fe6faa21f5..397e94a847 100644 --- a/modules/32_forestry/dynamic_may24/declarations.gms +++ b/modules/32_forestry/dynamic_may24/declarations.gms @@ -54,16 +54,16 @@ parameters p32_forestry_product_dist(t,i,kforestry) Distribution of wood products (1) p32_future_to_current_demand_ratio(t,i) Ratio of future and current timber demand (1) p32_demand_forestry_future(t,i,kforestry) Future forestry demand in current time step (tDM per yr) - p32_est_cost(type32) Establishment cost (USD per ha) + p32_est_cost(type32) Establishment cost (USD17MER per ha) ; positive variables vm_cost_fore(i) Forestry costs (Mio USD) - v32_cost_hvarea(i) Cost of harvesting timber from forests (mio. USD per yr) + v32_cost_hvarea(i) Cost of harvesting timber from forests (mio. USD17MER per yr) v32_land(j,type32,ac) Forestry land pools (mio. ha) v32_land_missing(j) Technical area balance term for timber plantation establishment (mio. ha) vm_landdiff_forestry Aggregated difference in forestry land compared to previous timestep (mio. ha) - v32_cost_recur(i) Recurring forest management costs (USD per ha) + v32_cost_recur(i) Recurring forest management costs (USD17MER per ha) v32_land_expansion(j,type32) Forestry land expansion (mio. ha) v32_land_reduction(j,type32,ac) Forestry land reduction (mio. ha) v32_cost_establishment(i) Cost of establishment calculated at the current time step (mio. USD) @@ -102,7 +102,7 @@ equations q32_cost_establishment(i) Present value of cost of establishment (mio. USD) q32_bgp_aff(j,ac) Biophysical afforestation calculation (mio. tCeq) q32_forestry_est(j,type32,ac) Distribution of forestry establishment over ac_est (mio. ha) - q32_cost_hvarea(i) Cost of harvesting timber from forests (mio. USD per yr) + q32_cost_hvarea(i) Cost of harvesting timber from forests (mio. USD17MER per yr) q32_prod_forestry(j) Production of woody biomass from commercial plantations (mio. tDM per yr) q32_bv_aff(j,potnatveg) Biodiversity value for aff forestry land (Mha) q32_bv_ndc(j,potnatveg) Biodiversity value for ndc forestry land (Mha) @@ -116,11 +116,11 @@ equations *#################### R SECTION START (OUTPUT DECLARATIONS) #################### parameters ov_cost_fore(t,i,type) Forestry costs (Mio USD) - ov32_cost_hvarea(t,i,type) Cost of harvesting timber from forests (mio. USD per yr) + ov32_cost_hvarea(t,i,type) Cost of harvesting timber from forests (mio. USD17MER per yr) ov32_land(t,j,type32,ac,type) Forestry land pools (mio. ha) ov32_land_missing(t,j,type) Technical area balance term for timber plantation establishment (mio. ha) ov_landdiff_forestry(t,type) Aggregated difference in forestry land compared to previous timestep (mio. ha) - ov32_cost_recur(t,i,type) Recurring forest management costs (USD per ha) + ov32_cost_recur(t,i,type) Recurring forest management costs (USD17MER per ha) ov32_land_expansion(t,j,type32,type) Forestry land expansion (mio. ha) ov32_land_reduction(t,j,type32,ac,type) Forestry land reduction (mio. ha) ov32_cost_establishment(t,i,type) Cost of establishment calculated at the current time step (mio. USD) @@ -153,7 +153,7 @@ parameters oq32_cost_establishment(t,i,type) Present value of cost of establishment (mio. USD) oq32_bgp_aff(t,j,ac,type) Biophysical afforestation calculation (mio. tCeq) oq32_forestry_est(t,j,type32,ac,type) Distribution of forestry establishment over ac_est (mio. ha) - oq32_cost_hvarea(t,i,type) Cost of harvesting timber from forests (mio. USD per yr) + oq32_cost_hvarea(t,i,type) Cost of harvesting timber from forests (mio. USD17MER per yr) oq32_prod_forestry(t,j,type) Production of woody biomass from commercial plantations (mio. tDM per yr) oq32_bv_aff(t,j,potnatveg,type) Biodiversity value for aff forestry land (Mha) oq32_bv_ndc(t,j,potnatveg,type) Biodiversity value for ndc forestry land (Mha) diff --git a/modules/32_forestry/dynamic_may24/input.gms b/modules/32_forestry/dynamic_may24/input.gms index 8e2bde9fea..6ffdb2cae8 100644 --- a/modules/32_forestry/dynamic_may24/input.gms +++ b/modules/32_forestry/dynamic_may24/input.gms @@ -24,16 +24,16 @@ $setglobal c32_shock_scenario none scalars s32_hvarea Flag for harvested area and establishemt (0=zero 1=exognous 2=endogneous) / 2 / - s32_est_cost_plant Establishment cost for plantations (USD per ha) / 2460 / - s32_est_cost_natveg Establishment cost for natural vegetation (USD per ha) / 2460 / - s32_recurring_cost Recurring costs (USD per ha) / 615 / - s32_harvesting_cost Harvesting cost (USD per ha) / 2460 / + s32_est_cost_plant Establishment cost for plantations (USD17MER per ha) / 2460 / + s32_est_cost_natveg Establishment cost for natural vegetation (USD17MER per ha) / 2460 / + s32_recurring_cost Recurring costs (USD17MER per ha) / 615 / + s32_harvesting_cost Harvesting cost (USD17MER per ha) / 2460 / s32_planing_horizon Afforestation planing horizon (years) / 50 / s32_rotation_extension Rotation extension factor 1=original rotations 2=100 percent increase in rotations etc (1) / 1 / s32_faustmann_rotation Switch to activate faustmann rotations (1=on 0=off) / 0 / s32_initial_distribution Switch to Activate ageclass distribution in plantations 0=off 1=equal distribution / 1 / - s32_price Price for timber (USD) / 55 / - s32_free_land_cost Penalty for technial area balance term (USD per ha) / 1e+06 / + s32_price Price for timber (USD17MER) / 55 / + s32_free_land_cost Penalty for technial area balance term (USD17MER per ha) / 1e+06 / s32_max_aff_area Maximum total global afforestation (mio. ha) / Inf / s32_aff_plantation Switch for using growth curves for afforestation 0=natveg 1=plantations (1) / 0 / s32_tcre_local Switch for local (1) or global (0) TRCE factors (1) / 1 / diff --git a/modules/56_ghg_policy/price_aug22/preloop.gms b/modules/56_ghg_policy/price_aug22/preloop.gms index 9d0f6d8887..460c233115 100644 --- a/modules/56_ghg_policy/price_aug22/preloop.gms +++ b/modules/56_ghg_policy/price_aug22/preloop.gms @@ -54,9 +54,9 @@ im_pollutant_prices(t_all,i,pollutants,emis_source)$(m_year(t_all) > sm_fix_SSP2 im_pollutant_prices(t_all,i,"co2_c",emis_source)$(m_year(t_all) > sm_fix_SSP2 AND m_year(t_all) <= m_year("%c56_mute_ghgprices_until%")) = s56_minimum_cprice; ***limit CH4 and N2O GHG prices based on s56_limit_ch4_n2o_price -*12/44 conversion from USD per tC to USD per tCO2 -*28 and 265 Global Warming Potentials from AR5 WG1 CH08 Table 8.7, conversion from USD per tCO2 to USD per tCH4 and USD per tN2O -*44/28 conversion from USD per tN2O to USD per tN +*12/44 conversion from USD17MER per tC to USD17MER per tCO2 +*28 and 265 Global Warming Potentials from AR5 WG1 CH08 Table 8.7, conversion from USD17MER per tCO2 to USD17MER per tCH4 and USD17MER per tN2O +*44/28 conversion from USD17MER per tN2O to USD17MER per tN im_pollutant_prices(t_all,i,"ch4",emis_source)$(im_pollutant_prices(t_all,i,"ch4",emis_source) > s56_limit_ch4_n2o_price*12/44*28) = s56_limit_ch4_n2o_price*12/44*28; im_pollutant_prices(t_all,i,"n2o_n_direct",emis_source)$(im_pollutant_prices(t_all,i,"n2o_n_direct",emis_source) > s56_limit_ch4_n2o_price*12/44*265*44/28) = s56_limit_ch4_n2o_price*12/44*265*44/28; im_pollutant_prices(t_all,i,"n2o_n_indirect",emis_source)$(im_pollutant_prices(t_all,i,"n2o_n_indirect",emis_source) > s56_limit_ch4_n2o_price*12/44*265*44/28) = s56_limit_ch4_n2o_price*12/44*265*44/28; diff --git a/modules/73_timber/default/declarations.gms b/modules/73_timber/default/declarations.gms index 67ced42c84..6f18cf0548 100644 --- a/modules/73_timber/default/declarations.gms +++ b/modules/73_timber/default/declarations.gms @@ -15,17 +15,17 @@ p73_demand_modifier(t_all) Simp p73_fraction(t_all) Fraction over which construction wood demand is spread out (1) p73_demand_constr_wood(t_all,i) Demand for construction wood (mio. tDM per yr) p73_fraction_sm_fix Modifier fraction at sm_fix_SSP2 time step (1) -im_timber_prod_cost(kforestry) Cost for producing one unit of wood and woodfuel (USD per tDM) +im_timber_prod_cost(kforestry) Cost for producing one unit of wood and woodfuel (USD17MER per tDM) ; positive variables -vm_cost_timber(i) Actual cost of harvesting timber from forests (mio. USD per yr) +vm_cost_timber(i) Actual cost of harvesting timber from forests (mio. USD17MER per yr) v73_prod_heaven_timber(j,kforestry) Production of woody biomass from heaven (mio. tDM per yr) v73_prod_residues(j) Production of residues from industrial roundwood harvest (mio. tDM per yr) ; equations -q73_cost_timber(i) Actual cost of harvesting timber from forests (mio. USD per yr) +q73_cost_timber(i) Actual cost of harvesting timber from forests (mio. USD17MER per yr) q73_prod_wood(j) Production of industrial roundwood (mio. tDM per yr) q73_prod_woodfuel(j) Production of wood fuel (mio. tDM per yr) q73_prod_residues(j) Production of residues from industrial roundwood harvest (mio. tDM per yr) @@ -34,10 +34,10 @@ q73_prod_residues(j) Prod *#################### R SECTION START (OUTPUT DECLARATIONS) #################### parameters - ov_cost_timber(t,i,type) Actual cost of harvesting timber from forests (mio. USD per yr) + ov_cost_timber(t,i,type) Actual cost of harvesting timber from forests (mio. USD17MER per yr) ov73_prod_heaven_timber(t,j,kforestry,type) Production of woody biomass from heaven (mio. tDM per yr) ov73_prod_residues(t,j,type) Production of residues from industrial roundwood harvest (mio. tDM per yr) - oq73_cost_timber(t,i,type) Actual cost of harvesting timber from forests (mio. USD per yr) + oq73_cost_timber(t,i,type) Actual cost of harvesting timber from forests (mio. USD17MER per yr) oq73_prod_wood(t,j,type) Production of industrial roundwood (mio. tDM per yr) oq73_prod_woodfuel(t,j,type) Production of wood fuel (mio. tDM per yr) oq73_prod_residues(t,j,type) Production of residues from industrial roundwood harvest (mio. tDM per yr) diff --git a/modules/73_timber/default/input.gms b/modules/73_timber/default/input.gms index afb194f52b..2e2f7d9356 100644 --- a/modules/73_timber/default/input.gms +++ b/modules/73_timber/default/input.gms @@ -18,7 +18,7 @@ scalars * inflated using USD05 --> USD17 rate of 1.23 s73_timber_prod_cost_wood Cost for producing one unit of wood (USD17MER per tDM) / 148 / s73_timber_prod_cost_woodfuel Cost for prodcing one unit of woodfuel (USD17MER per tDM) / 74 / - s73_free_prod_cost Very high cost for settling demand without production (USD per tDM) / 24600 / + s73_free_prod_cost Very high cost for settling demand without production (USD17MER per tDM) / 24600 / s73_timber_demand_switch Logical switch to turn on or off timber demand 1=on 0=off (1) / 1 / s73_increase_ceiling Limiter for not allowing a demand jump between time steps beyond a certain limit (1) / 1.025 / s73_residue_ratio Proportion of overall industrial roundwood production which ends up as residue during harvest (1) / 0.15 / From b649f770e94240f4f82b7790a1a9bb7b79fc9e29 Mon Sep 17 00:00:00 2001 From: Debbora Leip Date: Thu, 26 Sep 2024 16:37:31 +0200 Subject: [PATCH 026/206] updated some more currency units --- config/default.cfg | 2 +- modules/15_food/anthro_iso_jun22/equations.gms | 2 ++ .../anthropometrics_jan18/declarations.gms | 16 ++++++++-------- .../15_food/anthropometrics_jan18/equations.gms | 2 ++ .../35_natveg/pot_forest_may24/declarations.gms | 8 ++++---- modules/36_employment/exo_may22/declarations.gms | 10 +++++----- modules/36_employment/exo_may22/input.gms | 2 +- modules/70_livestock/fbask_jan16/equations.gms | 2 ++ .../fbask_jan16_sticky/equations.gms | 2 ++ 9 files changed, 27 insertions(+), 19 deletions(-) diff --git a/config/default.cfg b/config/default.cfg index 5d65a338e5..d9e136b4a8 100644 --- a/config/default.cfg +++ b/config/default.cfg @@ -2022,7 +2022,7 @@ s73_cost_multiplier <- 1.5 # def = 1.5 # Cost of production without using any land in case the model is running into infeasibilities. # This is a last ditch effort for the model and the variable associated with this cost -# should not be used in a normally feasible model run (USD/tDM) +# should not be used in a normally feasible model run (USD17MER/tDM) s73_free_prod_cost <- 1230000 # def = 1000000 * 1.23 # Switch for modifying woody biomass demand starting in 2035 diff --git a/modules/15_food/anthro_iso_jun22/equations.gms b/modules/15_food/anthro_iso_jun22/equations.gms index 2ae2d6014b..f631e37002 100644 --- a/modules/15_food/anthro_iso_jun22/equations.gms +++ b/modules/15_food/anthro_iso_jun22/equations.gms @@ -165,6 +165,8 @@ q15_regr_kcal(iso) .. *' This equation estimates key dietary composition regressision factors, *' such as the share of animal products, empty calories, or *' fruits, vegetables and nuts. +*' Note that regression coefficients are still based on USD05PPP values, but apllied +*' to income in USD17PPP since monetary units in MAgPIE have been updated. q15_regr(iso, regr15) .. v15_demand_regr(iso, regr15) =e= diff --git a/modules/15_food/anthropometrics_jan18/declarations.gms b/modules/15_food/anthropometrics_jan18/declarations.gms index 9ba90a94b5..6a6f9bfd9d 100644 --- a/modules/15_food/anthropometrics_jan18/declarations.gms +++ b/modules/15_food/anthropometrics_jan18/declarations.gms @@ -20,8 +20,8 @@ positive variables equations - q15_aim Objective function of food demand model (mio. USD05PPP) - q15_budget(iso) Household budget constraint (USD05PPP per cap per day) + q15_aim Objective function of food demand model (mio. USD17PPP) + q15_budget(iso) Household budget constraint (USD17PPP per cap per day) q15_regr_bmi_shr(iso,sex,agegroup15,bmi_tree15) Estimates regression parameters for BMI regression shares (1) q15_bmi_shr_verylow(iso,sex,agegroup15) Estimates BMI share for population groups with low BMI (1) @@ -47,8 +47,8 @@ positive variables v15_kcal_regr(iso,kfo) Uncalibrated regression estimates of calorie demand (kcal per cap per day) v15_kcal_regr_total(iso) Uncalibrated regression estimates of total per cap calories (kcal per cap per day) v15_demand_regr(iso, regr15) Uncalibrated regression estimates of kcal shares (1) - v15_income_pc_real_ppp_iso(iso) Real income per cap (USD05PPP per cap) - v15_income_balance(iso) Balance variable to balance cases in which reduction in income is larger than the per capita GDP (USD05PPP per cap per yr) + v15_income_pc_real_ppp_iso(iso) Real income per cap (USD17PPP per cap) + v15_income_balance(iso) Balance variable to balance cases in which reduction in income is larger than the per capita GDP (USD17PPP per cap per yr) v15_kcal_intake_total_regr(iso) Food intake (kcal per cap per day) v15_regr_overgroups(iso,sex,agegroup15,bmi_tree15) Hierarchical tree parameter regressions (1) v15_bmi_shr_regr(iso,sex,age,bmi_group15) Uncalibrated share of population groups belonging to a certain BMI group (1) @@ -56,7 +56,7 @@ positive variables ; variables - v15_objective Objective term (USD05PPP) + v15_objective Objective term (USD17PPP) ; scalars @@ -83,8 +83,8 @@ parameters p15_exo_food_scenario_fader(t_all) Exogenous diet scenario fader (1) * prices - p15_prices_kcal(t,iso,kfo,iter15) Prices from MAgPIE after optimization (USD05PPP per kcal) - i15_prices_initial_kcal(iso,kfo) Initial prices that capture the approximate level of prices in 1961-2010 (USD05PPP per kcal) + p15_prices_kcal(t,iso,kfo,iter15) Prices from MAgPIE after optimization (USD17PPP per kcal) + i15_prices_initial_kcal(iso,kfo) Initial prices that capture the approximate level of prices in 1961-2010 (USD17PPP per kcal) * anthropometrics o15_bmi_shr(t,iso,sex,age,bmi_group15) Calibrated estimates BMI share for population groups (1) @@ -176,7 +176,7 @@ parameters p15_foodscen_region_shr(t_all,i) Weighted share of region with regards to diet scenario of countries (1) * calculate diet iteration breakpoint - p15_income_pc_real_ppp(t,i) Regional per capita income after price shock on regional level (USD05PPP per capita) + p15_income_pc_real_ppp(t,i) Regional per capita income after price shock on regional level (USD17PPP per capita) p15_delta_income(t,i,iter15) Regional change in per capita income due to price shock on regional level (1) ; diff --git a/modules/15_food/anthropometrics_jan18/equations.gms b/modules/15_food/anthropometrics_jan18/equations.gms index 0506f61ff2..755ba8a0cb 100644 --- a/modules/15_food/anthropometrics_jan18/equations.gms +++ b/modules/15_food/anthropometrics_jan18/equations.gms @@ -165,6 +165,8 @@ q15_regr_kcal(iso) .. *' This equation estimates key dietary composition regressision factors, *' such as the share of animal products, empty calories, or *' fruits, vegetables and nuts. +*' Note that regression coefficients are still based on USD05PPP values, but apllied +*' to income in USD17PPP since monetary units in MAgPIE have been updated. q15_regr(iso, regr15) .. v15_demand_regr(iso, regr15) =e= diff --git a/modules/35_natveg/pot_forest_may24/declarations.gms b/modules/35_natveg/pot_forest_may24/declarations.gms index a583d4da6c..7ce8011d26 100644 --- a/modules/35_natveg/pot_forest_may24/declarations.gms +++ b/modules/35_natveg/pot_forest_may24/declarations.gms @@ -60,7 +60,7 @@ equations q35_prod_secdforest(j) Production of woody biomass from secondary forests (mio. tDM per yr) q35_prod_primforest(j) Production of woody biomass from primary forests (mio. tDM per yr) q35_prod_other(j) Production of woody biomass from other land (mio. tDM per yr) - q35_cost_hvarea(i) Cost of harvesting natural vegetation (mio. USD) + q35_cost_hvarea(i) Cost of harvesting natural vegetation (mio. USD17MER) q35_bv_primforest(j,potnatveg) Biodiversity value of primary forest (mio. ha) q35_bv_secdforest(j,potnatveg) Biodiversity value of secondary forest (mio. ha) q35_bv_other(j,potnatveg) Biodiversity value of other land (mio. ha) @@ -82,7 +82,7 @@ positive variables v35_hvarea_other(j,othertype35,ac) Harvested area from other land (mio. ha) v35_hvarea_primforest(j) Harvested area from primary forest (mio. ha) vm_prod_natveg(j,land_natveg,kforestry) Production of woody biomass from natural vegetation (mio. tDM per yr) - vm_cost_hvarea_natveg(i) Cost of harvesting natural vegetation (mio. USD) + vm_cost_hvarea_natveg(i) Cost of harvesting natural vegetation (mio. USD17MER) ; @@ -100,7 +100,7 @@ parameters ov35_hvarea_other(t,j,othertype35,ac,type) Harvested area from other land (mio. ha) ov35_hvarea_primforest(t,j,type) Harvested area from primary forest (mio. ha) ov_prod_natveg(t,j,land_natveg,kforestry,type) Production of woody biomass from natural vegetation (mio. tDM per yr) - ov_cost_hvarea_natveg(t,i,type) Cost of harvesting natural vegetation (mio. USD) + ov_cost_hvarea_natveg(t,i,type) Cost of harvesting natural vegetation (mio. USD17MER) oq35_land_secdforest(t,j,type) Secdforest land pool calculation (mio. ha) oq35_land_other(t,j,type) Other land pool calculation (mio. ha) oq35_carbon_primforest(t,j,ag_pools,stockType,type) Primforest carbon stock calculation (mio tC) @@ -125,7 +125,7 @@ parameters oq35_prod_secdforest(t,j,type) Production of woody biomass from secondary forests (mio. tDM per yr) oq35_prod_primforest(t,j,type) Production of woody biomass from primary forests (mio. tDM per yr) oq35_prod_other(t,j,type) Production of woody biomass from other land (mio. tDM per yr) - oq35_cost_hvarea(t,i,type) Cost of harvesting natural vegetation (mio. USD) + oq35_cost_hvarea(t,i,type) Cost of harvesting natural vegetation (mio. USD17MER) oq35_bv_primforest(t,j,potnatveg,type) Biodiversity value of primary forest (mio. ha) oq35_bv_secdforest(t,j,potnatveg,type) Biodiversity value of secondary forest (mio. ha) oq35_bv_other(t,j,potnatveg,type) Biodiversity value of other land (mio. ha) diff --git a/modules/36_employment/exo_may22/declarations.gms b/modules/36_employment/exo_may22/declarations.gms index 78002b9d20..60bc8d96f1 100644 --- a/modules/36_employment/exo_may22/declarations.gms +++ b/modules/36_employment/exo_may22/declarations.gms @@ -17,15 +17,15 @@ positive variables ; parameters - p36_hourly_costs_iso(t_all,iso, wage_scen) Hourly labor costs in agriculture on iso level before and after including wage scenario (USDMER05 per hour) - p36_hourly_costs_increase(iso) Difference between minimum hourly labor costs and actual hourly labor costs in 2050 (USDMER05 per hour) - pm_hourly_costs(t,i, wage_scen) Hourly labor costs in agriculture on regional level before and after including wage scenario (USDMER05 per hour) + p36_hourly_costs_iso(t_all,iso, wage_scen) Hourly labor costs in agriculture on iso level before and after including wage scenario (USD17MER per hour) + p36_hourly_costs_increase(iso) Difference between minimum hourly labor costs and actual hourly labor costs in 2050 (USD17MER per hour) + pm_hourly_costs(t,i, wage_scen) Hourly labor costs in agriculture on regional level before and after including wage scenario (USD17MER per hour) pm_productivity_gain_from_wages(t,i) Multiplicative factor describing productivity gain related to higher wages (1) p36_total_hours_worked(iso) Total hours worked by all employed people (mio. hours per year) - p36_calibration_hourly_costs(iso) Additive calibration term for hourly labor costs (USDMER05 per hour) + p36_calibration_hourly_costs(iso) Additive calibration term for hourly labor costs (USD17MER per hour) p36_cost_share(t,i) Capital share of factor costs (1) p36_share_calibration(i) Additive calibration term for capital shares (1) - p36_nonmagpie_labor_costs(t,i) Labor costs from subsidies and Value of Production not covered by MAgPIE (mio. USDMER05) + p36_nonmagpie_labor_costs(t,i) Labor costs from subsidies and Value of Production not covered by MAgPIE (mio. USD17MER) ; *#################### R SECTION START (OUTPUT DECLARATIONS) #################### diff --git a/modules/36_employment/exo_may22/input.gms b/modules/36_employment/exo_may22/input.gms index 7005029c52..994887e337 100644 --- a/modules/36_employment/exo_may22/input.gms +++ b/modules/36_employment/exo_may22/input.gms @@ -7,7 +7,7 @@ scalars s36_weeks_in_year number of weeks in a year (weeks per yr) / 52.1429 / -s36_minimum_wage global minimum wage (USDMER05 per hour) / 0 / +s36_minimum_wage global minimum wage (USD17MER per hour) / 0 / s36_scale_productivity_with_wage how strong the wage increase should affect labor productivity (1) / 0 / ; diff --git a/modules/70_livestock/fbask_jan16/equations.gms b/modules/70_livestock/fbask_jan16/equations.gms index 53e594a19c..4dac6e5550 100644 --- a/modules/70_livestock/fbask_jan16/equations.gms +++ b/modules/70_livestock/fbask_jan16/equations.gms @@ -28,6 +28,8 @@ q70_feed(i2,kap,kall) .. *' 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. +*' Note that regression coefficients are still based on USD04MER values, while other +*' monetary units in MAgPIE have been updated to USD17MER. *' 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 diff --git a/modules/70_livestock/fbask_jan16_sticky/equations.gms b/modules/70_livestock/fbask_jan16_sticky/equations.gms index 5febb63386..4723936d59 100644 --- a/modules/70_livestock/fbask_jan16_sticky/equations.gms +++ b/modules/70_livestock/fbask_jan16_sticky/equations.gms @@ -28,6 +28,8 @@ q70_feed(i2,kap,kall) .. *' 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. +*' Note that regression coefficients are still based on USD04MER values, while other +*' monetary units in MAgPIE have been updated to USD17MER. *' 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 From 8f33e047036694125b50e1b0b549ce0cd982474a Mon Sep 17 00:00:00 2001 From: florianh Date: Thu, 26 Sep 2024 18:57:42 +0200 Subject: [PATCH 027/206] macc USD unit corrections --- config/default.cfg | 4 ++-- modules/57_maccs/on_aug22/declarations.gms | 16 ++++++++-------- modules/57_maccs/on_aug22/preloop.gms | 9 ++++++--- 3 files changed, 16 insertions(+), 13 deletions(-) diff --git a/config/default.cfg b/config/default.cfg index 5d65a338e5..72def63bce 100644 --- a/config/default.cfg +++ b/config/default.cfg @@ -2022,8 +2022,8 @@ s73_cost_multiplier <- 1.5 # def = 1.5 # Cost of production without using any land in case the model is running into infeasibilities. # This is a last ditch effort for the model and the variable associated with this cost -# should not be used in a normally feasible model run (USD/tDM) -s73_free_prod_cost <- 1230000 # def = 1000000 * 1.23 +# should not be used in a normally feasible model run (USD17MER/tDM) +s73_free_prod_cost <- 1000000 # def = 1000000 # Switch for modifying woody biomass demand starting in 2035 # * ("default") = Default paper demand diff --git a/modules/57_maccs/on_aug22/declarations.gms b/modules/57_maccs/on_aug22/declarations.gms index b9db4d40c4..d36d57dc60 100644 --- a/modules/57_maccs/on_aug22/declarations.gms +++ b/modules/57_maccs/on_aug22/declarations.gms @@ -6,29 +6,29 @@ *** | Contact: magpie@pik-potsdam.de scalars - s57_step_length Step length in MACC data (yr) + s57_step_length Step length in MACC data (USD17MER) ; parameters im_maccs_mitigation(t,i,emis_source,pollutants) Technical mitigation of GHG emissions (percent) i57_mac_step_n2o(t,i,emis_source) Helper to map N2O prices and maccs_steps (1) i57_mac_step_ch4(t,i,emis_source) Helper to map CH4 prices and maccs_steps (1) - p57_maccs_costs_integral(t,i,emis_source,pollutants) Costs of technical mitigation (USD95MER per Tg N CH4 C) + p57_maccs_costs_integral(t,i,emis_source,pollutants) Costs of technical mitigation (USD17MER per Tg N CH4 C) ; equations - q57_labor_costs(i) Calculation of labor costs of technical mitigation (mio. USD95MER per yr) - q57_capital_costs(i) Calculation of capital costs of technical mitigation (mio. USD95MER per yr) + q57_labor_costs(i) Calculation of labor costs of technical mitigation (mio. USD17MER per yr) + q57_capital_costs(i) Calculation of capital costs of technical mitigation (mio. USD17MER per yr) ; positive variables - vm_maccs_costs(i,factors) Costs of technical mitigation of GHG emissions (mio. USD95MER per yr) + vm_maccs_costs(i,factors) Costs of technical mitigation of GHG emissions (mio. USD17MER per yr) ; *#################### R SECTION START (OUTPUT DECLARATIONS) #################### parameters - ov_maccs_costs(t,i,factors,type) Costs of technical mitigation of GHG emissions (mio. USD95MER per yr) - oq57_labor_costs(t,i,type) Calculation of labor costs of technical mitigation (mio. USD95MER per yr) - oq57_capital_costs(t,i,type) Calculation of capital costs of technical mitigation (mio. USD95MER per yr) + ov_maccs_costs(t,i,factors,type) Costs of technical mitigation of GHG emissions (mio. USD17MER per yr) + oq57_labor_costs(t,i,type) Calculation of labor costs of technical mitigation (mio. USD17MER per yr) + oq57_capital_costs(t,i,type) Calculation of capital costs of technical mitigation (mio. USD17MER per yr) ; *##################### R SECTION END (OUTPUT DECLARATIONS) ##################### diff --git a/modules/57_maccs/on_aug22/preloop.gms b/modules/57_maccs/on_aug22/preloop.gms index 9dec38e391..3504fe5c91 100644 --- a/modules/57_maccs/on_aug22/preloop.gms +++ b/modules/57_maccs/on_aug22/preloop.gms @@ -5,14 +5,17 @@ *** | MAgPIE License Exception, version 1.0 (see LICENSE file). *** | Contact: magpie@pik-potsdam.de -$if "%c57_macc_version%" == "PBL_2007" s57_step_length = 5; +* inflated using USD05 --> USD17 MER rate: 5 * 1.23 +$if "%c57_macc_version%" == "PBL_2007" s57_step_length = 6.15; +* inflated using USD10 --> USD17 MER rate: 20 * 1 $if "%c57_macc_version%" == "PBL_2019" s57_step_length = 20; +* inflated using USD10 --> USD17 MER rate: 20 * 1 $if "%c57_macc_version%" == "PBL_2022" s57_step_length = 20; $ontext Determine level of GHG emission abatement depending on GHG prices. -There are 201 abatement steps. Each step is 5 USD per tC eq in case of PBL_2007 and -20 USD per tC eq in case of PBL_2019. +There are 201 abatement steps. Each step is 6.15 USD17MER per tC eq in case of PBL_2007 and +20 USD17MER per tC eq in case of PBL_2019. Since the GHG prices are in USD per ton N and USD per ton CH4, conversion to USD per ton C eq is needed. In this realization, the IPCC AR4 global warming potential factor for N2O (298) and CH4 (25) are used because PBL used these parameters to convert USD per ton N2O and USD per ton CH4 into USD per ton C eq. From 2d2c3d6242644d6286fbba022e7992abb19cb35d Mon Sep 17 00:00:00 2001 From: Debbora Leip Date: Thu, 26 Sep 2024 19:07:42 +0200 Subject: [PATCH 028/206] update in livestock regression and cost share regressions --- config/default.cfg | 2 +- modules/15_food/anthro_iso_jun22/equations.gms | 2 -- modules/15_food/anthropometrics_jan18/equations.gms | 2 -- modules/36_employment/exo_may22/presolve.gms | 4 ++-- modules/38_factor_costs/per_ton_fao_may22/presolve.gms | 4 ++-- modules/38_factor_costs/sticky_feb18/presolve.gms | 4 ++-- modules/38_factor_costs/sticky_labor/preloop.gms | 4 ++-- modules/70_livestock/fbask_jan16/equations.gms | 2 -- modules/70_livestock/fbask_jan16/input.gms | 2 +- modules/70_livestock/fbask_jan16_sticky/equations.gms | 2 -- modules/70_livestock/fbask_jan16_sticky/input.gms | 2 +- 11 files changed, 11 insertions(+), 19 deletions(-) diff --git a/config/default.cfg b/config/default.cfg index 72def63bce..40ae3ff390 100644 --- a/config/default.cfg +++ b/config/default.cfg @@ -25,7 +25,7 @@ cfg$model <- "main.gms" #def = "main.gms" cfg$input <- c(regional = "rev4.112_h12_magpie.tgz", cellular = "rev4.112_h12_fd712c0b_cellularmagpie_c200_MRI-ESM2-0-ssp370_lpjml-8e6c5eb1.tgz", validation = "rev4.112_h12_magpie.tgz", - additional = "additional_data_rev4.55.tgz", + additional = "additional_data_rev4.56.tgz", calibration = "calibration_H12_26Mar24_fixed.tgz") # NOTE: It is recommended to recalibrate the model when changing cellular input data diff --git a/modules/15_food/anthro_iso_jun22/equations.gms b/modules/15_food/anthro_iso_jun22/equations.gms index f631e37002..2ae2d6014b 100644 --- a/modules/15_food/anthro_iso_jun22/equations.gms +++ b/modules/15_food/anthro_iso_jun22/equations.gms @@ -165,8 +165,6 @@ q15_regr_kcal(iso) .. *' This equation estimates key dietary composition regressision factors, *' such as the share of animal products, empty calories, or *' fruits, vegetables and nuts. -*' Note that regression coefficients are still based on USD05PPP values, but apllied -*' to income in USD17PPP since monetary units in MAgPIE have been updated. q15_regr(iso, regr15) .. v15_demand_regr(iso, regr15) =e= diff --git a/modules/15_food/anthropometrics_jan18/equations.gms b/modules/15_food/anthropometrics_jan18/equations.gms index 755ba8a0cb..0506f61ff2 100644 --- a/modules/15_food/anthropometrics_jan18/equations.gms +++ b/modules/15_food/anthropometrics_jan18/equations.gms @@ -165,8 +165,6 @@ q15_regr_kcal(iso) .. *' This equation estimates key dietary composition regressision factors, *' such as the share of animal products, empty calories, or *' fruits, vegetables and nuts. -*' Note that regression coefficients are still based on USD05PPP values, but apllied -*' to income in USD17PPP since monetary units in MAgPIE have been updated. q15_regr(iso, regr15) .. v15_demand_regr(iso, regr15) =e= diff --git a/modules/36_employment/exo_may22/presolve.gms b/modules/36_employment/exo_may22/presolve.gms index 48683a10e1..fc00b55a6d 100644 --- a/modules/36_employment/exo_may22/presolve.gms +++ b/modules/36_employment/exo_may22/presolve.gms @@ -6,12 +6,12 @@ *** | Contact: magpie@pik-potsdam.de * capital cost share to split non-magpie factor costs into labor and capital -p36_share_calibration(i) = f36_hist_cap_share("y2010",i)-(f36_regr_cap_share("slope")*log10(sum(i_to_iso(i,iso),im_gdp_pc_ppp_iso("y2010",iso)))+f36_regr_cap_share("intercept")); +p36_share_calibration(i) = f36_hist_cap_share("y2010",i)-(f36_regr_cap_share("slope")*log10(sum(i_to_iso(i,iso),(im_gdp_pc_ppp_iso("y2010",iso) * fm_gdp_defl_ppp(iso))))+f36_regr_cap_share("intercept")); if (m_year(t)<2010, p36_cost_share(t,i) = f36_hist_cap_share(t,i); elseif (m_year(t)>=2010), - p36_cost_share(t,i) = f36_regr_cap_share("slope")*log10(sum(i_to_iso(i,iso),im_gdp_pc_ppp_iso(t,iso)))+f36_regr_cap_share("intercept")+p36_share_calibration(i); + p36_cost_share(t,i) = f36_regr_cap_share("slope")*log10(sum(i_to_iso(i,iso),(im_gdp_pc_ppp_iso(t,iso) * fm_gdp_defl_ppp(iso))))+f36_regr_cap_share("intercept")+p36_share_calibration(i); ); *' @code diff --git a/modules/38_factor_costs/per_ton_fao_may22/presolve.gms b/modules/38_factor_costs/per_ton_fao_may22/presolve.gms index 1bf4bad5c6..58300986ba 100644 --- a/modules/38_factor_costs/per_ton_fao_may22/presolve.gms +++ b/modules/38_factor_costs/per_ton_fao_may22/presolve.gms @@ -21,13 +21,13 @@ else i38_fac_req(t,i,kcr) = i38_fac_req(t,i,kcr); ); -p38_share_calibration(i) = f38_historical_share("y2010",i)-(f38_reg_parameters("slope")*log10(sum(i_to_iso(i,iso),im_gdp_pc_ppp_iso("y2010",iso)))+f38_reg_parameters("intercept")); +p38_share_calibration(i) = f38_historical_share("y2010",i)-(f38_reg_parameters("slope")*log10(sum(i_to_iso(i,iso),(im_gdp_pc_ppp_iso("y2010",iso) * fm_gdp_defl_ppp(iso))))+f38_reg_parameters("intercept")); if (m_year(t)<2010, pm_cost_share_crops(t,i,"capital") = f38_historical_share(t,i); pm_cost_share_crops(t,i,"labor") = 1 - f38_historical_share(t,i); elseif (m_year(t)>=2010), - pm_cost_share_crops(t,i,"capital") = f38_reg_parameters("slope")*log10(sum(i_to_iso(i,iso),im_gdp_pc_ppp_iso(t,iso)))+f38_reg_parameters("intercept")+p38_share_calibration(i); + pm_cost_share_crops(t,i,"capital") = f38_reg_parameters("slope")*log10(sum(i_to_iso(i,iso),(im_gdp_pc_ppp_iso(t,iso) * fm_gdp_defl_ppp(iso))))+f38_reg_parameters("intercept")+p38_share_calibration(i); pm_cost_share_crops(t,i,"labor") = 1 - pm_cost_share_crops(t,i,"capital"); ); diff --git a/modules/38_factor_costs/sticky_feb18/presolve.gms b/modules/38_factor_costs/sticky_feb18/presolve.gms index 99eeaa61d3..c770b89f7a 100644 --- a/modules/38_factor_costs/sticky_feb18/presolve.gms +++ b/modules/38_factor_costs/sticky_feb18/presolve.gms @@ -9,14 +9,14 @@ if (smax(j, pm_labor_prod(t,j)) <> 1 OR smin(j, pm_labor_prod(t,j)) <> 1, abort "This factor cost realization cannot handle labor productivities != 1" ); -p38_share_calibration(i) = f38_historical_share("y2010",i)-(f38_reg_parameters("slope")*log10(sum(i_to_iso(i,iso),im_gdp_pc_ppp_iso("y2010",iso)))+f38_reg_parameters("intercept")); +p38_share_calibration(i) = f38_historical_share("y2010",i)-(f38_reg_parameters("slope")*log10(sum(i_to_iso(i,iso),(im_gdp_pc_ppp_iso("y2010",iso) * fm_gdp_defl_ppp(iso))))+f38_reg_parameters("intercept")); if (m_year(t)<2010, pm_cost_share_crops(t,i,"capital") = f38_historical_share(t,i); pm_cost_share_crops(t,i,"labor") = 1 - f38_historical_share(t,i); elseif (m_year(t)>=2010), - pm_cost_share_crops(t,i,"capital") = f38_reg_parameters("slope")*log10(sum(i_to_iso(i,iso),im_gdp_pc_ppp_iso(t,iso)))+f38_reg_parameters("intercept")+p38_share_calibration(i); + pm_cost_share_crops(t,i,"capital") = f38_reg_parameters("slope")*log10(sum(i_to_iso(i,iso),(im_gdp_pc_ppp_iso(t,iso) * fm_gdp_defl_ppp(iso))))+f38_reg_parameters("intercept")+p38_share_calibration(i); pm_cost_share_crops(t,i,"labor") = 1 - pm_cost_share_crops(t,i,"capital"); ); diff --git a/modules/38_factor_costs/sticky_labor/preloop.gms b/modules/38_factor_costs/sticky_labor/preloop.gms index 8fb3829096..931c760de7 100644 --- a/modules/38_factor_costs/sticky_labor/preloop.gms +++ b/modules/38_factor_costs/sticky_labor/preloop.gms @@ -11,9 +11,9 @@ s38_ces_elast_par = (1/s38_ces_elast_subst) - 1 ; p38_intr_depr(t,i) = (1-s38_depreciation_rate) * pm_interest(t,i)/(1+pm_interest(t,i)) + s38_depreciation_rate; * calculate labor/capital cost shares from regression -p38_share_calibration(i) = f38_historical_share("y2010",i)-(f38_reg_parameters("slope")*log10(sum(i_to_iso(i,iso),im_gdp_pc_ppp_iso("y2010",iso)))+f38_reg_parameters("intercept")); +p38_share_calibration(i) = f38_historical_share("y2010",i)-(f38_reg_parameters("slope")*log10(sum(i_to_iso(i,iso),(im_gdp_pc_ppp_iso("y2010",iso) * fm_gdp_defl_ppp(iso)))+f38_reg_parameters("intercept")); pm_cost_share_crops(t,i,"capital")$(m_year(t)<2010) = f38_historical_share(t,i); -pm_cost_share_crops(t,i,"capital")$(m_year(t)>=2010) = f38_reg_parameters("slope")*log10(sum(i_to_iso(i,iso),im_gdp_pc_ppp_iso(t,iso)))+f38_reg_parameters("intercept")+p38_share_calibration(i); +pm_cost_share_crops(t,i,"capital")$(m_year(t)>=2010) = f38_reg_parameters("slope")*log10(sum(i_to_iso(i,iso),(im_gdp_pc_ppp_iso(t,iso) * fm_gdp_defl_ppp(iso))))+f38_reg_parameters("intercept")+p38_share_calibration(i); pm_cost_share_crops(t,i,"labor") = 1 - pm_cost_share_crops(t,i,"capital"); diff --git a/modules/70_livestock/fbask_jan16/equations.gms b/modules/70_livestock/fbask_jan16/equations.gms index 4dac6e5550..53e594a19c 100644 --- a/modules/70_livestock/fbask_jan16/equations.gms +++ b/modules/70_livestock/fbask_jan16/equations.gms @@ -28,8 +28,6 @@ q70_feed(i2,kap,kall) .. *' 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. -*' Note that regression coefficients are still based on USD04MER values, while other -*' monetary units in MAgPIE have been updated to USD17MER. *' 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 diff --git a/modules/70_livestock/fbask_jan16/input.gms b/modules/70_livestock/fbask_jan16/input.gms index 85419c8398..8156155b8a 100644 --- a/modules/70_livestock/fbask_jan16/input.gms +++ b/modules/70_livestock/fbask_jan16/input.gms @@ -46,7 +46,7 @@ $ondelim $include "./modules/70_livestock/fbask_jan16/input/f70_livestock_productivity.cs3" $offdelim; -table f70_cost_regr(kap,cost_regr) Factor requirements livestock (USD04 per tDM (A) and USD (B)) +table f70_cost_regr(kap,cost_regr) Factor requirements livestock (USD17MER per tDM (A) and USD17MER (B)) $ondelim $include "./modules/70_livestock/fbask_jan16/input/f70_capit_liv_regr.csv" $offdelim diff --git a/modules/70_livestock/fbask_jan16_sticky/equations.gms b/modules/70_livestock/fbask_jan16_sticky/equations.gms index 4723936d59..5febb63386 100644 --- a/modules/70_livestock/fbask_jan16_sticky/equations.gms +++ b/modules/70_livestock/fbask_jan16_sticky/equations.gms @@ -28,8 +28,6 @@ q70_feed(i2,kap,kall) .. *' 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. -*' Note that regression coefficients are still based on USD04MER values, while other -*' monetary units in MAgPIE have been updated to USD17MER. *' 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 diff --git a/modules/70_livestock/fbask_jan16_sticky/input.gms b/modules/70_livestock/fbask_jan16_sticky/input.gms index df5083ba8b..dd728cd7ad 100644 --- a/modules/70_livestock/fbask_jan16_sticky/input.gms +++ b/modules/70_livestock/fbask_jan16_sticky/input.gms @@ -48,7 +48,7 @@ $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)) +table f70_cost_regr(kap,cost_regr) Factor requirements livestock (USD17MER per tDM (A) and USD17MER (B)) $ondelim $include "./modules/70_livestock/fbask_jan16_sticky/input/f70_capit_liv_regr.csv" $offdelim From 9ace917a309a696bb798e5ef566857cd693e6faa Mon Sep 17 00:00:00 2001 From: florianh Date: Thu, 26 Sep 2024 22:42:32 +0200 Subject: [PATCH 029/206] defaults --- modules/15_food/anthropometrics_jan18/declarations.gms | 10 +++++----- modules/29_cropland/simple_apr24/input.gms | 2 +- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/modules/15_food/anthropometrics_jan18/declarations.gms b/modules/15_food/anthropometrics_jan18/declarations.gms index 6a6f9bfd9d..9bd4ef6563 100644 --- a/modules/15_food/anthropometrics_jan18/declarations.gms +++ b/modules/15_food/anthropometrics_jan18/declarations.gms @@ -236,16 +236,16 @@ parameters ov15_kcal_regr(t,iso,kfo,type) Uncalibrated regression estimates of calorie demand (kcal per cap per day) ov15_kcal_regr_total(t,iso,type) Uncalibrated regression estimates of total per cap calories (kcal per cap per day) ov15_demand_regr(t,iso,regr15,type) Uncalibrated regression estimates of kcal shares (1) - ov15_income_pc_real_ppp_iso(t,iso,type) Real income per cap (USD05PPP per cap) - ov15_income_balance(t,iso,type) Balance variable to balance cases in which reduction in income is larger than the per capita GDP (USD05PPP per cap per yr) + ov15_income_pc_real_ppp_iso(t,iso,type) Real income per cap (USD17PPP per cap) + ov15_income_balance(t,iso,type) Balance variable to balance cases in which reduction in income is larger than the per capita GDP (USD17PPP per cap per yr) ov15_kcal_intake_total_regr(t,iso,type) Food intake (kcal per cap per day) ov15_regr_overgroups(t,iso,sex,agegroup15,bmi_tree15,type) Hierarchical tree parameter regressions (1) ov15_bmi_shr_regr(t,iso,sex,age,bmi_group15,type) Uncalibrated share of population groups belonging to a certain BMI group (1) ov15_bmi_shr_overgroups(t,iso,sex,agegroup15,bmi_group15,type) Uncalibrated share of population groups belonging to a certain BMI group (1) - ov15_objective(t,type) Objective term (USD05PPP) + ov15_objective(t,type) Objective term (USD17PPP) oq15_food_demand(t,i,kfo,type) Food demand (mio. kcal) - oq15_aim(t,type) Objective function of food demand model (mio. USD05PPP) - oq15_budget(t,iso,type) Household budget constraint (USD05PPP per cap per day) + oq15_aim(t,type) Objective function of food demand model (mio. USD17PPP) + oq15_budget(t,iso,type) Household budget constraint (USD17PPP per cap per day) oq15_regr_bmi_shr(t,iso,sex,agegroup15,bmi_tree15,type) Estimates regression parameters for BMI regression shares (1) oq15_bmi_shr_verylow(t,iso,sex,agegroup15,type) Estimates BMI share for population groups with low BMI (1) oq15_bmi_shr_low(t,iso,sex,agegroup15,type) Estimates BMI share for population groups with very low BMI (1) diff --git a/modules/29_cropland/simple_apr24/input.gms b/modules/29_cropland/simple_apr24/input.gms index f13c46f56f..70513be844 100644 --- a/modules/29_cropland/simple_apr24/input.gms +++ b/modules/29_cropland/simple_apr24/input.gms @@ -47,7 +47,7 @@ sets UGA,UKR,UMI,URY,USA,UZB,VAT,VCT,VEN,VGB, VIR,VNM,VUT,WLF,WSM,YEM,ZAF,ZMB,ZWE / -land_snv(land) land types allowed in the SNV policy / secdforest, forestry, past, other / +land_snv(land) land types allowed in the SNV policy / secdforest, other / ; ********* AVAILABLE CROPLAND ******************************************* From e4e09b86fcba8c903aa5bf6a4b31917562bd6619 Mon Sep 17 00:00:00 2001 From: florianh Date: Thu, 26 Sep 2024 22:43:10 +0200 Subject: [PATCH 030/206] defaults --- modules/29_cropland/detail_apr24/input.gms | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/29_cropland/detail_apr24/input.gms b/modules/29_cropland/detail_apr24/input.gms index 404b7ad5f7..77f9113cce 100644 --- a/modules/29_cropland/detail_apr24/input.gms +++ b/modules/29_cropland/detail_apr24/input.gms @@ -67,7 +67,7 @@ sets UGA,UKR,UMI,URY,USA,UZB,VAT,VCT,VEN,VGB, VIR,VNM,VUT,WLF,WSM,YEM,ZAF,ZMB,ZWE / -land_snv(land) land types allowed in the SNV policy / secdforest, forestry, past, other / +land_snv(land) land types allowed in the SNV policy / secdforest, other / ; ********* AVAILABLE CROPLAND ******************************************* From bf485ede3a7b06cf51a1d820252071c33082a54c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Florian=20Humpen=C3=B6der?= Date: Fri, 27 Sep 2024 10:12:09 +0200 Subject: [PATCH 031/206] Update config/projects/scenario_config_fsec.csv Co-authored-by: Debbora Leip --- config/projects/scenario_config_fsec.csv | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config/projects/scenario_config_fsec.csv b/config/projects/scenario_config_fsec.csv index 8fb692e285..1dd7460708 100644 --- a/config/projects/scenario_config_fsec.csv +++ b/config/projects/scenario_config_fsec.csv @@ -79,6 +79,6 @@ gms$c73_build_demand;;;;;;;;;;;;;;;;;;;;;;;;50pc;;;;;;;;;;;;;;;;;;;;;;;;;;; input['cellular'];rev4.112_FSEC_3c888fa5_cellularmagpie_c200_MRI-ESM2-0-ssp460_lpjml-8e6c5eb1.tgz;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;rev4.112_FSEC_0bd54110_cellularmagpie_c200_MRI-ESM2-0-ssp119_lpjml-8e6c5eb1.tgz;rev4.112_FSEC_6819938d_cellularmagpie_c200_MRI-ESM2-0-ssp126_lpjml-8e6c5eb1.tgz;;rev4.112_FSEC_1b5c3817_cellularmagpie_c200_MRI-ESM2-0-ssp245_lpjml-8e6c5eb1.tgz;rev4.112_FSEC_3c888fa5_cellularmagpie_c200_MRI-ESM2-0-ssp460_lpjml-8e6c5eb1.tgz;rev4.112_FSEC_fd712c0b_cellularmagpie_c200_MRI-ESM2-0-ssp370_lpjml-8e6c5eb1.tgz;rev4.112_FSEC_09a63995_cellularmagpie_c200_MRI-ESM2-0-ssp585_lpjml-8e6c5eb1.tgz;;; input['regional'];rev4.112_FSEC_magpie.tgz;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; input['validation'];rev4.112_FSEC_validation.tgz;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -input['additional'];additional_data_rev4.51.tgz;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +input['additional'];additional_data_rev4.56.tgz;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; input['calibration'];calibration_FSEC_26Mar24.tgz;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; magicc_emis_scen;bjoernAR6_C_SSP2-NDC.mif;;;bjoernAR6_C_SSP2-PkBudg900.mif;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;bjoernAR6_C_SSP1-NDC.mif;;;;;;;;;;;;bjoernAR6_C_RemSDP-900-MagSSP1.mif;; From 11de78830ef69d6f5db56420c545d2e04f17b5a1 Mon Sep 17 00:00:00 2001 From: florianh Date: Fri, 27 Sep 2024 11:31:22 +0200 Subject: [PATCH 032/206] bugfix macc USD + land conversions cost calib --- config/default.cfg | 10 +++---- main.gms | 4 +-- modules/57_maccs/on_aug22/preloop.gms | 10 +++---- scripts/start/extra/recalibrateH16.R | 33 +++++++++++++++++++++++ scripts/start/extra/recalibrate_FSEC.R | 4 +-- scripts/start/extra/recalibrate_default.R | 2 +- 6 files changed, 48 insertions(+), 15 deletions(-) create mode 100644 scripts/start/extra/recalibrateH16.R diff --git a/config/default.cfg b/config/default.cfg index 40ae3ff390..b395e4d704 100644 --- a/config/default.cfg +++ b/config/default.cfg @@ -26,7 +26,7 @@ cfg$input <- c(regional = "rev4.112_h12_magpie.tgz", cellular = "rev4.112_h12_fd712c0b_cellularmagpie_c200_MRI-ESM2-0-ssp370_lpjml-8e6c5eb1.tgz", validation = "rev4.112_h12_magpie.tgz", additional = "additional_data_rev4.56.tgz", - calibration = "calibration_H12_26Mar24_fixed.tgz") + calibration = "calibration_H12_27Sep24.tgz") # NOTE: It is recommended to recalibrate the model when changing cellular input data # as well as for any other setting that would affect initial values in the model, @@ -93,14 +93,14 @@ cfg$best_calib <- TRUE # def = TRUE # * (FALSE): Land conversion cost calibration will not be performed cfg$recalibrate_landconversion_cost <- "ifneeded" #def "ifneeded" # Up to which accuracy shall be recalibrated? -cfg$calib_accuracy_landconversion_cost <- 0.05 # def = 0.05 +cfg$calib_accuracy_landconversion_cost <- 0.01 # def = 0.01 # What is the maximum number of iterations if the precision goal is not reached? cfg$calib_maxiter_landconversion_cost <- 40 # def = 40 # Restart from existing calibration factors (TRUE or FALSE) -cfg$restart_landconversion_cost <- FALSE # def = FALSE +cfg$restart_landconversion_cost <- TRUE # def = TRUE # Number of lowpass filter iterations applied on calibration factors # for time steps 1995-2015 -cfg$lowpass_filter_landconversion_cost <- 1 # def= 1 +cfg$lowpass_filter_landconversion_cost <- 5 # def= 5 # Set upper limit for cropland calibration factor cfg$cost_calib_max_landconversion_cost <- 3 # def= 3 # Set lower limit for cropland calibration factor @@ -108,7 +108,7 @@ cfg$cost_calib_min_landconversion_cost <- 0.05 # def= 0.05 # Selection type of calibration factors. # If FALSE, calibration factors from the last iteration are used. # If TRUE, calibration factors from the iteration with the lowest divergence are used. -cfg$best_calib_landconversion_cost <- FALSE # def = FALSE +cfg$best_calib_landconversion_cost <- TRUE # def = TRUE # Settings for NPI/NDC recalculation # * (TRUE): NPI/NDC recalculation will be performed diff --git a/main.gms b/main.gms index 6313f17644..6d4bbafcd7 100644 --- a/main.gms +++ b/main.gms @@ -160,11 +160,11 @@ $title magpie * md5sum: NA * Repository: https://rse.pik-potsdam.de/data/magpie/public * -* Used data set: additional_data_rev4.55.tgz +* Used data set: additional_data_rev4.56.tgz * md5sum: NA * Repository: https://rse.pik-potsdam.de/data/magpie/public * -* Used data set: calibration_H12_26Mar24_fixed.tgz +* Used data set: calibration_H12_27Sep24.tgz * md5sum: NA * Repository: https://rse.pik-potsdam.de/data/magpie/public * diff --git a/modules/57_maccs/on_aug22/preloop.gms b/modules/57_maccs/on_aug22/preloop.gms index 3504fe5c91..0c89a1fc93 100644 --- a/modules/57_maccs/on_aug22/preloop.gms +++ b/modules/57_maccs/on_aug22/preloop.gms @@ -7,15 +7,15 @@ * inflated using USD05 --> USD17 MER rate: 5 * 1.23 $if "%c57_macc_version%" == "PBL_2007" s57_step_length = 6.15; -* inflated using USD10 --> USD17 MER rate: 20 * 1 -$if "%c57_macc_version%" == "PBL_2019" s57_step_length = 20; -* inflated using USD10 --> USD17 MER rate: 20 * 1 -$if "%c57_macc_version%" == "PBL_2022" s57_step_length = 20; +* inflated using USD10 --> USD17 MER rate: 20 * 1.12 +$if "%c57_macc_version%" == "PBL_2019" s57_step_length = 22.4; +* inflated using USD10 --> USD17 MER rate: 20 * 1.12 +$if "%c57_macc_version%" == "PBL_2022" s57_step_length = 22.4; $ontext Determine level of GHG emission abatement depending on GHG prices. There are 201 abatement steps. Each step is 6.15 USD17MER per tC eq in case of PBL_2007 and -20 USD17MER per tC eq in case of PBL_2019. +22.4 USD17MER per tC eq in case of PBL_2019. Since the GHG prices are in USD per ton N and USD per ton CH4, conversion to USD per ton C eq is needed. In this realization, the IPCC AR4 global warming potential factor for N2O (298) and CH4 (25) are used because PBL used these parameters to convert USD per ton N2O and USD per ton CH4 into USD per ton C eq. diff --git a/scripts/start/extra/recalibrateH16.R b/scripts/start/extra/recalibrateH16.R new file mode 100644 index 0000000000..340a473d22 --- /dev/null +++ b/scripts/start/extra/recalibrateH16.R @@ -0,0 +1,33 @@ +# | (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: calculate and store new land conversion cost calibration factors for default setup (time consuming; up to 40 model runs with 5 time steps) +# -------------------------------------------------------- + +library(magpie4) +library(magclass) + +# Load start_run(cfg) function which is needed to start MAgPIE runs +source("scripts/start_functions.R") + +#start MAgPIE run +source("config/default.cfg") +cfg$input['regional'] <- "rev4.112_36f73207_magpie.tgz" +cfg$input['validation'] <- "rev4.112_36f73207_validation.tgz" +cfg$input['calibration'] <- "calibration_H16_14Jun24.tgz" +cfg$input['cellular'] <- "rev4.112_36f73207_44a213b6_cellularmagpie_c400_MRI-ESM2-0-ssp370_lpjml-8e6c5eb1_clusterweight-ba4466a8.tgz" + +cfg$results_folder <- "output/:title:" +cfg$recalibrate <- FALSE +cfg$recalibrate_landconversion_cost <- TRUE +cfg$title <- "calib_run_H16" +cfg$output <- c("rds_report") +cfg$force_replace <- TRUE +cfg$qos <- "priority" +start_run(cfg,codeCheck=FALSE) +magpie4::submitCalibration("H16") diff --git a/scripts/start/extra/recalibrate_FSEC.R b/scripts/start/extra/recalibrate_FSEC.R index 0611437f08..1b33e460b3 100644 --- a/scripts/start/extra/recalibrate_FSEC.R +++ b/scripts/start/extra/recalibrate_FSEC.R @@ -20,12 +20,12 @@ source("scripts/projects/fsec.R") # Calibration run cfg <- fsecScenario(scenario = "c_BAU") -cfg$title <- "FSEC23Mar2024" +cfg$title <- "calib_run_FSEC" cfg$results_folder <- "output/:title:" cfg$recalibrate <- TRUE # required when penality_apr22 activated cfg$best_calib <- TRUE cfg$recalibrate_landconversion_cost <- TRUE -cfg$best_calib_landconversion_cost <- FALSE +cfg$best_calib_landconversion_cost <- TRUE cfg$output <- c("rds_report") cfg$force_replace <- TRUE cfg$qos <- "priority" diff --git a/scripts/start/extra/recalibrate_default.R b/scripts/start/extra/recalibrate_default.R index 69f52a17f3..fdf41a97ae 100644 --- a/scripts/start/extra/recalibrate_default.R +++ b/scripts/start/extra/recalibrate_default.R @@ -20,7 +20,7 @@ source("config/default.cfg") cfg$results_folder <- "output/:title:" cfg$recalibrate <- FALSE cfg$recalibrate_landconversion_cost <- TRUE -cfg$title <- "calib_run" +cfg$title <- "calib_run_H12" cfg$output <- c("rds_report") cfg$force_replace <- TRUE cfg$qos <- "priority" From 878d2d14b17f51ce46a372130950c80fdadd0135 Mon Sep 17 00:00:00 2001 From: florianh Date: Fri, 27 Sep 2024 11:44:09 +0200 Subject: [PATCH 033/206] bugfix sticky_labor --- modules/38_factor_costs/sticky_labor/preloop.gms | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/38_factor_costs/sticky_labor/preloop.gms b/modules/38_factor_costs/sticky_labor/preloop.gms index 931c760de7..031692e316 100644 --- a/modules/38_factor_costs/sticky_labor/preloop.gms +++ b/modules/38_factor_costs/sticky_labor/preloop.gms @@ -11,7 +11,7 @@ s38_ces_elast_par = (1/s38_ces_elast_subst) - 1 ; p38_intr_depr(t,i) = (1-s38_depreciation_rate) * pm_interest(t,i)/(1+pm_interest(t,i)) + s38_depreciation_rate; * calculate labor/capital cost shares from regression -p38_share_calibration(i) = f38_historical_share("y2010",i)-(f38_reg_parameters("slope")*log10(sum(i_to_iso(i,iso),(im_gdp_pc_ppp_iso("y2010",iso) * fm_gdp_defl_ppp(iso)))+f38_reg_parameters("intercept")); +p38_share_calibration(i) = f38_historical_share("y2010",i)-(f38_reg_parameters("slope")*log10(sum(i_to_iso(i,iso),(im_gdp_pc_ppp_iso("y2010",iso) * fm_gdp_defl_ppp(iso))))+f38_reg_parameters("intercept")); pm_cost_share_crops(t,i,"capital")$(m_year(t)<2010) = f38_historical_share(t,i); pm_cost_share_crops(t,i,"capital")$(m_year(t)>=2010) = f38_reg_parameters("slope")*log10(sum(i_to_iso(i,iso),(im_gdp_pc_ppp_iso(t,iso) * fm_gdp_defl_ppp(iso))))+f38_reg_parameters("intercept")+p38_share_calibration(i); From d7974040e0498f79b1e8c5ad33574e5ed95a18f3 Mon Sep 17 00:00:00 2001 From: florianh Date: Fri, 27 Sep 2024 13:42:33 +0200 Subject: [PATCH 034/206] bugfix warnings --- DESCRIPTION | 2 +- scripts/npi_ndc/start_npi_ndc.R | 4 ++-- scripts/output/extra/disaggregation.R | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/DESCRIPTION b/DESCRIPTION index 0f91ffe750..cf546354db 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -21,7 +21,7 @@ Imports: m4fsdp, madrat, magclass (>= 6.14.0), - magpie4 (>= 2.12.6), + magpie4 (>= 2.13.1), MagpieNCGains, magpiesets, mip, diff --git a/scripts/npi_ndc/start_npi_ndc.R b/scripts/npi_ndc/start_npi_ndc.R index 9b4681768b..68ecf70a37 100644 --- a/scripts/npi_ndc/start_npi_ndc.R +++ b/scripts/npi_ndc/start_npi_ndc.R @@ -182,7 +182,7 @@ calc_NPI_NDC <- function(policyregions = "iso", npi_aff <- droplevels(subset(pol_def, policy=="npi" & landpool=="affore")) addtable(npi_aff[,c(-2,-3)]) npi_aff <- calc_policy(npi_aff, land_stock, pol_type="aff", pol_mapping=pol_mapping, - weight=dimSums(land_stock[,2005,c("crop","past")]), + weight=dimSums(land_stock[,2005,c("crop","past")]) + 10^-10, map_file=map_file) getNames(npi_aff) <- "npi" cat(paste0(" (time elapsed: ",format(proc.time()["elapsed"]-ptm,width=6,nsmall=2,digits=2),"s)\n")) @@ -195,7 +195,7 @@ calc_NPI_NDC <- function(policyregions = "iso", ndc_aff <- droplevels(subset(pol_def, policy=="ndc" & landpool=="affore")) addtable(ndc_aff[,c(-2,-3)]) ndc_aff <- calc_policy(ndc_aff, land_stock, pol_type="aff", pol_mapping=pol_mapping, - weight=dimSums(land_stock[,2005,c("crop","past")]), + weight=dimSums(land_stock[,2005,c("crop","past")]) + 10^-10, map_file=map_file) getNames(ndc_aff) <- "ndc" #set all values before 2015 to NPI values; copy the values til 2010 from the NPI data diff --git a/scripts/output/extra/disaggregation.R b/scripts/output/extra/disaggregation.R index e9e31f3367..e4e963989e 100644 --- a/scripts/output/extra/disaggregation.R +++ b/scripts/output/extra/disaggregation.R @@ -450,7 +450,7 @@ message("Disaggregating BII values") # Load input data for BII disaggregation land_ini_hr <- read.magpie(land_hr_file)[, "y1995", ] side_layers_hr <- read.magpie(luh_side_layers) -landArea <- dimSums(land_ini_hr, dim = 3) +landArea <- dimSums(land_ini_hr, dim = 3) + 10^-10 side_layers_lr <- toolAggregate(x = side_layers_hr, rel = map_file, weight = landArea, from = "cell", to = "cluster") # Convert land types for BII disaggregation From e24ba0b9cf72adbb9afff3b50c06e684882d474a Mon Sep 17 00:00:00 2001 From: florianh Date: Fri, 27 Sep 2024 15:47:54 +0200 Subject: [PATCH 035/206] FSEC calib factors --- config/projects/scenario_config_fsec.csv | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config/projects/scenario_config_fsec.csv b/config/projects/scenario_config_fsec.csv index 1dd7460708..8cddb03ce6 100644 --- a/config/projects/scenario_config_fsec.csv +++ b/config/projects/scenario_config_fsec.csv @@ -80,5 +80,5 @@ input['cellular'];rev4.112_FSEC_3c888fa5_cellularmagpie_c200_MRI-ESM2-0-ssp460_l input['regional'];rev4.112_FSEC_magpie.tgz;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; input['validation'];rev4.112_FSEC_validation.tgz;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; input['additional'];additional_data_rev4.56.tgz;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -input['calibration'];calibration_FSEC_26Mar24.tgz;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +input['calibration'];calibration_FSEC_27Sep24.tgz;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; magicc_emis_scen;bjoernAR6_C_SSP2-NDC.mif;;;bjoernAR6_C_SSP2-PkBudg900.mif;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;bjoernAR6_C_SSP1-NDC.mif;;;;;;;;;;;;bjoernAR6_C_RemSDP-900-MagSSP1.mif;; From 1c467f3ac9246a75137466bc060314be55bd8fa6 Mon Sep 17 00:00:00 2001 From: florianh Date: Fri, 27 Sep 2024 15:58:45 +0200 Subject: [PATCH 036/206] fix warnings --- scripts/output/extra/highres.R | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/scripts/output/extra/highres.R b/scripts/output/extra/highres.R index c1768e03d6..f4e9dbe328 100644 --- a/scripts/output/extra/highres.R +++ b/scripts/output/extra/highres.R @@ -152,10 +152,14 @@ highres <- function(cfg = cfg, res = "c1000", tc = NULL) { cfg$gms$s15_elastic_demand <- 0 #get exogenous bioenergy demand and GHG prices from c200 run because these files may have been overwritten - write.magpie(readGDX(gdx,"f56_pollutant_prices_coupling"),"modules/56_ghg_policy/input/f56_pollutant_prices_coupling.cs3") - write.magpie(readGDX(gdx,"f56_pollutant_prices_emulator"),"modules/56_ghg_policy/input/f56_pollutant_prices_emulator.cs3") - write.magpie(readGDX(gdx,"f60_bioenergy_dem_coupling"),"modules/60_bioenergy/input/reg.2ndgen_bioenergy_demand.csv") - write.magpie(readGDX(gdx,"f60_bioenergy_dem_emulator"),"modules/60_bioenergy/input/glo.2ndgen_bioenergy_demand.csv") + a <- readGDX(gdx,"f56_pollutant_prices_coupling", react = "silent") + if(!is.null(a)) write.magpie(a,"modules/56_ghg_policy/input/f56_pollutant_prices_coupling.cs3") + a <- readGDX(gdx,"f56_pollutant_prices_emulator", react = "silent") + if(!is.null(a)) write.magpie(a,"modules/56_ghg_policy/input/f56_pollutant_prices_emulator.cs3") + a <- readGDX(gdx,"f60_bioenergy_dem_coupling", react = "silent") + if(!is.null(a)) write.magpie(a,"modules/60_bioenergy/input/reg.2ndgen_bioenergy_demand.csv") + a <- readGDX(gdx,"f60_bioenergy_dem_emulator", react = "silent") + if(!is.null(a)) write.magpie(a,"modules/60_bioenergy/input/glo.2ndgen_bioenergy_demand.csv") #get regional afforestation patterns from low resolution run with c200 aff <- dimSums(landForestry(gdx)[,,c("aff","ndc")],dim=3) From fa640a9b383ac609eb6cd4410171ec7075be3aab Mon Sep 17 00:00:00 2001 From: florianh Date: Fri, 27 Sep 2024 21:10:26 +0200 Subject: [PATCH 037/206] H16 calib factors --- scripts/start/extra/recalibrateH16.R | 2 +- scripts/start/projects/paper_peatlandTax.R | 4 ++-- scripts/start/projects/project_ABCDR.R | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/scripts/start/extra/recalibrateH16.R b/scripts/start/extra/recalibrateH16.R index 340a473d22..b576926d9b 100644 --- a/scripts/start/extra/recalibrateH16.R +++ b/scripts/start/extra/recalibrateH16.R @@ -19,7 +19,7 @@ source("scripts/start_functions.R") source("config/default.cfg") cfg$input['regional'] <- "rev4.112_36f73207_magpie.tgz" cfg$input['validation'] <- "rev4.112_36f73207_validation.tgz" -cfg$input['calibration'] <- "calibration_H16_14Jun24.tgz" +cfg$input['calibration'] <- "calibration_H16_27Sep24.tgz" cfg$input['cellular'] <- "rev4.112_36f73207_44a213b6_cellularmagpie_c400_MRI-ESM2-0-ssp370_lpjml-8e6c5eb1_clusterweight-ba4466a8.tgz" cfg$results_folder <- "output/:title:" diff --git a/scripts/start/projects/paper_peatlandTax.R b/scripts/start/projects/paper_peatlandTax.R index 2d607939a6..fdb17c6880 100644 --- a/scripts/start/projects/paper_peatlandTax.R +++ b/scripts/start/projects/paper_peatlandTax.R @@ -23,7 +23,7 @@ source("scripts/start_functions.R") source("config/default.cfg") # create additional information to describe the runs -cfg$info$flag <- "PTax25" +cfg$info$flag <- "PTax26" cfg$results_folder <- "output/:title:" cfg$results_folder_highres <- "output" @@ -46,7 +46,7 @@ cfg$repositories <- append( cfg$input['regional'] <- "rev4.112_36f73207_magpie.tgz" cfg$input['validation'] <- "rev4.112_36f73207_validation.tgz" -cfg$input['calibration'] <- "calibration_H16_14Jun24.tgz" +cfg$input['calibration'] <- "calibration_H16_27Sep24.tgz" cfg$input['cellular'] <- "rev4.112_36f73207_44a213b6_cellularmagpie_c400_MRI-ESM2-0-ssp370_lpjml-8e6c5eb1_clusterweight-ba4466a8.tgz" download_and_update(cfg) diff --git a/scripts/start/projects/project_ABCDR.R b/scripts/start/projects/project_ABCDR.R index e296416e38..82fe9ccdb0 100644 --- a/scripts/start/projects/project_ABCDR.R +++ b/scripts/start/projects/project_ABCDR.R @@ -33,7 +33,7 @@ cfg$qos <- "standby_highMem_dayMax" cfg$input['regional'] <- "rev4.112_36f73207_magpie.tgz" cfg$input['validation'] <- "rev4.112_36f73207_validation.tgz" -cfg$input['calibration'] <- "calibration_H16_14Jun24.tgz" +cfg$input['calibration'] <- "calibration_H16_27Sep24.tgz" cfg$input['cellular'] <- "rev4.112_36f73207_44a213b6_cellularmagpie_c400_MRI-ESM2-0-ssp370_lpjml-8e6c5eb1_clusterweight-ba4466a8.tgz" ssp <- "SSP2" From b9a6940cb8fd40c95b55df2c69675dd311dd27c5 Mon Sep 17 00:00:00 2001 From: florianh Date: Tue, 1 Oct 2024 17:01:38 +0200 Subject: [PATCH 038/206] update GDP17 --- config/default.cfg | 4 ++-- config/projects/scenario_config_fsec.csv | 2 +- literature.bib | 10 ++++++++++ modules/18_residues/flexcluster_jul23/equations.gms | 11 +++-------- modules/18_residues/flexreg_apr16/equations.gms | 11 +++-------- modules/57_maccs/on_aug22/input.gms | 2 +- modules/58_peatland/v2/input.gms | 2 +- 7 files changed, 21 insertions(+), 21 deletions(-) diff --git a/config/default.cfg b/config/default.cfg index b395e4d704..628153f963 100644 --- a/config/default.cfg +++ b/config/default.cfg @@ -25,7 +25,7 @@ cfg$model <- "main.gms" #def = "main.gms" cfg$input <- c(regional = "rev4.112_h12_magpie.tgz", cellular = "rev4.112_h12_fd712c0b_cellularmagpie_c200_MRI-ESM2-0-ssp370_lpjml-8e6c5eb1.tgz", validation = "rev4.112_h12_magpie.tgz", - additional = "additional_data_rev4.56.tgz", + additional = "additional_data_rev4.57.tgz", calibration = "calibration_H12_27Sep24.tgz") # NOTE: It is recommended to recalibrate the model when changing cellular input data @@ -1749,7 +1749,7 @@ cfg$gms$s58_cost_rewet_recur <- 37 # def = 30 * 1.23 # * One-time costs apply on the drainage of intact and rewetted peatland # * Recurring costs apply on the level of drained and managed peatland cfg$gms$s58_cost_drain_intact_onetime <- 0 # def = 0 -cfg$gms$s58_cost_drain_rewet_onetime <- 1230 # def = 1000 * 1.23 +cfg$gms$s58_cost_drain_rewet_onetime <- 0 # def = 0 cfg$gms$s58_cost_drain_recur <- 0 # def = 0 # * Penalty for technical peatland balance term (USD17MER) diff --git a/config/projects/scenario_config_fsec.csv b/config/projects/scenario_config_fsec.csv index 8cddb03ce6..551e558a57 100644 --- a/config/projects/scenario_config_fsec.csv +++ b/config/projects/scenario_config_fsec.csv @@ -79,6 +79,6 @@ gms$c73_build_demand;;;;;;;;;;;;;;;;;;;;;;;;50pc;;;;;;;;;;;;;;;;;;;;;;;;;;; input['cellular'];rev4.112_FSEC_3c888fa5_cellularmagpie_c200_MRI-ESM2-0-ssp460_lpjml-8e6c5eb1.tgz;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;rev4.112_FSEC_0bd54110_cellularmagpie_c200_MRI-ESM2-0-ssp119_lpjml-8e6c5eb1.tgz;rev4.112_FSEC_6819938d_cellularmagpie_c200_MRI-ESM2-0-ssp126_lpjml-8e6c5eb1.tgz;;rev4.112_FSEC_1b5c3817_cellularmagpie_c200_MRI-ESM2-0-ssp245_lpjml-8e6c5eb1.tgz;rev4.112_FSEC_3c888fa5_cellularmagpie_c200_MRI-ESM2-0-ssp460_lpjml-8e6c5eb1.tgz;rev4.112_FSEC_fd712c0b_cellularmagpie_c200_MRI-ESM2-0-ssp370_lpjml-8e6c5eb1.tgz;rev4.112_FSEC_09a63995_cellularmagpie_c200_MRI-ESM2-0-ssp585_lpjml-8e6c5eb1.tgz;;; input['regional'];rev4.112_FSEC_magpie.tgz;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; input['validation'];rev4.112_FSEC_validation.tgz;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -input['additional'];additional_data_rev4.56.tgz;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +input['additional'];additional_data_rev4.57.tgz;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; input['calibration'];calibration_FSEC_27Sep24.tgz;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; magicc_emis_scen;bjoernAR6_C_SSP2-NDC.mif;;;bjoernAR6_C_SSP2-PkBudg900.mif;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;bjoernAR6_C_SSP1-NDC.mif;;;;;;;;;;;;bjoernAR6_C_RemSDP-900-MagSSP1.mif;; diff --git a/literature.bib b/literature.bib index 64b837e368..9796ef8f89 100644 --- a/literature.bib +++ b/literature.bib @@ -1698,3 +1698,13 @@ @article{jarvio_LCA_MP_2021 keywords = {LCA, Food, Hydrogen-oxidizing bacteria, Cellular agriculture, Microbial protein}, pages = {145764}, } + + +@techreport{budynski_straw_2020, + title = {Straw manufacturing in {Alberta}}, + url = {https://open.alberta.ca/dataset/690317b0-1d07-4f9e-ae71-6340e16f6493/resource/89789096-1c7a-47ab-beb2-94d55606c922/}, + language = {en}, + institution = {Published by Alberta Agriculture and Forestry}, + author = {Budynski, Stephanie}, + year = {2020}, +} diff --git a/modules/18_residues/flexcluster_jul23/equations.gms b/modules/18_residues/flexcluster_jul23/equations.gms index 00ebf68911..8ab10fe894 100644 --- a/modules/18_residues/flexcluster_jul23/equations.gms +++ b/modules/18_residues/flexcluster_jul23/equations.gms @@ -129,14 +129,9 @@ + vm_res_ag_burn(i2,kcr,pk18) ); -*' Costs of residues production are determined as factor costs per ton -*' assuming 15 USD17MER per ton, using the lower range from -*' [this source](hwww1.agric.gov.ab.ca/$Department/deptdocs.nsf/All/faq7514), -*' 10USD baling costs per large round bale plus 2USD pro bale stocking and hauling, -*' 1 large round bale is approximately 500 kg, resulting in 24USD17MER per ton, -*' for developing prices see [here](citeseerx.ist.psu.edu/viewdoc/download?doi=10.1.1.557.5823&rep=rep1&type=pdf). -*' Tha calcuated factor costs per ton are therefore 24 for `res_cereals`, `res_fibrous` -*' and `res_nonfibrous`. +*' Costs of residue harvest are based on straw baling and hauling from +*' Budynski, Stephanie. 2020. Straw Manufacturing in Alberta (@budynski_straw_2020), +*' using the lower range of the US costs. q18_cost_prod_res(i2,kres) .. vm_cost_prod_kres(i2,kres) diff --git a/modules/18_residues/flexreg_apr16/equations.gms b/modules/18_residues/flexreg_apr16/equations.gms index 97608539d8..8d9d7e0c30 100644 --- a/modules/18_residues/flexreg_apr16/equations.gms +++ b/modules/18_residues/flexreg_apr16/equations.gms @@ -107,14 +107,9 @@ + vm_res_ag_burn(i2,kcr,pk18) ); -*' Costs of residues production are determined as factor costs per ton -*' assuming 15 USD17MER per ton, using the lower range from -*' [this source](hwww1.agric.gov.ab.ca/$Department/deptdocs.nsf/All/faq7514), -*' 10USD baling costs per large round bale plus 2USD pro bale stocking and hauling, -*' 1 large round bale is approximately 500 kg, resulting in 24USD17MER per ton, -*' for developing prices see [here](citeseerx.ist.psu.edu/viewdoc/download?doi=10.1.1.557.5823&rep=rep1&type=pdf). -*' Tha calcuated factor costs per ton are therefore 24 for `res_cereals`, `res_fibrous` -*' and `res_nonfibrous`. +*' Costs of residue harvest are based on straw baling and hauling from +*' Budynski, Stephanie. 2020. Straw Manufacturing in Alberta (@budynski_straw_2020), +*' using the lower range of the US costs. q18_cost_prod_res(i2,kres) .. vm_cost_prod_kres(i2,kres) diff --git a/modules/57_maccs/on_aug22/input.gms b/modules/57_maccs/on_aug22/input.gms index 95e6be943c..6c5987804e 100644 --- a/modules/57_maccs/on_aug22/input.gms +++ b/modules/57_maccs/on_aug22/input.gms @@ -17,7 +17,7 @@ scalars s57_maxmac_ch4_entferm activate enteric fermentation CH4 mitigation independent of pollutant price (step of MACC and -1 is inactive) / -1 / s57_maxmac_ch4_awms activate awms CH4 mitigation independent of pollutant price (step of MACC and -1 is inactive) / -1 / s57_implicit_emis_factor emission factor for direct soil emissions implicit to MACC curves (tN2ON per tN) / 0.01 / - s57_implicit_fert_cost fertilizer costs implicit to MACC curves (USD17MER per ton N) / 600 / + s57_implicit_fert_cost fertilizer costs implicit to MACC curves (USD17MER per ton N) / 738 / ; $onEmpty diff --git a/modules/58_peatland/v2/input.gms b/modules/58_peatland/v2/input.gms index de52ce1551..20e91e2c16 100644 --- a/modules/58_peatland/v2/input.gms +++ b/modules/58_peatland/v2/input.gms @@ -10,7 +10,7 @@ scalars s58_cost_rewet_onetime One-time costs for peatland rewetting (USD17MER per ha) / 1230 / s58_cost_drain_recur Recurring costs for drained and managed peatlands (USD17MER per ha) / 0 / s58_cost_drain_intact_onetime One-time costs for drainage of intact peatland (USD17MER per ha) / 0 / - s58_cost_drain_rewet_onetime One-time costs for drainage of rewetted peatland (USD17MER per ha) / 1230 / + s58_cost_drain_rewet_onetime One-time costs for drainage of rewetted peatland (USD17MER per ha) / 0 / s58_rewetting_switch Peatland rewetting on (Inf) or off (0) / Inf / s58_fix_peatland Year indicating until when peatland area should be fixed (year) / 2020 / s58_balance_penalty Penalty for technical peatland balance term (USD17MER) / 1e+06 / From 1f5f594b8fd23d77ebe03f664bf5ec8f234e595d Mon Sep 17 00:00:00 2001 From: florianh Date: Wed, 2 Oct 2024 10:06:11 +0200 Subject: [PATCH 039/206] update start scripts --- config/default.cfg | 6 +++ scripts/start/projects/paper_peatlandTax.R | 3 +- scripts/start/projects/project_ABCDR.R | 58 +++++++++++----------- 3 files changed, 36 insertions(+), 31 deletions(-) diff --git a/config/default.cfg b/config/default.cfg index 628153f963..6e7a3223c2 100644 --- a/config/default.cfg +++ b/config/default.cfg @@ -776,6 +776,12 @@ cfg$gms$s29_treecover_penalty <- 6150 # def = 5000 * 1.23 cfg$gms$s29_cost_treecover_est <- 2460 # def = 2000 * 1.23 # * Tree cover recurring cost (USD17MER per ha) cfg$gms$s29_cost_treecover_recur <- 615 # def = 500 * 1.23 +# * Switch for using natural vegetation (0) or plantation (1) growth curves towards LPJmL natural +# * vegetation carbon density. +cfg$gms$s29_treecover_plantation <- 0 # def = 0 +# * Switch for using secondary vegetation (0) or timber plantation (1) BII coefficients +# * The recommend setting is to map the BII coefficient to the choice of the growth curve. +cfg$gms$s29_treecover_bii_coeff <- 0 # def = 0 # * Sigmoid fader for minimum area share of fallow land on total cropland at cluster level # * Minimum area share of fallow land on total cropland in target year diff --git a/scripts/start/projects/paper_peatlandTax.R b/scripts/start/projects/paper_peatlandTax.R index fdb17c6880..80353854f3 100644 --- a/scripts/start/projects/paper_peatlandTax.R +++ b/scripts/start/projects/paper_peatlandTax.R @@ -23,7 +23,7 @@ source("scripts/start_functions.R") source("config/default.cfg") # create additional information to describe the runs -cfg$info$flag <- "PTax26" +cfg$info$flag <- "PTax30" cfg$results_folder <- "output/:title:" cfg$results_folder_highres <- "output" @@ -166,6 +166,7 @@ for (res in c("c400")) { "T400-GHG-GWP20")) { cfg$title <- .title(cfg, paste(res, ssp, tax, sep = "-")) cfg$gms$c56_mute_ghgprices_until <- "y2025" + cfg$gms$s58_cost_drain_intact_onetime <- 10000 cfg$gms$c56_pollutant_prices <- tax start_run(cfg, codeCheck = FALSE) } diff --git a/scripts/start/projects/project_ABCDR.R b/scripts/start/projects/project_ABCDR.R index 82fe9ccdb0..3e757d5106 100644 --- a/scripts/start/projects/project_ABCDR.R +++ b/scripts/start/projects/project_ABCDR.R @@ -19,7 +19,7 @@ source("config/default.cfg") #download_and_update(cfg) # create additional information to describe the runs -cfg$info$flag <- "ABCDR09" +cfg$info$flag <- "ABCDR10" cfg$results_folder <- "output/:title:" cfg$force_replace <- TRUE @@ -40,45 +40,43 @@ ssp <- "SSP2" cfg$gms$cropland <- "detail_apr24" - cfg$gms$scen_countries15 <- isoCountriesEUR cfg$gms$policy_countries29 <- isoCountriesEUR cfg$gms$policy_countries30 <- isoCountriesEUR - -cfg$gms$s29_treecover_keep <- 0 -cfg$gms$s29_treecover_penalty_before <- 0 -cfg$gms$s29_treecover_penalty <- 5000 -cfg$gms$s30_betr_penalty <- 0 - cfg$gms$s29_fader_functional_form <- 1 # linear fader cfg$gms$s29_treecover_scenario_start <- 2025 cfg$gms$s29_treecover_scenario_target <- 2060 for (pol in c("NDC","1p5deg","1p5deg-Diet")) { for (shr in c(0, 0.005, 0.01, 0.02)) { # share in 2045 - cfg$title <- .title(cfg, paste(ssp,pol,paste0("AFS_tree_",sub("\\.","p",as.character(shr*100))),sep="-")) - if (pol == "NDC") { - cfg <- setScenario(cfg,c(ssp,"NDC","rcp4p5")) - cfg$input['cellular'] <- "rev4.112_36f73207_30c9dc61_cellularmagpie_c400_MRI-ESM2-0-ssp245_lpjml-8e6c5eb1_clusterweight-ba4466a8.tgz" - cfg$gms$c56_mute_ghgprices_until <- "y2150" - cfg$gms$c56_pollutant_prices <- paste0("R32M46-", if (ssp=="SSP2") "SSP2EU" else ssp,"-NDC") - cfg$gms$c60_2ndgen_biodem <- paste0("R32M46-", if (ssp=="SSP2") "SSP2EU" else ssp,"-NDC") - } else if (pol == "1p5deg") { - cfg <- setScenario(cfg,c(ssp,"NDC","rcp1p9")) - cfg$input['cellular'] <- "rev4.112_36f73207_bc624950_cellularmagpie_c400_MRI-ESM2-0-ssp119_lpjml-8e6c5eb1_clusterweight-ba4466a8.tgz" - cfg$gms$c56_mute_ghgprices_until <- "y2030" - cfg$gms$c56_pollutant_prices <- paste0("R32M46-", if (ssp=="SSP2") "SSP2EU" else ssp,"-PkBudg650") - cfg$gms$c60_2ndgen_biodem <- paste0("R32M46-", if (ssp=="SSP2") "SSP2EU" else ssp,"-PkBudg650") - } else if (pol == "1p5deg-Diet") { - cfg <- setScenario(cfg,c(ssp,"NDC","rcp1p9","eat_lancet_diet_v1")) - cfg$input['cellular'] <- "rev4.112_36f73207_bc624950_cellularmagpie_c400_MRI-ESM2-0-ssp119_lpjml-8e6c5eb1_clusterweight-ba4466a8.tgz" - cfg$gms$c56_mute_ghgprices_until <- "y2030" - cfg$gms$c56_pollutant_prices <- paste0("R32M46-", if (ssp=="SSP2") "SSP2EU" else ssp,"-PkBudg650") - cfg$gms$c60_2ndgen_biodem <- paste0("R32M46-", if (ssp=="SSP2") "SSP2EU" else ssp,"-PkBudg650") + for (growth in c(0,1)) { + cfg$title <- .title(cfg, paste(ssp,pol,ifelse(growth==0,"natveg","plant"),paste0("AFS_tree_",sub("\\.","p",as.character(shr*100))),sep="-")) + if (pol == "NDC") { + cfg <- setScenario(cfg,c(ssp,"NDC","rcp4p5")) + cfg$input['cellular'] <- "rev4.112_36f73207_30c9dc61_cellularmagpie_c400_MRI-ESM2-0-ssp245_lpjml-8e6c5eb1_clusterweight-ba4466a8.tgz" + cfg$gms$c56_mute_ghgprices_until <- "y2150" + cfg$gms$c56_pollutant_prices <- paste0("R32M46-", if (ssp=="SSP2") "SSP2EU" else ssp,"-NDC") + cfg$gms$c60_2ndgen_biodem <- paste0("R32M46-", if (ssp=="SSP2") "SSP2EU" else ssp,"-NDC") + } else if (pol == "1p5deg") { + cfg <- setScenario(cfg,c(ssp,"NDC","rcp1p9")) + cfg$input['cellular'] <- "rev4.112_36f73207_bc624950_cellularmagpie_c400_MRI-ESM2-0-ssp119_lpjml-8e6c5eb1_clusterweight-ba4466a8.tgz" + cfg$gms$c56_mute_ghgprices_until <- "y2030" + cfg$gms$c56_pollutant_prices <- paste0("R32M46-", if (ssp=="SSP2") "SSP2EU" else ssp,"-PkBudg650") + cfg$gms$c60_2ndgen_biodem <- paste0("R32M46-", if (ssp=="SSP2") "SSP2EU" else ssp,"-PkBudg650") + } else if (pol == "1p5deg-Diet") { + cfg <- setScenario(cfg,c(ssp,"NDC","rcp1p9","eat_lancet_diet_v1")) + cfg$input['cellular'] <- "rev4.112_36f73207_bc624950_cellularmagpie_c400_MRI-ESM2-0-ssp119_lpjml-8e6c5eb1_clusterweight-ba4466a8.tgz" + cfg$gms$c56_mute_ghgprices_until <- "y2030" + cfg$gms$c56_pollutant_prices <- paste0("R32M46-", if (ssp=="SSP2") "SSP2EU" else ssp,"-PkBudg650") + cfg$gms$c60_2ndgen_biodem <- paste0("R32M46-", if (ssp=="SSP2") "SSP2EU" else ssp,"-PkBudg650") + } + cfg$gms$s29_treecover_target <- shr / (2045 - 2025) * (2060 - 2025) # Continue linear increase after 2045 until 2060 + cfg$gms$s30_betr_target <- 0 + cfg$gms$s30_betr_penalty <- 0 + cfg$gms$s29_treecover_plantation <- growth + cfg$gms$s29_treecover_bii_coeff <- growth + start_run(cfg, codeCheck = FALSE) } - cfg$gms$s29_treecover_target <- shr / (2045 - 2025) * (2060 - 2025) # Continue linear increase after 2045 until 2060 - cfg$gms$s30_betr_target <- 0 - start_run(cfg, codeCheck = FALSE) } } From 52090d1233542a8966961e335a308f96bebe829c Mon Sep 17 00:00:00 2001 From: florianh Date: Wed, 2 Oct 2024 10:20:59 +0200 Subject: [PATCH 040/206] magpie4 lib version --- DESCRIPTION | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/DESCRIPTION b/DESCRIPTION index cf546354db..f830cf4be4 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -21,7 +21,7 @@ Imports: m4fsdp, madrat, magclass (>= 6.14.0), - magpie4 (>= 2.13.1), + magpie4 (>= 2.13.3), MagpieNCGains, magpiesets, mip, From e7e62d7e655df659ed41350b1fab4b1961051ff7 Mon Sep 17 00:00:00 2001 From: florianh Date: Wed, 2 Oct 2024 15:58:17 +0200 Subject: [PATCH 041/206] bugfix plantation growth curves --- modules/32_forestry/dynamic_may24/presolve.gms | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/32_forestry/dynamic_may24/presolve.gms b/modules/32_forestry/dynamic_may24/presolve.gms index 6ebf6d3240..97d717c3eb 100644 --- a/modules/32_forestry/dynamic_may24/presolve.gms +++ b/modules/32_forestry/dynamic_may24/presolve.gms @@ -33,7 +33,7 @@ v32_land_reduction.fx(j,type32,ac_est) = 0; if(s32_aff_plantation = 0, p32_carbon_density_ac(t,j,"aff",ac,ag_pools) = pm_carbon_density_secdforest_ac(t,j,ac,ag_pools); elseif s32_aff_plantation = 1, - p32_carbon_density_ac(t,j,"aff",ac,ag_pools) = pm_carbon_density_plantation_ac(t,j,ac,"vegc"); + p32_carbon_density_ac(t,j,"aff",ac,ag_pools) = pm_carbon_density_plantation_ac(t,j,ac,ag_pools); ); *' Timber plantations carbon densities: From 98e6fd18dcd3e97c6e41b456082d3e3b88525ec4 Mon Sep 17 00:00:00 2001 From: florianh Date: Wed, 2 Oct 2024 17:13:45 +0200 Subject: [PATCH 042/206] update scaling factors --- modules/10_land/landmatrix_dec18/scaling.gms | 2 ++ modules/20_processing/substitution_may21/scaling.gms | 1 + modules/21_trade/selfsuff_reduced/scaling.gms | 2 +- modules/21_trade/selfsuff_reduced_bilateral22/scaling.gms | 2 +- modules/34_urban/exo_nov21/scaling.gms | 4 +++- modules/58_peatland/v2/scaling.gms | 3 +-- 6 files changed, 9 insertions(+), 5 deletions(-) diff --git a/modules/10_land/landmatrix_dec18/scaling.gms b/modules/10_land/landmatrix_dec18/scaling.gms index 7cf3630df2..2b40b4aedd 100644 --- a/modules/10_land/landmatrix_dec18/scaling.gms +++ b/modules/10_land/landmatrix_dec18/scaling.gms @@ -6,3 +6,5 @@ *** | Contact: magpie@pik-potsdam.de vm_landdiff.scale = 10e3; +v10_balance_positive.scale(j) = 10e-15; +v10_balance_negative.scale(j) = 10e-15; diff --git a/modules/20_processing/substitution_may21/scaling.gms b/modules/20_processing/substitution_may21/scaling.gms index eeacde45a8..db58c9ae6f 100644 --- a/modules/20_processing/substitution_may21/scaling.gms +++ b/modules/20_processing/substitution_may21/scaling.gms @@ -5,5 +5,6 @@ *** | MAgPIE License Exception, version 1.0 (see LICENSE file). *** | Contact: magpie@pik-potsdam.de +vm_secondary_overproduction.scale(i,kall,kpr) = 10e-3; vm_cost_processing.scale(i) = 10e5; vm_processing_substitution_cost.scale(i) = 10e4; diff --git a/modules/21_trade/selfsuff_reduced/scaling.gms b/modules/21_trade/selfsuff_reduced/scaling.gms index b785809e7b..445ed50447 100644 --- a/modules/21_trade/selfsuff_reduced/scaling.gms +++ b/modules/21_trade/selfsuff_reduced/scaling.gms @@ -6,4 +6,4 @@ *** | Contact: magpie@pik-potsdam.de vm_cost_trade.scale(i) = 10e5; -v21_cost_trade_reg.scale(h,k_trade) = 10e3; +v21_cost_trade_reg.scale(h,k_trade) = 10e4; diff --git a/modules/21_trade/selfsuff_reduced_bilateral22/scaling.gms b/modules/21_trade/selfsuff_reduced_bilateral22/scaling.gms index b9df882f1a..2a4d3ae97a 100644 --- a/modules/21_trade/selfsuff_reduced_bilateral22/scaling.gms +++ b/modules/21_trade/selfsuff_reduced_bilateral22/scaling.gms @@ -6,4 +6,4 @@ *** | Contact: magpie@pik-potsdam.de vm_cost_trade.scale(i) = 10e5; -v21_cost_trade_reg.scale(i,k_trade) = 10e3; +v21_cost_trade_reg.scale(i,k_trade) = 10e4; diff --git a/modules/34_urban/exo_nov21/scaling.gms b/modules/34_urban/exo_nov21/scaling.gms index dec0009dd7..f66056dbbd 100644 --- a/modules/34_urban/exo_nov21/scaling.gms +++ b/modules/34_urban/exo_nov21/scaling.gms @@ -5,4 +5,6 @@ *** | MAgPIE License Exception, version 1.0 (see LICENSE file). *** | Contact: magpie@pik-potsdam.de -vm_cost_urban.scale(j) = 10e4; +vm_cost_urban.scale(j) = 10e3; +v34_cost1.scale(j) = 10e-4; +v34_cost2.scale(j) = 10e-4; diff --git a/modules/58_peatland/v2/scaling.gms b/modules/58_peatland/v2/scaling.gms index 787936e8ca..f642843a53 100644 --- a/modules/58_peatland/v2/scaling.gms +++ b/modules/58_peatland/v2/scaling.gms @@ -5,5 +5,4 @@ *** | MAgPIE License Exception, version 1.0 (see LICENSE file). *** | Contact: magpie@pik-potsdam.de -v58_peatlandChange.scale(j,land58) = 10e-3; -v58_peatland.scale(j,land58) = 10e-3; +v58_balance2.scale(j,manPeat58) = 10e-6 From 019121aebb80a30e8d70bbde6785b4408f6c95b0 Mon Sep 17 00:00:00 2001 From: florianh Date: Wed, 2 Oct 2024 17:15:36 +0200 Subject: [PATCH 043/206] start scripts update --- scripts/start/projects/paper_peatlandTax.R | 2 +- scripts/start/projects/project_ABCDR.R | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/start/projects/paper_peatlandTax.R b/scripts/start/projects/paper_peatlandTax.R index 80353854f3..9c3a565421 100644 --- a/scripts/start/projects/paper_peatlandTax.R +++ b/scripts/start/projects/paper_peatlandTax.R @@ -23,7 +23,7 @@ source("scripts/start_functions.R") source("config/default.cfg") # create additional information to describe the runs -cfg$info$flag <- "PTax30" +cfg$info$flag <- "PTax31" cfg$results_folder <- "output/:title:" cfg$results_folder_highres <- "output" diff --git a/scripts/start/projects/project_ABCDR.R b/scripts/start/projects/project_ABCDR.R index 3e757d5106..9f6c3612ba 100644 --- a/scripts/start/projects/project_ABCDR.R +++ b/scripts/start/projects/project_ABCDR.R @@ -19,7 +19,7 @@ source("config/default.cfg") #download_and_update(cfg) # create additional information to describe the runs -cfg$info$flag <- "ABCDR10" +cfg$info$flag <- "ABCDR11" cfg$results_folder <- "output/:title:" cfg$force_replace <- TRUE From c5c92aaf568ec39ba3514cf885a29ccf1f90db8e Mon Sep 17 00:00:00 2001 From: florianh Date: Wed, 2 Oct 2024 17:22:40 +0200 Subject: [PATCH 044/206] bugfix --- modules/58_peatland/v2/scaling.gms | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/58_peatland/v2/scaling.gms b/modules/58_peatland/v2/scaling.gms index f642843a53..ce71aa32b4 100644 --- a/modules/58_peatland/v2/scaling.gms +++ b/modules/58_peatland/v2/scaling.gms @@ -5,4 +5,4 @@ *** | MAgPIE License Exception, version 1.0 (see LICENSE file). *** | Contact: magpie@pik-potsdam.de -v58_balance2.scale(j,manPeat58) = 10e-6 +v58_balance2.scale(j,manPeat58) = 10e-6; From 60d5bb8bcdbde41744a7ba378dc090b014a73f80 Mon Sep 17 00:00:00 2001 From: florianh Date: Wed, 2 Oct 2024 20:17:05 +0200 Subject: [PATCH 045/206] scaling update --- modules/10_land/landmatrix_dec18/scaling.gms | 4 ++-- modules/58_peatland/v2/scaling.gms | 3 ++- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/modules/10_land/landmatrix_dec18/scaling.gms b/modules/10_land/landmatrix_dec18/scaling.gms index 2b40b4aedd..3db0837364 100644 --- a/modules/10_land/landmatrix_dec18/scaling.gms +++ b/modules/10_land/landmatrix_dec18/scaling.gms @@ -6,5 +6,5 @@ *** | Contact: magpie@pik-potsdam.de vm_landdiff.scale = 10e3; -v10_balance_positive.scale(j) = 10e-15; -v10_balance_negative.scale(j) = 10e-15; +v10_balance_positive.scale(j) = 10e-10; +v10_balance_negative.scale(j) = 10e-10; diff --git a/modules/58_peatland/v2/scaling.gms b/modules/58_peatland/v2/scaling.gms index ce71aa32b4..a0f1cec7b8 100644 --- a/modules/58_peatland/v2/scaling.gms +++ b/modules/58_peatland/v2/scaling.gms @@ -5,4 +5,5 @@ *** | MAgPIE License Exception, version 1.0 (see LICENSE file). *** | Contact: magpie@pik-potsdam.de -v58_balance2.scale(j,manPeat58) = 10e-6; +v58_balance.scale(j,manPeat58) = 10e-5; +v58_balance2.scale(j,manPeat58) = 10e-5; From 82fb440cdbc1cc5896019ef85105df76595b57f6 Mon Sep 17 00:00:00 2001 From: florianh Date: Wed, 2 Oct 2024 21:35:15 +0200 Subject: [PATCH 046/206] start scripts --- scripts/start/projects/paper_peatlandTax.R | 2 +- scripts/start/projects/project_ABCDR.R | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/start/projects/paper_peatlandTax.R b/scripts/start/projects/paper_peatlandTax.R index 9c3a565421..ea1b26ee82 100644 --- a/scripts/start/projects/paper_peatlandTax.R +++ b/scripts/start/projects/paper_peatlandTax.R @@ -23,7 +23,7 @@ source("scripts/start_functions.R") source("config/default.cfg") # create additional information to describe the runs -cfg$info$flag <- "PTax31" +cfg$info$flag <- "PTax32" cfg$results_folder <- "output/:title:" cfg$results_folder_highres <- "output" diff --git a/scripts/start/projects/project_ABCDR.R b/scripts/start/projects/project_ABCDR.R index 9f6c3612ba..cf8092828e 100644 --- a/scripts/start/projects/project_ABCDR.R +++ b/scripts/start/projects/project_ABCDR.R @@ -19,7 +19,7 @@ source("config/default.cfg") #download_and_update(cfg) # create additional information to describe the runs -cfg$info$flag <- "ABCDR11" +cfg$info$flag <- "ABCDR12" cfg$results_folder <- "output/:title:" cfg$force_replace <- TRUE From 774765e80b32e6764b09dd798bf84f90994b4dcf Mon Sep 17 00:00:00 2001 From: florianh Date: Thu, 3 Oct 2024 09:22:07 +0200 Subject: [PATCH 047/206] start script update --- scripts/start/projects/project_BEST.R | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/scripts/start/projects/project_BEST.R b/scripts/start/projects/project_BEST.R index c525421d52..94122196c7 100644 --- a/scripts/start/projects/project_BEST.R +++ b/scripts/start/projects/project_BEST.R @@ -13,7 +13,7 @@ #### Script to start a MAgPIE run #### ###################################### -version <- "V13" +version <- "V14" library(lucode2) library(magclass) @@ -29,7 +29,7 @@ source("scripts/start_functions.R") calc_bioen <- function(x) { #B0 B0 <- new.magpie("GLO",seq(1995,2150,by=5),NULL,fill = 0) - + #B50 #50 EJ in 2050 globally, linear interpolation B50 <- new.magpie("GLO",c(seq(1995,2020,by=5),2050,2100,2150),NULL,fill = 0) @@ -43,7 +43,7 @@ calc_bioen <- function(x) { #B100 #100 EJ in 2050 globally, linear interpolation B100 <- B50*2 - + if (x == "B0") { return(B0) } else if (x == "B50") { @@ -108,18 +108,20 @@ for (rcp in rcps) { for (ssp in ssps) { cfg$title <- paste("TAU",ssp,rcp,tau_scen,sep="-") cfg <- setScenario(cfg,c(ssp,"NPI",rcp)) + cfg <- setScenario(cfg, "fix_2020", scenario_config = "config/projects/scenario_config_year_fix.csv") cfg$gms$s32_max_aff_area <- 0 cfg$gms$s56_c_price_induced_aff <- 0 cfg$gms$c30_bioen_type <- bioen_type cfg$gms$c30_bioen_water <- bioen_water cfg$gms$tc <- "endo_jan22" x <- try(modelstat(file.path("output",cfg$title,"fulldata.gdx")),silent = TRUE) - if(any(!x %in% c(2,7))) { + if(is.null(x) | (is.magpie(x) & any(!x %in% c(2,7)))) { download_and_update(cfg) write.magpie(calc_bioen(biodem),"modules/60_bioenergy/input/glo.2ndgen_bioenergy_demand.csv") write.magpie(calc_ghgprice(ghgprice),"modules/56_ghg_policy/input/f56_pollutant_prices_emulator.cs3") start_run(cfg,codeCheck=FALSE) message(paste0("TAU run started: ",cfg$title)) + Sys.sleep(10) } } } @@ -132,12 +134,12 @@ while (!success) { for (rcp in rcps) { for (ssp in ssps) { x <- try(modelstat(file.path("output",paste("TAU",ssp,rcp,tau_scen,sep="-"),"fulldata.gdx")),silent = TRUE) - if (is(x, "try-error")) x <- NULL else if (is.magpie(x) & all(x %in% c(2,7))) x <- add_dimension(collapseNames(x),dim = 3.1,add = "scen",nm = paste0(ssp,rcp)) + if (is.magpie(x) & all(x %in% c(2,7))) { + x <- add_dimension(collapseNames(x),dim = 3.1,add = "scen",nm = paste0(ssp,rcp)) + } else x <- NULL z <- mbind(z,x) } } - print(str(z)) - print(dim(z)) if (is.null(z)) { message("Not any model run with endogenous TAU finished. Sleeping for 10 minutes.") Sys.sleep(60*10) @@ -158,6 +160,7 @@ for (rcp in rcps) { for (bioen_type in c("all","begr","betr")) { for (bioen_water in c("all","rainfed")) { cfg <- setScenario(cfg,c(ssp,"NPI",rcp)) + cfg <- setScenario(cfg, "fix_2020", scenario_config = "config/projects/scenario_config_year_fix.csv") cfg$title <- paste(version,ssp,rcp,biodem,ghgprice,paste0("Type",toupper(bioen_type)),paste0("Water",toupper(bioen_water)),sep="-") cfg$gms$s32_max_aff_area <- 0 cfg$gms$s56_c_price_induced_aff <- 0 From bd5d8d3ebbfe5cdbf2a731718b66ca353c70f77c Mon Sep 17 00:00:00 2001 From: orichters Date: Fri, 4 Oct 2024 16:18:10 +0200 Subject: [PATCH 048/206] 2005 -> 2017 for REMIND coupling --- CHANGELOG.md | 1 + scripts/start/extra/emulator.R | 18 +++++++++--------- scripts/start_functions.R | 8 ++++---- 3 files changed, 14 insertions(+), 13 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 097c72d636..1f05f0628f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,6 +9,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). - **inputdata** changed GDP base year from 2005USD to 2017USD - **config** changed default input data to use 2017USD - **module_documentation** all references to USD05 changed to USD17 +- **scripts** REMIND coupling reads data in US$2017, not US$2005 ### added - diff --git a/scripts/start/extra/emulator.R b/scripts/start/extra/emulator.R index 4645d5914a..f2d6850f38 100644 --- a/scripts/start/extra/emulator.R +++ b/scripts/start/extra/emulator.R @@ -59,9 +59,9 @@ write.ghgtax <- function(mifname, outfile) { tmp <- read.report(fname, as.list = FALSE) # Select variables from REMIND report - ghg_price_names <- c("Price|Carbon (US$2005/t CO2)", - "Price|N2O (US$2005/t N2O)", - "Price|CH4 (US$2005/t CH4)") + ghg_price_names <- c("Price|Carbon (US$2017/t CO2)", + "Price|N2O (US$2017/t N2O)", + "Price|CH4 (US$2017/t CH4)") tmp <- collapseNames(tmp[,,ghg_price_names]) # remove global dimension tmp <- tmp["GLO",,,invert=TRUE] @@ -72,11 +72,11 @@ write.ghgtax <- function(mifname, outfile) { ghgtax <- new.magpie(cells_and_regions = getRegions(tmp),years = time,fill = NA,sets = c("regions","years","gas"),names = c("n2o_n_direct","n2o_n_indirect","ch4","co2_c")) - # unit defined in modules/56_ghg_policy/input/f56_pollutant_prices.cs3: US$ 2005 per Mg N2O-N CH4 and CO2-C - ghgtax[,,"co2_c"] <- tmp[,,"Price|Carbon (US$2005/t CO2)"] * 44/12 # US$2005/tCO2 -> US$2005/tC - ghgtax[,,"ch4"] <- tmp[,,"Price|CH4 (US$2005/t CH4)"] - ghgtax[,,"n2o_n_direct"] <- tmp[,,"Price|N2O (US$2005/t N2O)"] * 44/28 # US$2005/tN2O -> US$2005/tN - ghgtax[,,"n2o_n_indirect"] <- tmp[,,"Price|N2O (US$2005/t N2O)"] * 44/28 # US$2005/tN2O -> US$2005/tN + # unit defined in modules/56_ghg_policy/input/f56_pollutant_prices.cs3: US$ 2017 per Mg N2O-N CH4 and CO2-C + ghgtax[,,"co2_c"] <- tmp[,,"Price|Carbon (US$2017/t CO2)"] * 44/12 # US$2017/tCO2 -> US$2017/tC + ghgtax[,,"ch4"] <- tmp[,,"Price|CH4 (US$2017/t CH4)"] + ghgtax[,,"n2o_n_direct"] <- tmp[,,"Price|N2O (US$2017/t N2O)"] * 44/28 # US$2017/tN2O -> US$2017/tN + ghgtax[,,"n2o_n_indirect"] <- tmp[,,"Price|N2O (US$2017/t N2O)"] * 44/28 # US$2017/tN2O -> US$2017/tN # set ghg prices before and in 2020 to zero ghgtax[,getYears(ghgtax)<="y2020",] <- 0 @@ -89,7 +89,7 @@ write.ghgtax <- function(mifname, outfile) { cat("CO2 price in 2025:",ghgtax[,2025,"co2_c"],"\n") for_plot <- ghgtax[1,,"co2_c"] * 12/44 # convert unit back just for plotting #for_plot <- for_plot[,c("y1995","y2110","y2130","y2150"),,invert=TRUE] - txtplot(as.numeric(gsub("y","",getYears(for_plot))),for_plot,ylab="US$2005/tCO2") + txtplot(as.numeric(gsub("y","",getYears(for_plot))),for_plot,ylab="US$2017/tCO2") cat("Writing GHG tax scenario",scenarios[scen,"ghgtax_name"],"\n\n") write.magpie(ghgtax, file_name = outfile) diff --git a/scripts/start_functions.R b/scripts/start_functions.R index cd6f48738f..af8da9ddb1 100644 --- a/scripts/start_functions.R +++ b/scripts/start_functions.R @@ -555,16 +555,16 @@ getReportData <- function(path_to_report_bioenergy, path_to_report_ghgprices = N } .emissionPrices <- function(mag){ - out_c <- mag[,,"Price|Carbon (US$2005/t CO2)"]*44/12 # US$2005/tCO2 -> US$2005/tC + out_c <- mag[,,"Price|Carbon (US$2017/t CO2)"]*44/12 # US$2017/tCO2 -> US$2017/tC dimnames(out_c)[[3]] <- "co2_c" - out_n2o_direct <- mag[,,"Price|N2O (US$2005/t N2O)"]*44/28 # US$2005/tN2O -> US$2005/tN + out_n2o_direct <- mag[,,"Price|N2O (US$2017/t N2O)"]*44/28 # US$2017/tN2O -> US$2017/tN dimnames(out_n2o_direct)[[3]] <- "n2o_n_direct" - out_n2o_indirect <- mag[,,"Price|N2O (US$2005/t N2O)"]*44/28 # US$2005/tN2O -> US$2005/tN + out_n2o_indirect <- mag[,,"Price|N2O (US$2017/t N2O)"]*44/28 # US$2017/tN2O -> US$2017/tN dimnames(out_n2o_indirect)[[3]] <- "n2o_n_indirect" - out_ch4 <- mag[,,"Price|CH4 (US$2005/t CH4)"] + out_ch4 <- mag[,,"Price|CH4 (US$2017/t CH4)"] dimnames(out_ch4)[[3]] <- "ch4" out <- mbind(out_n2o_direct,out_n2o_indirect,out_ch4,out_c) From 064cd4761967dcbf1727979e6d9f5b303c503888 Mon Sep 17 00:00:00 2001 From: florianh Date: Mon, 14 Oct 2024 12:41:00 +0200 Subject: [PATCH 049/206] bugfix tree cover on cropland --- modules/29_cropland/detail_apr24/presolve.gms | 5 ++--- scripts/start/projects/project_ABCDR.R | 2 +- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/modules/29_cropland/detail_apr24/presolve.gms b/modules/29_cropland/detail_apr24/presolve.gms index e1a7d63bcf..1b521039ff 100644 --- a/modules/29_cropland/detail_apr24/presolve.gms +++ b/modules/29_cropland/detail_apr24/presolve.gms @@ -64,11 +64,10 @@ if (s29_treecover_keep = 1, i29_treecover_target(t,j)$(i29_treecover_target(t,j) < pc29_treecover_share(j)) = pc29_treecover_share(j); ); -* Bounds for treecover. Only ac_est can increase in optimization. ac_sub can only decrease. +* Bounds for treecover. Only ac_est can increase in optimization. ac_sub is fixed. v29_treecover.lo(j,ac_est) = 0; v29_treecover.up(j,ac_est) = Inf; -v29_treecover.lo(j,ac_sub) = 0; -v29_treecover.up(j,ac_sub) = pc29_treecover(j,ac_sub); +v29_treecover.fx(j,ac_sub) = pc29_treecover(j,ac_sub); m_boundfix(v29_treecover,(j,ac_sub),l,1e-6); * set treecover penalty diff --git a/scripts/start/projects/project_ABCDR.R b/scripts/start/projects/project_ABCDR.R index cf8092828e..90ff7ff309 100644 --- a/scripts/start/projects/project_ABCDR.R +++ b/scripts/start/projects/project_ABCDR.R @@ -19,7 +19,7 @@ source("config/default.cfg") #download_and_update(cfg) # create additional information to describe the runs -cfg$info$flag <- "ABCDR12" +cfg$info$flag <- "ABCDR13" cfg$results_folder <- "output/:title:" cfg$force_replace <- TRUE From 58cfd17fcd08c447b1e3908361df112aa7fe1fd7 Mon Sep 17 00:00:00 2001 From: Debbora Leip Date: Mon, 14 Oct 2024 19:28:55 +0200 Subject: [PATCH 050/206] added option to turn off future bioplastic demand --- CHANGELOG.md | 2 +- config/default.cfg | 7 ++++++- modules/62_material/exo_flexreg_apr16/input.gms | 1 + modules/62_material/exo_flexreg_apr16/preloop.gms | 10 +++++++--- modules/62_material/exo_flexreg_apr16/presolve.gms | 6 +++++- 5 files changed, 20 insertions(+), 6 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 097c72d636..5bf892130f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -11,7 +11,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). - **module_documentation** all references to USD05 changed to USD17 ### added -- +- **62_material** added switch to turn off future material demand for bioplastic ### removed - diff --git a/config/default.cfg b/config/default.cfg index 6e7a3223c2..22a4b7fc49 100644 --- a/config/default.cfg +++ b/config/default.cfg @@ -1941,11 +1941,16 @@ cfg$gms$material <- "exo_flexreg_apr16" # * defined by the maximum demand for bioplastics s62_max_dem_bioplastics # * (in mio. tonnes) and the midpoint s62_midpoint_dem_bioplastics (i.e. # * where bioplastic demand is half of the maximum demand). -# * If maximum demand is 0, biomass demand for bioplastic production is not included. +# * If s62_include_bioplastic is set to 0, future biomass demand for bioplastic +# * production is not included. Otherwise, bioplastic demand is either kept +# * constant at the value of 2020 (if s62_max_dem_bioplastics is set to 0) +# * or follows a logistic curve with the specified maximum demand and +# * midpoint (s62_midpoint_dem_bioplastic). # * Projected total plastic use in the "Global Ambiton" scneario of the OECD is # * about 600 mio. tonnes in 2050 -> E.g. 200 mio. tonnes in 2050 could be a # * reasonable (but ambitious) bioplastic scenario. With midpoint 2050 this # * would mean s62_max_dem_bioplastic = 400. +cfg$gms$s62_include_bioplastic <- 1 # def = 1 cfg$gms$s62_max_dem_bioplastic <- 0 # def = 0 cfg$gms$s62_midpoint_dem_bioplastic <- 2050 # def = 2050 diff --git a/modules/62_material/exo_flexreg_apr16/input.gms b/modules/62_material/exo_flexreg_apr16/input.gms index 829405d7da..c1996c58e9 100644 --- a/modules/62_material/exo_flexreg_apr16/input.gms +++ b/modules/62_material/exo_flexreg_apr16/input.gms @@ -27,5 +27,6 @@ $offdelim / ; +scalar s62_include_bioplastic switch whether future bioplastic demand should be included (0 or 1) / 0 /; scalar s62_max_dem_bioplastic maximum demand for bioplastics (mio. tDM per yr) / 0 /; scalar s62_midpoint_dem_bioplastic midpoint of logistic function for bioplastic demand (yr) / 2050 /; diff --git a/modules/62_material/exo_flexreg_apr16/preloop.gms b/modules/62_material/exo_flexreg_apr16/preloop.gms index 3253981ce5..ed766ebe54 100644 --- a/modules/62_material/exo_flexreg_apr16/preloop.gms +++ b/modules/62_material/exo_flexreg_apr16/preloop.gms @@ -9,9 +9,9 @@ p62_dem_food_lastcalibyear(i) = 1; p62_dem_bioplastic(t,i) = 0; -* Bioplastic demand is based on historic values up to 2020, and either kept constant for -* future years, or following a logistic function with given midpoint and maximum if a -* bioplastic production target is exogenously set. +* Bioplastic demand is based on historic values up to 2020, and either set to zero for +* future years, kept constant at the value of 2020, or following a logistic function with +* given midpoint and maximum if a bioplastic production target is exogenously set. * Global bioplastic demand is distributed to regions proportional to population due to lack of better data. p62_dem_bioplastic(t,i) = f62_hist_dem_bioplastic(t) * (im_pop(t,i) / sum(i2, im_pop(t,i2))); @@ -22,5 +22,9 @@ if (s62_max_dem_bioplastic <> 0, p62_dem_bioplastic(t,i)$(m_year(t)>2020) = s62_max_dem_bioplastic / (1 + exp(-s62_growth_rate_bioplastic*(m_year(t)-s62_midpoint_dem_bioplastic))) * (im_pop(t,i) / sum(i2, im_pop(t,i2))); ); +if (s62_include_bioplastic = 0, + p62_dem_bioplastic(t,i)$(m_year(t)>2020) = 0; +); + * translate bioplastic demand to biomass demand using conversion factors between bioplastic and the different biomass sources p62_bioplastic_substrate(t,i,kall) = p62_dem_bioplastic(t,i) * f62_biomass2bioplastic_conversion_ratio(kall); diff --git a/modules/62_material/exo_flexreg_apr16/presolve.gms b/modules/62_material/exo_flexreg_apr16/presolve.gms index c86fbd6bd3..6931ccf800 100644 --- a/modules/62_material/exo_flexreg_apr16/presolve.gms +++ b/modules/62_material/exo_flexreg_apr16/presolve.gms @@ -30,5 +30,9 @@ if (sum(sameas(t_past,t),1) = 1, p62_bioplastic_substrate_double_counted(t,i,kall) = p62_bioplastic_substrate(t,i,kall); p62_bioplastic_substrate_lastcalibyear(i,kall) = p62_bioplastic_substrate(t,i,kall); else - p62_bioplastic_substrate_double_counted(t,i,kall) = p62_bioplastic_substrate_lastcalibyear(i,kall) * p62_scaling_factor(i); + if (s62_include_bioplastic = 0, + p62_bioplastic_substrate_double_counted(t,i,kall) = 0; + else + p62_bioplastic_substrate_double_counted(t,i,kall) = p62_bioplastic_substrate_lastcalibyear(i,kall) * p62_scaling_factor(i); + ); ); From f00d6a3b8386d9dca0246e627db18f10b0a3f7f9 Mon Sep 17 00:00:00 2001 From: Debbora Leip Date: Mon, 14 Oct 2024 19:41:58 +0200 Subject: [PATCH 051/206] set s62_include_bioplastic to default value --- modules/62_material/exo_flexreg_apr16/input.gms | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/62_material/exo_flexreg_apr16/input.gms b/modules/62_material/exo_flexreg_apr16/input.gms index c1996c58e9..bd503db126 100644 --- a/modules/62_material/exo_flexreg_apr16/input.gms +++ b/modules/62_material/exo_flexreg_apr16/input.gms @@ -27,6 +27,6 @@ $offdelim / ; -scalar s62_include_bioplastic switch whether future bioplastic demand should be included (0 or 1) / 0 /; +scalar s62_include_bioplastic switch whether future bioplastic demand should be included (0 or 1) / 1 /; scalar s62_max_dem_bioplastic maximum demand for bioplastics (mio. tDM per yr) / 0 /; scalar s62_midpoint_dem_bioplastic midpoint of logistic function for bioplastic demand (yr) / 2050 /; From b7fda06eb927b04c3162360bbbfbcd33eeab27c9 Mon Sep 17 00:00:00 2001 From: florianh Date: Tue, 15 Oct 2024 13:40:03 +0200 Subject: [PATCH 052/206] changelog --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index ba9eedf89d..089ee490ab 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -19,6 +19,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). ### fixed - **11_costs** changed equation to fix bug in total water cost calculation +- **29_cropland** treecover age-class growth was not working properly because ac_sub was erroneously not fixed ## [4.8.2] - 2024-09-24 From f3bea2e8729086cb3a45a72dd4f2d2078317c3c9 Mon Sep 17 00:00:00 2001 From: Pascal Sauer <156898545+pascal-sauer@users.noreply.github.com> Date: Wed, 16 Oct 2024 10:23:42 +0200 Subject: [PATCH 053/206] renv 1.0.11 --- renv/activate.R | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/renv/activate.R b/renv/activate.R index c360bf2962..0eb51088a2 100644 --- a/renv/activate.R +++ b/renv/activate.R @@ -2,7 +2,7 @@ local({ # the requested version of renv - version <- "1.0.9" + version <- "1.0.11" attr(version, "sha") <- NULL # the project directory @@ -368,8 +368,7 @@ local({ quiet = TRUE ) - if ("headers" %in% names(formals(utils::download.file))) - { + if ("headers" %in% names(formals(utils::download.file))) { headers <- renv_bootstrap_download_custom_headers(url) if (length(headers) && is.character(headers)) args$headers <- headers @@ -457,9 +456,8 @@ local({ # add custom headers if available -- note that # utils::available.packages() will pass this to download.file() - if ("headers" %in% names(formals(utils::download.file))) - { - headers <- renv_bootstrap_download_custom_headers(url) + if ("headers" %in% names(formals(utils::download.file))) { + headers <- renv_bootstrap_download_custom_headers(repos) if (length(headers) && is.character(headers)) args$headers <- headers } From 408062ec202279c879aaa06a11f2cfb664052407 Mon Sep 17 00:00:00 2001 From: Pascal Sauer <156898545+pascal-sauer@users.noreply.github.com> Date: Wed, 16 Oct 2024 10:33:43 +0200 Subject: [PATCH 054/206] prevent warning by installing rmarkdown --- .Rprofile | 1 + 1 file changed, 1 insertion(+) diff --git a/.Rprofile b/.Rprofile index bc514ec1fa..049e1ce91b 100644 --- a/.Rprofile +++ b/.Rprofile @@ -27,6 +27,7 @@ if (!"https://rse.pik-potsdam.de/r/packages" %in% getOption("repos")) { # bootstrapping, will only run once after this repo is freshly cloned if (isTRUE(rownames(installed.packages(priority = "NA")) == "renv")) { message("R package dependencies are not installed in this renv, installing now...") + renv::install("rmarkdown", prompt = FALSE) # rmarkdown is required to find dependencies in Rmd files renv::hydrate(prompt = FALSE, report = FALSE) # auto-detect and install all dependencies message("Finished installing R package dependencies.") if (!("upstream" %in% gert::git_remote_list()$name)) { From 1d3b2343b439ce9e5a387cfcd42269b02f6c87b4 Mon Sep 17 00:00:00 2001 From: florianh Date: Thu, 17 Oct 2024 16:50:40 +0200 Subject: [PATCH 055/206] update input files --- config/default.cfg | 6 +++--- config/projects/scenario_config_el2.csv | 2 +- config/projects/scenario_config_fsec.csv | 6 +++--- config/scenario_config.csv | 2 +- scripts/start/extra/recalibrateH16.R | 6 +++--- scripts/start/projects/paper_peatlandTax.R | 10 +++++----- scripts/start/projects/project_ABCDR.R | 12 ++++++------ scripts/start/projects/project_EAT2p0.R | 2 +- 8 files changed, 23 insertions(+), 23 deletions(-) diff --git a/config/default.cfg b/config/default.cfg index 22a4b7fc49..2d941d0339 100644 --- a/config/default.cfg +++ b/config/default.cfg @@ -22,9 +22,9 @@ cfg$model <- "main.gms" #def = "main.gms" #### input settings #### # which input data sets should be used? -cfg$input <- c(regional = "rev4.112_h12_magpie.tgz", - cellular = "rev4.112_h12_fd712c0b_cellularmagpie_c200_MRI-ESM2-0-ssp370_lpjml-8e6c5eb1.tgz", - validation = "rev4.112_h12_magpie.tgz", +cfg$input <- c(regional = "rev4.113_h12_magpie.tgz", + cellular = "rev4.113_h12_fd712c0b_cellularmagpie_c200_MRI-ESM2-0-ssp370_lpjml-8e6c5eb1.tgz", + validation = "rev4.113_h12_magpie.tgz", additional = "additional_data_rev4.57.tgz", calibration = "calibration_H12_27Sep24.tgz") diff --git a/config/projects/scenario_config_el2.csv b/config/projects/scenario_config_el2.csv index d8dc50c837..ab91616c08 100644 --- a/config/projects/scenario_config_el2.csv +++ b/config/projects/scenario_config_el2.csv @@ -19,5 +19,5 @@ gms$s15_exo_alcohol;1;1;1 gms$s15_alc_scen;0;0;0 gms$factor_costs;sticky_labor;sticky_labor;sticky_labor gms$c70_feed_scen;ssp1;ssp2;ssp2 -input['cellular'];rev4.112EL2_h12_c6a7458f_cellularmagpie_c200_IPSL-CM6A-LR-ssp370_lpjml-8e6c5eb1.tgz;; +input['cellular'];rev4.113EL2_h12_c6a7458f_cellularmagpie_c200_IPSL-CM6A-LR-ssp370_lpjml-8e6c5eb1.tgz;; magicc_emis_scen;REMIND_generic_C_SSP2EU-DSPkB650-DS_betax_DeepDive_noNDC-rem-12.mif;REMIND_generic_C_SSP2EU-DSPkB650-DS_betax_DeepDive_noNDC-rem-12.mif;REMIND_generic_C_SSP2EU-DSPkB650-DS_betax_DeepDive_noNDC-rem-12.mif diff --git a/config/projects/scenario_config_fsec.csv b/config/projects/scenario_config_fsec.csv index 551e558a57..6991976180 100644 --- a/config/projects/scenario_config_fsec.csv +++ b/config/projects/scenario_config_fsec.csv @@ -76,9 +76,9 @@ gms$s62_max_dem_bioplastic;0;;;;400;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; gms$c70_fac_req_regr;reg;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; gms$c70_feed_scen;;;;;;;;;;;;;;;;;;ssp1;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; gms$c73_build_demand;;;;;;;;;;;;;;;;;;;;;;;;50pc;;;;;;;;;;;;;;;;;;;;;;;;;;; -input['cellular'];rev4.112_FSEC_3c888fa5_cellularmagpie_c200_MRI-ESM2-0-ssp460_lpjml-8e6c5eb1.tgz;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;rev4.112_FSEC_0bd54110_cellularmagpie_c200_MRI-ESM2-0-ssp119_lpjml-8e6c5eb1.tgz;rev4.112_FSEC_6819938d_cellularmagpie_c200_MRI-ESM2-0-ssp126_lpjml-8e6c5eb1.tgz;;rev4.112_FSEC_1b5c3817_cellularmagpie_c200_MRI-ESM2-0-ssp245_lpjml-8e6c5eb1.tgz;rev4.112_FSEC_3c888fa5_cellularmagpie_c200_MRI-ESM2-0-ssp460_lpjml-8e6c5eb1.tgz;rev4.112_FSEC_fd712c0b_cellularmagpie_c200_MRI-ESM2-0-ssp370_lpjml-8e6c5eb1.tgz;rev4.112_FSEC_09a63995_cellularmagpie_c200_MRI-ESM2-0-ssp585_lpjml-8e6c5eb1.tgz;;; -input['regional'];rev4.112_FSEC_magpie.tgz;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -input['validation'];rev4.112_FSEC_validation.tgz;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +input['cellular'];rev4.113_FSEC_3c888fa5_cellularmagpie_c200_MRI-ESM2-0-ssp460_lpjml-8e6c5eb1.tgz;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;rev4.113_FSEC_0bd54110_cellularmagpie_c200_MRI-ESM2-0-ssp119_lpjml-8e6c5eb1.tgz;rev4.113_FSEC_6819938d_cellularmagpie_c200_MRI-ESM2-0-ssp126_lpjml-8e6c5eb1.tgz;;rev4.113_FSEC_1b5c3817_cellularmagpie_c200_MRI-ESM2-0-ssp245_lpjml-8e6c5eb1.tgz;rev4.113_FSEC_3c888fa5_cellularmagpie_c200_MRI-ESM2-0-ssp460_lpjml-8e6c5eb1.tgz;rev4.113_FSEC_fd712c0b_cellularmagpie_c200_MRI-ESM2-0-ssp370_lpjml-8e6c5eb1.tgz;rev4.113_FSEC_09a63995_cellularmagpie_c200_MRI-ESM2-0-ssp585_lpjml-8e6c5eb1.tgz;;; +input['regional'];rev4.113_FSEC_magpie.tgz;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +input['validation'];rev4.113_FSEC_validation.tgz;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; input['additional'];additional_data_rev4.57.tgz;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; input['calibration'];calibration_FSEC_27Sep24.tgz;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; magicc_emis_scen;bjoernAR6_C_SSP2-NDC.mif;;;bjoernAR6_C_SSP2-PkBudg900.mif;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;bjoernAR6_C_SSP1-NDC.mif;;;;;;;;;;;;bjoernAR6_C_RemSDP-900-MagSSP1.mif;; diff --git a/config/scenario_config.csv b/config/scenario_config.csv index bb43320836..9a9ef32991 100755 --- a/config/scenario_config.csv +++ b/config/scenario_config.csv @@ -74,4 +74,4 @@ gms$c60_biodem_level;;;;;;;;;;;;;;;;;1;0;;;;;;;;;;;; gms$c60_res_2ndgenBE_dem;;;;ssp1;ssp2;ssp2;ssp3;ssp4;ssp5;sdp;ssp2;sdp;sdp;;;;;;;;;;;;;;;;; gms$c70_feed_scen;;;;ssp1;ssp2;ssp2;ssp3;ssp4;ssp5;ssp1;ssp5;ssp1;ssp1;;;;;;;;;;;;;;;;; gms$s73_timber_demand_switch;;;;;;;;;;;;;;;;;;;;;;1;1;0;;;;;; -input['cellular'];;;;;;;;;;;;;;;;;;;;;;;;;rev4.112_h12_0bd54110_cellularmagpie_c200_MRI-ESM2-0-ssp119_lpjml-8e6c5eb1.tgz;rev4.112_h12_6819938d_cellularmagpie_c200_MRI-ESM2-0-ssp126_lpjml-8e6c5eb1.tgz;rev4.112_h12_1b5c3817_cellularmagpie_c200_MRI-ESM2-0-ssp245_lpjml-8e6c5eb1.tgz;rev4.112_h12_3c888fa5_cellularmagpie_c200_MRI-ESM2-0-ssp460_lpjml-8e6c5eb1.tgz;rev4.112_h12_fd712c0b_cellularmagpie_c200_MRI-ESM2-0-ssp370_lpjml-8e6c5eb1.tgz;rev4.112_h12_09a63995_cellularmagpie_c200_MRI-ESM2-0-ssp585_lpjml-8e6c5eb1.tgz +input['cellular'];;;;;;;;;;;;;;;;;;;;;;;;;rev4.113_h12_0bd54110_cellularmagpie_c200_MRI-ESM2-0-ssp119_lpjml-8e6c5eb1.tgz;rev4.113_h12_6819938d_cellularmagpie_c200_MRI-ESM2-0-ssp126_lpjml-8e6c5eb1.tgz;rev4.113_h12_1b5c3817_cellularmagpie_c200_MRI-ESM2-0-ssp245_lpjml-8e6c5eb1.tgz;rev4.113_h12_3c888fa5_cellularmagpie_c200_MRI-ESM2-0-ssp460_lpjml-8e6c5eb1.tgz;rev4.113_h12_fd712c0b_cellularmagpie_c200_MRI-ESM2-0-ssp370_lpjml-8e6c5eb1.tgz;rev4.113_h12_09a63995_cellularmagpie_c200_MRI-ESM2-0-ssp585_lpjml-8e6c5eb1.tgz diff --git a/scripts/start/extra/recalibrateH16.R b/scripts/start/extra/recalibrateH16.R index b576926d9b..c01057b463 100644 --- a/scripts/start/extra/recalibrateH16.R +++ b/scripts/start/extra/recalibrateH16.R @@ -17,10 +17,10 @@ source("scripts/start_functions.R") #start MAgPIE run source("config/default.cfg") -cfg$input['regional'] <- "rev4.112_36f73207_magpie.tgz" -cfg$input['validation'] <- "rev4.112_36f73207_validation.tgz" +cfg$input['regional'] <- "rev4.113_36f73207_magpie.tgz" +cfg$input['validation'] <- "rev4.113_36f73207_validation.tgz" cfg$input['calibration'] <- "calibration_H16_27Sep24.tgz" -cfg$input['cellular'] <- "rev4.112_36f73207_44a213b6_cellularmagpie_c400_MRI-ESM2-0-ssp370_lpjml-8e6c5eb1_clusterweight-ba4466a8.tgz" +cfg$input['cellular'] <- "rev4.113_36f73207_44a213b6_cellularmagpie_c400_MRI-ESM2-0-ssp370_lpjml-8e6c5eb1_clusterweight-ba4466a8.tgz" cfg$results_folder <- "output/:title:" cfg$recalibrate <- FALSE diff --git a/scripts/start/projects/paper_peatlandTax.R b/scripts/start/projects/paper_peatlandTax.R index ea1b26ee82..e3dac9d5e9 100644 --- a/scripts/start/projects/paper_peatlandTax.R +++ b/scripts/start/projects/paper_peatlandTax.R @@ -44,10 +44,10 @@ cfg$repositories <- append( getOption("magpie_repos") ) -cfg$input['regional'] <- "rev4.112_36f73207_magpie.tgz" -cfg$input['validation'] <- "rev4.112_36f73207_validation.tgz" +cfg$input['regional'] <- "rev4.113_36f73207_magpie.tgz" +cfg$input['validation'] <- "rev4.113_36f73207_validation.tgz" cfg$input['calibration'] <- "calibration_H16_27Sep24.tgz" -cfg$input['cellular'] <- "rev4.112_36f73207_44a213b6_cellularmagpie_c400_MRI-ESM2-0-ssp370_lpjml-8e6c5eb1_clusterweight-ba4466a8.tgz" +cfg$input['cellular'] <- "rev4.113_36f73207_44a213b6_cellularmagpie_c400_MRI-ESM2-0-ssp370_lpjml-8e6c5eb1_clusterweight-ba4466a8.tgz" download_and_update(cfg) ## Create patch file for GHG prices @@ -147,9 +147,9 @@ cfg$gms$s56_c_price_induced_aff <- 0 ## Start scenarios for (res in c("c400")) { if (res == "c400") - cfg$input['cellular'] <- "rev4.112_36f73207_44a213b6_cellularmagpie_c400_MRI-ESM2-0-ssp370_lpjml-8e6c5eb1_clusterweight-ba4466a8.tgz" + cfg$input['cellular'] <- "rev4.113_36f73207_44a213b6_cellularmagpie_c400_MRI-ESM2-0-ssp370_lpjml-8e6c5eb1_clusterweight-ba4466a8.tgz" else if (res == "c1000") { - cfg$input['cellular'] <- "rev4.112_36f73207_10f98ac1_cellularmagpie_c1000_MRI-ESM2-0-ssp370_lpjml-8e6c5eb1_clusterweight-ba4466a8.tgz" + cfg$input['cellular'] <- "rev4.113_36f73207_10f98ac1_cellularmagpie_c1000_MRI-ESM2-0-ssp370_lpjml-8e6c5eb1_clusterweight-ba4466a8.tgz" } ## Ref scenario cfg$title <- .title(cfg, paste(res, ssp, "Ref", sep = "-")) diff --git a/scripts/start/projects/project_ABCDR.R b/scripts/start/projects/project_ABCDR.R index 90ff7ff309..e9e84de6f2 100644 --- a/scripts/start/projects/project_ABCDR.R +++ b/scripts/start/projects/project_ABCDR.R @@ -31,10 +31,10 @@ cfg$qos <- "standby_highMem_dayMax" .title <- function(cfg, ...) return(paste(cfg$info$flag, sep="_",...)) -cfg$input['regional'] <- "rev4.112_36f73207_magpie.tgz" -cfg$input['validation'] <- "rev4.112_36f73207_validation.tgz" +cfg$input['regional'] <- "rev4.113_36f73207_magpie.tgz" +cfg$input['validation'] <- "rev4.113_36f73207_validation.tgz" cfg$input['calibration'] <- "calibration_H16_27Sep24.tgz" -cfg$input['cellular'] <- "rev4.112_36f73207_44a213b6_cellularmagpie_c400_MRI-ESM2-0-ssp370_lpjml-8e6c5eb1_clusterweight-ba4466a8.tgz" +cfg$input['cellular'] <- "rev4.113_36f73207_44a213b6_cellularmagpie_c400_MRI-ESM2-0-ssp370_lpjml-8e6c5eb1_clusterweight-ba4466a8.tgz" ssp <- "SSP2" @@ -54,19 +54,19 @@ for (pol in c("NDC","1p5deg","1p5deg-Diet")) { cfg$title <- .title(cfg, paste(ssp,pol,ifelse(growth==0,"natveg","plant"),paste0("AFS_tree_",sub("\\.","p",as.character(shr*100))),sep="-")) if (pol == "NDC") { cfg <- setScenario(cfg,c(ssp,"NDC","rcp4p5")) - cfg$input['cellular'] <- "rev4.112_36f73207_30c9dc61_cellularmagpie_c400_MRI-ESM2-0-ssp245_lpjml-8e6c5eb1_clusterweight-ba4466a8.tgz" + cfg$input['cellular'] <- "rev4.113_36f73207_30c9dc61_cellularmagpie_c400_MRI-ESM2-0-ssp245_lpjml-8e6c5eb1_clusterweight-ba4466a8.tgz" cfg$gms$c56_mute_ghgprices_until <- "y2150" cfg$gms$c56_pollutant_prices <- paste0("R32M46-", if (ssp=="SSP2") "SSP2EU" else ssp,"-NDC") cfg$gms$c60_2ndgen_biodem <- paste0("R32M46-", if (ssp=="SSP2") "SSP2EU" else ssp,"-NDC") } else if (pol == "1p5deg") { cfg <- setScenario(cfg,c(ssp,"NDC","rcp1p9")) - cfg$input['cellular'] <- "rev4.112_36f73207_bc624950_cellularmagpie_c400_MRI-ESM2-0-ssp119_lpjml-8e6c5eb1_clusterweight-ba4466a8.tgz" + cfg$input['cellular'] <- "rev4.113_36f73207_bc624950_cellularmagpie_c400_MRI-ESM2-0-ssp119_lpjml-8e6c5eb1_clusterweight-ba4466a8.tgz" cfg$gms$c56_mute_ghgprices_until <- "y2030" cfg$gms$c56_pollutant_prices <- paste0("R32M46-", if (ssp=="SSP2") "SSP2EU" else ssp,"-PkBudg650") cfg$gms$c60_2ndgen_biodem <- paste0("R32M46-", if (ssp=="SSP2") "SSP2EU" else ssp,"-PkBudg650") } else if (pol == "1p5deg-Diet") { cfg <- setScenario(cfg,c(ssp,"NDC","rcp1p9","eat_lancet_diet_v1")) - cfg$input['cellular'] <- "rev4.112_36f73207_bc624950_cellularmagpie_c400_MRI-ESM2-0-ssp119_lpjml-8e6c5eb1_clusterweight-ba4466a8.tgz" + cfg$input['cellular'] <- "rev4.113_36f73207_bc624950_cellularmagpie_c400_MRI-ESM2-0-ssp119_lpjml-8e6c5eb1_clusterweight-ba4466a8.tgz" cfg$gms$c56_mute_ghgprices_until <- "y2030" cfg$gms$c56_pollutant_prices <- paste0("R32M46-", if (ssp=="SSP2") "SSP2EU" else ssp,"-PkBudg650") cfg$gms$c60_2ndgen_biodem <- paste0("R32M46-", if (ssp=="SSP2") "SSP2EU" else ssp,"-PkBudg650") diff --git a/scripts/start/projects/project_EAT2p0.R b/scripts/start/projects/project_EAT2p0.R index ae7c3e06c8..fa70ea615b 100644 --- a/scripts/start/projects/project_EAT2p0.R +++ b/scripts/start/projects/project_EAT2p0.R @@ -90,7 +90,7 @@ bau <- function(cfg) { cfg$gms$c60_2ndgen_biodem <- "R21M42-SSP2-NPi" # default # Climate Change - cfg$input["cellular"] <- "rev4.112EL2_h12_c6a7458f_cellularmagpie_c200_IPSL-CM6A-LR-ssp370_lpjml-8e6c5eb1.tgz" + cfg$input["cellular"] <- "rev4.113EL2_h12_c6a7458f_cellularmagpie_c200_IPSL-CM6A-LR-ssp370_lpjml-8e6c5eb1.tgz" return(cfg) } From 389b22dbc2d8d250ef55448b1251333bb54bb82d Mon Sep 17 00:00:00 2001 From: florianh Date: Thu, 17 Oct 2024 18:42:05 +0200 Subject: [PATCH 056/206] bugfix --- config/default.cfg | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config/default.cfg b/config/default.cfg index 2d941d0339..4874bebbd3 100644 --- a/config/default.cfg +++ b/config/default.cfg @@ -24,7 +24,7 @@ cfg$model <- "main.gms" #def = "main.gms" # which input data sets should be used? cfg$input <- c(regional = "rev4.113_h12_magpie.tgz", cellular = "rev4.113_h12_fd712c0b_cellularmagpie_c200_MRI-ESM2-0-ssp370_lpjml-8e6c5eb1.tgz", - validation = "rev4.113_h12_magpie.tgz", + validation = "rev4.113_h12_validation.tgz", additional = "additional_data_rev4.57.tgz", calibration = "calibration_H12_27Sep24.tgz") From 426462128739b1e1334d67e33b13c30169227890 Mon Sep 17 00:00:00 2001 From: florianh Date: Fri, 18 Oct 2024 08:47:32 +0200 Subject: [PATCH 057/206] bugfix resubmit.R and changelog --- CHANGELOG.md | 3 ++- scripts/output/extra/resubmit.R | 11 +++++++---- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 089ee490ab..c4995099d6 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -10,6 +10,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). - **config** changed default input data to use 2017USD - **module_documentation** all references to USD05 changed to USD17 - **scripts** REMIND coupling reads data in US$2017, not US$2005 +- **config** updated input data to rev4.113 ### added - **62_material** added switch to turn off future material demand for bioplastic @@ -20,7 +21,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). ### fixed - **11_costs** changed equation to fix bug in total water cost calculation - **29_cropland** treecover age-class growth was not working properly because ac_sub was erroneously not fixed - +- **scripts** script/output/extra/resubmit.R ## [4.8.2] - 2024-09-24 diff --git a/scripts/output/extra/resubmit.R b/scripts/output/extra/resubmit.R index 2c597b72ef..9b86374df9 100644 --- a/scripts/output/extra/resubmit.R +++ b/scripts/output/extra/resubmit.R @@ -36,13 +36,16 @@ for (i in 1:length(outputdir)) { print(paste("Checking",outputdir[i])) #gdx file gdx<-file.path(outputdir[i],"fulldata.gdx") - if(file.exists(gdx)) tmp <- modelstat(gdx) else tmp <- 0 - if (any(tmp>2) | all(tmp==0)) { - file.copy(from = "scripts/run_submit/submit.sh",to = file.path(outputdir[i],"submit.sh"),overwrite = TRUE) + if(file.exists(gdx)) { + tmp <- try(modelstat(gdx),silent = TRUE) + if(!is.magpie(tmp)) tmp <- 0 + } else tmp <- 0 + if (any(tmp>2) | any(tmp==0)) { + file.copy(from = "scripts/run_submit/submit_standby.sh",to = file.path(outputdir[i],"submit_standby.sh"),overwrite = TRUE) current <- getwd() setwd(outputdir[i]) if (file.exists("magpie_y1995.gdx")) file.remove("magpie_y1995.gdx") - system("sbatch submit.sh") + system("sbatch submit_standby.sh") setwd(current) } } From 79c633a347f054dba03ce47f13d3705e08758833 Mon Sep 17 00:00:00 2001 From: florianh Date: Fri, 18 Oct 2024 11:11:52 +0200 Subject: [PATCH 058/206] count-up versions in start scripts --- scripts/start/projects/paper_peatlandTax.R | 2 +- scripts/start/projects/project_ABCDR.R | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/start/projects/paper_peatlandTax.R b/scripts/start/projects/paper_peatlandTax.R index e3dac9d5e9..9b8a298c4b 100644 --- a/scripts/start/projects/paper_peatlandTax.R +++ b/scripts/start/projects/paper_peatlandTax.R @@ -23,7 +23,7 @@ source("scripts/start_functions.R") source("config/default.cfg") # create additional information to describe the runs -cfg$info$flag <- "PTax32" +cfg$info$flag <- "PTax33" cfg$results_folder <- "output/:title:" cfg$results_folder_highres <- "output" diff --git a/scripts/start/projects/project_ABCDR.R b/scripts/start/projects/project_ABCDR.R index e9e84de6f2..2575a45e86 100644 --- a/scripts/start/projects/project_ABCDR.R +++ b/scripts/start/projects/project_ABCDR.R @@ -19,7 +19,7 @@ source("config/default.cfg") #download_and_update(cfg) # create additional information to describe the runs -cfg$info$flag <- "ABCDR13" +cfg$info$flag <- "ABCDR14" cfg$results_folder <- "output/:title:" cfg$force_replace <- TRUE From 379b0884ff25dc3c53a7ff394be4713405461dba Mon Sep 17 00:00:00 2001 From: florianh Date: Fri, 18 Oct 2024 18:30:57 +0200 Subject: [PATCH 059/206] SHAPE scenarios start year of dietary shift changed to 2025 --- CHANGELOG.md | 1 + config/scenario_config.csv | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index c4995099d6..196d60e5d2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -11,6 +11,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). - **module_documentation** all references to USD05 changed to USD17 - **scripts** REMIND coupling reads data in US$2017, not US$2005 - **config** updated input data to rev4.113 +- **config** SHAPE scenarios start year of dietary shift changed to 2025 ### added - **62_material** added switch to turn off future material demand for bioplastic diff --git a/config/scenario_config.csv b/config/scenario_config.csv index 9a9ef32991..dc70569131 100755 --- a/config/scenario_config.csv +++ b/config/scenario_config.csv @@ -7,12 +7,12 @@ gms$c14_yields_scenario;cc;nocc;nocc_hist;;;;;;;;;;;;;;;;;;;;;;;;;;; gms$c15_food_scenario;;;;SSP1;SSP2;SSP2;SSP3;SSP4;SSP5;SSP1;SSP2;SSP1;SSP1;;;;;;;;;;;;;;;;; gms$s15_rumdairy_scp_substitution;;;;;;;;;;0;0.5;0;0;;;;;;;;;;;;;;;;; gms$s15_food_subst_functional_form;;;;;;;;;;;2;;;;;;;;;;;;;;;;;;; -gms$s15_food_substitution_start;;;;;;;;;;;2020;;;;;;;;;;;;;;;;;;; +gms$s15_food_substitution_start;;;;;;;;;;;2025;;;;;;;;;;;;;;;;;;; gms$s15_food_substitution_target;;;;;;;;;;;2050;;;;;;;;;;;;;;;;;;; gms$kfo_rd;;;;;;;;;;;livst_rum;;;;;;;;;;;;;;;;;;; gms$s15_exo_foodscen_convergence;;;;;;;;;;1;1;1;1;;;;;;;1;1;;;;;;;;; gms$s15_exo_foodscen_functional_form;;;;;;;;;;1;1;1;1;;;;;;;1;1;;;;;;;;; -gms$s15_exo_foodscen_start;;;;;;;;;;2020;2020;2020;2020;;;;;;;2025;2025;;;;;;;;; +gms$s15_exo_foodscen_start;;;;;;;;;;2025;2025;2025;2025;;;;;;;2025;2025;;;;;;;;; gms$s15_exo_foodscen_target;;;;;;;;;;2050;2050;2050;2070;;;;;;;2050;2050;;;;;;;;; gms$s15_exo_waste;;;;;;;;;;1;1;1;1;;;;;;;;;;;;;;;;; gms$s15_waste_scen;;;;;;;;;;1.2;1.3;1.2;1.25;;;;;;;;;;;;;;;;; From 9d70e393a859c473bd784ad5ebbd88ba544d3b7d Mon Sep 17 00:00:00 2001 From: florianh Date: Sat, 19 Oct 2024 09:41:12 +0200 Subject: [PATCH 060/206] update R packages and start scripts --- DESCRIPTION | 6 +++--- modules/58_peatland/v2/scaling.gms | 1 + scripts/start/projects/paper_peatlandTax.R | 2 +- scripts/start/projects/project_ABCDR.R | 2 +- 4 files changed, 6 insertions(+), 5 deletions(-) diff --git a/DESCRIPTION b/DESCRIPTION index f830cf4be4..103c305a10 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -21,14 +21,14 @@ Imports: m4fsdp, madrat, magclass (>= 6.14.0), - magpie4 (>= 2.13.3), + magpie4 (>= 2.13.9), MagpieNCGains, - magpiesets, + magpiesets (>= 0.46.1), mip, mrcommons, patchwork, piamenv (>= 0.5.5), - piamInterfaces (>= 0.20.7), + piamInterfaces (>= 0.36.1), piamutils, quitte, raster, diff --git a/modules/58_peatland/v2/scaling.gms b/modules/58_peatland/v2/scaling.gms index a0f1cec7b8..ad96fe3e35 100644 --- a/modules/58_peatland/v2/scaling.gms +++ b/modules/58_peatland/v2/scaling.gms @@ -7,3 +7,4 @@ v58_balance.scale(j,manPeat58) = 10e-5; v58_balance2.scale(j,manPeat58) = 10e-5; +v58_peatlandChange.scale(j,land58) = 10e-3; diff --git a/scripts/start/projects/paper_peatlandTax.R b/scripts/start/projects/paper_peatlandTax.R index 9b8a298c4b..499582d987 100644 --- a/scripts/start/projects/paper_peatlandTax.R +++ b/scripts/start/projects/paper_peatlandTax.R @@ -23,7 +23,7 @@ source("scripts/start_functions.R") source("config/default.cfg") # create additional information to describe the runs -cfg$info$flag <- "PTax33" +cfg$info$flag <- "PTax34" cfg$results_folder <- "output/:title:" cfg$results_folder_highres <- "output" diff --git a/scripts/start/projects/project_ABCDR.R b/scripts/start/projects/project_ABCDR.R index 2575a45e86..8c627082d7 100644 --- a/scripts/start/projects/project_ABCDR.R +++ b/scripts/start/projects/project_ABCDR.R @@ -19,7 +19,7 @@ source("config/default.cfg") #download_and_update(cfg) # create additional information to describe the runs -cfg$info$flag <- "ABCDR14" +cfg$info$flag <- "ABCDR15" cfg$results_folder <- "output/:title:" cfg$force_replace <- TRUE From 1baf2664749bef00f5963f0cdda2271a74808dd2 Mon Sep 17 00:00:00 2001 From: florianh Date: Mon, 21 Oct 2024 15:11:19 +0200 Subject: [PATCH 061/206] check if regional AR exceeds global AR limit --- scripts/output/extra/highres.R | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/scripts/output/extra/highres.R b/scripts/output/extra/highres.R index f4e9dbe328..786e90bf4f 100644 --- a/scripts/output/extra/highres.R +++ b/scripts/output/extra/highres.R @@ -161,11 +161,11 @@ highres <- function(cfg = cfg, res = "c1000", tc = NULL) { a <- readGDX(gdx,"f60_bioenergy_dem_emulator", react = "silent") if(!is.null(a)) write.magpie(a,"modules/60_bioenergy/input/glo.2ndgen_bioenergy_demand.csv") - #get regional afforestation patterns from low resolution run with c200 + #get regional afforestation/reforestation (AR) patterns from low resolution run with c200 aff <- dimSums(landForestry(gdx)[,,c("aff","ndc")],dim=3) - #Take away initial NDC area for consistency with global afforestation limit + #Take away initial NDC area for consistency with global AR limit aff <- aff-setYears(aff[,1,],NULL) - #calculate maximum regional afforestation over time + #calculate maximum regional AR over time aff_max <- setYears(aff[,1,],NULL) for (r in getRegions(aff)) { aff_max[r,,] <- max(aff[r,,]) @@ -173,10 +173,10 @@ highres <- function(cfg = cfg, res = "c1000", tc = NULL) { aff_max[aff_max < 0] <- 0 write.magpie(aff_max,"modules/32_forestry/input/f32_max_aff_area.cs4") cfg$gms$s32_max_aff_area_glo <- 0 - #check + #check if regional AR exceeds global AR limit if(cfg$gms$s32_max_aff_area < Inf) { - indicator <- abs(sum(aff_max)-cfg$gms$s32_max_aff_area) - if(indicator > 1e-06) warning(paste("Global and regional afforestation limit differ by",indicator,"Mha")) + indicator <- sum(aff_max)-cfg$gms$s32_max_aff_area + if(indicator > 1e-06) warning(paste("Regional AR exceeds global AR limit by",indicator,"Mha")) } Sys.sleep(2) From 63d96f32b7e0bc33bd0caa5a456c3f4ba9df104e Mon Sep 17 00:00:00 2001 From: florianh Date: Thu, 24 Oct 2024 16:44:02 +0200 Subject: [PATCH 062/206] added SSP1-MC, SSP2-MC and SSP5-MC to scenario_config --- CHANGELOG.md | 1 + config/scenario_config.csv | 154 ++++++++++++++++++------------------- 2 files changed, 78 insertions(+), 77 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 196d60e5d2..66751b03cb 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -15,6 +15,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). ### added - **62_material** added switch to turn off future material demand for bioplastic +- **config** added SSP1-MC, SSP2-MC and SSP5-MC ### removed - diff --git a/config/scenario_config.csv b/config/scenario_config.csv index dc70569131..764156653d 100755 --- a/config/scenario_config.csv +++ b/config/scenario_config.csv @@ -1,77 +1,77 @@ -;cc;nocc;nocc_hist;SSP1;SSP2;SSP2EU;SSP3;SSP4;SSP5;SDP;SDP-EI;SDP-RC;SDP-MC;BASE;NPI;NDC;coupling;emulator;input;eat_lancet_diet_v1;eat_lancet_diet_v2;ForestryEndo;ForestryExo;ForestryOff;rcp1p9;rcp2p6;rcp4p5;rcp6p0;rcp7p0;rcp8p5 -gms$c_timesteps;;;;;;;;;;;;;;;;;less_TS;less_TS;;;;;;;;;;;; -gms$c09_pop_scenario;;;;SSP1;SSP2;SSP2EU;SSP3;SSP4;SSP5;SSP1;SSP1;SSP1;SSP1;;;;;;;;;;;;;;;;; -gms$c09_gdp_scenario;;;;SSP1;SSP2;SSP2EU;SSP3;SSP4;SSP5;SSP1;SDP_EI;SDP_RC;SDP_MC;;;;;;;;;;;;;;;;; -gms$c09_pal_scenario;;;;SSP1;SSP2;SSP2EU;SSP3;SSP4;SSP5;SSP1;SSP2;SSP1;SSP1;;;;;;;;;;;;;;;;; -gms$c14_yields_scenario;cc;nocc;nocc_hist;;;;;;;;;;;;;;;;;;;;;;;;;;; -gms$c15_food_scenario;;;;SSP1;SSP2;SSP2;SSP3;SSP4;SSP5;SSP1;SSP2;SSP1;SSP1;;;;;;;;;;;;;;;;; -gms$s15_rumdairy_scp_substitution;;;;;;;;;;0;0.5;0;0;;;;;;;;;;;;;;;;; -gms$s15_food_subst_functional_form;;;;;;;;;;;2;;;;;;;;;;;;;;;;;;; -gms$s15_food_substitution_start;;;;;;;;;;;2025;;;;;;;;;;;;;;;;;;; -gms$s15_food_substitution_target;;;;;;;;;;;2050;;;;;;;;;;;;;;;;;;; -gms$kfo_rd;;;;;;;;;;;livst_rum;;;;;;;;;;;;;;;;;;; -gms$s15_exo_foodscen_convergence;;;;;;;;;;1;1;1;1;;;;;;;1;1;;;;;;;;; -gms$s15_exo_foodscen_functional_form;;;;;;;;;;1;1;1;1;;;;;;;1;1;;;;;;;;; -gms$s15_exo_foodscen_start;;;;;;;;;;2025;2025;2025;2025;;;;;;;2025;2025;;;;;;;;; -gms$s15_exo_foodscen_target;;;;;;;;;;2050;2050;2050;2070;;;;;;;2050;2050;;;;;;;;; -gms$s15_exo_waste;;;;;;;;;;1;1;1;1;;;;;;;;;;;;;;;;; -gms$s15_waste_scen;;;;;;;;;;1.2;1.3;1.2;1.25;;;;;;;;;;;;;;;;; -gms$s15_exo_diet;;;;;;;;;;1;1;1;1;;;;;;;1;3;;;;;;;;; -gms$c15_kcal_scen;;;;;;;;;;healthy_BMI;no_underweight;healthy_BMI;healthy_BMI;;;;;;;healthy_BMI;;;;;;;;;; -gms$c15_EAT_scen;;;;;;;;;;FLX;;FLX;FLX;;;;;;;FLX;;;;;;;;;; -gms$s15_exo_monogastric;;;;;;;;;;1;0;1;1;;;;;;;1;1;;;;;;;;; -gms$s15_exo_ruminant;;;;;;;;;;1;0;1;1;;;;;;;1;1;;;;;;;;; -gms$s15_exo_fish;;;;;;;;;;1;0;1;1;;;;;;;1;1;;;;;;;;; -gms$s15_exo_fruitvegnut;;;;;;;;;;1;0;1;1;;;;;;;1;1;;;;;;;;; -gms$s15_exo_roots;;;;;;;;;;1;0;1;1;;;;;;;1;1;;;;;;;;; -gms$s15_exo_pulses;;;;;;;;;;1;0;1;1;;;;;;;1;1;;;;;;;;; -gms$s15_exo_sugar;;;;;;;;;;1;0;1;1;;;;;;;1;1;;;;;;;;; -gms$s15_exo_oils;;;;;;;;;;1;0;1;1;;;;;;;1;1;;;;;;;;; -gms$s15_exo_brans;;;;;;;;;;1;0;1;1;;;;;;;1;0;;;;;;;;; -gms$s15_exo_scp;;;;;;;;;;1;0;1;1;;;;;;;1;1;;;;;;;;; -gms$s15_exo_alcohol;;;;;;;;;;1;0;1;1;;;;;;;1;1;;;;;;;;; -gms$s15_alc_scen;;;;;;;;;;;;;;;;;;;;0.014;0;;;;;;;;; -gms$c21_trade_liberalization;;;;l908080r807070;l909090r808080;l909090r808080;l909595r809090;l908080r807070;l908080r807070;l908080r807070;l908080r807070;l909595r809090;l908080r807070;;;;;;;;;;;;;;;;; -gms$c22_protect_scenario;;;;;;;;;;BH;none;BH_IFL;BH;;;;;;;;;;;;;;;;; -gms$s29_snv_shr;;;;;;;;;;0;0;0;0.2;;;;;;;;;;;;;;;;; -gms$s29_snv_scenario_target;;;;;;;;;;;;;2030;;;;;;;;;;;;;;;;; -gms$c30_bioen_water;;;;;;;;;;rainfed;all;rainfed;rainfed;;;;;;;;;;;;;;;;; -gms$c31_grassl_yld_scenario;cc;nocc;nocc_hist;;;;;;;;;;;;;;;;;;;;;;;;;;; -gms$s32_initial_distribution;;;;;;;;;;;;;;;;;;;;;;1;1;0;;;;;; -gms$s32_hvarea;;;;;;;;;;;;;;;;;;;;;;2;1;0;;;;;; -gms$s32_aff_plantation;;;;;;;;;;0;1;0;0;;;;;;;;;;;;;;;;; -gms$s32_aff_bii_coeff;;;;;;;;;;0;1;0;0;;;;;;;;;;;;;;;;; -gms$s32_max_aff_area;;;;;;;;;;500;350;0;700;;;;;;;;;;;;;;;;; -gms$c32_aff_mask;;;;;;;;;;onlytropical;onlytropical;onlytropical;onlytropical;;;;;;;;;;;;;;;;; -gms$c34_urban_scenario;;;;SSP1;SSP2;SSP2;SSP3;SSP4;SSP5;SSP1;SSP1;SSP2;SSP1;;;;;;;;;;;;;;;;; -gms$c32_aff_policy;;;;;;;;;;;;;;none;npi;ndc;;;;;;;;;;;;;; -gms$s32_planing_horizon;;;;;;;;;;50;30;50;50;;;;;;;;;;;;;;;;; -gms$c35_ad_policy;;;;;;;;;;;;;;none;npi;ndc;;;;;;;;;;;;;; -gms$c35_aolc_policy;;;;;;;;;;;;;;none;npi;ndc;;;;;;;;;;;;;; -gms$c35_pot_forest_scenario;cc;nocc;nocc_hist;;;;;;;;;;;;;;;;;;;;;;;;;;; -gms$s35_forest_damage_end;;;;2030;2050;2050;2050;2050;2030;2030;2030;2030;2030;;;;;;;;;;;;;;;;; -gms$s35_secdf_distribution;;;;;;;;;;;;;;;;;;;;;;2;2;0;;;;;; -gms$s35_hvarea;;;;;;;;;;;;;;;;;;;;;;2;2;0;;;;;; -gms$c42_watdem_scenario;cc;nocc;nocc_hist;;;;;;;;;;;;;;;;;;;;;;;;;;; -gms$s42_watdem_nonagr_scenario;;;;1;2;2;3;2;1;1;1;3;1;;;;;;;;;;;;;;;;; -gms$s42_irrig_eff_scenario;;;;;;;;;;3;3;3;3;;;;;;;;;;;;;;;;; -gms$c42_env_flow_policy;;;;on;off;off;off;mixed;on;on;on;on;on;;;;;;;;;;;;;;;;; -gms$s42_efp_targetyear;;;;;;;;;;2040;2050;2070;2050;;;;;;;;;;;;;;;;; -gms$c43_watavail_scenario;cc;nocc;nocc_hist;;;;;;;;;;;;;;;;;;;;;;;;;;; -gms$c50_scen_neff;;;;baseeff_add3_add10_add20_max75;baseeff_add3_add5_add10_max65;baseeff_add3_add5_add10_max65;baseeff_add3_add0_add0_max55;baseeff_add3_add10_add15_max75;baseeff_add3_add5_add15_max75;baseeff_add3_add15_add25_max75;baseeff_add3_add15_add25_max75;baseeff_add3_add15_add25_max65;baseeff_add3_add15_add25_max75;;;;;;;;;;;;;;;;; -gms$c52_carbon_scenario;cc;nocc;nocc_hist;;;;;;;;;;;;;;;;;;;;;;;;;;; -gms$c52_land_carbon_sink_rcp;;nocc;nocc_hist;;;;;;;;;;;;;;;;;;;;;;RCP19;RCP26;RCP45;RCP60;RCPBU;RCPBU -gms$c55_scen_conf;;;;ssp1;ssp2;ssp2;ssp3;ssp4;ssp5;ssp1;ssp1;ssp1;ssp1;;;;;;;;;;;;;;;;; -gms$c56_pollutant_prices;;;;;;;;;;;;;;;;;coupling;emulator;coupling;;;;;;;;;;; -gms$s56_c_price_exp_aff;;;;;;;;;;50;30;50;50;;;;;;;;;;;;;;;;; -gms$s56_buffer_aff;;;;;;;;;;0.5;0.5;0.2;0.3;;;;;;;;;;;;;;;;; -gms$c56_emis_policy;;;;;;;;;;reddnatveg_nosoil;reddnatveg_nosoil;redd_nosoil;all_nosoil;;;;;;;;;;;;;;;;; -gms$s56_minimum_cprice;;;;;;;;;;;;;;0;0;18;;;;;;;;;;;;;; -gms$c59_som_scenario;cc;nocc;nocc_hist;;;;;;;;;;;;;;;;;;;;;;;;;;; -gms$c60_1stgen_biodem;;;;phaseout2020;const2020;const2020;const2030;const2020;phaseout2020;phaseout2020;phaseout2020;phaseout2020;phaseout2020;;;;;;;;;;;;;;;;; -gms$c60_2ndgen_biodem;;;;;;;;;;;;;;;;;coupling;emulator;coupling;;;;;;;;;;; -gms$c60_biodem_level;;;;;;;;;;;;;;;;;1;0;;;;;;;;;;;; -gms$c60_res_2ndgenBE_dem;;;;ssp1;ssp2;ssp2;ssp3;ssp4;ssp5;sdp;ssp2;sdp;sdp;;;;;;;;;;;;;;;;; -gms$c70_feed_scen;;;;ssp1;ssp2;ssp2;ssp3;ssp4;ssp5;ssp1;ssp5;ssp1;ssp1;;;;;;;;;;;;;;;;; -gms$s73_timber_demand_switch;;;;;;;;;;;;;;;;;;;;;;1;1;0;;;;;; -input['cellular'];;;;;;;;;;;;;;;;;;;;;;;;;rev4.113_h12_0bd54110_cellularmagpie_c200_MRI-ESM2-0-ssp119_lpjml-8e6c5eb1.tgz;rev4.113_h12_6819938d_cellularmagpie_c200_MRI-ESM2-0-ssp126_lpjml-8e6c5eb1.tgz;rev4.113_h12_1b5c3817_cellularmagpie_c200_MRI-ESM2-0-ssp245_lpjml-8e6c5eb1.tgz;rev4.113_h12_3c888fa5_cellularmagpie_c200_MRI-ESM2-0-ssp460_lpjml-8e6c5eb1.tgz;rev4.113_h12_fd712c0b_cellularmagpie_c200_MRI-ESM2-0-ssp370_lpjml-8e6c5eb1.tgz;rev4.113_h12_09a63995_cellularmagpie_c200_MRI-ESM2-0-ssp585_lpjml-8e6c5eb1.tgz +;cc;nocc;nocc_hist;SSP1;SSP2;SSP2EU;SSP3;SSP4;SSP5;SDP;SDP-EI;SDP-RC;SDP-MC;SSP1-MC;SSP2-MC;SSP2-MC;BASE;NPI;NDC;coupling;emulator;input;eat_lancet_diet_v1;eat_lancet_diet_v2;ForestryEndo;ForestryExo;ForestryOff;rcp1p9;rcp2p6;rcp4p5;rcp6p0;rcp7p0;rcp8p5 +gms$c_timesteps;;;;;;;;;;;;;;;;;;;;less_TS;less_TS;;;;;;;;;;;; +gms$c09_pop_scenario;;;;SSP1;SSP2;SSP2EU;SSP3;SSP4;SSP5;SSP1;SSP1;SSP1;SSP1;SSP1;SSP2;SSP5;;;;;;;;;;;;;;;;; +gms$c09_gdp_scenario;;;;SSP1;SSP2;SSP2EU;SSP3;SSP4;SSP5;SSP1;SDP_EI;SDP_RC;SDP_MC;SSP1;SSP2;SSP5;;;;;;;;;;;;;;;;; +gms$c09_pal_scenario;;;;SSP1;SSP2;SSP2EU;SSP3;SSP4;SSP5;SSP1;SSP2;SSP1;SSP1;SSP1;SSP1;SSP1;;;;;;;;;;;;;;;;; +gms$c14_yields_scenario;cc;nocc;nocc_hist;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +gms$c15_food_scenario;;;;SSP1;SSP2;SSP2;SSP3;SSP4;SSP5;SSP1;SSP2;SSP1;SSP1;SSP1;SSP1;SSP1;;;;;;;;;;;;;;;;; +gms$s15_rumdairy_scp_substitution;;;;;;;;;;0;0.5;0;0;0;0;0;;;;;;;;;;;;;;;;; +gms$s15_food_subst_functional_form;;;;;;;;;;;2;;;;;;;;;;;;;;;;;;;;;; +gms$s15_food_substitution_start;;;;;;;;;;;2025;;;;;;;;;;;;;;;;;;;;;; +gms$s15_food_substitution_target;;;;;;;;;;;2050;;;;;;;;;;;;;;;;;;;;;; +gms$kfo_rd;;;;;;;;;;;livst_rum;;;;;;;;;;;;;;;;;;;;;; +gms$s15_exo_foodscen_convergence;;;;;;;;;;1;1;1;1;1;1;1;;;;;;;1;1;;;;;;;;; +gms$s15_exo_foodscen_functional_form;;;;;;;;;;1;1;1;1;1;1;1;;;;;;;1;1;;;;;;;;; +gms$s15_exo_foodscen_start;;;;;;;;;;2025;2025;2025;2025;2025;2025;2025;;;;;;;2025;2025;;;;;;;;; +gms$s15_exo_foodscen_target;;;;;;;;;;2050;2050;2050;2070;2070;2070;2070;;;;;;;2050;2050;;;;;;;;; +gms$s15_exo_waste;;;;;;;;;;1;1;1;1;1;1;1;;;;;;;;;;;;;;;;; +gms$s15_waste_scen;;;;;;;;;;1.2;1.3;1.2;1.25;1.25;1.25;1.25;;;;;;;;;;;;;;;;; +gms$s15_exo_diet;;;;;;;;;;1;1;1;1;1;1;1;;;;;;;1;3;;;;;;;;; +gms$c15_kcal_scen;;;;;;;;;;healthy_BMI;no_underweight;healthy_BMI;healthy_BMI;healthy_BMI;healthy_BMI;healthy_BMI;;;;;;;healthy_BMI;;;;;;;;;; +gms$c15_EAT_scen;;;;;;;;;;FLX;;FLX;FLX;FLX;FLX;FLX;;;;;;;FLX;;;;;;;;;; +gms$s15_exo_monogastric;;;;;;;;;;1;0;1;1;1;1;1;;;;;;;1;1;;;;;;;;; +gms$s15_exo_ruminant;;;;;;;;;;1;0;1;1;1;1;1;;;;;;;1;1;;;;;;;;; +gms$s15_exo_fish;;;;;;;;;;1;0;1;1;1;1;1;;;;;;;1;1;;;;;;;;; +gms$s15_exo_fruitvegnut;;;;;;;;;;1;0;1;1;1;1;1;;;;;;;1;1;;;;;;;;; +gms$s15_exo_roots;;;;;;;;;;1;0;1;1;1;1;1;;;;;;;1;1;;;;;;;;; +gms$s15_exo_pulses;;;;;;;;;;1;0;1;1;1;1;1;;;;;;;1;1;;;;;;;;; +gms$s15_exo_sugar;;;;;;;;;;1;0;1;1;1;1;1;;;;;;;1;1;;;;;;;;; +gms$s15_exo_oils;;;;;;;;;;1;0;1;1;1;1;1;;;;;;;1;1;;;;;;;;; +gms$s15_exo_brans;;;;;;;;;;1;0;1;1;1;1;1;;;;;;;1;0;;;;;;;;; +gms$s15_exo_scp;;;;;;;;;;1;0;1;1;1;1;1;;;;;;;1;1;;;;;;;;; +gms$s15_exo_alcohol;;;;;;;;;;1;0;1;1;1;1;1;;;;;;;1;1;;;;;;;;; +gms$s15_alc_scen;;;;;;;;;;;;;;;;;;;;;;;0.014;0;;;;;;;;; +gms$c21_trade_liberalization;;;;l908080r807070;l909090r808080;l909090r808080;l909595r809090;l908080r807070;l908080r807070;l908080r807070;l908080r807070;l909595r809090;l908080r807070;l908080r807070;l908080r807070;l908080r807070;;;;;;;;;;;;;;;;; +gms$c22_protect_scenario;;;;;;;;;;BH;none;BH_IFL;BH;BH;BH;BH;;;;;;;;;;;;;;;;; +gms$s29_snv_shr;;;;;;;;;;0;0;0;0.2;0.2;0.2;0.2;;;;;;;;;;;;;;;;; +gms$s29_snv_scenario_target;;;;;;;;;;;;;2030;2030;2030;2030;;;;;;;;;;;;;;;;; +gms$c30_bioen_water;;;;;;;;;;rainfed;all;rainfed;rainfed;rainfed;rainfed;rainfed;;;;;;;;;;;;;;;;; +gms$c31_grassl_yld_scenario;cc;nocc;nocc_hist;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +gms$s32_initial_distribution;;;;;;;;;;;;;;;;;;;;;;;;;1;1;0;;;;;; +gms$s32_hvarea;;;;;;;;;;;;;;;;;;;;;;;;;2;1;0;;;;;; +gms$s32_aff_plantation;;;;;;;;;;0;1;0;0;0;0;0;;;;;;;;;;;;;;;;; +gms$s32_aff_bii_coeff;;;;;;;;;;0;1;0;0;0;0;0;;;;;;;;;;;;;;;;; +gms$s32_max_aff_area;;;;;;;;;;500;350;0;700;700;700;700;;;;;;;;;;;;;;;;; +gms$c32_aff_mask;;;;;;;;;;onlytropical;onlytropical;onlytropical;onlytropical;onlytropical;onlytropical;onlytropical;;;;;;;;;;;;;;;;; +gms$c34_urban_scenario;;;;SSP1;SSP2;SSP2;SSP3;SSP4;SSP5;SSP1;SSP1;SSP2;SSP1;SSP1;SSP1;SSP1;;;;;;;;;;;;;;;;; +gms$c32_aff_policy;;;;;;;;;;;;;;;;;none;npi;ndc;;;;;;;;;;;;;; +gms$s32_planing_horizon;;;;;;;;;;50;30;50;50;50;50;50;;;;;;;;;;;;;;;;; +gms$c35_ad_policy;;;;;;;;;;;;;;;;;none;npi;ndc;;;;;;;;;;;;;; +gms$c35_aolc_policy;;;;;;;;;;;;;;;;;none;npi;ndc;;;;;;;;;;;;;; +gms$c35_pot_forest_scenario;cc;nocc;nocc_hist;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +gms$s35_forest_damage_end;;;;2030;2050;2050;2050;2050;2030;2030;2030;2030;2030;2030;2030;2030;;;;;;;;;;;;;;;;; +gms$s35_secdf_distribution;;;;;;;;;;;;;;;;;;;;;;;;;2;2;0;;;;;; +gms$s35_hvarea;;;;;;;;;;;;;;;;;;;;;;;;;2;2;0;;;;;; +gms$c42_watdem_scenario;cc;nocc;nocc_hist;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +gms$s42_watdem_nonagr_scenario;;;;1;2;2;3;2;1;1;1;3;1;1;1;1;;;;;;;;;;;;;;;;; +gms$s42_irrig_eff_scenario;;;;;;;;;;3;3;3;3;3;3;3;;;;;;;;;;;;;;;;; +gms$c42_env_flow_policy;;;;on;off;off;off;mixed;on;on;on;on;on;on;on;on;;;;;;;;;;;;;;;;; +gms$s42_efp_targetyear;;;;;;;;;;2040;2050;2070;2050;2050;2050;2050;;;;;;;;;;;;;;;;; +gms$c43_watavail_scenario;cc;nocc;nocc_hist;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +gms$c50_scen_neff;;;;baseeff_add3_add10_add20_max75;baseeff_add3_add5_add10_max65;baseeff_add3_add5_add10_max65;baseeff_add3_add0_add0_max55;baseeff_add3_add10_add15_max75;baseeff_add3_add5_add15_max75;baseeff_add3_add15_add25_max75;baseeff_add3_add15_add25_max75;baseeff_add3_add15_add25_max65;baseeff_add3_add15_add25_max75;baseeff_add3_add15_add25_max75;baseeff_add3_add15_add25_max75;baseeff_add3_add15_add25_max75;;;;;;;;;;;;;;;;; +gms$c52_carbon_scenario;cc;nocc;nocc_hist;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +gms$c52_land_carbon_sink_rcp;;nocc;nocc_hist;;;;;;;;;;;;;;;;;;;;;;;;;RCP19;RCP26;RCP45;RCP60;RCPBU;RCPBU +gms$c55_scen_conf;;;;ssp1;ssp2;ssp2;ssp3;ssp4;ssp5;ssp1;ssp1;ssp1;ssp1;ssp1;ssp1;ssp1;;;;;;;;;;;;;;;;; +gms$c56_pollutant_prices;;;;;;;;;;;;;;;;;;;;coupling;emulator;coupling;;;;;;;;;;; +gms$s56_c_price_exp_aff;;;;;;;;;;50;30;50;50;50;50;50;;;;;;;;;;;;;;;;; +gms$s56_buffer_aff;;;;;;;;;;0.5;0.5;0.2;0.3;0.3;0.3;0.3;;;;;;;;;;;;;;;;; +gms$c56_emis_policy;;;;;;;;;;reddnatveg_nosoil;reddnatveg_nosoil;redd_nosoil;all_nosoil;all_nosoil;all_nosoil;all_nosoil;;;;;;;;;;;;;;;;; +gms$s56_minimum_cprice;;;;;;;;;;;;;;;;;0;0;18;;;;;;;;;;;;;; +gms$c59_som_scenario;cc;nocc;nocc_hist;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +gms$c60_1stgen_biodem;;;;phaseout2020;const2020;const2020;const2030;const2020;phaseout2020;phaseout2020;phaseout2020;phaseout2020;phaseout2020;phaseout2020;phaseout2020;phaseout2020;;;;;;;;;;;;;;;;; +gms$c60_2ndgen_biodem;;;;;;;;;;;;;;;;;;;;coupling;emulator;coupling;;;;;;;;;;; +gms$c60_biodem_level;;;;;;;;;;;;;;;;;;;;1;0;;;;;;;;;;;; +gms$c60_res_2ndgenBE_dem;;;;ssp1;ssp2;ssp2;ssp3;ssp4;ssp5;sdp;ssp2;sdp;sdp;sdp;sdp;sdp;;;;;;;;;;;;;;;;; +gms$c70_feed_scen;;;;ssp1;ssp2;ssp2;ssp3;ssp4;ssp5;ssp1;ssp5;ssp1;ssp1;ssp1;ssp1;ssp1;;;;;;;;;;;;;;;;; +gms$s73_timber_demand_switch;;;;;;;;;;;;;;;;;;;;;;;;;1;1;0;;;;;; +input['cellular'];;;;;;;;;;;;;;;;;;;;;;;;;;;;rev4.113_h12_0bd54110_cellularmagpie_c200_MRI-ESM2-0-ssp119_lpjml-8e6c5eb1.tgz;rev4.113_h12_6819938d_cellularmagpie_c200_MRI-ESM2-0-ssp126_lpjml-8e6c5eb1.tgz;rev4.113_h12_1b5c3817_cellularmagpie_c200_MRI-ESM2-0-ssp245_lpjml-8e6c5eb1.tgz;rev4.113_h12_3c888fa5_cellularmagpie_c200_MRI-ESM2-0-ssp460_lpjml-8e6c5eb1.tgz;rev4.113_h12_fd712c0b_cellularmagpie_c200_MRI-ESM2-0-ssp370_lpjml-8e6c5eb1.tgz;rev4.113_h12_09a63995_cellularmagpie_c200_MRI-ESM2-0-ssp585_lpjml-8e6c5eb1.tgz From 890353bedcef4243066edbafe6751bfc2d4c34b6 Mon Sep 17 00:00:00 2001 From: florianh Date: Thu, 24 Oct 2024 16:55:00 +0200 Subject: [PATCH 063/206] bugfix --- config/scenario_config.csv | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config/scenario_config.csv b/config/scenario_config.csv index 764156653d..1ae222500b 100755 --- a/config/scenario_config.csv +++ b/config/scenario_config.csv @@ -1,4 +1,4 @@ -;cc;nocc;nocc_hist;SSP1;SSP2;SSP2EU;SSP3;SSP4;SSP5;SDP;SDP-EI;SDP-RC;SDP-MC;SSP1-MC;SSP2-MC;SSP2-MC;BASE;NPI;NDC;coupling;emulator;input;eat_lancet_diet_v1;eat_lancet_diet_v2;ForestryEndo;ForestryExo;ForestryOff;rcp1p9;rcp2p6;rcp4p5;rcp6p0;rcp7p0;rcp8p5 +;cc;nocc;nocc_hist;SSP1;SSP2;SSP2EU;SSP3;SSP4;SSP5;SDP;SDP-EI;SDP-RC;SDP-MC;SSP1-MC;SSP2-MC;SSP5-MC;BASE;NPI;NDC;coupling;emulator;input;eat_lancet_diet_v1;eat_lancet_diet_v2;ForestryEndo;ForestryExo;ForestryOff;rcp1p9;rcp2p6;rcp4p5;rcp6p0;rcp7p0;rcp8p5 gms$c_timesteps;;;;;;;;;;;;;;;;;;;;less_TS;less_TS;;;;;;;;;;;; gms$c09_pop_scenario;;;;SSP1;SSP2;SSP2EU;SSP3;SSP4;SSP5;SSP1;SSP1;SSP1;SSP1;SSP1;SSP2;SSP5;;;;;;;;;;;;;;;;; gms$c09_gdp_scenario;;;;SSP1;SSP2;SSP2EU;SSP3;SSP4;SSP5;SSP1;SDP_EI;SDP_RC;SDP_MC;SSP1;SSP2;SSP5;;;;;;;;;;;;;;;;; From 3bf13a81411b5db0438614ccc3306403b521fbff Mon Sep 17 00:00:00 2001 From: florianh Date: Thu, 24 Oct 2024 17:01:31 +0200 Subject: [PATCH 064/206] changelog --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 66751b03cb..7a648c02d8 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -15,7 +15,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). ### added - **62_material** added switch to turn off future material demand for bioplastic -- **config** added SSP1-MC, SSP2-MC and SSP5-MC +- **config** added SSP1-POP-GDP SSP2-POP-GDP and SSP5-POP-GDP ### removed - From 1879c5f147840aa623d786979e2b5426c8ed6114 Mon Sep 17 00:00:00 2001 From: florianh Date: Sat, 26 Oct 2024 08:11:33 +0200 Subject: [PATCH 065/206] bugfix age-class --- config/default.cfg | 6 +++--- config/scenario_config.csv | 2 +- core/sets.gms | 5 ++++- modules/28_ageclass/feb21/declarations.gms | 2 +- modules/28_ageclass/feb21/input.gms | 2 +- modules/28_ageclass/feb21/preloop.gms | 18 ++++++++++-------- modules/28_ageclass/feb21/sets.gms | 13 ++++--------- modules/35_natveg/pot_forest_may24/preloop.gms | 10 ++++------ 8 files changed, 28 insertions(+), 30 deletions(-) diff --git a/config/default.cfg b/config/default.cfg index 4874bebbd3..a7ae95150c 100644 --- a/config/default.cfg +++ b/config/default.cfg @@ -22,9 +22,9 @@ cfg$model <- "main.gms" #def = "main.gms" #### input settings #### # which input data sets should be used? -cfg$input <- c(regional = "rev4.113_h12_magpie.tgz", - cellular = "rev4.113_h12_fd712c0b_cellularmagpie_c200_MRI-ESM2-0-ssp370_lpjml-8e6c5eb1.tgz", - validation = "rev4.113_h12_validation.tgz", +cfg$input <- c(regional = "rev4.114_h12_magpie.tgz", + cellular = "rev4.114_h12_fd712c0b_cellularmagpie_c200_MRI-ESM2-0-ssp370_lpjml-8e6c5eb1.tgz", + validation = "rev4.114_h12_validation.tgz", additional = "additional_data_rev4.57.tgz", calibration = "calibration_H12_27Sep24.tgz") diff --git a/config/scenario_config.csv b/config/scenario_config.csv index 802415b6a0..b13b26be80 100755 --- a/config/scenario_config.csv +++ b/config/scenario_config.csv @@ -74,4 +74,4 @@ gms$c60_biodem_level;;;;;;;;;;;;;;;;;;;;1;0;;;;;;;;;;;; gms$c60_res_2ndgenBE_dem;;;;ssp1;ssp2;ssp2;ssp3;ssp4;ssp5;sdp;ssp2;sdp;sdp;;;;;;;;;;;;;;;;;;;; gms$c70_feed_scen;;;;ssp1;ssp2;ssp2;ssp3;ssp4;ssp5;ssp1;ssp5;ssp1;ssp1;;;;;;;;;;;;;;;;;;;; gms$s73_timber_demand_switch;;;;;;;;;;;;;;;;;;;;;;;;;1;1;0;;;;;; -input['cellular'];;;;;;;;;;;;;;;;;;;;;;;;;;;;rev4.113_h12_0bd54110_cellularmagpie_c200_MRI-ESM2-0-ssp119_lpjml-8e6c5eb1.tgz;rev4.113_h12_6819938d_cellularmagpie_c200_MRI-ESM2-0-ssp126_lpjml-8e6c5eb1.tgz;rev4.113_h12_1b5c3817_cellularmagpie_c200_MRI-ESM2-0-ssp245_lpjml-8e6c5eb1.tgz;rev4.113_h12_3c888fa5_cellularmagpie_c200_MRI-ESM2-0-ssp460_lpjml-8e6c5eb1.tgz;rev4.113_h12_fd712c0b_cellularmagpie_c200_MRI-ESM2-0-ssp370_lpjml-8e6c5eb1.tgz;rev4.113_h12_09a63995_cellularmagpie_c200_MRI-ESM2-0-ssp585_lpjml-8e6c5eb1.tgz +input['cellular'];;;;;;;;;;;;;;;;;;;;;;;;;;;;rev4.114_h12_0bd54110_cellularmagpie_c200_MRI-ESM2-0-ssp119_lpjml-8e6c5eb1.tgz;rev4.114_h12_6819938d_cellularmagpie_c200_MRI-ESM2-0-ssp126_lpjml-8e6c5eb1.tgz;rev4.114_h12_1b5c3817_cellularmagpie_c200_MRI-ESM2-0-ssp245_lpjml-8e6c5eb1.tgz;rev4.114_h12_3c888fa5_cellularmagpie_c200_MRI-ESM2-0-ssp460_lpjml-8e6c5eb1.tgz;rev4.114_h12_fd712c0b_cellularmagpie_c200_MRI-ESM2-0-ssp370_lpjml-8e6c5eb1.tgz;rev4.114_h12_09a63995_cellularmagpie_c200_MRI-ESM2-0-ssp585_lpjml-8e6c5eb1.tgz diff --git a/core/sets.gms b/core/sets.gms index d68a6b0774..e0a63e1bf7 100644 --- a/core/sets.gms +++ b/core/sets.gms @@ -264,7 +264,10 @@ sets ac Age classes / ac0,ac5,ac10,ac15,ac20,ac25,ac30,ac35,ac40,ac45,ac50, ac55,ac60,ac65,ac70,ac75,ac80,ac85,ac90,ac95,ac100, ac105,ac110,ac115,ac120,ac125,ac130,ac135,ac140,ac145, - ac150,ac155,acx / + ac150,ac155,ac160,ac165,ac170,ac175,ac180,ac185,ac190,ac195, + ac200,ac205,ac210,ac215,ac220,ac225,ac230,ac235,ac240,ac245, + ac250,ac255,ac260,ac265,ac270,ac275,ac280,ac285,ac290,ac295, + ac300, acx / ac_est(ac) Dynamic subset of age classes for establishment diff --git a/modules/28_ageclass/feb21/declarations.gms b/modules/28_ageclass/feb21/declarations.gms index baefc0ebb4..e994c79493 100644 --- a/modules/28_ageclass/feb21/declarations.gms +++ b/modules/28_ageclass/feb21/declarations.gms @@ -6,5 +6,5 @@ *** | Contact: magpie@pik-potsdam.de parameter - im_plantedclass_ac(j,ac) Raw Distribution of ageclass in secondary forest as a proxy for planted forest (mio. ha) + im_forest_ageclass(j,ac) Raw Distribution of ageclass in secondary forest as a proxy for planted forest (mio. ha) ; diff --git a/modules/28_ageclass/feb21/input.gms b/modules/28_ageclass/feb21/input.gms index 7e645fecdb..c3e13ce776 100644 --- a/modules/28_ageclass/feb21/input.gms +++ b/modules/28_ageclass/feb21/input.gms @@ -5,7 +5,7 @@ *** | MAgPIE License Exception, version 1.0 (see LICENSE file). *** | Contact: magpie@pik-potsdam.de -table f28_forestageclasses(j,ac_poulter) Poulter age-class area in each cluster (1) +table f28_forestageclasses(j,ac_poulter) Forest area in 15 10-year age classes (Mha) $ondelim $include "./modules/28_ageclass/input/forestageclasses.cs3" $offdelim diff --git a/modules/28_ageclass/feb21/preloop.gms b/modules/28_ageclass/feb21/preloop.gms index 12cffe2e9c..8c7bf092ea 100644 --- a/modules/28_ageclass/feb21/preloop.gms +++ b/modules/28_ageclass/feb21/preloop.gms @@ -5,11 +5,13 @@ *** | MAgPIE License Exception, version 1.0 (see LICENSE file). *** | Contact: magpie@pik-potsdam.de -* Ben Poulter age class distribution -im_plantedclass_ac(j,ac) = 0; -*im_plantedclass_ac(j,ac) = sum(ac_poulter_to_ac(ac_poulter,ac),f28_forestageclasses(j,ac_poulter)$(not sameas(ac_poulter,"class15"))); -im_plantedclass_ac(j,ac) = sum(ac_poulter_to_ac(ac_poulter,ac),f28_forestageclasses(j,ac_poulter)); - -* As summing over makes double counting (two magpie age classes in one poulter class) -* We divide by 2 -im_plantedclass_ac(j,ac) = im_plantedclass_ac(j,ac) /2; +* Two age-classes in `ac` are mapped to one age-class in `ac_poulter`. +* Therefore, each age-class in `ac_poulter` is distributed equally to all beloning age-classes in `ac`. +im_forest_ageclass(j,ac) = 0; +im_forest_ageclass(j,ac) = sum(ac_poulter_to_ac(ac_poulter,ac),f28_forestageclasses(j,ac_poulter)) / 2; +im_forest_ageclass(j,"acx") = f28_forestageclasses(j,"class15") + + + i35_plantedclass_ac(j,ac) = im_forest_ageclass(j,ac); + i35_plantedclass_ac(j,ac_young)$(i35_plantedclass_ac(j,ac_young) > im_forest_ageclass(j,"ac35")) = im_forest_ageclass(j,"ac35"); + diff --git a/modules/28_ageclass/feb21/sets.gms b/modules/28_ageclass/feb21/sets.gms index 0673fbb64e..c40bc897c3 100644 --- a/modules/28_ageclass/feb21/sets.gms +++ b/modules/28_ageclass/feb21/sets.gms @@ -11,18 +11,14 @@ ac_poulter Forest age classes in Poulter data set class6, class7, class8, class9, class10, class11, class12, class13, class14, class15 / -ac_planted(ac) Young age classes which probably belong to managed forest +ac_young(ac) Young age classes / ac0, ac5, ac10, ac15, ac20, ac25, ac30 / -ac_plantations(ac) Possible age classes which probably belong to plantations -/ ac0, ac5, ac10, ac15, ac20, ac25, ac30, - ac35, ac40, ac45, ac50, ac55, ac60 / - ac_poulter_to_ac(ac_poulter,ac) mapping between ac and ac_poulter / -class1 . (ac5,ac10) -class2 . (ac15,ac20) -class3 . (ac25,ac30) +class4 . (ac5,ac10) +class4 . (ac15,ac20) +class4 . (ac25,ac30) class4 . (ac35,ac40) class5 . (ac45,ac50) class6 . (ac55,ac60) @@ -34,7 +30,6 @@ class11 . (ac105,ac110) class12 . (ac115,ac120) class13 . (ac125,ac130) class14 . (ac135,ac140) -class15 . (ac145,ac150) / ; diff --git a/modules/35_natveg/pot_forest_may24/preloop.gms b/modules/35_natveg/pot_forest_may24/preloop.gms index 7d04a1928d..fe45000a65 100644 --- a/modules/35_natveg/pot_forest_may24/preloop.gms +++ b/modules/35_natveg/pot_forest_may24/preloop.gms @@ -16,12 +16,10 @@ elseif s35_secdf_distribution = 1, * ac0 is excluded here. Therefore no initial shifting is needed. i35_secdforest(j,ac)$(not sameas(ac,"ac0")) = pcm_land(j,"secdforest")/(card(ac)-1); elseif s35_secdf_distribution = 2, -*classes 1, 2, 3 include plantation and are therefore excluded -*As disturbance history (fire) would affect the age structure -*We use the sahre from class 4 to be in class 1,2,3 -*class 15 is primary forest and is therefore excluded - i35_plantedclass_ac(j,ac) = im_plantedclass_ac(j,ac); - i35_plantedclass_ac(j,ac_planted)$(i35_plantedclass_ac(j,ac_planted) > im_plantedclass_ac(j,"ac35")) = im_plantedclass_ac(j,"ac35"); +*classes 1, 2, 3 include many plantations and are therefore excluded +*Instead, we use class 4 for all young age-classes + i35_plantedclass_ac(j,ac) = im_forest_ageclass(j,ac); + i35_plantedclass_ac(j,ac_young) = im_forest_ageclass(j,"ac35"); * Distribute this area correctly p35_poulter_dist(j,ac) = 0; From 162048e86491c70d18fa3c6bf863aca654635ebe Mon Sep 17 00:00:00 2001 From: florianh Date: Sat, 26 Oct 2024 08:14:36 +0200 Subject: [PATCH 066/206] bugfix --- modules/28_ageclass/feb21/preloop.gms | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/modules/28_ageclass/feb21/preloop.gms b/modules/28_ageclass/feb21/preloop.gms index 8c7bf092ea..096647d549 100644 --- a/modules/28_ageclass/feb21/preloop.gms +++ b/modules/28_ageclass/feb21/preloop.gms @@ -9,9 +9,4 @@ * Therefore, each age-class in `ac_poulter` is distributed equally to all beloning age-classes in `ac`. im_forest_ageclass(j,ac) = 0; im_forest_ageclass(j,ac) = sum(ac_poulter_to_ac(ac_poulter,ac),f28_forestageclasses(j,ac_poulter)) / 2; -im_forest_ageclass(j,"acx") = f28_forestageclasses(j,"class15") - - - i35_plantedclass_ac(j,ac) = im_forest_ageclass(j,ac); - i35_plantedclass_ac(j,ac_young)$(i35_plantedclass_ac(j,ac_young) > im_forest_ageclass(j,"ac35")) = im_forest_ageclass(j,"ac35"); - +im_forest_ageclass(j,"acx") = f28_forestageclasses(j,"class15"); From d28d56a054238021f32161ad2eb9d38c8696f478 Mon Sep 17 00:00:00 2001 From: florianh Date: Sat, 26 Oct 2024 18:50:39 +0200 Subject: [PATCH 067/206] bugfix --- modules/28_ageclass/feb21/sets.gms | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/modules/28_ageclass/feb21/sets.gms b/modules/28_ageclass/feb21/sets.gms index c40bc897c3..08965f8e8d 100644 --- a/modules/28_ageclass/feb21/sets.gms +++ b/modules/28_ageclass/feb21/sets.gms @@ -16,9 +16,9 @@ ac_young(ac) Young age classes ac_poulter_to_ac(ac_poulter,ac) mapping between ac and ac_poulter / -class4 . (ac5,ac10) -class4 . (ac15,ac20) -class4 . (ac25,ac30) +class1 . (ac5,ac10) +class2 . (ac15,ac20) +class3 . (ac25,ac30) class4 . (ac35,ac40) class5 . (ac45,ac50) class6 . (ac55,ac60) From 6aec7dc8b4ce5e03c21d721dec480e4c0acfae81 Mon Sep 17 00:00:00 2001 From: florianh Date: Sun, 27 Oct 2024 00:40:56 +0200 Subject: [PATCH 068/206] update --- modules/28_ageclass/feb21/declarations.gms | 2 +- modules/28_ageclass/feb21/input.gms | 2 +- modules/28_ageclass/feb21/preloop.gms | 6 +++--- modules/28_ageclass/feb21/sets.gms | 6 +++--- modules/28_ageclass/module.gms | 6 +++--- .../35_natveg/pot_forest_may24/declarations.gms | 4 ++-- modules/35_natveg/pot_forest_may24/preloop.gms | 17 ++++++++++------- 7 files changed, 23 insertions(+), 20 deletions(-) diff --git a/modules/28_ageclass/feb21/declarations.gms b/modules/28_ageclass/feb21/declarations.gms index e994c79493..96fdac64c9 100644 --- a/modules/28_ageclass/feb21/declarations.gms +++ b/modules/28_ageclass/feb21/declarations.gms @@ -6,5 +6,5 @@ *** | Contact: magpie@pik-potsdam.de parameter - im_forest_ageclass(j,ac) Raw Distribution of ageclass in secondary forest as a proxy for planted forest (mio. ha) + im_forest_ageclass(j,ac) Forest area in 5-year age-classes based on GFAD (mio. ha) ; diff --git a/modules/28_ageclass/feb21/input.gms b/modules/28_ageclass/feb21/input.gms index c3e13ce776..4183a2e0fe 100644 --- a/modules/28_ageclass/feb21/input.gms +++ b/modules/28_ageclass/feb21/input.gms @@ -5,7 +5,7 @@ *** | MAgPIE License Exception, version 1.0 (see LICENSE file). *** | Contact: magpie@pik-potsdam.de -table f28_forestageclasses(j,ac_poulter) Forest area in 15 10-year age classes (Mha) +table f28_forestageclasses(j,ac_gfad) Forest area in 15 10-year age classes from GFAD (Mha) $ondelim $include "./modules/28_ageclass/input/forestageclasses.cs3" $offdelim diff --git a/modules/28_ageclass/feb21/preloop.gms b/modules/28_ageclass/feb21/preloop.gms index 096647d549..20585251fc 100644 --- a/modules/28_ageclass/feb21/preloop.gms +++ b/modules/28_ageclass/feb21/preloop.gms @@ -5,8 +5,8 @@ *** | MAgPIE License Exception, version 1.0 (see LICENSE file). *** | Contact: magpie@pik-potsdam.de -* Two age-classes in `ac` are mapped to one age-class in `ac_poulter`. -* Therefore, each age-class in `ac_poulter` is distributed equally to all beloning age-classes in `ac`. +* Two age-classes in `ac` are mapped to one age-class in `ac_gfad`. +* Therefore, each age-class in `ac_gfad` is distributed equally to all beloning age-classes in `ac`. im_forest_ageclass(j,ac) = 0; -im_forest_ageclass(j,ac) = sum(ac_poulter_to_ac(ac_poulter,ac),f28_forestageclasses(j,ac_poulter)) / 2; +im_forest_ageclass(j,ac) = sum(ac_gfad_to_ac(ac_gfad,ac),f28_forestageclasses(j,ac_gfad)) / 2; im_forest_ageclass(j,"acx") = f28_forestageclasses(j,"class15"); diff --git a/modules/28_ageclass/feb21/sets.gms b/modules/28_ageclass/feb21/sets.gms index 08965f8e8d..9fc3483ce4 100644 --- a/modules/28_ageclass/feb21/sets.gms +++ b/modules/28_ageclass/feb21/sets.gms @@ -6,7 +6,7 @@ *** | Contact: magpie@pik-potsdam.de sets -ac_poulter Forest age classes in Poulter data set +ac_gfad Forest age classes in GFAD data set / class1, class2, class3, class4, class5, class6, class7, class8, class9, class10, class11, class12, class13, class14, class15 / @@ -14,7 +14,7 @@ class11, class12, class13, class14, class15 / ac_young(ac) Young age classes / ac0, ac5, ac10, ac15, ac20, ac25, ac30 / -ac_poulter_to_ac(ac_poulter,ac) mapping between ac and ac_poulter +ac_gfad_to_ac(ac_gfad,ac) mapping between ac and ac_gfad / class1 . (ac5,ac10) class2 . (ac15,ac20) @@ -34,5 +34,5 @@ class14 . (ac135,ac140) ; -alias(ac_poulter,ac_poulter2); +alias(ac_gfad,ac_gfad2); alias(ac,ac2); diff --git a/modules/28_ageclass/module.gms b/modules/28_ageclass/module.gms index 27f03a3081..ae92ac4942 100644 --- a/modules/28_ageclass/module.gms +++ b/modules/28_ageclass/module.gms @@ -7,9 +7,9 @@ *' @title Age class -*' @description The age-class module calculates the distribution of secondary -*' forests and timber plantations based on Poulter dataset. This is used in -*' [32_forestry] and [35_natveg] for initialization of forest areas. +*' @description The age-class module provides the distribution of forest age-classes +*' to other modules. The age-class distribution is used in +*' [35_natveg] for the initialization of secondary forest areas. *' @authors Abhijeet Mishra, Florian Humpenöder diff --git a/modules/35_natveg/pot_forest_may24/declarations.gms b/modules/35_natveg/pot_forest_may24/declarations.gms index 7ce8011d26..a0228e1a36 100644 --- a/modules/35_natveg/pot_forest_may24/declarations.gms +++ b/modules/35_natveg/pot_forest_may24/declarations.gms @@ -27,8 +27,8 @@ parameters p35_carbon_density_other(t,j,othertype35,ac,ag_pools) Carbon density other land (tC per ha) p35_disturbance_loss_secdf(t,j,ac) Loss due to disturbances in secondary forest (mio. ha) p35_disturbance_loss_primf(t,j) Loss due to disturbances in primary forest (mio. ha) - i35_plantedclass_ac(j,ac) Area of age-classes in secondary forest (1) - p35_poulter_dist(j,ac) Share of age-classes in secondary forest (1) + p35_secdf_ageclass(j,ac) Secondadry forest area in 5-year age-classes (mio. ha) + p35_secdf_ageclass_dist(j,ac) Share of age-classes in secondary forest (1) p35_land_start_ac(j,ac,land_natveg) Initial Natural vegetation area (mio. ha) p35_protection_dist(j,ac) Distribution of secondary forest protection (1) p35_land_restoration(j,land_natveg) Actual secondary forest and other land restoration area (mio. ha) diff --git a/modules/35_natveg/pot_forest_may24/preloop.gms b/modules/35_natveg/pot_forest_may24/preloop.gms index fe45000a65..788908ea9e 100644 --- a/modules/35_natveg/pot_forest_may24/preloop.gms +++ b/modules/35_natveg/pot_forest_may24/preloop.gms @@ -16,15 +16,18 @@ elseif s35_secdf_distribution = 1, * ac0 is excluded here. Therefore no initial shifting is needed. i35_secdforest(j,ac)$(not sameas(ac,"ac0")) = pcm_land(j,"secdforest")/(card(ac)-1); elseif s35_secdf_distribution = 2, -*classes 1, 2, 3 include many plantations and are therefore excluded -*Instead, we use class 4 for all young age-classes - i35_plantedclass_ac(j,ac) = im_forest_ageclass(j,ac); - i35_plantedclass_ac(j,ac_young) = im_forest_ageclass(j,"ac35"); +*classes 1, 2, 3 include plantation and are therefore excluded +*As disturbance history (fire) would affect the age structure +*We use the share from class 4 to be in class 1,2,3 +*class 15 is primary forest and is therefore excluded + p35_secdf_ageclass(j,ac) = im_forest_ageclass(j,ac); + p35_secdf_ageclass(j,ac_young) = im_forest_ageclass(j,"ac35"); + p35_secdf_ageclass(j,"acx") = 0; * Distribute this area correctly - p35_poulter_dist(j,ac) = 0; - p35_poulter_dist(j,ac) = (i35_plantedclass_ac(j,ac)/sum(ac2,i35_plantedclass_ac(j,ac2)))$(sum(ac2,i35_plantedclass_ac(j,ac2))>0); - i35_secdforest(j,ac)$(not sameas(ac,"ac0")) = pcm_land(j,"secdforest")*p35_poulter_dist(j,ac); + p35_secdf_ageclass_dist(j,ac) = 1/card(ac); + p35_secdf_ageclass_dist(j,ac)$(sum(ac2,p35_secdf_ageclass(j,ac2))>0) = (p35_secdf_ageclass(j,ac)/sum(ac2,p35_secdf_ageclass(j,ac2))); + i35_secdforest(j,ac)$(not sameas(ac,"ac0")) = pcm_land(j,"secdforest")*p35_secdf_ageclass_dist(j,ac); ); *use residual approach to avoid rounding errors From 3afc33181585f209c148febc2193bfd84802806a Mon Sep 17 00:00:00 2001 From: florianh Date: Sun, 27 Oct 2024 09:43:54 +0100 Subject: [PATCH 069/206] test --- modules/35_natveg/pot_forest_may24/preloop.gms | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/35_natveg/pot_forest_may24/preloop.gms b/modules/35_natveg/pot_forest_may24/preloop.gms index 788908ea9e..90ff1dae95 100644 --- a/modules/35_natveg/pot_forest_may24/preloop.gms +++ b/modules/35_natveg/pot_forest_may24/preloop.gms @@ -22,7 +22,7 @@ elseif s35_secdf_distribution = 2, *class 15 is primary forest and is therefore excluded p35_secdf_ageclass(j,ac) = im_forest_ageclass(j,ac); p35_secdf_ageclass(j,ac_young) = im_forest_ageclass(j,"ac35"); - p35_secdf_ageclass(j,"acx") = 0; +* p35_secdf_ageclass(j,"acx") = 0; * Distribute this area correctly p35_secdf_ageclass_dist(j,ac) = 1/card(ac); From 3f492da8f801cc7884e65c8fbb3b72708090c4cd Mon Sep 17 00:00:00 2001 From: florianh Date: Sun, 27 Oct 2024 10:25:04 +0100 Subject: [PATCH 070/206] test --- modules/35_natveg/pot_forest_may24/preloop.gms | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/modules/35_natveg/pot_forest_may24/preloop.gms b/modules/35_natveg/pot_forest_may24/preloop.gms index 90ff1dae95..eacd4eb89b 100644 --- a/modules/35_natveg/pot_forest_may24/preloop.gms +++ b/modules/35_natveg/pot_forest_may24/preloop.gms @@ -25,8 +25,12 @@ elseif s35_secdf_distribution = 2, * p35_secdf_ageclass(j,"acx") = 0; * Distribute this area correctly - p35_secdf_ageclass_dist(j,ac) = 1/card(ac); - p35_secdf_ageclass_dist(j,ac)$(sum(ac2,p35_secdf_ageclass(j,ac2))>0) = (p35_secdf_ageclass(j,ac)/sum(ac2,p35_secdf_ageclass(j,ac2))); +if(sum(ac2,p35_secdf_ageclass(j,ac2)) > 0, + p35_secdf_ageclass_dist(j,ac) = (p35_secdf_ageclass(j,ac)/sum(ac2,p35_secdf_ageclass(j,ac2))); +else + p35_secdf_ageclass_dist(j,ac) = 0; + p35_secdf_ageclass_dist(j,"acx") = 1; +); i35_secdforest(j,ac)$(not sameas(ac,"ac0")) = pcm_land(j,"secdforest")*p35_secdf_ageclass_dist(j,ac); ); From 1abf76d949e0ae323da8225a01465aff9d0228bc Mon Sep 17 00:00:00 2001 From: florianh Date: Sun, 27 Oct 2024 10:30:31 +0100 Subject: [PATCH 071/206] test --- modules/35_natveg/pot_forest_may24/preloop.gms | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/35_natveg/pot_forest_may24/preloop.gms b/modules/35_natveg/pot_forest_may24/preloop.gms index eacd4eb89b..9bb43e3722 100644 --- a/modules/35_natveg/pot_forest_may24/preloop.gms +++ b/modules/35_natveg/pot_forest_may24/preloop.gms @@ -22,7 +22,7 @@ elseif s35_secdf_distribution = 2, *class 15 is primary forest and is therefore excluded p35_secdf_ageclass(j,ac) = im_forest_ageclass(j,ac); p35_secdf_ageclass(j,ac_young) = im_forest_ageclass(j,"ac35"); -* p35_secdf_ageclass(j,"acx") = 0; + p35_secdf_ageclass(j,"acx") = 0; * Distribute this area correctly if(sum(ac2,p35_secdf_ageclass(j,ac2)) > 0, From f2a70446c6b9518518da04abccce37b079bb940e Mon Sep 17 00:00:00 2001 From: florianh Date: Sun, 27 Oct 2024 10:35:05 +0100 Subject: [PATCH 072/206] test --- modules/35_natveg/pot_forest_may24/preloop.gms | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/modules/35_natveg/pot_forest_may24/preloop.gms b/modules/35_natveg/pot_forest_may24/preloop.gms index 9bb43e3722..ef5287e923 100644 --- a/modules/35_natveg/pot_forest_may24/preloop.gms +++ b/modules/35_natveg/pot_forest_may24/preloop.gms @@ -22,15 +22,13 @@ elseif s35_secdf_distribution = 2, *class 15 is primary forest and is therefore excluded p35_secdf_ageclass(j,ac) = im_forest_ageclass(j,ac); p35_secdf_ageclass(j,ac_young) = im_forest_ageclass(j,"ac35"); - p35_secdf_ageclass(j,"acx") = 0; +* p35_secdf_ageclass(j,"acx") = 0; * Distribute this area correctly -if(sum(ac2,p35_secdf_ageclass(j,ac2)) > 0, - p35_secdf_ageclass_dist(j,ac) = (p35_secdf_ageclass(j,ac)/sum(ac2,p35_secdf_ageclass(j,ac2))); -else p35_secdf_ageclass_dist(j,ac) = 0; p35_secdf_ageclass_dist(j,"acx") = 1; -); + p35_secdf_ageclass_dist(j,ac)$(sum(ac2,p35_secdf_ageclass(j,ac2))>0) = + p35_secdf_ageclass(j,ac)/sum(ac2,p35_secdf_ageclass(j,ac2)); i35_secdforest(j,ac)$(not sameas(ac,"ac0")) = pcm_land(j,"secdforest")*p35_secdf_ageclass_dist(j,ac); ); From a68766360ace46ea6d5b4ddfe47a8f5693bf450e Mon Sep 17 00:00:00 2001 From: florianh Date: Sun, 27 Oct 2024 10:42:02 +0100 Subject: [PATCH 073/206] test --- modules/35_natveg/pot_forest_may24/preloop.gms | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/35_natveg/pot_forest_may24/preloop.gms b/modules/35_natveg/pot_forest_may24/preloop.gms index ef5287e923..7ac109e176 100644 --- a/modules/35_natveg/pot_forest_may24/preloop.gms +++ b/modules/35_natveg/pot_forest_may24/preloop.gms @@ -22,7 +22,7 @@ elseif s35_secdf_distribution = 2, *class 15 is primary forest and is therefore excluded p35_secdf_ageclass(j,ac) = im_forest_ageclass(j,ac); p35_secdf_ageclass(j,ac_young) = im_forest_ageclass(j,"ac35"); -* p35_secdf_ageclass(j,"acx") = 0; + p35_secdf_ageclass(j,"acx") = 0; * Distribute this area correctly p35_secdf_ageclass_dist(j,ac) = 0; From 68a0eac2f1383424467bb2aa396ea7e96b47b28c Mon Sep 17 00:00:00 2001 From: florianh Date: Sun, 27 Oct 2024 10:51:05 +0100 Subject: [PATCH 074/206] test --- modules/35_natveg/pot_forest_may24/preloop.gms | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/modules/35_natveg/pot_forest_may24/preloop.gms b/modules/35_natveg/pot_forest_may24/preloop.gms index 7ac109e176..71874b3999 100644 --- a/modules/35_natveg/pot_forest_may24/preloop.gms +++ b/modules/35_natveg/pot_forest_may24/preloop.gms @@ -21,8 +21,8 @@ elseif s35_secdf_distribution = 2, *We use the share from class 4 to be in class 1,2,3 *class 15 is primary forest and is therefore excluded p35_secdf_ageclass(j,ac) = im_forest_ageclass(j,ac); - p35_secdf_ageclass(j,ac_young) = im_forest_ageclass(j,"ac35"); - p35_secdf_ageclass(j,"acx") = 0; + p35_secdf_ageclass(j,ac_young)$(p35_secdf_ageclass(j,ac_planted) > p35_secdf_ageclass(j,"ac35")) = p35_secdf_ageclass(j,"ac35"); +* p35_secdf_ageclass(j,"acx") = 0; * Distribute this area correctly p35_secdf_ageclass_dist(j,ac) = 0; From 5ecc0a921bc318ef749b719b66a2ac8a023b4f3b Mon Sep 17 00:00:00 2001 From: florianh Date: Sun, 27 Oct 2024 12:21:40 +0100 Subject: [PATCH 075/206] bugfix --- modules/35_natveg/pot_forest_may24/preloop.gms | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/35_natveg/pot_forest_may24/preloop.gms b/modules/35_natveg/pot_forest_may24/preloop.gms index 71874b3999..b296eec294 100644 --- a/modules/35_natveg/pot_forest_may24/preloop.gms +++ b/modules/35_natveg/pot_forest_may24/preloop.gms @@ -21,7 +21,7 @@ elseif s35_secdf_distribution = 2, *We use the share from class 4 to be in class 1,2,3 *class 15 is primary forest and is therefore excluded p35_secdf_ageclass(j,ac) = im_forest_ageclass(j,ac); - p35_secdf_ageclass(j,ac_young)$(p35_secdf_ageclass(j,ac_planted) > p35_secdf_ageclass(j,"ac35")) = p35_secdf_ageclass(j,"ac35"); + p35_secdf_ageclass(j,ac_young)$(p35_secdf_ageclass(j,ac_young) > p35_secdf_ageclass(j,"ac35")) = p35_secdf_ageclass(j,"ac35"); * p35_secdf_ageclass(j,"acx") = 0; * Distribute this area correctly From ae79626342ec02a2e5b5a67e4a9933fc205d59e6 Mon Sep 17 00:00:00 2001 From: florianh Date: Sun, 27 Oct 2024 12:27:12 +0100 Subject: [PATCH 076/206] test --- modules/35_natveg/pot_forest_may24/preloop.gms | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/modules/35_natveg/pot_forest_may24/preloop.gms b/modules/35_natveg/pot_forest_may24/preloop.gms index b296eec294..d70e333f11 100644 --- a/modules/35_natveg/pot_forest_may24/preloop.gms +++ b/modules/35_natveg/pot_forest_may24/preloop.gms @@ -22,7 +22,8 @@ elseif s35_secdf_distribution = 2, *class 15 is primary forest and is therefore excluded p35_secdf_ageclass(j,ac) = im_forest_ageclass(j,ac); p35_secdf_ageclass(j,ac_young)$(p35_secdf_ageclass(j,ac_young) > p35_secdf_ageclass(j,"ac35")) = p35_secdf_ageclass(j,"ac35"); -* p35_secdf_ageclass(j,"acx") = 0; + p35_secdf_ageclass(j,"acx") = p35_secdf_ageclass(j,"acx") - pcm_land(j,"primforest"); + p35_secdf_ageclass(j,"acx")$(p35_secdf_ageclass(j,"acx") < 0) = 0; * Distribute this area correctly p35_secdf_ageclass_dist(j,ac) = 0; From 981756c7270b74a742349bfc560025e79c718003 Mon Sep 17 00:00:00 2001 From: florianh Date: Sun, 27 Oct 2024 15:25:30 +0100 Subject: [PATCH 077/206] update --- literature.bib | 13 +++++++++++++ modules/28_ageclass/feb21/preloop.gms | 2 ++ modules/28_ageclass/feb21/realization.gms | 16 ++++++---------- modules/28_ageclass/module.gms | 4 ++-- modules/35_natveg/pot_forest_may24/preloop.gms | 14 ++++++++------ 5 files changed, 31 insertions(+), 18 deletions(-) diff --git a/literature.bib b/literature.bib index 9796ef8f89..ec51852a27 100644 --- a/literature.bib +++ b/literature.bib @@ -1361,6 +1361,19 @@ @article{poulter2018global publisher = {NASA National Aeronautics and Space Administration, PANGAEA} } +@misc{poulter_global_2019, + title = {The global forest age dataset and its uncertainties (GFADv1.1)}, + copyright = {info:eu-repo/semantics/openAccess}, + url = {https://doi.pangaea.de/10.1594/PANGAEA.897392}, + doi = {10.1594/PANGAEA.897392}, + urldate = {2024-10-27}, + publisher = {PANGAEA}, + author = {Poulter, Benjamin and Aragão, Luiz and Andela, Niels and Bellassen, Valentin and Ciais, Philippe and Kato, Tomomichi and Lin, Xin and Nachin, Baatarbileg and Luyssaert, Sebastiaan and Pederson, Niel and Peylin, Philippe and Piao, Shilong and Pugh, Tom and Saatchi, Sassan and Schepaschenko, Dmitry and Schelhaas, Martjan and Shivdenko, Anatoly}, + year = {2019}, + note = {Publication Title: NASA National Aeronautics and Space Administration}, + keywords = {age class, GFAD, Poulter}, +} + @article{zabel_global_2014, title = {Global {{Agricultural Land Resources}} \textendash{} {{A High Resolution Suitability Evaluation}} and {{Its Perspectives}} until 2100 under {{Climate Change Conditions}}}, author = {Zabel, Florian and Putzenlechner, Birgitta and Mauser, Wolfram}, diff --git a/modules/28_ageclass/feb21/preloop.gms b/modules/28_ageclass/feb21/preloop.gms index 20585251fc..000994c174 100644 --- a/modules/28_ageclass/feb21/preloop.gms +++ b/modules/28_ageclass/feb21/preloop.gms @@ -9,4 +9,6 @@ * Therefore, each age-class in `ac_gfad` is distributed equally to all beloning age-classes in `ac`. im_forest_ageclass(j,ac) = 0; im_forest_ageclass(j,ac) = sum(ac_gfad_to_ac(ac_gfad,ac),f28_forestageclasses(j,ac_gfad)) / 2; +* `class15` in GFAD1.1 includes forests that are 150 years or older, also including primary forest. +* Therefore, `class15` is mapped to the highest age-class `acx`. im_forest_ageclass(j,"acx") = f28_forestageclasses(j,"class15"); diff --git a/modules/28_ageclass/feb21/realization.gms b/modules/28_ageclass/feb21/realization.gms index f88a2c1b85..1cc6eac0e6 100644 --- a/modules/28_ageclass/feb21/realization.gms +++ b/modules/28_ageclass/feb21/realization.gms @@ -5,17 +5,13 @@ *** | MAgPIE License Exception, version 1.0 (see LICENSE file). *** | Contact: magpie@pik-potsdam.de -*' @description This realization calculates use the results from @poulter2018global -*' for secondary forests (and timber plantations) based on MODIS satellite data. -*' This is used in [32_forestry] and [35_natveg] for initialization of forest areas -*' based on specification of endogenous (or exogenous) forest harvests. These numbers -*' are the most consistent dataset available on spatial scale and are preferred over -*' extarcting such numbers from LUH data due to ease of generating these numbers. +*' @description This realization provides forest area in age-classes `im_forest_ageclass` +*' based on the Global Forest Age Dataset (GFAD V1.1) from @poulter_global_2019. -*' @limitations Forest fires change how the age structures of secondary or -*' human-intervention forests over time. This being a satellite observation data -*' probably includes such disturbances. These disturbances are not modeled extensively -*' in MAgPIE and hence using these numbers directly in the model might generate biases. +*' @limitations Disturbances such as forest fires change the age structure of forests over time. +*' GFAD V1.1 likely includes such disturbances in younger age-classes (`ac_young`). +*' Since forest disturbances are not modeled extensively in MAgPIE, +*' using these numbers directly in the model might generate biases. *####################### R SECTION START (PHASES) ############################## $Ifi "%phase%" == "sets" $include "./modules/28_ageclass/feb21/sets.gms" diff --git a/modules/28_ageclass/module.gms b/modules/28_ageclass/module.gms index ae92ac4942..0d79dbd6a3 100644 --- a/modules/28_ageclass/module.gms +++ b/modules/28_ageclass/module.gms @@ -7,8 +7,8 @@ *' @title Age class -*' @description The age-class module provides the distribution of forest age-classes -*' to other modules. The age-class distribution is used in +*' @description The age-class module provides forest area in age-classes +*' to other modules. The interface `im_forest_ageclass` is used in *' [35_natveg] for the initialization of secondary forest areas. *' @authors Abhijeet Mishra, Florian Humpenöder diff --git a/modules/35_natveg/pot_forest_may24/preloop.gms b/modules/35_natveg/pot_forest_may24/preloop.gms index d70e333f11..8c422db456 100644 --- a/modules/35_natveg/pot_forest_may24/preloop.gms +++ b/modules/35_natveg/pot_forest_may24/preloop.gms @@ -16,16 +16,18 @@ elseif s35_secdf_distribution = 1, * ac0 is excluded here. Therefore no initial shifting is needed. i35_secdforest(j,ac)$(not sameas(ac,"ac0")) = pcm_land(j,"secdforest")/(card(ac)-1); elseif s35_secdf_distribution = 2, -*classes 1, 2, 3 include plantation and are therefore excluded -*As disturbance history (fire) would affect the age structure -*We use the share from class 4 to be in class 1,2,3 -*class 15 is primary forest and is therefore excluded +*For the initialization of age-classes in secondary forest, forest area in 5-year age-classes based on GFAD is used p35_secdf_ageclass(j,ac) = im_forest_ageclass(j,ac); - p35_secdf_ageclass(j,ac_young)$(p35_secdf_ageclass(j,ac_young) > p35_secdf_ageclass(j,"ac35")) = p35_secdf_ageclass(j,"ac35"); +* p35_secdf_ageclass(j,ac_young)$(p35_secdf_ageclass(j,ac_young) > p35_secdf_ageclass(j,"ac35")) = p35_secdf_ageclass(j,"ac35"); +* Young forest (`ac_young`) includes plantations and might be (strongly) affected by disturbances such as fire. +* Therefore, young forest (`ac_young`) is disregarded for the initialization of age-classes in secondary forest. +* Instead, age-class areas from `ac35` are used as a proxy for `ac_young`. + p35_secdf_ageclass(j,ac_young) = p35_secdf_ageclass(j,"ac35"); +* `acx` includes primary forest. Therefore, primary forest is subtracted from `acx`. p35_secdf_ageclass(j,"acx") = p35_secdf_ageclass(j,"acx") - pcm_land(j,"primforest"); p35_secdf_ageclass(j,"acx")$(p35_secdf_ageclass(j,"acx") < 0) = 0; -* Distribute this area correctly +* Distribution of age-classes in secondary forest. In case of missing area information, `acx` is assumed. p35_secdf_ageclass_dist(j,ac) = 0; p35_secdf_ageclass_dist(j,"acx") = 1; p35_secdf_ageclass_dist(j,ac)$(sum(ac2,p35_secdf_ageclass(j,ac2))>0) = From 47af91ce66f76b05c42e9da9482f47c7f37ce67d Mon Sep 17 00:00:00 2001 From: florianh Date: Sun, 27 Oct 2024 15:36:03 +0100 Subject: [PATCH 078/206] age-class update --- CHANGELOG.md | 4 +++- config/default.cfg | 4 ++-- config/projects/scenario_config_el2.csv | 2 +- config/projects/scenario_config_fsec.csv | 6 +++--- main.gms | 14 +++++++------- modules/28_ageclass/module.gms | 2 +- .../28_ageclass/{feb21 => oct24}/declarations.gms | 0 modules/28_ageclass/{feb21 => oct24}/input.gms | 0 modules/28_ageclass/{feb21 => oct24}/preloop.gms | 0 modules/28_ageclass/{feb21 => oct24}/presolve.gms | 0 .../28_ageclass/{feb21 => oct24}/realization.gms | 10 +++++----- modules/28_ageclass/{feb21 => oct24}/sets.gms | 0 scripts/start/extra/recalibrateH16.R | 6 +++--- scripts/start/projects/paper_peatlandTax.R | 12 ++++++------ scripts/start/projects/project_ABCDR.R | 14 +++++++------- scripts/start/projects/project_EAT2p0.R | 2 +- 16 files changed, 39 insertions(+), 37 deletions(-) rename modules/28_ageclass/{feb21 => oct24}/declarations.gms (100%) rename modules/28_ageclass/{feb21 => oct24}/input.gms (100%) rename modules/28_ageclass/{feb21 => oct24}/preloop.gms (100%) rename modules/28_ageclass/{feb21 => oct24}/presolve.gms (100%) rename modules/28_ageclass/{feb21 => oct24}/realization.gms (78%) rename modules/28_ageclass/{feb21 => oct24}/sets.gms (100%) diff --git a/CHANGELOG.md b/CHANGELOG.md index 7a648c02d8..2589ad27ca 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -10,8 +10,9 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). - **config** changed default input data to use 2017USD - **module_documentation** all references to USD05 changed to USD17 - **scripts** REMIND coupling reads data in US$2017, not US$2005 -- **config** updated input data to rev4.113 +- **config** updated input data to rev4.114 - **config** SHAPE scenarios start year of dietary shift changed to 2025 +- **35_natveg_** revised age-class initialization of secondary forest ### added - **62_material** added switch to turn off future material demand for bioplastic @@ -24,6 +25,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). - **11_costs** changed equation to fix bug in total water cost calculation - **29_cropland** treecover age-class growth was not working properly because ac_sub was erroneously not fixed - **scripts** script/output/extra/resubmit.R +- **28_ageclass_** bugfix input data unit and code clean-up ## [4.8.2] - 2024-09-24 diff --git a/config/default.cfg b/config/default.cfg index a7ae95150c..404772ab33 100644 --- a/config/default.cfg +++ b/config/default.cfg @@ -690,8 +690,8 @@ cfg$gms$s22_conservation_start <- 2025 # def = 2025 cfg$gms$s22_conservation_target <- 2050 # def = 2050 # ***--------------------- 28_ageclass ----------------------------------- -# * (feb21): Distribution of age-classes according to Poulter et al 2018 -cfg$gms$ageclass <- "feb21" # def = feb21 +# * (oct24): Forest age-classes based on GFAD V1.1 from Poulter et al 2019 +cfg$gms$ageclass <- "oct24" # def = oct24 # ***--------------------- 29_cropland ----------------------------------- # * Cropland is defined as the sum of croparea, fallow land and tree cover diff --git a/config/projects/scenario_config_el2.csv b/config/projects/scenario_config_el2.csv index ab91616c08..c9b84c1c5f 100644 --- a/config/projects/scenario_config_el2.csv +++ b/config/projects/scenario_config_el2.csv @@ -19,5 +19,5 @@ gms$s15_exo_alcohol;1;1;1 gms$s15_alc_scen;0;0;0 gms$factor_costs;sticky_labor;sticky_labor;sticky_labor gms$c70_feed_scen;ssp1;ssp2;ssp2 -input['cellular'];rev4.113EL2_h12_c6a7458f_cellularmagpie_c200_IPSL-CM6A-LR-ssp370_lpjml-8e6c5eb1.tgz;; +input['cellular'];rev4.114EL2_h12_c6a7458f_cellularmagpie_c200_IPSL-CM6A-LR-ssp370_lpjml-8e6c5eb1.tgz;; magicc_emis_scen;REMIND_generic_C_SSP2EU-DSPkB650-DS_betax_DeepDive_noNDC-rem-12.mif;REMIND_generic_C_SSP2EU-DSPkB650-DS_betax_DeepDive_noNDC-rem-12.mif;REMIND_generic_C_SSP2EU-DSPkB650-DS_betax_DeepDive_noNDC-rem-12.mif diff --git a/config/projects/scenario_config_fsec.csv b/config/projects/scenario_config_fsec.csv index 6991976180..9cbebdbf97 100644 --- a/config/projects/scenario_config_fsec.csv +++ b/config/projects/scenario_config_fsec.csv @@ -76,9 +76,9 @@ gms$s62_max_dem_bioplastic;0;;;;400;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; gms$c70_fac_req_regr;reg;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; gms$c70_feed_scen;;;;;;;;;;;;;;;;;;ssp1;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; gms$c73_build_demand;;;;;;;;;;;;;;;;;;;;;;;;50pc;;;;;;;;;;;;;;;;;;;;;;;;;;; -input['cellular'];rev4.113_FSEC_3c888fa5_cellularmagpie_c200_MRI-ESM2-0-ssp460_lpjml-8e6c5eb1.tgz;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;rev4.113_FSEC_0bd54110_cellularmagpie_c200_MRI-ESM2-0-ssp119_lpjml-8e6c5eb1.tgz;rev4.113_FSEC_6819938d_cellularmagpie_c200_MRI-ESM2-0-ssp126_lpjml-8e6c5eb1.tgz;;rev4.113_FSEC_1b5c3817_cellularmagpie_c200_MRI-ESM2-0-ssp245_lpjml-8e6c5eb1.tgz;rev4.113_FSEC_3c888fa5_cellularmagpie_c200_MRI-ESM2-0-ssp460_lpjml-8e6c5eb1.tgz;rev4.113_FSEC_fd712c0b_cellularmagpie_c200_MRI-ESM2-0-ssp370_lpjml-8e6c5eb1.tgz;rev4.113_FSEC_09a63995_cellularmagpie_c200_MRI-ESM2-0-ssp585_lpjml-8e6c5eb1.tgz;;; -input['regional'];rev4.113_FSEC_magpie.tgz;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -input['validation'];rev4.113_FSEC_validation.tgz;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +input['cellular'];rev4.114_FSEC_3c888fa5_cellularmagpie_c200_MRI-ESM2-0-ssp460_lpjml-8e6c5eb1.tgz;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;rev4.114_FSEC_0bd54110_cellularmagpie_c200_MRI-ESM2-0-ssp119_lpjml-8e6c5eb1.tgz;rev4.114_FSEC_6819938d_cellularmagpie_c200_MRI-ESM2-0-ssp126_lpjml-8e6c5eb1.tgz;;rev4.114_FSEC_1b5c3817_cellularmagpie_c200_MRI-ESM2-0-ssp245_lpjml-8e6c5eb1.tgz;rev4.114_FSEC_3c888fa5_cellularmagpie_c200_MRI-ESM2-0-ssp460_lpjml-8e6c5eb1.tgz;rev4.114_FSEC_fd712c0b_cellularmagpie_c200_MRI-ESM2-0-ssp370_lpjml-8e6c5eb1.tgz;rev4.114_FSEC_09a63995_cellularmagpie_c200_MRI-ESM2-0-ssp585_lpjml-8e6c5eb1.tgz;;; +input['regional'];rev4.114_FSEC_magpie.tgz;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +input['validation'];rev4.114_FSEC_validation.tgz;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; input['additional'];additional_data_rev4.57.tgz;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; input['calibration'];calibration_FSEC_27Sep24.tgz;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; magicc_emis_scen;bjoernAR6_C_SSP2-NDC.mif;;;bjoernAR6_C_SSP2-PkBudg900.mif;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;bjoernAR6_C_SSP1-NDC.mif;;;;;;;;;;;;bjoernAR6_C_RemSDP-900-MagSSP1.mif;; diff --git a/main.gms b/main.gms index 6d4bbafcd7..d359a4d999 100644 --- a/main.gms +++ b/main.gms @@ -148,15 +148,15 @@ $title magpie *##################### R SECTION START (VERSION INFO) ########################## * -* Used data set: rev4.112_h12_magpie.tgz +* Used data set: rev4.114_h12_magpie.tgz * md5sum: NA * Repository: https://rse.pik-potsdam.de/data/magpie/public * -* Used data set: rev4.112_h12_fd712c0b_cellularmagpie_c200_MRI-ESM2-0-ssp370_lpjml-8e6c5eb1.tgz +* Used data set: rev4.114_h12_fd712c0b_cellularmagpie_c200_MRI-ESM2-0-ssp370_lpjml-8e6c5eb1.tgz * md5sum: NA * Repository: https://rse.pik-potsdam.de/data/magpie/public * -* Used data set: rev4.112_h12_validation.tgz +* Used data set: rev4.114_h12_validation.tgz * md5sum: NA * Repository: https://rse.pik-potsdam.de/data/magpie/public * @@ -179,11 +179,11 @@ $title magpie * * Regionscode: 62eff8f7 * -* Regions data revision: 4.112 +* Regions data revision: 4.114 * * lpj2magpie settings: * * LPJmL data: MRI-ESM2-0:ssp370 -* * Revision: 4.112 +* * Revision: 4.114 * * aggregation settings: * * Input resolution: 0.5 @@ -195,7 +195,7 @@ $title magpie * * Call: withCallingHandlers(expr, message = messageHandler, warning = warningHandler, error = errorHandler) * * -* Last modification (input data): Tue Sep 24 17:20:08 2024 +* Last modification (input data): Sun Oct 27 00:37:36 2024 * *###################### R SECTION END (VERSION INFO) ########################### @@ -247,7 +247,7 @@ $setglobal processing substitution_may21 $setglobal trade selfsuff_reduced $setglobal land_conservation area_based_apr22 -$setglobal ageclass feb21 +$setglobal ageclass oct24 $setglobal cropland simple_apr24 $setglobal croparea simple_apr24 diff --git a/modules/28_ageclass/module.gms b/modules/28_ageclass/module.gms index 0d79dbd6a3..30488315fb 100644 --- a/modules/28_ageclass/module.gms +++ b/modules/28_ageclass/module.gms @@ -14,5 +14,5 @@ *' @authors Abhijeet Mishra, Florian Humpenöder *###################### R SECTION START (MODULETYPES) ########################## -$Ifi "%ageclass%" == "feb21" $include "./modules/28_ageclass/feb21/realization.gms" +$Ifi "%ageclass%" == "oct24" $include "./modules/28_ageclass/oct24/realization.gms" *###################### R SECTION END (MODULETYPES) ############################ diff --git a/modules/28_ageclass/feb21/declarations.gms b/modules/28_ageclass/oct24/declarations.gms similarity index 100% rename from modules/28_ageclass/feb21/declarations.gms rename to modules/28_ageclass/oct24/declarations.gms diff --git a/modules/28_ageclass/feb21/input.gms b/modules/28_ageclass/oct24/input.gms similarity index 100% rename from modules/28_ageclass/feb21/input.gms rename to modules/28_ageclass/oct24/input.gms diff --git a/modules/28_ageclass/feb21/preloop.gms b/modules/28_ageclass/oct24/preloop.gms similarity index 100% rename from modules/28_ageclass/feb21/preloop.gms rename to modules/28_ageclass/oct24/preloop.gms diff --git a/modules/28_ageclass/feb21/presolve.gms b/modules/28_ageclass/oct24/presolve.gms similarity index 100% rename from modules/28_ageclass/feb21/presolve.gms rename to modules/28_ageclass/oct24/presolve.gms diff --git a/modules/28_ageclass/feb21/realization.gms b/modules/28_ageclass/oct24/realization.gms similarity index 78% rename from modules/28_ageclass/feb21/realization.gms rename to modules/28_ageclass/oct24/realization.gms index 1cc6eac0e6..918f99d9e6 100644 --- a/modules/28_ageclass/feb21/realization.gms +++ b/modules/28_ageclass/oct24/realization.gms @@ -14,9 +14,9 @@ *' using these numbers directly in the model might generate biases. *####################### R SECTION START (PHASES) ############################## -$Ifi "%phase%" == "sets" $include "./modules/28_ageclass/feb21/sets.gms" -$Ifi "%phase%" == "declarations" $include "./modules/28_ageclass/feb21/declarations.gms" -$Ifi "%phase%" == "input" $include "./modules/28_ageclass/feb21/input.gms" -$Ifi "%phase%" == "preloop" $include "./modules/28_ageclass/feb21/preloop.gms" -$Ifi "%phase%" == "presolve" $include "./modules/28_ageclass/feb21/presolve.gms" +$Ifi "%phase%" == "sets" $include "./modules/28_ageclass/oct24/sets.gms" +$Ifi "%phase%" == "declarations" $include "./modules/28_ageclass/oct24/declarations.gms" +$Ifi "%phase%" == "input" $include "./modules/28_ageclass/oct24/input.gms" +$Ifi "%phase%" == "preloop" $include "./modules/28_ageclass/oct24/preloop.gms" +$Ifi "%phase%" == "presolve" $include "./modules/28_ageclass/oct24/presolve.gms" *######################## R SECTION END (PHASES) ############################### diff --git a/modules/28_ageclass/feb21/sets.gms b/modules/28_ageclass/oct24/sets.gms similarity index 100% rename from modules/28_ageclass/feb21/sets.gms rename to modules/28_ageclass/oct24/sets.gms diff --git a/scripts/start/extra/recalibrateH16.R b/scripts/start/extra/recalibrateH16.R index c01057b463..43330dd11f 100644 --- a/scripts/start/extra/recalibrateH16.R +++ b/scripts/start/extra/recalibrateH16.R @@ -17,10 +17,10 @@ source("scripts/start_functions.R") #start MAgPIE run source("config/default.cfg") -cfg$input['regional'] <- "rev4.113_36f73207_magpie.tgz" -cfg$input['validation'] <- "rev4.113_36f73207_validation.tgz" +cfg$input['regional'] <- "rev4.114_36f73207_magpie.tgz" +cfg$input['validation'] <- "rev4.114_36f73207_validation.tgz" cfg$input['calibration'] <- "calibration_H16_27Sep24.tgz" -cfg$input['cellular'] <- "rev4.113_36f73207_44a213b6_cellularmagpie_c400_MRI-ESM2-0-ssp370_lpjml-8e6c5eb1_clusterweight-ba4466a8.tgz" +cfg$input['cellular'] <- "rev4.114_36f73207_44a213b6_cellularmagpie_c400_MRI-ESM2-0-ssp370_lpjml-8e6c5eb1_clusterweight-ba4466a8.tgz" cfg$results_folder <- "output/:title:" cfg$recalibrate <- FALSE diff --git a/scripts/start/projects/paper_peatlandTax.R b/scripts/start/projects/paper_peatlandTax.R index 499582d987..48ee3c328c 100644 --- a/scripts/start/projects/paper_peatlandTax.R +++ b/scripts/start/projects/paper_peatlandTax.R @@ -23,7 +23,7 @@ source("scripts/start_functions.R") source("config/default.cfg") # create additional information to describe the runs -cfg$info$flag <- "PTax34" +cfg$info$flag <- "PTax35" cfg$results_folder <- "output/:title:" cfg$results_folder_highres <- "output" @@ -44,10 +44,10 @@ cfg$repositories <- append( getOption("magpie_repos") ) -cfg$input['regional'] <- "rev4.113_36f73207_magpie.tgz" -cfg$input['validation'] <- "rev4.113_36f73207_validation.tgz" +cfg$input['regional'] <- "rev4.114_36f73207_magpie.tgz" +cfg$input['validation'] <- "rev4.114_36f73207_validation.tgz" cfg$input['calibration'] <- "calibration_H16_27Sep24.tgz" -cfg$input['cellular'] <- "rev4.113_36f73207_44a213b6_cellularmagpie_c400_MRI-ESM2-0-ssp370_lpjml-8e6c5eb1_clusterweight-ba4466a8.tgz" +cfg$input['cellular'] <- "rev4.114_36f73207_44a213b6_cellularmagpie_c400_MRI-ESM2-0-ssp370_lpjml-8e6c5eb1_clusterweight-ba4466a8.tgz" download_and_update(cfg) ## Create patch file for GHG prices @@ -147,9 +147,9 @@ cfg$gms$s56_c_price_induced_aff <- 0 ## Start scenarios for (res in c("c400")) { if (res == "c400") - cfg$input['cellular'] <- "rev4.113_36f73207_44a213b6_cellularmagpie_c400_MRI-ESM2-0-ssp370_lpjml-8e6c5eb1_clusterweight-ba4466a8.tgz" + cfg$input['cellular'] <- "rev4.114_36f73207_44a213b6_cellularmagpie_c400_MRI-ESM2-0-ssp370_lpjml-8e6c5eb1_clusterweight-ba4466a8.tgz" else if (res == "c1000") { - cfg$input['cellular'] <- "rev4.113_36f73207_10f98ac1_cellularmagpie_c1000_MRI-ESM2-0-ssp370_lpjml-8e6c5eb1_clusterweight-ba4466a8.tgz" + cfg$input['cellular'] <- "rev4.114_36f73207_10f98ac1_cellularmagpie_c1000_MRI-ESM2-0-ssp370_lpjml-8e6c5eb1_clusterweight-ba4466a8.tgz" } ## Ref scenario cfg$title <- .title(cfg, paste(res, ssp, "Ref", sep = "-")) diff --git a/scripts/start/projects/project_ABCDR.R b/scripts/start/projects/project_ABCDR.R index 8c627082d7..154489725c 100644 --- a/scripts/start/projects/project_ABCDR.R +++ b/scripts/start/projects/project_ABCDR.R @@ -19,7 +19,7 @@ source("config/default.cfg") #download_and_update(cfg) # create additional information to describe the runs -cfg$info$flag <- "ABCDR15" +cfg$info$flag <- "ABCDR16" cfg$results_folder <- "output/:title:" cfg$force_replace <- TRUE @@ -31,10 +31,10 @@ cfg$qos <- "standby_highMem_dayMax" .title <- function(cfg, ...) return(paste(cfg$info$flag, sep="_",...)) -cfg$input['regional'] <- "rev4.113_36f73207_magpie.tgz" -cfg$input['validation'] <- "rev4.113_36f73207_validation.tgz" +cfg$input['regional'] <- "rev4.114_36f73207_magpie.tgz" +cfg$input['validation'] <- "rev4.114_36f73207_validation.tgz" cfg$input['calibration'] <- "calibration_H16_27Sep24.tgz" -cfg$input['cellular'] <- "rev4.113_36f73207_44a213b6_cellularmagpie_c400_MRI-ESM2-0-ssp370_lpjml-8e6c5eb1_clusterweight-ba4466a8.tgz" +cfg$input['cellular'] <- "rev4.114_36f73207_44a213b6_cellularmagpie_c400_MRI-ESM2-0-ssp370_lpjml-8e6c5eb1_clusterweight-ba4466a8.tgz" ssp <- "SSP2" @@ -54,19 +54,19 @@ for (pol in c("NDC","1p5deg","1p5deg-Diet")) { cfg$title <- .title(cfg, paste(ssp,pol,ifelse(growth==0,"natveg","plant"),paste0("AFS_tree_",sub("\\.","p",as.character(shr*100))),sep="-")) if (pol == "NDC") { cfg <- setScenario(cfg,c(ssp,"NDC","rcp4p5")) - cfg$input['cellular'] <- "rev4.113_36f73207_30c9dc61_cellularmagpie_c400_MRI-ESM2-0-ssp245_lpjml-8e6c5eb1_clusterweight-ba4466a8.tgz" + cfg$input['cellular'] <- "rev4.114_36f73207_30c9dc61_cellularmagpie_c400_MRI-ESM2-0-ssp245_lpjml-8e6c5eb1_clusterweight-ba4466a8.tgz" cfg$gms$c56_mute_ghgprices_until <- "y2150" cfg$gms$c56_pollutant_prices <- paste0("R32M46-", if (ssp=="SSP2") "SSP2EU" else ssp,"-NDC") cfg$gms$c60_2ndgen_biodem <- paste0("R32M46-", if (ssp=="SSP2") "SSP2EU" else ssp,"-NDC") } else if (pol == "1p5deg") { cfg <- setScenario(cfg,c(ssp,"NDC","rcp1p9")) - cfg$input['cellular'] <- "rev4.113_36f73207_bc624950_cellularmagpie_c400_MRI-ESM2-0-ssp119_lpjml-8e6c5eb1_clusterweight-ba4466a8.tgz" + cfg$input['cellular'] <- "rev4.114_36f73207_bc624950_cellularmagpie_c400_MRI-ESM2-0-ssp119_lpjml-8e6c5eb1_clusterweight-ba4466a8.tgz" cfg$gms$c56_mute_ghgprices_until <- "y2030" cfg$gms$c56_pollutant_prices <- paste0("R32M46-", if (ssp=="SSP2") "SSP2EU" else ssp,"-PkBudg650") cfg$gms$c60_2ndgen_biodem <- paste0("R32M46-", if (ssp=="SSP2") "SSP2EU" else ssp,"-PkBudg650") } else if (pol == "1p5deg-Diet") { cfg <- setScenario(cfg,c(ssp,"NDC","rcp1p9","eat_lancet_diet_v1")) - cfg$input['cellular'] <- "rev4.113_36f73207_bc624950_cellularmagpie_c400_MRI-ESM2-0-ssp119_lpjml-8e6c5eb1_clusterweight-ba4466a8.tgz" + cfg$input['cellular'] <- "rev4.114_36f73207_bc624950_cellularmagpie_c400_MRI-ESM2-0-ssp119_lpjml-8e6c5eb1_clusterweight-ba4466a8.tgz" cfg$gms$c56_mute_ghgprices_until <- "y2030" cfg$gms$c56_pollutant_prices <- paste0("R32M46-", if (ssp=="SSP2") "SSP2EU" else ssp,"-PkBudg650") cfg$gms$c60_2ndgen_biodem <- paste0("R32M46-", if (ssp=="SSP2") "SSP2EU" else ssp,"-PkBudg650") diff --git a/scripts/start/projects/project_EAT2p0.R b/scripts/start/projects/project_EAT2p0.R index fa70ea615b..0fd148dc35 100644 --- a/scripts/start/projects/project_EAT2p0.R +++ b/scripts/start/projects/project_EAT2p0.R @@ -90,7 +90,7 @@ bau <- function(cfg) { cfg$gms$c60_2ndgen_biodem <- "R21M42-SSP2-NPi" # default # Climate Change - cfg$input["cellular"] <- "rev4.113EL2_h12_c6a7458f_cellularmagpie_c200_IPSL-CM6A-LR-ssp370_lpjml-8e6c5eb1.tgz" + cfg$input["cellular"] <- "rev4.114EL2_h12_c6a7458f_cellularmagpie_c200_IPSL-CM6A-LR-ssp370_lpjml-8e6c5eb1.tgz" return(cfg) } From a7bfcf65b5ffa96f9b63f8877cde1798b81383ff Mon Sep 17 00:00:00 2001 From: florianh Date: Sun, 27 Oct 2024 15:38:05 +0100 Subject: [PATCH 079/206] changelog --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 2589ad27ca..acf31658b8 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -12,6 +12,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). - **scripts** REMIND coupling reads data in US$2017, not US$2005 - **config** updated input data to rev4.114 - **config** SHAPE scenarios start year of dietary shift changed to 2025 +- **28_ageclass_** number of age-classes doubled from 150 to 300 years for better match of growth curves with potential natural vegetation. - **35_natveg_** revised age-class initialization of secondary forest ### added From 7eb9e6bbd70c008899c53d6485d2947c371c6f59 Mon Sep 17 00:00:00 2001 From: florianh Date: Sun, 27 Oct 2024 15:46:01 +0100 Subject: [PATCH 080/206] changelog --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index acf31658b8..85c7602d73 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -26,7 +26,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). - **11_costs** changed equation to fix bug in total water cost calculation - **29_cropland** treecover age-class growth was not working properly because ac_sub was erroneously not fixed - **scripts** script/output/extra/resubmit.R -- **28_ageclass_** bugfix input data unit and code clean-up +- **28_ageclass_** bugfix input data unit and code clean-up. Renamed `feb21` realization to `oct24` ## [4.8.2] - 2024-09-24 From 606689dd128b8633ae3095e3e73d32bb1a21c328 Mon Sep 17 00:00:00 2001 From: florianh Date: Sun, 27 Oct 2024 16:12:55 +0100 Subject: [PATCH 081/206] changelog --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 85c7602d73..0117b1e9cb 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -12,7 +12,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). - **scripts** REMIND coupling reads data in US$2017, not US$2005 - **config** updated input data to rev4.114 - **config** SHAPE scenarios start year of dietary shift changed to 2025 -- **28_ageclass_** number of age-classes doubled from 150 to 300 years for better match of growth curves with potential natural vegetation. +- **core** number of age-classes doubled from 150 to 300 years for better match of growth curves with potential natural vegetation. - **35_natveg_** revised age-class initialization of secondary forest ### added From 9a09d4c53b868d04a202d50752de603fbe424ec2 Mon Sep 17 00:00:00 2001 From: florianh Date: Sun, 27 Oct 2024 16:18:43 +0100 Subject: [PATCH 082/206] changelog --- CHANGELOG.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 0117b1e9cb..c64cffcb32 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -13,7 +13,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). - **config** updated input data to rev4.114 - **config** SHAPE scenarios start year of dietary shift changed to 2025 - **core** number of age-classes doubled from 150 to 300 years for better match of growth curves with potential natural vegetation. -- **35_natveg_** revised age-class initialization of secondary forest +- **35_natveg** revised age-class initialization of secondary forest ### added - **62_material** added switch to turn off future material demand for bioplastic @@ -26,7 +26,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). - **11_costs** changed equation to fix bug in total water cost calculation - **29_cropland** treecover age-class growth was not working properly because ac_sub was erroneously not fixed - **scripts** script/output/extra/resubmit.R -- **28_ageclass_** bugfix input data unit and code clean-up. Renamed `feb21` realization to `oct24` +- **28_ageclass** bugfix input data unit and code clean-up. Renamed `feb21` realization to `oct24` ## [4.8.2] - 2024-09-24 From 91b5c6e9f3944e7b74a1076242cb4037c2ad34e6 Mon Sep 17 00:00:00 2001 From: florianh Date: Sun, 27 Oct 2024 18:19:24 +0100 Subject: [PATCH 083/206] update --- modules/35_natveg/pot_forest_may24/preloop.gms | 1 - 1 file changed, 1 deletion(-) diff --git a/modules/35_natveg/pot_forest_may24/preloop.gms b/modules/35_natveg/pot_forest_may24/preloop.gms index 8c422db456..bad3110864 100644 --- a/modules/35_natveg/pot_forest_may24/preloop.gms +++ b/modules/35_natveg/pot_forest_may24/preloop.gms @@ -18,7 +18,6 @@ elseif s35_secdf_distribution = 1, elseif s35_secdf_distribution = 2, *For the initialization of age-classes in secondary forest, forest area in 5-year age-classes based on GFAD is used p35_secdf_ageclass(j,ac) = im_forest_ageclass(j,ac); -* p35_secdf_ageclass(j,ac_young)$(p35_secdf_ageclass(j,ac_young) > p35_secdf_ageclass(j,"ac35")) = p35_secdf_ageclass(j,"ac35"); * Young forest (`ac_young`) includes plantations and might be (strongly) affected by disturbances such as fire. * Therefore, young forest (`ac_young`) is disregarded for the initialization of age-classes in secondary forest. * Instead, age-class areas from `ac35` are used as a proxy for `ac_young`. From e826a09834ffaf2e7df4e158c37b7d06d31b2bd1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Florian=20Humpen=C3=B6der?= Date: Mon, 28 Oct 2024 23:21:38 +0100 Subject: [PATCH 084/206] Update modules/28_ageclass/oct24/preloop.gms Co-authored-by: Pascal Sauer <156898545+pascal-sauer@users.noreply.github.com> --- modules/28_ageclass/oct24/preloop.gms | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/28_ageclass/oct24/preloop.gms b/modules/28_ageclass/oct24/preloop.gms index 000994c174..b077389274 100644 --- a/modules/28_ageclass/oct24/preloop.gms +++ b/modules/28_ageclass/oct24/preloop.gms @@ -6,7 +6,7 @@ *** | Contact: magpie@pik-potsdam.de * Two age-classes in `ac` are mapped to one age-class in `ac_gfad`. -* Therefore, each age-class in `ac_gfad` is distributed equally to all beloning age-classes in `ac`. +* Therefore, each age-class in `ac_gfad` is distributed equally to all belonging age-classes in `ac`. im_forest_ageclass(j,ac) = 0; im_forest_ageclass(j,ac) = sum(ac_gfad_to_ac(ac_gfad,ac),f28_forestageclasses(j,ac_gfad)) / 2; * `class15` in GFAD1.1 includes forests that are 150 years or older, also including primary forest. From a9f2de7112d05219ebba1eac4310ae66afa21c47 Mon Sep 17 00:00:00 2001 From: pvjeetze Date: Tue, 29 Oct 2024 11:12:43 +0100 Subject: [PATCH 085/206] peatland considered during disaggregation --- scripts/output/extra/disaggregation.R | 96 +++++++++++++++------------ 1 file changed, 53 insertions(+), 43 deletions(-) diff --git a/scripts/output/extra/disaggregation.R b/scripts/output/extra/disaggregation.R index e4e963989e..2c6608bc25 100644 --- a/scripts/output/extra/disaggregation.R +++ b/scripts/output/extra/disaggregation.R @@ -87,7 +87,8 @@ if (length(map_file) > 1) { } .dissagLandConsv <- function(gdx, cfg, map_file, wdpa_hr_file, consv_prio_hr_file) { - land_consv_lr <- readGDX(gdx, "p22_conservation_area", react = "silent") + land_consv_lr <- readGDX(gdx, "pm_land_conservation", react = "silent") + land_consv_lr <- dimSums(land_consv_lr, dim=3.2) wdpa_hr <- read.magpie(wdpa_hr_file) map <- readRDS(map_file) @@ -275,6 +276,8 @@ if (cfg$gms$urban == "exo_nov21") { # Prepare land conservation data # ---------------------------------------- +message("Disaggregating conservation land") + land_consv_hr <- NULL if (file.exists(wdpa_hr_file)) { land_consv_hr <- .dissagLandConsv(gdx, cfg, map_file, wdpa_hr_file, consv_prio_hr_file) @@ -300,6 +303,30 @@ avl_cropland_hr <- file.path(outputdir, "avl_cropland_0.5.mz") # available cropl marginal_land <- cfg$gms$c29_marginal_land # marginal land scenario snv_pol_fader <- readGDX(gdx, "i29_snv_scenario_fader") + +# -------------------------------- +# Disaggregate peatland +# -------------------------------- + +message("Disaggregating peatland") + +# check for peatland version +if (cfg$gms$peatland == "v2") { + peat_lr <- PeatlandArea(gdx, level = "cell", sum = FALSE) + peat_ini_hr <- read.magpie(peatland_v2_hr_file) + peat_ini_hr <- add_columns(peat_ini_hr, addnm = "rewetted", dim = "d3", fill = 0) + peat_ini_hr <- add_columns(peat_ini_hr, addnm = "unused", dim = "d3", fill = 0) + peat_hr <- suppressWarnings(luscale::interpolate2(peat_lr, peat_ini_hr, map_file)) + peat_hr <- peat_hr[, getYears(peat_hr, as.integer = T) >= cfg$gms$s58_fix_peatland, ] +} else if (cfg$gms$peatland == "on") { + peat_lr <- PeatlandArea(gdx, level = "cell", sum = TRUE) + peat_ini_hr <- mbind(setNames(read.magpie(peatland_on_intact_hr_file), "intact"), setNames(read.magpie(peatland_on_degrad_hr_file), "degrad")) + peat_ini_hr <- add_columns(peat_ini_hr, addnm = "rewet", dim = "d3", fill = 0) + peat_hr <- suppressWarnings(luscale::interpolate2(peat_lr, peat_ini_hr, map_file)) + peat_hr <- peat_hr[, getYears(peat_hr, as.integer = T) >= cfg$gms$s58_fix_peatland, ] +} +peat_hr <- .fixCoords(peat_hr) + # ============================================ # Start disaggregation # ============================================ @@ -319,6 +346,7 @@ land_hr <- interpolateAvlCroplandWeighted( marginal_land = marginal_land, urban_land_hr = urban_land_hr, land_consv_hr = land_consv_hr, + peat_hr = peat_hr, snv_pol_shr = snv_pol_shr, snv_pol_fader = snv_pol_fader ) @@ -335,6 +363,30 @@ land_hr <- .fixCoords(land_hr) ) gc() +# ----------------------------------- +# Create peatland outputs +# ----------------------------------- + +# Write output +.writeDisagg(peat_hr, peatland_hr_out_file, + comment = "unit: Mha per grid-cell", + message = "Write outputs peatland Mha" +) +gc() + +out <- peat_hr / dimSums(land_hr[, getYears(peat_hr), ], dim = 3) +out[is.nan(out)] <- 0 +out[is.infinite(out)] <- 0 + +rm(land_hr, peat_hr) + +.writeDisagg(out, peatland_hr_share_out_file, + comment = "unit: grid-cell land area fraction", + message = "Write outputs peatland share" +) +gc() + + # --------------------------------- # Split land pools # --------------------------------- @@ -532,46 +584,4 @@ rm(bii_hr) gc() -# -------------------------------- -# Disaggregate peatland -# -------------------------------- - -message("Disaggregating peatland") - -# check for peatland version -if (cfg$gms$peatland == "v2") { - peat_lr <- PeatlandArea(gdx, level = "cell", sum = FALSE) - peat_ini_hr <- read.magpie(peatland_v2_hr_file) - peat_ini_hr <- add_columns(peat_ini_hr, addnm = "rewetted", dim = "d3", fill = 0) - peat_ini_hr <- add_columns(peat_ini_hr, addnm = "unused", dim = "d3", fill = 0) - peat_hr <- suppressWarnings(luscale::interpolate2(peat_lr, peat_ini_hr, map_file)) - peat_hr <- peat_hr[, getYears(peat_hr, as.integer = T) >= cfg$gms$s58_fix_peatland, ] -} else if (cfg$gms$peatland == "on") { - peat_lr <- PeatlandArea(gdx, level = "cell", sum = TRUE) - peat_ini_hr <- mbind(setNames(read.magpie(peatland_on_intact_hr_file), "intact"), setNames(read.magpie(peatland_on_degrad_hr_file), "degrad")) - peat_ini_hr <- add_columns(peat_ini_hr, addnm = "rewet", dim = "d3", fill = 0) - peat_hr <- suppressWarnings(luscale::interpolate2(peat_lr, peat_ini_hr, map_file)) - peat_hr <- peat_hr[, getYears(peat_hr, as.integer = T) >= cfg$gms$s58_fix_peatland, ] -} -peat_hr <- .fixCoords(peat_hr) - -# Write output -.writeDisagg(peat_hr, peatland_hr_out_file, - comment = "unit: Mha per grid-cell", - message = "Write outputs peatland Mha" -) -gc() - -out <- peat_hr / dimSums(land_hr[, getYears(peat_hr), ], dim = 3) -out[is.nan(out)] <- 0 -out[is.infinite(out)] <- 0 - -rm(land_hr, peat_hr) - -.writeDisagg(out, peatland_hr_share_out_file, - comment = "unit: grid-cell land area fraction", - message = "Write outputs peatland share" -) -gc() - message("Finished disaggregation") From 12c7df64441607a587631ebc74144626a5596cc5 Mon Sep 17 00:00:00 2001 From: pvjeetze Date: Tue, 29 Oct 2024 11:22:17 +0100 Subject: [PATCH 086/206] changelog --- CHANGELOG.md | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 7a648c02d8..2ad2663b8e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -12,6 +12,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). - **scripts** REMIND coupling reads data in US$2017, not US$2005 - **config** updated input data to rev4.113 - **config** SHAPE scenarios start year of dietary shift changed to 2025 +- **extra/disaggregation** Peatland now considered in disaggregation of land pools ### added - **62_material** added switch to turn off future material demand for bioplastic @@ -21,9 +22,9 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). - ### fixed -- **11_costs** changed equation to fix bug in total water cost calculation -- **29_cropland** treecover age-class growth was not working properly because ac_sub was erroneously not fixed -- **scripts** script/output/extra/resubmit.R +- **11_costs** changed equation to fix bug in total water cost calculation +- **29_cropland** treecover age-class growth was not working properly because ac_sub was erroneously not fixed +- **scripts** script/output/extra/resubmit.R ## [4.8.2] - 2024-09-24 From 091622c7a3fe0b6ffc8365ee8932229afa5b450b Mon Sep 17 00:00:00 2001 From: Debbora Leip Date: Tue, 29 Oct 2024 11:33:38 +0100 Subject: [PATCH 087/206] update of usda cost shares --- .../36_employment/exo_may22/declarations.gms | 2 -- modules/36_employment/exo_may22/input.gms | 16 ---------------- modules/36_employment/exo_may22/input/files | 4 +--- modules/36_employment/exo_may22/presolve.gms | 10 +--------- modules/38_factor_costs/input/files | 5 +++-- .../per_ton_fao_may22/declarations.gms | 7 ++++--- .../per_ton_fao_may22/equations.gms | 4 ++-- .../per_ton_fao_may22/input.gms | 10 ++++++++-- .../per_ton_fao_may22/preloop.gms | 18 ++++++++++++++++++ .../per_ton_fao_may22/presolve.gms | 11 ----------- .../per_ton_fao_may22/realization.gms | 1 + .../sticky_feb18/declarations.gms | 5 +++-- modules/38_factor_costs/sticky_feb18/input.gms | 10 ++++++++-- .../38_factor_costs/sticky_feb18/input/files | 3 ++- .../38_factor_costs/sticky_feb18/preloop.gms | 18 ++++++++++++++++++ .../38_factor_costs/sticky_feb18/presolve.gms | 17 +++-------------- .../sticky_feb18/realization.gms | 1 + .../sticky_labor/declarations.gms | 7 ++++--- modules/38_factor_costs/sticky_labor/input.gms | 10 ++++++++-- .../38_factor_costs/sticky_labor/input/files | 3 ++- .../38_factor_costs/sticky_labor/preloop.gms | 14 +++++++++----- .../38_factor_costs/sticky_labor/presolve.gms | 16 ++++++++-------- modules/57_maccs/on_aug22/equations.gms | 4 ++-- .../70_livestock/fbask_jan16/declarations.gms | 2 -- modules/70_livestock/fbask_jan16/equations.gms | 4 ++-- modules/70_livestock/fbask_jan16/input.gms | 14 -------------- modules/70_livestock/fbask_jan16/input/files | 2 -- modules/70_livestock/fbask_jan16/presolve.gms | 10 ---------- .../fbask_jan16_sticky/declarations.gms | 2 -- .../fbask_jan16_sticky/equations.gms | 2 +- .../70_livestock/fbask_jan16_sticky/input.gms | 14 -------------- .../fbask_jan16_sticky/input/files | 2 -- .../fbask_jan16_sticky/presolve.gms | 13 +------------ 33 files changed, 110 insertions(+), 151 deletions(-) create mode 100644 modules/38_factor_costs/per_ton_fao_may22/preloop.gms create mode 100644 modules/38_factor_costs/sticky_feb18/preloop.gms diff --git a/modules/36_employment/exo_may22/declarations.gms b/modules/36_employment/exo_may22/declarations.gms index 60bc8d96f1..1e1c3b74ae 100644 --- a/modules/36_employment/exo_may22/declarations.gms +++ b/modules/36_employment/exo_may22/declarations.gms @@ -23,8 +23,6 @@ parameters pm_productivity_gain_from_wages(t,i) Multiplicative factor describing productivity gain related to higher wages (1) p36_total_hours_worked(iso) Total hours worked by all employed people (mio. hours per year) p36_calibration_hourly_costs(iso) Additive calibration term for hourly labor costs (USD17MER per hour) - p36_cost_share(t,i) Capital share of factor costs (1) - p36_share_calibration(i) Additive calibration term for capital shares (1) p36_nonmagpie_labor_costs(t,i) Labor costs from subsidies and Value of Production not covered by MAgPIE (mio. USD17MER) ; diff --git a/modules/36_employment/exo_may22/input.gms b/modules/36_employment/exo_may22/input.gms index 994887e337..cc33cd77bc 100644 --- a/modules/36_employment/exo_may22/input.gms +++ b/modules/36_employment/exo_may22/input.gms @@ -54,19 +54,3 @@ $ondelim $include "./modules/36_employment/exo_may22/input/f36_nonmagpie_factor_costs.csv" $offdelim ; - -parameter f36_regr_cap_share(reg36) Parameters for dynamic regression -/ -$ondelim -$include "./modules/36_employment/exo_may22/input/f36_regression_cap_share.csv" -$offdelim -/ -; - -table f36_hist_cap_share(t_all,i) Historical capital share -$ondelim -$include "./modules/36_employment/exo_may22/input/f36_historical_share.csv" -$offdelim -; - - diff --git a/modules/36_employment/exo_may22/input/files b/modules/36_employment/exo_may22/input/files index d7ddcb6ef8..4509b91c06 100644 --- a/modules/36_employment/exo_may22/input/files +++ b/modules/36_employment/exo_may22/input/files @@ -5,6 +5,4 @@ f36_historic_hourly_labor_costs.csv f36_regression_hourly_labor_costs.csv f36_historic_ag_employment.csv f36_unspecified_subsidies.csv -f36_nonmagpie_factor_costs.csv -f36_regression_cap_share.csv -f36_historical_share.csv +f36_nonmagpie_factor_costs.csv \ No newline at end of file diff --git a/modules/36_employment/exo_may22/presolve.gms b/modules/36_employment/exo_may22/presolve.gms index fc00b55a6d..f75f0f56ff 100644 --- a/modules/36_employment/exo_may22/presolve.gms +++ b/modules/36_employment/exo_may22/presolve.gms @@ -5,14 +5,6 @@ *** | MAgPIE License Exception, version 1.0 (see LICENSE file). *** | Contact: magpie@pik-potsdam.de -* capital cost share to split non-magpie factor costs into labor and capital -p36_share_calibration(i) = f36_hist_cap_share("y2010",i)-(f36_regr_cap_share("slope")*log10(sum(i_to_iso(i,iso),(im_gdp_pc_ppp_iso("y2010",iso) * fm_gdp_defl_ppp(iso))))+f36_regr_cap_share("intercept")); - -if (m_year(t)<2010, - p36_cost_share(t,i) = f36_hist_cap_share(t,i); -elseif (m_year(t)>=2010), - p36_cost_share(t,i) = f36_regr_cap_share("slope")*log10(sum(i_to_iso(i,iso),(im_gdp_pc_ppp_iso(t,iso) * fm_gdp_defl_ppp(iso))))+f36_regr_cap_share("intercept")+p36_share_calibration(i); -); *' @code @@ -21,7 +13,7 @@ elseif (m_year(t)>=2010), *' are both kept constant for future years. p36_nonmagpie_labor_costs(t,i) = (f36_unspecified_subsidies(t,i) + f36_nonmagpie_factor_costs(t,i)) * - (1-p36_cost_share(t,i)) * (1/pm_productivity_gain_from_wages(t,i)) * + (pm_factor_cost_shares(t,i,"labor")) * (1/pm_productivity_gain_from_wages(t,i)) * (pm_hourly_costs(t,i,"scenario") / pm_hourly_costs(t,i,"baseline")); *' @stop diff --git a/modules/38_factor_costs/input/files b/modules/38_factor_costs/input/files index cc31093237..1f2dd5d67d 100644 --- a/modules/38_factor_costs/input/files +++ b/modules/38_factor_costs/input/files @@ -1,5 +1,6 @@ * list of files that are required here -f38_historical_share.csv +f38_historical_share_iso.csv f38_regression_cap_share.csv f38_fac_req_fao.csv -f38_fac_req_fao_regional.cs4 \ No newline at end of file +f38_fac_req_fao_regional.cs4 +f38_hist_factor_costs_iso.csv \ No newline at end of file diff --git a/modules/38_factor_costs/per_ton_fao_may22/declarations.gms b/modules/38_factor_costs/per_ton_fao_may22/declarations.gms index 29f31dba80..ca250d3df4 100644 --- a/modules/38_factor_costs/per_ton_fao_may22/declarations.gms +++ b/modules/38_factor_costs/per_ton_fao_may22/declarations.gms @@ -15,9 +15,10 @@ vm_cost_prod_crop(i,factors) Regional factor costs of capital and labor for ; parameter -pm_cost_share_crops(t,i,factors) Capital and labor shares of the regional factor costs for crop production (1) -p38_share_calibration(i) Summation factor used to calibrate calculated capital shares with historical values (1) -i38_fac_req(t_all,i,kcr) Factor requirements (USD17MER per tDM) +p38_capital_cost_shares_iso(t,iso) Capital shares of factor costs on iso level (1) +p38_share_calibration(iso) Summation factor used to calibrate calculated capital shares with historical values (1) +pm_factor_cost_shares(t,i,factors) Capital and labor shares of factor costs on regional level (1) +i38_fac_req(t_all,i,kcr) Factor requirements (USD17MER per tDM) ; *#################### R SECTION START (OUTPUT DECLARATIONS) #################### diff --git a/modules/38_factor_costs/per_ton_fao_may22/equations.gms b/modules/38_factor_costs/per_ton_fao_may22/equations.gms index 94d8bacc07..a42e33dabd 100644 --- a/modules/38_factor_costs/per_ton_fao_may22/equations.gms +++ b/modules/38_factor_costs/per_ton_fao_may22/equations.gms @@ -9,12 +9,12 @@ q38_cost_prod_crop_labor(i2) .. vm_cost_prod_crop(i2,"labor") =e= sum(kcr, vm_prod_reg(i2,kcr) * sum(ct,i38_fac_req(ct,i2,kcr))) * - sum(ct,pm_cost_share_crops(ct,i2,"labor") * (1/pm_productivity_gain_from_wages(ct,i2)) * + sum(ct,pm_factor_cost_shares(ct,i2,"labor") * (1/pm_productivity_gain_from_wages(ct,i2)) * (pm_hourly_costs(ct,i2,"scenario") / pm_hourly_costs(ct,i2,"baseline"))); q38_cost_prod_crop_capital(i2) .. vm_cost_prod_crop(i2,"capital") =e= sum(kcr, vm_prod_reg(i2,kcr) * sum(ct,i38_fac_req(ct,i2,kcr))) * - sum(ct,pm_cost_share_crops(ct,i2,"capital")); + sum(ct,pm_factor_cost_shares(ct,i2,"capital")); *' The factor costs for crops `vm_cost_prod_crop` are calculated as product of *' production quantity `vm_prod_reg` and crop-specific factor requirements diff --git a/modules/38_factor_costs/per_ton_fao_may22/input.gms b/modules/38_factor_costs/per_ton_fao_may22/input.gms index f04303aa89..203a30213f 100644 --- a/modules/38_factor_costs/per_ton_fao_may22/input.gms +++ b/modules/38_factor_costs/per_ton_fao_may22/input.gms @@ -33,8 +33,14 @@ $offdelim / ; -table f38_historical_share(t_all,i) Historical capital share +table f38_historical_share(t_all,iso) Historical capital share $ondelim -$include "./modules/38_factor_costs/input/f38_historical_share.csv" +$include "./modules/38_factor_costs/input/f38_historical_share_iso.csv" +$offdelim +; + +table f38_hist_factor_costs(t_all,iso) Historical factor costs for crop and livestock (mio USD17MER) +$ondelim +$include "./modules/38_factor_costs/input/f38_hist_factor_costs_iso.csv" $offdelim ; diff --git a/modules/38_factor_costs/per_ton_fao_may22/preloop.gms b/modules/38_factor_costs/per_ton_fao_may22/preloop.gms new file mode 100644 index 0000000000..14d00c3de0 --- /dev/null +++ b/modules/38_factor_costs/per_ton_fao_may22/preloop.gms @@ -0,0 +1,18 @@ +*** | (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 + +* calculate capital cost shares from regression +p38_share_calibration(iso) = f38_historical_share("y2010",iso) - (f38_reg_parameters("slope") * + log10(im_gdp_pc_ppp_iso("y2010",iso)) + f38_reg_parameters("intercept")); + +p38_capital_cost_shares_iso(t,iso)$(m_year(t)<2010) = f38_historical_share(t,iso); +p38_capital_cost_shares_iso(t,iso)$(m_year(t)>=2010) = f38_reg_parameters("slope") * log10(im_gdp_pc_ppp_iso(t,iso)) + f38_reg_parameters("intercept") + p38_share_calibration(iso); + +* aggregate factor cost shares +pm_factor_cost_shares(t,i,"capital") = (1/sum(i_to_iso(i,iso), f38_hist_factor_costs(t,iso))) * + sum(i_to_iso(i,iso), f38_hist_factor_costs(t,iso) * p38_capital_cost_shares_iso(t,iso)); +pm_factor_cost_shares(t,i,"labor") = 1 - pm_factor_cost_shares(t,i,"capital"); \ No newline at end of file diff --git a/modules/38_factor_costs/per_ton_fao_may22/presolve.gms b/modules/38_factor_costs/per_ton_fao_may22/presolve.gms index 58300986ba..67923af624 100644 --- a/modules/38_factor_costs/per_ton_fao_may22/presolve.gms +++ b/modules/38_factor_costs/per_ton_fao_may22/presolve.gms @@ -20,14 +20,3 @@ elseif m_year(t)>=2010, else i38_fac_req(t,i,kcr) = i38_fac_req(t,i,kcr); ); - -p38_share_calibration(i) = f38_historical_share("y2010",i)-(f38_reg_parameters("slope")*log10(sum(i_to_iso(i,iso),(im_gdp_pc_ppp_iso("y2010",iso) * fm_gdp_defl_ppp(iso))))+f38_reg_parameters("intercept")); - -if (m_year(t)<2010, - pm_cost_share_crops(t,i,"capital") = f38_historical_share(t,i); - pm_cost_share_crops(t,i,"labor") = 1 - f38_historical_share(t,i); - -elseif (m_year(t)>=2010), - pm_cost_share_crops(t,i,"capital") = f38_reg_parameters("slope")*log10(sum(i_to_iso(i,iso),(im_gdp_pc_ppp_iso(t,iso) * fm_gdp_defl_ppp(iso))))+f38_reg_parameters("intercept")+p38_share_calibration(i); - pm_cost_share_crops(t,i,"labor") = 1 - pm_cost_share_crops(t,i,"capital"); -); diff --git a/modules/38_factor_costs/per_ton_fao_may22/realization.gms b/modules/38_factor_costs/per_ton_fao_may22/realization.gms index 44dfd75df6..81c5f87e5d 100644 --- a/modules/38_factor_costs/per_ton_fao_may22/realization.gms +++ b/modules/38_factor_costs/per_ton_fao_may22/realization.gms @@ -24,6 +24,7 @@ $Ifi "%phase%" == "declarations" $include "./modules/38_factor_costs/per_ton_fao $Ifi "%phase%" == "input" $include "./modules/38_factor_costs/per_ton_fao_may22/input.gms" $Ifi "%phase%" == "equations" $include "./modules/38_factor_costs/per_ton_fao_may22/equations.gms" $Ifi "%phase%" == "scaling" $include "./modules/38_factor_costs/per_ton_fao_may22/scaling.gms" +$Ifi "%phase%" == "preloop" $include "./modules/38_factor_costs/per_ton_fao_may22/preloop.gms" $Ifi "%phase%" == "presolve" $include "./modules/38_factor_costs/per_ton_fao_may22/presolve.gms" $Ifi "%phase%" == "postsolve" $include "./modules/38_factor_costs/per_ton_fao_may22/postsolve.gms" *######################## R SECTION END (PHASES) ############################### diff --git a/modules/38_factor_costs/sticky_feb18/declarations.gms b/modules/38_factor_costs/sticky_feb18/declarations.gms index 744328c67d..b572876760 100644 --- a/modules/38_factor_costs/sticky_feb18/declarations.gms +++ b/modules/38_factor_costs/sticky_feb18/declarations.gms @@ -24,8 +24,9 @@ parameters p38_capital_immobile(t,j,kcr) Preexisting immobile capital stocks before investment (mio USD17MER) p38_capital_mobile(t,j) Preexisting mobile capital stocks before investment (mio USD17MER) - pm_cost_share_crops(t,i,factors) Capital and labor shares of the regional factor costs for crop production (1) - p38_share_calibration(i) Summation factor used to calibrate calculated capital shares with historical values (1) + p38_capital_cost_shares_iso(t,iso) Capital shares of factor costs on iso level (1) + p38_share_calibration(iso) Summation factor used to calibrate calculated capital shares with historical values (1) + pm_factor_cost_shares(t,i,factors) Capital and labor shares of factor costs on regional level (1) p38_croparea_start(j,w,kcr) Agricultural land initialization area (mio. ha) diff --git a/modules/38_factor_costs/sticky_feb18/input.gms b/modules/38_factor_costs/sticky_feb18/input.gms index 73d26f6d04..a186255029 100644 --- a/modules/38_factor_costs/sticky_feb18/input.gms +++ b/modules/38_factor_costs/sticky_feb18/input.gms @@ -39,8 +39,14 @@ $offdelim / ; -table f38_historical_share(t_all,i) Historical capital share +table f38_historical_share(t_all,iso) Historical capital share $ondelim -$include "./modules/38_factor_costs/input/f38_historical_share.csv" +$include "./modules/38_factor_costs/input/f38_historical_share_iso.csv" +$offdelim +; + +table f38_hist_factor_costs(t_all,iso) Historical factor costs for crop and livestock (mio USD17MER) +$ondelim +$include "./modules/38_factor_costs/input/f38_hist_factor_costs_iso.csv" $offdelim ; diff --git a/modules/38_factor_costs/sticky_feb18/input/files b/modules/38_factor_costs/sticky_feb18/input/files index f427961d4b..55e0b4bc59 100644 --- a/modules/38_factor_costs/sticky_feb18/input/files +++ b/modules/38_factor_costs/sticky_feb18/input/files @@ -1,5 +1,6 @@ * list of files that are required here f38_region_yield.csv -f38_historical_share.csv +f38_historical_share_iso.csv f38_regression_cap_share.csv f38_fac_req_fao.csv +f38_hist_factor_costs_iso.csv \ No newline at end of file diff --git a/modules/38_factor_costs/sticky_feb18/preloop.gms b/modules/38_factor_costs/sticky_feb18/preloop.gms new file mode 100644 index 0000000000..14d00c3de0 --- /dev/null +++ b/modules/38_factor_costs/sticky_feb18/preloop.gms @@ -0,0 +1,18 @@ +*** | (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 + +* calculate capital cost shares from regression +p38_share_calibration(iso) = f38_historical_share("y2010",iso) - (f38_reg_parameters("slope") * + log10(im_gdp_pc_ppp_iso("y2010",iso)) + f38_reg_parameters("intercept")); + +p38_capital_cost_shares_iso(t,iso)$(m_year(t)<2010) = f38_historical_share(t,iso); +p38_capital_cost_shares_iso(t,iso)$(m_year(t)>=2010) = f38_reg_parameters("slope") * log10(im_gdp_pc_ppp_iso(t,iso)) + f38_reg_parameters("intercept") + p38_share_calibration(iso); + +* aggregate factor cost shares +pm_factor_cost_shares(t,i,"capital") = (1/sum(i_to_iso(i,iso), f38_hist_factor_costs(t,iso))) * + sum(i_to_iso(i,iso), f38_hist_factor_costs(t,iso) * p38_capital_cost_shares_iso(t,iso)); +pm_factor_cost_shares(t,i,"labor") = 1 - pm_factor_cost_shares(t,i,"capital"); \ No newline at end of file diff --git a/modules/38_factor_costs/sticky_feb18/presolve.gms b/modules/38_factor_costs/sticky_feb18/presolve.gms index c770b89f7a..0691f0e9ad 100644 --- a/modules/38_factor_costs/sticky_feb18/presolve.gms +++ b/modules/38_factor_costs/sticky_feb18/presolve.gms @@ -9,17 +9,6 @@ if (smax(j, pm_labor_prod(t,j)) <> 1 OR smin(j, pm_labor_prod(t,j)) <> 1, abort "This factor cost realization cannot handle labor productivities != 1" ); -p38_share_calibration(i) = f38_historical_share("y2010",i)-(f38_reg_parameters("slope")*log10(sum(i_to_iso(i,iso),(im_gdp_pc_ppp_iso("y2010",iso) * fm_gdp_defl_ppp(iso))))+f38_reg_parameters("intercept")); - -if (m_year(t)<2010, - pm_cost_share_crops(t,i,"capital") = f38_historical_share(t,i); - pm_cost_share_crops(t,i,"labor") = 1 - f38_historical_share(t,i); - -elseif (m_year(t)>=2010), - pm_cost_share_crops(t,i,"capital") = f38_reg_parameters("slope")*log10(sum(i_to_iso(i,iso),(im_gdp_pc_ppp_iso(t,iso) * fm_gdp_defl_ppp(iso))))+f38_reg_parameters("intercept")+p38_share_calibration(i); - pm_cost_share_crops(t,i,"labor") = 1 - pm_cost_share_crops(t,i,"capital"); -); - * choosing between regional (+time dependent) or global (from 2005) factor requirements $if "%c38_fac_req%" == "glo" i38_fac_req(t,i,kcr) = f38_fac_req(kcr); $if "%c38_fac_req%" == "reg" i38_fac_req(t,i,kcr) = f38_fac_req_fao_reg(t,i,kcr); @@ -32,9 +21,9 @@ else i38_fac_req(t,i,kcr) = i38_fac_req(t,i,kcr); ); -p38_labor_need(t,i,kcr) = i38_fac_req(t,i,kcr) * pm_cost_share_crops(t,i,"labor"); -p38_capital_need(t,i,kcr,"mobile") = i38_fac_req(t,i,kcr) * pm_cost_share_crops(t,i,"capital") / (pm_interest(t,i)+s38_depreciation_rate) * (1-s38_immobile); -p38_capital_need(t,i,kcr,"immobile") = i38_fac_req(t,i,kcr) * pm_cost_share_crops(t,i,"capital") / (pm_interest(t,i)+s38_depreciation_rate) * s38_immobile; +p38_labor_need(t,i,kcr) = i38_fac_req(t,i,kcr) * pm_factor_cost_shares(t,i,"labor"); +p38_capital_need(t,i,kcr,"mobile") = i38_fac_req(t,i,kcr) * pm_factor_cost_shares(t,i,"capital") / (pm_interest(t,i)+s38_depreciation_rate) * (1-s38_immobile); +p38_capital_need(t,i,kcr,"immobile") = i38_fac_req(t,i,kcr) * pm_factor_cost_shares(t,i,"capital") / (pm_interest(t,i)+s38_depreciation_rate) * s38_immobile; if (ord(t) = 1, diff --git a/modules/38_factor_costs/sticky_feb18/realization.gms b/modules/38_factor_costs/sticky_feb18/realization.gms index 6317ee59a6..3070759e8e 100644 --- a/modules/38_factor_costs/sticky_feb18/realization.gms +++ b/modules/38_factor_costs/sticky_feb18/realization.gms @@ -24,6 +24,7 @@ $Ifi "%phase%" == "declarations" $include "./modules/38_factor_costs/sticky_feb1 $Ifi "%phase%" == "input" $include "./modules/38_factor_costs/sticky_feb18/input.gms" $Ifi "%phase%" == "equations" $include "./modules/38_factor_costs/sticky_feb18/equations.gms" $Ifi "%phase%" == "scaling" $include "./modules/38_factor_costs/sticky_feb18/scaling.gms" +$Ifi "%phase%" == "preloop" $include "./modules/38_factor_costs/sticky_feb18/preloop.gms" $Ifi "%phase%" == "presolve" $include "./modules/38_factor_costs/sticky_feb18/presolve.gms" $Ifi "%phase%" == "postsolve" $include "./modules/38_factor_costs/sticky_feb18/postsolve.gms" *######################## R SECTION END (PHASES) ############################### diff --git a/modules/38_factor_costs/sticky_labor/declarations.gms b/modules/38_factor_costs/sticky_labor/declarations.gms index 3d926064b4..e0c52e4039 100644 --- a/modules/38_factor_costs/sticky_labor/declarations.gms +++ b/modules/38_factor_costs/sticky_labor/declarations.gms @@ -29,8 +29,9 @@ parameters p38_capital_immobile(t,j,kcr) Preexisting immobile capital stocks before investment (mio USD17MER) p38_capital_mobile(t,j) Preexisting mobile capital stocks before investment (mio USD17MER) - pm_cost_share_crops(t,i,factors) Capital and labor shares of the regional factor costs for crop production (1) - p38_share_calibration(i) Summation factor used to calibrate calculated capital shares with historical values (1) + p38_capital_cost_shares_iso(t,iso) Capital shares of factor costs on iso level (1) + p38_share_calibration(iso) Summation factor used to calibrate calculated capital shares with historical values (1) + pm_factor_cost_shares(t,i,factors) Capital and labor shares of factor costs on regional level (1) p38_min_labor_share(t,j) Minimum labor share out of labor plus capital needed (1) p38_croparea_start(j,w,kcr) Agricultural land initialization area (mio. ha) @@ -54,7 +55,7 @@ parameters ov38_investment_mobile(t,j,type) Investment costs in mobile farm capital (mio USD17MER per yr) ov38_laborhours_need(t,j,kcr,type) Labor required per unit of output (hours per ton DM) ov38_capital_need(t,j,kcr,mobil38,type) Captial required per unit of output (USD17MER per ton DM) - ov38_relax_CES_lp(t,j,kcr,type) Variable to make CES function feasible in linearized model (1) + ov38_relax_CES_lp(t,j,kcr,type) Variable to make CES function feasible in linearized model (1) oq38_cost_prod_labor(t,i,type) Regional labor input costs for crop production (mio USD17MER) oq38_cost_prod_capital(t,i,type) Regional capital input costs for crop production (mio USD17MER) oq38_investment_immobile(t,j,kcr,type) Cellular immobile investments into farm capital (mio USD17MER) diff --git a/modules/38_factor_costs/sticky_labor/input.gms b/modules/38_factor_costs/sticky_labor/input.gms index 0e96a2a567..1caf2e0472 100644 --- a/modules/38_factor_costs/sticky_labor/input.gms +++ b/modules/38_factor_costs/sticky_labor/input.gms @@ -44,8 +44,14 @@ $offdelim / ; -table f38_historical_share(t_all,i) Historical capital share +table f38_historical_share(t_all,iso) Historical capital share $ondelim -$include "./modules/38_factor_costs/input/f38_historical_share.csv" +$include "./modules/38_factor_costs/input/f38_historical_share_iso.csv" +$offdelim +; + +table f38_hist_factor_costs(t_all,iso) Historical factor costs for crop and livestock (mio USD17MER) +$ondelim +$include "./modules/38_factor_costs/input/f38_hist_factor_costs_iso.csv" $offdelim ; diff --git a/modules/38_factor_costs/sticky_labor/input/files b/modules/38_factor_costs/sticky_labor/input/files index f427961d4b..55e0b4bc59 100644 --- a/modules/38_factor_costs/sticky_labor/input/files +++ b/modules/38_factor_costs/sticky_labor/input/files @@ -1,5 +1,6 @@ * list of files that are required here f38_region_yield.csv -f38_historical_share.csv +f38_historical_share_iso.csv f38_regression_cap_share.csv f38_fac_req_fao.csv +f38_hist_factor_costs_iso.csv \ No newline at end of file diff --git a/modules/38_factor_costs/sticky_labor/preloop.gms b/modules/38_factor_costs/sticky_labor/preloop.gms index 031692e316..3a3ea95f4d 100644 --- a/modules/38_factor_costs/sticky_labor/preloop.gms +++ b/modules/38_factor_costs/sticky_labor/preloop.gms @@ -10,10 +10,14 @@ s38_ces_elast_par = (1/s38_ces_elast_subst) - 1 ; p38_intr_depr(t,i) = (1-s38_depreciation_rate) * pm_interest(t,i)/(1+pm_interest(t,i)) + s38_depreciation_rate; -* calculate labor/capital cost shares from regression -p38_share_calibration(i) = f38_historical_share("y2010",i)-(f38_reg_parameters("slope")*log10(sum(i_to_iso(i,iso),(im_gdp_pc_ppp_iso("y2010",iso) * fm_gdp_defl_ppp(iso))))+f38_reg_parameters("intercept")); +* calculate capital cost shares from regression +p38_share_calibration(iso) = f38_historical_share("y2010",iso) - (f38_reg_parameters("slope") * + log10(im_gdp_pc_ppp_iso("y2010",iso)) + f38_reg_parameters("intercept")); -pm_cost_share_crops(t,i,"capital")$(m_year(t)<2010) = f38_historical_share(t,i); -pm_cost_share_crops(t,i,"capital")$(m_year(t)>=2010) = f38_reg_parameters("slope")*log10(sum(i_to_iso(i,iso),(im_gdp_pc_ppp_iso(t,iso) * fm_gdp_defl_ppp(iso))))+f38_reg_parameters("intercept")+p38_share_calibration(i); +p38_capital_cost_shares_iso(t,iso)$(m_year(t)<2010) = f38_historical_share(t,iso); +p38_capital_cost_shares_iso(t,iso)$(m_year(t)>=2010) = f38_reg_parameters("slope") * log10(im_gdp_pc_ppp_iso(t,iso)) + f38_reg_parameters("intercept") + p38_share_calibration(iso); -pm_cost_share_crops(t,i,"labor") = 1 - pm_cost_share_crops(t,i,"capital"); +* aggregate factor cost shares +pm_factor_cost_shares(t,i,"capital") = (1/sum(i_to_iso(i,iso), f38_hist_factor_costs(t,iso))) * + sum(i_to_iso(i,iso), f38_hist_factor_costs(t,iso) * p38_capital_cost_shares_iso(t,iso)); +pm_factor_cost_shares(t,i,"labor") = 1 - pm_factor_cost_shares(t,i,"capital"); \ No newline at end of file diff --git a/modules/38_factor_costs/sticky_labor/presolve.gms b/modules/38_factor_costs/sticky_labor/presolve.gms index df95ef82ef..9db187bfa6 100644 --- a/modules/38_factor_costs/sticky_labor/presolve.gms +++ b/modules/38_factor_costs/sticky_labor/presolve.gms @@ -17,26 +17,26 @@ else i38_fac_req(t,i,kcr) = i38_fac_req(t,i,kcr); ); -p38_labor_need(t,i,kcr) = i38_fac_req(t,i,kcr) * pm_cost_share_crops(t,i,"labor"); -p38_capital_need(t,i,kcr,"mobile") = i38_fac_req(t,i,kcr) * pm_cost_share_crops(t,i,"capital") / (pm_interest(t,i)+s38_depreciation_rate) * (1-s38_immobile); -p38_capital_need(t,i,kcr,"immobile") = i38_fac_req(t,i,kcr) * pm_cost_share_crops(t,i,"capital") / (pm_interest(t,i)+s38_depreciation_rate) * s38_immobile; +p38_labor_need(t,i,kcr) = i38_fac_req(t,i,kcr) * pm_factor_cost_shares(t,i,"labor"); +p38_capital_need(t,i,kcr,"mobile") = i38_fac_req(t,i,kcr) * pm_factor_cost_shares(t,i,"capital") / (pm_interest(t,i)+s38_depreciation_rate) * (1-s38_immobile); +p38_capital_need(t,i,kcr,"immobile") = i38_fac_req(t,i,kcr) * pm_factor_cost_shares(t,i,"capital") / (pm_interest(t,i)+s38_depreciation_rate) * s38_immobile; * minimum labor share based on target and adjustment factor if (m_year(t) <= s38_startyear_labor_substitution, p38_min_labor_share(t,j) = 0; elseif m_year(t) <= s38_targetyear_labor_share, p38_min_labor_share(t,j) = sum(cell(i,j), - max(pm_cost_share_crops(t,i,"labor"), pm_cost_share_crops(t,i,"labor") + + max(pm_factor_cost_shares(t,i,"labor"), pm_factor_cost_shares(t,i,"labor") + ((m_year(t)-s38_startyear_labor_substitution)/(s38_targetyear_labor_share-s38_startyear_labor_substitution) * (s38_target_fulfillment * (s38_target_labor_share - sum(t2$(m_year(t2) = s38_targetyear_labor_share), - pm_cost_share_crops(t2,i,"labor"))))))); + pm_factor_cost_shares(t2,i,"labor"))))))); else p38_min_labor_share(t,j)$(sum(t2$(m_year(t2) = s38_targetyear_labor_share), - sum(cell(i,j), pm_cost_share_crops(t2,i,"labor"))) <= s38_target_labor_share) + sum(cell(i,j), pm_factor_cost_shares(t2,i,"labor"))) <= s38_target_labor_share) = sum(t2$(m_year(t2) = s38_targetyear_labor_share), p38_min_labor_share(t2,j)); p38_min_labor_share(t,j)$(sum(t2$(m_year(t2) = s38_targetyear_labor_share), - sum(cell(i,j), pm_cost_share_crops(t2,i,"labor"))) > s38_target_labor_share) - = max(sum(cell(i,j), pm_cost_share_crops(t,i,"labor")), s38_target_labor_share); + sum(cell(i,j), pm_factor_cost_shares(t2,i,"labor"))) > s38_target_labor_share) + = max(sum(cell(i,j), pm_factor_cost_shares(t,i,"labor")), s38_target_labor_share); ); * overwrite with 0 in case target labor share is 0 (i.e. off) diff --git a/modules/57_maccs/on_aug22/equations.gms b/modules/57_maccs/on_aug22/equations.gms index fcd0dc6d7b..2af85f3ec6 100644 --- a/modules/57_maccs/on_aug22/equations.gms +++ b/modules/57_maccs/on_aug22/equations.gms @@ -39,7 +39,7 @@ q57_labor_costs(i2) .. + sum(emis_source_inorg_fert_n2o, (vm_emissions_reg(i2,emis_source_inorg_fert_n2o,"n2o_n_direct") / s57_implicit_emis_factor) * sum(ct,im_maccs_mitigation(ct,i2,emis_source_inorg_fert_n2o,"n2o_n_direct")) * s57_implicit_fert_cost)) - * sum(ct, pm_cost_share_crops(ct ,i2,"labor") * (1/pm_productivity_gain_from_wages(ct,i2)) * + * sum(ct, pm_factor_cost_shares(ct ,i2,"labor") * (1/pm_productivity_gain_from_wages(ct,i2)) * (pm_hourly_costs(ct,i2,"scenario") / pm_hourly_costs(ct,i2,"baseline"))); q57_capital_costs(i2) .. @@ -49,4 +49,4 @@ q57_capital_costs(i2) .. + sum(emis_source_inorg_fert_n2o, (vm_emissions_reg(i2,emis_source_inorg_fert_n2o,"n2o_n_direct") / s57_implicit_emis_factor) * sum(ct,im_maccs_mitigation(ct,i2,emis_source_inorg_fert_n2o,"n2o_n_direct")) * s57_implicit_fert_cost)) - * sum(ct, pm_cost_share_crops(ct ,i2,"capital")); + * sum(ct, pm_factor_cost_shares(ct ,i2,"capital")); diff --git a/modules/70_livestock/fbask_jan16/declarations.gms b/modules/70_livestock/fbask_jan16/declarations.gms index 2641126d57..0b1503dba5 100644 --- a/modules/70_livestock/fbask_jan16/declarations.gms +++ b/modules/70_livestock/fbask_jan16/declarations.gms @@ -32,8 +32,6 @@ parameters 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 (USD17MER per tDM) p70_cereal_subst_fader(t_all) Cereal feed substitution with SCP fader (1) diff --git a/modules/70_livestock/fbask_jan16/equations.gms b/modules/70_livestock/fbask_jan16/equations.gms index 53e594a19c..7773d8e6f8 100644 --- a/modules/70_livestock/fbask_jan16/equations.gms +++ b/modules/70_livestock/fbask_jan16/equations.gms @@ -35,12 +35,12 @@ q70_feed(i2,kap,kall) .. 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, pm_factor_cost_shares(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_liv_capital(i2) .. vm_cost_prod_livst(i2,"capital") =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,"capital")); + *sum(ct, pm_factor_cost_shares(ct,i2,"capital")); q70_cost_prod_fish(i2) .. vm_cost_prod_fish(i2) =e= diff --git a/modules/70_livestock/fbask_jan16/input.gms b/modules/70_livestock/fbask_jan16/input.gms index 8156155b8a..6161ae4a10 100644 --- a/modules/70_livestock/fbask_jan16/input.gms +++ b/modules/70_livestock/fbask_jan16/input.gms @@ -67,20 +67,6 @@ $include "./modules/70_livestock/fbask_jan16/input/f70_pyld_slope_reg.cs4" $offdelim /; -parameter f70_cap_share_reg(share_regr) Parameters for regression -/ -$ondelim -$include "./modules/70_livestock/fbask_jan16/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/input/f70_hist_cap_share.csv" -$offdelim -; - table f70_hist_factor_costs_livst(t_all,i,kli) Historical factor costs in livestock production (mio. USD17MER) $ondelim $include "./modules/70_livestock/fbask_jan16/input/f70_hist_factor_costs_livst.cs3" diff --git a/modules/70_livestock/fbask_jan16/input/files b/modules/70_livestock/fbask_jan16/input/files index ca00704e44..8de709636b 100644 --- a/modules/70_livestock/fbask_jan16/input/files +++ b/modules/70_livestock/fbask_jan16/input/files @@ -5,7 +5,5 @@ 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/presolve.gms b/modules/70_livestock/fbask_jan16/presolve.gms index 5d1dda4fee..59c9667511 100644 --- a/modules/70_livestock/fbask_jan16/presolve.gms +++ b/modules/70_livestock/fbask_jan16/presolve.gms @@ -55,16 +55,6 @@ else *' @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) * fm_gdp_defl_ppp(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) * fm_gdp_defl_ppp(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"); -); diff --git a/modules/70_livestock/fbask_jan16_sticky/declarations.gms b/modules/70_livestock/fbask_jan16_sticky/declarations.gms index 0ea7887eea..4e00176562 100644 --- a/modules/70_livestock/fbask_jan16_sticky/declarations.gms +++ b/modules/70_livestock/fbask_jan16_sticky/declarations.gms @@ -34,8 +34,6 @@ parameters 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 (USD17MER per tDM) p70_cereal_subst_fader(t_all) Cereal feed substitution with SCP fader (1) diff --git a/modules/70_livestock/fbask_jan16_sticky/equations.gms b/modules/70_livestock/fbask_jan16_sticky/equations.gms index 5febb63386..4a5b32746c 100644 --- a/modules/70_livestock/fbask_jan16_sticky/equations.gms +++ b/modules/70_livestock/fbask_jan16_sticky/equations.gms @@ -35,7 +35,7 @@ q70_feed(i2,kap,kall) .. 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, pm_factor_cost_shares(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"))); diff --git a/modules/70_livestock/fbask_jan16_sticky/input.gms b/modules/70_livestock/fbask_jan16_sticky/input.gms index dd728cd7ad..6b17181e57 100644 --- a/modules/70_livestock/fbask_jan16_sticky/input.gms +++ b/modules/70_livestock/fbask_jan16_sticky/input.gms @@ -69,20 +69,6 @@ $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. USD17MER) $ondelim $include "./modules/70_livestock/fbask_jan16_sticky/input/f70_hist_factor_costs_livst.cs3" diff --git a/modules/70_livestock/fbask_jan16_sticky/input/files b/modules/70_livestock/fbask_jan16_sticky/input/files index ca00704e44..8de709636b 100644 --- a/modules/70_livestock/fbask_jan16_sticky/input/files +++ b/modules/70_livestock/fbask_jan16_sticky/input/files @@ -5,7 +5,5 @@ 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/presolve.gms b/modules/70_livestock/fbask_jan16_sticky/presolve.gms index b0f81f8b02..d78de1a773 100644 --- a/modules/70_livestock/fbask_jan16_sticky/presolve.gms +++ b/modules/70_livestock/fbask_jan16_sticky/presolve.gms @@ -55,17 +55,6 @@ else *' @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) * fm_gdp_defl_ppp(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) * fm_gdp_defl_ppp(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, @@ -73,7 +62,7 @@ elseif (m_year(t)>=2010), *' 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_factor_cost_shares(t,i,"capital") / (pm_interest(t,i)+s70_depreciation_rate) * s70_multiplicator_capital_need; From de335035d9ad8d4ccbb6ad0b3a96de0bbe55850d Mon Sep 17 00:00:00 2001 From: florianh Date: Thu, 31 Oct 2024 10:05:12 +0100 Subject: [PATCH 088/206] bugfix output scripts report --- scripts/output/rds_report.R | 1 + scripts/output/rds_report_iso.R | 4 ++++ 2 files changed, 5 insertions(+) diff --git a/scripts/output/rds_report.R b/scripts/output/rds_report.R index 2b3dea3f0e..fab0e3ce8e 100644 --- a/scripts/output/rds_report.R +++ b/scripts/output/rds_report.R @@ -48,6 +48,7 @@ for (mapping in c("AR6", "NAVIGATE", "SHAPE", "AR6_MAgPIE")) { } write.report(report, file = mif) +report <- read.report(file = mif, as.list=F) q <- as.quitte(report) # as.quitte converts "World" into "GLO". But we want to keep "World" and therefore undo these changes diff --git a/scripts/output/rds_report_iso.R b/scripts/output/rds_report_iso.R index 52cf2aa574..4f8ffdfcdf 100644 --- a/scripts/output/rds_report_iso.R +++ b/scripts/output/rds_report_iso.R @@ -32,6 +32,10 @@ rds_iso <- paste0(outputdir, "/report_iso.rds") report <- getReportIso(gdx, scenario = cfg$title, dir = outputdir) +mif <- sub(".rds",".mif",rds_iso) +write.report(report, file = mif, scenario = cfg$title) +report <- read.report(file = mif, as.list=F) + q <- as.quitte(report) # as.quitte converts "World" into "GLO". But we want to keep "World" and therefore undo these changes q <- droplevels(q) From e073d786b709a85481fb480c25e15e76469eb62e Mon Sep 17 00:00:00 2001 From: Felicitas Beier <39262100+FelicitasBeier@users.noreply.github.com> Date: Thu, 31 Oct 2024 10:32:51 +0100 Subject: [PATCH 089/206] Update rds_report.R linter rules --- scripts/output/rds_report.R | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/output/rds_report.R b/scripts/output/rds_report.R index fab0e3ce8e..e63f4a896a 100644 --- a/scripts/output/rds_report.R +++ b/scripts/output/rds_report.R @@ -39,7 +39,7 @@ resultsarchive <- "/p/projects/rd3mod/models/results/magpie" report <- getReport(gdx, scenario = cfg$title, dir = outputdir) for (mapping in c("AR6", "NAVIGATE", "SHAPE", "AR6_MAgPIE")) { - missingVariables <- sort(setdiff(unique(deletePlus(getMappingVariables(mapping,"M"))),unique(deletePlus(getNames(report,dim="variable"))))) + missingVariables <- sort(setdiff(unique(deletePlus(getMappingVariables(mapping, "M"))), unique(deletePlus(getNames(report, dim = "variable"))))) if (length(missingVariables) > 0) { warning("# The following ", length(missingVariables), " variables are expected in the piamInterfaces package ", "for mapping ", mapping, ", but cannot be found in the MAgPIE report.\nPlease either fix in magpie4 or adjust the mapping in piamInterfaces.\n- ", @@ -48,7 +48,7 @@ for (mapping in c("AR6", "NAVIGATE", "SHAPE", "AR6_MAgPIE")) { } write.report(report, file = mif) -report <- read.report(file = mif, as.list=F) +report <- read.report(file = mif, as.list = FALSE) q <- as.quitte(report) # as.quitte converts "World" into "GLO". But we want to keep "World" and therefore undo these changes From 02fdf50e191c60d6bc21c1838956936430992374 Mon Sep 17 00:00:00 2001 From: Felicitas Beier <39262100+FelicitasBeier@users.noreply.github.com> Date: Thu, 31 Oct 2024 10:33:26 +0100 Subject: [PATCH 090/206] Update rds_report_iso.R --- scripts/output/rds_report_iso.R | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/output/rds_report_iso.R b/scripts/output/rds_report_iso.R index 4f8ffdfcdf..7439b930f7 100644 --- a/scripts/output/rds_report_iso.R +++ b/scripts/output/rds_report_iso.R @@ -34,7 +34,7 @@ report <- getReportIso(gdx, scenario = cfg$title, dir = outputdir) mif <- sub(".rds",".mif",rds_iso) write.report(report, file = mif, scenario = cfg$title) -report <- read.report(file = mif, as.list=F) +report <- read.report(file = mif, as.list = FALSE) q <- as.quitte(report) # as.quitte converts "World" into "GLO". But we want to keep "World" and therefore undo these changes From 752524b4fadb01072b2dfd67610822309552152a Mon Sep 17 00:00:00 2001 From: Debbora Leip Date: Thu, 31 Oct 2024 12:57:48 +0100 Subject: [PATCH 091/206] bugfix --- modules/38_factor_costs/per_ton_fao_may22/preloop.gms | 6 +++--- modules/38_factor_costs/sticky_feb18/preloop.gms | 6 +++--- modules/38_factor_costs/sticky_labor/preloop.gms | 6 +++--- scripts/output/rds_report.R | 3 ++- scripts/output/rds_report_iso.R | 4 ++++ 5 files changed, 15 insertions(+), 10 deletions(-) diff --git a/modules/38_factor_costs/per_ton_fao_may22/preloop.gms b/modules/38_factor_costs/per_ton_fao_may22/preloop.gms index 14d00c3de0..8076e4a47f 100644 --- a/modules/38_factor_costs/per_ton_fao_may22/preloop.gms +++ b/modules/38_factor_costs/per_ton_fao_may22/preloop.gms @@ -13,6 +13,6 @@ p38_capital_cost_shares_iso(t,iso)$(m_year(t)<2010) = f38_historical_share(t,is p38_capital_cost_shares_iso(t,iso)$(m_year(t)>=2010) = f38_reg_parameters("slope") * log10(im_gdp_pc_ppp_iso(t,iso)) + f38_reg_parameters("intercept") + p38_share_calibration(iso); * aggregate factor cost shares -pm_factor_cost_shares(t,i,"capital") = (1/sum(i_to_iso(i,iso), f38_hist_factor_costs(t,iso))) * - sum(i_to_iso(i,iso), f38_hist_factor_costs(t,iso) * p38_capital_cost_shares_iso(t,iso)); -pm_factor_cost_shares(t,i,"labor") = 1 - pm_factor_cost_shares(t,i,"capital"); \ No newline at end of file +pm_factor_cost_shares(t,i,"capital") = (1/sum(i_to_iso(i,iso), f38_hist_factor_costs("y2010",iso))) * + sum(i_to_iso(i,iso), f38_hist_factor_costs("y2010",iso) * p38_capital_cost_shares_iso(t,iso)); +pm_factor_cost_shares(t,i,"labor") = 1 - pm_factor_cost_shares(t,i,"capital"); diff --git a/modules/38_factor_costs/sticky_feb18/preloop.gms b/modules/38_factor_costs/sticky_feb18/preloop.gms index 14d00c3de0..8076e4a47f 100644 --- a/modules/38_factor_costs/sticky_feb18/preloop.gms +++ b/modules/38_factor_costs/sticky_feb18/preloop.gms @@ -13,6 +13,6 @@ p38_capital_cost_shares_iso(t,iso)$(m_year(t)<2010) = f38_historical_share(t,is p38_capital_cost_shares_iso(t,iso)$(m_year(t)>=2010) = f38_reg_parameters("slope") * log10(im_gdp_pc_ppp_iso(t,iso)) + f38_reg_parameters("intercept") + p38_share_calibration(iso); * aggregate factor cost shares -pm_factor_cost_shares(t,i,"capital") = (1/sum(i_to_iso(i,iso), f38_hist_factor_costs(t,iso))) * - sum(i_to_iso(i,iso), f38_hist_factor_costs(t,iso) * p38_capital_cost_shares_iso(t,iso)); -pm_factor_cost_shares(t,i,"labor") = 1 - pm_factor_cost_shares(t,i,"capital"); \ No newline at end of file +pm_factor_cost_shares(t,i,"capital") = (1/sum(i_to_iso(i,iso), f38_hist_factor_costs("y2010",iso))) * + sum(i_to_iso(i,iso), f38_hist_factor_costs("y2010",iso) * p38_capital_cost_shares_iso(t,iso)); +pm_factor_cost_shares(t,i,"labor") = 1 - pm_factor_cost_shares(t,i,"capital"); diff --git a/modules/38_factor_costs/sticky_labor/preloop.gms b/modules/38_factor_costs/sticky_labor/preloop.gms index 3a3ea95f4d..60050a7597 100644 --- a/modules/38_factor_costs/sticky_labor/preloop.gms +++ b/modules/38_factor_costs/sticky_labor/preloop.gms @@ -18,6 +18,6 @@ p38_capital_cost_shares_iso(t,iso)$(m_year(t)<2010) = f38_historical_share(t,is p38_capital_cost_shares_iso(t,iso)$(m_year(t)>=2010) = f38_reg_parameters("slope") * log10(im_gdp_pc_ppp_iso(t,iso)) + f38_reg_parameters("intercept") + p38_share_calibration(iso); * aggregate factor cost shares -pm_factor_cost_shares(t,i,"capital") = (1/sum(i_to_iso(i,iso), f38_hist_factor_costs(t,iso))) * - sum(i_to_iso(i,iso), f38_hist_factor_costs(t,iso) * p38_capital_cost_shares_iso(t,iso)); -pm_factor_cost_shares(t,i,"labor") = 1 - pm_factor_cost_shares(t,i,"capital"); \ No newline at end of file +pm_factor_cost_shares(t,i,"capital") = (1/sum(i_to_iso(i,iso), f38_hist_factor_costs("y2010",iso))) * + sum(i_to_iso(i,iso), f38_hist_factor_costs("y2010",iso) * p38_capital_cost_shares_iso(t,iso)); +pm_factor_cost_shares(t,i,"labor") = 1 - pm_factor_cost_shares(t,i,"capital"); diff --git a/scripts/output/rds_report.R b/scripts/output/rds_report.R index 2b3dea3f0e..e63f4a896a 100644 --- a/scripts/output/rds_report.R +++ b/scripts/output/rds_report.R @@ -39,7 +39,7 @@ resultsarchive <- "/p/projects/rd3mod/models/results/magpie" report <- getReport(gdx, scenario = cfg$title, dir = outputdir) for (mapping in c("AR6", "NAVIGATE", "SHAPE", "AR6_MAgPIE")) { - missingVariables <- sort(setdiff(unique(deletePlus(getMappingVariables(mapping,"M"))),unique(deletePlus(getNames(report,dim="variable"))))) + missingVariables <- sort(setdiff(unique(deletePlus(getMappingVariables(mapping, "M"))), unique(deletePlus(getNames(report, dim = "variable"))))) if (length(missingVariables) > 0) { warning("# The following ", length(missingVariables), " variables are expected in the piamInterfaces package ", "for mapping ", mapping, ", but cannot be found in the MAgPIE report.\nPlease either fix in magpie4 or adjust the mapping in piamInterfaces.\n- ", @@ -48,6 +48,7 @@ for (mapping in c("AR6", "NAVIGATE", "SHAPE", "AR6_MAgPIE")) { } write.report(report, file = mif) +report <- read.report(file = mif, as.list = FALSE) q <- as.quitte(report) # as.quitte converts "World" into "GLO". But we want to keep "World" and therefore undo these changes diff --git a/scripts/output/rds_report_iso.R b/scripts/output/rds_report_iso.R index 52cf2aa574..7439b930f7 100644 --- a/scripts/output/rds_report_iso.R +++ b/scripts/output/rds_report_iso.R @@ -32,6 +32,10 @@ rds_iso <- paste0(outputdir, "/report_iso.rds") report <- getReportIso(gdx, scenario = cfg$title, dir = outputdir) +mif <- sub(".rds",".mif",rds_iso) +write.report(report, file = mif, scenario = cfg$title) +report <- read.report(file = mif, as.list = FALSE) + q <- as.quitte(report) # as.quitte converts "World" into "GLO". But we want to keep "World" and therefore undo these changes q <- droplevels(q) From ae906dda1f61b694230824553dd1ffad6eaee7d9 Mon Sep 17 00:00:00 2001 From: Debbora Leip Date: Thu, 31 Oct 2024 14:27:54 +0100 Subject: [PATCH 092/206] updated changelog --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 097c72d636..c642b5715b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). ## [Unreleased] ### changed +- **38_factor_costs** updated use of USDA cost shares - **inputdata** changed GDP base year from 2005USD to 2017USD - **config** changed default input data to use 2017USD - **module_documentation** all references to USD05 changed to USD17 From 227eb631f4bb338addf447091bd359e250890b6c Mon Sep 17 00:00:00 2001 From: Pascal Sauer <156898545+pascal-sauer@users.noreply.github.com> Date: Fri, 1 Nov 2024 13:06:21 +0100 Subject: [PATCH 093/206] check unit format in rds_report --- scripts/output/rds_report.R | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/scripts/output/rds_report.R b/scripts/output/rds_report.R index e63f4a896a..424ccff62d 100644 --- a/scripts/output/rds_report.R +++ b/scripts/output/rds_report.R @@ -37,6 +37,11 @@ resultsarchive <- "/p/projects/rd3mod/models/results/magpie" report <- getReport(gdx, scenario = cfg$title, dir = outputdir) +if (!all(grepl(" \\(([^\\()]*)\\)($|\\.)", getNames(report, fulldim = TRUE)$variable))) { + warning("Variables should be in the format 'name (unit)', but the following are not:\n", + paste(grep(" \\(([^\\()]*)\\)($|\\.)", getNames(report, fulldim = TRUE)$variable, + invert = TRUE, value = TRUE), collapse = "\n")) +} for (mapping in c("AR6", "NAVIGATE", "SHAPE", "AR6_MAgPIE")) { missingVariables <- sort(setdiff(unique(deletePlus(getMappingVariables(mapping, "M"))), unique(deletePlus(getNames(report, dim = "variable"))))) @@ -48,7 +53,6 @@ for (mapping in c("AR6", "NAVIGATE", "SHAPE", "AR6_MAgPIE")) { } write.report(report, file = mif) -report <- read.report(file = mif, as.list = FALSE) q <- as.quitte(report) # as.quitte converts "World" into "GLO". But we want to keep "World" and therefore undo these changes From a5b6b2228c74152c1a74dbc176fb2bc8234323c5 Mon Sep 17 00:00:00 2001 From: Pascal Sauer <156898545+pascal-sauer@users.noreply.github.com> Date: Fri, 1 Nov 2024 13:41:19 +0100 Subject: [PATCH 094/206] clarify --- scripts/output/rds_report.R | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/scripts/output/rds_report.R b/scripts/output/rds_report.R index 424ccff62d..a950b5e3c4 100644 --- a/scripts/output/rds_report.R +++ b/scripts/output/rds_report.R @@ -38,16 +38,19 @@ resultsarchive <- "/p/projects/rd3mod/models/results/magpie" report <- getReport(gdx, scenario = cfg$title, dir = outputdir) if (!all(grepl(" \\(([^\\()]*)\\)($|\\.)", getNames(report, fulldim = TRUE)$variable))) { - warning("Variables should be in the format 'name (unit)', but the following are not:\n", + warning("Variables should be in the format 'name (unit)' (the space between name and unit is important), ", + "but the following are not:\n", paste(grep(" \\(([^\\()]*)\\)($|\\.)", getNames(report, fulldim = TRUE)$variable, invert = TRUE, value = TRUE), collapse = "\n")) } for (mapping in c("AR6", "NAVIGATE", "SHAPE", "AR6_MAgPIE")) { - missingVariables <- sort(setdiff(unique(deletePlus(getMappingVariables(mapping, "M"))), unique(deletePlus(getNames(report, dim = "variable"))))) + missingVariables <- sort(setdiff(unique(deletePlus(getMappingVariables(mapping, "M"))), + unique(deletePlus(getNames(report, dim = "variable"))))) if (length(missingVariables) > 0) { warning("# The following ", length(missingVariables), " variables are expected in the piamInterfaces package ", - "for mapping ", mapping, ", but cannot be found in the MAgPIE report.\nPlease either fix in magpie4 or adjust the mapping in piamInterfaces.\n- ", + "for mapping ", mapping, ", but cannot be found in the MAgPIE report.\n", + "Please either fix in magpie4 or adjust the mapping in piamInterfaces.\n- ", paste(missingVariables, collapse = ",\n- "), "\n") } } From af0fa82bb20d41795bfb3a1bcd719df2ea7551e2 Mon Sep 17 00:00:00 2001 From: Pascal Sauer <156898545+pascal-sauer@users.noreply.github.com> Date: Fri, 1 Nov 2024 15:05:52 +0100 Subject: [PATCH 095/206] linter --- scripts/output/rds_report.R | 29 +++++++++++++++-------------- 1 file changed, 15 insertions(+), 14 deletions(-) diff --git a/scripts/output/rds_report.R b/scripts/output/rds_report.R index a950b5e3c4..7e98f53b98 100644 --- a/scripts/output/rds_report.R +++ b/scripts/output/rds_report.R @@ -22,7 +22,7 @@ library(piamutils) options("magclass.verbosity" = 1) ############################# BASIC CONFIGURATION ############################# -if(!exists("source_include")) { +if (!exists("source_include")) { outputdir <- "/p/projects/landuse/users/miodrag/projects/tests/flexreg/output/H12_setup1_2016-11-23_12.38.56/" readArgs("outputdir") } @@ -57,20 +57,22 @@ for (mapping in c("AR6", "NAVIGATE", "SHAPE", "AR6_MAgPIE")) { write.report(report, file = mif) -q <- as.quitte(report) +qu <- as.quitte(report) # as.quitte converts "World" into "GLO". But we want to keep "World" and therefore undo these changes -q <- droplevels(q) -levels(q$region)[levels(q$region) == "GLO"] <- "World" -q$region <- factor(q$region,levels = sort(levels(q$region))) +qu <- droplevels(qu) +levels(qu$region)[levels(qu$region) == "GLO"] <- "World" +qu$region <- factor(qu$region,levels = sort(levels(qu$region))) -if(all(is.na(q$value))) stop("No values in reporting!") +if (all(is.na(qu$value))) { + stop("No values in reporting!") +} -saveRDS(q, file = rds, version = 2) +saveRDS(qu, file = rds, version = 2) -if(file.exists(runstatistics) & dir.exists(resultsarchive)) { +if (file.exists(runstatistics) && dir.exists(resultsarchive)) { stats <- list() load(runstatistics) - if(is.null(stats$id)) { + if (is.null(stats$id)) { # create an id if it does not exist (which means that statistics have not # been saved to the archive before) and save statistics to the archive message("No id found in runstatistics.rda. Calling lucode2::runstatistics() to create one.") @@ -82,9 +84,8 @@ if(file.exists(runstatistics) & dir.exists(resultsarchive)) { } # Save report to results archive - saveRDS(q, file = paste0(resultsarchive, "/", stats$id, ".rds"), version = 2) - cwd <- getwd() - setwd(resultsarchive) - system("find -type f -name '1*.rds' -printf '%f\n' | sort > fileListForShinyresults") - setwd(cwd) + saveRDS(qu, file = paste0(resultsarchive, "/", stats$id, ".rds"), version = 2) + withr::with_dir(resultsarchive, { + system("find -type f -name '1*.rds' -printf '%f\n' | sort > fileListForShinyresults") + }) } From 629d61a211055a1b5640c53cad99098d28ac5ca9 Mon Sep 17 00:00:00 2001 From: florianh Date: Sun, 3 Nov 2024 19:30:40 +0100 Subject: [PATCH 096/206] bugfix --- scripts/output/extra/disaggregation.R | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/scripts/output/extra/disaggregation.R b/scripts/output/extra/disaggregation.R index 2c6608bc25..29a72de732 100644 --- a/scripts/output/extra/disaggregation.R +++ b/scripts/output/extra/disaggregation.R @@ -378,8 +378,6 @@ out <- peat_hr / dimSums(land_hr[, getYears(peat_hr), ], dim = 3) out[is.nan(out)] <- 0 out[is.infinite(out)] <- 0 -rm(land_hr, peat_hr) - .writeDisagg(out, peatland_hr_share_out_file, comment = "unit: grid-cell land area fraction", message = "Write outputs peatland share" @@ -526,6 +524,10 @@ if (grepl("grass", cfg$gms$past)) { "past", "manpast", gsub("range", "rangeland", getNames(land_lr)) ) + getNames(land_consv_hr) <- gsub( + "past", "manpast", + gsub("range", "rangeland", getNames(land_consv_hr)) + ) } else { # Disaggregate pasture land_ini_lr <- mbind( @@ -537,6 +539,11 @@ if (grepl("grass", cfg$gms$past)) { land_lr[, , c("past"), invert = TRUE], collapseNames(land_lr[, , "past"]) * side_layers_lr[, , c("manpast", "rangeland")] ) + + land_consv_hr <- mbind( + land_consv_hr[, , c("past"), invert = TRUE], + collapseNames(land_consv_hr[, , "past"]) * side_layers_hr[, , c("manpast", "rangeland")] + ) } # Sort and rename @@ -556,6 +563,7 @@ land_bii_hr <- interpolateAvlCroplandWeighted( marginal_land = marginal_land, urban_land_hr = urban_land_hr, land_consv_hr = land_consv_hr, + peat_hr = peat_hr, snv_pol_shr = snv_pol_shr, snv_pol_fader = snv_pol_fader, unit = "share" From b99affc29f4664c4b9e717ee8f76b8f2777a34b7 Mon Sep 17 00:00:00 2001 From: florianh Date: Mon, 4 Nov 2024 06:15:13 +0100 Subject: [PATCH 097/206] Tol_Feas_Min = 3.e-13 --- modules/80_optimization/lp_nlp_apr17/solve.gms | 1 + modules/80_optimization/nlp_apr17/solve.gms | 1 + modules/80_optimization/nlp_par/solve.gms | 1 + 3 files changed, 3 insertions(+) diff --git a/modules/80_optimization/lp_nlp_apr17/solve.gms b/modules/80_optimization/lp_nlp_apr17/solve.gms index c3250b566c..bca87a9b38 100644 --- a/modules/80_optimization/lp_nlp_apr17/solve.gms +++ b/modules/80_optimization/lp_nlp_apr17/solve.gms @@ -36,6 +36,7 @@ $endif $onecho > conopt4.opt Lim_Variable = 1.e25 +Tol_Feas_Min = 3.e-13 $offecho $onecho > conopt4.op2 diff --git a/modules/80_optimization/nlp_apr17/solve.gms b/modules/80_optimization/nlp_apr17/solve.gms index 7dc3b1198d..ce482ee046 100644 --- a/modules/80_optimization/nlp_apr17/solve.gms +++ b/modules/80_optimization/nlp_apr17/solve.gms @@ -20,6 +20,7 @@ magpie.holdfixed = 1 ; $onecho > conopt4.opt Lim_Variable = 1.e25 +Tol_Feas_Min = 3.e-13 $offecho $onecho > conopt4.op2 diff --git a/modules/80_optimization/nlp_par/solve.gms b/modules/80_optimization/nlp_par/solve.gms index 60d888a72e..d634213781 100644 --- a/modules/80_optimization/nlp_par/solve.gms +++ b/modules/80_optimization/nlp_par/solve.gms @@ -23,6 +23,7 @@ magpie.savepoint = 0; $onecho > conopt4.opt Lim_Variable = 1.e25 +Tol_Feas_Min = 3.e-13 $offecho $onecho > conopt4.op2 From b86f689f565e91a2e3655afe5fa2b1983cd7b703 Mon Sep 17 00:00:00 2001 From: florianh Date: Mon, 4 Nov 2024 06:18:46 +0100 Subject: [PATCH 098/206] update --- scripts/projects/fsec.R | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/projects/fsec.R b/scripts/projects/fsec.R index f7f3302baa..78dd0490e5 100644 --- a/scripts/projects/fsec.R +++ b/scripts/projects/fsec.R @@ -226,7 +226,7 @@ fsecScenario <- function(scenario) { "rds_report") cfg$force_download <- TRUE cfg$gms$s80_optfile <- 0 - cfg$gms$s80_maxiter <- 100 + cfg$gms$s80_maxiter <- 30 return(cfg) } From 141a0bcf7e962aeb66e57ae67b3d76838a746007 Mon Sep 17 00:00:00 2001 From: florianh Date: Mon, 4 Nov 2024 09:39:08 +0100 Subject: [PATCH 099/206] test --- modules/38_factor_costs/sticky_feb18/scaling.gms | 1 + 1 file changed, 1 insertion(+) diff --git a/modules/38_factor_costs/sticky_feb18/scaling.gms b/modules/38_factor_costs/sticky_feb18/scaling.gms index 77d6248084..27fd45cc58 100644 --- a/modules/38_factor_costs/sticky_feb18/scaling.gms +++ b/modules/38_factor_costs/sticky_feb18/scaling.gms @@ -7,3 +7,4 @@ vm_cost_prod_crop.scale(i,factors) = 10e5; v38_investment_immobile.scale(j,kcr) = 10e3; +v38_capital_need.scale(j,kcr,mobil38) = 10e3; From 509595dd5b2bd8473c41d80bd154c966d20c0ded Mon Sep 17 00:00:00 2001 From: florianh Date: Mon, 4 Nov 2024 10:29:06 +0100 Subject: [PATCH 100/206] update --- modules/10_land/landmatrix_dec18/scaling.gms | 4 ++-- modules/20_processing/substitution_may21/scaling.gms | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/modules/10_land/landmatrix_dec18/scaling.gms b/modules/10_land/landmatrix_dec18/scaling.gms index 3db0837364..7698c27b82 100644 --- a/modules/10_land/landmatrix_dec18/scaling.gms +++ b/modules/10_land/landmatrix_dec18/scaling.gms @@ -6,5 +6,5 @@ *** | Contact: magpie@pik-potsdam.de vm_landdiff.scale = 10e3; -v10_balance_positive.scale(j) = 10e-10; -v10_balance_negative.scale(j) = 10e-10; +v10_balance_positive.scale(j) = 10e-9; +v10_balance_negative.scale(j) = 10e-9; diff --git a/modules/20_processing/substitution_may21/scaling.gms b/modules/20_processing/substitution_may21/scaling.gms index db58c9ae6f..e6a6e99a3c 100644 --- a/modules/20_processing/substitution_may21/scaling.gms +++ b/modules/20_processing/substitution_may21/scaling.gms @@ -5,6 +5,6 @@ *** | MAgPIE License Exception, version 1.0 (see LICENSE file). *** | Contact: magpie@pik-potsdam.de -vm_secondary_overproduction.scale(i,kall,kpr) = 10e-3; +vm_secondary_overproduction.scale(i,kall,kpr) = 10e-4; vm_cost_processing.scale(i) = 10e5; vm_processing_substitution_cost.scale(i) = 10e4; From cf6165369959b95a5691506e0c9bbcb6b2a30ede Mon Sep 17 00:00:00 2001 From: Debbora Leip Date: Mon, 4 Nov 2024 20:39:53 +0100 Subject: [PATCH 101/206] updated input tgz --- config/default.cfg | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/config/default.cfg b/config/default.cfg index 404772ab33..21f3598876 100644 --- a/config/default.cfg +++ b/config/default.cfg @@ -22,9 +22,9 @@ cfg$model <- "main.gms" #def = "main.gms" #### input settings #### # which input data sets should be used? -cfg$input <- c(regional = "rev4.114_h12_magpie.tgz", - cellular = "rev4.114_h12_fd712c0b_cellularmagpie_c200_MRI-ESM2-0-ssp370_lpjml-8e6c5eb1.tgz", - validation = "rev4.114_h12_validation.tgz", +cfg$input <- c(regional = "rev4.114_testUSDAupdate_v7_h12_magpie.tgz", + cellular = "rev4.114_testUSDAupdate_v7_h12_fd712c0b_cellularmagpie_c200_MRI-ESM2-0-ssp370_lpjml-8e6c5eb1.tgz", + validation = "rev4.114_testUSDAupdate_v7_h12_validation.tgz", additional = "additional_data_rev4.57.tgz", calibration = "calibration_H12_27Sep24.tgz") From 8897503400004fc0f2e50a089d2f56f596e23fb7 Mon Sep 17 00:00:00 2001 From: florianh Date: Mon, 4 Nov 2024 22:48:43 +0100 Subject: [PATCH 102/206] update --- modules/44_biodiversity/bii_target_apr24/equations.gms | 4 ++-- modules/44_biodiversity/bii_target_apr24/preloop.gms | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/modules/44_biodiversity/bii_target_apr24/equations.gms b/modules/44_biodiversity/bii_target_apr24/equations.gms index b7fdc1ea1d..3e084c12a2 100644 --- a/modules/44_biodiversity/bii_target_apr24/equations.gms +++ b/modules/44_biodiversity/bii_target_apr24/equations.gms @@ -11,14 +11,14 @@ *' Biodiversity stock weighted by range-rarity restoration prioritization layer (`f44_rr_layer`) *' The regional layer is needed for compatibility with the high resolution parallel optimization output script (scripts/output/extra/highres.R) - q44_bii(i2,biome44)$(sum(cell(i2,j2), f44_biome(j2,biome44)) > 0) .. v44_bii(i2,biome44) + q44_bii(i2,biome44)$(sum(cell(i2,j2), f44_biome(j2,biome44)*f44_rr_layer(j2)) > 1e-6) .. v44_bii(i2,biome44) =e= (sum((cell(i2,j2),potnatveg,landcover44), vm_bv(j2,landcover44,potnatveg) * f44_rr_layer(j2) * f44_biome(j2,biome44)) / sum((cell(i2,j2),land), pcm_land(j2,land) * f44_rr_layer(j2) * f44_biome(j2,biome44))); *' For each of the 71 biomes, the BII has to meet a minium level based on `s44_bii_lower_bound`. *' `v44_bii_missing` is a technical variable to maintain feasibility in case `v44_bii` cannot be increased. - q44_bii_target(i2,biome44)$(sum(cell(i2,j2), f44_biome(j2,biome44)) > 0) .. + q44_bii_target(i2,biome44)$(sum(cell(i2,j2), f44_biome(j2,biome44)*f44_rr_layer(j2)) > 1e-6) .. v44_bii(i2,biome44) + v44_bii_missing(i2,biome44) =g= sum(ct, p44_bii_lower_bound(ct,i2,biome44)); *' Costs accrue only for `v44_bii_missing`. In the best case costs should be zero or close to zero. diff --git a/modules/44_biodiversity/bii_target_apr24/preloop.gms b/modules/44_biodiversity/bii_target_apr24/preloop.gms index 2c6494fe74..5cd24279d5 100644 --- a/modules/44_biodiversity/bii_target_apr24/preloop.gms +++ b/modules/44_biodiversity/bii_target_apr24/preloop.gms @@ -7,8 +7,8 @@ v44_bii.l(i,biome44) = 0.75; -v44_bii.fx(i,biome44)$(sum(cell(i,j), f44_biome(j,biome44)) = 0) = 0; -v44_bii_missing.fx(i,biome44)$(sum(cell(i,j), f44_biome(j,biome44)) = 0) = 0; +v44_bii.fx(i,biome44)$(sum(cell(i,j), f44_biome(j,biome44)*f44_rr_layer(j2)) <= 1e-6) = 0; +v44_bii_missing.fx(i,biome44)$(sum(cell(i,j), f44_biome(j,biome44)*f44_rr_layer(j2)) <= 1e-6) = 0; p44_bii_lower_bound(t,i,biome44) = 0; vm_bv.l(j,landcover44,potnatveg) = 0; From f8348d7d39a6313460eeb4f51daa4d5f264c75c7 Mon Sep 17 00:00:00 2001 From: florianh Date: Mon, 4 Nov 2024 22:59:16 +0100 Subject: [PATCH 103/206] bugfix --- modules/44_biodiversity/bii_target_apr24/preloop.gms | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/modules/44_biodiversity/bii_target_apr24/preloop.gms b/modules/44_biodiversity/bii_target_apr24/preloop.gms index 5cd24279d5..589c41bec0 100644 --- a/modules/44_biodiversity/bii_target_apr24/preloop.gms +++ b/modules/44_biodiversity/bii_target_apr24/preloop.gms @@ -7,8 +7,8 @@ v44_bii.l(i,biome44) = 0.75; -v44_bii.fx(i,biome44)$(sum(cell(i,j), f44_biome(j,biome44)*f44_rr_layer(j2)) <= 1e-6) = 0; -v44_bii_missing.fx(i,biome44)$(sum(cell(i,j), f44_biome(j,biome44)*f44_rr_layer(j2)) <= 1e-6) = 0; +v44_bii.fx(i,biome44)$(sum(cell(i,j), f44_biome(j,biome44)*f44_rr_layer(j)) <= 1e-6) = 0; +v44_bii_missing.fx(i,biome44)$(sum(cell(i,j), f44_biome(j,biome44)*f44_rr_layer(j)) <= 1e-6) = 0; p44_bii_lower_bound(t,i,biome44) = 0; vm_bv.l(j,landcover44,potnatveg) = 0; From 47a8258eea81559195903e3d7eec859d64d8ad68 Mon Sep 17 00:00:00 2001 From: florianh Date: Tue, 5 Nov 2024 06:43:50 +0100 Subject: [PATCH 104/206] bugfix --- modules/44_biodiversity/bii_target_apr24/presolve.gms | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/44_biodiversity/bii_target_apr24/presolve.gms b/modules/44_biodiversity/bii_target_apr24/presolve.gms index 0a45321b2a..de40ebb61b 100644 --- a/modules/44_biodiversity/bii_target_apr24/presolve.gms +++ b/modules/44_biodiversity/bii_target_apr24/presolve.gms @@ -23,7 +23,7 @@ else ); p44_bii_lower_bound(t2,i,biome44)$(p44_bii_lower_bound(t2,i,biome44) >= 1) = 1; p44_bii_lower_bound(t2,i,biome44)$(m_year(t2) < s44_start_year) = 0; - p44_bii_lower_bound(t2,i,biome44)$(sum(cell(i,j), f44_biome(j,biome44)) = 0) = 0; + p44_bii_lower_bound(t2,i,biome44)$(sum(cell(i,j), f44_biome(j,biome44)**f44_rr_layer(j2)) <= 1e-6) = 0; * The lower bound of `v44_bii` is set to `p44_bii_lower_bound` to avoid a reduction of BII in combination with `v44_bii_missing`. v44_bii.lo(i,biome44) = p44_bii_lower_bound(t,i,biome44); display p44_bii_lower_bound; From 65ccea5df82ea6366ea1f5fcf9bc13d636b659d3 Mon Sep 17 00:00:00 2001 From: florianh Date: Tue, 5 Nov 2024 06:51:09 +0100 Subject: [PATCH 105/206] bugfix --- modules/44_biodiversity/bii_target_apr24/presolve.gms | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/44_biodiversity/bii_target_apr24/presolve.gms b/modules/44_biodiversity/bii_target_apr24/presolve.gms index de40ebb61b..4af7a228cc 100644 --- a/modules/44_biodiversity/bii_target_apr24/presolve.gms +++ b/modules/44_biodiversity/bii_target_apr24/presolve.gms @@ -23,7 +23,7 @@ else ); p44_bii_lower_bound(t2,i,biome44)$(p44_bii_lower_bound(t2,i,biome44) >= 1) = 1; p44_bii_lower_bound(t2,i,biome44)$(m_year(t2) < s44_start_year) = 0; - p44_bii_lower_bound(t2,i,biome44)$(sum(cell(i,j), f44_biome(j,biome44)**f44_rr_layer(j2)) <= 1e-6) = 0; + p44_bii_lower_bound(t2,i,biome44)$(sum(cell(i,j), f44_biome(j,biome44)**f44_rr_layer(j)) <= 1e-6) = 0; * The lower bound of `v44_bii` is set to `p44_bii_lower_bound` to avoid a reduction of BII in combination with `v44_bii_missing`. v44_bii.lo(i,biome44) = p44_bii_lower_bound(t,i,biome44); display p44_bii_lower_bound; From 9a1e2b9872b80234226aef0970675d6e5d5b2b11 Mon Sep 17 00:00:00 2001 From: florianh Date: Tue, 5 Nov 2024 07:58:27 +0100 Subject: [PATCH 106/206] test --- modules/80_optimization/nlp_apr17/solve.gms | 1 + 1 file changed, 1 insertion(+) diff --git a/modules/80_optimization/nlp_apr17/solve.gms b/modules/80_optimization/nlp_apr17/solve.gms index ce482ee046..d95a53e8b4 100644 --- a/modules/80_optimization/nlp_apr17/solve.gms +++ b/modules/80_optimization/nlp_apr17/solve.gms @@ -21,6 +21,7 @@ magpie.holdfixed = 1 ; $onecho > conopt4.opt Lim_Variable = 1.e25 Tol_Feas_Min = 3.e-13 +Tol_Feas_Max = 1.e-3 $offecho $onecho > conopt4.op2 From 43f1357a658eefbde29188dc27a283116d14bf27 Mon Sep 17 00:00:00 2001 From: florianh Date: Tue, 5 Nov 2024 09:47:06 +0100 Subject: [PATCH 107/206] test --- modules/80_optimization/nlp_apr17/solve.gms | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/80_optimization/nlp_apr17/solve.gms b/modules/80_optimization/nlp_apr17/solve.gms index d95a53e8b4..be5dad4856 100644 --- a/modules/80_optimization/nlp_apr17/solve.gms +++ b/modules/80_optimization/nlp_apr17/solve.gms @@ -21,7 +21,7 @@ magpie.holdfixed = 1 ; $onecho > conopt4.opt Lim_Variable = 1.e25 Tol_Feas_Min = 3.e-13 -Tol_Feas_Max = 1.e-3 +Tol_Feas_Max = 1.e-10 $offecho $onecho > conopt4.op2 From d1931dd3d62493b356289d2ac264570569125c77 Mon Sep 17 00:00:00 2001 From: Debbora Leip Date: Tue, 5 Nov 2024 10:29:44 +0100 Subject: [PATCH 108/206] added newline at end of files --- modules/36_employment/exo_may22/input/files | 2 +- modules/38_factor_costs/input/files | 2 +- modules/38_factor_costs/sticky_feb18/input/files | 2 +- modules/38_factor_costs/sticky_labor/input/files | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/modules/36_employment/exo_may22/input/files b/modules/36_employment/exo_may22/input/files index 4509b91c06..adbd3d2b95 100644 --- a/modules/36_employment/exo_may22/input/files +++ b/modules/36_employment/exo_may22/input/files @@ -5,4 +5,4 @@ f36_historic_hourly_labor_costs.csv f36_regression_hourly_labor_costs.csv f36_historic_ag_employment.csv f36_unspecified_subsidies.csv -f36_nonmagpie_factor_costs.csv \ No newline at end of file +f36_nonmagpie_factor_costs.csv diff --git a/modules/38_factor_costs/input/files b/modules/38_factor_costs/input/files index 1f2dd5d67d..fda8548a95 100644 --- a/modules/38_factor_costs/input/files +++ b/modules/38_factor_costs/input/files @@ -3,4 +3,4 @@ f38_historical_share_iso.csv f38_regression_cap_share.csv f38_fac_req_fao.csv f38_fac_req_fao_regional.cs4 -f38_hist_factor_costs_iso.csv \ No newline at end of file +f38_hist_factor_costs_iso.csv diff --git a/modules/38_factor_costs/sticky_feb18/input/files b/modules/38_factor_costs/sticky_feb18/input/files index 55e0b4bc59..dbebab811f 100644 --- a/modules/38_factor_costs/sticky_feb18/input/files +++ b/modules/38_factor_costs/sticky_feb18/input/files @@ -3,4 +3,4 @@ f38_region_yield.csv f38_historical_share_iso.csv f38_regression_cap_share.csv f38_fac_req_fao.csv -f38_hist_factor_costs_iso.csv \ No newline at end of file +f38_hist_factor_costs_iso.csv diff --git a/modules/38_factor_costs/sticky_labor/input/files b/modules/38_factor_costs/sticky_labor/input/files index 55e0b4bc59..dbebab811f 100644 --- a/modules/38_factor_costs/sticky_labor/input/files +++ b/modules/38_factor_costs/sticky_labor/input/files @@ -3,4 +3,4 @@ f38_region_yield.csv f38_historical_share_iso.csv f38_regression_cap_share.csv f38_fac_req_fao.csv -f38_hist_factor_costs_iso.csv \ No newline at end of file +f38_hist_factor_costs_iso.csv From 1e439cdd223569062c9d05c9a7553848c91a0ecb Mon Sep 17 00:00:00 2001 From: florianh Date: Tue, 5 Nov 2024 11:05:42 +0100 Subject: [PATCH 109/206] update --- modules/44_biodiversity/bii_target/equations.gms | 3 ++- modules/44_biodiversity/bii_target/presolve.gms | 2 +- modules/44_biodiversity/bii_target_apr24/equations.gms | 7 ++++--- modules/44_biodiversity/bii_target_apr24/preloop.gms | 4 ++-- modules/44_biodiversity/bii_target_apr24/presolve.gms | 2 +- modules/80_optimization/lp_nlp_apr17/solve.gms | 2 +- modules/80_optimization/nlp_apr17/solve.gms | 3 +-- modules/80_optimization/nlp_par/solve.gms | 2 +- 8 files changed, 13 insertions(+), 12 deletions(-) diff --git a/modules/44_biodiversity/bii_target/equations.gms b/modules/44_biodiversity/bii_target/equations.gms index cc753571e8..eb730f0a96 100644 --- a/modules/44_biodiversity/bii_target/equations.gms +++ b/modules/44_biodiversity/bii_target/equations.gms @@ -10,7 +10,8 @@ *' The Biodiversity Intactness Index (BII) is calculated at the level of 71 biomes. *' The regional layer is needed for compatibility with the high resolution parallel optimization output script (scripts/output/extra/highres.R) - q44_bii(i2,biome44)$(sum(cell(i2,j2), f44_biome(j2,biome44)) > 1e-10) .. v44_bii(i2,biome44) * sum((cell(i2,j2),land), pcm_land(j2,land) * f44_biome(j2,biome44)) + q44_bii(i2,biome44)$(sum(cell(i2,j2), f44_biome(j2,biome44)) > 1e-10) .. + v44_bii(i2,biome44) * sum((cell(i2,j2),land), pcm_land(j2,land) * f44_biome(j2,biome44)) =e= sum((cell(i2,j2),potnatveg,landcover44), vm_bv(j2,landcover44,potnatveg) * f44_biome(j2,biome44)); diff --git a/modules/44_biodiversity/bii_target/presolve.gms b/modules/44_biodiversity/bii_target/presolve.gms index de414061ef..88dc5aba91 100644 --- a/modules/44_biodiversity/bii_target/presolve.gms +++ b/modules/44_biodiversity/bii_target/presolve.gms @@ -23,7 +23,7 @@ else ); p44_bii_lower_bound(t2,i,biome44)$(p44_bii_lower_bound(t2,i,biome44) >= 1) = 1; p44_bii_lower_bound(t2,i,biome44)$(m_year(t2) < s44_start_year) = 0; - p44_bii_lower_bound(t2,i,biome44)$(sum(cell(i,j), f44_biome(j,biome44)) = 0) = 0; + p44_bii_lower_bound(t2,i,biome44)$(sum(cell(i,j), f44_biome(j,biome44)) <= 1e-10) = 0; * The lower bound of `v44_bii` is set to `p44_bii_lower_bound` to avoid a reduction of BII in combination with `v44_bii_missing`. v44_bii.lo(i,biome44) = p44_bii_lower_bound(t,i,biome44); display p44_bii_lower_bound; diff --git a/modules/44_biodiversity/bii_target_apr24/equations.gms b/modules/44_biodiversity/bii_target_apr24/equations.gms index 3e084c12a2..e0584c0b98 100644 --- a/modules/44_biodiversity/bii_target_apr24/equations.gms +++ b/modules/44_biodiversity/bii_target_apr24/equations.gms @@ -11,14 +11,15 @@ *' Biodiversity stock weighted by range-rarity restoration prioritization layer (`f44_rr_layer`) *' The regional layer is needed for compatibility with the high resolution parallel optimization output script (scripts/output/extra/highres.R) - q44_bii(i2,biome44)$(sum(cell(i2,j2), f44_biome(j2,biome44)*f44_rr_layer(j2)) > 1e-6) .. v44_bii(i2,biome44) + q44_bii(i2,biome44)$(sum(cell(i2,j2), f44_biome(j2,biome44)*f44_rr_layer(j2)) > 1e-10) .. + v44_bii(i2,biome44) * sum((cell(i2,j2),land), pcm_land(j2,land) * f44_rr_layer(j2) * f44_biome(j2,biome44)) =e= - (sum((cell(i2,j2),potnatveg,landcover44), vm_bv(j2,landcover44,potnatveg) * f44_rr_layer(j2) * f44_biome(j2,biome44)) / sum((cell(i2,j2),land), pcm_land(j2,land) * f44_rr_layer(j2) * f44_biome(j2,biome44))); + sum((cell(i2,j2),potnatveg,landcover44), vm_bv(j2,landcover44,potnatveg) * f44_rr_layer(j2) * f44_biome(j2,biome44)); *' For each of the 71 biomes, the BII has to meet a minium level based on `s44_bii_lower_bound`. *' `v44_bii_missing` is a technical variable to maintain feasibility in case `v44_bii` cannot be increased. - q44_bii_target(i2,biome44)$(sum(cell(i2,j2), f44_biome(j2,biome44)*f44_rr_layer(j2)) > 1e-6) .. + q44_bii_target(i2,biome44)$(sum(cell(i2,j2), f44_biome(j2,biome44)*f44_rr_layer(j2)) > 1e-10) .. v44_bii(i2,biome44) + v44_bii_missing(i2,biome44) =g= sum(ct, p44_bii_lower_bound(ct,i2,biome44)); *' Costs accrue only for `v44_bii_missing`. In the best case costs should be zero or close to zero. diff --git a/modules/44_biodiversity/bii_target_apr24/preloop.gms b/modules/44_biodiversity/bii_target_apr24/preloop.gms index 589c41bec0..717263d631 100644 --- a/modules/44_biodiversity/bii_target_apr24/preloop.gms +++ b/modules/44_biodiversity/bii_target_apr24/preloop.gms @@ -7,8 +7,8 @@ v44_bii.l(i,biome44) = 0.75; -v44_bii.fx(i,biome44)$(sum(cell(i,j), f44_biome(j,biome44)*f44_rr_layer(j)) <= 1e-6) = 0; -v44_bii_missing.fx(i,biome44)$(sum(cell(i,j), f44_biome(j,biome44)*f44_rr_layer(j)) <= 1e-6) = 0; +v44_bii.fx(i,biome44)$(sum(cell(i,j), f44_biome(j,biome44)*f44_rr_layer(j)) <= 1e-10) = 0; +v44_bii_missing.fx(i,biome44)$(sum(cell(i,j), f44_biome(j,biome44)*f44_rr_layer(j)) <= 1e-10) = 0; p44_bii_lower_bound(t,i,biome44) = 0; vm_bv.l(j,landcover44,potnatveg) = 0; diff --git a/modules/44_biodiversity/bii_target_apr24/presolve.gms b/modules/44_biodiversity/bii_target_apr24/presolve.gms index 4af7a228cc..487b68041a 100644 --- a/modules/44_biodiversity/bii_target_apr24/presolve.gms +++ b/modules/44_biodiversity/bii_target_apr24/presolve.gms @@ -23,7 +23,7 @@ else ); p44_bii_lower_bound(t2,i,biome44)$(p44_bii_lower_bound(t2,i,biome44) >= 1) = 1; p44_bii_lower_bound(t2,i,biome44)$(m_year(t2) < s44_start_year) = 0; - p44_bii_lower_bound(t2,i,biome44)$(sum(cell(i,j), f44_biome(j,biome44)**f44_rr_layer(j)) <= 1e-6) = 0; + p44_bii_lower_bound(t2,i,biome44)$(sum(cell(i,j), f44_biome(j,biome44)**f44_rr_layer(j)) <= 1e-10) = 0; * The lower bound of `v44_bii` is set to `p44_bii_lower_bound` to avoid a reduction of BII in combination with `v44_bii_missing`. v44_bii.lo(i,biome44) = p44_bii_lower_bound(t,i,biome44); display p44_bii_lower_bound; diff --git a/modules/80_optimization/lp_nlp_apr17/solve.gms b/modules/80_optimization/lp_nlp_apr17/solve.gms index bca87a9b38..e492dd9a36 100644 --- a/modules/80_optimization/lp_nlp_apr17/solve.gms +++ b/modules/80_optimization/lp_nlp_apr17/solve.gms @@ -36,7 +36,7 @@ $endif $onecho > conopt4.opt Lim_Variable = 1.e25 -Tol_Feas_Min = 3.e-13 +Tol_Bound = 1.e-10 $offecho $onecho > conopt4.op2 diff --git a/modules/80_optimization/nlp_apr17/solve.gms b/modules/80_optimization/nlp_apr17/solve.gms index be5dad4856..62dd0aee3d 100644 --- a/modules/80_optimization/nlp_apr17/solve.gms +++ b/modules/80_optimization/nlp_apr17/solve.gms @@ -20,8 +20,7 @@ magpie.holdfixed = 1 ; $onecho > conopt4.opt Lim_Variable = 1.e25 -Tol_Feas_Min = 3.e-13 -Tol_Feas_Max = 1.e-10 +Tol_Bound = 1.e-10 $offecho $onecho > conopt4.op2 diff --git a/modules/80_optimization/nlp_par/solve.gms b/modules/80_optimization/nlp_par/solve.gms index d634213781..a3151692f2 100644 --- a/modules/80_optimization/nlp_par/solve.gms +++ b/modules/80_optimization/nlp_par/solve.gms @@ -23,7 +23,7 @@ magpie.savepoint = 0; $onecho > conopt4.opt Lim_Variable = 1.e25 -Tol_Feas_Min = 3.e-13 +Tol_Bound = 1.e-10 $offecho $onecho > conopt4.op2 From a07bd31f5fca23a4e10b2f82defa1912c5529a36 Mon Sep 17 00:00:00 2001 From: florianh Date: Tue, 5 Nov 2024 11:23:42 +0100 Subject: [PATCH 110/206] update --- modules/80_optimization/lp_nlp_apr17/solve.gms | 2 ++ modules/80_optimization/nlp_apr17/solve.gms | 2 ++ modules/80_optimization/nlp_par/solve.gms | 2 ++ 3 files changed, 6 insertions(+) diff --git a/modules/80_optimization/lp_nlp_apr17/solve.gms b/modules/80_optimization/lp_nlp_apr17/solve.gms index e492dd9a36..f84f03fc11 100644 --- a/modules/80_optimization/lp_nlp_apr17/solve.gms +++ b/modules/80_optimization/lp_nlp_apr17/solve.gms @@ -37,6 +37,8 @@ $endif $onecho > conopt4.opt Lim_Variable = 1.e25 Tol_Bound = 1.e-10 +Tol_Opt_Infeas = 1.e-10 +Tol_Optimality = 1.e-10 $offecho $onecho > conopt4.op2 diff --git a/modules/80_optimization/nlp_apr17/solve.gms b/modules/80_optimization/nlp_apr17/solve.gms index 62dd0aee3d..6956fe7f9f 100644 --- a/modules/80_optimization/nlp_apr17/solve.gms +++ b/modules/80_optimization/nlp_apr17/solve.gms @@ -21,6 +21,8 @@ magpie.holdfixed = 1 ; $onecho > conopt4.opt Lim_Variable = 1.e25 Tol_Bound = 1.e-10 +Tol_Opt_Infeas = 1.e-10 +Tol_Optimality = 1.e-10 $offecho $onecho > conopt4.op2 diff --git a/modules/80_optimization/nlp_par/solve.gms b/modules/80_optimization/nlp_par/solve.gms index a3151692f2..3aae972646 100644 --- a/modules/80_optimization/nlp_par/solve.gms +++ b/modules/80_optimization/nlp_par/solve.gms @@ -24,6 +24,8 @@ magpie.savepoint = 0; $onecho > conopt4.opt Lim_Variable = 1.e25 Tol_Bound = 1.e-10 +Tol_Opt_Infeas = 1.e-10 +Tol_Optimality = 1.e-10 $offecho $onecho > conopt4.op2 From 1fac4e5d559bea1b50c3934b6626634d396e079c Mon Sep 17 00:00:00 2001 From: florianh Date: Tue, 5 Nov 2024 12:11:36 +0100 Subject: [PATCH 111/206] test --- modules/10_land/landmatrix_dec18/equations.gms | 3 +-- modules/10_land/landmatrix_dec18/preloop.gms | 3 +++ 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/modules/10_land/landmatrix_dec18/equations.gms b/modules/10_land/landmatrix_dec18/equations.gms index e086f12cfa..719eaa91ad 100644 --- a/modules/10_land/landmatrix_dec18/equations.gms +++ b/modules/10_land/landmatrix_dec18/equations.gms @@ -17,8 +17,7 @@ *' `v10_balance_negative`should deviate from zero only in exceptional cases. q10_transition_matrix(j2) .. - sum((land_from,land_to), vm_lu_transitions(j2,land_from,land_to)) - + v10_balance_positive(j2) - v10_balance_negative(j2) =e= + sum((land_from,land_to), vm_lu_transitions(j2,land_from,land_to)) =e= sum(land, pcm_land(j2,land)); q10_transition_to(j2,land_to) .. diff --git a/modules/10_land/landmatrix_dec18/preloop.gms b/modules/10_land/landmatrix_dec18/preloop.gms index 3a209b115b..798cbba3b1 100644 --- a/modules/10_land/landmatrix_dec18/preloop.gms +++ b/modules/10_land/landmatrix_dec18/preloop.gms @@ -4,3 +4,6 @@ *** | 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 + +v10_balance_positive.fx(j) = 0; +v10_balance_negative.fx(j) = 0; From 6a8a23f29cb995f58d61b03b907128dd6f3eb2a6 Mon Sep 17 00:00:00 2001 From: florianh Date: Tue, 5 Nov 2024 13:24:20 +0100 Subject: [PATCH 112/206] bugfix --- modules/10_land/landmatrix_dec18/equations.gms | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/modules/10_land/landmatrix_dec18/equations.gms b/modules/10_land/landmatrix_dec18/equations.gms index 719eaa91ad..328b92b5eb 100644 --- a/modules/10_land/landmatrix_dec18/equations.gms +++ b/modules/10_land/landmatrix_dec18/equations.gms @@ -18,7 +18,7 @@ q10_transition_matrix(j2) .. sum((land_from,land_to), vm_lu_transitions(j2,land_from,land_to)) =e= - sum(land, pcm_land(j2,land)); + sum(land, vm_land(j2,land)); q10_transition_to(j2,land_to) .. sum(land_from, vm_lu_transitions(j2,land_from,land_to)) =e= @@ -26,7 +26,7 @@ q10_transition_from(j2,land_from) .. sum(land_to, vm_lu_transitions(j2,land_from,land_to)) =e= - pcm_land(j2,land_from); + vm_land.l(j2,land_from); *' The following two equations calculate land expansion and land contraction based *' on the above land transition matrix. From 492c783625c6dd9824a4cc3cc43523651dde4981 Mon Sep 17 00:00:00 2001 From: florianh Date: Tue, 5 Nov 2024 13:49:51 +0100 Subject: [PATCH 113/206] update --- modules/10_land/landmatrix_dec18/declarations.gms | 4 ++-- modules/10_land/landmatrix_dec18/equations.gms | 4 ++-- modules/10_land/landmatrix_dec18/preloop.gms | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/modules/10_land/landmatrix_dec18/declarations.gms b/modules/10_land/landmatrix_dec18/declarations.gms index 172ec3792d..be999bbc39 100644 --- a/modules/10_land/landmatrix_dec18/declarations.gms +++ b/modules/10_land/landmatrix_dec18/declarations.gms @@ -21,8 +21,8 @@ positive variables vm_landreduction(j,land) Land reduction (mio. ha) vm_cost_land_transition(j) Costs for lu transitions (mio. USD17MER per yr) vm_lu_transitions(j,land_from,land_to) Land transitions between time steps (mio. ha) - v10_balance_positive(j) Balance variable for land transitions (mio. ha) - v10_balance_negative(j) Balance variable for land transitions (mio. ha) + v10_balance_positive(j,land_from) Balance variable for land transitions (mio. ha) + v10_balance_negative(j,land_from) Balance variable for land transitions (mio. ha) ; equations diff --git a/modules/10_land/landmatrix_dec18/equations.gms b/modules/10_land/landmatrix_dec18/equations.gms index 328b92b5eb..55ee823251 100644 --- a/modules/10_land/landmatrix_dec18/equations.gms +++ b/modules/10_land/landmatrix_dec18/equations.gms @@ -26,7 +26,7 @@ q10_transition_from(j2,land_from) .. sum(land_to, vm_lu_transitions(j2,land_from,land_to)) =e= - vm_land.l(j2,land_from); + vm_land.l(j2,land_from) + v10_balance_positive(j2,land_from) - v10_balance_negative(j2,land_from); *' The following two equations calculate land expansion and land contraction based *' on the above land transition matrix. @@ -46,7 +46,7 @@ q10_cost(j2) .. vm_cost_land_transition(j2) =e= sum(land, vm_landexpansion(j2,land) + vm_landreduction(j2,land)) * 1 - + (v10_balance_positive(j2) + v10_balance_negative(j2)) * s10_cost_balance; + + sum(land_from, v10_balance_positive(j2,land_from) + v10_balance_negative(j2,land_from)) * s10_cost_balance; *' The gross changes in land are calculated based on land expansion, land *' contraction and land changes from within the modules [35_natveg] diff --git a/modules/10_land/landmatrix_dec18/preloop.gms b/modules/10_land/landmatrix_dec18/preloop.gms index 798cbba3b1..3523a193e4 100644 --- a/modules/10_land/landmatrix_dec18/preloop.gms +++ b/modules/10_land/landmatrix_dec18/preloop.gms @@ -5,5 +5,5 @@ *** | MAgPIE License Exception, version 1.0 (see LICENSE file). *** | Contact: magpie@pik-potsdam.de -v10_balance_positive.fx(j) = 0; -v10_balance_negative.fx(j) = 0; +*v10_balance_positive.fx(j) = 0; +*v10_balance_negative.fx(j) = 0; From 99e089085894988721fcf9d6970ece84963a0fcd Mon Sep 17 00:00:00 2001 From: florianh Date: Tue, 5 Nov 2024 13:53:18 +0100 Subject: [PATCH 114/206] fix --- modules/10_land/landmatrix_dec18/scaling.gms | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/modules/10_land/landmatrix_dec18/scaling.gms b/modules/10_land/landmatrix_dec18/scaling.gms index 7698c27b82..72e83b61f5 100644 --- a/modules/10_land/landmatrix_dec18/scaling.gms +++ b/modules/10_land/landmatrix_dec18/scaling.gms @@ -6,5 +6,5 @@ *** | Contact: magpie@pik-potsdam.de vm_landdiff.scale = 10e3; -v10_balance_positive.scale(j) = 10e-9; -v10_balance_negative.scale(j) = 10e-9; +*v10_balance_positive.scale(j) = 10e-9; +*v10_balance_negative.scale(j) = 10e-9; From d905f25616014b90109fa02f70b213264b6000b8 Mon Sep 17 00:00:00 2001 From: florianh Date: Tue, 5 Nov 2024 14:34:07 +0100 Subject: [PATCH 115/206] update --- .../10_land/landmatrix_dec18/declarations.gms | 4 ++-- modules/10_land/landmatrix_dec18/postsolve.gms | 16 ++++++++-------- .../sticky_labor/declarations.gms | 2 +- .../bii_target_apr24/equations.gms | 4 ++-- .../44_biodiversity/bii_target_apr24/preloop.gms | 4 ++-- .../bii_target_apr24/presolve.gms | 2 +- .../bii_target_apr24/realization.gms | 1 + .../44_biodiversity/bii_target_apr24/scaling.gms | 9 +++++++++ 8 files changed, 26 insertions(+), 16 deletions(-) create mode 100644 modules/44_biodiversity/bii_target_apr24/scaling.gms diff --git a/modules/10_land/landmatrix_dec18/declarations.gms b/modules/10_land/landmatrix_dec18/declarations.gms index be999bbc39..2b7346ff73 100644 --- a/modules/10_land/landmatrix_dec18/declarations.gms +++ b/modules/10_land/landmatrix_dec18/declarations.gms @@ -43,8 +43,8 @@ parameters ov_landreduction(t,j,land,type) Land reduction (mio. ha) ov_cost_land_transition(t,j,type) Costs for lu transitions (mio. USD17MER per yr) ov_lu_transitions(t,j,land_from,land_to,type) Land transitions between time steps (mio. ha) - ov10_balance_positive(t,j,type) Balance variable for land transitions (mio. ha) - ov10_balance_negative(t,j,type) Balance variable for land transitions (mio. ha) + ov10_balance_positive(t,j,land_from,type) Balance variable for land transitions (mio. ha) + ov10_balance_negative(t,j,land_from,type) Balance variable for land transitions (mio. ha) oq10_transition_matrix(t,j,type) Land transition constraint cell area (mio. ha) oq10_transition_to(t,j,land_to,type) Land transition constraint to (mio. ha) oq10_transition_from(t,j,land_from,type) Land transition constraint from (mio. ha) diff --git a/modules/10_land/landmatrix_dec18/postsolve.gms b/modules/10_land/landmatrix_dec18/postsolve.gms index b7e9c5277e..75565d91fc 100644 --- a/modules/10_land/landmatrix_dec18/postsolve.gms +++ b/modules/10_land/landmatrix_dec18/postsolve.gms @@ -15,8 +15,8 @@ pcm_land(j,land) = vm_land.l(j,land); ov_landreduction(t,j,land,"marginal") = vm_landreduction.m(j,land); ov_cost_land_transition(t,j,"marginal") = vm_cost_land_transition.m(j); ov_lu_transitions(t,j,land_from,land_to,"marginal") = vm_lu_transitions.m(j,land_from,land_to); - ov10_balance_positive(t,j,"marginal") = v10_balance_positive.m(j); - ov10_balance_negative(t,j,"marginal") = v10_balance_negative.m(j); + ov10_balance_positive(t,j,land_from,"marginal") = v10_balance_positive.m(j,land_from); + ov10_balance_negative(t,j,land_from,"marginal") = v10_balance_negative.m(j,land_from); oq10_transition_matrix(t,j,"marginal") = q10_transition_matrix.m(j); oq10_transition_to(t,j,land_to,"marginal") = q10_transition_to.m(j,land_to); oq10_transition_from(t,j,land_from,"marginal") = q10_transition_from.m(j,land_from); @@ -30,8 +30,8 @@ pcm_land(j,land) = vm_land.l(j,land); ov_landreduction(t,j,land,"level") = vm_landreduction.l(j,land); ov_cost_land_transition(t,j,"level") = vm_cost_land_transition.l(j); ov_lu_transitions(t,j,land_from,land_to,"level") = vm_lu_transitions.l(j,land_from,land_to); - ov10_balance_positive(t,j,"level") = v10_balance_positive.l(j); - ov10_balance_negative(t,j,"level") = v10_balance_negative.l(j); + ov10_balance_positive(t,j,land_from,"level") = v10_balance_positive.l(j,land_from); + ov10_balance_negative(t,j,land_from,"level") = v10_balance_negative.l(j,land_from); oq10_transition_matrix(t,j,"level") = q10_transition_matrix.l(j); oq10_transition_to(t,j,land_to,"level") = q10_transition_to.l(j,land_to); oq10_transition_from(t,j,land_from,"level") = q10_transition_from.l(j,land_from); @@ -45,8 +45,8 @@ pcm_land(j,land) = vm_land.l(j,land); ov_landreduction(t,j,land,"upper") = vm_landreduction.up(j,land); ov_cost_land_transition(t,j,"upper") = vm_cost_land_transition.up(j); ov_lu_transitions(t,j,land_from,land_to,"upper") = vm_lu_transitions.up(j,land_from,land_to); - ov10_balance_positive(t,j,"upper") = v10_balance_positive.up(j); - ov10_balance_negative(t,j,"upper") = v10_balance_negative.up(j); + ov10_balance_positive(t,j,land_from,"upper") = v10_balance_positive.up(j,land_from); + ov10_balance_negative(t,j,land_from,"upper") = v10_balance_negative.up(j,land_from); oq10_transition_matrix(t,j,"upper") = q10_transition_matrix.up(j); oq10_transition_to(t,j,land_to,"upper") = q10_transition_to.up(j,land_to); oq10_transition_from(t,j,land_from,"upper") = q10_transition_from.up(j,land_from); @@ -60,8 +60,8 @@ pcm_land(j,land) = vm_land.l(j,land); ov_landreduction(t,j,land,"lower") = vm_landreduction.lo(j,land); ov_cost_land_transition(t,j,"lower") = vm_cost_land_transition.lo(j); ov_lu_transitions(t,j,land_from,land_to,"lower") = vm_lu_transitions.lo(j,land_from,land_to); - ov10_balance_positive(t,j,"lower") = v10_balance_positive.lo(j); - ov10_balance_negative(t,j,"lower") = v10_balance_negative.lo(j); + ov10_balance_positive(t,j,land_from,"lower") = v10_balance_positive.lo(j,land_from); + ov10_balance_negative(t,j,land_from,"lower") = v10_balance_negative.lo(j,land_from); oq10_transition_matrix(t,j,"lower") = q10_transition_matrix.lo(j); oq10_transition_to(t,j,land_to,"lower") = q10_transition_to.lo(j,land_to); oq10_transition_from(t,j,land_from,"lower") = q10_transition_from.lo(j,land_from); diff --git a/modules/38_factor_costs/sticky_labor/declarations.gms b/modules/38_factor_costs/sticky_labor/declarations.gms index 3d926064b4..708e08fe82 100644 --- a/modules/38_factor_costs/sticky_labor/declarations.gms +++ b/modules/38_factor_costs/sticky_labor/declarations.gms @@ -54,7 +54,7 @@ parameters ov38_investment_mobile(t,j,type) Investment costs in mobile farm capital (mio USD17MER per yr) ov38_laborhours_need(t,j,kcr,type) Labor required per unit of output (hours per ton DM) ov38_capital_need(t,j,kcr,mobil38,type) Captial required per unit of output (USD17MER per ton DM) - ov38_relax_CES_lp(t,j,kcr,type) Variable to make CES function feasible in linearized model (1) + ov38_relax_CES_lp(t,j,kcr,type) Variable to make CES function feasible in linearized model (1) oq38_cost_prod_labor(t,i,type) Regional labor input costs for crop production (mio USD17MER) oq38_cost_prod_capital(t,i,type) Regional capital input costs for crop production (mio USD17MER) oq38_investment_immobile(t,j,kcr,type) Cellular immobile investments into farm capital (mio USD17MER) diff --git a/modules/44_biodiversity/bii_target_apr24/equations.gms b/modules/44_biodiversity/bii_target_apr24/equations.gms index e0584c0b98..13604ddc05 100644 --- a/modules/44_biodiversity/bii_target_apr24/equations.gms +++ b/modules/44_biodiversity/bii_target_apr24/equations.gms @@ -11,7 +11,7 @@ *' Biodiversity stock weighted by range-rarity restoration prioritization layer (`f44_rr_layer`) *' The regional layer is needed for compatibility with the high resolution parallel optimization output script (scripts/output/extra/highres.R) - q44_bii(i2,biome44)$(sum(cell(i2,j2), f44_biome(j2,biome44)*f44_rr_layer(j2)) > 1e-10) .. + q44_bii(i2,biome44)$(sum(cell(i2,j2), f44_biome(j2,biome44)*f44_rr_layer(j2)) > 1e-6) .. v44_bii(i2,biome44) * sum((cell(i2,j2),land), pcm_land(j2,land) * f44_rr_layer(j2) * f44_biome(j2,biome44)) =e= sum((cell(i2,j2),potnatveg,landcover44), vm_bv(j2,landcover44,potnatveg) * f44_rr_layer(j2) * f44_biome(j2,biome44)); @@ -19,7 +19,7 @@ *' For each of the 71 biomes, the BII has to meet a minium level based on `s44_bii_lower_bound`. *' `v44_bii_missing` is a technical variable to maintain feasibility in case `v44_bii` cannot be increased. - q44_bii_target(i2,biome44)$(sum(cell(i2,j2), f44_biome(j2,biome44)*f44_rr_layer(j2)) > 1e-10) .. + q44_bii_target(i2,biome44)$(sum(cell(i2,j2), f44_biome(j2,biome44)*f44_rr_layer(j2)) > 1e-6) .. v44_bii(i2,biome44) + v44_bii_missing(i2,biome44) =g= sum(ct, p44_bii_lower_bound(ct,i2,biome44)); *' Costs accrue only for `v44_bii_missing`. In the best case costs should be zero or close to zero. diff --git a/modules/44_biodiversity/bii_target_apr24/preloop.gms b/modules/44_biodiversity/bii_target_apr24/preloop.gms index 717263d631..589c41bec0 100644 --- a/modules/44_biodiversity/bii_target_apr24/preloop.gms +++ b/modules/44_biodiversity/bii_target_apr24/preloop.gms @@ -7,8 +7,8 @@ v44_bii.l(i,biome44) = 0.75; -v44_bii.fx(i,biome44)$(sum(cell(i,j), f44_biome(j,biome44)*f44_rr_layer(j)) <= 1e-10) = 0; -v44_bii_missing.fx(i,biome44)$(sum(cell(i,j), f44_biome(j,biome44)*f44_rr_layer(j)) <= 1e-10) = 0; +v44_bii.fx(i,biome44)$(sum(cell(i,j), f44_biome(j,biome44)*f44_rr_layer(j)) <= 1e-6) = 0; +v44_bii_missing.fx(i,biome44)$(sum(cell(i,j), f44_biome(j,biome44)*f44_rr_layer(j)) <= 1e-6) = 0; p44_bii_lower_bound(t,i,biome44) = 0; vm_bv.l(j,landcover44,potnatveg) = 0; diff --git a/modules/44_biodiversity/bii_target_apr24/presolve.gms b/modules/44_biodiversity/bii_target_apr24/presolve.gms index 487b68041a..4af7a228cc 100644 --- a/modules/44_biodiversity/bii_target_apr24/presolve.gms +++ b/modules/44_biodiversity/bii_target_apr24/presolve.gms @@ -23,7 +23,7 @@ else ); p44_bii_lower_bound(t2,i,biome44)$(p44_bii_lower_bound(t2,i,biome44) >= 1) = 1; p44_bii_lower_bound(t2,i,biome44)$(m_year(t2) < s44_start_year) = 0; - p44_bii_lower_bound(t2,i,biome44)$(sum(cell(i,j), f44_biome(j,biome44)**f44_rr_layer(j)) <= 1e-10) = 0; + p44_bii_lower_bound(t2,i,biome44)$(sum(cell(i,j), f44_biome(j,biome44)**f44_rr_layer(j)) <= 1e-6) = 0; * The lower bound of `v44_bii` is set to `p44_bii_lower_bound` to avoid a reduction of BII in combination with `v44_bii_missing`. v44_bii.lo(i,biome44) = p44_bii_lower_bound(t,i,biome44); display p44_bii_lower_bound; diff --git a/modules/44_biodiversity/bii_target_apr24/realization.gms b/modules/44_biodiversity/bii_target_apr24/realization.gms index 1b1298ab5a..f8fbd4252e 100644 --- a/modules/44_biodiversity/bii_target_apr24/realization.gms +++ b/modules/44_biodiversity/bii_target_apr24/realization.gms @@ -19,6 +19,7 @@ $Ifi "%phase%" == "sets" $include "./modules/44_biodiversity/bii_target_apr24/se $Ifi "%phase%" == "declarations" $include "./modules/44_biodiversity/bii_target_apr24/declarations.gms" $Ifi "%phase%" == "input" $include "./modules/44_biodiversity/bii_target_apr24/input.gms" $Ifi "%phase%" == "equations" $include "./modules/44_biodiversity/bii_target_apr24/equations.gms" +$Ifi "%phase%" == "scaling" $include "./modules/44_biodiversity/bii_target_apr24/scaling.gms" $Ifi "%phase%" == "preloop" $include "./modules/44_biodiversity/bii_target_apr24/preloop.gms" $Ifi "%phase%" == "presolve" $include "./modules/44_biodiversity/bii_target_apr24/presolve.gms" $Ifi "%phase%" == "postsolve" $include "./modules/44_biodiversity/bii_target_apr24/postsolve.gms" diff --git a/modules/44_biodiversity/bii_target_apr24/scaling.gms b/modules/44_biodiversity/bii_target_apr24/scaling.gms new file mode 100644 index 0000000000..5e247851b2 --- /dev/null +++ b/modules/44_biodiversity/bii_target_apr24/scaling.gms @@ -0,0 +1,9 @@ +*** | (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 + +v44_bii.scale(i,biome44) = 10e-4; +vm_bv.scale(j,landcover44,potnatveg) = 10e-4; From a3743a6d0e3fa2c74fcf507200777c0617007943 Mon Sep 17 00:00:00 2001 From: florianh Date: Tue, 5 Nov 2024 15:45:45 +0100 Subject: [PATCH 116/206] update --- modules/10_land/landmatrix_dec18/scaling.gms | 4 ++-- modules/44_biodiversity/bii_target_apr24/equations.gms | 4 ++-- modules/44_biodiversity/bii_target_apr24/preloop.gms | 4 ++-- modules/44_biodiversity/bii_target_apr24/presolve.gms | 2 +- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/modules/10_land/landmatrix_dec18/scaling.gms b/modules/10_land/landmatrix_dec18/scaling.gms index 72e83b61f5..661fd10648 100644 --- a/modules/10_land/landmatrix_dec18/scaling.gms +++ b/modules/10_land/landmatrix_dec18/scaling.gms @@ -6,5 +6,5 @@ *** | Contact: magpie@pik-potsdam.de vm_landdiff.scale = 10e3; -*v10_balance_positive.scale(j) = 10e-9; -*v10_balance_negative.scale(j) = 10e-9; +v10_balance_positive.scale(j,land_from) = 10e-3; +v10_balance_negative.scale(j,land_from) = 10e-3; diff --git a/modules/44_biodiversity/bii_target_apr24/equations.gms b/modules/44_biodiversity/bii_target_apr24/equations.gms index 13604ddc05..e0584c0b98 100644 --- a/modules/44_biodiversity/bii_target_apr24/equations.gms +++ b/modules/44_biodiversity/bii_target_apr24/equations.gms @@ -11,7 +11,7 @@ *' Biodiversity stock weighted by range-rarity restoration prioritization layer (`f44_rr_layer`) *' The regional layer is needed for compatibility with the high resolution parallel optimization output script (scripts/output/extra/highres.R) - q44_bii(i2,biome44)$(sum(cell(i2,j2), f44_biome(j2,biome44)*f44_rr_layer(j2)) > 1e-6) .. + q44_bii(i2,biome44)$(sum(cell(i2,j2), f44_biome(j2,biome44)*f44_rr_layer(j2)) > 1e-10) .. v44_bii(i2,biome44) * sum((cell(i2,j2),land), pcm_land(j2,land) * f44_rr_layer(j2) * f44_biome(j2,biome44)) =e= sum((cell(i2,j2),potnatveg,landcover44), vm_bv(j2,landcover44,potnatveg) * f44_rr_layer(j2) * f44_biome(j2,biome44)); @@ -19,7 +19,7 @@ *' For each of the 71 biomes, the BII has to meet a minium level based on `s44_bii_lower_bound`. *' `v44_bii_missing` is a technical variable to maintain feasibility in case `v44_bii` cannot be increased. - q44_bii_target(i2,biome44)$(sum(cell(i2,j2), f44_biome(j2,biome44)*f44_rr_layer(j2)) > 1e-6) .. + q44_bii_target(i2,biome44)$(sum(cell(i2,j2), f44_biome(j2,biome44)*f44_rr_layer(j2)) > 1e-10) .. v44_bii(i2,biome44) + v44_bii_missing(i2,biome44) =g= sum(ct, p44_bii_lower_bound(ct,i2,biome44)); *' Costs accrue only for `v44_bii_missing`. In the best case costs should be zero or close to zero. diff --git a/modules/44_biodiversity/bii_target_apr24/preloop.gms b/modules/44_biodiversity/bii_target_apr24/preloop.gms index 589c41bec0..717263d631 100644 --- a/modules/44_biodiversity/bii_target_apr24/preloop.gms +++ b/modules/44_biodiversity/bii_target_apr24/preloop.gms @@ -7,8 +7,8 @@ v44_bii.l(i,biome44) = 0.75; -v44_bii.fx(i,biome44)$(sum(cell(i,j), f44_biome(j,biome44)*f44_rr_layer(j)) <= 1e-6) = 0; -v44_bii_missing.fx(i,biome44)$(sum(cell(i,j), f44_biome(j,biome44)*f44_rr_layer(j)) <= 1e-6) = 0; +v44_bii.fx(i,biome44)$(sum(cell(i,j), f44_biome(j,biome44)*f44_rr_layer(j)) <= 1e-10) = 0; +v44_bii_missing.fx(i,biome44)$(sum(cell(i,j), f44_biome(j,biome44)*f44_rr_layer(j)) <= 1e-10) = 0; p44_bii_lower_bound(t,i,biome44) = 0; vm_bv.l(j,landcover44,potnatveg) = 0; diff --git a/modules/44_biodiversity/bii_target_apr24/presolve.gms b/modules/44_biodiversity/bii_target_apr24/presolve.gms index 4af7a228cc..487b68041a 100644 --- a/modules/44_biodiversity/bii_target_apr24/presolve.gms +++ b/modules/44_biodiversity/bii_target_apr24/presolve.gms @@ -23,7 +23,7 @@ else ); p44_bii_lower_bound(t2,i,biome44)$(p44_bii_lower_bound(t2,i,biome44) >= 1) = 1; p44_bii_lower_bound(t2,i,biome44)$(m_year(t2) < s44_start_year) = 0; - p44_bii_lower_bound(t2,i,biome44)$(sum(cell(i,j), f44_biome(j,biome44)**f44_rr_layer(j)) <= 1e-6) = 0; + p44_bii_lower_bound(t2,i,biome44)$(sum(cell(i,j), f44_biome(j,biome44)**f44_rr_layer(j)) <= 1e-10) = 0; * The lower bound of `v44_bii` is set to `p44_bii_lower_bound` to avoid a reduction of BII in combination with `v44_bii_missing`. v44_bii.lo(i,biome44) = p44_bii_lower_bound(t,i,biome44); display p44_bii_lower_bound; From a378239138d4d520dd48591219dcfa6b58d3387d Mon Sep 17 00:00:00 2001 From: florianh Date: Tue, 5 Nov 2024 16:04:22 +0100 Subject: [PATCH 117/206] update --- modules/10_land/landmatrix_dec18/preloop.gms | 3 --- 1 file changed, 3 deletions(-) diff --git a/modules/10_land/landmatrix_dec18/preloop.gms b/modules/10_land/landmatrix_dec18/preloop.gms index 3523a193e4..3a209b115b 100644 --- a/modules/10_land/landmatrix_dec18/preloop.gms +++ b/modules/10_land/landmatrix_dec18/preloop.gms @@ -4,6 +4,3 @@ *** | 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 - -*v10_balance_positive.fx(j) = 0; -*v10_balance_negative.fx(j) = 0; From 4ab91f858816b2f07819bc8c704a6b89a2deee77 Mon Sep 17 00:00:00 2001 From: Debbora Leip Date: Tue, 5 Nov 2024 18:10:32 +0100 Subject: [PATCH 118/206] incorporate comments --- .../per_ton_fao_may22/declarations.gms | 2 +- modules/38_factor_costs/per_ton_fao_may22/preloop.gms | 11 ++++++----- modules/38_factor_costs/sticky_feb18/declarations.gms | 2 +- modules/38_factor_costs/sticky_feb18/preloop.gms | 11 ++++++----- modules/38_factor_costs/sticky_labor/declarations.gms | 2 +- modules/38_factor_costs/sticky_labor/preloop.gms | 11 ++++++----- 6 files changed, 21 insertions(+), 18 deletions(-) diff --git a/modules/38_factor_costs/per_ton_fao_may22/declarations.gms b/modules/38_factor_costs/per_ton_fao_may22/declarations.gms index ca250d3df4..03b0d553a1 100644 --- a/modules/38_factor_costs/per_ton_fao_may22/declarations.gms +++ b/modules/38_factor_costs/per_ton_fao_may22/declarations.gms @@ -16,7 +16,7 @@ vm_cost_prod_crop(i,factors) Regional factor costs of capital and labor for parameter p38_capital_cost_shares_iso(t,iso) Capital shares of factor costs on iso level (1) -p38_share_calibration(iso) Summation factor used to calibrate calculated capital shares with historical values (1) +p38_capital_share_calibration(iso) Summation factor used to calibrate calculated capital shares with historical values (1) pm_factor_cost_shares(t,i,factors) Capital and labor shares of factor costs on regional level (1) i38_fac_req(t_all,i,kcr) Factor requirements (USD17MER per tDM) ; diff --git a/modules/38_factor_costs/per_ton_fao_may22/preloop.gms b/modules/38_factor_costs/per_ton_fao_may22/preloop.gms index 8076e4a47f..44b1a86f39 100644 --- a/modules/38_factor_costs/per_ton_fao_may22/preloop.gms +++ b/modules/38_factor_costs/per_ton_fao_may22/preloop.gms @@ -6,13 +6,14 @@ *** | Contact: magpie@pik-potsdam.de * calculate capital cost shares from regression -p38_share_calibration(iso) = f38_historical_share("y2010",iso) - (f38_reg_parameters("slope") * - log10(im_gdp_pc_ppp_iso("y2010",iso)) + f38_reg_parameters("intercept")); +p38_capital_share_calibration(iso) = sum(t_past$(ord(t_past) eq card(t_past)), f38_historical_share(t_past,iso) - (f38_reg_parameters("slope") * + log10(im_gdp_pc_ppp_iso(t_past,iso)) + f38_reg_parameters("intercept"))); p38_capital_cost_shares_iso(t,iso)$(m_year(t)<2010) = f38_historical_share(t,iso); -p38_capital_cost_shares_iso(t,iso)$(m_year(t)>=2010) = f38_reg_parameters("slope") * log10(im_gdp_pc_ppp_iso(t,iso)) + f38_reg_parameters("intercept") + p38_share_calibration(iso); +p38_capital_cost_shares_iso(t,iso)$(m_year(t)>=2010) = f38_reg_parameters("slope") * log10(im_gdp_pc_ppp_iso(t,iso)) + f38_reg_parameters("intercept") + p38_capital_share_calibration(iso); * aggregate factor cost shares -pm_factor_cost_shares(t,i,"capital") = (1/sum(i_to_iso(i,iso), f38_hist_factor_costs("y2010",iso))) * - sum(i_to_iso(i,iso), f38_hist_factor_costs("y2010",iso) * p38_capital_cost_shares_iso(t,iso)); +pm_factor_cost_shares(t,i,"capital") = sum(t_past$(ord(t_past) eq card(t_past)), + sum(i_to_iso(i,iso), f38_hist_factor_costs(t_past,iso) * p38_capital_cost_shares_iso(t,iso)) / + sum(i_to_iso(i,iso), f38_hist_factor_costs(t_past,iso))); pm_factor_cost_shares(t,i,"labor") = 1 - pm_factor_cost_shares(t,i,"capital"); diff --git a/modules/38_factor_costs/sticky_feb18/declarations.gms b/modules/38_factor_costs/sticky_feb18/declarations.gms index b572876760..5b4d232df5 100644 --- a/modules/38_factor_costs/sticky_feb18/declarations.gms +++ b/modules/38_factor_costs/sticky_feb18/declarations.gms @@ -25,7 +25,7 @@ parameters p38_capital_mobile(t,j) Preexisting mobile capital stocks before investment (mio USD17MER) p38_capital_cost_shares_iso(t,iso) Capital shares of factor costs on iso level (1) - p38_share_calibration(iso) Summation factor used to calibrate calculated capital shares with historical values (1) + p38_capital_share_calibration(iso) Summation factor used to calibrate calculated capital shares with historical values (1) pm_factor_cost_shares(t,i,factors) Capital and labor shares of factor costs on regional level (1) p38_croparea_start(j,w,kcr) Agricultural land initialization area (mio. ha) diff --git a/modules/38_factor_costs/sticky_feb18/preloop.gms b/modules/38_factor_costs/sticky_feb18/preloop.gms index 8076e4a47f..44b1a86f39 100644 --- a/modules/38_factor_costs/sticky_feb18/preloop.gms +++ b/modules/38_factor_costs/sticky_feb18/preloop.gms @@ -6,13 +6,14 @@ *** | Contact: magpie@pik-potsdam.de * calculate capital cost shares from regression -p38_share_calibration(iso) = f38_historical_share("y2010",iso) - (f38_reg_parameters("slope") * - log10(im_gdp_pc_ppp_iso("y2010",iso)) + f38_reg_parameters("intercept")); +p38_capital_share_calibration(iso) = sum(t_past$(ord(t_past) eq card(t_past)), f38_historical_share(t_past,iso) - (f38_reg_parameters("slope") * + log10(im_gdp_pc_ppp_iso(t_past,iso)) + f38_reg_parameters("intercept"))); p38_capital_cost_shares_iso(t,iso)$(m_year(t)<2010) = f38_historical_share(t,iso); -p38_capital_cost_shares_iso(t,iso)$(m_year(t)>=2010) = f38_reg_parameters("slope") * log10(im_gdp_pc_ppp_iso(t,iso)) + f38_reg_parameters("intercept") + p38_share_calibration(iso); +p38_capital_cost_shares_iso(t,iso)$(m_year(t)>=2010) = f38_reg_parameters("slope") * log10(im_gdp_pc_ppp_iso(t,iso)) + f38_reg_parameters("intercept") + p38_capital_share_calibration(iso); * aggregate factor cost shares -pm_factor_cost_shares(t,i,"capital") = (1/sum(i_to_iso(i,iso), f38_hist_factor_costs("y2010",iso))) * - sum(i_to_iso(i,iso), f38_hist_factor_costs("y2010",iso) * p38_capital_cost_shares_iso(t,iso)); +pm_factor_cost_shares(t,i,"capital") = sum(t_past$(ord(t_past) eq card(t_past)), + sum(i_to_iso(i,iso), f38_hist_factor_costs(t_past,iso) * p38_capital_cost_shares_iso(t,iso)) / + sum(i_to_iso(i,iso), f38_hist_factor_costs(t_past,iso))); pm_factor_cost_shares(t,i,"labor") = 1 - pm_factor_cost_shares(t,i,"capital"); diff --git a/modules/38_factor_costs/sticky_labor/declarations.gms b/modules/38_factor_costs/sticky_labor/declarations.gms index e0c52e4039..3a1c7a6401 100644 --- a/modules/38_factor_costs/sticky_labor/declarations.gms +++ b/modules/38_factor_costs/sticky_labor/declarations.gms @@ -30,7 +30,7 @@ parameters p38_capital_mobile(t,j) Preexisting mobile capital stocks before investment (mio USD17MER) p38_capital_cost_shares_iso(t,iso) Capital shares of factor costs on iso level (1) - p38_share_calibration(iso) Summation factor used to calibrate calculated capital shares with historical values (1) + p38_capital_share_calibration(iso) Summation factor used to calibrate calculated capital shares with historical values (1) pm_factor_cost_shares(t,i,factors) Capital and labor shares of factor costs on regional level (1) p38_min_labor_share(t,j) Minimum labor share out of labor plus capital needed (1) diff --git a/modules/38_factor_costs/sticky_labor/preloop.gms b/modules/38_factor_costs/sticky_labor/preloop.gms index 60050a7597..5b5c0d1649 100644 --- a/modules/38_factor_costs/sticky_labor/preloop.gms +++ b/modules/38_factor_costs/sticky_labor/preloop.gms @@ -11,13 +11,14 @@ s38_ces_elast_par = (1/s38_ces_elast_subst) - 1 ; p38_intr_depr(t,i) = (1-s38_depreciation_rate) * pm_interest(t,i)/(1+pm_interest(t,i)) + s38_depreciation_rate; * calculate capital cost shares from regression -p38_share_calibration(iso) = f38_historical_share("y2010",iso) - (f38_reg_parameters("slope") * - log10(im_gdp_pc_ppp_iso("y2010",iso)) + f38_reg_parameters("intercept")); +p38_capital_share_calibration(iso) = sum(t_past$(ord(t_past) eq card(t_past)), f38_historical_share(t_past,iso) - (f38_reg_parameters("slope") * + log10(im_gdp_pc_ppp_iso(t_past,iso)) + f38_reg_parameters("intercept"))); p38_capital_cost_shares_iso(t,iso)$(m_year(t)<2010) = f38_historical_share(t,iso); -p38_capital_cost_shares_iso(t,iso)$(m_year(t)>=2010) = f38_reg_parameters("slope") * log10(im_gdp_pc_ppp_iso(t,iso)) + f38_reg_parameters("intercept") + p38_share_calibration(iso); +p38_capital_cost_shares_iso(t,iso)$(m_year(t)>=2010) = f38_reg_parameters("slope") * log10(im_gdp_pc_ppp_iso(t,iso)) + f38_reg_parameters("intercept") + p38_capital_share_calibration(iso); * aggregate factor cost shares -pm_factor_cost_shares(t,i,"capital") = (1/sum(i_to_iso(i,iso), f38_hist_factor_costs("y2010",iso))) * - sum(i_to_iso(i,iso), f38_hist_factor_costs("y2010",iso) * p38_capital_cost_shares_iso(t,iso)); +pm_factor_cost_shares(t,i,"capital") = sum(t_past$(ord(t_past) eq card(t_past)), + sum(i_to_iso(i,iso), f38_hist_factor_costs(t_past,iso) * p38_capital_cost_shares_iso(t,iso)) / + sum(i_to_iso(i,iso), f38_hist_factor_costs(t_past,iso))); pm_factor_cost_shares(t,i,"labor") = 1 - pm_factor_cost_shares(t,i,"capital"); From ba9483d3b13ea4cc9913dbdff3c8ad5e6521e947 Mon Sep 17 00:00:00 2001 From: florianh Date: Tue, 5 Nov 2024 20:53:20 +0100 Subject: [PATCH 119/206] test --- modules/10_land/landmatrix_dec18/scaling.gms | 4 ++-- modules/44_biodiversity/bii_target_apr24/scaling.gms | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/modules/10_land/landmatrix_dec18/scaling.gms b/modules/10_land/landmatrix_dec18/scaling.gms index 661fd10648..6f29db5b5e 100644 --- a/modules/10_land/landmatrix_dec18/scaling.gms +++ b/modules/10_land/landmatrix_dec18/scaling.gms @@ -6,5 +6,5 @@ *** | Contact: magpie@pik-potsdam.de vm_landdiff.scale = 10e3; -v10_balance_positive.scale(j,land_from) = 10e-3; -v10_balance_negative.scale(j,land_from) = 10e-3; +*v10_balance_positive.scale(j,land_from) = 10e-3; +*v10_balance_negative.scale(j,land_from) = 10e-3; diff --git a/modules/44_biodiversity/bii_target_apr24/scaling.gms b/modules/44_biodiversity/bii_target_apr24/scaling.gms index 5e247851b2..33a5a12965 100644 --- a/modules/44_biodiversity/bii_target_apr24/scaling.gms +++ b/modules/44_biodiversity/bii_target_apr24/scaling.gms @@ -5,5 +5,5 @@ *** | MAgPIE License Exception, version 1.0 (see LICENSE file). *** | Contact: magpie@pik-potsdam.de -v44_bii.scale(i,biome44) = 10e-4; -vm_bv.scale(j,landcover44,potnatveg) = 10e-4; +*v44_bii.scale(i,biome44) = 10e-4; +*vm_bv.scale(j,landcover44,potnatveg) = 10e-4; From af74fd22a1c06f083a068c9a82e669fe5011d0c5 Mon Sep 17 00:00:00 2001 From: florianh Date: Tue, 5 Nov 2024 21:05:03 +0100 Subject: [PATCH 120/206] update --- modules/80_optimization/lp_nlp_apr17/solve.gms | 3 --- modules/80_optimization/nlp_apr17/solve.gms | 3 --- modules/80_optimization/nlp_par/solve.gms | 3 --- 3 files changed, 9 deletions(-) diff --git a/modules/80_optimization/lp_nlp_apr17/solve.gms b/modules/80_optimization/lp_nlp_apr17/solve.gms index f84f03fc11..c3250b566c 100644 --- a/modules/80_optimization/lp_nlp_apr17/solve.gms +++ b/modules/80_optimization/lp_nlp_apr17/solve.gms @@ -36,9 +36,6 @@ $endif $onecho > conopt4.opt Lim_Variable = 1.e25 -Tol_Bound = 1.e-10 -Tol_Opt_Infeas = 1.e-10 -Tol_Optimality = 1.e-10 $offecho $onecho > conopt4.op2 diff --git a/modules/80_optimization/nlp_apr17/solve.gms b/modules/80_optimization/nlp_apr17/solve.gms index 6956fe7f9f..7dc3b1198d 100644 --- a/modules/80_optimization/nlp_apr17/solve.gms +++ b/modules/80_optimization/nlp_apr17/solve.gms @@ -20,9 +20,6 @@ magpie.holdfixed = 1 ; $onecho > conopt4.opt Lim_Variable = 1.e25 -Tol_Bound = 1.e-10 -Tol_Opt_Infeas = 1.e-10 -Tol_Optimality = 1.e-10 $offecho $onecho > conopt4.op2 diff --git a/modules/80_optimization/nlp_par/solve.gms b/modules/80_optimization/nlp_par/solve.gms index 3aae972646..60d888a72e 100644 --- a/modules/80_optimization/nlp_par/solve.gms +++ b/modules/80_optimization/nlp_par/solve.gms @@ -23,9 +23,6 @@ magpie.savepoint = 0; $onecho > conopt4.opt Lim_Variable = 1.e25 -Tol_Bound = 1.e-10 -Tol_Opt_Infeas = 1.e-10 -Tol_Optimality = 1.e-10 $offecho $onecho > conopt4.op2 From d386fb180e1a52e59f6ed6a4a18a6f43c0dd7e89 Mon Sep 17 00:00:00 2001 From: florianh Date: Tue, 5 Nov 2024 21:18:32 +0100 Subject: [PATCH 121/206] test --- modules/10_land/landmatrix_dec18/scaling.gms | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/modules/10_land/landmatrix_dec18/scaling.gms b/modules/10_land/landmatrix_dec18/scaling.gms index 6f29db5b5e..661fd10648 100644 --- a/modules/10_land/landmatrix_dec18/scaling.gms +++ b/modules/10_land/landmatrix_dec18/scaling.gms @@ -6,5 +6,5 @@ *** | Contact: magpie@pik-potsdam.de vm_landdiff.scale = 10e3; -*v10_balance_positive.scale(j,land_from) = 10e-3; -*v10_balance_negative.scale(j,land_from) = 10e-3; +v10_balance_positive.scale(j,land_from) = 10e-3; +v10_balance_negative.scale(j,land_from) = 10e-3; From 44bfabf0ef5cc40a3c6358ad5ddb95124177515a Mon Sep 17 00:00:00 2001 From: Debbora Leip Date: Tue, 5 Nov 2024 22:03:52 +0100 Subject: [PATCH 122/206] updated preprocessing --- config/default.cfg | 6 +++--- config/projects/scenario_config_el2.csv | 2 +- config/projects/scenario_config_fsec.csv | 6 +++--- config/scenario_config.csv | 2 +- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/config/default.cfg b/config/default.cfg index 21f3598876..f15f836398 100644 --- a/config/default.cfg +++ b/config/default.cfg @@ -22,9 +22,9 @@ cfg$model <- "main.gms" #def = "main.gms" #### input settings #### # which input data sets should be used? -cfg$input <- c(regional = "rev4.114_testUSDAupdate_v7_h12_magpie.tgz", - cellular = "rev4.114_testUSDAupdate_v7_h12_fd712c0b_cellularmagpie_c200_MRI-ESM2-0-ssp370_lpjml-8e6c5eb1.tgz", - validation = "rev4.114_testUSDAupdate_v7_h12_validation.tgz", +cfg$input <- c(regional = "rev4.115_h12_magpie.tgz", + cellular = "rev4.115_h12_0bd54110_cellularmagpie_c200_MRI-ESM2-0-ssp119_lpjml-8e6c5eb1.tgz", + validation = "rev4.115_h12_validation.tgz", additional = "additional_data_rev4.57.tgz", calibration = "calibration_H12_27Sep24.tgz") diff --git a/config/projects/scenario_config_el2.csv b/config/projects/scenario_config_el2.csv index c9b84c1c5f..4fb7c28973 100644 --- a/config/projects/scenario_config_el2.csv +++ b/config/projects/scenario_config_el2.csv @@ -19,5 +19,5 @@ gms$s15_exo_alcohol;1;1;1 gms$s15_alc_scen;0;0;0 gms$factor_costs;sticky_labor;sticky_labor;sticky_labor gms$c70_feed_scen;ssp1;ssp2;ssp2 -input['cellular'];rev4.114EL2_h12_c6a7458f_cellularmagpie_c200_IPSL-CM6A-LR-ssp370_lpjml-8e6c5eb1.tgz;; +input['cellular'];rev4.115EL2_h12_c6a7458f_cellularmagpie_c200_IPSL-CM6A-LR-ssp370_lpjml-8e6c5eb1.tgz;; magicc_emis_scen;REMIND_generic_C_SSP2EU-DSPkB650-DS_betax_DeepDive_noNDC-rem-12.mif;REMIND_generic_C_SSP2EU-DSPkB650-DS_betax_DeepDive_noNDC-rem-12.mif;REMIND_generic_C_SSP2EU-DSPkB650-DS_betax_DeepDive_noNDC-rem-12.mif diff --git a/config/projects/scenario_config_fsec.csv b/config/projects/scenario_config_fsec.csv index 9cbebdbf97..a007d17c34 100644 --- a/config/projects/scenario_config_fsec.csv +++ b/config/projects/scenario_config_fsec.csv @@ -76,9 +76,9 @@ gms$s62_max_dem_bioplastic;0;;;;400;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; gms$c70_fac_req_regr;reg;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; gms$c70_feed_scen;;;;;;;;;;;;;;;;;;ssp1;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; gms$c73_build_demand;;;;;;;;;;;;;;;;;;;;;;;;50pc;;;;;;;;;;;;;;;;;;;;;;;;;;; -input['cellular'];rev4.114_FSEC_3c888fa5_cellularmagpie_c200_MRI-ESM2-0-ssp460_lpjml-8e6c5eb1.tgz;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;rev4.114_FSEC_0bd54110_cellularmagpie_c200_MRI-ESM2-0-ssp119_lpjml-8e6c5eb1.tgz;rev4.114_FSEC_6819938d_cellularmagpie_c200_MRI-ESM2-0-ssp126_lpjml-8e6c5eb1.tgz;;rev4.114_FSEC_1b5c3817_cellularmagpie_c200_MRI-ESM2-0-ssp245_lpjml-8e6c5eb1.tgz;rev4.114_FSEC_3c888fa5_cellularmagpie_c200_MRI-ESM2-0-ssp460_lpjml-8e6c5eb1.tgz;rev4.114_FSEC_fd712c0b_cellularmagpie_c200_MRI-ESM2-0-ssp370_lpjml-8e6c5eb1.tgz;rev4.114_FSEC_09a63995_cellularmagpie_c200_MRI-ESM2-0-ssp585_lpjml-8e6c5eb1.tgz;;; -input['regional'];rev4.114_FSEC_magpie.tgz;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -input['validation'];rev4.114_FSEC_validation.tgz;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +input['cellular'];rev4.115_FSEC_3c888fa5_cellularmagpie_c200_MRI-ESM2-0-ssp460_lpjml-8e6c5eb1.tgz;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;rev4.115_FSEC_0bd54110_cellularmagpie_c200_MRI-ESM2-0-ssp119_lpjml-8e6c5eb1.tgz;rev4.115_FSEC_6819938d_cellularmagpie_c200_MRI-ESM2-0-ssp126_lpjml-8e6c5eb1.tgz;;rev4.115_FSEC_1b5c3817_cellularmagpie_c200_MRI-ESM2-0-ssp245_lpjml-8e6c5eb1.tgz;rev4.115_FSEC_3c888fa5_cellularmagpie_c200_MRI-ESM2-0-ssp460_lpjml-8e6c5eb1.tgz;rev4.115_FSEC_fd712c0b_cellularmagpie_c200_MRI-ESM2-0-ssp370_lpjml-8e6c5eb1.tgz;rev4.115_FSEC_09a63995_cellularmagpie_c200_MRI-ESM2-0-ssp585_lpjml-8e6c5eb1.tgz;;; +input['regional'];rev4.115_FSEC_magpie.tgz;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +input['validation'];rev4.115_FSEC_validation.tgz;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; input['additional'];additional_data_rev4.57.tgz;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; input['calibration'];calibration_FSEC_27Sep24.tgz;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; magicc_emis_scen;bjoernAR6_C_SSP2-NDC.mif;;;bjoernAR6_C_SSP2-PkBudg900.mif;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;bjoernAR6_C_SSP1-NDC.mif;;;;;;;;;;;;bjoernAR6_C_RemSDP-900-MagSSP1.mif;; diff --git a/config/scenario_config.csv b/config/scenario_config.csv index b13b26be80..fe9e64437b 100755 --- a/config/scenario_config.csv +++ b/config/scenario_config.csv @@ -74,4 +74,4 @@ gms$c60_biodem_level;;;;;;;;;;;;;;;;;;;;1;0;;;;;;;;;;;; gms$c60_res_2ndgenBE_dem;;;;ssp1;ssp2;ssp2;ssp3;ssp4;ssp5;sdp;ssp2;sdp;sdp;;;;;;;;;;;;;;;;;;;; gms$c70_feed_scen;;;;ssp1;ssp2;ssp2;ssp3;ssp4;ssp5;ssp1;ssp5;ssp1;ssp1;;;;;;;;;;;;;;;;;;;; gms$s73_timber_demand_switch;;;;;;;;;;;;;;;;;;;;;;;;;1;1;0;;;;;; -input['cellular'];;;;;;;;;;;;;;;;;;;;;;;;;;;;rev4.114_h12_0bd54110_cellularmagpie_c200_MRI-ESM2-0-ssp119_lpjml-8e6c5eb1.tgz;rev4.114_h12_6819938d_cellularmagpie_c200_MRI-ESM2-0-ssp126_lpjml-8e6c5eb1.tgz;rev4.114_h12_1b5c3817_cellularmagpie_c200_MRI-ESM2-0-ssp245_lpjml-8e6c5eb1.tgz;rev4.114_h12_3c888fa5_cellularmagpie_c200_MRI-ESM2-0-ssp460_lpjml-8e6c5eb1.tgz;rev4.114_h12_fd712c0b_cellularmagpie_c200_MRI-ESM2-0-ssp370_lpjml-8e6c5eb1.tgz;rev4.114_h12_09a63995_cellularmagpie_c200_MRI-ESM2-0-ssp585_lpjml-8e6c5eb1.tgz +input['cellular'];;;;;;;;;;;;;;;;;;;;;;;;;;;;rev4.115_h12_0bd54110_cellularmagpie_c200_MRI-ESM2-0-ssp119_lpjml-8e6c5eb1.tgz;rev4.115_h12_6819938d_cellularmagpie_c200_MRI-ESM2-0-ssp126_lpjml-8e6c5eb1.tgz;rev4.115_h12_1b5c3817_cellularmagpie_c200_MRI-ESM2-0-ssp245_lpjml-8e6c5eb1.tgz;rev4.115_h12_3c888fa5_cellularmagpie_c200_MRI-ESM2-0-ssp460_lpjml-8e6c5eb1.tgz;rev4.115_h12_fd712c0b_cellularmagpie_c200_MRI-ESM2-0-ssp370_lpjml-8e6c5eb1.tgz;rev4.115_h12_09a63995_cellularmagpie_c200_MRI-ESM2-0-ssp585_lpjml-8e6c5eb1.tgz From 47f3227b15f161c19efa62f460e7c138ea2847ac Mon Sep 17 00:00:00 2001 From: florianh Date: Tue, 5 Nov 2024 22:42:18 +0100 Subject: [PATCH 123/206] bugfix --- modules/38_factor_costs/sticky_feb18/scaling.gms | 1 - modules/38_factor_costs/sticky_labor/scaling.gms | 2 ++ 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/modules/38_factor_costs/sticky_feb18/scaling.gms b/modules/38_factor_costs/sticky_feb18/scaling.gms index 27fd45cc58..77d6248084 100644 --- a/modules/38_factor_costs/sticky_feb18/scaling.gms +++ b/modules/38_factor_costs/sticky_feb18/scaling.gms @@ -7,4 +7,3 @@ vm_cost_prod_crop.scale(i,factors) = 10e5; v38_investment_immobile.scale(j,kcr) = 10e3; -v38_capital_need.scale(j,kcr,mobil38) = 10e3; diff --git a/modules/38_factor_costs/sticky_labor/scaling.gms b/modules/38_factor_costs/sticky_labor/scaling.gms index d4602db9fe..f24ae1f0b4 100644 --- a/modules/38_factor_costs/sticky_labor/scaling.gms +++ b/modules/38_factor_costs/sticky_labor/scaling.gms @@ -6,3 +6,5 @@ *** | Contact: magpie@pik-potsdam.de vm_cost_prod_crop.scale(i,factors) = 10e4; +v38_investment_immobile.scale(j,kcr) = 10e3; +v38_capital_need.scale(j,kcr,mobil38) = 10e3; From fe8cd67a21d9659ac9453b484d75e65dfd0cb180 Mon Sep 17 00:00:00 2001 From: florianh Date: Wed, 6 Nov 2024 06:48:39 +0100 Subject: [PATCH 124/206] update --- modules/29_cropland/detail_apr24/realization.gms | 1 + .../detail_apr24}/scaling.gms | 4 ++-- modules/38_factor_costs/sticky_labor/scaling.gms | 2 +- .../44_biodiversity/bii_target_apr24/realization.gms | 1 - modules/70_livestock/fbask_jan16/realization.gms | 1 + modules/70_livestock/{ => fbask_jan16}/scaling.gms | 0 .../70_livestock/fbask_jan16_sticky/realization.gms | 1 + .../fbask_jan16_sticky}/scaling.gms | 6 +++--- .../71_disagg_lvst/foragebased_aug18/realization.gms | 1 - modules/71_disagg_lvst/foragebased_aug18/scaling.gms | 10 ---------- .../71_disagg_lvst/foragebased_jul23/realization.gms | 1 - 11 files changed, 9 insertions(+), 19 deletions(-) rename modules/{44_biodiversity/bii_target_apr24 => 29_cropland/detail_apr24}/scaling.gms (82%) rename modules/70_livestock/{ => fbask_jan16}/scaling.gms (100%) rename modules/{71_disagg_lvst/foragebased_jul23 => 70_livestock/fbask_jan16_sticky}/scaling.gms (65%) delete mode 100644 modules/71_disagg_lvst/foragebased_aug18/scaling.gms diff --git a/modules/29_cropland/detail_apr24/realization.gms b/modules/29_cropland/detail_apr24/realization.gms index 071000bd1e..c9b62fec84 100644 --- a/modules/29_cropland/detail_apr24/realization.gms +++ b/modules/29_cropland/detail_apr24/realization.gms @@ -25,6 +25,7 @@ $Ifi "%phase%" == "sets" $include "./modules/29_cropland/detail_apr24/sets.gms" $Ifi "%phase%" == "declarations" $include "./modules/29_cropland/detail_apr24/declarations.gms" $Ifi "%phase%" == "input" $include "./modules/29_cropland/detail_apr24/input.gms" $Ifi "%phase%" == "equations" $include "./modules/29_cropland/detail_apr24/equations.gms" +$Ifi "%phase%" == "scaling" $include "./modules/29_cropland/detail_apr24/scaling.gms" $Ifi "%phase%" == "preloop" $include "./modules/29_cropland/detail_apr24/preloop.gms" $Ifi "%phase%" == "presolve" $include "./modules/29_cropland/detail_apr24/presolve.gms" $Ifi "%phase%" == "postsolve" $include "./modules/29_cropland/detail_apr24/postsolve.gms" diff --git a/modules/44_biodiversity/bii_target_apr24/scaling.gms b/modules/29_cropland/detail_apr24/scaling.gms similarity index 82% rename from modules/44_biodiversity/bii_target_apr24/scaling.gms rename to modules/29_cropland/detail_apr24/scaling.gms index 33a5a12965..49bccf2ac2 100644 --- a/modules/44_biodiversity/bii_target_apr24/scaling.gms +++ b/modules/29_cropland/detail_apr24/scaling.gms @@ -5,5 +5,5 @@ *** | MAgPIE License Exception, version 1.0 (see LICENSE file). *** | Contact: magpie@pik-potsdam.de -*v44_bii.scale(i,biome44) = 10e-4; -*vm_bv.scale(j,landcover44,potnatveg) = 10e-4; +v29_treecover.scale(j,ac) = 10e-3; +v29_treecover_missing.scale(j) = 10e-3; diff --git a/modules/38_factor_costs/sticky_labor/scaling.gms b/modules/38_factor_costs/sticky_labor/scaling.gms index f24ae1f0b4..27fd45cc58 100644 --- a/modules/38_factor_costs/sticky_labor/scaling.gms +++ b/modules/38_factor_costs/sticky_labor/scaling.gms @@ -5,6 +5,6 @@ *** | MAgPIE License Exception, version 1.0 (see LICENSE file). *** | Contact: magpie@pik-potsdam.de -vm_cost_prod_crop.scale(i,factors) = 10e4; +vm_cost_prod_crop.scale(i,factors) = 10e5; v38_investment_immobile.scale(j,kcr) = 10e3; v38_capital_need.scale(j,kcr,mobil38) = 10e3; diff --git a/modules/44_biodiversity/bii_target_apr24/realization.gms b/modules/44_biodiversity/bii_target_apr24/realization.gms index f8fbd4252e..1b1298ab5a 100644 --- a/modules/44_biodiversity/bii_target_apr24/realization.gms +++ b/modules/44_biodiversity/bii_target_apr24/realization.gms @@ -19,7 +19,6 @@ $Ifi "%phase%" == "sets" $include "./modules/44_biodiversity/bii_target_apr24/se $Ifi "%phase%" == "declarations" $include "./modules/44_biodiversity/bii_target_apr24/declarations.gms" $Ifi "%phase%" == "input" $include "./modules/44_biodiversity/bii_target_apr24/input.gms" $Ifi "%phase%" == "equations" $include "./modules/44_biodiversity/bii_target_apr24/equations.gms" -$Ifi "%phase%" == "scaling" $include "./modules/44_biodiversity/bii_target_apr24/scaling.gms" $Ifi "%phase%" == "preloop" $include "./modules/44_biodiversity/bii_target_apr24/preloop.gms" $Ifi "%phase%" == "presolve" $include "./modules/44_biodiversity/bii_target_apr24/presolve.gms" $Ifi "%phase%" == "postsolve" $include "./modules/44_biodiversity/bii_target_apr24/postsolve.gms" diff --git a/modules/70_livestock/fbask_jan16/realization.gms b/modules/70_livestock/fbask_jan16/realization.gms index 97f9aa4279..c3b44b9ebc 100644 --- a/modules/70_livestock/fbask_jan16/realization.gms +++ b/modules/70_livestock/fbask_jan16/realization.gms @@ -84,6 +84,7 @@ $Ifi "%phase%" == "sets" $include "./modules/70_livestock/fbask_jan16/sets.gms" $Ifi "%phase%" == "declarations" $include "./modules/70_livestock/fbask_jan16/declarations.gms" $Ifi "%phase%" == "input" $include "./modules/70_livestock/fbask_jan16/input.gms" $Ifi "%phase%" == "equations" $include "./modules/70_livestock/fbask_jan16/equations.gms" +$Ifi "%phase%" == "scaling" $include "./modules/70_livestock/fbask_jan16/scaling.gms" $Ifi "%phase%" == "preloop" $include "./modules/70_livestock/fbask_jan16/preloop.gms" $Ifi "%phase%" == "presolve" $include "./modules/70_livestock/fbask_jan16/presolve.gms" $Ifi "%phase%" == "postsolve" $include "./modules/70_livestock/fbask_jan16/postsolve.gms" diff --git a/modules/70_livestock/scaling.gms b/modules/70_livestock/fbask_jan16/scaling.gms similarity index 100% rename from modules/70_livestock/scaling.gms rename to modules/70_livestock/fbask_jan16/scaling.gms diff --git a/modules/70_livestock/fbask_jan16_sticky/realization.gms b/modules/70_livestock/fbask_jan16_sticky/realization.gms index 46ff7d5323..734972e767 100644 --- a/modules/70_livestock/fbask_jan16_sticky/realization.gms +++ b/modules/70_livestock/fbask_jan16_sticky/realization.gms @@ -102,6 +102,7 @@ $Ifi "%phase%" == "sets" $include "./modules/70_livestock/fbask_jan16_sticky/set $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%" == "scaling" $include "./modules/70_livestock/fbask_jan16_sticky/scaling.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" diff --git a/modules/71_disagg_lvst/foragebased_jul23/scaling.gms b/modules/70_livestock/fbask_jan16_sticky/scaling.gms similarity index 65% rename from modules/71_disagg_lvst/foragebased_jul23/scaling.gms rename to modules/70_livestock/fbask_jan16_sticky/scaling.gms index c3e721d03f..120fe57164 100644 --- a/modules/71_disagg_lvst/foragebased_jul23/scaling.gms +++ b/modules/70_livestock/fbask_jan16_sticky/scaling.gms @@ -5,6 +5,6 @@ *** | MAgPIE License Exception, version 1.0 (see LICENSE file). *** | Contact: magpie@pik-potsdam.de -vm_costs_additional_mon.scale(i) = 10e4; -*Don't scale this variable. Model is very sensitive to scaling this variable and might become infeasible or very slow. -*v71_feed_balanceflow.scale(j,kforage) = 10e3; + +vm_cost_prod_livst.scale(i,factors) = 10e5; +vm_cost_prod_fish.scale(i) = 10e5; diff --git a/modules/71_disagg_lvst/foragebased_aug18/realization.gms b/modules/71_disagg_lvst/foragebased_aug18/realization.gms index 00e90d4012..94a0fdc42f 100644 --- a/modules/71_disagg_lvst/foragebased_aug18/realization.gms +++ b/modules/71_disagg_lvst/foragebased_aug18/realization.gms @@ -24,7 +24,6 @@ $Ifi "%phase%" == "sets" $include "./modules/71_disagg_lvst/foragebased_aug18/sets.gms" $Ifi "%phase%" == "declarations" $include "./modules/71_disagg_lvst/foragebased_aug18/declarations.gms" $Ifi "%phase%" == "equations" $include "./modules/71_disagg_lvst/foragebased_aug18/equations.gms" -$Ifi "%phase%" == "scaling" $include "./modules/71_disagg_lvst/foragebased_aug18/scaling.gms" $Ifi "%phase%" == "preloop" $include "./modules/71_disagg_lvst/foragebased_aug18/preloop.gms" $Ifi "%phase%" == "postsolve" $include "./modules/71_disagg_lvst/foragebased_aug18/postsolve.gms" *######################## R SECTION END (PHASES) ############################### diff --git a/modules/71_disagg_lvst/foragebased_aug18/scaling.gms b/modules/71_disagg_lvst/foragebased_aug18/scaling.gms deleted file mode 100644 index a9ec69a79e..0000000000 --- a/modules/71_disagg_lvst/foragebased_aug18/scaling.gms +++ /dev/null @@ -1,10 +0,0 @@ -*** | (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 - -vm_costs_additional_mon.scale(i) = 10e4; -*Don't scale this variable. Model is very sensitive to scaling this variable and might become infeasible or very slow. -*v71_feed_balanceflow.scale(j,kli_rum,kforage) = 10e3; diff --git a/modules/71_disagg_lvst/foragebased_jul23/realization.gms b/modules/71_disagg_lvst/foragebased_jul23/realization.gms index 638bb9c520..d1cb9f6507 100644 --- a/modules/71_disagg_lvst/foragebased_jul23/realization.gms +++ b/modules/71_disagg_lvst/foragebased_jul23/realization.gms @@ -24,7 +24,6 @@ $Ifi "%phase%" == "sets" $include "./modules/71_disagg_lvst/foragebased_jul23/sets.gms" $Ifi "%phase%" == "declarations" $include "./modules/71_disagg_lvst/foragebased_jul23/declarations.gms" $Ifi "%phase%" == "equations" $include "./modules/71_disagg_lvst/foragebased_jul23/equations.gms" -$Ifi "%phase%" == "scaling" $include "./modules/71_disagg_lvst/foragebased_jul23/scaling.gms" $Ifi "%phase%" == "preloop" $include "./modules/71_disagg_lvst/foragebased_jul23/preloop.gms" $Ifi "%phase%" == "postsolve" $include "./modules/71_disagg_lvst/foragebased_jul23/postsolve.gms" $Ifi "%phase%" == "nl_fix" $include "./modules/71_disagg_lvst/foragebased_jul23/nl_fix.gms" From a798fc1894046fb71b50da13fe29472b65f2f571 Mon Sep 17 00:00:00 2001 From: Debbora Leip Date: Wed, 6 Nov 2024 08:50:16 +0100 Subject: [PATCH 125/206] updated input data in start scripts --- scripts/start/extra/recalibrateH16.R | 6 +++--- scripts/start/projects/paper_peatlandTax.R | 10 +++++----- scripts/start/projects/project_ABCDR.R | 12 ++++++------ scripts/start/projects/project_EAT2p0.R | 2 +- 4 files changed, 15 insertions(+), 15 deletions(-) diff --git a/scripts/start/extra/recalibrateH16.R b/scripts/start/extra/recalibrateH16.R index 43330dd11f..f2d3fa5cd9 100644 --- a/scripts/start/extra/recalibrateH16.R +++ b/scripts/start/extra/recalibrateH16.R @@ -17,10 +17,10 @@ source("scripts/start_functions.R") #start MAgPIE run source("config/default.cfg") -cfg$input['regional'] <- "rev4.114_36f73207_magpie.tgz" -cfg$input['validation'] <- "rev4.114_36f73207_validation.tgz" +cfg$input['regional'] <- "rev4.115_36f73207_magpie.tgz" +cfg$input['validation'] <- "rev4.115_36f73207_validation.tgz" cfg$input['calibration'] <- "calibration_H16_27Sep24.tgz" -cfg$input['cellular'] <- "rev4.114_36f73207_44a213b6_cellularmagpie_c400_MRI-ESM2-0-ssp370_lpjml-8e6c5eb1_clusterweight-ba4466a8.tgz" +cfg$input['cellular'] <- "rev4.115_36f73207_44a213b6_cellularmagpie_c400_MRI-ESM2-0-ssp370_lpjml-8e6c5eb1_clusterweight-ba4466a8.tgz" cfg$results_folder <- "output/:title:" cfg$recalibrate <- FALSE diff --git a/scripts/start/projects/paper_peatlandTax.R b/scripts/start/projects/paper_peatlandTax.R index 48ee3c328c..5b20f9e1b9 100644 --- a/scripts/start/projects/paper_peatlandTax.R +++ b/scripts/start/projects/paper_peatlandTax.R @@ -44,10 +44,10 @@ cfg$repositories <- append( getOption("magpie_repos") ) -cfg$input['regional'] <- "rev4.114_36f73207_magpie.tgz" -cfg$input['validation'] <- "rev4.114_36f73207_validation.tgz" +cfg$input['regional'] <- "rev4.115_36f73207_magpie.tgz" +cfg$input['validation'] <- "rev4.115_36f73207_validation.tgz" cfg$input['calibration'] <- "calibration_H16_27Sep24.tgz" -cfg$input['cellular'] <- "rev4.114_36f73207_44a213b6_cellularmagpie_c400_MRI-ESM2-0-ssp370_lpjml-8e6c5eb1_clusterweight-ba4466a8.tgz" +cfg$input['cellular'] <- "rev4.115_36f73207_44a213b6_cellularmagpie_c400_MRI-ESM2-0-ssp370_lpjml-8e6c5eb1_clusterweight-ba4466a8.tgz" download_and_update(cfg) ## Create patch file for GHG prices @@ -147,9 +147,9 @@ cfg$gms$s56_c_price_induced_aff <- 0 ## Start scenarios for (res in c("c400")) { if (res == "c400") - cfg$input['cellular'] <- "rev4.114_36f73207_44a213b6_cellularmagpie_c400_MRI-ESM2-0-ssp370_lpjml-8e6c5eb1_clusterweight-ba4466a8.tgz" + cfg$input['cellular'] <- "rev4.115_36f73207_44a213b6_cellularmagpie_c400_MRI-ESM2-0-ssp370_lpjml-8e6c5eb1_clusterweight-ba4466a8.tgz" else if (res == "c1000") { - cfg$input['cellular'] <- "rev4.114_36f73207_10f98ac1_cellularmagpie_c1000_MRI-ESM2-0-ssp370_lpjml-8e6c5eb1_clusterweight-ba4466a8.tgz" + cfg$input['cellular'] <- "rev4.115_36f73207_10f98ac1_cellularmagpie_c1000_MRI-ESM2-0-ssp370_lpjml-8e6c5eb1_clusterweight-ba4466a8.tgz" } ## Ref scenario cfg$title <- .title(cfg, paste(res, ssp, "Ref", sep = "-")) diff --git a/scripts/start/projects/project_ABCDR.R b/scripts/start/projects/project_ABCDR.R index 154489725c..cf52c94a97 100644 --- a/scripts/start/projects/project_ABCDR.R +++ b/scripts/start/projects/project_ABCDR.R @@ -31,10 +31,10 @@ cfg$qos <- "standby_highMem_dayMax" .title <- function(cfg, ...) return(paste(cfg$info$flag, sep="_",...)) -cfg$input['regional'] <- "rev4.114_36f73207_magpie.tgz" -cfg$input['validation'] <- "rev4.114_36f73207_validation.tgz" +cfg$input['regional'] <- "rev4.115_36f73207_magpie.tgz" +cfg$input['validation'] <- "rev4.115_36f73207_validation.tgz" cfg$input['calibration'] <- "calibration_H16_27Sep24.tgz" -cfg$input['cellular'] <- "rev4.114_36f73207_44a213b6_cellularmagpie_c400_MRI-ESM2-0-ssp370_lpjml-8e6c5eb1_clusterweight-ba4466a8.tgz" +cfg$input['cellular'] <- "rev4.115_36f73207_44a213b6_cellularmagpie_c400_MRI-ESM2-0-ssp370_lpjml-8e6c5eb1_clusterweight-ba4466a8.tgz" ssp <- "SSP2" @@ -54,19 +54,19 @@ for (pol in c("NDC","1p5deg","1p5deg-Diet")) { cfg$title <- .title(cfg, paste(ssp,pol,ifelse(growth==0,"natveg","plant"),paste0("AFS_tree_",sub("\\.","p",as.character(shr*100))),sep="-")) if (pol == "NDC") { cfg <- setScenario(cfg,c(ssp,"NDC","rcp4p5")) - cfg$input['cellular'] <- "rev4.114_36f73207_30c9dc61_cellularmagpie_c400_MRI-ESM2-0-ssp245_lpjml-8e6c5eb1_clusterweight-ba4466a8.tgz" + cfg$input['cellular'] <- "rev4.115_36f73207_30c9dc61_cellularmagpie_c400_MRI-ESM2-0-ssp245_lpjml-8e6c5eb1_clusterweight-ba4466a8.tgz" cfg$gms$c56_mute_ghgprices_until <- "y2150" cfg$gms$c56_pollutant_prices <- paste0("R32M46-", if (ssp=="SSP2") "SSP2EU" else ssp,"-NDC") cfg$gms$c60_2ndgen_biodem <- paste0("R32M46-", if (ssp=="SSP2") "SSP2EU" else ssp,"-NDC") } else if (pol == "1p5deg") { cfg <- setScenario(cfg,c(ssp,"NDC","rcp1p9")) - cfg$input['cellular'] <- "rev4.114_36f73207_bc624950_cellularmagpie_c400_MRI-ESM2-0-ssp119_lpjml-8e6c5eb1_clusterweight-ba4466a8.tgz" + cfg$input['cellular'] <- "rev4.115_36f73207_bc624950_cellularmagpie_c400_MRI-ESM2-0-ssp119_lpjml-8e6c5eb1_clusterweight-ba4466a8.tgz" cfg$gms$c56_mute_ghgprices_until <- "y2030" cfg$gms$c56_pollutant_prices <- paste0("R32M46-", if (ssp=="SSP2") "SSP2EU" else ssp,"-PkBudg650") cfg$gms$c60_2ndgen_biodem <- paste0("R32M46-", if (ssp=="SSP2") "SSP2EU" else ssp,"-PkBudg650") } else if (pol == "1p5deg-Diet") { cfg <- setScenario(cfg,c(ssp,"NDC","rcp1p9","eat_lancet_diet_v1")) - cfg$input['cellular'] <- "rev4.114_36f73207_bc624950_cellularmagpie_c400_MRI-ESM2-0-ssp119_lpjml-8e6c5eb1_clusterweight-ba4466a8.tgz" + cfg$input['cellular'] <- "rev4.115_36f73207_bc624950_cellularmagpie_c400_MRI-ESM2-0-ssp119_lpjml-8e6c5eb1_clusterweight-ba4466a8.tgz" cfg$gms$c56_mute_ghgprices_until <- "y2030" cfg$gms$c56_pollutant_prices <- paste0("R32M46-", if (ssp=="SSP2") "SSP2EU" else ssp,"-PkBudg650") cfg$gms$c60_2ndgen_biodem <- paste0("R32M46-", if (ssp=="SSP2") "SSP2EU" else ssp,"-PkBudg650") diff --git a/scripts/start/projects/project_EAT2p0.R b/scripts/start/projects/project_EAT2p0.R index 0fd148dc35..fdc7042f28 100644 --- a/scripts/start/projects/project_EAT2p0.R +++ b/scripts/start/projects/project_EAT2p0.R @@ -90,7 +90,7 @@ bau <- function(cfg) { cfg$gms$c60_2ndgen_biodem <- "R21M42-SSP2-NPi" # default # Climate Change - cfg$input["cellular"] <- "rev4.114EL2_h12_c6a7458f_cellularmagpie_c200_IPSL-CM6A-LR-ssp370_lpjml-8e6c5eb1.tgz" + cfg$input["cellular"] <- "rev4.115EL2_h12_c6a7458f_cellularmagpie_c200_IPSL-CM6A-LR-ssp370_lpjml-8e6c5eb1.tgz" return(cfg) } From 84436ed1b097027c420d1790c7a84d115ab9bec3 Mon Sep 17 00:00:00 2001 From: florianh Date: Wed, 6 Nov 2024 08:58:33 +0100 Subject: [PATCH 126/206] test --- modules/10_land/landmatrix_dec18/scaling.gms | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/modules/10_land/landmatrix_dec18/scaling.gms b/modules/10_land/landmatrix_dec18/scaling.gms index 661fd10648..d948fc90ad 100644 --- a/modules/10_land/landmatrix_dec18/scaling.gms +++ b/modules/10_land/landmatrix_dec18/scaling.gms @@ -6,5 +6,5 @@ *** | Contact: magpie@pik-potsdam.de vm_landdiff.scale = 10e3; -v10_balance_positive.scale(j,land_from) = 10e-3; -v10_balance_negative.scale(j,land_from) = 10e-3; +v10_balance_positive.scale(j,land_from) = 10e-6; +v10_balance_negative.scale(j,land_from) = 10e-6; From 815f223be98855f8d8988cad4bb6366c88c9d204 Mon Sep 17 00:00:00 2001 From: florianh Date: Wed, 6 Nov 2024 10:02:01 +0100 Subject: [PATCH 127/206] bugfix --- modules/10_land/landmatrix_dec18/scaling.gms | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/modules/10_land/landmatrix_dec18/scaling.gms b/modules/10_land/landmatrix_dec18/scaling.gms index d948fc90ad..4bb36e606e 100644 --- a/modules/10_land/landmatrix_dec18/scaling.gms +++ b/modules/10_land/landmatrix_dec18/scaling.gms @@ -6,5 +6,5 @@ *** | Contact: magpie@pik-potsdam.de vm_landdiff.scale = 10e3; -v10_balance_positive.scale(j,land_from) = 10e-6; -v10_balance_negative.scale(j,land_from) = 10e-6; +v10_balance_positive.scale(j,land_from) = 10e-7; +v10_balance_negative.scale(j,land_from) = 10e-7; From 6592c0487ee5dbe281ca2640b0f307ab96ac6ed7 Mon Sep 17 00:00:00 2001 From: florianh Date: Wed, 6 Nov 2024 10:12:20 +0100 Subject: [PATCH 128/206] changelog --- CHANGELOG.md | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 0eb11e2780..1704a4f640 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -15,6 +15,8 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). - **config** SHAPE scenarios start year of dietary shift changed to 2025 - **core** number of age-classes doubled from 150 to 300 years for better match of growth curves with potential natural vegetation. - **35_natveg** revised age-class initialization of secondary forest +- **modules** update of scaling factors in several modules + ### added - **62_material** added switch to turn off future material demand for bioplastic @@ -28,6 +30,9 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). - **29_cropland** treecover age-class growth was not working properly because ac_sub was erroneously not fixed - **scripts** script/output/extra/resubmit.R - **28_ageclass** bugfix input data unit and code clean-up. Renamed `feb21` realization to `oct24` +- **70_livestock** bugfix scaling.gms file in wrong folder +- **10_land** bugfix land transition matrix for improved feasibility (variables and parameters have different accuracy) +- **44_biodiversity** avoid division by zero and improved consistency between realisations for fixing variables ## [4.8.2] - 2024-09-24 From aa034ef644048018219664b51bc58ce0b7fc3dbb Mon Sep 17 00:00:00 2001 From: florianh Date: Wed, 6 Nov 2024 13:42:05 +0100 Subject: [PATCH 129/206] bugfix typo --- modules/44_biodiversity/bii_target_apr24/presolve.gms | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/44_biodiversity/bii_target_apr24/presolve.gms b/modules/44_biodiversity/bii_target_apr24/presolve.gms index 487b68041a..5a3ee7f43f 100644 --- a/modules/44_biodiversity/bii_target_apr24/presolve.gms +++ b/modules/44_biodiversity/bii_target_apr24/presolve.gms @@ -23,7 +23,7 @@ else ); p44_bii_lower_bound(t2,i,biome44)$(p44_bii_lower_bound(t2,i,biome44) >= 1) = 1; p44_bii_lower_bound(t2,i,biome44)$(m_year(t2) < s44_start_year) = 0; - p44_bii_lower_bound(t2,i,biome44)$(sum(cell(i,j), f44_biome(j,biome44)**f44_rr_layer(j)) <= 1e-10) = 0; + p44_bii_lower_bound(t2,i,biome44)$(sum(cell(i,j), f44_biome(j,biome44)*f44_rr_layer(j)) <= 1e-10) = 0; * The lower bound of `v44_bii` is set to `p44_bii_lower_bound` to avoid a reduction of BII in combination with `v44_bii_missing`. v44_bii.lo(i,biome44) = p44_bii_lower_bound(t,i,biome44); display p44_bii_lower_bound; From 1a84ac8e51ec998f5471a5529544352a4e479d7d Mon Sep 17 00:00:00 2001 From: florianh Date: Wed, 6 Nov 2024 14:21:47 +0100 Subject: [PATCH 130/206] update start scripts --- scripts/start/projects/paper_peatlandTax.R | 12 ++++++++++-- scripts/start/projects/project_ABCDR.R | 2 +- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/scripts/start/projects/paper_peatlandTax.R b/scripts/start/projects/paper_peatlandTax.R index 5b20f9e1b9..43dccf6672 100644 --- a/scripts/start/projects/paper_peatlandTax.R +++ b/scripts/start/projects/paper_peatlandTax.R @@ -23,7 +23,7 @@ source("scripts/start_functions.R") source("config/default.cfg") # create additional information to describe the runs -cfg$info$flag <- "PTax35" +cfg$info$flag <- "PTax36" cfg$results_folder <- "output/:title:" cfg$results_folder_highres <- "output" @@ -69,6 +69,7 @@ calc_ghgprice <- function() { T200[, , "n2o_n_indirect"] <- T200[, , "co2_c"] * 265 * 44 / 28 T200[, , "co2_c"] <- T200[, , "co2_c"] * 44 / 12 + T25 <- T200 * 0.125 T50 <- T200 * 0.25 T100 <- T200 * 0.5 T400 <- T200 * 2 @@ -76,6 +77,12 @@ calc_ghgprice <- function() { GHG <- mbind( add_dimension(T0, dim = 3.2, add = "scen", nm = "T0-GHG"), + add_dimension( + T25, + dim = 3.2, + add = "scen", + nm = "T25-GHG" + ), add_dimension( T50, dim = 3.2, @@ -158,7 +165,8 @@ for (res in c("c400")) { start_run(cfg, codeCheck = FALSE) ## Policy scenarios - for (tax in c("T50-CO2", + for (tax in c("T25-CO2", + "T50-CO2", "T100-CO2", "T200-CO2", "T400-CO2", diff --git a/scripts/start/projects/project_ABCDR.R b/scripts/start/projects/project_ABCDR.R index cf52c94a97..c721ab8aa2 100644 --- a/scripts/start/projects/project_ABCDR.R +++ b/scripts/start/projects/project_ABCDR.R @@ -19,7 +19,7 @@ source("config/default.cfg") #download_and_update(cfg) # create additional information to describe the runs -cfg$info$flag <- "ABCDR16" +cfg$info$flag <- "ABCDR17" cfg$results_folder <- "output/:title:" cfg$force_replace <- TRUE From 3323a4e8c63fb5e66794d6afec0f2f5750a488ef Mon Sep 17 00:00:00 2001 From: florianh Date: Fri, 8 Nov 2024 12:57:49 +0100 Subject: [PATCH 131/206] remove scaling for 29_cropland --- modules/29_cropland/detail_apr24/realization.gms | 1 - modules/29_cropland/detail_apr24/scaling.gms | 9 --------- 2 files changed, 10 deletions(-) delete mode 100644 modules/29_cropland/detail_apr24/scaling.gms diff --git a/modules/29_cropland/detail_apr24/realization.gms b/modules/29_cropland/detail_apr24/realization.gms index c9b62fec84..071000bd1e 100644 --- a/modules/29_cropland/detail_apr24/realization.gms +++ b/modules/29_cropland/detail_apr24/realization.gms @@ -25,7 +25,6 @@ $Ifi "%phase%" == "sets" $include "./modules/29_cropland/detail_apr24/sets.gms" $Ifi "%phase%" == "declarations" $include "./modules/29_cropland/detail_apr24/declarations.gms" $Ifi "%phase%" == "input" $include "./modules/29_cropland/detail_apr24/input.gms" $Ifi "%phase%" == "equations" $include "./modules/29_cropland/detail_apr24/equations.gms" -$Ifi "%phase%" == "scaling" $include "./modules/29_cropland/detail_apr24/scaling.gms" $Ifi "%phase%" == "preloop" $include "./modules/29_cropland/detail_apr24/preloop.gms" $Ifi "%phase%" == "presolve" $include "./modules/29_cropland/detail_apr24/presolve.gms" $Ifi "%phase%" == "postsolve" $include "./modules/29_cropland/detail_apr24/postsolve.gms" diff --git a/modules/29_cropland/detail_apr24/scaling.gms b/modules/29_cropland/detail_apr24/scaling.gms deleted file mode 100644 index 49bccf2ac2..0000000000 --- a/modules/29_cropland/detail_apr24/scaling.gms +++ /dev/null @@ -1,9 +0,0 @@ -*** | (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 - -v29_treecover.scale(j,ac) = 10e-3; -v29_treecover_missing.scale(j) = 10e-3; From 0ebe1364cdf9b8b86dd6f5aae3a736b472951c72 Mon Sep 17 00:00:00 2001 From: florianh Date: Fri, 8 Nov 2024 13:43:06 +0100 Subject: [PATCH 132/206] start script update counter --- scripts/start/projects/project_ABCDR.R | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/start/projects/project_ABCDR.R b/scripts/start/projects/project_ABCDR.R index c721ab8aa2..a36e9c200a 100644 --- a/scripts/start/projects/project_ABCDR.R +++ b/scripts/start/projects/project_ABCDR.R @@ -19,7 +19,7 @@ source("config/default.cfg") #download_and_update(cfg) # create additional information to describe the runs -cfg$info$flag <- "ABCDR17" +cfg$info$flag <- "ABCDR18" cfg$results_folder <- "output/:title:" cfg$force_replace <- TRUE From 942b8ee164aa8debcc5318a9f12a13fdd56fb541 Mon Sep 17 00:00:00 2001 From: florianh Date: Fri, 8 Nov 2024 18:04:00 +0100 Subject: [PATCH 133/206] test --- modules/58_peatland/v2/declarations.gms | 3 +++ modules/58_peatland/v2/equations.gms | 4 ++++ modules/58_peatland/v2/input.gms | 1 + modules/58_peatland/v2/preloop.gms | 3 +++ modules/58_peatland/v2/presolve.gms | 1 + 5 files changed, 12 insertions(+) diff --git a/modules/58_peatland/v2/declarations.gms b/modules/58_peatland/v2/declarations.gms index b7748cbff5..384e907b87 100644 --- a/modules/58_peatland/v2/declarations.gms +++ b/modules/58_peatland/v2/declarations.gms @@ -18,6 +18,8 @@ parameters i58_cost_drain_rewet_onetime(t) One-time costs for drainage of rewetted peatland (USD17MER per ha) p58_availPeatlandExp(t,j) Available area for expansion of drained peatland (mio. ha) p58_availLandExp(t,j) Available area for expansion of managed land (mio. ha) + i58_peatland_rewetting_fader Fader (1) + p58_peatland_ref(j,land58) ref (mio. ha) ; equations @@ -32,6 +34,7 @@ equations q58_peatland_cost_annuity(j,cost58) Annuity costs for peatland conversion in the current timestep (mio. USD17MER per yr) q58_peatland_emis_detail(j,land58,emis58) Detailed GHG emissions from peatlands (Tg per yr) q58_peatland_emis(i,poll58) GHG emissions from managed peatland (Tg per yr) + q58_rewetting_exo(j,manPeat58) blub (mio. ha) ; variables diff --git a/modules/58_peatland/v2/equations.gms b/modules/58_peatland/v2/equations.gms index 569fc87361..b41dd2fa09 100644 --- a/modules/58_peatland/v2/equations.gms +++ b/modules/58_peatland/v2/equations.gms @@ -49,6 +49,10 @@ + v58_manLandExp(j2,manPeat58) * sum(ct, p58_scalingFactorExp(ct,j2)) - v58_balance(j2,manPeat58) - v58_manLandRed(j2,manPeat58) * sum(ct, p58_scalingFactorRed(ct,j2,manPeat58)) + v58_balance2(j2,manPeat58); + q58_rewetting_exo(j2,manPeat58)$(sum(ct, m_year(ct)) > s58_fix_peatland) .. + sum(drained58, v58_peatland(j2,drained58)) =l= + sum(drained58, p58_peatland_ref(j2,drained58)) * (1-sum(ct, i58_peatland_rewetting_fader(ct))) * s58_rewetting_exo + *' Drained peatland used for agriculture and forestry cannot exceed corresponding managed land. q58_peatlandMan2(j2,manPeat58)$(sum(ct, m_year(ct)) > s58_fix_peatland) .. diff --git a/modules/58_peatland/v2/input.gms b/modules/58_peatland/v2/input.gms index 20e91e2c16..f9dc6c6694 100644 --- a/modules/58_peatland/v2/input.gms +++ b/modules/58_peatland/v2/input.gms @@ -14,6 +14,7 @@ scalars s58_rewetting_switch Peatland rewetting on (Inf) or off (0) / Inf / s58_fix_peatland Year indicating until when peatland area should be fixed (year) / 2020 / s58_balance_penalty Penalty for technical peatland balance term (USD17MER) / 1e+06 / + s58_rewetting_exo share / 0 / ; *Peatland area based on Global Peatland Map 2.0 and Global Peatland Database diff --git a/modules/58_peatland/v2/preloop.gms b/modules/58_peatland/v2/preloop.gms index 9525ea2860..44f569e9ee 100644 --- a/modules/58_peatland/v2/preloop.gms +++ b/modules/58_peatland/v2/preloop.gms @@ -5,6 +5,9 @@ *** | MAgPIE License Exception, version 1.0 (see LICENSE file). *** | Contact: magpie@pik-potsdam.de +m_linear_time_interpol(i58_peatland_rewetting_fader,2030,2050,0.3,0.5); + + vm_emissions_reg.fx(i,"peatland",pollutants) = 0; vm_emissions_reg.lo(i,"peatland",poll58) = -Inf; vm_emissions_reg.up(i,"peatland",poll58) = Inf; diff --git a/modules/58_peatland/v2/presolve.gms b/modules/58_peatland/v2/presolve.gms index 02d99220b5..27139a0d54 100644 --- a/modules/58_peatland/v2/presolve.gms +++ b/modules/58_peatland/v2/presolve.gms @@ -30,6 +30,7 @@ if (m_year(t) <= s58_fix_peatland, i58_cost_drain_rewet_onetime(t) = 0; i58_cost_rewet_onetime(t) = 0; else + p58_peatland_ref(j,land58)$(m_year(t) = s58_fix_peatland) = pc58_peatland(j,land58); * Define bounds and costs for peatland area after the year given by s58_fix_peatland v58_peatland.lo(j,land58) = 0; v58_peatland.l(j,land58) = pc58_peatland(j,land58); From 286158d943f4cd7036f56e9038a7007396bab3b0 Mon Sep 17 00:00:00 2001 From: florianh Date: Fri, 8 Nov 2024 18:06:49 +0100 Subject: [PATCH 134/206] test --- modules/58_peatland/v2/declarations.gms | 1 + modules/58_peatland/v2/equations.gms | 2 +- modules/58_peatland/v2/postsolve.gms | 4 ++++ 3 files changed, 6 insertions(+), 1 deletion(-) diff --git a/modules/58_peatland/v2/declarations.gms b/modules/58_peatland/v2/declarations.gms index 384e907b87..d9bb34cfcd 100644 --- a/modules/58_peatland/v2/declarations.gms +++ b/modules/58_peatland/v2/declarations.gms @@ -76,5 +76,6 @@ parameters oq58_peatland_cost_annuity(t,j,cost58,type) Annuity costs for peatland conversion in the current timestep (mio. USD17MER per yr) oq58_peatland_emis_detail(t,j,land58,emis58,type) Detailed GHG emissions from peatlands (Tg per yr) oq58_peatland_emis(t,i,poll58,type) GHG emissions from managed peatland (Tg per yr) + oq58_rewetting_exo(t,j,manPeat58,type) blub (mio. ha) ; *##################### R SECTION END (OUTPUT DECLARATIONS) ##################### diff --git a/modules/58_peatland/v2/equations.gms b/modules/58_peatland/v2/equations.gms index b41dd2fa09..bb27e3ba38 100644 --- a/modules/58_peatland/v2/equations.gms +++ b/modules/58_peatland/v2/equations.gms @@ -51,7 +51,7 @@ q58_rewetting_exo(j2,manPeat58)$(sum(ct, m_year(ct)) > s58_fix_peatland) .. sum(drained58, v58_peatland(j2,drained58)) =l= - sum(drained58, p58_peatland_ref(j2,drained58)) * (1-sum(ct, i58_peatland_rewetting_fader(ct))) * s58_rewetting_exo + sum(drained58, p58_peatland_ref(j2,drained58)) * (1-sum(ct, i58_peatland_rewetting_fader(ct))) * s58_rewetting_exo; *' Drained peatland used for agriculture and forestry cannot exceed corresponding managed land. diff --git a/modules/58_peatland/v2/postsolve.gms b/modules/58_peatland/v2/postsolve.gms index b8274c3db3..f7afcc5a46 100644 --- a/modules/58_peatland/v2/postsolve.gms +++ b/modules/58_peatland/v2/postsolve.gms @@ -30,6 +30,7 @@ pc58_manLand(j,manPeat58) = v58_manLand.l(j,manPeat58); oq58_peatland_cost_annuity(t,j,cost58,"marginal") = q58_peatland_cost_annuity.m(j,cost58); oq58_peatland_emis_detail(t,j,land58,emis58,"marginal") = q58_peatland_emis_detail.m(j,land58,emis58); oq58_peatland_emis(t,i,poll58,"marginal") = q58_peatland_emis.m(i,poll58); + oq58_rewetting_exo(t,j,manPeat58,"marginal") = q58_rewetting_exo.m(j,manPeat58); ov58_peatlandChange(t,j,land58,"level") = v58_peatlandChange.l(j,land58); ov_peatland_cost(t,j,"level") = vm_peatland_cost.l(j); ov58_peatland_emis(t,j,land58,emis58,"level") = v58_peatland_emis.l(j,land58,emis58); @@ -51,6 +52,7 @@ pc58_manLand(j,manPeat58) = v58_manLand.l(j,manPeat58); oq58_peatland_cost_annuity(t,j,cost58,"level") = q58_peatland_cost_annuity.l(j,cost58); oq58_peatland_emis_detail(t,j,land58,emis58,"level") = q58_peatland_emis_detail.l(j,land58,emis58); oq58_peatland_emis(t,i,poll58,"level") = q58_peatland_emis.l(i,poll58); + oq58_rewetting_exo(t,j,manPeat58,"level") = q58_rewetting_exo.l(j,manPeat58); ov58_peatlandChange(t,j,land58,"upper") = v58_peatlandChange.up(j,land58); ov_peatland_cost(t,j,"upper") = vm_peatland_cost.up(j); ov58_peatland_emis(t,j,land58,emis58,"upper") = v58_peatland_emis.up(j,land58,emis58); @@ -72,6 +74,7 @@ pc58_manLand(j,manPeat58) = v58_manLand.l(j,manPeat58); oq58_peatland_cost_annuity(t,j,cost58,"upper") = q58_peatland_cost_annuity.up(j,cost58); oq58_peatland_emis_detail(t,j,land58,emis58,"upper") = q58_peatland_emis_detail.up(j,land58,emis58); oq58_peatland_emis(t,i,poll58,"upper") = q58_peatland_emis.up(i,poll58); + oq58_rewetting_exo(t,j,manPeat58,"upper") = q58_rewetting_exo.up(j,manPeat58); ov58_peatlandChange(t,j,land58,"lower") = v58_peatlandChange.lo(j,land58); ov_peatland_cost(t,j,"lower") = vm_peatland_cost.lo(j); ov58_peatland_emis(t,j,land58,emis58,"lower") = v58_peatland_emis.lo(j,land58,emis58); @@ -93,4 +96,5 @@ pc58_manLand(j,manPeat58) = v58_manLand.l(j,manPeat58); oq58_peatland_cost_annuity(t,j,cost58,"lower") = q58_peatland_cost_annuity.lo(j,cost58); oq58_peatland_emis_detail(t,j,land58,emis58,"lower") = q58_peatland_emis_detail.lo(j,land58,emis58); oq58_peatland_emis(t,i,poll58,"lower") = q58_peatland_emis.lo(i,poll58); + oq58_rewetting_exo(t,j,manPeat58,"lower") = q58_rewetting_exo.lo(j,manPeat58); *##################### R SECTION END (OUTPUT DEFINITIONS) ###################### From 1b22c3dbd60d5a9409c651ef1a63346c612449ae Mon Sep 17 00:00:00 2001 From: florianh Date: Fri, 8 Nov 2024 22:35:13 +0100 Subject: [PATCH 135/206] test --- scripts/start/projects/paper_peatlandTax.R | 65 ++++++++++++++++++---- 1 file changed, 54 insertions(+), 11 deletions(-) diff --git a/scripts/start/projects/paper_peatlandTax.R b/scripts/start/projects/paper_peatlandTax.R index 43dccf6672..97226311f5 100644 --- a/scripts/start/projects/paper_peatlandTax.R +++ b/scripts/start/projects/paper_peatlandTax.R @@ -23,11 +23,11 @@ source("scripts/start_functions.R") source("config/default.cfg") # create additional information to describe the runs -cfg$info$flag <- "PTax36" +cfg$info$flag <- "PTax38" cfg$results_folder <- "output/:title:" cfg$results_folder_highres <- "output" -cfg$output <- c(cfg$output, "extra/highres") +#cfg$output <- c(cfg$output, "extra/highres") cfg$force_replace <- TRUE cfg$force_download <- FALSE cfg$qos <- "standby_highMem_dayMax" @@ -44,10 +44,10 @@ cfg$repositories <- append( getOption("magpie_repos") ) -cfg$input['regional'] <- "rev4.115_36f73207_magpie.tgz" -cfg$input['validation'] <- "rev4.115_36f73207_validation.tgz" -cfg$input['calibration'] <- "calibration_H16_27Sep24.tgz" -cfg$input['cellular'] <- "rev4.115_36f73207_44a213b6_cellularmagpie_c400_MRI-ESM2-0-ssp370_lpjml-8e6c5eb1_clusterweight-ba4466a8.tgz" +cfg$input['regional'] <- "rev4.115_5d9a2237_magpie.tgz" +cfg$input['validation'] <- "rev4.115_5d9a2237_validation.tgz" +cfg$input['calibration'] <- "calibration_H15_27Sep24.tgz" +cfg$input['cellular'] <- "rev4.115_5d9a2237_d882386f_cellularmagpie_c400_MRI-ESM2-0-ssp370_lpjml-8e6c5eb1_clusterweight-db9e7cf8.tgz" download_and_update(cfg) ## Create patch file for GHG prices @@ -154,17 +154,18 @@ cfg$gms$s56_c_price_induced_aff <- 0 ## Start scenarios for (res in c("c400")) { if (res == "c400") - cfg$input['cellular'] <- "rev4.115_36f73207_44a213b6_cellularmagpie_c400_MRI-ESM2-0-ssp370_lpjml-8e6c5eb1_clusterweight-ba4466a8.tgz" + cfg$input['cellular'] <- "rev4.115_5d9a2237_d882386f_cellularmagpie_c400_MRI-ESM2-0-ssp370_lpjml-8e6c5eb1_clusterweight-db9e7cf8.tgz" else if (res == "c1000") { - cfg$input['cellular'] <- "rev4.115_36f73207_10f98ac1_cellularmagpie_c1000_MRI-ESM2-0-ssp370_lpjml-8e6c5eb1_clusterweight-ba4466a8.tgz" + cfg$input['cellular'] <- "rev4.115_5d9a2237_277ed036_cellularmagpie_c1000_MRI-ESM2-0-ssp370_lpjml-8e6c5eb1_clusterweight-db9e7cf8.tgz" } ## Ref scenario - cfg$title <- .title(cfg, paste(res, ssp, "Ref", sep = "-")) + cfg$title <- .title(cfg, paste(ssp, "Ref", sep = "-")) cfg$gms$c56_mute_ghgprices_until <- "y2150" cfg$gms$c56_pollutant_prices <- "T0-CO2" + cfg$gms$s58_rewetting_exo <- 0 start_run(cfg, codeCheck = FALSE) - ## Policy scenarios + ## GHG policy scenarios for (tax in c("T25-CO2", "T50-CO2", "T100-CO2", @@ -172,10 +173,52 @@ for (res in c("c400")) { "T400-CO2", "T400-GHG", "T400-GHG-GWP20")) { - cfg$title <- .title(cfg, paste(res, ssp, tax, sep = "-")) + cfg$title <- .title(cfg, paste(ssp, tax, sep = "-")) cfg$gms$c56_mute_ghgprices_until <- "y2025" cfg$gms$s58_cost_drain_intact_onetime <- 10000 cfg$gms$c56_pollutant_prices <- tax start_run(cfg, codeCheck = FALSE) } + + ## Exo rewet scenarios + cfg$title <- .title(cfg, paste(ssp, "NRL50", sep = "-")) + cfg$gms$c56_mute_ghgprices_until <- "y2150" + cfg$gms$c56_pollutant_prices <- "T0-CO2" + cfg$gms$s58_rewetting_exo <- 0.5 + cfg$gms$s58_cost_drain_intact_onetime <- 10000 + start_run(cfg, codeCheck = FALSE) + + cfg$title <- .title(cfg, paste(ssp, "NRL100", sep = "-")) + cfg$gms$c56_mute_ghgprices_until <- "y2150" + cfg$gms$c56_pollutant_prices <- "T0-CO2" + cfg$gms$s58_rewetting_exo <- 1 + cfg$gms$s58_cost_drain_intact_onetime <- 10000 + start_run(cfg, codeCheck = FALSE) + + cfg$title <- .title(cfg, paste(ssp, "AREA100", sep = "-")) + cfg$gms$c56_mute_ghgprices_until <- "y2150" + cfg$gms$c56_pollutant_prices <- "T0-CO2" + cfg$gms$s58_rewetting_exo <- 0 + cfg$gms$s58_cost_drain_intact_onetime <- 10000 + cfg$gms$s58_cost_rewet_onetime <- -100 + cfg$gms$s58_cost_rewet_recur <- -100 + start_run(cfg, codeCheck = FALSE) + + cfg$title <- .title(cfg, paste(ssp, "AREA500", sep = "-")) + cfg$gms$c56_mute_ghgprices_until <- "y2150" + cfg$gms$c56_pollutant_prices <- "T0-CO2" + cfg$gms$s58_rewetting_exo <- 0 + cfg$gms$s58_cost_drain_intact_onetime <- 10000 + cfg$gms$s58_cost_rewet_onetime <- -500 + cfg$gms$s58_cost_rewet_recur <- -100 + start_run(cfg, codeCheck = FALSE) + + cfg$title <- .title(cfg, paste(ssp, "AREA1000", sep = "-")) + cfg$gms$c56_mute_ghgprices_until <- "y2150" + cfg$gms$c56_pollutant_prices <- "T0-CO2" + cfg$gms$s58_rewetting_exo <- 0 + cfg$gms$s58_cost_drain_intact_onetime <- 10000 + cfg$gms$s58_cost_rewet_onetime <- -1000 + cfg$gms$s58_cost_rewet_recur <- -100 + start_run(cfg, codeCheck = FALSE) } From 6917a6ae1f190f898c2a278a6e6ba95f934ebb50 Mon Sep 17 00:00:00 2001 From: florianh Date: Sat, 9 Nov 2024 11:43:45 +0100 Subject: [PATCH 136/206] test --- modules/58_peatland/v2/equations.gms | 2 +- scripts/start/projects/paper_peatlandTax.R | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/modules/58_peatland/v2/equations.gms b/modules/58_peatland/v2/equations.gms index bb27e3ba38..6161bf24dd 100644 --- a/modules/58_peatland/v2/equations.gms +++ b/modules/58_peatland/v2/equations.gms @@ -50,7 +50,7 @@ - v58_manLandRed(j2,manPeat58) * sum(ct, p58_scalingFactorRed(ct,j2,manPeat58)) + v58_balance2(j2,manPeat58); q58_rewetting_exo(j2,manPeat58)$(sum(ct, m_year(ct)) > s58_fix_peatland) .. - sum(drained58, v58_peatland(j2,drained58)) =l= + v58_peatland(j2,"rewetted") =g= sum(drained58, p58_peatland_ref(j2,drained58)) * (1-sum(ct, i58_peatland_rewetting_fader(ct))) * s58_rewetting_exo; *' Drained peatland used for agriculture and forestry cannot exceed corresponding managed land. diff --git a/scripts/start/projects/paper_peatlandTax.R b/scripts/start/projects/paper_peatlandTax.R index 97226311f5..5bb27787bf 100644 --- a/scripts/start/projects/paper_peatlandTax.R +++ b/scripts/start/projects/paper_peatlandTax.R @@ -23,7 +23,7 @@ source("scripts/start_functions.R") source("config/default.cfg") # create additional information to describe the runs -cfg$info$flag <- "PTax38" +cfg$info$flag <- "PTax39" cfg$results_folder <- "output/:title:" cfg$results_folder_highres <- "output" From e38e1d28975c23a8faff29f43621a9b438a2e875 Mon Sep 17 00:00:00 2001 From: florianh Date: Sun, 10 Nov 2024 14:58:42 +0100 Subject: [PATCH 137/206] test --- modules/58_peatland/v2/equations.gms | 2 +- modules/58_peatland/v2/presolve.gms | 4 +- modules/58_peatland/v2/scaling.gms | 2 +- scripts/start/projects/paper_peatlandTax.R | 48 ++++++++++++++++++---- 4 files changed, 44 insertions(+), 12 deletions(-) diff --git a/modules/58_peatland/v2/equations.gms b/modules/58_peatland/v2/equations.gms index 6161bf24dd..2c6c1851af 100644 --- a/modules/58_peatland/v2/equations.gms +++ b/modules/58_peatland/v2/equations.gms @@ -51,7 +51,7 @@ q58_rewetting_exo(j2,manPeat58)$(sum(ct, m_year(ct)) > s58_fix_peatland) .. v58_peatland(j2,"rewetted") =g= - sum(drained58, p58_peatland_ref(j2,drained58)) * (1-sum(ct, i58_peatland_rewetting_fader(ct))) * s58_rewetting_exo; + sum(drained58, p58_peatland_ref(j2,drained58)) * sum(ct, i58_peatland_rewetting_fader(ct)) * s58_rewetting_exo; *' Drained peatland used for agriculture and forestry cannot exceed corresponding managed land. diff --git a/modules/58_peatland/v2/presolve.gms b/modules/58_peatland/v2/presolve.gms index 27139a0d54..a360c3218c 100644 --- a/modules/58_peatland/v2/presolve.gms +++ b/modules/58_peatland/v2/presolve.gms @@ -29,8 +29,10 @@ if (m_year(t) <= s58_fix_peatland, i58_cost_drain_intact_onetime(t) = 0; i58_cost_drain_rewet_onetime(t) = 0; i58_cost_rewet_onetime(t) = 0; -else + +* save area in reference period p58_peatland_ref(j,land58)$(m_year(t) = s58_fix_peatland) = pc58_peatland(j,land58); +else * Define bounds and costs for peatland area after the year given by s58_fix_peatland v58_peatland.lo(j,land58) = 0; v58_peatland.l(j,land58) = pc58_peatland(j,land58); diff --git a/modules/58_peatland/v2/scaling.gms b/modules/58_peatland/v2/scaling.gms index ad96fe3e35..b81bb8aa9a 100644 --- a/modules/58_peatland/v2/scaling.gms +++ b/modules/58_peatland/v2/scaling.gms @@ -7,4 +7,4 @@ v58_balance.scale(j,manPeat58) = 10e-5; v58_balance2.scale(j,manPeat58) = 10e-5; -v58_peatlandChange.scale(j,land58) = 10e-3; +*v58_peatlandChange.scale(j,land58) = 10e-3; diff --git a/scripts/start/projects/paper_peatlandTax.R b/scripts/start/projects/paper_peatlandTax.R index 5bb27787bf..8f55829e13 100644 --- a/scripts/start/projects/paper_peatlandTax.R +++ b/scripts/start/projects/paper_peatlandTax.R @@ -23,7 +23,7 @@ source("scripts/start_functions.R") source("config/default.cfg") # create additional information to describe the runs -cfg$info$flag <- "PTax39" +cfg$info$flag <- "PTax40" cfg$results_folder <- "output/:title:" cfg$results_folder_highres <- "output" @@ -47,7 +47,7 @@ cfg$repositories <- append( cfg$input['regional'] <- "rev4.115_5d9a2237_magpie.tgz" cfg$input['validation'] <- "rev4.115_5d9a2237_validation.tgz" cfg$input['calibration'] <- "calibration_H15_27Sep24.tgz" -cfg$input['cellular'] <- "rev4.115_5d9a2237_d882386f_cellularmagpie_c400_MRI-ESM2-0-ssp370_lpjml-8e6c5eb1_clusterweight-db9e7cf8.tgz" +cfg$input['cellular'] <- "rev4.115_5d9a2237_d882386f_cellularmagpie_c200_MRI-ESM2-0-ssp370_lpjml-8e6c5eb1_clusterweight-db9e7cf8.tgz" download_and_update(cfg) ## Create patch file for GHG prices @@ -152,8 +152,10 @@ cfg$gms$livestock <- "fbask_jan16_sticky" cfg$gms$s56_c_price_induced_aff <- 0 ## Start scenarios -for (res in c("c400")) { - if (res == "c400") +for (res in c("c200")) { + if (res == "c200") + cfg$input['cellular'] <- "rev4.115_5d9a2237_d882386f_cellularmagpie_c200_MRI-ESM2-0-ssp370_lpjml-8e6c5eb1_clusterweight-db9e7cf8.tgz" + else if (res == "c400") cfg$input['cellular'] <- "rev4.115_5d9a2237_d882386f_cellularmagpie_c400_MRI-ESM2-0-ssp370_lpjml-8e6c5eb1_clusterweight-db9e7cf8.tgz" else if (res == "c1000") { cfg$input['cellular'] <- "rev4.115_5d9a2237_277ed036_cellularmagpie_c1000_MRI-ESM2-0-ssp370_lpjml-8e6c5eb1_clusterweight-db9e7cf8.tgz" @@ -195,12 +197,21 @@ for (res in c("c400")) { cfg$gms$s58_cost_drain_intact_onetime <- 10000 start_run(cfg, codeCheck = FALSE) + cfg$title <- .title(cfg, paste(ssp, "AREA50", sep = "-")) + cfg$gms$c56_mute_ghgprices_until <- "y2150" + cfg$gms$c56_pollutant_prices <- "T0-CO2" + cfg$gms$s58_rewetting_exo <- 0 + cfg$gms$s58_cost_drain_intact_onetime <- 10000 + cfg$gms$s58_cost_rewet_onetime <- 0 + cfg$gms$s58_cost_rewet_recur <- -50 + start_run(cfg, codeCheck = FALSE) + cfg$title <- .title(cfg, paste(ssp, "AREA100", sep = "-")) cfg$gms$c56_mute_ghgprices_until <- "y2150" cfg$gms$c56_pollutant_prices <- "T0-CO2" cfg$gms$s58_rewetting_exo <- 0 cfg$gms$s58_cost_drain_intact_onetime <- 10000 - cfg$gms$s58_cost_rewet_onetime <- -100 + cfg$gms$s58_cost_rewet_onetime <- 0 cfg$gms$s58_cost_rewet_recur <- -100 start_run(cfg, codeCheck = FALSE) @@ -209,8 +220,8 @@ for (res in c("c400")) { cfg$gms$c56_pollutant_prices <- "T0-CO2" cfg$gms$s58_rewetting_exo <- 0 cfg$gms$s58_cost_drain_intact_onetime <- 10000 - cfg$gms$s58_cost_rewet_onetime <- -500 - cfg$gms$s58_cost_rewet_recur <- -100 + cfg$gms$s58_cost_rewet_onetime <- 0 + cfg$gms$s58_cost_rewet_recur <- 500 start_run(cfg, codeCheck = FALSE) cfg$title <- .title(cfg, paste(ssp, "AREA1000", sep = "-")) @@ -218,7 +229,26 @@ for (res in c("c400")) { cfg$gms$c56_pollutant_prices <- "T0-CO2" cfg$gms$s58_rewetting_exo <- 0 cfg$gms$s58_cost_drain_intact_onetime <- 10000 - cfg$gms$s58_cost_rewet_onetime <- -1000 - cfg$gms$s58_cost_rewet_recur <- -100 + cfg$gms$s58_cost_rewet_onetime <- 0 + cfg$gms$s58_cost_rewet_recur <- 1000 start_run(cfg, codeCheck = FALSE) + + cfg$title <- .title(cfg, paste(ssp, "AREA2000", sep = "-")) + cfg$gms$c56_mute_ghgprices_until <- "y2150" + cfg$gms$c56_pollutant_prices <- "T0-CO2" + cfg$gms$s58_rewetting_exo <- 0 + cfg$gms$s58_cost_drain_intact_onetime <- 10000 + cfg$gms$s58_cost_rewet_onetime <- 0 + cfg$gms$s58_cost_rewet_recur <- 2000 + start_run(cfg, codeCheck = FALSE) + + cfg$title <- .title(cfg, paste(ssp, "AREA5000", sep = "-")) + cfg$gms$c56_mute_ghgprices_until <- "y2150" + cfg$gms$c56_pollutant_prices <- "T0-CO2" + cfg$gms$s58_rewetting_exo <- 0 + cfg$gms$s58_cost_drain_intact_onetime <- 10000 + cfg$gms$s58_cost_rewet_onetime <- 0 + cfg$gms$s58_cost_rewet_recur <- 5000 + start_run(cfg, codeCheck = FALSE) + } From 18ce375617b637c65a9091ef9903e14c519c2883 Mon Sep 17 00:00:00 2001 From: florianh Date: Sun, 10 Nov 2024 15:09:35 +0100 Subject: [PATCH 138/206] update --- scripts/start/projects/paper_peatlandTax.R | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/start/projects/paper_peatlandTax.R b/scripts/start/projects/paper_peatlandTax.R index 8f55829e13..e6a0aaf127 100644 --- a/scripts/start/projects/paper_peatlandTax.R +++ b/scripts/start/projects/paper_peatlandTax.R @@ -47,7 +47,7 @@ cfg$repositories <- append( cfg$input['regional'] <- "rev4.115_5d9a2237_magpie.tgz" cfg$input['validation'] <- "rev4.115_5d9a2237_validation.tgz" cfg$input['calibration'] <- "calibration_H15_27Sep24.tgz" -cfg$input['cellular'] <- "rev4.115_5d9a2237_d882386f_cellularmagpie_c200_MRI-ESM2-0-ssp370_lpjml-8e6c5eb1_clusterweight-db9e7cf8.tgz" +cfg$input['cellular'] <- "rev4.115_5d9a2237_4f52075b_cellularmagpie_c200_MRI-ESM2-0-ssp370_lpjml-8e6c5eb1_clusterweight-db9e7cf8.tgz" download_and_update(cfg) ## Create patch file for GHG prices @@ -154,7 +154,7 @@ cfg$gms$s56_c_price_induced_aff <- 0 ## Start scenarios for (res in c("c200")) { if (res == "c200") - cfg$input['cellular'] <- "rev4.115_5d9a2237_d882386f_cellularmagpie_c200_MRI-ESM2-0-ssp370_lpjml-8e6c5eb1_clusterweight-db9e7cf8.tgz" + cfg$input['cellular'] <- "rev4.115_5d9a2237_4f52075b_cellularmagpie_c200_MRI-ESM2-0-ssp370_lpjml-8e6c5eb1_clusterweight-db9e7cf8.tgz" else if (res == "c400") cfg$input['cellular'] <- "rev4.115_5d9a2237_d882386f_cellularmagpie_c400_MRI-ESM2-0-ssp370_lpjml-8e6c5eb1_clusterweight-db9e7cf8.tgz" else if (res == "c1000") { From 2acb91318eb3d3b704bee847b8789857c7ba1e65 Mon Sep 17 00:00:00 2001 From: florianh Date: Sun, 10 Nov 2024 22:11:32 +0100 Subject: [PATCH 139/206] update --- scripts/start/projects/paper_peatlandTax.R | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/scripts/start/projects/paper_peatlandTax.R b/scripts/start/projects/paper_peatlandTax.R index e6a0aaf127..12732302c4 100644 --- a/scripts/start/projects/paper_peatlandTax.R +++ b/scripts/start/projects/paper_peatlandTax.R @@ -23,7 +23,7 @@ source("scripts/start_functions.R") source("config/default.cfg") # create additional information to describe the runs -cfg$info$flag <- "PTax40" +cfg$info$flag <- "PTax41" cfg$results_folder <- "output/:title:" cfg$results_folder_highres <- "output" @@ -152,7 +152,7 @@ cfg$gms$livestock <- "fbask_jan16_sticky" cfg$gms$s56_c_price_induced_aff <- 0 ## Start scenarios -for (res in c("c200")) { +for (res in c("c400")) { if (res == "c200") cfg$input['cellular'] <- "rev4.115_5d9a2237_4f52075b_cellularmagpie_c200_MRI-ESM2-0-ssp370_lpjml-8e6c5eb1_clusterweight-db9e7cf8.tgz" else if (res == "c400") @@ -221,7 +221,7 @@ for (res in c("c200")) { cfg$gms$s58_rewetting_exo <- 0 cfg$gms$s58_cost_drain_intact_onetime <- 10000 cfg$gms$s58_cost_rewet_onetime <- 0 - cfg$gms$s58_cost_rewet_recur <- 500 + cfg$gms$s58_cost_rewet_recur <- -500 start_run(cfg, codeCheck = FALSE) cfg$title <- .title(cfg, paste(ssp, "AREA1000", sep = "-")) @@ -230,7 +230,7 @@ for (res in c("c200")) { cfg$gms$s58_rewetting_exo <- 0 cfg$gms$s58_cost_drain_intact_onetime <- 10000 cfg$gms$s58_cost_rewet_onetime <- 0 - cfg$gms$s58_cost_rewet_recur <- 1000 + cfg$gms$s58_cost_rewet_recur <- -1000 start_run(cfg, codeCheck = FALSE) cfg$title <- .title(cfg, paste(ssp, "AREA2000", sep = "-")) @@ -239,7 +239,7 @@ for (res in c("c200")) { cfg$gms$s58_rewetting_exo <- 0 cfg$gms$s58_cost_drain_intact_onetime <- 10000 cfg$gms$s58_cost_rewet_onetime <- 0 - cfg$gms$s58_cost_rewet_recur <- 2000 + cfg$gms$s58_cost_rewet_recur <- -2000 start_run(cfg, codeCheck = FALSE) cfg$title <- .title(cfg, paste(ssp, "AREA5000", sep = "-")) @@ -248,7 +248,7 @@ for (res in c("c200")) { cfg$gms$s58_rewetting_exo <- 0 cfg$gms$s58_cost_drain_intact_onetime <- 10000 cfg$gms$s58_cost_rewet_onetime <- 0 - cfg$gms$s58_cost_rewet_recur <- 5000 + cfg$gms$s58_cost_rewet_recur <- -5000 start_run(cfg, codeCheck = FALSE) } From 6565d7a238bef70eb8c90d429f9641d39b9b506e Mon Sep 17 00:00:00 2001 From: florianh Date: Mon, 11 Nov 2024 18:45:32 +0100 Subject: [PATCH 140/206] bugfix vm_land --- modules/10_land/landmatrix_dec18/equations.gms | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/modules/10_land/landmatrix_dec18/equations.gms b/modules/10_land/landmatrix_dec18/equations.gms index 55ee823251..97d4594976 100644 --- a/modules/10_land/landmatrix_dec18/equations.gms +++ b/modules/10_land/landmatrix_dec18/equations.gms @@ -18,7 +18,7 @@ q10_transition_matrix(j2) .. sum((land_from,land_to), vm_lu_transitions(j2,land_from,land_to)) =e= - sum(land, vm_land(j2,land)); + sum(land, pcm_land(j2,land)); q10_transition_to(j2,land_to) .. sum(land_from, vm_lu_transitions(j2,land_from,land_to)) =e= @@ -26,7 +26,7 @@ q10_transition_from(j2,land_from) .. sum(land_to, vm_lu_transitions(j2,land_from,land_to)) =e= - vm_land.l(j2,land_from) + v10_balance_positive(j2,land_from) - v10_balance_negative(j2,land_from); + pcm_land(j2,land_from) + v10_balance_positive(j2,land_from) - v10_balance_negative(j2,land_from); *' The following two equations calculate land expansion and land contraction based *' on the above land transition matrix. From f817640583cca844e294046ba59d8a4e5c120b90 Mon Sep 17 00:00:00 2001 From: florianh Date: Mon, 11 Nov 2024 18:54:46 +0100 Subject: [PATCH 141/206] test --- modules/10_land/landmatrix_dec18/equations.gms | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/10_land/landmatrix_dec18/equations.gms b/modules/10_land/landmatrix_dec18/equations.gms index 97d4594976..6bd859e490 100644 --- a/modules/10_land/landmatrix_dec18/equations.gms +++ b/modules/10_land/landmatrix_dec18/equations.gms @@ -18,7 +18,7 @@ q10_transition_matrix(j2) .. sum((land_from,land_to), vm_lu_transitions(j2,land_from,land_to)) =e= - sum(land, pcm_land(j2,land)); + sum(land, vm_land(j2,land)); q10_transition_to(j2,land_to) .. sum(land_from, vm_lu_transitions(j2,land_from,land_to)) =e= From 84bfeee8106097a1c44cfa5ed54ea6a4084654dd Mon Sep 17 00:00:00 2001 From: florianh Date: Mon, 11 Nov 2024 19:30:38 +0100 Subject: [PATCH 142/206] test --- modules/10_land/landmatrix_dec18/equations.gms | 6 +++--- modules/10_land/landmatrix_dec18/preloop.gms | 3 +++ modules/10_land/landmatrix_dec18/scaling.gms | 4 ++-- 3 files changed, 8 insertions(+), 5 deletions(-) diff --git a/modules/10_land/landmatrix_dec18/equations.gms b/modules/10_land/landmatrix_dec18/equations.gms index 6bd859e490..eec4f4934f 100644 --- a/modules/10_land/landmatrix_dec18/equations.gms +++ b/modules/10_land/landmatrix_dec18/equations.gms @@ -17,8 +17,8 @@ *' `v10_balance_negative`should deviate from zero only in exceptional cases. q10_transition_matrix(j2) .. - sum((land_from,land_to), vm_lu_transitions(j2,land_from,land_to)) =e= - sum(land, vm_land(j2,land)); + sum(land, vm_land(j2,land)) =e= + sum(land, pcm_land(j2,land)); q10_transition_to(j2,land_to) .. sum(land_from, vm_lu_transitions(j2,land_from,land_to)) =e= @@ -26,7 +26,7 @@ q10_transition_from(j2,land_from) .. sum(land_to, vm_lu_transitions(j2,land_from,land_to)) =e= - pcm_land(j2,land_from) + v10_balance_positive(j2,land_from) - v10_balance_negative(j2,land_from); + pcm_land(j2,land_from); *' The following two equations calculate land expansion and land contraction based *' on the above land transition matrix. diff --git a/modules/10_land/landmatrix_dec18/preloop.gms b/modules/10_land/landmatrix_dec18/preloop.gms index 3a209b115b..6f42473d92 100644 --- a/modules/10_land/landmatrix_dec18/preloop.gms +++ b/modules/10_land/landmatrix_dec18/preloop.gms @@ -4,3 +4,6 @@ *** | 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 + +v10_balance_positive.fx(j,land_from) = 0; +v10_balance_negative.fx(j,land_from) = 0; diff --git a/modules/10_land/landmatrix_dec18/scaling.gms b/modules/10_land/landmatrix_dec18/scaling.gms index 4bb36e606e..7b3c0f19ba 100644 --- a/modules/10_land/landmatrix_dec18/scaling.gms +++ b/modules/10_land/landmatrix_dec18/scaling.gms @@ -6,5 +6,5 @@ *** | Contact: magpie@pik-potsdam.de vm_landdiff.scale = 10e3; -v10_balance_positive.scale(j,land_from) = 10e-7; -v10_balance_negative.scale(j,land_from) = 10e-7; +*v10_balance_positive.scale(j,land_from) = 10e-7; +*v10_balance_negative.scale(j,land_from) = 10e-7; From a173ead6930b50364064f33feb76b74f9e5b6da2 Mon Sep 17 00:00:00 2001 From: florianh Date: Mon, 11 Nov 2024 20:43:23 +0100 Subject: [PATCH 143/206] test --- config/default.cfg | 7 ------- .../10_land/landmatrix_dec18/declarations.gms | 8 ++------ .../10_land/landmatrix_dec18/equations.gms | 19 +++++++------------ modules/10_land/landmatrix_dec18/input.gms | 4 ---- .../10_land/landmatrix_dec18/postsolve.gms | 16 ++++------------ modules/10_land/landmatrix_dec18/scaling.gms | 2 -- .../44_biodiversity/bii_target/equations.gms | 2 +- .../bii_target_apr24/equations.gms | 2 +- .../44_biodiversity/bv_btc_mar21/not_used.txt | 2 +- 9 files changed, 16 insertions(+), 46 deletions(-) diff --git a/config/default.cfg b/config/default.cfg index f15f836398..fbc2cc2182 100644 --- a/config/default.cfg +++ b/config/default.cfg @@ -206,13 +206,6 @@ cfg$gms$sm_fix_cc <- 2025 # * (landmatrix_dec18): includes a land transition matrix cfg$gms$land <- "landmatrix_dec18" # def = landmatrix_dec18 -# * Artificial cost for balance variables (USD17MER per ha) -# * The balance variables in the land module avoid infeasibilities due to -# * differences in accuracy between parameters and variables in GAMS. -# * High costs make sure that the balance variables are only used as a last resort. -cfg$gms$s10_cost_balance <- 1e+06 # def = 1e+06 - - # ***--------------------- 11_costs ------ -------------------------------- # * (default): default cost realization cfg$gms$costs <- "default" # def = default diff --git a/modules/10_land/landmatrix_dec18/declarations.gms b/modules/10_land/landmatrix_dec18/declarations.gms index 2b7346ff73..b0fb5b0616 100644 --- a/modules/10_land/landmatrix_dec18/declarations.gms +++ b/modules/10_land/landmatrix_dec18/declarations.gms @@ -21,12 +21,10 @@ positive variables vm_landreduction(j,land) Land reduction (mio. ha) vm_cost_land_transition(j) Costs for lu transitions (mio. USD17MER per yr) vm_lu_transitions(j,land_from,land_to) Land transitions between time steps (mio. ha) - v10_balance_positive(j,land_from) Balance variable for land transitions (mio. ha) - v10_balance_negative(j,land_from) Balance variable for land transitions (mio. ha) ; equations - q10_transition_matrix(j) Land transition constraint cell area (mio. ha) + q10_land_area(j) Land transition constraint cell area (mio. ha) q10_transition_to(j,land_to) Land transition constraint to (mio. ha) q10_transition_from(j,land_from) Land transition constraint from (mio. ha) q10_landexpansion(j,land_to) Land expansion constraint (mio. ha) @@ -43,9 +41,7 @@ parameters ov_landreduction(t,j,land,type) Land reduction (mio. ha) ov_cost_land_transition(t,j,type) Costs for lu transitions (mio. USD17MER per yr) ov_lu_transitions(t,j,land_from,land_to,type) Land transitions between time steps (mio. ha) - ov10_balance_positive(t,j,land_from,type) Balance variable for land transitions (mio. ha) - ov10_balance_negative(t,j,land_from,type) Balance variable for land transitions (mio. ha) - oq10_transition_matrix(t,j,type) Land transition constraint cell area (mio. ha) + oq10_land_area(t,j,type) Land transition constraint cell area (mio. ha) oq10_transition_to(t,j,land_to,type) Land transition constraint to (mio. ha) oq10_transition_from(t,j,land_from,type) Land transition constraint from (mio. ha) oq10_landexpansion(t,j,land_to,type) Land expansion constraint (mio. ha) diff --git a/modules/10_land/landmatrix_dec18/equations.gms b/modules/10_land/landmatrix_dec18/equations.gms index eec4f4934f..aab102ce92 100644 --- a/modules/10_land/landmatrix_dec18/equations.gms +++ b/modules/10_land/landmatrix_dec18/equations.gms @@ -7,19 +7,15 @@ *' @equations -*' The following three equations describe the general structure of the land transition matrix. -*' The first equation defines the total amount of land to be constant over time. -*' The two balancing variables `v10_balance_positive` and `v10_balance_negative` are needed -*' to avoid technical infeasibilities due to small differences in accuracy between -*' variables and parameters in GAMS. The use of `v10_balance_positive` and -*' `v10_balance_negative` is minimized by putting a high cost factor on these variables -*' (`q10_cost`). In practice, `v10_balance_positive` and -*' `v10_balance_negative`should deviate from zero only in exceptional cases. - - q10_transition_matrix(j2) .. + +*' This equation defines the total amount of land to be constant over time. + + q10_land_area(j2) .. sum(land, vm_land(j2,land)) =e= sum(land, pcm_land(j2,land)); +*' The following two equations describe the land transition matrix. + q10_transition_to(j2,land_to) .. sum(land_from, vm_lu_transitions(j2,land_from,land_to)) =e= vm_land(j2,land_to); @@ -45,8 +41,7 @@ q10_cost(j2) .. vm_cost_land_transition(j2) =e= - sum(land, vm_landexpansion(j2,land) + vm_landreduction(j2,land)) * 1 - + sum(land_from, v10_balance_positive(j2,land_from) + v10_balance_negative(j2,land_from)) * s10_cost_balance; + sum(land, vm_landexpansion(j2,land) + vm_landreduction(j2,land)) * 1; *' The gross changes in land are calculated based on land expansion, land *' contraction and land changes from within the modules [35_natveg] diff --git a/modules/10_land/landmatrix_dec18/input.gms b/modules/10_land/landmatrix_dec18/input.gms index d0c305c988..54b958cffa 100644 --- a/modules/10_land/landmatrix_dec18/input.gms +++ b/modules/10_land/landmatrix_dec18/input.gms @@ -5,10 +5,6 @@ *** | MAgPIE License Exception, version 1.0 (see LICENSE file). *** | Contact: magpie@pik-potsdam.de -scalars - s10_cost_balance Artificial cost for balance variable (USD17MER per ha) / 1e+06 / -; - table f10_land(t_ini10,j,land) Different land type areas (mio. ha) $ondelim $include "./modules/10_land/input/avl_land_t.cs3" diff --git a/modules/10_land/landmatrix_dec18/postsolve.gms b/modules/10_land/landmatrix_dec18/postsolve.gms index 75565d91fc..f3cbeb531e 100644 --- a/modules/10_land/landmatrix_dec18/postsolve.gms +++ b/modules/10_land/landmatrix_dec18/postsolve.gms @@ -15,9 +15,7 @@ pcm_land(j,land) = vm_land.l(j,land); ov_landreduction(t,j,land,"marginal") = vm_landreduction.m(j,land); ov_cost_land_transition(t,j,"marginal") = vm_cost_land_transition.m(j); ov_lu_transitions(t,j,land_from,land_to,"marginal") = vm_lu_transitions.m(j,land_from,land_to); - ov10_balance_positive(t,j,land_from,"marginal") = v10_balance_positive.m(j,land_from); - ov10_balance_negative(t,j,land_from,"marginal") = v10_balance_negative.m(j,land_from); - oq10_transition_matrix(t,j,"marginal") = q10_transition_matrix.m(j); + oq10_land_area(t,j,"marginal") = q10_land_area.m(j); oq10_transition_to(t,j,land_to,"marginal") = q10_transition_to.m(j,land_to); oq10_transition_from(t,j,land_from,"marginal") = q10_transition_from.m(j,land_from); oq10_landexpansion(t,j,land_to,"marginal") = q10_landexpansion.m(j,land_to); @@ -30,9 +28,7 @@ pcm_land(j,land) = vm_land.l(j,land); ov_landreduction(t,j,land,"level") = vm_landreduction.l(j,land); ov_cost_land_transition(t,j,"level") = vm_cost_land_transition.l(j); ov_lu_transitions(t,j,land_from,land_to,"level") = vm_lu_transitions.l(j,land_from,land_to); - ov10_balance_positive(t,j,land_from,"level") = v10_balance_positive.l(j,land_from); - ov10_balance_negative(t,j,land_from,"level") = v10_balance_negative.l(j,land_from); - oq10_transition_matrix(t,j,"level") = q10_transition_matrix.l(j); + oq10_land_area(t,j,"level") = q10_land_area.l(j); oq10_transition_to(t,j,land_to,"level") = q10_transition_to.l(j,land_to); oq10_transition_from(t,j,land_from,"level") = q10_transition_from.l(j,land_from); oq10_landexpansion(t,j,land_to,"level") = q10_landexpansion.l(j,land_to); @@ -45,9 +41,7 @@ pcm_land(j,land) = vm_land.l(j,land); ov_landreduction(t,j,land,"upper") = vm_landreduction.up(j,land); ov_cost_land_transition(t,j,"upper") = vm_cost_land_transition.up(j); ov_lu_transitions(t,j,land_from,land_to,"upper") = vm_lu_transitions.up(j,land_from,land_to); - ov10_balance_positive(t,j,land_from,"upper") = v10_balance_positive.up(j,land_from); - ov10_balance_negative(t,j,land_from,"upper") = v10_balance_negative.up(j,land_from); - oq10_transition_matrix(t,j,"upper") = q10_transition_matrix.up(j); + oq10_land_area(t,j,"upper") = q10_land_area.up(j); oq10_transition_to(t,j,land_to,"upper") = q10_transition_to.up(j,land_to); oq10_transition_from(t,j,land_from,"upper") = q10_transition_from.up(j,land_from); oq10_landexpansion(t,j,land_to,"upper") = q10_landexpansion.up(j,land_to); @@ -60,9 +54,7 @@ pcm_land(j,land) = vm_land.l(j,land); ov_landreduction(t,j,land,"lower") = vm_landreduction.lo(j,land); ov_cost_land_transition(t,j,"lower") = vm_cost_land_transition.lo(j); ov_lu_transitions(t,j,land_from,land_to,"lower") = vm_lu_transitions.lo(j,land_from,land_to); - ov10_balance_positive(t,j,land_from,"lower") = v10_balance_positive.lo(j,land_from); - ov10_balance_negative(t,j,land_from,"lower") = v10_balance_negative.lo(j,land_from); - oq10_transition_matrix(t,j,"lower") = q10_transition_matrix.lo(j); + oq10_land_area(t,j,"lower") = q10_land_area.lo(j); oq10_transition_to(t,j,land_to,"lower") = q10_transition_to.lo(j,land_to); oq10_transition_from(t,j,land_from,"lower") = q10_transition_from.lo(j,land_from); oq10_landexpansion(t,j,land_to,"lower") = q10_landexpansion.lo(j,land_to); diff --git a/modules/10_land/landmatrix_dec18/scaling.gms b/modules/10_land/landmatrix_dec18/scaling.gms index 7b3c0f19ba..7cf3630df2 100644 --- a/modules/10_land/landmatrix_dec18/scaling.gms +++ b/modules/10_land/landmatrix_dec18/scaling.gms @@ -6,5 +6,3 @@ *** | Contact: magpie@pik-potsdam.de vm_landdiff.scale = 10e3; -*v10_balance_positive.scale(j,land_from) = 10e-7; -*v10_balance_negative.scale(j,land_from) = 10e-7; diff --git a/modules/44_biodiversity/bii_target/equations.gms b/modules/44_biodiversity/bii_target/equations.gms index eb730f0a96..4d5be2c8e7 100644 --- a/modules/44_biodiversity/bii_target/equations.gms +++ b/modules/44_biodiversity/bii_target/equations.gms @@ -11,7 +11,7 @@ *' The regional layer is needed for compatibility with the high resolution parallel optimization output script (scripts/output/extra/highres.R) q44_bii(i2,biome44)$(sum(cell(i2,j2), f44_biome(j2,biome44)) > 1e-10) .. - v44_bii(i2,biome44) * sum((cell(i2,j2),land), pcm_land(j2,land) * f44_biome(j2,biome44)) + v44_bii(i2,biome44) * sum((cell(i2,j2),land), vm_land(j2,land) * f44_biome(j2,biome44)) =e= sum((cell(i2,j2),potnatveg,landcover44), vm_bv(j2,landcover44,potnatveg) * f44_biome(j2,biome44)); diff --git a/modules/44_biodiversity/bii_target_apr24/equations.gms b/modules/44_biodiversity/bii_target_apr24/equations.gms index e0584c0b98..891f8f575a 100644 --- a/modules/44_biodiversity/bii_target_apr24/equations.gms +++ b/modules/44_biodiversity/bii_target_apr24/equations.gms @@ -12,7 +12,7 @@ *' The regional layer is needed for compatibility with the high resolution parallel optimization output script (scripts/output/extra/highres.R) q44_bii(i2,biome44)$(sum(cell(i2,j2), f44_biome(j2,biome44)*f44_rr_layer(j2)) > 1e-10) .. - v44_bii(i2,biome44) * sum((cell(i2,j2),land), pcm_land(j2,land) * f44_rr_layer(j2) * f44_biome(j2,biome44)) + v44_bii(i2,biome44) * sum((cell(i2,j2),land), vm_land(j2,land) * f44_rr_layer(j2) * f44_biome(j2,biome44)) =e= sum((cell(i2,j2),potnatveg,landcover44), vm_bv(j2,landcover44,potnatveg) * f44_rr_layer(j2) * f44_biome(j2,biome44)); diff --git a/modules/44_biodiversity/bv_btc_mar21/not_used.txt b/modules/44_biodiversity/bv_btc_mar21/not_used.txt index 2430a1919c..3d0cbff4f1 100644 --- a/modules/44_biodiversity/bv_btc_mar21/not_used.txt +++ b/modules/44_biodiversity/bv_btc_mar21/not_used.txt @@ -1,3 +1,3 @@ name,type,reason -pcm_land, input, not used +vm_land, input, not used sm_fix_SSP2, input, not used From 6edaf63e0eefb8de0d5e1c6f768429ed9c9bcd34 Mon Sep 17 00:00:00 2001 From: florianh Date: Mon, 11 Nov 2024 20:55:48 +0100 Subject: [PATCH 144/206] test --- modules/10_land/landmatrix_dec18/preloop.gms | 9 --------- modules/10_land/landmatrix_dec18/realization.gms | 1 - 2 files changed, 10 deletions(-) delete mode 100644 modules/10_land/landmatrix_dec18/preloop.gms diff --git a/modules/10_land/landmatrix_dec18/preloop.gms b/modules/10_land/landmatrix_dec18/preloop.gms deleted file mode 100644 index 6f42473d92..0000000000 --- a/modules/10_land/landmatrix_dec18/preloop.gms +++ /dev/null @@ -1,9 +0,0 @@ -*** | (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 - -v10_balance_positive.fx(j,land_from) = 0; -v10_balance_negative.fx(j,land_from) = 0; diff --git a/modules/10_land/landmatrix_dec18/realization.gms b/modules/10_land/landmatrix_dec18/realization.gms index 0a32fde34d..1fdcc37d64 100644 --- a/modules/10_land/landmatrix_dec18/realization.gms +++ b/modules/10_land/landmatrix_dec18/realization.gms @@ -17,7 +17,6 @@ $Ifi "%phase%" == "input" $include "./modules/10_land/landmatrix_dec18/input.gms $Ifi "%phase%" == "equations" $include "./modules/10_land/landmatrix_dec18/equations.gms" $Ifi "%phase%" == "scaling" $include "./modules/10_land/landmatrix_dec18/scaling.gms" $Ifi "%phase%" == "start" $include "./modules/10_land/landmatrix_dec18/start.gms" -$Ifi "%phase%" == "preloop" $include "./modules/10_land/landmatrix_dec18/preloop.gms" $Ifi "%phase%" == "presolve" $include "./modules/10_land/landmatrix_dec18/presolve.gms" $Ifi "%phase%" == "postsolve" $include "./modules/10_land/landmatrix_dec18/postsolve.gms" *######################## R SECTION END (PHASES) ############################### From 1e3f522dc49c254b9f665bff64a7e427e61eb224 Mon Sep 17 00:00:00 2001 From: florianh Date: Tue, 12 Nov 2024 08:50:54 +0100 Subject: [PATCH 145/206] revert --- modules/44_biodiversity/bii_target/equations.gms | 2 +- modules/44_biodiversity/bii_target_apr24/equations.gms | 2 +- modules/44_biodiversity/bv_btc_mar21/not_used.txt | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/modules/44_biodiversity/bii_target/equations.gms b/modules/44_biodiversity/bii_target/equations.gms index 4d5be2c8e7..eb730f0a96 100644 --- a/modules/44_biodiversity/bii_target/equations.gms +++ b/modules/44_biodiversity/bii_target/equations.gms @@ -11,7 +11,7 @@ *' The regional layer is needed for compatibility with the high resolution parallel optimization output script (scripts/output/extra/highres.R) q44_bii(i2,biome44)$(sum(cell(i2,j2), f44_biome(j2,biome44)) > 1e-10) .. - v44_bii(i2,biome44) * sum((cell(i2,j2),land), vm_land(j2,land) * f44_biome(j2,biome44)) + v44_bii(i2,biome44) * sum((cell(i2,j2),land), pcm_land(j2,land) * f44_biome(j2,biome44)) =e= sum((cell(i2,j2),potnatveg,landcover44), vm_bv(j2,landcover44,potnatveg) * f44_biome(j2,biome44)); diff --git a/modules/44_biodiversity/bii_target_apr24/equations.gms b/modules/44_biodiversity/bii_target_apr24/equations.gms index 891f8f575a..e0584c0b98 100644 --- a/modules/44_biodiversity/bii_target_apr24/equations.gms +++ b/modules/44_biodiversity/bii_target_apr24/equations.gms @@ -12,7 +12,7 @@ *' The regional layer is needed for compatibility with the high resolution parallel optimization output script (scripts/output/extra/highres.R) q44_bii(i2,biome44)$(sum(cell(i2,j2), f44_biome(j2,biome44)*f44_rr_layer(j2)) > 1e-10) .. - v44_bii(i2,biome44) * sum((cell(i2,j2),land), vm_land(j2,land) * f44_rr_layer(j2) * f44_biome(j2,biome44)) + v44_bii(i2,biome44) * sum((cell(i2,j2),land), pcm_land(j2,land) * f44_rr_layer(j2) * f44_biome(j2,biome44)) =e= sum((cell(i2,j2),potnatveg,landcover44), vm_bv(j2,landcover44,potnatveg) * f44_rr_layer(j2) * f44_biome(j2,biome44)); diff --git a/modules/44_biodiversity/bv_btc_mar21/not_used.txt b/modules/44_biodiversity/bv_btc_mar21/not_used.txt index 3d0cbff4f1..2430a1919c 100644 --- a/modules/44_biodiversity/bv_btc_mar21/not_used.txt +++ b/modules/44_biodiversity/bv_btc_mar21/not_used.txt @@ -1,3 +1,3 @@ name,type,reason -vm_land, input, not used +pcm_land, input, not used sm_fix_SSP2, input, not used From 8e865afec7f521c3bc3ef816ea8032ae718843e6 Mon Sep 17 00:00:00 2001 From: florianh Date: Tue, 12 Nov 2024 21:30:23 +0100 Subject: [PATCH 146/206] update --- CHANGELOG.md | 5 ++-- config/default.cfg | 6 ++--- config/projects/scenario_config_el2.csv | 2 +- config/projects/scenario_config_fsec.csv | 6 ++--- config/scenario_config.csv | 2 +- modules/29_cropland/detail_apr24/preloop.gms | 7 ++++++ modules/30_croparea/detail_apr24/preloop.gms | 9 ++++++++ modules/30_croparea/simple_apr24/preloop.gms | 9 ++++++++ modules/31_past/endo_jun13/preloop.gms | 14 +++++++++++ modules/31_past/endo_jun13/realization.gms | 1 + modules/31_past/grasslands_apr22/preloop.gms | 9 ++++++++ modules/32_forestry/dynamic_may24/preloop.gms | 13 +++++++++++ modules/34_urban/exo_nov21/preloop.gms | 4 ++++ modules/34_urban/static/presolve.gms | 2 +- .../35_natveg/pot_forest_may24/preloop.gms | 12 ++++++++++ .../bii_target/declarations.gms | 18 ++++++++------- .../44_biodiversity/bii_target/equations.gms | 9 ++++---- modules/44_biodiversity/bii_target/input.gms | 6 ++--- .../44_biodiversity/bii_target/preloop.gms | 23 +++++++++++++++---- .../44_biodiversity/bii_target/presolve.gms | 2 +- .../bii_target_apr24/declarations.gms | 16 +++++++------ .../bii_target_apr24/equations.gms | 9 ++++---- .../bii_target_apr24/input.gms | 6 ++--- .../bii_target_apr24/preloop.gms | 23 +++++++++++++++---- .../bii_target_apr24/presolve.gms | 5 +++- scripts/start/extra/recalibrateH16.R | 6 ++--- scripts/start/projects/paper_peatlandTax.R | 10 ++++---- scripts/start/projects/project_ABCDR.R | 14 +++++------ scripts/start/projects/project_EAT2p0.R | 2 +- 29 files changed, 182 insertions(+), 68 deletions(-) create mode 100644 modules/31_past/endo_jun13/preloop.gms diff --git a/CHANGELOG.md b/CHANGELOG.md index 1704a4f640..fbc13a9cc6 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -21,6 +21,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). ### added - **62_material** added switch to turn off future material demand for bioplastic - **config** added SSP1-POP-GDP SSP2-POP-GDP and SSP5-POP-GDP +- **modules[29-35]** added initial vales for ov_bv for better starting point ### removed - @@ -31,8 +32,8 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). - **scripts** script/output/extra/resubmit.R - **28_ageclass** bugfix input data unit and code clean-up. Renamed `feb21` realization to `oct24` - **70_livestock** bugfix scaling.gms file in wrong folder -- **10_land** bugfix land transition matrix for improved feasibility (variables and parameters have different accuracy) -- **44_biodiversity** avoid division by zero and improved consistency between realisations for fixing variables +- **10_land** Simplified land transition matrix for improved feasibility +- **44_biodiversity** bugfix biorealm_biome.cs3 in input data (shares did not add-up to 1) ## [4.8.2] - 2024-09-24 diff --git a/config/default.cfg b/config/default.cfg index fbc2cc2182..841a22f14b 100644 --- a/config/default.cfg +++ b/config/default.cfg @@ -22,9 +22,9 @@ cfg$model <- "main.gms" #def = "main.gms" #### input settings #### # which input data sets should be used? -cfg$input <- c(regional = "rev4.115_h12_magpie.tgz", - cellular = "rev4.115_h12_0bd54110_cellularmagpie_c200_MRI-ESM2-0-ssp119_lpjml-8e6c5eb1.tgz", - validation = "rev4.115_h12_validation.tgz", +cfg$input <- c(regional = "rev4.116_h12_magpie.tgz", + cellular = "rev4.116_h12_2ca80312_cellularmagpie_c400_MRI-ESM2-0-ssp370_lpjml-8e6c5eb1.tgz", + validation = "rev4.116_h12_validation.tgz", additional = "additional_data_rev4.57.tgz", calibration = "calibration_H12_27Sep24.tgz") diff --git a/config/projects/scenario_config_el2.csv b/config/projects/scenario_config_el2.csv index 4fb7c28973..e48b47aae1 100644 --- a/config/projects/scenario_config_el2.csv +++ b/config/projects/scenario_config_el2.csv @@ -19,5 +19,5 @@ gms$s15_exo_alcohol;1;1;1 gms$s15_alc_scen;0;0;0 gms$factor_costs;sticky_labor;sticky_labor;sticky_labor gms$c70_feed_scen;ssp1;ssp2;ssp2 -input['cellular'];rev4.115EL2_h12_c6a7458f_cellularmagpie_c200_IPSL-CM6A-LR-ssp370_lpjml-8e6c5eb1.tgz;; +input['cellular'];rev4.116EL2_h12_c6a7458f_cellularmagpie_c200_IPSL-CM6A-LR-ssp370_lpjml-8e6c5eb1.tgz;; magicc_emis_scen;REMIND_generic_C_SSP2EU-DSPkB650-DS_betax_DeepDive_noNDC-rem-12.mif;REMIND_generic_C_SSP2EU-DSPkB650-DS_betax_DeepDive_noNDC-rem-12.mif;REMIND_generic_C_SSP2EU-DSPkB650-DS_betax_DeepDive_noNDC-rem-12.mif diff --git a/config/projects/scenario_config_fsec.csv b/config/projects/scenario_config_fsec.csv index a007d17c34..dda4e130b0 100644 --- a/config/projects/scenario_config_fsec.csv +++ b/config/projects/scenario_config_fsec.csv @@ -76,9 +76,9 @@ gms$s62_max_dem_bioplastic;0;;;;400;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; gms$c70_fac_req_regr;reg;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; gms$c70_feed_scen;;;;;;;;;;;;;;;;;;ssp1;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; gms$c73_build_demand;;;;;;;;;;;;;;;;;;;;;;;;50pc;;;;;;;;;;;;;;;;;;;;;;;;;;; -input['cellular'];rev4.115_FSEC_3c888fa5_cellularmagpie_c200_MRI-ESM2-0-ssp460_lpjml-8e6c5eb1.tgz;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;rev4.115_FSEC_0bd54110_cellularmagpie_c200_MRI-ESM2-0-ssp119_lpjml-8e6c5eb1.tgz;rev4.115_FSEC_6819938d_cellularmagpie_c200_MRI-ESM2-0-ssp126_lpjml-8e6c5eb1.tgz;;rev4.115_FSEC_1b5c3817_cellularmagpie_c200_MRI-ESM2-0-ssp245_lpjml-8e6c5eb1.tgz;rev4.115_FSEC_3c888fa5_cellularmagpie_c200_MRI-ESM2-0-ssp460_lpjml-8e6c5eb1.tgz;rev4.115_FSEC_fd712c0b_cellularmagpie_c200_MRI-ESM2-0-ssp370_lpjml-8e6c5eb1.tgz;rev4.115_FSEC_09a63995_cellularmagpie_c200_MRI-ESM2-0-ssp585_lpjml-8e6c5eb1.tgz;;; -input['regional'];rev4.115_FSEC_magpie.tgz;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -input['validation'];rev4.115_FSEC_validation.tgz;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +input['cellular'];rev4.116_FSEC_3c888fa5_cellularmagpie_c200_MRI-ESM2-0-ssp460_lpjml-8e6c5eb1.tgz;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;rev4.116_FSEC_0bd54110_cellularmagpie_c200_MRI-ESM2-0-ssp119_lpjml-8e6c5eb1.tgz;rev4.116_FSEC_6819938d_cellularmagpie_c200_MRI-ESM2-0-ssp126_lpjml-8e6c5eb1.tgz;;rev4.116_FSEC_1b5c3817_cellularmagpie_c200_MRI-ESM2-0-ssp245_lpjml-8e6c5eb1.tgz;rev4.116_FSEC_3c888fa5_cellularmagpie_c200_MRI-ESM2-0-ssp460_lpjml-8e6c5eb1.tgz;rev4.116_FSEC_fd712c0b_cellularmagpie_c200_MRI-ESM2-0-ssp370_lpjml-8e6c5eb1.tgz;rev4.116_FSEC_09a63995_cellularmagpie_c200_MRI-ESM2-0-ssp585_lpjml-8e6c5eb1.tgz;;; +input['regional'];rev4.116_FSEC_magpie.tgz;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +input['validation'];rev4.116_FSEC_validation.tgz;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; input['additional'];additional_data_rev4.57.tgz;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; input['calibration'];calibration_FSEC_27Sep24.tgz;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; magicc_emis_scen;bjoernAR6_C_SSP2-NDC.mif;;;bjoernAR6_C_SSP2-PkBudg900.mif;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;bjoernAR6_C_SSP1-NDC.mif;;;;;;;;;;;;bjoernAR6_C_RemSDP-900-MagSSP1.mif;; diff --git a/config/scenario_config.csv b/config/scenario_config.csv index fe9e64437b..6f00b24aa8 100755 --- a/config/scenario_config.csv +++ b/config/scenario_config.csv @@ -74,4 +74,4 @@ gms$c60_biodem_level;;;;;;;;;;;;;;;;;;;;1;0;;;;;;;;;;;; gms$c60_res_2ndgenBE_dem;;;;ssp1;ssp2;ssp2;ssp3;ssp4;ssp5;sdp;ssp2;sdp;sdp;;;;;;;;;;;;;;;;;;;; gms$c70_feed_scen;;;;ssp1;ssp2;ssp2;ssp3;ssp4;ssp5;ssp1;ssp5;ssp1;ssp1;;;;;;;;;;;;;;;;;;;; gms$s73_timber_demand_switch;;;;;;;;;;;;;;;;;;;;;;;;;1;1;0;;;;;; -input['cellular'];;;;;;;;;;;;;;;;;;;;;;;;;;;;rev4.115_h12_0bd54110_cellularmagpie_c200_MRI-ESM2-0-ssp119_lpjml-8e6c5eb1.tgz;rev4.115_h12_6819938d_cellularmagpie_c200_MRI-ESM2-0-ssp126_lpjml-8e6c5eb1.tgz;rev4.115_h12_1b5c3817_cellularmagpie_c200_MRI-ESM2-0-ssp245_lpjml-8e6c5eb1.tgz;rev4.115_h12_3c888fa5_cellularmagpie_c200_MRI-ESM2-0-ssp460_lpjml-8e6c5eb1.tgz;rev4.115_h12_fd712c0b_cellularmagpie_c200_MRI-ESM2-0-ssp370_lpjml-8e6c5eb1.tgz;rev4.115_h12_09a63995_cellularmagpie_c200_MRI-ESM2-0-ssp585_lpjml-8e6c5eb1.tgz +input['cellular'];;;;;;;;;;;;;;;;;;;;;;;;;;;;rev4.116_h12_0bd54110_cellularmagpie_c200_MRI-ESM2-0-ssp119_lpjml-8e6c5eb1.tgz;rev4.116_h12_6819938d_cellularmagpie_c200_MRI-ESM2-0-ssp126_lpjml-8e6c5eb1.tgz;rev4.116_h12_1b5c3817_cellularmagpie_c200_MRI-ESM2-0-ssp245_lpjml-8e6c5eb1.tgz;rev4.116_h12_3c888fa5_cellularmagpie_c200_MRI-ESM2-0-ssp460_lpjml-8e6c5eb1.tgz;rev4.116_h12_fd712c0b_cellularmagpie_c200_MRI-ESM2-0-ssp370_lpjml-8e6c5eb1.tgz;rev4.116_h12_09a63995_cellularmagpie_c200_MRI-ESM2-0-ssp585_lpjml-8e6c5eb1.tgz diff --git a/modules/29_cropland/detail_apr24/preloop.gms b/modules/29_cropland/detail_apr24/preloop.gms index 34c0fe6eac..35e58c0244 100644 --- a/modules/29_cropland/detail_apr24/preloop.gms +++ b/modules/29_cropland/detail_apr24/preloop.gms @@ -66,3 +66,10 @@ p29_country_dummy(policy_countries29) = 1; * Countries are weighted by available cropland area. pm_avl_cropland_iso(iso) = f29_avl_cropland_iso(iso,"%c29_marginal_land%"); p29_country_weight(i) = sum(i_to_iso(i,iso), p29_country_dummy(iso) * pm_avl_cropland_iso(iso)) / sum(i_to_iso(i,iso), pm_avl_cropland_iso(iso)); + +* Initialize biodiversity value +vm_bv.l(j2,"crop_fallow",potnatveg) = 0; + +vm_bv.l(j2,"crop_tree",potnatveg) = + sum(bii_class_secd, sum(ac_to_bii_class_secd(ac,bii_class_secd), pc29_treecover(j2,ac)) * + p29_treecover_bii_coeff(bii_class_secd,potnatveg)) * fm_luh2_side_layers(j2,potnatveg); diff --git a/modules/30_croparea/detail_apr24/preloop.gms b/modules/30_croparea/detail_apr24/preloop.gms index cdef528e7f..54fe834d90 100644 --- a/modules/30_croparea/detail_apr24/preloop.gms +++ b/modules/30_croparea/detail_apr24/preloop.gms @@ -39,3 +39,12 @@ p30_country_dummy(policy_countries30) = 1; * share is calculated that translates the countries' influence to regional level. * Countries are weighted by available cropland area. p30_country_weight(i) = sum(i_to_iso(i,iso), p30_country_dummy(iso) * pm_avl_cropland_iso(iso)) / sum(i_to_iso(i,iso), pm_avl_cropland_iso(iso)); + +* Initialize biodiversity value +vm_bv.l(j,"crop_ann",potnatveg) = + sum((crop_ann30,w), fm_croparea("y1995",j,w,crop_ann30)) * fm_bii_coeff("crop_ann",potnatveg) + * fm_luh2_side_layers(j,potnatveg); + +vm_bv.l(j,"crop_per",potnatveg) = + sum((crop_per30,w), fm_croparea("y1995",j,w,crop_per30)) * fm_bii_coeff("crop_per",potnatveg) + * fm_luh2_side_layers(j,potnatveg); diff --git a/modules/30_croparea/simple_apr24/preloop.gms b/modules/30_croparea/simple_apr24/preloop.gms index adffa58780..119943f4a2 100644 --- a/modules/30_croparea/simple_apr24/preloop.gms +++ b/modules/30_croparea/simple_apr24/preloop.gms @@ -23,3 +23,12 @@ p30_country_dummy(policy_countries30) = 1; * share is calculated that translates the countries' influence to regional level. * Countries are weighted by available cropland area. p30_country_weight(i) = sum(i_to_iso(i,iso), p30_country_dummy(iso) * pm_avl_cropland_iso(iso)) / sum(i_to_iso(i,iso), pm_avl_cropland_iso(iso)); + +* Initialize biodiversity value +vm_bv.l(j,"crop_ann",potnatveg) = + sum((crop_ann30,w), fm_croparea("y1995",j,w,crop_ann30)) * fm_bii_coeff("crop_ann",potnatveg) + * fm_luh2_side_layers(j,potnatveg); + +vm_bv.l(j,"crop_per",potnatveg) = + sum((crop_per30,w), fm_croparea("y1995",j,w,crop_per30)) * fm_bii_coeff("crop_per",potnatveg) + * fm_luh2_side_layers(j,potnatveg); diff --git a/modules/31_past/endo_jun13/preloop.gms b/modules/31_past/endo_jun13/preloop.gms new file mode 100644 index 0000000000..0a411a741f --- /dev/null +++ b/modules/31_past/endo_jun13/preloop.gms @@ -0,0 +1,14 @@ +*** | (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 + +* Initialize biodiversity value +vm_bv.l(j,"manpast",potnatveg) = + pcm_land(j,"past") * fm_luh2_side_layers(j,"manpast") * fm_bii_coeff("manpast",potnatveg) * fm_luh2_side_layers(j,potnatveg); + +vm_bv.l(j,"rangeland",potnatveg) = + pcm_land(j,"past") * fm_luh2_side_layers(j,"rangeland") * fm_bii_coeff("rangeland",potnatveg) * fm_luh2_side_layers(j,potnatveg); + diff --git a/modules/31_past/endo_jun13/realization.gms b/modules/31_past/endo_jun13/realization.gms index f85b630f32..d06a7405f6 100644 --- a/modules/31_past/endo_jun13/realization.gms +++ b/modules/31_past/endo_jun13/realization.gms @@ -21,6 +21,7 @@ $Ifi "%phase%" == "declarations" $include "./modules/31_past/endo_jun13/declarations.gms" $Ifi "%phase%" == "input" $include "./modules/31_past/endo_jun13/input.gms" $Ifi "%phase%" == "equations" $include "./modules/31_past/endo_jun13/equations.gms" +$Ifi "%phase%" == "preloop" $include "./modules/31_past/endo_jun13/preloop.gms" $Ifi "%phase%" == "presolve" $include "./modules/31_past/endo_jun13/presolve.gms" $Ifi "%phase%" == "postsolve" $include "./modules/31_past/endo_jun13/postsolve.gms" *######################## R SECTION END (PHASES) ############################### diff --git a/modules/31_past/grasslands_apr22/preloop.gms b/modules/31_past/grasslands_apr22/preloop.gms index 4b32591636..0f54f10b19 100644 --- a/modules/31_past/grasslands_apr22/preloop.gms +++ b/modules/31_past/grasslands_apr22/preloop.gms @@ -93,3 +93,12 @@ i31_grass_yields(t,j,"pastr") = i31_grass_yields(t,j,"pastr") * i31_grass_calib( *' Note that the calculation is split into two parts for better readability. *' @stop + +* Initialize biodiversity value +vm_bv.l(j,"manpast",potnatveg) = + pcm_land(j,"past") * fm_luh2_side_layers(j,"manpast") * fm_bii_coeff("manpast",potnatveg) * fm_luh2_side_layers(j,potnatveg); + +vm_bv.l(j,"rangeland",potnatveg) = + pcm_land(j,"past") * fm_luh2_side_layers(j,"rangeland") * fm_bii_coeff("rangeland",potnatveg) * fm_luh2_side_layers(j,potnatveg); + + diff --git a/modules/32_forestry/dynamic_may24/preloop.gms b/modules/32_forestry/dynamic_may24/preloop.gms index bcf1b96ed1..edccee7402 100644 --- a/modules/32_forestry/dynamic_may24/preloop.gms +++ b/modules/32_forestry/dynamic_may24/preloop.gms @@ -228,3 +228,16 @@ p32_land(t,j,type32,ac) = 0; * initialize forest disturbance losses p32_disturbance_loss_ftype32(t,j,"aff",ac) = 0; + +* Initialize biodiversity value +vm_bv.l(j,"aff_co2p",potnatveg) = + sum(bii_class_secd, sum(ac_to_bii_class_secd(ac,bii_class_secd), pc32_land(j,"aff",ac)) * + p32_bii_coeff("aff",bii_class_secd,potnatveg)) * fm_luh2_side_layers(j,potnatveg); + +vm_bv.l(j,"aff_ndc",potnatveg) = + sum(bii_class_secd, sum(ac_to_bii_class_secd(ac,bii_class_secd), pc32_land(j,"ndc",ac)) * + p32_bii_coeff("ndc",bii_class_secd,potnatveg)) * fm_luh2_side_layers(j,potnatveg); + +vm_bv.l(j,"plant",potnatveg) = + sum(bii_class_secd, sum(ac_to_bii_class_secd(ac,bii_class_secd), pc32_land(j,"plant",ac)) * + p32_bii_coeff("plant",bii_class_secd,potnatveg)) * fm_luh2_side_layers(j,potnatveg); diff --git a/modules/34_urban/exo_nov21/preloop.gms b/modules/34_urban/exo_nov21/preloop.gms index a313f1a29b..af2f0c4700 100644 --- a/modules/34_urban/exo_nov21/preloop.gms +++ b/modules/34_urban/exo_nov21/preloop.gms @@ -15,3 +15,7 @@ i34_urban_area(t_all, j) = f34_urbanland(t_all, j,"%c34_urban_scenario%"); ); pcm_land(j,"urban") = i34_urban_area("y1995",j); + +* Initialize biodiversity value +vm_bv.l(j2,"urban", potnatveg) = + pcm_land(j2,"urban") * fm_bii_coeff("urban",potnatveg) * fm_luh2_side_layers(j2,potnatveg); diff --git a/modules/34_urban/static/presolve.gms b/modules/34_urban/static/presolve.gms index 00ee7576bb..4a9eb9e4a5 100644 --- a/modules/34_urban/static/presolve.gms +++ b/modules/34_urban/static/presolve.gms @@ -8,7 +8,7 @@ vm_land.fx(j,"urban") = pcm_land(j,"urban"); vm_carbon_stock.fx(j,"urban",ag_pools,stockType) = 0; -*' Biodiveristy value (BV) +* Biodiveristy value (BV) vm_bv.fx(j,"urban", potnatveg) = pcm_land(j,"urban") * fm_bii_coeff("urban",potnatveg) * fm_luh2_side_layers(j,potnatveg); vm_cost_urban.fx(j) = 0; diff --git a/modules/35_natveg/pot_forest_may24/preloop.gms b/modules/35_natveg/pot_forest_may24/preloop.gms index bad3110864..178ff03bbd 100644 --- a/modules/35_natveg/pot_forest_may24/preloop.gms +++ b/modules/35_natveg/pot_forest_may24/preloop.gms @@ -85,3 +85,15 @@ m_sigmoid_time_interpol(p35_damage_fader,sm_fix_SSP2,s35_forest_damage_end,0,1); pc35_secdforest(j,ac) = i35_secdforest(j,ac); pc35_land_other(j,othertype35,ac) = i35_land_other(j,othertype35,ac); + +* Initialize biodiversity value +vm_bv.l(j,"primforest",potnatveg) = + pcm_land(j,"primforest") * fm_bii_coeff("primary",potnatveg) * fm_luh2_side_layers(j,potnatveg); + +vm_bv.l(j,"secdforest",potnatveg) = + sum(bii_class_secd, sum(ac_to_bii_class_secd(ac,bii_class_secd), i35_secdforest(j,ac)) * + fm_bii_coeff(bii_class_secd,potnatveg)) * fm_luh2_side_layers(j,potnatveg); + +vm_bv.l(j,"other",potnatveg) = + sum(bii_class_secd, sum(ac_to_bii_class_secd(ac,bii_class_secd), sum(othertype35, i35_land_other(j,othertype35,ac))) * + fm_bii_coeff(bii_class_secd,potnatveg)) * fm_luh2_side_layers(j,potnatveg); diff --git a/modules/44_biodiversity/bii_target/declarations.gms b/modules/44_biodiversity/bii_target/declarations.gms index c73b4a6f04..7f4552e059 100644 --- a/modules/44_biodiversity/bii_target/declarations.gms +++ b/modules/44_biodiversity/bii_target/declarations.gms @@ -7,22 +7,24 @@ positive variables - vm_cost_bv_loss(j) Biodiversity cost (mio USD17MER) - vm_bv(j,landcover44,potnatveg) Biodiversity stock for all land cover classes (Mha) - v44_bii(i,biome44) Biodiversity Intactness Index BII (1) - v44_bii_missing(i,biome44) Missing BII increase for compliance with BII target (1) + vm_cost_bv_loss(j) Biodiversity cost (mio USD17MER) + vm_bv(j,landcover44,potnatveg) Biodiversity stock for all land cover classes (Mha) + v44_bii(i,biome44) Biodiversity Intactness Index BII (1) + v44_bii_missing(i,biome44) Missing BII increase for compliance with BII target (1) ; parameters - p44_bii_lower_bound(t,i,biome44) Interpolated lower bound for BII over time (1) + p44_bii_lower_bound(t,i,biome44) Interpolated lower bound for BII over time (1) p44_start_value(i,biome44) Start value for BII lower bound (1) p44_target_value(i,biome44) Target value for BII lower bound (1) + i44_biome_share(j,biome44) Share of biome type in each spatial unit (1) + i44_biome_area_reg(i,biome44) Area of range-rarity weighted biome type in each region (mio. ha) ; equations - q44_bii(i,biome44) Biodiversity Intactness Index BII (1) - q44_bii_target(i,biome44) Missing BII increase for compliance with BII target (1) - q44_cost(i) Biodiversity cost (mio USD17MER) + q44_bii(i,biome44) Biodiversity Intactness Index BII (1) + q44_bii_target(i,biome44) Missing BII increase for compliance with BII target (1) + q44_cost(i) Biodiversity cost (mio USD17MER) ; diff --git a/modules/44_biodiversity/bii_target/equations.gms b/modules/44_biodiversity/bii_target/equations.gms index eb730f0a96..25bd174d97 100644 --- a/modules/44_biodiversity/bii_target/equations.gms +++ b/modules/44_biodiversity/bii_target/equations.gms @@ -10,15 +10,16 @@ *' The Biodiversity Intactness Index (BII) is calculated at the level of 71 biomes. *' The regional layer is needed for compatibility with the high resolution parallel optimization output script (scripts/output/extra/highres.R) - q44_bii(i2,biome44)$(sum(cell(i2,j2), f44_biome(j2,biome44)) > 1e-10) .. - v44_bii(i2,biome44) * sum((cell(i2,j2),land), pcm_land(j2,land) * f44_biome(j2,biome44)) + q44_bii(i2,biome44)$(i44_biome_area_reg(i2,biome44) > 0) .. + v44_bii(i2,biome44) =e= - sum((cell(i2,j2),potnatveg,landcover44), vm_bv(j2,landcover44,potnatveg) * f44_biome(j2,biome44)); + sum((cell(i2,j2),potnatveg,landcover44), vm_bv(j2,landcover44,potnatveg) * f44_biome(j2,biome44)) + / i44_biome_area_reg(i2,biome44); *' For each of the 71 biomes, the BII has to meet a minium level based on `s44_bii_lower_bound`. *' `v44_bii_missing` is a technical variable to maintain feasibility in case `v44_bii` cannot be increased. - q44_bii_target(i2,biome44)$(sum(cell(i2,j2), f44_biome(j2,biome44)) > 1e-10) .. + q44_bii_target(i2,biome44)$(i44_biome_area_reg(i2,biome44) > 0) .. v44_bii(i2,biome44) + v44_bii_missing(i2,biome44) =g= sum(ct, p44_bii_lower_bound(ct,i2,biome44)); *' Costs accrue only for `v44_bii_missing`. In the best case costs should be zero or close to zero. diff --git a/modules/44_biodiversity/bii_target/input.gms b/modules/44_biodiversity/bii_target/input.gms index 624e4e8799..65f4f864ee 100644 --- a/modules/44_biodiversity/bii_target/input.gms +++ b/modules/44_biodiversity/bii_target/input.gms @@ -6,11 +6,11 @@ *** | Contact: magpie@pik-potsdam.de scalars - s44_bii_lower_bound Lower bound for BII (1) / 0 / + s44_bii_lower_bound Lower bound for BII (1) / 0 / c44_bii_decrease Implementation of lower bound for BII (binary) / 1 / s44_target_year Year in which the BII lower bound is reached (1) / 2100 / s44_start_year Start year for interpolation towards BII lower bound (1) / 2025 / - s44_cost_bii_missing Technical costs for missing BII increase (USD17MER per unit of BII) / 1e+06 / + s44_cost_bii_missing Technical costs for missing BII increase (USD17MER per unit of BII) / 1e+06 / ; @@ -20,7 +20,7 @@ $include "./modules/44_biodiversity/bii_target/input/f44_bii_coeff.cs3" $offdelim ; -table f44_biome(j,biome44) Share of biome type in each spatial unit (1) +table f44_biome_area(j,biome44) Area of biome type in each spatial unit (mio. ha) $ondelim $include "./modules/44_biodiversity/bii_target/input/biorealm_biome.cs3" $offdelim diff --git a/modules/44_biodiversity/bii_target/preloop.gms b/modules/44_biodiversity/bii_target/preloop.gms index e14172dca5..50cbbaff35 100644 --- a/modules/44_biodiversity/bii_target/preloop.gms +++ b/modules/44_biodiversity/bii_target/preloop.gms @@ -5,10 +5,23 @@ *** | MAgPIE License Exception, version 1.0 (see LICENSE file). *** | Contact: magpie@pik-potsdam.de -v44_bii.l(i,biome44) = 0.75; +i44_biome_share(j,biome44) = 0; +i44_biome_share(j,biome44)$(sum(land, pcm_land(j,land)) > 0) = f44_biome_area(j,biome44) / sum(land, pcm_land(j,land)); -v44_bii.fx(i,biome44)$(sum(cell(i,j), f44_biome(j,biome44)) <= 1e-10) = 0; -v44_bii_missing.fx(i,biome44)$(sum(cell(i,j), f44_biome(j,biome44)) <= 1e-10) = 0; -p44_bii_lower_bound(t,i,biome44) = 0; +i44_biome_area_reg(i,biome44) = + sum((cell(i,j),land), pcm_land(j,land) * i44_biome_share(j,biome44)); + +loop(i, + loop(biome44, + if(i44_biome_area_reg(i,biome44) <= 0, + v44_bii.fx(i,biome44) = 0; + v44_bii_missing.fx(i,biome44) = 0; + else + v44_bii.l(i,biome44) = + sum((cell(i,j),potnatveg,landcover44), vm_bv.l(j,landcover44,potnatveg) * i44_biome_share(j,biome44)) + / i44_biome_area_reg(i,biome44); + ); + ); +); -vm_bv.l(j,landcover44,potnatveg) = 0; +p44_bii_lower_bound(t,i,biome44) = 0; diff --git a/modules/44_biodiversity/bii_target/presolve.gms b/modules/44_biodiversity/bii_target/presolve.gms index 88dc5aba91..ff874e5049 100644 --- a/modules/44_biodiversity/bii_target/presolve.gms +++ b/modules/44_biodiversity/bii_target/presolve.gms @@ -23,7 +23,7 @@ else ); p44_bii_lower_bound(t2,i,biome44)$(p44_bii_lower_bound(t2,i,biome44) >= 1) = 1; p44_bii_lower_bound(t2,i,biome44)$(m_year(t2) < s44_start_year) = 0; - p44_bii_lower_bound(t2,i,biome44)$(sum(cell(i,j), f44_biome(j,biome44)) <= 1e-10) = 0; + p44_bii_lower_bound(t2,i,biome44)$(i44_biome_area_reg(i,biome44) <= 0) = 0; * The lower bound of `v44_bii` is set to `p44_bii_lower_bound` to avoid a reduction of BII in combination with `v44_bii_missing`. v44_bii.lo(i,biome44) = p44_bii_lower_bound(t,i,biome44); display p44_bii_lower_bound; diff --git a/modules/44_biodiversity/bii_target_apr24/declarations.gms b/modules/44_biodiversity/bii_target_apr24/declarations.gms index 8beb0dabed..12eb55056c 100644 --- a/modules/44_biodiversity/bii_target_apr24/declarations.gms +++ b/modules/44_biodiversity/bii_target_apr24/declarations.gms @@ -7,22 +7,24 @@ positive variables - vm_cost_bv_loss(j) Biodiversity cost (mio USD17MER) - vm_bv(j,landcover44,potnatveg) Biodiversity stock for all land cover classes (Mha) - v44_bii(i,biome44) Biodiversity Intactness Index BII (1) + vm_cost_bv_loss(j) Biodiversity cost (mio USD17MER) + vm_bv(j,landcover44,potnatveg) Biodiversity stock for all land cover classes (Mha) + v44_bii(i,biome44) Biodiversity Intactness Index BII (1) v44_bii_missing(i,biome44) Missing BII increase for compliance with BII target (1) ; parameters - p44_bii_lower_bound(t,i,biome44) Interpolated lower bound for BII over time (1) + p44_bii_lower_bound(t,i,biome44) Interpolated lower bound for BII over time (1) p44_start_value(i,biome44) Start value for BII lower bound (1) p44_target_value(i,biome44) Target value for BII lower bound (1) + i44_biome_share(j,biome44) Share of biome type in each spatial unit (1) + i44_biome_area_reg(i,biome44) Area of range-rarity weighted biome type in each region (mio. ha) ; equations - q44_bii(i,biome44) Biodiversity Intactness Index BII (1) - q44_bii_target(i,biome44) Missing BII increase for compliance with BII target (1) - q44_cost(i) Biodiversity cost (mio USD17MER) + q44_bii(i,biome44) Biodiversity Intactness Index BII (1) + q44_bii_target(i,biome44) Missing BII increase for compliance with BII target (1) + q44_cost(i) Biodiversity cost (mio USD17MER) ; diff --git a/modules/44_biodiversity/bii_target_apr24/equations.gms b/modules/44_biodiversity/bii_target_apr24/equations.gms index e0584c0b98..19c78350ce 100644 --- a/modules/44_biodiversity/bii_target_apr24/equations.gms +++ b/modules/44_biodiversity/bii_target_apr24/equations.gms @@ -11,15 +11,16 @@ *' Biodiversity stock weighted by range-rarity restoration prioritization layer (`f44_rr_layer`) *' The regional layer is needed for compatibility with the high resolution parallel optimization output script (scripts/output/extra/highres.R) - q44_bii(i2,biome44)$(sum(cell(i2,j2), f44_biome(j2,biome44)*f44_rr_layer(j2)) > 1e-10) .. - v44_bii(i2,biome44) * sum((cell(i2,j2),land), pcm_land(j2,land) * f44_rr_layer(j2) * f44_biome(j2,biome44)) + q44_bii(i2,biome44)$(i44_biome_area_reg(i2,biome44) > 0) .. + v44_bii(i2,biome44) =e= - sum((cell(i2,j2),potnatveg,landcover44), vm_bv(j2,landcover44,potnatveg) * f44_rr_layer(j2) * f44_biome(j2,biome44)); + sum((cell(i2,j2),potnatveg,landcover44), vm_bv(j2,landcover44,potnatveg) * f44_rr_layer(j2) * i44_biome_share(j2,biome44)) + / i44_biome_area_reg(i2,biome44); *' For each of the 71 biomes, the BII has to meet a minium level based on `s44_bii_lower_bound`. *' `v44_bii_missing` is a technical variable to maintain feasibility in case `v44_bii` cannot be increased. - q44_bii_target(i2,biome44)$(sum(cell(i2,j2), f44_biome(j2,biome44)*f44_rr_layer(j2)) > 1e-10) .. + q44_bii_target(i2,biome44)$(i44_biome_area_reg(i2,biome44) > 0) .. v44_bii(i2,biome44) + v44_bii_missing(i2,biome44) =g= sum(ct, p44_bii_lower_bound(ct,i2,biome44)); *' Costs accrue only for `v44_bii_missing`. In the best case costs should be zero or close to zero. diff --git a/modules/44_biodiversity/bii_target_apr24/input.gms b/modules/44_biodiversity/bii_target_apr24/input.gms index b04e933504..042c3e03fb 100644 --- a/modules/44_biodiversity/bii_target_apr24/input.gms +++ b/modules/44_biodiversity/bii_target_apr24/input.gms @@ -6,11 +6,11 @@ *** | Contact: magpie@pik-potsdam.de scalars - s44_bii_lower_bound Lower bound for BII (1) / 0 / + s44_bii_lower_bound Lower bound for BII (1) / 0 / c44_bii_decrease Implementation of lower bound for BII (binary) / 1 / s44_target_year Year in which the BII lower bound is reached (1) / 2100 / s44_start_year Start year for interpolation towards BII lower bound (1) / 2025 / - s44_cost_bii_missing Technical costs for missing BII increase (USD17MER per unit of BII) / 1e+06 / + s44_cost_bii_missing Technical costs for missing BII increase (USD17MER per unit of BII) / 1e+06 / ; @@ -20,7 +20,7 @@ $include "./modules/44_biodiversity/bii_target_apr24/input/f44_bii_coeff.cs3" $offdelim ; -table f44_biome(j,biome44) Share of biome type in each spatial unit (1) +table f44_biome_area(j,biome44) Area of biome type in each spatial unit (mio. ha) $ondelim $include "./modules/44_biodiversity/bii_target_apr24/input/biorealm_biome.cs3" $offdelim diff --git a/modules/44_biodiversity/bii_target_apr24/preloop.gms b/modules/44_biodiversity/bii_target_apr24/preloop.gms index 717263d631..6460fa7b59 100644 --- a/modules/44_biodiversity/bii_target_apr24/preloop.gms +++ b/modules/44_biodiversity/bii_target_apr24/preloop.gms @@ -5,10 +5,23 @@ *** | MAgPIE License Exception, version 1.0 (see LICENSE file). *** | Contact: magpie@pik-potsdam.de -v44_bii.l(i,biome44) = 0.75; +i44_biome_share(j,biome44) = 0; +i44_biome_share(j,biome44)$(sum(land, pcm_land(j,land)) > 0) = f44_biome_area(j,biome44) / sum(land, pcm_land(j,land)); -v44_bii.fx(i,biome44)$(sum(cell(i,j), f44_biome(j,biome44)*f44_rr_layer(j)) <= 1e-10) = 0; -v44_bii_missing.fx(i,biome44)$(sum(cell(i,j), f44_biome(j,biome44)*f44_rr_layer(j)) <= 1e-10) = 0; -p44_bii_lower_bound(t,i,biome44) = 0; +i44_biome_area_reg(i,biome44) = + sum((cell(i,j),land), pcm_land(j,land) * f44_rr_layer(j) * i44_biome_share(j,biome44)); + +loop(i, + loop(biome44, + if(i44_biome_area_reg(i,biome44) <= 0, + v44_bii.fx(i,biome44) = 0; + v44_bii_missing.fx(i,biome44) = 0; + else + v44_bii.l(i,biome44) = + sum((cell(i,j),potnatveg,landcover44), vm_bv.l(j,landcover44,potnatveg) * f44_rr_layer(j) * i44_biome_share(j,biome44)) + / i44_biome_area_reg(i,biome44); + ); + ); +); -vm_bv.l(j,landcover44,potnatveg) = 0; +p44_bii_lower_bound(t,i,biome44) = 0; diff --git a/modules/44_biodiversity/bii_target_apr24/presolve.gms b/modules/44_biodiversity/bii_target_apr24/presolve.gms index 5a3ee7f43f..7b1b704cfb 100644 --- a/modules/44_biodiversity/bii_target_apr24/presolve.gms +++ b/modules/44_biodiversity/bii_target_apr24/presolve.gms @@ -23,8 +23,11 @@ else ); p44_bii_lower_bound(t2,i,biome44)$(p44_bii_lower_bound(t2,i,biome44) >= 1) = 1; p44_bii_lower_bound(t2,i,biome44)$(m_year(t2) < s44_start_year) = 0; - p44_bii_lower_bound(t2,i,biome44)$(sum(cell(i,j), f44_biome(j,biome44)*f44_rr_layer(j)) <= 1e-10) = 0; + p44_bii_lower_bound(t2,i,biome44)$(i44_biome_area_reg(i,biome44) <= 0) = 0; * The lower bound of `v44_bii` is set to `p44_bii_lower_bound` to avoid a reduction of BII in combination with `v44_bii_missing`. v44_bii.lo(i,biome44) = p44_bii_lower_bound(t,i,biome44); display p44_bii_lower_bound; ); + +i44_biome_area_reg(i,biome44) = + sum((cell(i,j),land), pcm_land(j,land) * f44_rr_layer(j) * i44_biome_share(j,biome44)); diff --git a/scripts/start/extra/recalibrateH16.R b/scripts/start/extra/recalibrateH16.R index f2d3fa5cd9..79c532c9f2 100644 --- a/scripts/start/extra/recalibrateH16.R +++ b/scripts/start/extra/recalibrateH16.R @@ -17,10 +17,10 @@ source("scripts/start_functions.R") #start MAgPIE run source("config/default.cfg") -cfg$input['regional'] <- "rev4.115_36f73207_magpie.tgz" -cfg$input['validation'] <- "rev4.115_36f73207_validation.tgz" +cfg$input['regional'] <- "rev4.116_36f73207_magpie.tgz" +cfg$input['validation'] <- "rev4.116_36f73207_validation.tgz" cfg$input['calibration'] <- "calibration_H16_27Sep24.tgz" -cfg$input['cellular'] <- "rev4.115_36f73207_44a213b6_cellularmagpie_c400_MRI-ESM2-0-ssp370_lpjml-8e6c5eb1_clusterweight-ba4466a8.tgz" +cfg$input['cellular'] <- "rev4.116_36f73207_44a213b6_cellularmagpie_c400_MRI-ESM2-0-ssp370_lpjml-8e6c5eb1_clusterweight-ba4466a8.tgz" cfg$results_folder <- "output/:title:" cfg$recalibrate <- FALSE diff --git a/scripts/start/projects/paper_peatlandTax.R b/scripts/start/projects/paper_peatlandTax.R index 43dccf6672..010b09b2cb 100644 --- a/scripts/start/projects/paper_peatlandTax.R +++ b/scripts/start/projects/paper_peatlandTax.R @@ -44,10 +44,10 @@ cfg$repositories <- append( getOption("magpie_repos") ) -cfg$input['regional'] <- "rev4.115_36f73207_magpie.tgz" -cfg$input['validation'] <- "rev4.115_36f73207_validation.tgz" +cfg$input['regional'] <- "rev4.116_36f73207_magpie.tgz" +cfg$input['validation'] <- "rev4.116_36f73207_validation.tgz" cfg$input['calibration'] <- "calibration_H16_27Sep24.tgz" -cfg$input['cellular'] <- "rev4.115_36f73207_44a213b6_cellularmagpie_c400_MRI-ESM2-0-ssp370_lpjml-8e6c5eb1_clusterweight-ba4466a8.tgz" +cfg$input['cellular'] <- "rev4.116_36f73207_44a213b6_cellularmagpie_c400_MRI-ESM2-0-ssp370_lpjml-8e6c5eb1_clusterweight-ba4466a8.tgz" download_and_update(cfg) ## Create patch file for GHG prices @@ -154,9 +154,9 @@ cfg$gms$s56_c_price_induced_aff <- 0 ## Start scenarios for (res in c("c400")) { if (res == "c400") - cfg$input['cellular'] <- "rev4.115_36f73207_44a213b6_cellularmagpie_c400_MRI-ESM2-0-ssp370_lpjml-8e6c5eb1_clusterweight-ba4466a8.tgz" + cfg$input['cellular'] <- "rev4.116_36f73207_44a213b6_cellularmagpie_c400_MRI-ESM2-0-ssp370_lpjml-8e6c5eb1_clusterweight-ba4466a8.tgz" else if (res == "c1000") { - cfg$input['cellular'] <- "rev4.115_36f73207_10f98ac1_cellularmagpie_c1000_MRI-ESM2-0-ssp370_lpjml-8e6c5eb1_clusterweight-ba4466a8.tgz" + cfg$input['cellular'] <- "rev4.116_36f73207_10f98ac1_cellularmagpie_c1000_MRI-ESM2-0-ssp370_lpjml-8e6c5eb1_clusterweight-ba4466a8.tgz" } ## Ref scenario cfg$title <- .title(cfg, paste(res, ssp, "Ref", sep = "-")) diff --git a/scripts/start/projects/project_ABCDR.R b/scripts/start/projects/project_ABCDR.R index a36e9c200a..1fb29b8b4a 100644 --- a/scripts/start/projects/project_ABCDR.R +++ b/scripts/start/projects/project_ABCDR.R @@ -19,7 +19,7 @@ source("config/default.cfg") #download_and_update(cfg) # create additional information to describe the runs -cfg$info$flag <- "ABCDR18" +cfg$info$flag <- "ABCDR19" cfg$results_folder <- "output/:title:" cfg$force_replace <- TRUE @@ -31,10 +31,10 @@ cfg$qos <- "standby_highMem_dayMax" .title <- function(cfg, ...) return(paste(cfg$info$flag, sep="_",...)) -cfg$input['regional'] <- "rev4.115_36f73207_magpie.tgz" -cfg$input['validation'] <- "rev4.115_36f73207_validation.tgz" +cfg$input['regional'] <- "rev4.116_36f73207_magpie.tgz" +cfg$input['validation'] <- "rev4.116_36f73207_validation.tgz" cfg$input['calibration'] <- "calibration_H16_27Sep24.tgz" -cfg$input['cellular'] <- "rev4.115_36f73207_44a213b6_cellularmagpie_c400_MRI-ESM2-0-ssp370_lpjml-8e6c5eb1_clusterweight-ba4466a8.tgz" +cfg$input['cellular'] <- "rev4.116_36f73207_44a213b6_cellularmagpie_c400_MRI-ESM2-0-ssp370_lpjml-8e6c5eb1_clusterweight-ba4466a8.tgz" ssp <- "SSP2" @@ -54,19 +54,19 @@ for (pol in c("NDC","1p5deg","1p5deg-Diet")) { cfg$title <- .title(cfg, paste(ssp,pol,ifelse(growth==0,"natveg","plant"),paste0("AFS_tree_",sub("\\.","p",as.character(shr*100))),sep="-")) if (pol == "NDC") { cfg <- setScenario(cfg,c(ssp,"NDC","rcp4p5")) - cfg$input['cellular'] <- "rev4.115_36f73207_30c9dc61_cellularmagpie_c400_MRI-ESM2-0-ssp245_lpjml-8e6c5eb1_clusterweight-ba4466a8.tgz" + cfg$input['cellular'] <- "rev4.116_36f73207_30c9dc61_cellularmagpie_c400_MRI-ESM2-0-ssp245_lpjml-8e6c5eb1_clusterweight-ba4466a8.tgz" cfg$gms$c56_mute_ghgprices_until <- "y2150" cfg$gms$c56_pollutant_prices <- paste0("R32M46-", if (ssp=="SSP2") "SSP2EU" else ssp,"-NDC") cfg$gms$c60_2ndgen_biodem <- paste0("R32M46-", if (ssp=="SSP2") "SSP2EU" else ssp,"-NDC") } else if (pol == "1p5deg") { cfg <- setScenario(cfg,c(ssp,"NDC","rcp1p9")) - cfg$input['cellular'] <- "rev4.115_36f73207_bc624950_cellularmagpie_c400_MRI-ESM2-0-ssp119_lpjml-8e6c5eb1_clusterweight-ba4466a8.tgz" + cfg$input['cellular'] <- "rev4.116_36f73207_bc624950_cellularmagpie_c400_MRI-ESM2-0-ssp119_lpjml-8e6c5eb1_clusterweight-ba4466a8.tgz" cfg$gms$c56_mute_ghgprices_until <- "y2030" cfg$gms$c56_pollutant_prices <- paste0("R32M46-", if (ssp=="SSP2") "SSP2EU" else ssp,"-PkBudg650") cfg$gms$c60_2ndgen_biodem <- paste0("R32M46-", if (ssp=="SSP2") "SSP2EU" else ssp,"-PkBudg650") } else if (pol == "1p5deg-Diet") { cfg <- setScenario(cfg,c(ssp,"NDC","rcp1p9","eat_lancet_diet_v1")) - cfg$input['cellular'] <- "rev4.115_36f73207_bc624950_cellularmagpie_c400_MRI-ESM2-0-ssp119_lpjml-8e6c5eb1_clusterweight-ba4466a8.tgz" + cfg$input['cellular'] <- "rev4.116_36f73207_bc624950_cellularmagpie_c400_MRI-ESM2-0-ssp119_lpjml-8e6c5eb1_clusterweight-ba4466a8.tgz" cfg$gms$c56_mute_ghgprices_until <- "y2030" cfg$gms$c56_pollutant_prices <- paste0("R32M46-", if (ssp=="SSP2") "SSP2EU" else ssp,"-PkBudg650") cfg$gms$c60_2ndgen_biodem <- paste0("R32M46-", if (ssp=="SSP2") "SSP2EU" else ssp,"-PkBudg650") diff --git a/scripts/start/projects/project_EAT2p0.R b/scripts/start/projects/project_EAT2p0.R index fdc7042f28..40763095df 100644 --- a/scripts/start/projects/project_EAT2p0.R +++ b/scripts/start/projects/project_EAT2p0.R @@ -90,7 +90,7 @@ bau <- function(cfg) { cfg$gms$c60_2ndgen_biodem <- "R21M42-SSP2-NPi" # default # Climate Change - cfg$input["cellular"] <- "rev4.115EL2_h12_c6a7458f_cellularmagpie_c200_IPSL-CM6A-LR-ssp370_lpjml-8e6c5eb1.tgz" + cfg$input["cellular"] <- "rev4.116EL2_h12_c6a7458f_cellularmagpie_c200_IPSL-CM6A-LR-ssp370_lpjml-8e6c5eb1.tgz" return(cfg) } From a3ff847ea2d4a1a6d4e9898af860668428549c4a Mon Sep 17 00:00:00 2001 From: florianh Date: Wed, 13 Nov 2024 02:55:52 +0100 Subject: [PATCH 147/206] fix --- config/default.cfg | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config/default.cfg b/config/default.cfg index 841a22f14b..913fabc11f 100644 --- a/config/default.cfg +++ b/config/default.cfg @@ -23,7 +23,7 @@ cfg$model <- "main.gms" #def = "main.gms" # which input data sets should be used? cfg$input <- c(regional = "rev4.116_h12_magpie.tgz", - cellular = "rev4.116_h12_2ca80312_cellularmagpie_c400_MRI-ESM2-0-ssp370_lpjml-8e6c5eb1.tgz", + cellular = "rev4.116_h12_fd712c0b_cellularmagpie_c200_MRI-ESM2-0-ssp370_lpjml-8e6c5eb1.tgz", validation = "rev4.116_h12_validation.tgz", additional = "additional_data_rev4.57.tgz", calibration = "calibration_H12_27Sep24.tgz") From 9e0c3bdd2296a1bc9f7c11662845e6558cc35d2f Mon Sep 17 00:00:00 2001 From: florianh Date: Wed, 13 Nov 2024 08:29:07 +0100 Subject: [PATCH 148/206] update --- DESCRIPTION | 2 +- main.gms | 8 ++++---- modules/44_biodiversity/bii_target/preloop.gms | 4 ++-- modules/44_biodiversity/bii_target/sets.gms | 2 ++ modules/44_biodiversity/bii_target_apr24/preloop.gms | 4 ++-- modules/44_biodiversity/bii_target_apr24/sets.gms | 2 ++ 6 files changed, 13 insertions(+), 9 deletions(-) diff --git a/DESCRIPTION b/DESCRIPTION index 103c305a10..ff585694d4 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -21,7 +21,7 @@ Imports: m4fsdp, madrat, magclass (>= 6.14.0), - magpie4 (>= 2.13.9), + magpie4 (>= 2.14.4), MagpieNCGains, magpiesets (>= 0.46.1), mip, diff --git a/main.gms b/main.gms index d359a4d999..3789d6775f 100644 --- a/main.gms +++ b/main.gms @@ -148,19 +148,19 @@ $title magpie *##################### R SECTION START (VERSION INFO) ########################## * -* Used data set: rev4.114_h12_magpie.tgz +* Used data set: rev4.116_h12_magpie.tgz * md5sum: NA * Repository: https://rse.pik-potsdam.de/data/magpie/public * -* Used data set: rev4.114_h12_fd712c0b_cellularmagpie_c200_MRI-ESM2-0-ssp370_lpjml-8e6c5eb1.tgz +* Used data set: rev4.116_h12_fd712c0b_cellularmagpie_c200_MRI-ESM2-0-ssp370_lpjml-8e6c5eb1.tgz * md5sum: NA * Repository: https://rse.pik-potsdam.de/data/magpie/public * -* Used data set: rev4.114_h12_validation.tgz +* Used data set: rev4.116_h12_validation.tgz * md5sum: NA * Repository: https://rse.pik-potsdam.de/data/magpie/public * -* Used data set: additional_data_rev4.56.tgz +* Used data set: additional_data_rev4.57.tgz * md5sum: NA * Repository: https://rse.pik-potsdam.de/data/magpie/public * diff --git a/modules/44_biodiversity/bii_target/preloop.gms b/modules/44_biodiversity/bii_target/preloop.gms index 50cbbaff35..635bac0f5e 100644 --- a/modules/44_biodiversity/bii_target/preloop.gms +++ b/modules/44_biodiversity/bii_target/preloop.gms @@ -5,8 +5,8 @@ *** | MAgPIE License Exception, version 1.0 (see LICENSE file). *** | Contact: magpie@pik-potsdam.de -i44_biome_share(j,biome44) = 0; -i44_biome_share(j,biome44)$(sum(land, pcm_land(j,land)) > 0) = f44_biome_area(j,biome44) / sum(land, pcm_land(j,land)); +i44_biome_share(j,biome44) = + (f44_biome_area(j,biome44) + 1e-10) / sum(biome44_2, f44_biome_area(j,biome44_2) + 1e-10); i44_biome_area_reg(i,biome44) = sum((cell(i,j),land), pcm_land(j,land) * i44_biome_share(j,biome44)); diff --git a/modules/44_biodiversity/bii_target/sets.gms b/modules/44_biodiversity/bii_target/sets.gms index fb93906e40..69751ecef9 100644 --- a/modules/44_biodiversity/bii_target/sets.gms +++ b/modules/44_biodiversity/bii_target/sets.gms @@ -30,3 +30,5 @@ sets OC1,OC2,OC7,NT3,NT4,NT7,NT8,NT10,NT12,NT13,NT14,PA11,PA12,PA13,NA5,PA1,PA4,PA5,PA6, PA8,PA9,PA10,AN99,AT98,NA2,NA6,NA7,NA12,NA99,PA98,PA99,AA12,AA13 / ; + +alias(biome44,biome44_2); diff --git a/modules/44_biodiversity/bii_target_apr24/preloop.gms b/modules/44_biodiversity/bii_target_apr24/preloop.gms index 6460fa7b59..91a91de3d9 100644 --- a/modules/44_biodiversity/bii_target_apr24/preloop.gms +++ b/modules/44_biodiversity/bii_target_apr24/preloop.gms @@ -5,8 +5,8 @@ *** | MAgPIE License Exception, version 1.0 (see LICENSE file). *** | Contact: magpie@pik-potsdam.de -i44_biome_share(j,biome44) = 0; -i44_biome_share(j,biome44)$(sum(land, pcm_land(j,land)) > 0) = f44_biome_area(j,biome44) / sum(land, pcm_land(j,land)); +i44_biome_share(j,biome44) = + (f44_biome_area(j,biome44) + 1e-10) / sum(biome44_2, f44_biome_area(j,biome44_2) + 1e-10); i44_biome_area_reg(i,biome44) = sum((cell(i,j),land), pcm_land(j,land) * f44_rr_layer(j) * i44_biome_share(j,biome44)); diff --git a/modules/44_biodiversity/bii_target_apr24/sets.gms b/modules/44_biodiversity/bii_target_apr24/sets.gms index c4e1566ef6..4e19d2313d 100644 --- a/modules/44_biodiversity/bii_target_apr24/sets.gms +++ b/modules/44_biodiversity/bii_target_apr24/sets.gms @@ -30,3 +30,5 @@ sets OC1,OC2,OC7,NT3,NT4,NT7,NT8,NT10,NT12,NT13,NT14,PA11,PA12,PA13,NA5,PA1,PA4,PA5,PA6, PA8,PA9,PA10,AN99,AT98,NA2,NA6,NA7,NA12,NA99,PA98,PA99,AA12,AA13 / ; + +alias(biome44,biome44_2); From 5eb966425d059f9b7cbfb8dfae8f642aa26521f3 Mon Sep 17 00:00:00 2001 From: florianh Date: Wed, 13 Nov 2024 09:53:12 +0100 Subject: [PATCH 149/206] bugfixes --- modules/29_cropland/detail_apr24/preloop.gms | 4 +++- modules/29_cropland/detail_apr24/presolve.gms | 8 ++++++++ modules/32_forestry/dynamic_may24/presolve.gms | 13 +++++++++++++ modules/35_natveg/pot_forest_may24/presolve.gms | 12 ++++++++++++ modules/44_biodiversity/bii_target/presolve.gms | 13 ++++++++----- .../44_biodiversity/bii_target_apr24/presolve.gms | 15 ++++++++------- 6 files changed, 52 insertions(+), 13 deletions(-) diff --git a/modules/29_cropland/detail_apr24/preloop.gms b/modules/29_cropland/detail_apr24/preloop.gms index 35e58c0244..d116470844 100644 --- a/modules/29_cropland/detail_apr24/preloop.gms +++ b/modules/29_cropland/detail_apr24/preloop.gms @@ -68,7 +68,9 @@ pm_avl_cropland_iso(iso) = f29_avl_cropland_iso(iso,"%c29_marginal_land%"); p29_country_weight(i) = sum(i_to_iso(i,iso), p29_country_dummy(iso) * pm_avl_cropland_iso(iso)) / sum(i_to_iso(i,iso), pm_avl_cropland_iso(iso)); * Initialize biodiversity value -vm_bv.l(j2,"crop_fallow",potnatveg) = 0; +vm_fallow.l(j) = 0; +vm_bv.l(j,"crop_fallow",potnatveg) = + vm_fallow.l(j) * fm_bii_coeff("crop_per",potnatveg) * fm_luh2_side_layers(j,potnatveg); vm_bv.l(j2,"crop_tree",potnatveg) = sum(bii_class_secd, sum(ac_to_bii_class_secd(ac,bii_class_secd), pc29_treecover(j2,ac)) * diff --git a/modules/29_cropland/detail_apr24/presolve.gms b/modules/29_cropland/detail_apr24/presolve.gms index 1b521039ff..99e6d3014d 100644 --- a/modules/29_cropland/detail_apr24/presolve.gms +++ b/modules/29_cropland/detail_apr24/presolve.gms @@ -109,3 +109,11 @@ else vm_fallow.lo(j) = 0; vm_fallow.up(j) = p29_avl_cropland(t,j); m_boundfix(vm_fallow,(j),l,1e-6); + +* Update biodiversity value +vm_bv.l(j,"crop_fallow",potnatveg) = + vm_fallow.l(j) * fm_bii_coeff("crop_per",potnatveg) * fm_luh2_side_layers(j,potnatveg); + +vm_bv.l(j,"crop_tree",potnatveg) = + sum(bii_class_secd, sum(ac_to_bii_class_secd(ac,bii_class_secd), pc29_treecover(j,ac)) * + p29_treecover_bii_coeff(bii_class_secd,potnatveg)) * fm_luh2_side_layers(j,potnatveg); diff --git a/modules/32_forestry/dynamic_may24/presolve.gms b/modules/32_forestry/dynamic_may24/presolve.gms index 97d717c3eb..000f614f94 100644 --- a/modules/32_forestry/dynamic_may24/presolve.gms +++ b/modules/32_forestry/dynamic_may24/presolve.gms @@ -183,4 +183,17 @@ pm_land_conservation(t,j,"secdforest","restore")$(pm_land_conservation(t,j,"secd = pm_land_conservation(t,j,"secdforest","restore") - (sum(ac, p32_land(t,j,"ndc",ac) + p32_land(t,j,"aff",ac) + v32_land.lo(j,"plant",ac)) + p32_aff_pol_timestep(t,j)); pm_land_conservation(t,j,"secdforest","restore")$(pm_land_conservation(t,j,"secdforest","restore") <= sum(ac, p32_land(t,j,"ndc",ac) + p32_land(t,j,"aff",ac) + v32_land.lo(j,"plant",ac)) + p32_aff_pol_timestep(t,j)) = 0; +* Update biodiversity value +vm_bv.l(j,"aff_co2p",potnatveg) = + sum(bii_class_secd, sum(ac_to_bii_class_secd(ac,bii_class_secd), pc32_land(j,"aff",ac)) * + p32_bii_coeff("aff",bii_class_secd,potnatveg)) * fm_luh2_side_layers(j,potnatveg); + +vm_bv.l(j,"aff_ndc",potnatveg) = + sum(bii_class_secd, sum(ac_to_bii_class_secd(ac,bii_class_secd), pc32_land(j,"ndc",ac)) * + p32_bii_coeff("ndc",bii_class_secd,potnatveg)) * fm_luh2_side_layers(j,potnatveg); + +vm_bv.l(j,"plant",potnatveg) = + sum(bii_class_secd, sum(ac_to_bii_class_secd(ac,bii_class_secd), pc32_land(j,"plant",ac)) * + p32_bii_coeff("plant",bii_class_secd,potnatveg)) * fm_luh2_side_layers(j,potnatveg); + *** EOF presolve.gms *** diff --git a/modules/35_natveg/pot_forest_may24/presolve.gms b/modules/35_natveg/pot_forest_may24/presolve.gms index d6e63de4a6..96daaca500 100644 --- a/modules/35_natveg/pot_forest_may24/presolve.gms +++ b/modules/35_natveg/pot_forest_may24/presolve.gms @@ -244,3 +244,15 @@ elseif s35_hvarea = 1, v35_hvarea_primforest.fx(j) = (vm_land.l(j,"primforest") - vm_land.lo(j,"primforest"))*s35_hvarea_primforest*m_timestep_length_forestry; v35_hvarea_other.fx(j,othertype35,ac_sub) = (vm_land_other.l(j,othertype35,ac_sub) - vm_land_other.lo(j,othertype35,ac_sub))*s35_hvarea_other*m_timestep_length_forestry; ); + +* Update biodiversity value +vm_bv.l(j,"primforest",potnatveg) = + pcm_land(j,"primforest") * fm_bii_coeff("primary",potnatveg) * fm_luh2_side_layers(j,potnatveg); + +vm_bv.l(j,"secdforest",potnatveg) = + sum(bii_class_secd, sum(ac_to_bii_class_secd(ac,bii_class_secd), pc35_secdforest(j,ac)) * + fm_bii_coeff(bii_class_secd,potnatveg)) * fm_luh2_side_layers(j,potnatveg); + +vm_bv.l(j,"other",potnatveg) = + sum(bii_class_secd, sum(ac_to_bii_class_secd(ac,bii_class_secd), sum(othertype35, pc35_land_other(j,othertype35,ac))) * + fm_bii_coeff(bii_class_secd,potnatveg)) * fm_luh2_side_layers(j,potnatveg); diff --git a/modules/44_biodiversity/bii_target/presolve.gms b/modules/44_biodiversity/bii_target/presolve.gms index ff874e5049..a205ff9d5d 100644 --- a/modules/44_biodiversity/bii_target/presolve.gms +++ b/modules/44_biodiversity/bii_target/presolve.gms @@ -5,6 +5,9 @@ *** | MAgPIE License Exception, version 1.0 (see LICENSE file). *** | Contact: magpie@pik-potsdam.de +i44_biome_area_reg(i,biome44) = + sum((cell(i,j),land), pcm_land(j,land) * f44_rr_layer(j) * i44_biome_share(j,biome44)); + * The start value for the linear interpolation is the BII at biome level in the start year. p44_start_value(i,biome44)$(m_year(t) = s44_start_year) = v44_bii.l(i,biome44); * The target value for the linear interpolation is the lower bound defined in `s44_bii_lower_bound`. @@ -17,13 +20,13 @@ else p44_bii_lower_bound(t2,i,biome44) = p44_start_value(i,biome44) + ((m_year(t2) - s44_start_year) / (s44_target_year - s44_start_year)) * (p44_target_value(i,biome44) - p44_start_value(i,biome44)); p44_bii_lower_bound(t2,i,biome44)$(m_year(t2) > s44_target_year) = p44_target_value(i,biome44); if(c44_bii_decrease = 0, - p44_bii_lower_bound(t2,i,biome44)$(v44_bii.l(i,biome44) >= p44_target_value(i,biome44)) = v44_bii.l(i,biome44); + p44_bii_lower_bound(t,i,biome44)$(v44_bii.l(i,biome44) >= p44_target_value(i,biome44)) = v44_bii.l(i,biome44); elseif c44_bii_decrease = 1, - p44_bii_lower_bound(t2,i,biome44)$(v44_bii.l(i,biome44) >= p44_target_value(i,biome44)) = p44_target_value(i,biome44); + p44_bii_lower_bound(t,i,biome44)$(v44_bii.l(i,biome44) >= p44_target_value(i,biome44)) = p44_target_value(i,biome44); ); - p44_bii_lower_bound(t2,i,biome44)$(p44_bii_lower_bound(t2,i,biome44) >= 1) = 1; - p44_bii_lower_bound(t2,i,biome44)$(m_year(t2) < s44_start_year) = 0; - p44_bii_lower_bound(t2,i,biome44)$(i44_biome_area_reg(i,biome44) <= 0) = 0; + p44_bii_lower_bound(t,i,biome44)$(p44_bii_lower_bound(t,i,biome44) >= 1) = 1; + p44_bii_lower_bound(t,i,biome44)$(m_year(t) < s44_start_year) = 0; + p44_bii_lower_bound(t,i,biome44)$(i44_biome_area_reg(i,biome44) <= 0) = 0; * The lower bound of `v44_bii` is set to `p44_bii_lower_bound` to avoid a reduction of BII in combination with `v44_bii_missing`. v44_bii.lo(i,biome44) = p44_bii_lower_bound(t,i,biome44); display p44_bii_lower_bound; diff --git a/modules/44_biodiversity/bii_target_apr24/presolve.gms b/modules/44_biodiversity/bii_target_apr24/presolve.gms index 7b1b704cfb..bfb5c8b842 100644 --- a/modules/44_biodiversity/bii_target_apr24/presolve.gms +++ b/modules/44_biodiversity/bii_target_apr24/presolve.gms @@ -5,6 +5,9 @@ *** | MAgPIE License Exception, version 1.0 (see LICENSE file). *** | Contact: magpie@pik-potsdam.de +i44_biome_area_reg(i,biome44) = + sum((cell(i,j),land), pcm_land(j,land) * f44_rr_layer(j) * i44_biome_share(j,biome44)); + * The start value for the linear interpolation is the BII at biome level in the start year. p44_start_value(i,biome44)$(m_year(t) = s44_start_year) = v44_bii.l(i,biome44); * The target value for the linear interpolation is the lower bound defined in `s44_bii_lower_bound`. @@ -17,17 +20,15 @@ else p44_bii_lower_bound(t2,i,biome44) = p44_start_value(i,biome44) + ((m_year(t2) - s44_start_year) / (s44_target_year - s44_start_year)) * (p44_target_value(i,biome44) - p44_start_value(i,biome44)); p44_bii_lower_bound(t2,i,biome44)$(m_year(t2) > s44_target_year) = p44_target_value(i,biome44); if(c44_bii_decrease = 0, - p44_bii_lower_bound(t2,i,biome44)$(v44_bii.l(i,biome44) >= p44_target_value(i,biome44)) = v44_bii.l(i,biome44); + p44_bii_lower_bound(t,i,biome44)$(v44_bii.l(i,biome44) >= p44_target_value(i,biome44)) = v44_bii.l(i,biome44); elseif c44_bii_decrease = 1, - p44_bii_lower_bound(t2,i,biome44)$(v44_bii.l(i,biome44) >= p44_target_value(i,biome44)) = p44_target_value(i,biome44); + p44_bii_lower_bound(t,i,biome44)$(v44_bii.l(i,biome44) >= p44_target_value(i,biome44)) = p44_target_value(i,biome44); ); - p44_bii_lower_bound(t2,i,biome44)$(p44_bii_lower_bound(t2,i,biome44) >= 1) = 1; - p44_bii_lower_bound(t2,i,biome44)$(m_year(t2) < s44_start_year) = 0; - p44_bii_lower_bound(t2,i,biome44)$(i44_biome_area_reg(i,biome44) <= 0) = 0; + p44_bii_lower_bound(t,i,biome44)$(p44_bii_lower_bound(t,i,biome44) >= 1) = 1; + p44_bii_lower_bound(t,i,biome44)$(m_year(t) < s44_start_year) = 0; + p44_bii_lower_bound(t,i,biome44)$(i44_biome_area_reg(i,biome44) <= 0) = 0; * The lower bound of `v44_bii` is set to `p44_bii_lower_bound` to avoid a reduction of BII in combination with `v44_bii_missing`. v44_bii.lo(i,biome44) = p44_bii_lower_bound(t,i,biome44); display p44_bii_lower_bound; ); -i44_biome_area_reg(i,biome44) = - sum((cell(i,j),land), pcm_land(j,land) * f44_rr_layer(j) * i44_biome_share(j,biome44)); From 6cc883ec1880f0381609553896c55fcd13ff6b4e Mon Sep 17 00:00:00 2001 From: florianh Date: Wed, 13 Nov 2024 09:59:48 +0100 Subject: [PATCH 150/206] bugfix --- modules/44_biodiversity/bii_target/preloop.gms | 3 +++ modules/44_biodiversity/bii_target/presolve.gms | 17 ++++++++++++++++- .../bii_target_apr24/preloop.gms | 3 +++ .../bii_target_apr24/presolve.gms | 15 +++++++++++++++ 4 files changed, 37 insertions(+), 1 deletion(-) diff --git a/modules/44_biodiversity/bii_target/preloop.gms b/modules/44_biodiversity/bii_target/preloop.gms index 635bac0f5e..d5c4d6d2af 100644 --- a/modules/44_biodiversity/bii_target/preloop.gms +++ b/modules/44_biodiversity/bii_target/preloop.gms @@ -5,12 +5,15 @@ *** | MAgPIE License Exception, version 1.0 (see LICENSE file). *** | Contact: magpie@pik-potsdam.de +* Calculate biome share i44_biome_share(j,biome44) = (f44_biome_area(j,biome44) + 1e-10) / sum(biome44_2, f44_biome_area(j,biome44_2) + 1e-10); +* Update i44_biome_area_reg i44_biome_area_reg(i,biome44) = sum((cell(i,j),land), pcm_land(j,land) * i44_biome_share(j,biome44)); +* Update v44_bii.l based on vm_bv.l loop(i, loop(biome44, if(i44_biome_area_reg(i,biome44) <= 0, diff --git a/modules/44_biodiversity/bii_target/presolve.gms b/modules/44_biodiversity/bii_target/presolve.gms index a205ff9d5d..7bcff03d01 100644 --- a/modules/44_biodiversity/bii_target/presolve.gms +++ b/modules/44_biodiversity/bii_target/presolve.gms @@ -5,8 +5,23 @@ *** | MAgPIE License Exception, version 1.0 (see LICENSE file). *** | Contact: magpie@pik-potsdam.de +* Update i44_biome_area_reg i44_biome_area_reg(i,biome44) = - sum((cell(i,j),land), pcm_land(j,land) * f44_rr_layer(j) * i44_biome_share(j,biome44)); + sum((cell(i,j),land), pcm_land(j,land) * i44_biome_share(j,biome44)); + +* Update v44_bii.l based on vm_bv.l +loop(i, + loop(biome44, + if(i44_biome_area_reg(i,biome44) <= 0, + v44_bii.fx(i,biome44) = 0; + v44_bii_missing.fx(i,biome44) = 0; + else + v44_bii.l(i,biome44) = + sum((cell(i,j),potnatveg,landcover44), vm_bv.l(j,landcover44,potnatveg) * i44_biome_share(j,biome44)) + / i44_biome_area_reg(i,biome44); + ); + ); +); * The start value for the linear interpolation is the BII at biome level in the start year. p44_start_value(i,biome44)$(m_year(t) = s44_start_year) = v44_bii.l(i,biome44); diff --git a/modules/44_biodiversity/bii_target_apr24/preloop.gms b/modules/44_biodiversity/bii_target_apr24/preloop.gms index 91a91de3d9..51d81f6e93 100644 --- a/modules/44_biodiversity/bii_target_apr24/preloop.gms +++ b/modules/44_biodiversity/bii_target_apr24/preloop.gms @@ -5,12 +5,15 @@ *** | MAgPIE License Exception, version 1.0 (see LICENSE file). *** | Contact: magpie@pik-potsdam.de +* Calculate biome share i44_biome_share(j,biome44) = (f44_biome_area(j,biome44) + 1e-10) / sum(biome44_2, f44_biome_area(j,biome44_2) + 1e-10); +* Update i44_biome_area_reg i44_biome_area_reg(i,biome44) = sum((cell(i,j),land), pcm_land(j,land) * f44_rr_layer(j) * i44_biome_share(j,biome44)); +* Update v44_bii.l based on vm_bv.l loop(i, loop(biome44, if(i44_biome_area_reg(i,biome44) <= 0, diff --git a/modules/44_biodiversity/bii_target_apr24/presolve.gms b/modules/44_biodiversity/bii_target_apr24/presolve.gms index bfb5c8b842..d6e419490e 100644 --- a/modules/44_biodiversity/bii_target_apr24/presolve.gms +++ b/modules/44_biodiversity/bii_target_apr24/presolve.gms @@ -5,9 +5,24 @@ *** | MAgPIE License Exception, version 1.0 (see LICENSE file). *** | Contact: magpie@pik-potsdam.de +* Update i44_biome_area_reg i44_biome_area_reg(i,biome44) = sum((cell(i,j),land), pcm_land(j,land) * f44_rr_layer(j) * i44_biome_share(j,biome44)); +* Update v44_bii.l based on vm_bv.l +loop(i, + loop(biome44, + if(i44_biome_area_reg(i,biome44) <= 0, + v44_bii.fx(i,biome44) = 0; + v44_bii_missing.fx(i,biome44) = 0; + else + v44_bii.l(i,biome44) = + sum((cell(i,j),potnatveg,landcover44), vm_bv.l(j,landcover44,potnatveg) * f44_rr_layer(j) * i44_biome_share(j,biome44)) + / i44_biome_area_reg(i,biome44); + ); + ); +); + * The start value for the linear interpolation is the BII at biome level in the start year. p44_start_value(i,biome44)$(m_year(t) = s44_start_year) = v44_bii.l(i,biome44); * The target value for the linear interpolation is the lower bound defined in `s44_bii_lower_bound`. From 172f8c3c411e070a85b058a97f82b1395c0c7cdd Mon Sep 17 00:00:00 2001 From: florianh Date: Wed, 13 Nov 2024 12:37:53 +0100 Subject: [PATCH 151/206] codeCheck update --- modules/31_past/endo_jun13/not_used.txt | 1 - modules/31_past/grasslands_apr22/not_used.txt | 1 - 2 files changed, 2 deletions(-) diff --git a/modules/31_past/endo_jun13/not_used.txt b/modules/31_past/endo_jun13/not_used.txt index 2b47ed0ec1..2c2efa6670 100644 --- a/modules/31_past/endo_jun13/not_used.txt +++ b/modules/31_past/endo_jun13/not_used.txt @@ -1,5 +1,4 @@ name,type,reason -pcm_land, input, not needed vm_tau,input,questionnaire fm_pastr_tau_hist,input,questionnaire sm_fix_cc, input, not needed diff --git a/modules/31_past/grasslands_apr22/not_used.txt b/modules/31_past/grasslands_apr22/not_used.txt index d1f943c5f1..85a13d5fd2 100644 --- a/modules/31_past/grasslands_apr22/not_used.txt +++ b/modules/31_past/grasslands_apr22/not_used.txt @@ -1,3 +1,2 @@ name,type,reason -pcm_land, input, not needed vm_yld,variable, not needed From 1f39058acd8f1397faa1997a1ba7f82966592a34 Mon Sep 17 00:00:00 2001 From: florianh Date: Wed, 13 Nov 2024 16:58:27 +0100 Subject: [PATCH 152/206] removed neg scaling factors --- modules/20_processing/substitution_may21/scaling.gms | 1 - modules/32_forestry/dynamic_may24/scaling.gms | 1 - modules/34_urban/exo_nov21/scaling.gms | 4 ++-- modules/58_peatland/v2/scaling.gms | 6 +++--- modules/73_timber/default/scaling.gms | 2 +- 5 files changed, 6 insertions(+), 8 deletions(-) diff --git a/modules/20_processing/substitution_may21/scaling.gms b/modules/20_processing/substitution_may21/scaling.gms index e6a6e99a3c..eeacde45a8 100644 --- a/modules/20_processing/substitution_may21/scaling.gms +++ b/modules/20_processing/substitution_may21/scaling.gms @@ -5,6 +5,5 @@ *** | MAgPIE License Exception, version 1.0 (see LICENSE file). *** | Contact: magpie@pik-potsdam.de -vm_secondary_overproduction.scale(i,kall,kpr) = 10e-4; vm_cost_processing.scale(i) = 10e5; vm_processing_substitution_cost.scale(i) = 10e4; diff --git a/modules/32_forestry/dynamic_may24/scaling.gms b/modules/32_forestry/dynamic_may24/scaling.gms index 029d892a2e..d6b52732fc 100644 --- a/modules/32_forestry/dynamic_may24/scaling.gms +++ b/modules/32_forestry/dynamic_may24/scaling.gms @@ -9,4 +9,3 @@ v32_cost_establishment.scale(i) = 10e4; v32_cost_recur.scale(i) = 10e4; vm_cost_fore.scale(i) = 10e5; v32_cost_hvarea.scale(i)$(s32_hvarea = 1 OR s32_hvarea = 2) = 10e4; -vm_cdr_aff.scale(j,ac,aff_effect) = 10e-4; diff --git a/modules/34_urban/exo_nov21/scaling.gms b/modules/34_urban/exo_nov21/scaling.gms index f66056dbbd..3b13d1a8d0 100644 --- a/modules/34_urban/exo_nov21/scaling.gms +++ b/modules/34_urban/exo_nov21/scaling.gms @@ -6,5 +6,5 @@ *** | Contact: magpie@pik-potsdam.de vm_cost_urban.scale(j) = 10e3; -v34_cost1.scale(j) = 10e-4; -v34_cost2.scale(j) = 10e-4; +*v34_cost1.scale(j) = 10e-4; +*v34_cost2.scale(j) = 10e-4; diff --git a/modules/58_peatland/v2/scaling.gms b/modules/58_peatland/v2/scaling.gms index ad96fe3e35..96c21058f5 100644 --- a/modules/58_peatland/v2/scaling.gms +++ b/modules/58_peatland/v2/scaling.gms @@ -5,6 +5,6 @@ *** | MAgPIE License Exception, version 1.0 (see LICENSE file). *** | Contact: magpie@pik-potsdam.de -v58_balance.scale(j,manPeat58) = 10e-5; -v58_balance2.scale(j,manPeat58) = 10e-5; -v58_peatlandChange.scale(j,land58) = 10e-3; +*v58_balance.scale(j,manPeat58) = 10e-5; +*v58_balance2.scale(j,manPeat58) = 10e-5; +*v58_peatlandChange.scale(j,land58) = 10e-3; diff --git a/modules/73_timber/default/scaling.gms b/modules/73_timber/default/scaling.gms index 4741722426..c2ef8c1365 100644 --- a/modules/73_timber/default/scaling.gms +++ b/modules/73_timber/default/scaling.gms @@ -6,4 +6,4 @@ *** | Contact: magpie@pik-potsdam.de vm_cost_timber.scale(i)$(s73_timber_demand_switch = 1) = 10e4; -v73_prod_heaven_timber.scale(j,kforestry) = 10e-3; +*v73_prod_heaven_timber.scale(j,kforestry) = 10e-3; From 3a4ddd870f0bb9f0283788fbd6852f9899b603dd Mon Sep 17 00:00:00 2001 From: florianh Date: Thu, 14 Nov 2024 08:42:12 +0100 Subject: [PATCH 153/206] clean-up scaling factors --- modules/58_peatland/v2/realization.gms | 1 - modules/58_peatland/v2/scaling.gms | 10 ---------- modules/73_timber/default/scaling.gms | 1 - 3 files changed, 12 deletions(-) delete mode 100644 modules/58_peatland/v2/scaling.gms diff --git a/modules/58_peatland/v2/realization.gms b/modules/58_peatland/v2/realization.gms index 8fef618fcf..f00746f3f5 100644 --- a/modules/58_peatland/v2/realization.gms +++ b/modules/58_peatland/v2/realization.gms @@ -36,7 +36,6 @@ $Ifi "%phase%" == "sets" $include "./modules/58_peatland/v2/sets.gms" $Ifi "%phase%" == "declarations" $include "./modules/58_peatland/v2/declarations.gms" $Ifi "%phase%" == "input" $include "./modules/58_peatland/v2/input.gms" $Ifi "%phase%" == "equations" $include "./modules/58_peatland/v2/equations.gms" -$Ifi "%phase%" == "scaling" $include "./modules/58_peatland/v2/scaling.gms" $Ifi "%phase%" == "preloop" $include "./modules/58_peatland/v2/preloop.gms" $Ifi "%phase%" == "presolve" $include "./modules/58_peatland/v2/presolve.gms" $Ifi "%phase%" == "postsolve" $include "./modules/58_peatland/v2/postsolve.gms" diff --git a/modules/58_peatland/v2/scaling.gms b/modules/58_peatland/v2/scaling.gms deleted file mode 100644 index 96c21058f5..0000000000 --- a/modules/58_peatland/v2/scaling.gms +++ /dev/null @@ -1,10 +0,0 @@ -*** | (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 - -*v58_balance.scale(j,manPeat58) = 10e-5; -*v58_balance2.scale(j,manPeat58) = 10e-5; -*v58_peatlandChange.scale(j,land58) = 10e-3; diff --git a/modules/73_timber/default/scaling.gms b/modules/73_timber/default/scaling.gms index c2ef8c1365..1c85838a24 100644 --- a/modules/73_timber/default/scaling.gms +++ b/modules/73_timber/default/scaling.gms @@ -6,4 +6,3 @@ *** | Contact: magpie@pik-potsdam.de vm_cost_timber.scale(i)$(s73_timber_demand_switch = 1) = 10e4; -*v73_prod_heaven_timber.scale(j,kforestry) = 10e-3; From 849c9a0a339b19e5c75358da71bf9e9ba81f68ae Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Florian=20Humpen=C3=B6der?= Date: Thu, 14 Nov 2024 09:32:06 +0100 Subject: [PATCH 154/206] Update CHANGELOG.md Co-authored-by: pvjeetze <50408549+pvjeetze@users.noreply.github.com> --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index ec9ca6fd61..6aea51d87a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -21,7 +21,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). ### added - **62_material** added switch to turn off future material demand for bioplastic - **config** added SSP1-POP-GDP SSP2-POP-GDP and SSP5-POP-GDP -- **modules[29-35]** added initial vales for ov_bv for better starting point +- **modules[29-35]** added initial values for ov_bv for better starting point ### removed - From 6069d0718fd68e5d915f9af261afc83c49daad40 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Florian=20Humpen=C3=B6der?= Date: Thu, 14 Nov 2024 09:35:11 +0100 Subject: [PATCH 155/206] Update modules/44_biodiversity/bii_target/equations.gms Co-authored-by: pvjeetze <50408549+pvjeetze@users.noreply.github.com> --- modules/44_biodiversity/bii_target/equations.gms | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/44_biodiversity/bii_target/equations.gms b/modules/44_biodiversity/bii_target/equations.gms index 25bd174d97..d372e2a7c3 100644 --- a/modules/44_biodiversity/bii_target/equations.gms +++ b/modules/44_biodiversity/bii_target/equations.gms @@ -13,7 +13,7 @@ q44_bii(i2,biome44)$(i44_biome_area_reg(i2,biome44) > 0) .. v44_bii(i2,biome44) =e= - sum((cell(i2,j2),potnatveg,landcover44), vm_bv(j2,landcover44,potnatveg) * f44_biome(j2,biome44)) + sum((cell(i2,j2),potnatveg,landcover44), vm_bv(j2,landcover44,potnatveg) * i44_biome_share(j2,biome44)) / i44_biome_area_reg(i2,biome44); *' For each of the 71 biomes, the BII has to meet a minium level based on `s44_bii_lower_bound`. From 9d89010e897bd79c51ce31854ef177c9f017a885 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Florian=20Humpen=C3=B6der?= Date: Thu, 14 Nov 2024 09:36:20 +0100 Subject: [PATCH 156/206] Update modules/44_biodiversity/bii_target/preloop.gms Co-authored-by: pvjeetze <50408549+pvjeetze@users.noreply.github.com> --- modules/44_biodiversity/bii_target/preloop.gms | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/44_biodiversity/bii_target/preloop.gms b/modules/44_biodiversity/bii_target/preloop.gms index d5c4d6d2af..d14b89afd6 100644 --- a/modules/44_biodiversity/bii_target/preloop.gms +++ b/modules/44_biodiversity/bii_target/preloop.gms @@ -9,7 +9,7 @@ i44_biome_share(j,biome44) = (f44_biome_area(j,biome44) + 1e-10) / sum(biome44_2, f44_biome_area(j,biome44_2) + 1e-10); -* Update i44_biome_area_reg +* Set i44_biome_area_reg i44_biome_area_reg(i,biome44) = sum((cell(i,j),land), pcm_land(j,land) * i44_biome_share(j,biome44)); From ad9bc11b029456e44e4fb4d28748d5d179491580 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Florian=20Humpen=C3=B6der?= Date: Thu, 14 Nov 2024 09:36:40 +0100 Subject: [PATCH 157/206] Update modules/44_biodiversity/bii_target_apr24/preloop.gms Co-authored-by: pvjeetze <50408549+pvjeetze@users.noreply.github.com> --- modules/44_biodiversity/bii_target_apr24/preloop.gms | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/44_biodiversity/bii_target_apr24/preloop.gms b/modules/44_biodiversity/bii_target_apr24/preloop.gms index 51d81f6e93..98b09690fa 100644 --- a/modules/44_biodiversity/bii_target_apr24/preloop.gms +++ b/modules/44_biodiversity/bii_target_apr24/preloop.gms @@ -9,7 +9,7 @@ i44_biome_share(j,biome44) = (f44_biome_area(j,biome44) + 1e-10) / sum(biome44_2, f44_biome_area(j,biome44_2) + 1e-10); -* Update i44_biome_area_reg +* Set i44_biome_area_reg i44_biome_area_reg(i,biome44) = sum((cell(i,j),land), pcm_land(j,land) * f44_rr_layer(j) * i44_biome_share(j,biome44)); From 01af64c63e87d85d93f2db19fb908ef60766a143 Mon Sep 17 00:00:00 2001 From: florianh Date: Thu, 14 Nov 2024 09:39:38 +0100 Subject: [PATCH 158/206] remove i44_biome_area_reg from presolve --- modules/44_biodiversity/bii_target/presolve.gms | 4 ---- modules/44_biodiversity/bii_target_apr24/presolve.gms | 4 ---- 2 files changed, 8 deletions(-) diff --git a/modules/44_biodiversity/bii_target/presolve.gms b/modules/44_biodiversity/bii_target/presolve.gms index 7bcff03d01..edca9fc629 100644 --- a/modules/44_biodiversity/bii_target/presolve.gms +++ b/modules/44_biodiversity/bii_target/presolve.gms @@ -5,10 +5,6 @@ *** | MAgPIE License Exception, version 1.0 (see LICENSE file). *** | Contact: magpie@pik-potsdam.de -* Update i44_biome_area_reg -i44_biome_area_reg(i,biome44) = - sum((cell(i,j),land), pcm_land(j,land) * i44_biome_share(j,biome44)); - * Update v44_bii.l based on vm_bv.l loop(i, loop(biome44, diff --git a/modules/44_biodiversity/bii_target_apr24/presolve.gms b/modules/44_biodiversity/bii_target_apr24/presolve.gms index d6e419490e..f9cd49db45 100644 --- a/modules/44_biodiversity/bii_target_apr24/presolve.gms +++ b/modules/44_biodiversity/bii_target_apr24/presolve.gms @@ -5,10 +5,6 @@ *** | MAgPIE License Exception, version 1.0 (see LICENSE file). *** | Contact: magpie@pik-potsdam.de -* Update i44_biome_area_reg -i44_biome_area_reg(i,biome44) = - sum((cell(i,j),land), pcm_land(j,land) * f44_rr_layer(j) * i44_biome_share(j,biome44)); - * Update v44_bii.l based on vm_bv.l loop(i, loop(biome44, From 3888668febbb29f4e20d04d85e192dc238047e98 Mon Sep 17 00:00:00 2001 From: florianh Date: Thu, 14 Nov 2024 09:57:24 +0100 Subject: [PATCH 159/206] removed duplicate code --- modules/44_biodiversity/bii_target/preloop.gms | 14 -------------- .../44_biodiversity/bii_target_apr24/preloop.gms | 14 -------------- 2 files changed, 28 deletions(-) diff --git a/modules/44_biodiversity/bii_target/preloop.gms b/modules/44_biodiversity/bii_target/preloop.gms index d14b89afd6..962ffcaea1 100644 --- a/modules/44_biodiversity/bii_target/preloop.gms +++ b/modules/44_biodiversity/bii_target/preloop.gms @@ -13,18 +13,4 @@ i44_biome_share(j,biome44) = i44_biome_area_reg(i,biome44) = sum((cell(i,j),land), pcm_land(j,land) * i44_biome_share(j,biome44)); -* Update v44_bii.l based on vm_bv.l -loop(i, - loop(biome44, - if(i44_biome_area_reg(i,biome44) <= 0, - v44_bii.fx(i,biome44) = 0; - v44_bii_missing.fx(i,biome44) = 0; - else - v44_bii.l(i,biome44) = - sum((cell(i,j),potnatveg,landcover44), vm_bv.l(j,landcover44,potnatveg) * i44_biome_share(j,biome44)) - / i44_biome_area_reg(i,biome44); - ); - ); -); - p44_bii_lower_bound(t,i,biome44) = 0; diff --git a/modules/44_biodiversity/bii_target_apr24/preloop.gms b/modules/44_biodiversity/bii_target_apr24/preloop.gms index 98b09690fa..f296466db2 100644 --- a/modules/44_biodiversity/bii_target_apr24/preloop.gms +++ b/modules/44_biodiversity/bii_target_apr24/preloop.gms @@ -13,18 +13,4 @@ i44_biome_share(j,biome44) = i44_biome_area_reg(i,biome44) = sum((cell(i,j),land), pcm_land(j,land) * f44_rr_layer(j) * i44_biome_share(j,biome44)); -* Update v44_bii.l based on vm_bv.l -loop(i, - loop(biome44, - if(i44_biome_area_reg(i,biome44) <= 0, - v44_bii.fx(i,biome44) = 0; - v44_bii_missing.fx(i,biome44) = 0; - else - v44_bii.l(i,biome44) = - sum((cell(i,j),potnatveg,landcover44), vm_bv.l(j,landcover44,potnatveg) * f44_rr_layer(j) * i44_biome_share(j,biome44)) - / i44_biome_area_reg(i,biome44); - ); - ); -); - p44_bii_lower_bound(t,i,biome44) = 0; From 664273514694ea18bae1163c3f8dc7714d37a782 Mon Sep 17 00:00:00 2001 From: florianh Date: Thu, 14 Nov 2024 20:45:10 +0100 Subject: [PATCH 160/206] update start script --- scripts/start/projects/paper_peatlandTax.R | 71 ++++++++++------------ scripts/start/projects/project_ABCDR.R | 12 ++-- 2 files changed, 38 insertions(+), 45 deletions(-) diff --git a/scripts/start/projects/paper_peatlandTax.R b/scripts/start/projects/paper_peatlandTax.R index 010b09b2cb..ed4526b597 100644 --- a/scripts/start/projects/paper_peatlandTax.R +++ b/scripts/start/projects/paper_peatlandTax.R @@ -23,14 +23,14 @@ source("scripts/start_functions.R") source("config/default.cfg") # create additional information to describe the runs -cfg$info$flag <- "PTax36" +cfg$info$flag <- "PTax42" cfg$results_folder <- "output/:title:" cfg$results_folder_highres <- "output" -cfg$output <- c(cfg$output, "extra/highres") +#cfg$output <- c(cfg$output, "extra/highres") cfg$force_replace <- TRUE cfg$force_download <- FALSE -cfg$qos <- "standby_highMem_dayMax" +cfg$qos <- "standby_dayMax" # support function to create standardized title .title <- function(cfg, ...) @@ -44,10 +44,10 @@ cfg$repositories <- append( getOption("magpie_repos") ) -cfg$input['regional'] <- "rev4.116_36f73207_magpie.tgz" -cfg$input['validation'] <- "rev4.116_36f73207_validation.tgz" -cfg$input['calibration'] <- "calibration_H16_27Sep24.tgz" -cfg$input['cellular'] <- "rev4.116_36f73207_44a213b6_cellularmagpie_c400_MRI-ESM2-0-ssp370_lpjml-8e6c5eb1_clusterweight-ba4466a8.tgz" +cfg$input['regional'] <- "rev4.116_5d9a2237_magpie.tgz" +cfg$input['validation'] <- "rev4.116_5d9a2237_validation.tgz" +cfg$input['calibration'] <- "calibration_H15_27Sep24.tgz" +cfg$input['cellular'] <- "rev4.116_36f73207_bd86374e_cellularmagpie_c200_MRI-ESM2-0-ssp370_lpjml-8e6c5eb1_clusterweight-ba4466a8.tgz" download_and_update(cfg) ## Create patch file for GHG prices @@ -55,7 +55,7 @@ calc_ghgprice <- function() { T0 <- read.magpie("modules/56_ghg_policy/input/f56_pollutant_prices.cs3") T0 <- collapseNames(T0[, , getNames(T0, dim = 2)[1]]) T0[, , ] <- 0 - + #T200 200 USD/tCO2 in 2050 T200 <- new.magpie(getRegions(T0), c(seq(1995, 2025, by = 5), 2050, 2100, 2150), getNames(T0), fill = 0) T200[, "y2025", "co2_c"] <- 0 @@ -68,13 +68,13 @@ calc_ghgprice <- function() { T200[, , "n2o_n_direct"] <- T200[, , "co2_c"] * 265 * 44 / 28 T200[, , "n2o_n_indirect"] <- T200[, , "co2_c"] * 265 * 44 / 28 T200[, , "co2_c"] <- T200[, , "co2_c"] * 44 / 12 - + T25 <- T200 * 0.125 T50 <- T200 * 0.25 T100 <- T200 * 0.5 T400 <- T200 * 2 T800 <- T200 * 4 - + GHG <- mbind( add_dimension(T0, dim = 3.2, add = "scen", nm = "T0-GHG"), add_dimension( @@ -114,16 +114,16 @@ calc_ghgprice <- function() { nm = "T800-GHG" ) ) - + CO2 <- GHG CO2[, , c("ch4", "n2o_n_direct", "n2o_n_indirect")] <- 0 getNames(CO2, dim = 2) <- gsub("GHG", "CO2", getNames(CO2, dim = 2)) - + GHGCH4GWP20 <- GHG GHGCH4GWP20[, , "ch4"] <- GHGCH4GWP20[, , "ch4"] / 28 * 84 getNames(GHGCH4GWP20, dim = 2) <- gsub("GHG", "GHG-GWP20", getNames(GHGCH4GWP20, dim = 2)) - + GHG <- mbind(CO2, GHG, GHGCH4GWP20) if (!dir.exists("./patch_inputdata")) dir.create("./patch_inputdata") @@ -133,7 +133,7 @@ calc_ghgprice <- function() { write.magpie(GHG, file_name = "patch_inputdata/patchGHGprices/f56_pollutant_prices.cs3") tardir("patch_inputdata/patchGHGprices", "patch_inputdata/patchGHGprices.tgz") - + unlink("patch_inputdata/patchGHGprices", recursive = TRUE) return(getNames(GHG, dim = 2)) } @@ -152,30 +152,23 @@ cfg$gms$livestock <- "fbask_jan16_sticky" cfg$gms$s56_c_price_induced_aff <- 0 ## Start scenarios -for (res in c("c400")) { - if (res == "c400") - cfg$input['cellular'] <- "rev4.116_36f73207_44a213b6_cellularmagpie_c400_MRI-ESM2-0-ssp370_lpjml-8e6c5eb1_clusterweight-ba4466a8.tgz" - else if (res == "c1000") { - cfg$input['cellular'] <- "rev4.116_36f73207_10f98ac1_cellularmagpie_c1000_MRI-ESM2-0-ssp370_lpjml-8e6c5eb1_clusterweight-ba4466a8.tgz" - } - ## Ref scenario - cfg$title <- .title(cfg, paste(res, ssp, "Ref", sep = "-")) - cfg$gms$c56_mute_ghgprices_until <- "y2150" - cfg$gms$c56_pollutant_prices <- "T0-CO2" +## Ref scenario +cfg$title <- .title(cfg, paste(ssp, "Ref", sep = "-")) +cfg$gms$c56_mute_ghgprices_until <- "y2150" +cfg$gms$c56_pollutant_prices <- "T0-CO2" +start_run(cfg, codeCheck = FALSE) + +## GHG policy scenarios +for (tax in c("T25-CO2", + "T50-CO2", + "T100-CO2", + "T200-CO2", + "T400-CO2", + "T400-GHG", + "T400-GHG-GWP20")) { + cfg$title <- .title(cfg, paste(ssp, tax, sep = "-")) + cfg$gms$c56_mute_ghgprices_until <- "y2025" + cfg$gms$s58_cost_drain_intact_onetime <- 10000 + cfg$gms$c56_pollutant_prices <- tax start_run(cfg, codeCheck = FALSE) - - ## Policy scenarios - for (tax in c("T25-CO2", - "T50-CO2", - "T100-CO2", - "T200-CO2", - "T400-CO2", - "T400-GHG", - "T400-GHG-GWP20")) { - cfg$title <- .title(cfg, paste(res, ssp, tax, sep = "-")) - cfg$gms$c56_mute_ghgprices_until <- "y2025" - cfg$gms$s58_cost_drain_intact_onetime <- 10000 - cfg$gms$c56_pollutant_prices <- tax - start_run(cfg, codeCheck = FALSE) - } } diff --git a/scripts/start/projects/project_ABCDR.R b/scripts/start/projects/project_ABCDR.R index 1fb29b8b4a..c37eb41942 100644 --- a/scripts/start/projects/project_ABCDR.R +++ b/scripts/start/projects/project_ABCDR.R @@ -19,13 +19,13 @@ source("config/default.cfg") #download_and_update(cfg) # create additional information to describe the runs -cfg$info$flag <- "ABCDR19" +cfg$info$flag <- "ABCDR20" cfg$results_folder <- "output/:title:" cfg$force_replace <- TRUE cfg$force_download <- FALSE -cfg$qos <- "standby_highMem_dayMax" +cfg$qos <- "standby_dayMax" # support function to create standardized title .title <- function(cfg, ...) return(paste(cfg$info$flag, sep="_",...)) @@ -34,7 +34,7 @@ cfg$qos <- "standby_highMem_dayMax" cfg$input['regional'] <- "rev4.116_36f73207_magpie.tgz" cfg$input['validation'] <- "rev4.116_36f73207_validation.tgz" cfg$input['calibration'] <- "calibration_H16_27Sep24.tgz" -cfg$input['cellular'] <- "rev4.116_36f73207_44a213b6_cellularmagpie_c400_MRI-ESM2-0-ssp370_lpjml-8e6c5eb1_clusterweight-ba4466a8.tgz" +cfg$input['cellular'] <- "rev4.116_36f73207_bd86374e_cellularmagpie_c200_MRI-ESM2-0-ssp370_lpjml-8e6c5eb1_clusterweight-ba4466a8.tgz" ssp <- "SSP2" @@ -54,19 +54,19 @@ for (pol in c("NDC","1p5deg","1p5deg-Diet")) { cfg$title <- .title(cfg, paste(ssp,pol,ifelse(growth==0,"natveg","plant"),paste0("AFS_tree_",sub("\\.","p",as.character(shr*100))),sep="-")) if (pol == "NDC") { cfg <- setScenario(cfg,c(ssp,"NDC","rcp4p5")) - cfg$input['cellular'] <- "rev4.116_36f73207_30c9dc61_cellularmagpie_c400_MRI-ESM2-0-ssp245_lpjml-8e6c5eb1_clusterweight-ba4466a8.tgz" + cfg$input['cellular'] <- "rev4.116_36f73207_582d657c_cellularmagpie_c200_MRI-ESM2-0-ssp245_lpjml-8e6c5eb1_clusterweight-ba4466a8.tgz" cfg$gms$c56_mute_ghgprices_until <- "y2150" cfg$gms$c56_pollutant_prices <- paste0("R32M46-", if (ssp=="SSP2") "SSP2EU" else ssp,"-NDC") cfg$gms$c60_2ndgen_biodem <- paste0("R32M46-", if (ssp=="SSP2") "SSP2EU" else ssp,"-NDC") } else if (pol == "1p5deg") { cfg <- setScenario(cfg,c(ssp,"NDC","rcp1p9")) - cfg$input['cellular'] <- "rev4.116_36f73207_bc624950_cellularmagpie_c400_MRI-ESM2-0-ssp119_lpjml-8e6c5eb1_clusterweight-ba4466a8.tgz" + cfg$input['cellular'] <- "rev4.116_36f73207_ab632bd4_cellularmagpie_c200_MRI-ESM2-0-ssp119_lpjml-8e6c5eb1_clusterweight-ba4466a8.tgz" cfg$gms$c56_mute_ghgprices_until <- "y2030" cfg$gms$c56_pollutant_prices <- paste0("R32M46-", if (ssp=="SSP2") "SSP2EU" else ssp,"-PkBudg650") cfg$gms$c60_2ndgen_biodem <- paste0("R32M46-", if (ssp=="SSP2") "SSP2EU" else ssp,"-PkBudg650") } else if (pol == "1p5deg-Diet") { cfg <- setScenario(cfg,c(ssp,"NDC","rcp1p9","eat_lancet_diet_v1")) - cfg$input['cellular'] <- "rev4.116_36f73207_bc624950_cellularmagpie_c400_MRI-ESM2-0-ssp119_lpjml-8e6c5eb1_clusterweight-ba4466a8.tgz" + cfg$input['cellular'] <- "rev4.116_36f73207_ab632bd4_cellularmagpie_c200_MRI-ESM2-0-ssp119_lpjml-8e6c5eb1_clusterweight-ba4466a8.tgz" cfg$gms$c56_mute_ghgprices_until <- "y2030" cfg$gms$c56_pollutant_prices <- paste0("R32M46-", if (ssp=="SSP2") "SSP2EU" else ssp,"-PkBudg650") cfg$gms$c60_2ndgen_biodem <- paste0("R32M46-", if (ssp=="SSP2") "SSP2EU" else ssp,"-PkBudg650") From 3bb99fc8e53cb099373f31178fca7bb476bd4e90 Mon Sep 17 00:00:00 2001 From: florianh Date: Thu, 14 Nov 2024 20:46:15 +0100 Subject: [PATCH 161/206] magpie4 lib --- DESCRIPTION | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/DESCRIPTION b/DESCRIPTION index ff585694d4..a86101ab14 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -21,7 +21,7 @@ Imports: m4fsdp, madrat, magclass (>= 6.14.0), - magpie4 (>= 2.14.4), + magpie4 (>= 2.15.1), MagpieNCGains, magpiesets (>= 0.46.1), mip, From 1946d58bc17be10debea8a0581528779b8cedcd1 Mon Sep 17 00:00:00 2001 From: florianh Date: Mon, 18 Nov 2024 21:51:01 +0100 Subject: [PATCH 162/206] bugfix c60_bioenergy_subsidy --- CHANGELOG.md | 2 ++ config/default.cfg | 6 +++--- config/projects/scenario_config_fsec.csv | 2 +- main.gms | 2 +- modules/60_bioenergy/1st2ndgen_priced_feb24/input.gms | 4 ++-- modules/60_bioenergy/1stgen_priced_dec18/input.gms | 2 +- 6 files changed, 10 insertions(+), 8 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 6aea51d87a..78ccb20ec0 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -17,6 +17,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). - **core** number of age-classes doubled from 150 to 300 years for better match of growth curves with potential natural vegetation. - **35_natveg** revised age-class initialization of secondary forest - **modules** update of scaling factors in several modules +- **config** default for `c60_bioenergy_subsidy` changed from 369 to 246 USD17MER per ton ### added - **62_material** added switch to turn off future material demand for bioplastic @@ -34,6 +35,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). - **70_livestock** bugfix scaling.gms file in wrong folder - **10_land** Simplified land transition matrix for improved feasibility - **44_biodiversity** bugfix biorealm_biome.cs3 in input data (shares did not add-up to 1) +- **config** additional data increased to `additional_data_rev4.58.tgz` which fixes missing gdp2017 conversions in f20_processing_unitcosts ## [4.8.2] - 2024-09-24 diff --git a/config/default.cfg b/config/default.cfg index 913fabc11f..03d8f373e4 100644 --- a/config/default.cfg +++ b/config/default.cfg @@ -25,7 +25,7 @@ cfg$model <- "main.gms" #def = "main.gms" cfg$input <- c(regional = "rev4.116_h12_magpie.tgz", cellular = "rev4.116_h12_fd712c0b_cellularmagpie_c200_MRI-ESM2-0-ssp370_lpjml-8e6c5eb1.tgz", validation = "rev4.116_h12_validation.tgz", - additional = "additional_data_rev4.57.tgz", + additional = "additional_data_rev4.58.tgz", calibration = "calibration_H12_27Sep24.tgz") # NOTE: It is recommended to recalibrate the model when changing cellular input data @@ -1902,8 +1902,8 @@ cfg$gms$s60_2ndgen_bioenergy_dem_min <- 1 # def = 1 # * c60_bioenergy_subsidy is applied constant to model horizon (after sm_fix_SSP2) # * If GJ-based prices are used (setting below), c60_bioenergy_subsidy should be set to 0. # * (inflated from default originally in USD05 using USD05 --> USD17 inflation rate:1.23) -cfg$gms$c60_bioenergy_subsidy <- 369 # def = 300 * 1.23 -cfg$gms$c60_bioenergy_subsidy_fix_SSP2 <- 369 # def = 300 * 1.23 +cfg$gms$c60_bioenergy_subsidy <- 246 # def = 200 * 1.23 +cfg$gms$c60_bioenergy_subsidy_fix_SSP2 <- 246 # def = 200 * 1.23 # ** Options for realization `1st2ndgen_priced_feb24` diff --git a/config/projects/scenario_config_fsec.csv b/config/projects/scenario_config_fsec.csv index dda4e130b0..8c1adb8a5f 100644 --- a/config/projects/scenario_config_fsec.csv +++ b/config/projects/scenario_config_fsec.csv @@ -79,6 +79,6 @@ gms$c73_build_demand;;;;;;;;;;;;;;;;;;;;;;;;50pc;;;;;;;;;;;;;;;;;;;;;;;;;;; input['cellular'];rev4.116_FSEC_3c888fa5_cellularmagpie_c200_MRI-ESM2-0-ssp460_lpjml-8e6c5eb1.tgz;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;rev4.116_FSEC_0bd54110_cellularmagpie_c200_MRI-ESM2-0-ssp119_lpjml-8e6c5eb1.tgz;rev4.116_FSEC_6819938d_cellularmagpie_c200_MRI-ESM2-0-ssp126_lpjml-8e6c5eb1.tgz;;rev4.116_FSEC_1b5c3817_cellularmagpie_c200_MRI-ESM2-0-ssp245_lpjml-8e6c5eb1.tgz;rev4.116_FSEC_3c888fa5_cellularmagpie_c200_MRI-ESM2-0-ssp460_lpjml-8e6c5eb1.tgz;rev4.116_FSEC_fd712c0b_cellularmagpie_c200_MRI-ESM2-0-ssp370_lpjml-8e6c5eb1.tgz;rev4.116_FSEC_09a63995_cellularmagpie_c200_MRI-ESM2-0-ssp585_lpjml-8e6c5eb1.tgz;;; input['regional'];rev4.116_FSEC_magpie.tgz;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; input['validation'];rev4.116_FSEC_validation.tgz;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -input['additional'];additional_data_rev4.57.tgz;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +input['additional'];additional_data_rev4.58.tgz;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; input['calibration'];calibration_FSEC_27Sep24.tgz;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; magicc_emis_scen;bjoernAR6_C_SSP2-NDC.mif;;;bjoernAR6_C_SSP2-PkBudg900.mif;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;bjoernAR6_C_SSP1-NDC.mif;;;;;;;;;;;;bjoernAR6_C_RemSDP-900-MagSSP1.mif;; diff --git a/main.gms b/main.gms index 3789d6775f..3a47f34650 100644 --- a/main.gms +++ b/main.gms @@ -160,7 +160,7 @@ $title magpie * md5sum: NA * Repository: https://rse.pik-potsdam.de/data/magpie/public * -* Used data set: additional_data_rev4.57.tgz +* Used data set: additional_data_rev4.58.tgz * md5sum: NA * Repository: https://rse.pik-potsdam.de/data/magpie/public * diff --git a/modules/60_bioenergy/1st2ndgen_priced_feb24/input.gms b/modules/60_bioenergy/1st2ndgen_priced_feb24/input.gms index d368538417..2167baa9df 100644 --- a/modules/60_bioenergy/1st2ndgen_priced_feb24/input.gms +++ b/modules/60_bioenergy/1st2ndgen_priced_feb24/input.gms @@ -35,8 +35,8 @@ sets scalars c60_biodem_level bioenergy demand level indicator 1 for regional and 0 for global demand (1) / 1 / - c60_bioenergy_subsidy_fix_SSP2 first generation bioenergy subsidy during fix_SSP period (USD17MER per ton) / 369 / - c60_bioenergy_subsidy first generation bioenergy subsidy (USD17MER per ton) / 369 / + c60_bioenergy_subsidy_fix_SSP2 first generation bioenergy subsidy during fix_SSP period (USD17MER per ton) / 246 / + c60_bioenergy_subsidy first generation bioenergy subsidy (USD17MER per ton) / 246 / s60_bioenergy_gj_price_1st first generation bioenergy per-GJ price (USD17MER per GJ) / 0 / s60_bioenergy_price_2nd second generation bioenergy price (USD17MER per GJ) / 0 / s60_2ndgen_bioenergy_dem_min Minimum dedicated 2nd generation bioenergy demand assumed in each region during SSP2-fix (mio. GJ per yr) / 1 / diff --git a/modules/60_bioenergy/1stgen_priced_dec18/input.gms b/modules/60_bioenergy/1stgen_priced_dec18/input.gms index 3ce1668a2c..be9ccb858d 100644 --- a/modules/60_bioenergy/1stgen_priced_dec18/input.gms +++ b/modules/60_bioenergy/1stgen_priced_dec18/input.gms @@ -35,7 +35,7 @@ sets scalars c60_biodem_level bioenergy demand level indicator 1 for regional and 0 for global demand (1) / 1 / - c60_bioenergy_subsidy first generation bioenergy subsidy (USD17MER per ton) / 369 / + c60_bioenergy_subsidy first generation bioenergy subsidy (USD17MER per ton) / 246 / s60_2ndgen_bioenergy_dem_min Minimum dedicated 2nd generation bioenergy demand assumed in each region (mio. GJ per yr) / 1 / ; From ae7b978ee85e8696a1c1e0915760ba5e0b52ab24 Mon Sep 17 00:00:00 2001 From: florianh Date: Tue, 19 Nov 2024 08:48:24 +0100 Subject: [PATCH 163/206] update R libs --- DESCRIPTION | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/DESCRIPTION b/DESCRIPTION index a86101ab14..2b0d18e38b 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -21,14 +21,14 @@ Imports: m4fsdp, madrat, magclass (>= 6.14.0), - magpie4 (>= 2.15.1), + magpie4 (>= 2.15.6), MagpieNCGains, magpiesets (>= 0.46.1), mip, mrcommons, patchwork, piamenv (>= 0.5.5), - piamInterfaces (>= 0.36.1), + piamInterfaces (>= 0.36.9), piamutils, quitte, raster, From 541a4d0ac92dd832b0ee79012668d5daa3d80276 Mon Sep 17 00:00:00 2001 From: florianh Date: Tue, 19 Nov 2024 08:52:48 +0100 Subject: [PATCH 164/206] doc config --- config/default.cfg | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/config/default.cfg b/config/default.cfg index 03d8f373e4..d1f08835ab 100644 --- a/config/default.cfg +++ b/config/default.cfg @@ -1897,6 +1897,10 @@ cfg$gms$c60_biodem_level <- 1 # def = 1 cfg$gms$s60_2ndgen_bioenergy_dem_min <- 1 # def = 1 # * t DM-based first generation bioenergy subsidy (USD17MER per ton) +# * The subsidy can simulate a perfectly elastic demand for bioenergy from the energy sector and should be used as a +# * default floor price that avoids the wastage of ethanal or oils in case that the demand for byproducts +# * (oilcake and brewers grains) exceeds the demand for these secondary products. As such, it also avoids unrealistic +# * price fluctuations connected to the inelastic demand for couple products. # * (1stgen_priced_dec18): c60_bioenergy_subsidy is applied constant over historic and model horizon, c60_bioenergy_subsidy_fix_SSP2 has no effect # * (1st2ndgen_priced_feb24): c60_bioenergy_subsidy_fix_SSP2 is applied constant to historic time steps (up until sm_fix_SSP2). # * c60_bioenergy_subsidy is applied constant to model horizon (after sm_fix_SSP2) From 453fec9ebe895dfb577b4685f5a728687539ce17 Mon Sep 17 00:00:00 2001 From: florianh Date: Tue, 19 Nov 2024 09:07:36 +0100 Subject: [PATCH 165/206] change subsidy to 200 --- config/default.cfg | 5 ++--- modules/60_bioenergy/1st2ndgen_priced_feb24/input.gms | 4 ++-- modules/60_bioenergy/1stgen_priced_dec18/input.gms | 2 +- 3 files changed, 5 insertions(+), 6 deletions(-) diff --git a/config/default.cfg b/config/default.cfg index d1f08835ab..30bbbc1049 100644 --- a/config/default.cfg +++ b/config/default.cfg @@ -1905,9 +1905,8 @@ cfg$gms$s60_2ndgen_bioenergy_dem_min <- 1 # def = 1 # * (1st2ndgen_priced_feb24): c60_bioenergy_subsidy_fix_SSP2 is applied constant to historic time steps (up until sm_fix_SSP2). # * c60_bioenergy_subsidy is applied constant to model horizon (after sm_fix_SSP2) # * If GJ-based prices are used (setting below), c60_bioenergy_subsidy should be set to 0. -# * (inflated from default originally in USD05 using USD05 --> USD17 inflation rate:1.23) -cfg$gms$c60_bioenergy_subsidy <- 246 # def = 200 * 1.23 -cfg$gms$c60_bioenergy_subsidy_fix_SSP2 <- 246 # def = 200 * 1.23 +cfg$gms$c60_bioenergy_subsidy <- 200 # def = 200 +cfg$gms$c60_bioenergy_subsidy_fix_SSP2 <- 200 # def = 200 # ** Options for realization `1st2ndgen_priced_feb24` diff --git a/modules/60_bioenergy/1st2ndgen_priced_feb24/input.gms b/modules/60_bioenergy/1st2ndgen_priced_feb24/input.gms index 2167baa9df..1031a3082a 100644 --- a/modules/60_bioenergy/1st2ndgen_priced_feb24/input.gms +++ b/modules/60_bioenergy/1st2ndgen_priced_feb24/input.gms @@ -35,8 +35,8 @@ sets scalars c60_biodem_level bioenergy demand level indicator 1 for regional and 0 for global demand (1) / 1 / - c60_bioenergy_subsidy_fix_SSP2 first generation bioenergy subsidy during fix_SSP period (USD17MER per ton) / 246 / - c60_bioenergy_subsidy first generation bioenergy subsidy (USD17MER per ton) / 246 / + c60_bioenergy_subsidy_fix_SSP2 first generation bioenergy subsidy during fix_SSP period (USD17MER per ton) / 200 / + c60_bioenergy_subsidy first generation bioenergy subsidy (USD17MER per ton) / 200 / s60_bioenergy_gj_price_1st first generation bioenergy per-GJ price (USD17MER per GJ) / 0 / s60_bioenergy_price_2nd second generation bioenergy price (USD17MER per GJ) / 0 / s60_2ndgen_bioenergy_dem_min Minimum dedicated 2nd generation bioenergy demand assumed in each region during SSP2-fix (mio. GJ per yr) / 1 / diff --git a/modules/60_bioenergy/1stgen_priced_dec18/input.gms b/modules/60_bioenergy/1stgen_priced_dec18/input.gms index be9ccb858d..1183f3d38b 100644 --- a/modules/60_bioenergy/1stgen_priced_dec18/input.gms +++ b/modules/60_bioenergy/1stgen_priced_dec18/input.gms @@ -35,7 +35,7 @@ sets scalars c60_biodem_level bioenergy demand level indicator 1 for regional and 0 for global demand (1) / 1 / - c60_bioenergy_subsidy first generation bioenergy subsidy (USD17MER per ton) / 246 / + c60_bioenergy_subsidy first generation bioenergy subsidy (USD17MER per ton) / 200 / s60_2ndgen_bioenergy_dem_min Minimum dedicated 2nd generation bioenergy demand assumed in each region (mio. GJ per yr) / 1 / ; From c8af317d1de2bd2c6c5e66bc902c823af4c7c4f6 Mon Sep 17 00:00:00 2001 From: florianh Date: Tue, 19 Nov 2024 10:01:58 +0100 Subject: [PATCH 166/206] update --- modules/58_peatland/v2/declarations.gms | 8 ++++---- modules/58_peatland/v2/equations.gms | 11 +++++++---- modules/58_peatland/v2/input.gms | 22 +++++++++++++--------- modules/58_peatland/v2/preloop.gms | 3 +-- 4 files changed, 25 insertions(+), 19 deletions(-) diff --git a/modules/58_peatland/v2/declarations.gms b/modules/58_peatland/v2/declarations.gms index d9bb34cfcd..cb3ef96d1b 100644 --- a/modules/58_peatland/v2/declarations.gms +++ b/modules/58_peatland/v2/declarations.gms @@ -18,8 +18,8 @@ parameters i58_cost_drain_rewet_onetime(t) One-time costs for drainage of rewetted peatland (USD17MER per ha) p58_availPeatlandExp(t,j) Available area for expansion of drained peatland (mio. ha) p58_availLandExp(t,j) Available area for expansion of managed land (mio. ha) - i58_peatland_rewetting_fader Fader (1) - p58_peatland_ref(j,land58) ref (mio. ha) + i58_peatland_rewetting_fader Temporal fader for exogenous peatland rewetting (1) + p58_peatland_ref(j,land58) Peatland area in reference period (mio. ha) ; equations @@ -30,11 +30,11 @@ equations q58_manLandRed(j,manPeat58) Managed land area reduction (mio. ha) q58_peatlandMan(j,manPeat58) Change of managed peatland area (mio. ha) q58_peatlandMan2(j,manPeat58) Contraint for managed peatland area (mio. ha) + q58_rewetting_exo(j,manPeat58) Constraint for exogenous peatland rewetting (mio. ha) q58_peatland_cost(j) One-time and recurring cost of peatland conversion and management (mio. USD17MER per yr) q58_peatland_cost_annuity(j,cost58) Annuity costs for peatland conversion in the current timestep (mio. USD17MER per yr) q58_peatland_emis_detail(j,land58,emis58) Detailed GHG emissions from peatlands (Tg per yr) - q58_peatland_emis(i,poll58) GHG emissions from managed peatland (Tg per yr) - q58_rewetting_exo(j,manPeat58) blub (mio. ha) + q58_peatland_emis(i,poll58) GHG emissions from managed peatland (Tg per yr) ; variables diff --git a/modules/58_peatland/v2/equations.gms b/modules/58_peatland/v2/equations.gms index 2c6c1851af..92c9aa7936 100644 --- a/modules/58_peatland/v2/equations.gms +++ b/modules/58_peatland/v2/equations.gms @@ -49,15 +49,18 @@ + v58_manLandExp(j2,manPeat58) * sum(ct, p58_scalingFactorExp(ct,j2)) - v58_balance(j2,manPeat58) - v58_manLandRed(j2,manPeat58) * sum(ct, p58_scalingFactorRed(ct,j2,manPeat58)) + v58_balance2(j2,manPeat58); - q58_rewetting_exo(j2,manPeat58)$(sum(ct, m_year(ct)) > s58_fix_peatland) .. - v58_peatland(j2,"rewetted") =g= - sum(drained58, p58_peatland_ref(j2,drained58)) * sum(ct, i58_peatland_rewetting_fader(ct)) * s58_rewetting_exo; - *' Drained peatland used for agriculture and forestry cannot exceed corresponding managed land. q58_peatlandMan2(j2,manPeat58)$(sum(ct, m_year(ct)) > s58_fix_peatland) .. v58_peatland(j2,manPeat58) =l= v58_manLand(j2,manPeat58); +*' Constraint for optional exogenous peatland rewetting + + q58_rewetting_exo(j2,manPeat58)$(sum(ct, m_year(ct)) > s58_fix_peatland) .. + v58_peatland(j2,"rewetted") =g= + sum(drained58, p58_peatland_ref(j2,drained58)) * sum(ct, i58_peatland_rewetting_fader(ct)) * s58_rewetting_exo; + + *' Costs for peatland degradation and rewetting q58_peatland_cost(j2) .. diff --git a/modules/58_peatland/v2/input.gms b/modules/58_peatland/v2/input.gms index f9dc6c6694..e0b2dbb356 100644 --- a/modules/58_peatland/v2/input.gms +++ b/modules/58_peatland/v2/input.gms @@ -6,15 +6,19 @@ *** | Contact: magpie@pik-potsdam.de scalars - s58_cost_rewet_recur Recurring costs for rewetted peatland (USD17MER per ha) / 37 / - s58_cost_rewet_onetime One-time costs for peatland rewetting (USD17MER per ha) / 1230 / - s58_cost_drain_recur Recurring costs for drained and managed peatlands (USD17MER per ha) / 0 / - s58_cost_drain_intact_onetime One-time costs for drainage of intact peatland (USD17MER per ha) / 0 / - s58_cost_drain_rewet_onetime One-time costs for drainage of rewetted peatland (USD17MER per ha) / 0 / - s58_rewetting_switch Peatland rewetting on (Inf) or off (0) / Inf / - s58_fix_peatland Year indicating until when peatland area should be fixed (year) / 2020 / - s58_balance_penalty Penalty for technical peatland balance term (USD17MER) / 1e+06 / - s58_rewetting_exo share / 0 / + s58_cost_rewet_recur Recurring costs for rewetted peatland (USD17MER per ha) / 37 / + s58_cost_rewet_onetime One-time costs for peatland rewetting (USD17MER per ha) / 1230 / + s58_cost_drain_recur Recurring costs for drained and managed peatlands (USD17MER per ha) / 0 / + s58_cost_drain_intact_onetime One-time costs for drainage of intact peatland (USD17MER per ha) / 0 / + s58_cost_drain_rewet_onetime One-time costs for drainage of rewetted peatland (USD17MER per ha) / 0 / + s58_rewetting_switch Peatland rewetting on (Inf) or off (0) / Inf / + s58_fix_peatland Year indicating until when peatland area should be fixed (year) / 2020 / + s58_balance_penalty Penalty for technical peatland balance term (USD17MER) / 1e+06 / + s58_rewetting_exo Switch for exogenous peatland rewetting (1) / 0 / + s58_rewet_exo_start_year Start year for exogenous peatland rewetting / 2030 / + s58_rewet_exo_target_year Target year for exogenous peatland rewetting / 2050 / + s58_rewet_exo_start_value Start value for exogenous peatland rewetting as share of drained peatland in reference period (1) / 0.3 / + s58_rewet_exo_target_value Target value for exogenous peatland rewetting as share of drained peatland in reference period (1) / 0.5 / ; *Peatland area based on Global Peatland Map 2.0 and Global Peatland Database diff --git a/modules/58_peatland/v2/preloop.gms b/modules/58_peatland/v2/preloop.gms index 44f569e9ee..2c713d4e35 100644 --- a/modules/58_peatland/v2/preloop.gms +++ b/modules/58_peatland/v2/preloop.gms @@ -5,8 +5,7 @@ *** | MAgPIE License Exception, version 1.0 (see LICENSE file). *** | Contact: magpie@pik-potsdam.de -m_linear_time_interpol(i58_peatland_rewetting_fader,2030,2050,0.3,0.5); - +m_linear_time_interpol(i58_peatland_rewetting_fader,s58_rewet_exo_start_year,s58_rewet_exo_target_year,s58_rewet_exo_start_value,s58_rewet_exo_target_value); vm_emissions_reg.fx(i,"peatland",pollutants) = 0; vm_emissions_reg.lo(i,"peatland",poll58) = -Inf; From c177383d9c547c3f0ac4e1c05d7fe9967c73f73a Mon Sep 17 00:00:00 2001 From: Pascal Sauer <156898545+pascal-sauer@users.noreply.github.com> Date: Tue, 19 Nov 2024 15:50:56 +0100 Subject: [PATCH 167/206] mrdowscale scripts --- CHANGELOG.md | 2 ++ DESCRIPTION | 2 +- scripts/output/extra/mrdownscale.R | 13 +++++++++++++ ...aggregation_mrdownscale.R => mrdownscale_LUH2.R} | 0 4 files changed, 16 insertions(+), 1 deletion(-) create mode 100644 scripts/output/extra/mrdownscale.R rename scripts/output/extra/{disaggregation_mrdownscale.R => mrdownscale_LUH2.R} (100%) diff --git a/CHANGELOG.md b/CHANGELOG.md index 6aea51d87a..229169c2f3 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -17,6 +17,8 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). - **core** number of age-classes doubled from 150 to 300 years for better match of growth curves with potential natural vegetation. - **35_natveg** revised age-class initialization of secondary forest - **modules** update of scaling factors in several modules +- **scripts** add mrdownscale script (0.5deg downscaling using LandUseInit as reference) +- **scripts** renamed disaggregation_mrdownscale.R -> mrdownscale_LUH2.R ### added - **62_material** added switch to turn off future material demand for bioplastic diff --git a/DESCRIPTION b/DESCRIPTION index a86101ab14..2699a14fda 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -40,7 +40,7 @@ Imports: Suggests: goxygen, languageserver, - mrdownscale (>= 0.23.0), + mrdownscale (>= 0.28.0), qgraph, shinyresults, XML diff --git a/scripts/output/extra/mrdownscale.R b/scripts/output/extra/mrdownscale.R new file mode 100644 index 0000000000..83b3295233 --- /dev/null +++ b/scripts/output/extra/mrdownscale.R @@ -0,0 +1,13 @@ +# | (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: Downscale MAgPIE results to 0.5 degree resolution using landuseinit as reference data +# comparison script: FALSE +# ------------------------------------------------------------------------------------------------ +library(mrdownscale) +downscaleRun(outputdir, "DOWNSCALEDMAGPIE") diff --git a/scripts/output/extra/disaggregation_mrdownscale.R b/scripts/output/extra/mrdownscale_LUH2.R similarity index 100% rename from scripts/output/extra/disaggregation_mrdownscale.R rename to scripts/output/extra/mrdownscale_LUH2.R From cc57e1461bbdbb52bdbbea1d6060a879dc3bacdc Mon Sep 17 00:00:00 2001 From: Pascal Sauer <156898545+pascal-sauer@users.noreply.github.com> Date: Tue, 19 Nov 2024 15:59:16 +0100 Subject: [PATCH 168/206] move to added --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 229169c2f3..f7ed8f2edc 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -17,13 +17,13 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). - **core** number of age-classes doubled from 150 to 300 years for better match of growth curves with potential natural vegetation. - **35_natveg** revised age-class initialization of secondary forest - **modules** update of scaling factors in several modules -- **scripts** add mrdownscale script (0.5deg downscaling using LandUseInit as reference) - **scripts** renamed disaggregation_mrdownscale.R -> mrdownscale_LUH2.R ### added - **62_material** added switch to turn off future material demand for bioplastic - **config** added SSP1-POP-GDP SSP2-POP-GDP and SSP5-POP-GDP - **modules[29-35]** added initial values for ov_bv for better starting point +- **scripts** add mrdownscale script (0.5deg downscaling using LandUseInit as reference) ### removed - From 3e65e6b465639309ca4204942036d03292055c56 Mon Sep 17 00:00:00 2001 From: florianh Date: Tue, 19 Nov 2024 17:22:21 +0100 Subject: [PATCH 169/206] peatland exo option --- config/default.cfg | 21 +++++++++++++ modules/58_peatland/input/files | 1 + modules/58_peatland/v2/declarations.gms | 5 ++- modules/58_peatland/v2/equations.gms | 3 +- modules/58_peatland/v2/input.gms | 41 ++++++++++++++++++++++++- modules/58_peatland/v2/preloop.gms | 18 +++++++++++ 6 files changed, 85 insertions(+), 4 deletions(-) diff --git a/config/default.cfg b/config/default.cfg index 30bbbc1049..37173f9cfe 100644 --- a/config/default.cfg +++ b/config/default.cfg @@ -1739,6 +1739,27 @@ cfg$gms$peatland <- "v2" # def = v2 # * Inf (on) cfg$gms$s58_rewetting_switch <- Inf # def = Inf +# * Switch and specification of countries for selected policies in apply. +# * Options: list of iso-codes of countries where exogenous peatland rewetting should be applied +# * Note: must be written in the format: "IND, BRA, DEU" +# * Default: all iso countries +cfg$gms$policy_countries58 <- all_iso_countries + +# * Switch for exogenous peatland rewetting for selected countries (0=off, 1=on) +cfg$gms$s58_rewetting_exo <- 0 # def = 0 +# * Switch for exogenous peatland rewetting for all other countries (0=off, 1=on) +cfg$gms$s58_rewetting_exo_noselect <- 0 # def = 0 +# * The following default values for exogenous peatland rewetting are based on the +# * Nature Restoration Law (NRL): 30 % by 2030, 40% by 2040, 50% by 2050 +# * Start year for exogenous peatland rewetting +cfg$gms$s58_rewet_exo_start_year <- 2030 # def = 2030 +# * Target year for exogenous peatland rewetting +cfg$gms$s58_rewet_exo_target_year <- 2050 # def = 2050 +# * Start value for exogenous peatland rewetting as share of drained peatland in reference period +cfg$gms$s58_rewet_exo_start_value <- 0.3 # def = 0.3 +# * Target value for exogenous peatland rewetting as share of drained peatland in reference period +cfg$gms$s58_rewet_exo_target_value <- 0.5 # def = 0.5 + # * One-time and recurring costs for peatland rewetting (USD17MER per ha) # * (inflated from default originally in USD05 using USD05 --> USD17 inflation rate:1.23) cfg$gms$s58_cost_rewet_onetime <- 1230 # def = 1000 * 1.23 diff --git a/modules/58_peatland/input/files b/modules/58_peatland/input/files index 09985440b4..9af5876c07 100644 --- a/modules/58_peatland/input/files +++ b/modules/58_peatland/input/files @@ -1,3 +1,4 @@ * list of files that are required here f58_ipcc_wetland_ef2.cs3 f58_peatland_area.cs3 +f58_peatland_area_iso.cs3 diff --git a/modules/58_peatland/v2/declarations.gms b/modules/58_peatland/v2/declarations.gms index cb3ef96d1b..f42d289168 100644 --- a/modules/58_peatland/v2/declarations.gms +++ b/modules/58_peatland/v2/declarations.gms @@ -18,8 +18,11 @@ parameters i58_cost_drain_rewet_onetime(t) One-time costs for drainage of rewetted peatland (USD17MER per ha) p58_availPeatlandExp(t,j) Available area for expansion of drained peatland (mio. ha) p58_availLandExp(t,j) Available area for expansion of managed land (mio. ha) - i58_peatland_rewetting_fader Temporal fader for exogenous peatland rewetting (1) + i58_peatland_rewetting_fader(t_all) Temporal fader for exogenous peatland rewetting (1) p58_peatland_ref(j,land58) Peatland area in reference period (mio. ha) + p58_country_dummy(iso) Dummy parameter indicating whether country is affected by exogenous peatland rewetting (1) + p58_country_weight(i) Policy country weight per region (1) + i58_rewetting_exo(t,j) Share of drained peatland in reference period to be rewetted (1) ; equations diff --git a/modules/58_peatland/v2/equations.gms b/modules/58_peatland/v2/equations.gms index 92c9aa7936..b55bc06ef4 100644 --- a/modules/58_peatland/v2/equations.gms +++ b/modules/58_peatland/v2/equations.gms @@ -58,8 +58,7 @@ q58_rewetting_exo(j2,manPeat58)$(sum(ct, m_year(ct)) > s58_fix_peatland) .. v58_peatland(j2,"rewetted") =g= - sum(drained58, p58_peatland_ref(j2,drained58)) * sum(ct, i58_peatland_rewetting_fader(ct)) * s58_rewetting_exo; - + sum(drained58, p58_peatland_ref(j2,drained58)) * sum(ct, i58_rewetting_exo(ct,j2)); *' Costs for peatland degradation and rewetting diff --git a/modules/58_peatland/v2/input.gms b/modules/58_peatland/v2/input.gms index e0b2dbb356..76af642439 100644 --- a/modules/58_peatland/v2/input.gms +++ b/modules/58_peatland/v2/input.gms @@ -14,13 +14,45 @@ scalars s58_rewetting_switch Peatland rewetting on (Inf) or off (0) / Inf / s58_fix_peatland Year indicating until when peatland area should be fixed (year) / 2020 / s58_balance_penalty Penalty for technical peatland balance term (USD17MER) / 1e+06 / - s58_rewetting_exo Switch for exogenous peatland rewetting (1) / 0 / + s58_rewetting_exo Switch for exogenous peatland rewetting for selected countries (1) / 0 / + s58_rewetting_exo_noselect Switch for exogenous peatland rewetting for all other countries (1) / 0 / s58_rewet_exo_start_year Start year for exogenous peatland rewetting / 2030 / s58_rewet_exo_target_year Target year for exogenous peatland rewetting / 2050 / s58_rewet_exo_start_value Start value for exogenous peatland rewetting as share of drained peatland in reference period (1) / 0.3 / s58_rewet_exo_target_value Target value for exogenous peatland rewetting as share of drained peatland in reference period (1) / 0.5 / ; +* Set-switch for countries affected by certain policies +* Default: all iso countries selected +sets + policy_countries58(iso) countries to be affected by exogenous peatland rewetting + / 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 / +; + *Peatland area based on Global Peatland Map 2.0 and Global Peatland Database table f58_peatland_area(j,land58) Peatland area (mio. ha) $ondelim @@ -28,6 +60,13 @@ $include "./modules/58_peatland/input/f58_peatland_area.cs3" $offdelim ; +*Peatland area based on Global Peatland Map 2.0 and Global Peatland Database +table f58_peatland_area_iso(iso,land58) Peatland area (mio. ha) +$ondelim +$include "./modules/58_peatland/input/f58_peatland_area_iso.cs3" +$offdelim +; + *Wetland GHG emission factors based on IPCC Wetlands 2014 and Tiemeyer et al. 2020 table f58_ipcc_wetland_ef(clcl58,land58,emis58) Wetland emission factors (Tg per yr) $ondelim diff --git a/modules/58_peatland/v2/preloop.gms b/modules/58_peatland/v2/preloop.gms index 2c713d4e35..d15f4305f8 100644 --- a/modules/58_peatland/v2/preloop.gms +++ b/modules/58_peatland/v2/preloop.gms @@ -5,12 +5,30 @@ *** | MAgPIE License Exception, version 1.0 (see LICENSE file). *** | Contact: magpie@pik-potsdam.de +* linear fader for exogenous peatland rewetting m_linear_time_interpol(i58_peatland_rewetting_fader,s58_rewet_exo_start_year,s58_rewet_exo_target_year,s58_rewet_exo_start_value,s58_rewet_exo_target_value); +* Country switch to determine countries for which certain policies shall be applied. +* In the default case, the policy affects all countries when activated. +p58_country_dummy(iso) = 0; +p58_country_dummy(policy_countries58) = 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 total peatland area. +p58_country_weight(i) = sum(i_to_iso(i,iso), p58_country_dummy(iso) * sum(land58, f58_peatland_area_iso(iso,land58))) + / sum(i_to_iso(i,iso), sum(land58, f58_peatland_area_iso(iso,land58))); + +* construct exogenous peatland rewetting scenario +i58_rewetting_exo(t,j) = i58_peatland_rewetting_fader(t) * + (s58_rewetting_exo * sum(cell(i,j), p58_country_weight(i)) + + s58_rewetting_exo_noselect * sum(cell(i,j), 1-p58_country_weight(i))); + +* fix uncontrolled pollutants to zero vm_emissions_reg.fx(i,"peatland",pollutants) = 0; vm_emissions_reg.lo(i,"peatland",poll58) = -Inf; vm_emissions_reg.up(i,"peatland",poll58) = Inf; +* Mapping between detailed and simple climate classes p58_mapping_cell_climate(j,clcl58) = sum(clcl_mapping(clcl,clcl58),pm_climate_class(j,clcl)); * Initialization of peatland area From 2471108ad45034b4080b4aa173831d38db8b143b Mon Sep 17 00:00:00 2001 From: florianh Date: Tue, 19 Nov 2024 17:46:58 +0100 Subject: [PATCH 170/206] npi reversal --- modules/32_forestry/dynamic_may24/input.gms | 1 + modules/32_forestry/dynamic_may24/presolve.gms | 6 ++++++ modules/35_natveg/pot_forest_may24/input.gms | 1 + modules/35_natveg/pot_forest_may24/presolve.gms | 6 ++++++ 4 files changed, 14 insertions(+) diff --git a/modules/32_forestry/dynamic_may24/input.gms b/modules/32_forestry/dynamic_may24/input.gms index 6ffdb2cae8..7dfde9491a 100644 --- a/modules/32_forestry/dynamic_may24/input.gms +++ b/modules/32_forestry/dynamic_may24/input.gms @@ -48,6 +48,7 @@ scalars s32_plant_contr_growth_endvalue End value for plantation contribution growth fader (percent per year) / 0 / s32_plant_contr_max Maximum plantation contribution for establishment decision (percent) / 0.5 / s32_demand_establishment Boolean switch for establishment demand assumption 1=forward looking 0=static (1) / 1 / + s32_npi_ndc_reversal Year in which NPI NDC reversal should take place (1) / Inf / ; parameter f32_aff_mask(j) afforestation mask (binary) diff --git a/modules/32_forestry/dynamic_may24/presolve.gms b/modules/32_forestry/dynamic_may24/presolve.gms index 000f614f94..2062502519 100644 --- a/modules/32_forestry/dynamic_may24/presolve.gms +++ b/modules/32_forestry/dynamic_may24/presolve.gms @@ -120,6 +120,12 @@ v32_land.fx(j,"ndc",ac_sub) = pc32_land(j,"ndc",ac_sub); v32_land.lo(j,"ndc",ac_est) = 0; v32_land.up(j,"ndc",ac_est) = Inf; +* release all bounds in case of NPI / NDC reversal +if (m_year(t) >= s35_npi_ndc_reversal, + v32_land.lo(j,"ndc",ac) = 0; + v32_land.up(j,"ndc",ac) = Inf; +); + ** fix c price induced afforestation based on s32_planing_horizon, fixed only until end of s32_planing_horizon, ac_est is free if(s32_aff_prot = 0, v32_land.fx(j,"aff",ac)$(ac.off <= s32_planing_horizon/5) = pc32_land(j,"aff",ac); diff --git a/modules/35_natveg/pot_forest_may24/input.gms b/modules/35_natveg/pot_forest_may24/input.gms index 95cfbab45b..73ce195cb4 100644 --- a/modules/35_natveg/pot_forest_may24/input.gms +++ b/modules/35_natveg/pot_forest_may24/input.gms @@ -26,6 +26,7 @@ s35_natveg_harvest_shr Constrains the allowed wood harvest from natural vegetati s35_secdf_distribution Flag for secdf initialization (0=all secondary forest in highest age class 1=Equal distribution among all age classes 2=Poulter distribution from MODIS satellite data) (1) / 2 / s35_forest_damage Damage simulation in forests (0=none 1=shifting agriculture 2= Damage from shifting agriculture is faded out by c35_forest_damage_end 4= f35_forest_shock scenario) / 2 / s35_forest_damage_end Year of forest damage end (1) / 2050 / +s35_npi_ndc_reversal Year in which NPI NDC reversal should take place (1) / Inf / ; table f35_forest_lost_share(i,driver_source) Share of area damanged by forest fires (1) diff --git a/modules/35_natveg/pot_forest_may24/presolve.gms b/modules/35_natveg/pot_forest_may24/presolve.gms index 96daaca500..4a357bf452 100644 --- a/modules/35_natveg/pot_forest_may24/presolve.gms +++ b/modules/35_natveg/pot_forest_may24/presolve.gms @@ -227,6 +227,12 @@ p35_min_forest(t,j)$(p35_min_forest(t,j) > pcm_land(j,"primforest") + pcm_land(j = pcm_land(j,"primforest") + pcm_land(j,"secdforest") + pcm_land(j,"forestry"); p35_min_other(t,j)$(p35_min_other(t,j) > pcm_land(j,"other")) = pcm_land(j,"other"); +* NPI / NDC reversal +if (m_year(t) >= s35_npi_ndc_reversal, + p35_min_forest(t,j) = 0; + p35_min_other(t,j) = 0; +); + ** Youngest age classes are not allowed to be harvested v35_hvarea_secdforest.fx(j,ac_est) = 0; v35_hvarea_other.fx(j,othertype35,ac_est) = 0; From c1e242796ad9de81123fcd4922f681a646b7907b Mon Sep 17 00:00:00 2001 From: florianh Date: Tue, 19 Nov 2024 17:50:01 +0100 Subject: [PATCH 171/206] npi reversal --- config/default.cfg | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/config/default.cfg b/config/default.cfg index 30bbbc1049..11fcc51b98 100644 --- a/config/default.cfg +++ b/config/default.cfg @@ -924,6 +924,9 @@ cfg$gms$s32_aff_bii_coeff <- 0 # def = 0 # * ("ndc"): prescribed afforestation based on NPI+NDC policies cfg$gms$c32_aff_policy <- "npi" # def = "npi" +# Year in which NPI NDC reversal should take place (e.g. 2025) +cfg$gms$s32_npi_ndc_reversal <- Inf # def = Inf + # Maximum total global afforestation in Mha (Inf = no constraint) # Note 1: the limit applies to the sum of endogenous CO2 price driven and exogenous NPI/NDC afforestation # Note 2: a limit of 0 or below the level of exogenous NPI/NDC afforestation will be a automatically raised to the level of exogenous NPI/NDC afforestation @@ -1059,6 +1062,9 @@ cfg$gms$c35_ad_policy <- "npi" # def = "npi" # * ("ndc"): avoided other land conversion based on NPI+NDC policies cfg$gms$c35_aolc_policy <- "npi" # def = "npi" +# Year in which NPI NDC reversal should take place (e.g. 2025) +cfg$gms$s35_npi_ndc_reversal <- Inf # def = Inf + # Distribution of age-classes during secondary forest initialization # * (0): All secondary forest belongs to highest age class # * (1): Equal distribution of secondary forest in all age-classes From 545fc3d571bcb2677ae8599f7c6d031821ba624e Mon Sep 17 00:00:00 2001 From: florianh Date: Tue, 19 Nov 2024 21:46:10 +0100 Subject: [PATCH 172/206] update calib factor --- config/projects/scenario_config_fsec.csv | 2 +- scripts/start/projects/paper_peatlandTax.R | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/config/projects/scenario_config_fsec.csv b/config/projects/scenario_config_fsec.csv index 8c1adb8a5f..9967f88400 100644 --- a/config/projects/scenario_config_fsec.csv +++ b/config/projects/scenario_config_fsec.csv @@ -80,5 +80,5 @@ input['cellular'];rev4.116_FSEC_3c888fa5_cellularmagpie_c200_MRI-ESM2-0-ssp460_l input['regional'];rev4.116_FSEC_magpie.tgz;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; input['validation'];rev4.116_FSEC_validation.tgz;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; input['additional'];additional_data_rev4.58.tgz;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -input['calibration'];calibration_FSEC_27Sep24.tgz;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +input['calibration'];calibration_FSEC_19Nov24.tgz;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; magicc_emis_scen;bjoernAR6_C_SSP2-NDC.mif;;;bjoernAR6_C_SSP2-PkBudg900.mif;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;bjoernAR6_C_SSP1-NDC.mif;;;;;;;;;;;;bjoernAR6_C_RemSDP-900-MagSSP1.mif;; diff --git a/scripts/start/projects/paper_peatlandTax.R b/scripts/start/projects/paper_peatlandTax.R index ed4526b597..c6e9ff78e2 100644 --- a/scripts/start/projects/paper_peatlandTax.R +++ b/scripts/start/projects/paper_peatlandTax.R @@ -46,7 +46,7 @@ cfg$repositories <- append( cfg$input['regional'] <- "rev4.116_5d9a2237_magpie.tgz" cfg$input['validation'] <- "rev4.116_5d9a2237_validation.tgz" -cfg$input['calibration'] <- "calibration_H15_27Sep24.tgz" +cfg$input['calibration'] <- "calibration_H16_27Sep24.tgz" cfg$input['cellular'] <- "rev4.116_36f73207_bd86374e_cellularmagpie_c200_MRI-ESM2-0-ssp370_lpjml-8e6c5eb1_clusterweight-ba4466a8.tgz" download_and_update(cfg) From ad2a1445f47ca5ba2b6ab4a0c7949be97e8e0cc7 Mon Sep 17 00:00:00 2001 From: florianh Date: Tue, 19 Nov 2024 22:02:00 +0100 Subject: [PATCH 173/206] revert --- scripts/start/projects/paper_peatlandTax.R | 88 +++------------------- 1 file changed, 9 insertions(+), 79 deletions(-) diff --git a/scripts/start/projects/paper_peatlandTax.R b/scripts/start/projects/paper_peatlandTax.R index 37c699676d..c6e9ff78e2 100644 --- a/scripts/start/projects/paper_peatlandTax.R +++ b/scripts/start/projects/paper_peatlandTax.R @@ -23,7 +23,7 @@ source("scripts/start_functions.R") source("config/default.cfg") # create additional information to describe the runs -cfg$info$flag <- "PTax41" +cfg$info$flag <- "PTax42" cfg$results_folder <- "output/:title:" cfg$results_folder_highres <- "output" @@ -47,7 +47,7 @@ cfg$repositories <- append( cfg$input['regional'] <- "rev4.116_5d9a2237_magpie.tgz" cfg$input['validation'] <- "rev4.116_5d9a2237_validation.tgz" cfg$input['calibration'] <- "calibration_H16_27Sep24.tgz" -cfg$input['cellular'] <- "rev4.116_5d9a2237_4f52075b_cellularmagpie_c200_MRI-ESM2-0-ssp370_lpjml-8e6c5eb1_clusterweight-db9e7cf8.tgz" +cfg$input['cellular'] <- "rev4.116_36f73207_bd86374e_cellularmagpie_c200_MRI-ESM2-0-ssp370_lpjml-8e6c5eb1_clusterweight-ba4466a8.tgz" download_and_update(cfg) ## Create patch file for GHG prices @@ -55,7 +55,7 @@ calc_ghgprice <- function() { T0 <- read.magpie("modules/56_ghg_policy/input/f56_pollutant_prices.cs3") T0 <- collapseNames(T0[, , getNames(T0, dim = 2)[1]]) T0[, , ] <- 0 - + #T200 200 USD/tCO2 in 2050 T200 <- new.magpie(getRegions(T0), c(seq(1995, 2025, by = 5), 2050, 2100, 2150), getNames(T0), fill = 0) T200[, "y2025", "co2_c"] <- 0 @@ -68,13 +68,13 @@ calc_ghgprice <- function() { T200[, , "n2o_n_direct"] <- T200[, , "co2_c"] * 265 * 44 / 28 T200[, , "n2o_n_indirect"] <- T200[, , "co2_c"] * 265 * 44 / 28 T200[, , "co2_c"] <- T200[, , "co2_c"] * 44 / 12 - + T25 <- T200 * 0.125 T50 <- T200 * 0.25 T100 <- T200 * 0.5 T400 <- T200 * 2 T800 <- T200 * 4 - + GHG <- mbind( add_dimension(T0, dim = 3.2, add = "scen", nm = "T0-GHG"), add_dimension( @@ -114,16 +114,16 @@ calc_ghgprice <- function() { nm = "T800-GHG" ) ) - + CO2 <- GHG CO2[, , c("ch4", "n2o_n_direct", "n2o_n_indirect")] <- 0 getNames(CO2, dim = 2) <- gsub("GHG", "CO2", getNames(CO2, dim = 2)) - + GHGCH4GWP20 <- GHG GHGCH4GWP20[, , "ch4"] <- GHGCH4GWP20[, , "ch4"] / 28 * 84 getNames(GHGCH4GWP20, dim = 2) <- gsub("GHG", "GHG-GWP20", getNames(GHGCH4GWP20, dim = 2)) - + GHG <- mbind(CO2, GHG, GHGCH4GWP20) if (!dir.exists("./patch_inputdata")) dir.create("./patch_inputdata") @@ -133,7 +133,7 @@ calc_ghgprice <- function() { write.magpie(GHG, file_name = "patch_inputdata/patchGHGprices/f56_pollutant_prices.cs3") tardir("patch_inputdata/patchGHGprices", "patch_inputdata/patchGHGprices.tgz") - + unlink("patch_inputdata/patchGHGprices", recursive = TRUE) return(getNames(GHG, dim = 2)) } @@ -156,7 +156,6 @@ cfg$gms$s56_c_price_induced_aff <- 0 cfg$title <- .title(cfg, paste(ssp, "Ref", sep = "-")) cfg$gms$c56_mute_ghgprices_until <- "y2150" cfg$gms$c56_pollutant_prices <- "T0-CO2" -cfg$gms$s58_rewetting_exo <- 0 start_run(cfg, codeCheck = FALSE) ## GHG policy scenarios @@ -173,72 +172,3 @@ for (tax in c("T25-CO2", cfg$gms$c56_pollutant_prices <- tax start_run(cfg, codeCheck = FALSE) } - -## Exo rewet scenarios -cfg$title <- .title(cfg, paste(ssp, "NRL50", sep = "-")) -cfg$gms$c56_mute_ghgprices_until <- "y2150" -cfg$gms$c56_pollutant_prices <- "T0-CO2" -cfg$gms$s58_rewetting_exo <- 0.5 -cfg$gms$s58_cost_drain_intact_onetime <- 10000 -start_run(cfg, codeCheck = FALSE) - -cfg$title <- .title(cfg, paste(ssp, "NRL100", sep = "-")) -cfg$gms$c56_mute_ghgprices_until <- "y2150" -cfg$gms$c56_pollutant_prices <- "T0-CO2" -cfg$gms$s58_rewetting_exo <- 1 -cfg$gms$s58_cost_drain_intact_onetime <- 10000 -start_run(cfg, codeCheck = FALSE) - -cfg$title <- .title(cfg, paste(ssp, "AREA50", sep = "-")) -cfg$gms$c56_mute_ghgprices_until <- "y2150" -cfg$gms$c56_pollutant_prices <- "T0-CO2" -cfg$gms$s58_rewetting_exo <- 0 -cfg$gms$s58_cost_drain_intact_onetime <- 10000 -cfg$gms$s58_cost_rewet_onetime <- 0 -cfg$gms$s58_cost_rewet_recur <- -50 -start_run(cfg, codeCheck = FALSE) - -cfg$title <- .title(cfg, paste(ssp, "AREA100", sep = "-")) -cfg$gms$c56_mute_ghgprices_until <- "y2150" -cfg$gms$c56_pollutant_prices <- "T0-CO2" -cfg$gms$s58_rewetting_exo <- 0 -cfg$gms$s58_cost_drain_intact_onetime <- 10000 -cfg$gms$s58_cost_rewet_onetime <- 0 -cfg$gms$s58_cost_rewet_recur <- -100 -start_run(cfg, codeCheck = FALSE) - -cfg$title <- .title(cfg, paste(ssp, "AREA500", sep = "-")) -cfg$gms$c56_mute_ghgprices_until <- "y2150" -cfg$gms$c56_pollutant_prices <- "T0-CO2" -cfg$gms$s58_rewetting_exo <- 0 -cfg$gms$s58_cost_drain_intact_onetime <- 10000 -cfg$gms$s58_cost_rewet_onetime <- 0 -cfg$gms$s58_cost_rewet_recur <- -500 -start_run(cfg, codeCheck = FALSE) - -cfg$title <- .title(cfg, paste(ssp, "AREA1000", sep = "-")) -cfg$gms$c56_mute_ghgprices_until <- "y2150" -cfg$gms$c56_pollutant_prices <- "T0-CO2" -cfg$gms$s58_rewetting_exo <- 0 -cfg$gms$s58_cost_drain_intact_onetime <- 10000 -cfg$gms$s58_cost_rewet_onetime <- 0 -cfg$gms$s58_cost_rewet_recur <- -1000 -start_run(cfg, codeCheck = FALSE) - -cfg$title <- .title(cfg, paste(ssp, "AREA2000", sep = "-")) -cfg$gms$c56_mute_ghgprices_until <- "y2150" -cfg$gms$c56_pollutant_prices <- "T0-CO2" -cfg$gms$s58_rewetting_exo <- 0 -cfg$gms$s58_cost_drain_intact_onetime <- 10000 -cfg$gms$s58_cost_rewet_onetime <- 0 -cfg$gms$s58_cost_rewet_recur <- -2000 -start_run(cfg, codeCheck = FALSE) - -cfg$title <- .title(cfg, paste(ssp, "AREA5000", sep = "-")) -cfg$gms$c56_mute_ghgprices_until <- "y2150" -cfg$gms$c56_pollutant_prices <- "T0-CO2" -cfg$gms$s58_rewetting_exo <- 0 -cfg$gms$s58_cost_drain_intact_onetime <- 10000 -cfg$gms$s58_cost_rewet_onetime <- 0 -cfg$gms$s58_cost_rewet_recur <- -5000 -start_run(cfg, codeCheck = FALSE) From 3654769c74ec37549a88d862687e65d87303a37b Mon Sep 17 00:00:00 2001 From: florianh Date: Tue, 19 Nov 2024 22:04:01 +0100 Subject: [PATCH 174/206] log --- CHANGELOG.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 78ccb20ec0..ebf672764b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -23,6 +23,8 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). - **62_material** added switch to turn off future material demand for bioplastic - **config** added SSP1-POP-GDP SSP2-POP-GDP and SSP5-POP-GDP - **modules[29-35]** added initial values for ov_bv for better starting point +- **32_forestry** added option s32_npi_ndc_reversal +- **35_natveg** added option s35_npi_ndc_reversal ### removed - From c9f19ca3c323c87eb5b30ff98f68e8146807f34a Mon Sep 17 00:00:00 2001 From: florianh Date: Tue, 19 Nov 2024 22:16:26 +0100 Subject: [PATCH 175/206] update --- modules/58_peatland/v2/declarations.gms | 2 +- modules/58_peatland/v2/postsolve.gms | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/modules/58_peatland/v2/declarations.gms b/modules/58_peatland/v2/declarations.gms index f42d289168..d812fa5151 100644 --- a/modules/58_peatland/v2/declarations.gms +++ b/modules/58_peatland/v2/declarations.gms @@ -75,10 +75,10 @@ parameters oq58_manLandRed(t,j,manPeat58,type) Managed land area reduction (mio. ha) oq58_peatlandMan(t,j,manPeat58,type) Change of managed peatland area (mio. ha) oq58_peatlandMan2(t,j,manPeat58,type) Contraint for managed peatland area (mio. ha) + oq58_rewetting_exo(t,j,manPeat58,type) Constraint for exogenous peatland rewetting (mio. ha) oq58_peatland_cost(t,j,type) One-time and recurring cost of peatland conversion and management (mio. USD17MER per yr) oq58_peatland_cost_annuity(t,j,cost58,type) Annuity costs for peatland conversion in the current timestep (mio. USD17MER per yr) oq58_peatland_emis_detail(t,j,land58,emis58,type) Detailed GHG emissions from peatlands (Tg per yr) oq58_peatland_emis(t,i,poll58,type) GHG emissions from managed peatland (Tg per yr) - oq58_rewetting_exo(t,j,manPeat58,type) blub (mio. ha) ; *##################### R SECTION END (OUTPUT DECLARATIONS) ##################### diff --git a/modules/58_peatland/v2/postsolve.gms b/modules/58_peatland/v2/postsolve.gms index f7afcc5a46..563eb66e46 100644 --- a/modules/58_peatland/v2/postsolve.gms +++ b/modules/58_peatland/v2/postsolve.gms @@ -26,11 +26,11 @@ pc58_manLand(j,manPeat58) = v58_manLand.l(j,manPeat58); oq58_manLandRed(t,j,manPeat58,"marginal") = q58_manLandRed.m(j,manPeat58); oq58_peatlandMan(t,j,manPeat58,"marginal") = q58_peatlandMan.m(j,manPeat58); oq58_peatlandMan2(t,j,manPeat58,"marginal") = q58_peatlandMan2.m(j,manPeat58); + oq58_rewetting_exo(t,j,manPeat58,"marginal") = q58_rewetting_exo.m(j,manPeat58); oq58_peatland_cost(t,j,"marginal") = q58_peatland_cost.m(j); oq58_peatland_cost_annuity(t,j,cost58,"marginal") = q58_peatland_cost_annuity.m(j,cost58); oq58_peatland_emis_detail(t,j,land58,emis58,"marginal") = q58_peatland_emis_detail.m(j,land58,emis58); oq58_peatland_emis(t,i,poll58,"marginal") = q58_peatland_emis.m(i,poll58); - oq58_rewetting_exo(t,j,manPeat58,"marginal") = q58_rewetting_exo.m(j,manPeat58); ov58_peatlandChange(t,j,land58,"level") = v58_peatlandChange.l(j,land58); ov_peatland_cost(t,j,"level") = vm_peatland_cost.l(j); ov58_peatland_emis(t,j,land58,emis58,"level") = v58_peatland_emis.l(j,land58,emis58); @@ -48,11 +48,11 @@ pc58_manLand(j,manPeat58) = v58_manLand.l(j,manPeat58); oq58_manLandRed(t,j,manPeat58,"level") = q58_manLandRed.l(j,manPeat58); oq58_peatlandMan(t,j,manPeat58,"level") = q58_peatlandMan.l(j,manPeat58); oq58_peatlandMan2(t,j,manPeat58,"level") = q58_peatlandMan2.l(j,manPeat58); + oq58_rewetting_exo(t,j,manPeat58,"level") = q58_rewetting_exo.l(j,manPeat58); oq58_peatland_cost(t,j,"level") = q58_peatland_cost.l(j); oq58_peatland_cost_annuity(t,j,cost58,"level") = q58_peatland_cost_annuity.l(j,cost58); oq58_peatland_emis_detail(t,j,land58,emis58,"level") = q58_peatland_emis_detail.l(j,land58,emis58); oq58_peatland_emis(t,i,poll58,"level") = q58_peatland_emis.l(i,poll58); - oq58_rewetting_exo(t,j,manPeat58,"level") = q58_rewetting_exo.l(j,manPeat58); ov58_peatlandChange(t,j,land58,"upper") = v58_peatlandChange.up(j,land58); ov_peatland_cost(t,j,"upper") = vm_peatland_cost.up(j); ov58_peatland_emis(t,j,land58,emis58,"upper") = v58_peatland_emis.up(j,land58,emis58); @@ -70,11 +70,11 @@ pc58_manLand(j,manPeat58) = v58_manLand.l(j,manPeat58); oq58_manLandRed(t,j,manPeat58,"upper") = q58_manLandRed.up(j,manPeat58); oq58_peatlandMan(t,j,manPeat58,"upper") = q58_peatlandMan.up(j,manPeat58); oq58_peatlandMan2(t,j,manPeat58,"upper") = q58_peatlandMan2.up(j,manPeat58); + oq58_rewetting_exo(t,j,manPeat58,"upper") = q58_rewetting_exo.up(j,manPeat58); oq58_peatland_cost(t,j,"upper") = q58_peatland_cost.up(j); oq58_peatland_cost_annuity(t,j,cost58,"upper") = q58_peatland_cost_annuity.up(j,cost58); oq58_peatland_emis_detail(t,j,land58,emis58,"upper") = q58_peatland_emis_detail.up(j,land58,emis58); oq58_peatland_emis(t,i,poll58,"upper") = q58_peatland_emis.up(i,poll58); - oq58_rewetting_exo(t,j,manPeat58,"upper") = q58_rewetting_exo.up(j,manPeat58); ov58_peatlandChange(t,j,land58,"lower") = v58_peatlandChange.lo(j,land58); ov_peatland_cost(t,j,"lower") = vm_peatland_cost.lo(j); ov58_peatland_emis(t,j,land58,emis58,"lower") = v58_peatland_emis.lo(j,land58,emis58); @@ -92,9 +92,9 @@ pc58_manLand(j,manPeat58) = v58_manLand.l(j,manPeat58); oq58_manLandRed(t,j,manPeat58,"lower") = q58_manLandRed.lo(j,manPeat58); oq58_peatlandMan(t,j,manPeat58,"lower") = q58_peatlandMan.lo(j,manPeat58); oq58_peatlandMan2(t,j,manPeat58,"lower") = q58_peatlandMan2.lo(j,manPeat58); + oq58_rewetting_exo(t,j,manPeat58,"lower") = q58_rewetting_exo.lo(j,manPeat58); oq58_peatland_cost(t,j,"lower") = q58_peatland_cost.lo(j); oq58_peatland_cost_annuity(t,j,cost58,"lower") = q58_peatland_cost_annuity.lo(j,cost58); oq58_peatland_emis_detail(t,j,land58,emis58,"lower") = q58_peatland_emis_detail.lo(j,land58,emis58); oq58_peatland_emis(t,i,poll58,"lower") = q58_peatland_emis.lo(i,poll58); - oq58_rewetting_exo(t,j,manPeat58,"lower") = q58_rewetting_exo.lo(j,manPeat58); *##################### R SECTION END (OUTPUT DEFINITIONS) ###################### From 9bc340b13c982d15ded9ba11e2f098dcd17d8806 Mon Sep 17 00:00:00 2001 From: florianh Date: Wed, 20 Nov 2024 10:08:48 +0100 Subject: [PATCH 176/206] test --- scripts/start/projects/paper_peatlandTax.R | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/scripts/start/projects/paper_peatlandTax.R b/scripts/start/projects/paper_peatlandTax.R index 0a6eff9964..ed8a6e13b1 100644 --- a/scripts/start/projects/paper_peatlandTax.R +++ b/scripts/start/projects/paper_peatlandTax.R @@ -23,7 +23,7 @@ source("scripts/start_functions.R") source("config/default.cfg") # create additional information to describe the runs -cfg$info$flag <- "PTax42" +cfg$info$flag <- "PTax43" cfg$results_folder <- "output/:title:" cfg$results_folder_highres <- "output" @@ -166,7 +166,6 @@ for (tax in c("T25-CO2", "T400-GHG-GWP20")) { cfg$title <- .title(cfg, paste(ssp, tax, sep = "-")) cfg$gms$c56_mute_ghgprices_until <- "y2025" - cfg$gms$s58_cost_drain_intact_onetime <- 10000 cfg$gms$c56_pollutant_prices <- tax start_run(cfg, codeCheck = FALSE) } @@ -176,19 +175,16 @@ cfg$title <- .title(cfg, paste(ssp, "NRL33", sep = "-")) cfg$gms$c56_mute_ghgprices_until <- "y2150" cfg$gms$c56_pollutant_prices <- "T0-CO2" cfg$gms$s58_rewetting_exo <- 0.33 -cfg$gms$s58_cost_drain_intact_onetime <- 10000 start_run(cfg, codeCheck = FALSE) cfg$title <- .title(cfg, paste(ssp, "NRL50", sep = "-")) cfg$gms$c56_mute_ghgprices_until <- "y2150" cfg$gms$c56_pollutant_prices <- "T0-CO2" cfg$gms$s58_rewetting_exo <- 0.5 -cfg$gms$s58_cost_drain_intact_onetime <- 10000 start_run(cfg, codeCheck = FALSE) cfg$title <- .title(cfg, paste(ssp, "NRL100", sep = "-")) cfg$gms$c56_mute_ghgprices_until <- "y2150" cfg$gms$c56_pollutant_prices <- "T0-CO2" cfg$gms$s58_rewetting_exo <- 1 -cfg$gms$s58_cost_drain_intact_onetime <- 10000 start_run(cfg, codeCheck = FALSE) From 85270d1ef5e92136f1a23b08bfadeb639b2fba0d Mon Sep 17 00:00:00 2001 From: florianh Date: Wed, 20 Nov 2024 10:16:34 +0100 Subject: [PATCH 177/206] update --- scripts/start/projects/paper_peatlandTax.R | 1 - 1 file changed, 1 deletion(-) diff --git a/scripts/start/projects/paper_peatlandTax.R b/scripts/start/projects/paper_peatlandTax.R index ed8a6e13b1..0093eb5fd1 100644 --- a/scripts/start/projects/paper_peatlandTax.R +++ b/scripts/start/projects/paper_peatlandTax.R @@ -145,7 +145,6 @@ cfg$gms$policy_countries56 <- isoCountriesEUR cfg$gms$policy_countries58 <- isoCountriesEUR cfg$gms$c56_emis_policy <- "sdp_peatland" cfg$gms$factor_costs <- "sticky_feb18" -cfg$gms$livestock <- "fbask_jan16_sticky" cfg$gms$s56_c_price_induced_aff <- 0 ## Start scenarios From 811adb386eebd2d80222a3cc9eb276f4cb5d5307 Mon Sep 17 00:00:00 2001 From: florianh Date: Wed, 20 Nov 2024 12:24:31 +0100 Subject: [PATCH 178/206] update --- config/default.cfg | 5 +++++ modules/58_peatland/v2/declarations.gms | 3 ++- modules/58_peatland/v2/input.gms | 6 ++++-- modules/58_peatland/v2/preloop.gms | 3 +++ modules/58_peatland/v2/presolve.gms | 1 + scripts/start/projects/paper_peatlandTax.R | 7 ++++++- 6 files changed, 21 insertions(+), 4 deletions(-) diff --git a/config/default.cfg b/config/default.cfg index 37173f9cfe..935a0c2e4f 100644 --- a/config/default.cfg +++ b/config/default.cfg @@ -1760,6 +1760,11 @@ cfg$gms$s58_rewet_exo_start_value <- 0.3 # def = 0.3 # * Target value for exogenous peatland rewetting as share of drained peatland in reference period cfg$gms$s58_rewet_exo_target_value <- 0.5 # def = 0.5 +# * Switch for exogenous protection of intact peatland for selected countries (0=off, 1=on) +cfg$gms$s58_intact_prot_exo <- 0 # def = 0 +# * Switch for exogenous protection of intact peatland for all other countries (0=off, 1=on) +cfg$gms$s58_intact_prot_exo_noselect <- 0 # def = 0 + # * One-time and recurring costs for peatland rewetting (USD17MER per ha) # * (inflated from default originally in USD05 using USD05 --> USD17 inflation rate:1.23) cfg$gms$s58_cost_rewet_onetime <- 1230 # def = 1000 * 1.23 diff --git a/modules/58_peatland/v2/declarations.gms b/modules/58_peatland/v2/declarations.gms index d812fa5151..8ea1d306e5 100644 --- a/modules/58_peatland/v2/declarations.gms +++ b/modules/58_peatland/v2/declarations.gms @@ -22,7 +22,8 @@ parameters p58_peatland_ref(j,land58) Peatland area in reference period (mio. ha) p58_country_dummy(iso) Dummy parameter indicating whether country is affected by exogenous peatland rewetting (1) p58_country_weight(i) Policy country weight per region (1) - i58_rewetting_exo(t,j) Share of drained peatland in reference period to be rewetted (1) + i58_rewetting_exo(t,j) Cellular share of drained peatland in reference period to be rewetted (1) + i58_intact_protection_exo(j) Cellular share of intact peatland that should be protected (1) ; equations diff --git a/modules/58_peatland/v2/input.gms b/modules/58_peatland/v2/input.gms index 76af642439..2c570b4383 100644 --- a/modules/58_peatland/v2/input.gms +++ b/modules/58_peatland/v2/input.gms @@ -16,10 +16,12 @@ scalars s58_balance_penalty Penalty for technical peatland balance term (USD17MER) / 1e+06 / s58_rewetting_exo Switch for exogenous peatland rewetting for selected countries (1) / 0 / s58_rewetting_exo_noselect Switch for exogenous peatland rewetting for all other countries (1) / 0 / - s58_rewet_exo_start_year Start year for exogenous peatland rewetting / 2030 / - s58_rewet_exo_target_year Target year for exogenous peatland rewetting / 2050 / + s58_rewet_exo_start_year Start year for exogenous peatland rewetting (1) / 2030 / + s58_rewet_exo_target_year Target year for exogenous peatland rewetting (1) / 2050 / s58_rewet_exo_start_value Start value for exogenous peatland rewetting as share of drained peatland in reference period (1) / 0.3 / s58_rewet_exo_target_value Target value for exogenous peatland rewetting as share of drained peatland in reference period (1) / 0.5 / + s58_intact_prot_exo Switch for exogenous protection of intact peatland for selected countries (1) / 0 / + s58_intact_prot_exo_noselect Switch for exogenous protection of intact peatland for all other countries (1) / 0 / ; * Set-switch for countries affected by certain policies diff --git a/modules/58_peatland/v2/preloop.gms b/modules/58_peatland/v2/preloop.gms index d15f4305f8..ea9fd54f81 100644 --- a/modules/58_peatland/v2/preloop.gms +++ b/modules/58_peatland/v2/preloop.gms @@ -23,6 +23,9 @@ i58_rewetting_exo(t,j) = i58_peatland_rewetting_fader(t) * (s58_rewetting_exo * sum(cell(i,j), p58_country_weight(i)) + s58_rewetting_exo_noselect * sum(cell(i,j), 1-p58_country_weight(i))); +i58_intact_protection_exo(j) = s58_intact_prot_exo * sum(cell(i,j), p58_country_weight(i)) + + s58_intact_prot_exo_noselect * sum(cell(i,j), 1-p58_country_weight(i)); + * fix uncontrolled pollutants to zero vm_emissions_reg.fx(i,"peatland",pollutants) = 0; vm_emissions_reg.lo(i,"peatland",poll58) = -Inf; diff --git a/modules/58_peatland/v2/presolve.gms b/modules/58_peatland/v2/presolve.gms index a360c3218c..6c8ec456b8 100644 --- a/modules/58_peatland/v2/presolve.gms +++ b/modules/58_peatland/v2/presolve.gms @@ -38,6 +38,7 @@ else v58_peatland.l(j,land58) = pc58_peatland(j,land58); v58_peatland.up(j,drained58) = Inf; v58_peatland.up(j,"rewetted") = s58_rewetting_switch; + v58_peatland.lo(j,"intact") = pc58_peatland(j,"intact") * i58_intact_protection_exo(j); v58_peatland.up(j,"intact") = pc58_peatland(j,"intact"); v58_peatland.fx(j,"peatExtract") = pc58_peatland(j,"peatExtract"); v58_balance.lo(j,manPeat58) = 0; diff --git a/scripts/start/projects/paper_peatlandTax.R b/scripts/start/projects/paper_peatlandTax.R index 0093eb5fd1..d8a7f77b7b 100644 --- a/scripts/start/projects/paper_peatlandTax.R +++ b/scripts/start/projects/paper_peatlandTax.R @@ -23,7 +23,7 @@ source("scripts/start_functions.R") source("config/default.cfg") # create additional information to describe the runs -cfg$info$flag <- "PTax43" +cfg$info$flag <- "PTax44" cfg$results_folder <- "output/:title:" cfg$results_folder_highres <- "output" @@ -153,6 +153,7 @@ cfg$title <- .title(cfg, paste(ssp, "Ref", sep = "-")) cfg$gms$c56_mute_ghgprices_until <- "y2150" cfg$gms$c56_pollutant_prices <- "T0-CO2" cfg$gms$s58_rewetting_exo <- 0 +cfg$gms$s58_intact_prot_exo <- 0 start_run(cfg, codeCheck = FALSE) ## GHG policy scenarios @@ -166,6 +167,7 @@ for (tax in c("T25-CO2", cfg$title <- .title(cfg, paste(ssp, tax, sep = "-")) cfg$gms$c56_mute_ghgprices_until <- "y2025" cfg$gms$c56_pollutant_prices <- tax + cfg$gms$s58_intact_prot_exo <- 1 start_run(cfg, codeCheck = FALSE) } @@ -174,16 +176,19 @@ cfg$title <- .title(cfg, paste(ssp, "NRL33", sep = "-")) cfg$gms$c56_mute_ghgprices_until <- "y2150" cfg$gms$c56_pollutant_prices <- "T0-CO2" cfg$gms$s58_rewetting_exo <- 0.33 +cfg$gms$s58_intact_prot_exo <- 1 start_run(cfg, codeCheck = FALSE) cfg$title <- .title(cfg, paste(ssp, "NRL50", sep = "-")) cfg$gms$c56_mute_ghgprices_until <- "y2150" cfg$gms$c56_pollutant_prices <- "T0-CO2" cfg$gms$s58_rewetting_exo <- 0.5 +cfg$gms$s58_intact_prot_exo <- 1 start_run(cfg, codeCheck = FALSE) cfg$title <- .title(cfg, paste(ssp, "NRL100", sep = "-")) cfg$gms$c56_mute_ghgprices_until <- "y2150" cfg$gms$c56_pollutant_prices <- "T0-CO2" cfg$gms$s58_rewetting_exo <- 1 +cfg$gms$s58_intact_prot_exo <- 1 start_run(cfg, codeCheck = FALSE) From c77d3f48d676b81dfb7d16a78e5144c39c5383a6 Mon Sep 17 00:00:00 2001 From: florianh Date: Wed, 20 Nov 2024 14:42:29 +0100 Subject: [PATCH 179/206] update --- modules/32_forestry/dynamic_may24/declarations.gms | 1 + modules/32_forestry/dynamic_may24/equations.gms | 2 +- modules/32_forestry/dynamic_may24/preloop.gms | 3 ++- modules/32_forestry/dynamic_may24/presolve.gms | 3 ++- 4 files changed, 6 insertions(+), 3 deletions(-) diff --git a/modules/32_forestry/dynamic_may24/declarations.gms b/modules/32_forestry/dynamic_may24/declarations.gms index 397e94a847..1034b8cfd2 100644 --- a/modules/32_forestry/dynamic_may24/declarations.gms +++ b/modules/32_forestry/dynamic_may24/declarations.gms @@ -55,6 +55,7 @@ parameters p32_future_to_current_demand_ratio(t,i) Ratio of future and current timber demand (1) p32_demand_forestry_future(t,i,kforestry) Future forestry demand in current time step (tDM per yr) p32_est_cost(type32) Establishment cost (USD17MER per ha) + i32_recurring_cost(type32) Recurring costs (USD17MER per ha) ; positive variables diff --git a/modules/32_forestry/dynamic_may24/equations.gms b/modules/32_forestry/dynamic_may24/equations.gms index c2f861d0d5..42555a0c50 100644 --- a/modules/32_forestry/dynamic_may24/equations.gms +++ b/modules/32_forestry/dynamic_may24/equations.gms @@ -158,7 +158,7 @@ q32_cost_establishment(i2).. *' trees established for re/afforestation purposes. q32_cost_recur(i2) .. v32_cost_recur(i2) =e= - sum((cell(i2,j2),type32,ac_sub), v32_land(j2,type32,ac_sub)) * s32_recurring_cost; + sum((cell(i2,j2),type32,ac_sub), v32_land(j2,type32,ac_sub) * i32_recurring_cost(type32)); **** Plantation establishment decision diff --git a/modules/32_forestry/dynamic_may24/preloop.gms b/modules/32_forestry/dynamic_may24/preloop.gms index edccee7402..6a02ea1608 100644 --- a/modules/32_forestry/dynamic_may24/preloop.gms +++ b/modules/32_forestry/dynamic_may24/preloop.gms @@ -5,7 +5,8 @@ *** | MAgPIE License Exception, version 1.0 (see LICENSE file). *** | Contact: magpie@pik-potsdam.de -*m_sigmoid_time_interpol(i32_plant_contr_fader,2020,2050,0.05,0); +i32_recurring_cost(type32) = s32_recurring_cost; + m_sigmoid_time_interpol(i32_plant_contr_growth_fader,s32_plant_contr_growth_startyear,s32_plant_contr_growth_endyear,s32_plant_contr_growth_startvalue,s32_plant_contr_growth_endvalue); p32_est_cost("plant") = s32_est_cost_plant; diff --git a/modules/32_forestry/dynamic_may24/presolve.gms b/modules/32_forestry/dynamic_may24/presolve.gms index 2062502519..03ef692f9f 100644 --- a/modules/32_forestry/dynamic_may24/presolve.gms +++ b/modules/32_forestry/dynamic_may24/presolve.gms @@ -120,10 +120,11 @@ v32_land.fx(j,"ndc",ac_sub) = pc32_land(j,"ndc",ac_sub); v32_land.lo(j,"ndc",ac_est) = 0; v32_land.up(j,"ndc",ac_est) = Inf; -* release all bounds in case of NPI / NDC reversal +* release all bounds in case of NPI / NDC reversal and set recurring costs to zero if (m_year(t) >= s35_npi_ndc_reversal, v32_land.lo(j,"ndc",ac) = 0; v32_land.up(j,"ndc",ac) = Inf; + i32_recurring_cost("ndc") = 0; ); ** fix c price induced afforestation based on s32_planing_horizon, fixed only until end of s32_planing_horizon, ac_est is free From 3f9827f7ee941cd13189b9798eeb3ed26c4cf349 Mon Sep 17 00:00:00 2001 From: florianh Date: Wed, 20 Nov 2024 15:06:11 +0100 Subject: [PATCH 180/206] update --- scripts/start/projects/paper_peatlandTax.R | 44 ++++++++++++++++++++-- 1 file changed, 40 insertions(+), 4 deletions(-) diff --git a/scripts/start/projects/paper_peatlandTax.R b/scripts/start/projects/paper_peatlandTax.R index d8a7f77b7b..e01e73ab5c 100644 --- a/scripts/start/projects/paper_peatlandTax.R +++ b/scripts/start/projects/paper_peatlandTax.R @@ -23,7 +23,7 @@ source("scripts/start_functions.R") source("config/default.cfg") # create additional information to describe the runs -cfg$info$flag <- "PTax44" +cfg$info$flag <- "PTax45" cfg$results_folder <- "output/:title:" cfg$results_folder_highres <- "output" @@ -149,15 +149,51 @@ cfg$gms$s56_c_price_induced_aff <- 0 ## Start scenarios ## Ref scenario -cfg$title <- .title(cfg, paste(ssp, "Ref", sep = "-")) +cfg$title <- .title(cfg, paste("TAU",ssp, "Ref", sep = "-")) cfg$gms$c56_mute_ghgprices_until <- "y2150" cfg$gms$c56_pollutant_prices <- "T0-CO2" cfg$gms$s58_rewetting_exo <- 0 cfg$gms$s58_intact_prot_exo <- 0 -start_run(cfg, codeCheck = FALSE) +x <- try(modelstat(file.path("output",cfg$title,"fulldata.gdx")),silent = TRUE) +if(is.null(x) | (is.magpie(x) & any(!x %in% c(2,7)))) { + download_and_update(cfg) + start_run(cfg, codeCheck = FALSE) + message(paste0("TAU run started: ",cfg$title)) + Sys.sleep(10) +} + + +### wait until model runs with endogenous TAU are finished, check is performed every 10 minutes +success <- FALSE +while (!success) { + z <- NULL + for (rcp in rcps) { + for (ssp in ssps) { + x <- try(modelstat(file.path("output",cfg$title,"fulldata.gdx")),silent = TRUE) + if (is.magpie(x) & all(x %in% c(2,7))) { + x <- add_dimension(collapseNames(x),dim = 3.1,add = "scen",nm = paste0(ssp,rcp)) + } else x <- NULL + z <- mbind(z,x) + } + } + if (is.null(z)) { + message("Not any model run with endogenous TAU finished. Sleeping for 10 minutes.") + Sys.sleep(60*10) + } else if (dim(z)[3] < length(ssps) * length(rcps)) { + message("At least on model run with endogenous TAU not yet finished. Sleeping for 10 minutes.") + Sys.sleep(60*10) + } else if (dim(z)[3] == length(ssps) * length(rcps)) { + if (all(z %in% c(2,7))) success <- TRUE else stop("Modelstat different from 2 or 7 detected") + } +} + +# use exo TC in all following runs +write.magpie(readGDX(file.path("output",cfg$title,"fulldata.gdx"), "ov_tau", select=list(type="level")),"modules/13_tc/input/f13_tau_scenario.csv") +cfg$gms$tc <- "exo" ## GHG policy scenarios -for (tax in c("T25-CO2", +for (tax in c("T0-CO2", + "T25-CO2", "T50-CO2", "T100-CO2", "T200-CO2", From e9a2363ab7ec88275e9f87d402e21fe2688e9bbb Mon Sep 17 00:00:00 2001 From: florianh Date: Wed, 20 Nov 2024 15:17:34 +0100 Subject: [PATCH 181/206] removed grasslands realization --- CHANGELOG.md | 2 +- config/default.cfg | 7 -- .../31_past/grasslands_apr22/declarations.gms | 52 --------- .../31_past/grasslands_apr22/equations.gms | 56 ---------- modules/31_past/grasslands_apr22/input.gms | 55 --------- modules/31_past/grasslands_apr22/not_used.txt | 2 - .../31_past/grasslands_apr22/postsolve.gms | 54 --------- modules/31_past/grasslands_apr22/preloop.gms | 104 ------------------ modules/31_past/grasslands_apr22/presolve.gms | 20 ---- .../31_past/grasslands_apr22/realization.gms | 40 ------- modules/31_past/grasslands_apr22/sets.gms | 22 ---- modules/31_past/input/files | 4 - modules/31_past/module.gms | 1 - 13 files changed, 1 insertion(+), 418 deletions(-) delete mode 100644 modules/31_past/grasslands_apr22/declarations.gms delete mode 100644 modules/31_past/grasslands_apr22/equations.gms delete mode 100644 modules/31_past/grasslands_apr22/input.gms delete mode 100644 modules/31_past/grasslands_apr22/not_used.txt delete mode 100644 modules/31_past/grasslands_apr22/postsolve.gms delete mode 100644 modules/31_past/grasslands_apr22/preloop.gms delete mode 100644 modules/31_past/grasslands_apr22/presolve.gms delete mode 100644 modules/31_past/grasslands_apr22/realization.gms delete mode 100644 modules/31_past/grasslands_apr22/sets.gms diff --git a/CHANGELOG.md b/CHANGELOG.md index 78ccb20ec0..1276814c34 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -25,7 +25,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). - **modules[29-35]** added initial values for ov_bv for better starting point ### removed -- +- **31_past** removed `grasslands_apr22` realization ### fixed - **11_costs** changed equation to fix bug in total water cost calculation diff --git a/config/default.cfg b/config/default.cfg index 30bbbc1049..2e5102ed29 100644 --- a/config/default.cfg +++ b/config/default.cfg @@ -866,7 +866,6 @@ cfg$gms$s30_rotation_scenario_target <- 2050 # def = 2050 # ***--------------------- 31_past --------------------------------------- # * (static): static pasture # * (endo_jun13): dynamic pasture -# * (grasslands_apr22): Grassland management separating managed pastures from rangelands # NOTE: It is recommended to recalibrate the model when changing this setting! cfg$gms$past <- "endo_jun13" # def = endo_jun13 @@ -878,12 +877,6 @@ cfg$gms$s31_fac_req_past <- 1 # def = 1 # * reflecting that not all pasture area is grazed. cfg$gms$s31_unequal <- 1 # def = 1 -# * Scenario for grassland, pasture suitability areas and pasture yields (only take effect for realization grasslands_apr22) -# * options: cc (climate change) -# * nocc (no climate change) -# * nocc_hist (no climate change after year defined by sm_fix_cc) -cfg$gms$c31_grassl_yld_scenario <- "cc" # def = "cc" - # * Switch that allows selecting how yield calibration factors will be calculated. # * If 0, grassland yield calibration will be calculated as multiplicative relative values. # * If 1, calibration values will be limited to additive absolute values when modeled yields strongly diff --git a/modules/31_past/grasslands_apr22/declarations.gms b/modules/31_past/grasslands_apr22/declarations.gms deleted file mode 100644 index 55b632c120..0000000000 --- a/modules/31_past/grasslands_apr22/declarations.gms +++ /dev/null @@ -1,52 +0,0 @@ -*** | (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 - - -equations -q31_carbon(j,ag_pools,stockType) Above ground carbon content calculation for pasture (mio tC) -q31_cost_prod_past(i) Costs for putting animals on grasslands and shifting between grassland types (mio. USD17MER per yr) -q31_bv_manpast(j,potnatveg) Biodiversity value for managed pastures (Mha) -q31_bv_rangeland(j,potnatveg) Biodiversity value for rangeland (Mha) -q31_pasture_areas(j) Total grassland calculation (mio. ha) -q31_prod_pm(j) Cellular grass production constraint (mio. tDM per yr) -q31_expansion_cost(j, grassland) Grassland expansion cost constraint (mio. USD17MER) -; - -positive variables -v31_grass_area(j,grassland) Grassland areas (mio. ha) -v31_cost_grass_expansion(j, grassland) Costs of grassland expansion (mio. USD17MER) -vm_cost_prod_past(i) Costs for putting animals on grasslands and shifting between grassland types (mio. USD17MER per yr) -; - -parameters -i31_manpast_suit(t_all,j) Areas suitable for managed pastures (mio. ha) -pc31_grass(j,grassland) Grassland areas in previous time step (mio. ha) -i31_grass_calib(t_all,j,grassland) Regional grassland calibration factor correcting for FAO yield levels (1) -i31_grass_modeled_yld(t_all,i,grassland) Biophysical input yields average over region and grassland cover type at the historical reference year (tDM per ha) -i31_grass_yields(t_all,j,grassland) Cellular biophysical input yields (tDM per ha) -i31_grassl_areas(t_all,j) Celullar grassland areas (mio. ha) -i31_lambda_grass(t,i,grassland) Grassland Scaling factor for non-linear management calibration (1) -i31_grassl_yld_hist_reg(t,i,grassland) Grassland FAO yields per region at the historical referende year (tDM per ha) -i31_grass_hist_yld(t_all,i, grassland) FAO gassland yields (tDM per ha) -; - -*#################### R SECTION START (OUTPUT DECLARATIONS) #################### -parameters - ov31_grass_area(t,j,grassland,type) Grassland areas (mio. ha) - ov31_cost_grass_expansion(t,j,grassland,type) Costs of grassland expansion (mio. USD17MER) - ov_cost_prod_past(t,i,type) Costs for putting animals on grasslands and shifting between grassland types (mio. USD17MER per yr) - oq31_carbon(t,j,ag_pools,stockType,type) Above ground carbon content calculation for pasture (mio tC) - oq31_cost_prod_past(t,i,type) Costs for putting animals on grasslands and shifting between grassland types (mio. USD17MER per yr) - oq31_bv_manpast(t,j,potnatveg,type) Biodiversity value for managed pastures (Mha) - oq31_bv_rangeland(t,j,potnatveg,type) Biodiversity value for rangeland (Mha) - oq31_pasture_areas(t,j,type) Total grassland calculation (mio. ha) - oq31_prod_pm(t,j,type) Cellular grass production constraint (mio. tDM per yr) - oq31_expansion_cost(t,j,grassland,type) Grassland expansion cost constraint (mio. USD17MER) -; -*##################### R SECTION END (OUTPUT DECLARATIONS) ##################### - -*** EOF declarations.gms *** diff --git a/modules/31_past/grasslands_apr22/equations.gms b/modules/31_past/grasslands_apr22/equations.gms deleted file mode 100644 index b80ad66e98..0000000000 --- a/modules/31_past/grasslands_apr22/equations.gms +++ /dev/null @@ -1,56 +0,0 @@ -*** | (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 - -*' @equations - -*' Grassland production is estimated by multiplying grassland areas and yields. -*' Technological change is applied to managed pastures yields through 'vm_tau', -*' whereas rangeland yields are kept unaltered after the preloop calibration of -*' 'i31_grass_yields'. - -q31_prod_pm(j2) .. - vm_prod(j2,"pasture") =l= v31_grass_area(j2,"range") * sum(ct,i31_grass_yields(ct,j2,"range")) - + v31_grass_area(j2,"pastr") * sum(ct,i31_grass_yields(ct,j2,"pastr")) * - sum((cell(i2,j2), supreg(h2,i2)), vm_tau(h2, "pastr") / fm_pastr_tau_hist("y1995",h2)); - -*' The sum of managed pastures and rangelands areas equal the parent -*' land class pastures areas in 'vm_land'. - -q31_pasture_areas(j2).. - vm_land(j2,"past") =e= sum(grassland, v31_grass_area(j2,grassland)); - -*' To avoid unrealistic conversions between rangelands and managed pastures areas, -*' a cost is associated with the expansion of rangelands and managed pastures 'v31_cost_grass_expansion' -*' in comparison with areas in the previous time step 'pc31_grass'. - -q31_expansion_cost(j2,grassland) .. - v31_cost_grass_expansion(j2, grassland) =g= - (v31_grass_area(j2, grassland) - pc31_grass(j2,grassland)) * s31_cost_expansion; - -*' Cost of production account for the cost of moving animals to grassland areas plus the costs of -*' expanding aras of production. - -q31_cost_prod_past(i2) .. - vm_cost_prod_past(i2) =e= sum(cell(i2,j2), vm_prod(j2,"pasture")) * s31_cost_grass_prod + - sum((cell(i2,j2), grassland), v31_cost_grass_expansion(j2,grassland)); - -*' On the basis of the required pasture area, cellular above ground carbon stocks are calculated: - -q31_carbon(j2,ag_pools,stockType) .. - vm_carbon_stock(j2,"past",ag_pools,stockType) =e= - m_carbon_stock(vm_land,fm_carbon_density,"past"); - -*' By estimating the different area of managed pasture and rangeland via the luh2 side layers, the biodiversity value for pastures and rangeland is calculated in following: - q31_bv_manpast(j2,potnatveg) .. vm_bv(j2,"manpast",potnatveg) - =e= - vm_land(j2,"past") * fm_luh2_side_layers(j2,"manpast") * fm_bii_coeff("manpast",potnatveg) * fm_luh2_side_layers(j2,potnatveg); - - q31_bv_rangeland(j2,potnatveg) .. vm_bv(j2,"rangeland",potnatveg) - =e= - vm_land(j2,"past") * fm_luh2_side_layers(j2,"rangeland") * fm_bii_coeff("rangeland",potnatveg) * fm_luh2_side_layers(j2,potnatveg); - -*** EOF constraints.gms *** diff --git a/modules/31_past/grasslands_apr22/input.gms b/modules/31_past/grasslands_apr22/input.gms deleted file mode 100644 index f5d0dd3463..0000000000 --- a/modules/31_past/grasslands_apr22/input.gms +++ /dev/null @@ -1,55 +0,0 @@ -*** | (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 - - -scalars - s31_cost_expansion Grasslands expansion costs (USD17MER per hectare) / 1 / - s31_cost_grass_prod Grasslands factor costs (USD17MER per tDM) / 1 / -; - -$setglobal c31_grassl_yld_scenario cc -* options: cc (climate change) -* nocc (no climate change) -* nocc_hist (no climate change after year defined by sm_fix_cc) - -parameter f31_pastr_suitability(t_all,j) Areas suitable for pasture management (mio. ha) -/ -$ondelim -$include "./modules/31_past/input/f31_pastr_suitability.cs2" -$offdelim -/; - -i31_manpast_suit(t_all,j) = f31_pastr_suitability(t_all,j) -* set values to 1995 if nocc scenario is used, or to sm_fix_cc after sm_fix_cc if nocc_hist is used -$if "%c31_grassl_yld_scenario%" == "nocc" i31_manpast_suit(t_all,j) = f31_pastr_suitability("y1995",j); -$if "%c31_grassl_yld_scenario%" == "nocc_hist" i31_manpast_suit(t_all,j)$(m_year(t_all) > sm_fix_cc) = i31_manpast_suit(t_all,j)$(m_year(t_all) = sm_fix_cc); - - -scalar s31_limit_calib Relative managament calibration switch (1=limited 0=pure relative) / 1 /; - - -table f31_grassl_yld(t_all,j,grassland,w) LPJmL potential yields per cell (rainfed only) (tDM per ha) -$ondelim -$include "./modules/31_past/input/f31_grassl_yld.cs3" -$offdelim -; -* set values to 1995 if nocc scenario is used, or to sm_fix_cc after sm_fix_cc if nocc_hist is used -$if "%c31_grassl_yld_scenario%" == "nocc" f31_grassl_yld(t_all,j,grassland,w) = f31_grassl_yld("y1995",j,grassland,w); -$if "%c31_grassl_yld_scenario%" == "nocc_hist" f31_grassl_yld(t_all,j,grassland,w)$(m_year(t_all) > sm_fix_cc) = f31_grassl_yld(t_all,j,grassland,w)$(m_year(t_all) = sm_fix_cc); - - -table f31_grass_bio(t_all,i, grassland) Estimated regional grass biomass consumption in the past (tDM) -$ondelim -$include "./modules/31_past/input/f31_grass_bio_hist.cs3" -$offdelim; - - - -table f31_LUH2v2(t_all,j, f31_luh) LUH2v2 land classes separating rangelands from managed pastures -$ondelim -$include "./modules/31_past/input/f31_LUH2v2.cs3" -$offdelim; diff --git a/modules/31_past/grasslands_apr22/not_used.txt b/modules/31_past/grasslands_apr22/not_used.txt deleted file mode 100644 index 85a13d5fd2..0000000000 --- a/modules/31_past/grasslands_apr22/not_used.txt +++ /dev/null @@ -1,2 +0,0 @@ -name,type,reason -vm_yld,variable, not needed diff --git a/modules/31_past/grasslands_apr22/postsolve.gms b/modules/31_past/grasslands_apr22/postsolve.gms deleted file mode 100644 index a0bae99662..0000000000 --- a/modules/31_past/grasslands_apr22/postsolve.gms +++ /dev/null @@ -1,54 +0,0 @@ -*** | (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 - -*** Land Patterns are transferred to next timestep - pc31_grass(j,grassland) = v31_grass_area.l(j,grassland); - -*#################### R SECTION START (OUTPUT DEFINITIONS) ##################### - ov31_grass_area(t,j,grassland,"marginal") = v31_grass_area.m(j,grassland); - ov31_cost_grass_expansion(t,j,grassland,"marginal") = v31_cost_grass_expansion.m(j,grassland); - ov_cost_prod_past(t,i,"marginal") = vm_cost_prod_past.m(i); - oq31_carbon(t,j,ag_pools,stockType,"marginal") = q31_carbon.m(j,ag_pools,stockType); - oq31_cost_prod_past(t,i,"marginal") = q31_cost_prod_past.m(i); - oq31_bv_manpast(t,j,potnatveg,"marginal") = q31_bv_manpast.m(j,potnatveg); - oq31_bv_rangeland(t,j,potnatveg,"marginal") = q31_bv_rangeland.m(j,potnatveg); - oq31_pasture_areas(t,j,"marginal") = q31_pasture_areas.m(j); - oq31_prod_pm(t,j,"marginal") = q31_prod_pm.m(j); - oq31_expansion_cost(t,j,grassland,"marginal") = q31_expansion_cost.m(j,grassland); - ov31_grass_area(t,j,grassland,"level") = v31_grass_area.l(j,grassland); - ov31_cost_grass_expansion(t,j,grassland,"level") = v31_cost_grass_expansion.l(j,grassland); - ov_cost_prod_past(t,i,"level") = vm_cost_prod_past.l(i); - oq31_carbon(t,j,ag_pools,stockType,"level") = q31_carbon.l(j,ag_pools,stockType); - oq31_cost_prod_past(t,i,"level") = q31_cost_prod_past.l(i); - oq31_bv_manpast(t,j,potnatveg,"level") = q31_bv_manpast.l(j,potnatveg); - oq31_bv_rangeland(t,j,potnatveg,"level") = q31_bv_rangeland.l(j,potnatveg); - oq31_pasture_areas(t,j,"level") = q31_pasture_areas.l(j); - oq31_prod_pm(t,j,"level") = q31_prod_pm.l(j); - oq31_expansion_cost(t,j,grassland,"level") = q31_expansion_cost.l(j,grassland); - ov31_grass_area(t,j,grassland,"upper") = v31_grass_area.up(j,grassland); - ov31_cost_grass_expansion(t,j,grassland,"upper") = v31_cost_grass_expansion.up(j,grassland); - ov_cost_prod_past(t,i,"upper") = vm_cost_prod_past.up(i); - oq31_carbon(t,j,ag_pools,stockType,"upper") = q31_carbon.up(j,ag_pools,stockType); - oq31_cost_prod_past(t,i,"upper") = q31_cost_prod_past.up(i); - oq31_bv_manpast(t,j,potnatveg,"upper") = q31_bv_manpast.up(j,potnatveg); - oq31_bv_rangeland(t,j,potnatveg,"upper") = q31_bv_rangeland.up(j,potnatveg); - oq31_pasture_areas(t,j,"upper") = q31_pasture_areas.up(j); - oq31_prod_pm(t,j,"upper") = q31_prod_pm.up(j); - oq31_expansion_cost(t,j,grassland,"upper") = q31_expansion_cost.up(j,grassland); - ov31_grass_area(t,j,grassland,"lower") = v31_grass_area.lo(j,grassland); - ov31_cost_grass_expansion(t,j,grassland,"lower") = v31_cost_grass_expansion.lo(j,grassland); - ov_cost_prod_past(t,i,"lower") = vm_cost_prod_past.lo(i); - oq31_carbon(t,j,ag_pools,stockType,"lower") = q31_carbon.lo(j,ag_pools,stockType); - oq31_cost_prod_past(t,i,"lower") = q31_cost_prod_past.lo(i); - oq31_bv_manpast(t,j,potnatveg,"lower") = q31_bv_manpast.lo(j,potnatveg); - oq31_bv_rangeland(t,j,potnatveg,"lower") = q31_bv_rangeland.lo(j,potnatveg); - oq31_pasture_areas(t,j,"lower") = q31_pasture_areas.lo(j); - oq31_prod_pm(t,j,"lower") = q31_prod_pm.lo(j); - oq31_expansion_cost(t,j,grassland,"lower") = q31_expansion_cost.lo(j,grassland); -*##################### R SECTION END (OUTPUT DEFINITIONS) ###################### - -*** EOF postsolve.gms *** diff --git a/modules/31_past/grasslands_apr22/preloop.gms b/modules/31_past/grasslands_apr22/preloop.gms deleted file mode 100644 index 0f54f10b19..0000000000 --- a/modules/31_past/grasslands_apr22/preloop.gms +++ /dev/null @@ -1,104 +0,0 @@ -*** | (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 - - -pc31_grass(j,grassland) = f31_LUH2v2("y1995",j,grassland); - - -***YIELD CORRECTION ACCOUNTING FOR REGIONAL DIFFERENCES IN MANAGEMENT*** - -*' @code - -*' Grassland yields for rangelands and managed pastures are calibrated to match estimated -*' historical pasture productivity. - -*' The following equations calibrate the grassland cellular yield patterns ('f31_grassl_yld') to match -*' 'estimated historical yields' ('i31_grass_hist_yld') by calculating a calibration term called -*' 'i31_grass_calib'. For most cases, 'i31_grass_calib' is the ratio of the 'i31_grass_hist_yld' -*' and modeled yields ('i31_grass_modeled_yld') given historic grassland area patterns -*' ('i31_grassl_areas') and cellular yields coming from crop models like LPJmL 'f31_grassl_yld'. -*' In these cases, 'i31_grass_calib' represents a purely relative calibration factor that depends -*' only on the initial conditions of the starting year. -*' -*' However, when estimated yields 'i31_grass_hist_yld' are significantly higher than -*' given by the cellular yield inputs 'f31_grassl_yld' we refer to this as an underestimated -*' baseline. In this situation the relative calibration terms can lead to unrealistically -*' large yields in the case of future yield increases within the cellular yield patterns. -*' -*' To address this issue, we introduce the factor 'i31_lambda_grass' that determines the degree -*' to which the baseline 'i31_grass_hist_yld' is under- or overestimated by the modeled yields -*' 'i31_grass_modeled_yld'. This factor is used to control whether the calibration factor is -*' applied as an absolute or relative change. For 'i31_grass_hist_yld' smaller than -*' 'i31_grass_modeled_yld' (overestimated baseline) 'i31_lambda_grass' is 1, which is -*' equivalent to an entirely relative calibration. For underestimated yields, 'i31_lambda_grass' -*' is calculated as the squared root of the ratio between modeled yields 'i31_grass_modeled_yld' -*' and the historical estimates 'i31_grass_hist_yld'. For underestimated yields, as 'i31_lambda_grass' -*' approaches 0, it reduces the applied relative change resulting in a mean change increasingly -*' similar to an additive term (@Heinke.2013). - -*' This concept is referred to as limited calibration, as it limits the calibration -*' to an additive term in case of a strongly underestimated baseline. The scalar -* 's31_limit_calib' can be used to switch limited calibration on (1) and off (0). - -i31_grass_yields(t,j,grassland) = f31_grassl_yld(t,j,grassland,"rainfed"); -i31_grassl_areas(t_all,j) = sum(grassland, f31_LUH2v2(t_all,j,grassland)); -i31_grass_hist_yld(t_past,i,grassland) = (f31_grass_bio(t_past,i, grassland) / - sum(cell(i,j),f31_LUH2v2(t_past,j,grassland)))$(sum(cell(i,j), f31_LUH2v2(t_past,j,grassland))>0); - -i31_grass_modeled_yld(t_past,i,grassland) - = (sum(cell(i,j),i31_grass_yields(t_past,j,grassland) * f31_LUH2v2(t_past,j,grassland)) / - sum(cell(i,j),f31_LUH2v2(t_past,j,grassland)))$(sum(cell(i,j), f31_LUH2v2(t_past,j,grassland))>0) - + (sum(cell(i,j),i31_grassl_areas(t_past,j) * i31_grass_yields(t_past,j,grassland)) / - sum(cell(i,j),i31_grassl_areas(t_past,j)))$(sum(cell(i,j), f31_LUH2v2(t_past,j,grassland))=0); - -loop(t, - if(sum(sameas(t,"y1995"),1)=1, - - if ((s31_limit_calib = 0), - i31_lambda_grass(t,i,grassland) = 1; - - Elseif (s31_limit_calib =1 ), - i31_lambda_grass(t,i,grassland) = - 1$(i31_grass_hist_yld(t,i,grassland) <= i31_grass_modeled_yld(t,i,grassland)) - + sqrt(i31_grass_modeled_yld(t,i,grassland)/i31_grass_hist_yld(t,i,grassland))$ - (i31_grass_hist_yld(t,i,grassland) > i31_grass_modeled_yld(t,i,grassland)); - ); - - i31_grassl_yld_hist_reg(t,i,grassland) = i31_grass_hist_yld(t,i,grassland); - - Else - i31_grass_modeled_yld(t,i,grassland) = i31_grass_modeled_yld(t-1,i,grassland); - i31_grassl_yld_hist_reg(t,i,grassland) = i31_grassl_yld_hist_reg(t-1,i,grassland); - i31_lambda_grass(t,i,grassland) = i31_lambda_grass(t-1,i,grassland); - ); -); - - -*' The calibrated cellular yield 'i31_grass_yields' is calculated for each time step depending -*' on the constant values 'i31_grass_modeled_yld', 'i31_grassl_yld_hist_reg', 'i31_lambda_grass' -*' and the uncalibrated, cellular yield 'f31_grassl_yld' following the idea of eq. (9) in @Heinke.2013: - -i31_grass_calib(t,j,grassland) = - 1 + (sum(cell(i,j), i31_grassl_yld_hist_reg(t,i,grassland) - i31_grass_modeled_yld(t,i,grassland)) / - f31_grassl_yld(t,j,grassland,"rainfed") * - (f31_grassl_yld(t,j,grassland,"rainfed") / (sum(cell(i,j),i31_grass_modeled_yld(t,i,grassland))+10**(-8))) ** - sum(cell(i,j),i31_lambda_grass(t,i,grassland)))$(f31_grassl_yld(t,j,grassland,"rainfed")>0); - -i31_grass_yields(t,j,"range") = i31_grass_yields(t,j,"range") * i31_grass_calib(t,j,"range"); -i31_grass_yields(t,j,"pastr") = i31_grass_yields(t,j,"pastr") * i31_grass_calib(t,j,"pastr"); - -*' Note that the calculation is split into two parts for better readability. -*' @stop - -* Initialize biodiversity value -vm_bv.l(j,"manpast",potnatveg) = - pcm_land(j,"past") * fm_luh2_side_layers(j,"manpast") * fm_bii_coeff("manpast",potnatveg) * fm_luh2_side_layers(j,potnatveg); - -vm_bv.l(j,"rangeland",potnatveg) = - pcm_land(j,"past") * fm_luh2_side_layers(j,"rangeland") * fm_bii_coeff("rangeland",potnatveg) * fm_luh2_side_layers(j,potnatveg); - - diff --git a/modules/31_past/grasslands_apr22/presolve.gms b/modules/31_past/grasslands_apr22/presolve.gms deleted file mode 100644 index 3f5ef77c20..0000000000 --- a/modules/31_past/grasslands_apr22/presolve.gms +++ /dev/null @@ -1,20 +0,0 @@ -*** | (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 - -*' Socioeconomic and environmental conditions determine the potential managed pastures -*' areas ('i31_manpast_suit'). 'i31_manpast_suit' is estimated by determining areas -*' with more than five inhabitants per km2 and with aridity greater than 0.5 following -*' the methodology established by @KleinGoldewijk.2017 - -v31_grass_area.up(j,"pastr") = i31_manpast_suit(t,j); - -*' Total grassland area cannot be smaller than legally protected grassland area -vm_land.lo(j,"past") = sum(consv_type, pm_land_conservation(t,j,"past",consv_type)); - -*' @stop diff --git a/modules/31_past/grasslands_apr22/realization.gms b/modules/31_past/grasslands_apr22/realization.gms deleted file mode 100644 index 389b2e95c0..0000000000 --- a/modules/31_past/grasslands_apr22/realization.gms +++ /dev/null @@ -1,40 +0,0 @@ -*** | (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 In the grasslands_apr22 realization, grassland areas and related -*' carbon stocks are modelled endogenously. The initial spatially explicit patterns -*' of grasslands ("past") are defined in the module [10_land] by the land use input -*' data set. These areas are further divided into rangelands and managed pastures -*' under different management assumptions. For future time steps, grasslands spatial -*' distribution depend on the demand of grass biomass to feed livestock as calculated -*' in the module [70_livestock] and from the intensity of grassland utilization -*' ("grassland yields"). Grassland yields are defined separately for rangelands -*' and managed pasture based on historical estimates or areas and biomass production -*' for these two systems. Managed pastures yields can be increased endogenously -*' by investments in technology as calculated in [13_tc]. Rising yields alter the -*' nitrogen budged on grasslands triggering costs for N inorganic fertilization as -*' calculated in [50_nr_soil_budget] and control the balance between intensive and -*' extensive grass biomass production. - -*' @limitations At the moment this realization only runs with a single climate scenario -*' (SPP1-RCP2p6 from MRI_ESM-0), which is used in all (except constant climate) settings. -*' We currently do not accout for specific differences within intensive -*' pasture management systems and related degradation of grasslands for both -*' rangelands or managed pastures. Grass production costs and conversion costs between -*' grassland types are set 1 USD17MER per unit due to lack of data. - - - -*####################### R SECTION START (PHASES) ############################## -$Ifi "%phase%" == "sets" $include "./modules/31_past/grasslands_apr22/sets.gms" -$Ifi "%phase%" == "declarations" $include "./modules/31_past/grasslands_apr22/declarations.gms" -$Ifi "%phase%" == "input" $include "./modules/31_past/grasslands_apr22/input.gms" -$Ifi "%phase%" == "equations" $include "./modules/31_past/grasslands_apr22/equations.gms" -$Ifi "%phase%" == "preloop" $include "./modules/31_past/grasslands_apr22/preloop.gms" -$Ifi "%phase%" == "presolve" $include "./modules/31_past/grasslands_apr22/presolve.gms" -$Ifi "%phase%" == "postsolve" $include "./modules/31_past/grasslands_apr22/postsolve.gms" -*######################## R SECTION END (PHASES) ############################### diff --git a/modules/31_past/grasslands_apr22/sets.gms b/modules/31_past/grasslands_apr22/sets.gms deleted file mode 100644 index a85206326b..0000000000 --- a/modules/31_past/grasslands_apr22/sets.gms +++ /dev/null @@ -1,22 +0,0 @@ -*** | (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 - - f31_luh LHUv2 land cover types - / primf, primn, secdf, secdn, urban, c3ann, c4ann, c3per, c4per, c3nfx, pastr, range / - - grassland(f31_luh) Grassland cover types (pastr = managed pastures and range = rangelands) - / pastr, range / - - grass_to31(grassland) pasture management options - / pastr,range / - - grass_from31(grassland) pasture management options - / pastr,range / - -; diff --git a/modules/31_past/input/files b/modules/31_past/input/files index b628d2f69c..fb86d81209 100644 --- a/modules/31_past/input/files +++ b/modules/31_past/input/files @@ -1,5 +1 @@ * list of files that are required here -f31_pastr_suitability.cs2 -f31_LUH2v2.cs3 -f31_grassl_yld.cs3 -f31_grass_bio_hist.cs3 diff --git a/modules/31_past/module.gms b/modules/31_past/module.gms index f2058d5d0f..2628d1af7d 100644 --- a/modules/31_past/module.gms +++ b/modules/31_past/module.gms @@ -18,6 +18,5 @@ *###################### R SECTION START (MODULETYPES) ########################## $Ifi "%past%" == "endo_jun13" $include "./modules/31_past/endo_jun13/realization.gms" -$Ifi "%past%" == "grasslands_apr22" $include "./modules/31_past/grasslands_apr22/realization.gms" $Ifi "%past%" == "static" $include "./modules/31_past/static/realization.gms" *###################### R SECTION END (MODULETYPES) ############################ From 94ce089ac2bc162e5533c6ed7623dadbb1030c5d Mon Sep 17 00:00:00 2001 From: florianh Date: Wed, 20 Nov 2024 15:57:06 +0100 Subject: [PATCH 182/206] bugfix --- scripts/start/projects/paper_peatlandTax.R | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/scripts/start/projects/paper_peatlandTax.R b/scripts/start/projects/paper_peatlandTax.R index e01e73ab5c..6d88dc21d7 100644 --- a/scripts/start/projects/paper_peatlandTax.R +++ b/scripts/start/projects/paper_peatlandTax.R @@ -167,15 +167,11 @@ if(is.null(x) | (is.magpie(x) & any(!x %in% c(2,7)))) { success <- FALSE while (!success) { z <- NULL - for (rcp in rcps) { - for (ssp in ssps) { - x <- try(modelstat(file.path("output",cfg$title,"fulldata.gdx")),silent = TRUE) - if (is.magpie(x) & all(x %in% c(2,7))) { - x <- add_dimension(collapseNames(x),dim = 3.1,add = "scen",nm = paste0(ssp,rcp)) - } else x <- NULL - z <- mbind(z,x) - } - } + x <- try(modelstat(file.path("output",cfg$title,"fulldata.gdx")),silent = TRUE) + if (is.magpie(x) & all(x %in% c(2,7))) { + x <- add_dimension(collapseNames(x),dim = 3.1,add = "scen",nm = paste0(ssp,rcp)) + } else x <- NULL + z <- mbind(z,x) if (is.null(z)) { message("Not any model run with endogenous TAU finished. Sleeping for 10 minutes.") Sys.sleep(60*10) From 5b1ccec74721c49ad1f29744b978a9c3c63fa8a1 Mon Sep 17 00:00:00 2001 From: florianh Date: Wed, 20 Nov 2024 16:05:47 +0100 Subject: [PATCH 183/206] bugfix --- scripts/start/projects/paper_peatlandTax.R | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/scripts/start/projects/paper_peatlandTax.R b/scripts/start/projects/paper_peatlandTax.R index 6d88dc21d7..86e3bde7eb 100644 --- a/scripts/start/projects/paper_peatlandTax.R +++ b/scripts/start/projects/paper_peatlandTax.R @@ -169,16 +169,13 @@ while (!success) { z <- NULL x <- try(modelstat(file.path("output",cfg$title,"fulldata.gdx")),silent = TRUE) if (is.magpie(x) & all(x %in% c(2,7))) { - x <- add_dimension(collapseNames(x),dim = 3.1,add = "scen",nm = paste0(ssp,rcp)) + x <- x } else x <- NULL z <- mbind(z,x) if (is.null(z)) { message("Not any model run with endogenous TAU finished. Sleeping for 10 minutes.") Sys.sleep(60*10) - } else if (dim(z)[3] < length(ssps) * length(rcps)) { - message("At least on model run with endogenous TAU not yet finished. Sleeping for 10 minutes.") - Sys.sleep(60*10) - } else if (dim(z)[3] == length(ssps) * length(rcps)) { + } else { if (all(z %in% c(2,7))) success <- TRUE else stop("Modelstat different from 2 or 7 detected") } } From e2648b1b992ba68d4f3a6012a1f3f5480954acd0 Mon Sep 17 00:00:00 2001 From: florianh Date: Wed, 20 Nov 2024 16:40:10 +0100 Subject: [PATCH 184/206] bugfix --- scripts/start/projects/paper_peatlandTax.R | 1 + 1 file changed, 1 insertion(+) diff --git a/scripts/start/projects/paper_peatlandTax.R b/scripts/start/projects/paper_peatlandTax.R index 86e3bde7eb..85e37353c1 100644 --- a/scripts/start/projects/paper_peatlandTax.R +++ b/scripts/start/projects/paper_peatlandTax.R @@ -181,6 +181,7 @@ while (!success) { } # use exo TC in all following runs +download_and_update(cfg) write.magpie(readGDX(file.path("output",cfg$title,"fulldata.gdx"), "ov_tau", select=list(type="level")),"modules/13_tc/input/f13_tau_scenario.csv") cfg$gms$tc <- "exo" From 9508bcf0856bf777318bac3fe45c3511eb639a71 Mon Sep 17 00:00:00 2001 From: florianh Date: Thu, 21 Nov 2024 09:13:03 +0100 Subject: [PATCH 185/206] bugfix --- modules/32_forestry/dynamic_may24/presolve.gms | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/32_forestry/dynamic_may24/presolve.gms b/modules/32_forestry/dynamic_may24/presolve.gms index 03ef692f9f..bee79ec879 100644 --- a/modules/32_forestry/dynamic_may24/presolve.gms +++ b/modules/32_forestry/dynamic_may24/presolve.gms @@ -121,7 +121,7 @@ v32_land.lo(j,"ndc",ac_est) = 0; v32_land.up(j,"ndc",ac_est) = Inf; * release all bounds in case of NPI / NDC reversal and set recurring costs to zero -if (m_year(t) >= s35_npi_ndc_reversal, +if (m_year(t) >= s32_npi_ndc_reversal, v32_land.lo(j,"ndc",ac) = 0; v32_land.up(j,"ndc",ac) = Inf; i32_recurring_cost("ndc") = 0; From b341ae7ae8c31c056d2753a9882ffe739e51ce12 Mon Sep 17 00:00:00 2001 From: florianh Date: Thu, 21 Nov 2024 14:21:01 +0100 Subject: [PATCH 186/206] updates --- config/default.cfg | 15 -------- config/scenario_config.csv | 1 - scripts/start/projects/paper_grassland.R | 44 ------------------------ 3 files changed, 60 deletions(-) delete mode 100644 scripts/start/projects/paper_grassland.R diff --git a/config/default.cfg b/config/default.cfg index 2e5102ed29..17a24518f8 100644 --- a/config/default.cfg +++ b/config/default.cfg @@ -872,21 +872,6 @@ cfg$gms$past <- "endo_jun13" # def = endo_jun13 # * Factor requirements (USD17 per ton DM) cfg$gms$s31_fac_req_past <- 1 # def = 1 -# * switch for unequal (1) or equal (0) sign in pasture production constraint q31_prod. -# * unequal means that pasture production can be lower than pasture area x pasture yield, -# * reflecting that not all pasture area is grazed. -cfg$gms$s31_unequal <- 1 # def = 1 - -# * Switch that allows selecting how yield calibration factors will be calculated. -# * If 0, grassland yield calibration will be calculated as multiplicative relative values. -# * If 1, calibration values will be limited to additive absolute values when modeled yields strongly -# * underestimate historical values. For more information, read the description on the 'preloop' -# * file of module 31_past. - -# * options: 1 (limit to absolute values) -# * 0 (pure relative calibration) -cfg$gms$s31_limit_calib <- 1 # def = 1 - # ***--------------------- 32_forestry ----------------------------------- # * (dynamic_may24): Dynamic forestry sector including afforestation with detailed age-classes cfg$gms$forestry <- "dynamic_may24" # def = dynamic_may24 diff --git a/config/scenario_config.csv b/config/scenario_config.csv index 6f00b24aa8..39fff4e2e2 100755 --- a/config/scenario_config.csv +++ b/config/scenario_config.csv @@ -36,7 +36,6 @@ gms$c22_protect_scenario;;;;;;;;;;BH;none;BH_IFL;BH;;;;;;;;;;;;;;;;;;;; gms$s29_snv_shr;;;;;;;;;;0;0;0;0.2;;;;;;;;;;;;;;;;;;;; gms$s29_snv_scenario_target;;;;;;;;;;;;;2030;;;;;;;;;;;;;;;;;;;; gms$c30_bioen_water;;;;;;;;;;rainfed;all;rainfed;rainfed;;;;;;;;;;;;;;;;;;;; -gms$c31_grassl_yld_scenario;cc;nocc;nocc_hist;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; gms$s32_initial_distribution;;;;;;;;;;;;;;;;;;;;;;;;;1;1;0;;;;;; gms$s32_hvarea;;;;;;;;;;;;;;;;;;;;;;;;;2;1;0;;;;;; gms$s32_aff_plantation;;;;;;;;;;0;1;0;0;;;;;;;;;;;;;;;;;;;; diff --git a/scripts/start/projects/paper_grassland.R b/scripts/start/projects/paper_grassland.R deleted file mode 100644 index 7a405b0042..0000000000 --- a/scripts/start/projects/paper_grassland.R +++ /dev/null @@ -1,44 +0,0 @@ -# | (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: Runs for Pasture mangagement paper -# ------------------------------------------------ -library(gms) -# Load start_run(cfg) function which is needed to start MAgPIE runs -source("scripts/start_functions.R") - -#start MAgPIE run - -scenarios <- list(c("SSP1","rcp2p6"), c("SSP2","rcp4p5"), c("SSP3","rcp7p0"), c("SSP4","rcp6p0"), c("SSP5", "rcp8p5")) - -for (ssp_setting in scenarios) { - name = "H12_G11" - cfg="default.cfg" - cfg <- setScenario(cfg,ssp_setting) - if(grepl("FSEC", name)) { - cfg$input["calibration"] <- "calibration_FSEC_G3_22Mar22.tgz" - if(SSP1 %in% ssp_setting){ - cfg$input["cellular"] <- "rev4.68_e2bdb6cd_6819938d_cellularmagpie_c200_MRI-ESM2-0-ssp126_lpjml-8e6c5eb1.tgz" - } else if (SSP2 %in% ssp_setting) { - cfg$input["cellular"] <- "rev4.68_e2bdb6cd_1b5c3817_cellularmagpie_c200_MRI-ESM2-0-ssp245_lpjml-8e6c5eb1.tgz" - } else if (SSP3 %in% ssp_setting) { - cfg$input["cellular"] <- "rev4.68_e2bdb6cd_fd712c0b_cellularmagpie_c200_MRI-ESM2-0-ssp370_lpjml-8e6c5eb1.tgz" - } else if (SSP4 %in% ssp_setting) { - cfg$input["cellular"] <- "rev4.68_e2bdb6cd_3c888fa5_cellularmagpie_c200_MRI-ESM2-0-ssp460_lpjml-8e6c5eb1.tgz" - } else if (SSP5 %in% ssp_setting) { - cfg$input["cellular"] <- "rev4.68_e2bdb6cd_09a63995_cellularmagpie_c200_MRI-ESM2-0-ssp585_lpjml-8e6c5eb1.tgz" - } else { - stop("Select a correct SSP scenario!") - } - } else { - cfg$input["calibration"] <- "calibration_H12_grassland_mar22.tgz" - } - cfg$gms$past <- "grasslands_apr22" - cfg$title <- paste0(name,"_",ssp_setting[1],"_",ssp_setting[2],"_", substr(Sys.time(), 6,10),"-",gsub(":", "_I_", substr(Sys.time(), 12,16))) - start_run(cfg) -} From 38349efe8dfcf3fdb9b02986235bd7eb76036b59 Mon Sep 17 00:00:00 2001 From: florianh Date: Fri, 22 Nov 2024 12:37:03 +0100 Subject: [PATCH 187/206] bugfix remove empty files file --- modules/31_past/input/files | 1 - 1 file changed, 1 deletion(-) delete mode 100644 modules/31_past/input/files diff --git a/modules/31_past/input/files b/modules/31_past/input/files deleted file mode 100644 index fb86d81209..0000000000 --- a/modules/31_past/input/files +++ /dev/null @@ -1 +0,0 @@ -* list of files that are required here From e632d7d656f59e9b2c8086410808e5e098df1724 Mon Sep 17 00:00:00 2001 From: florianh Date: Fri, 22 Nov 2024 16:57:01 +0100 Subject: [PATCH 188/206] bugfix --- modules/58_peatland/v2/presolve.gms | 3 +++ 1 file changed, 3 insertions(+) diff --git a/modules/58_peatland/v2/presolve.gms b/modules/58_peatland/v2/presolve.gms index 38bca88d78..6c8ec456b8 100644 --- a/modules/58_peatland/v2/presolve.gms +++ b/modules/58_peatland/v2/presolve.gms @@ -29,6 +29,9 @@ if (m_year(t) <= s58_fix_peatland, i58_cost_drain_intact_onetime(t) = 0; i58_cost_drain_rewet_onetime(t) = 0; i58_cost_rewet_onetime(t) = 0; + +* save area in reference period + p58_peatland_ref(j,land58)$(m_year(t) = s58_fix_peatland) = pc58_peatland(j,land58); else * Define bounds and costs for peatland area after the year given by s58_fix_peatland v58_peatland.lo(j,land58) = 0; From 70990a9592a08b8064928a79aac275439152038a Mon Sep 17 00:00:00 2001 From: florianh Date: Sat, 23 Nov 2024 11:25:54 +0100 Subject: [PATCH 189/206] test --- config/default.cfg | 2 +- modules/58_peatland/v2/declarations.gms | 4 +--- modules/58_peatland/v2/equations.gms | 4 +--- modules/58_peatland/v2/presolve.gms | 12 +++++------- modules/58_peatland/v2/sets.gms | 13 +++++++++++-- 5 files changed, 19 insertions(+), 16 deletions(-) diff --git a/config/default.cfg b/config/default.cfg index d6f94ec7d5..23a47c5b71 100644 --- a/config/default.cfg +++ b/config/default.cfg @@ -1758,7 +1758,7 @@ cfg$gms$s58_cost_rewet_recur <- 37 # def = 30 * 1.23 # * One-time costs apply on the drainage of intact and rewetted peatland # * Recurring costs apply on the level of drained and managed peatland cfg$gms$s58_cost_drain_intact_onetime <- 0 # def = 0 -cfg$gms$s58_cost_drain_rewet_onetime <- 0 # def = 0 +cfg$gms$s58_cost_drain_rewet_onetime <- 1230 # def = 1230 cfg$gms$s58_cost_drain_recur <- 0 # def = 0 # * Penalty for technical peatland balance term (USD17MER) diff --git a/modules/58_peatland/v2/declarations.gms b/modules/58_peatland/v2/declarations.gms index 8ea1d306e5..4151322e15 100644 --- a/modules/58_peatland/v2/declarations.gms +++ b/modules/58_peatland/v2/declarations.gms @@ -12,10 +12,8 @@ parameters p58_scalingFactorRed(t,j,manPeat58) Scaling factor for peatland reduction (1) p58_mapping_cell_climate(j,clcl58) Mapping between cells and climate regions (binary) i58_cost_rewet_recur(t) Recurring costs for rewetted peatland (USD17MER per ha) - i58_cost_rewet_onetime(t) One-time costs for peatland rewetting (USD17MER per ha) i58_cost_drain_recur(t) Recurring costs for drained and managed peatlands (USD17MER per ha) - i58_cost_drain_intact_onetime(t) One-time costs for drainage of intact peatland (USD17MER per ha) - i58_cost_drain_rewet_onetime(t) One-time costs for drainage of rewetted peatland (USD17MER per ha) + i58_cost_onetime(t,cost58) One-time costs for peatland rewetting and drainage (USD17MER per ha) p58_availPeatlandExp(t,j) Available area for expansion of drained peatland (mio. ha) p58_availLandExp(t,j) Available area for expansion of managed land (mio. ha) i58_peatland_rewetting_fader(t_all) Temporal fader for exogenous peatland rewetting (1) diff --git a/modules/58_peatland/v2/equations.gms b/modules/58_peatland/v2/equations.gms index b55bc06ef4..865e9089e0 100644 --- a/modules/58_peatland/v2/equations.gms +++ b/modules/58_peatland/v2/equations.gms @@ -70,9 +70,7 @@ q58_peatland_cost_annuity(j2,cost58) .. v58_peatland_cost_annuity(j2,cost58) =g= - (- v58_peatlandChange(j2,"intact") * sum(ct, i58_cost_drain_intact_onetime(ct)))$sameas(cost58,"drain_intact") - + (- v58_peatlandChange(j2,"rewetted") * sum(ct, i58_cost_drain_rewet_onetime(ct)))$sameas(cost58,"drain_rewetted") - + (v58_peatlandChange(j2,"rewetted") * sum(ct, i58_cost_rewet_onetime(ct)))$sameas(cost58,"rewet") + sum(intact2cost(intact58,cost58), v58_peatlandChange(j2,intact58)) * sum(ct, i58_cost_onetime(ct,cost58)) * sum((cell(i2,j2),ct),pm_interest(ct,i2)/(1+pm_interest(ct,i2))); *' Detailed peatland GHG emissions diff --git a/modules/58_peatland/v2/presolve.gms b/modules/58_peatland/v2/presolve.gms index 6c8ec456b8..0231728617 100644 --- a/modules/58_peatland/v2/presolve.gms +++ b/modules/58_peatland/v2/presolve.gms @@ -26,9 +26,7 @@ if (m_year(t) <= s58_fix_peatland, i58_cost_rewet_recur(t) = 0; i58_cost_drain_recur(t) = 0; - i58_cost_drain_intact_onetime(t) = 0; - i58_cost_drain_rewet_onetime(t) = 0; - i58_cost_rewet_onetime(t) = 0; + i58_cost_onetime(t,cost58) = 0; * save area in reference period p58_peatland_ref(j,land58)$(m_year(t) = s58_fix_peatland) = pc58_peatland(j,land58); @@ -36,7 +34,7 @@ else * Define bounds and costs for peatland area after the year given by s58_fix_peatland v58_peatland.lo(j,land58) = 0; v58_peatland.l(j,land58) = pc58_peatland(j,land58); - v58_peatland.up(j,drained58) = Inf; + v58_peatland.up(j,drained58) = sum(land58, pc58_peatland(j,land58)); v58_peatland.up(j,"rewetted") = s58_rewetting_switch; v58_peatland.lo(j,"intact") = pc58_peatland(j,"intact") * i58_intact_protection_exo(j); v58_peatland.up(j,"intact") = pc58_peatland(j,"intact"); @@ -48,9 +46,9 @@ else i58_cost_rewet_recur(t) = s58_cost_rewet_recur; i58_cost_drain_recur(t) = s58_cost_drain_recur; - i58_cost_drain_intact_onetime(t) = s58_cost_drain_intact_onetime; - i58_cost_drain_rewet_onetime(t) = s58_cost_drain_rewet_onetime; - i58_cost_rewet_onetime(t) = s58_cost_rewet_onetime; + i58_cost_onetime(t,"drain_intact") = -s58_cost_drain_intact_onetime; + i58_cost_onetime(t,"drain_rewetted") = -s58_cost_drain_rewet_onetime; + i58_cost_onetime(t,"rewetted") = s58_cost_rewet_onetime; ); *' @code diff --git a/modules/58_peatland/v2/sets.gms b/modules/58_peatland/v2/sets.gms index 561c9bdb28..907ba019b2 100644 --- a/modules/58_peatland/v2/sets.gms +++ b/modules/58_peatland/v2/sets.gms @@ -16,20 +16,29 @@ sets manPeat58(land58) Drained and managed peatland categories / crop, past, forestry / + intact58(land58) intact and rewetted peatland categories + / intact, rewetted / + cost58 annunity cost categories - / drain_intact, drain_rewetted, rewet / + / drain_intact, drain_rewetted, rewetted / + + intact2cost(intact58,cost58) Mapping between intact58 and cost58 + / intact .(drain_intact) + rewetted .(drain_rewetted) + rewetted .(rewetted) / emis58 Wetland emission types / co2, doc, ch4, n2o / emisSub58(emis58) Wetland emission types - / co2, ch4, n2o / + / co2, doc, ch4, n2o / poll58(pollutants) Wetland emissions that can be taxed / co2_c, ch4, n2o_n_direct / emisSub58_to_poll58(emisSub58,poll58) Mapping / co2 .(co2_c) + doc .(co2_c) ch4 .(ch4) n2o .(n2o_n_direct) / From 60c56e40e751f8e6aeac657b63eea5e729bc2468 Mon Sep 17 00:00:00 2001 From: florianh Date: Sat, 23 Nov 2024 13:50:15 +0100 Subject: [PATCH 190/206] bugfix --- config/default.cfg | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/config/default.cfg b/config/default.cfg index 23a47c5b71..d17577c82b 100644 --- a/config/default.cfg +++ b/config/default.cfg @@ -1757,8 +1757,8 @@ cfg$gms$s58_cost_rewet_recur <- 37 # def = 30 * 1.23 # * One-time and recurring costs for peatland drainage (USD17MER per ha) # * One-time costs apply on the drainage of intact and rewetted peatland # * Recurring costs apply on the level of drained and managed peatland -cfg$gms$s58_cost_drain_intact_onetime <- 0 # def = 0 -cfg$gms$s58_cost_drain_rewet_onetime <- 1230 # def = 1230 +cfg$gms$s58_cost_drain_intact_onetime <- 1230 # def = 1230 +cfg$gms$s58_cost_drain_rewet_onetime <- 0 # def = 0 cfg$gms$s58_cost_drain_recur <- 0 # def = 0 # * Penalty for technical peatland balance term (USD17MER) From e993340ef2710e663c998f0e87e53ea368401958 Mon Sep 17 00:00:00 2001 From: florianh Date: Sun, 24 Nov 2024 16:45:12 +0100 Subject: [PATCH 191/206] bugfix removal grassland realisation --- CHANGELOG.md | 1 + modules/13_tc/endo_jan22/input.gms | 2 +- modules/13_tc/endo_jan22/preloop.gms | 2 +- modules/13_tc/endo_jan22/presolve.gms | 2 +- modules/13_tc/exo/input.gms | 2 +- modules/13_tc/exo/preloop.gms | 2 +- modules/31_past/endo_jun13/not_used.txt | 4 ---- modules/31_past/static/not_used.txt | 3 --- 8 files changed, 6 insertions(+), 12 deletions(-) delete mode 100644 modules/31_past/endo_jun13/not_used.txt diff --git a/CHANGELOG.md b/CHANGELOG.md index 650e9df00b..2ef775bf19 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -30,6 +30,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). ### removed - **31_past** removed `grasslands_apr22` realization +- **13_tau** removed interface `fm_pastr_tau_hist` ### fixed - **11_costs** changed equation to fix bug in total water cost calculation diff --git a/modules/13_tc/endo_jan22/input.gms b/modules/13_tc/endo_jan22/input.gms index f9a37ab622..b74ae99b53 100644 --- a/modules/13_tc/endo_jan22/input.gms +++ b/modules/13_tc/endo_jan22/input.gms @@ -45,7 +45,7 @@ $include "./modules/13_tc/input/f13_tau_historical.csv" $offdelim ; -table fm_pastr_tau_hist(t_all,h) Historical managed pasture tau (1) +table f13_pastr_tau_hist(t_all,h) Historical managed pasture tau (1) $ondelim $include "./modules/13_tc/input/f13_pastr_tau_hist.csv" $offdelim diff --git a/modules/13_tc/endo_jan22/preloop.gms b/modules/13_tc/endo_jan22/preloop.gms index b96d0b99a3..31cbb0fe18 100644 --- a/modules/13_tc/endo_jan22/preloop.gms +++ b/modules/13_tc/endo_jan22/preloop.gms @@ -16,5 +16,5 @@ loop(t, ); pcm_tau(h,"crop") = fm_tau1995(h); -pcm_tau(h,"pastr") = fm_pastr_tau_hist("y1995",h); +pcm_tau(h,"pastr") = f13_pastr_tau_hist("y1995",h); pc13_tcguess(h,tautype) = f13_tcguess(h); diff --git a/modules/13_tc/endo_jan22/presolve.gms b/modules/13_tc/endo_jan22/presolve.gms index f769dc97ba..9e37d6aae3 100644 --- a/modules/13_tc/endo_jan22/presolve.gms +++ b/modules/13_tc/endo_jan22/presolve.gms @@ -10,7 +10,7 @@ pc13_land(i,"pastr") = sum(cell(i,j),pcm_land(j,"past")); pc13_land(i,"crop") = sum(cell(i,j),pcm_land(j,"crop")); if (sum(sameas(t_past,t),1) = 1 AND s13_ignore_tau_historical = 0, - vm_tau.lo(h,"pastr") = fm_pastr_tau_hist(t,h); + vm_tau.lo(h,"pastr") = f13_pastr_tau_hist(t,h); vm_tau.lo(h,"crop") = f13_tau_historical(t,h); else vm_tau.lo(h, tautype) = pcm_tau(h, tautype); diff --git a/modules/13_tc/exo/input.gms b/modules/13_tc/exo/input.gms index f5743743e1..39b97b6336 100644 --- a/modules/13_tc/exo/input.gms +++ b/modules/13_tc/exo/input.gms @@ -34,7 +34,7 @@ $include "./modules/13_tc/input/f13_tau_scenario.csv" $offdelim ; -table fm_pastr_tau_hist(t_all,h) Historical managed pasture tau (1) +table f13_pastr_tau_hist(t_all,h) Historical managed pasture tau (1) $ondelim $include "./modules/13_tc/input/f13_pastr_tau_hist.csv" $offdelim diff --git a/modules/13_tc/exo/preloop.gms b/modules/13_tc/exo/preloop.gms index 6c62b24803..0d26231054 100644 --- a/modules/13_tc/exo/preloop.gms +++ b/modules/13_tc/exo/preloop.gms @@ -16,4 +16,4 @@ loop(t, ); pcm_tau(h,"crop") = fm_tau1995(h); -pcm_tau(h,"pastr") = fm_pastr_tau_hist("y1995",h); +pcm_tau(h,"pastr") = f13_pastr_tau_hist("y1995",h); diff --git a/modules/31_past/endo_jun13/not_used.txt b/modules/31_past/endo_jun13/not_used.txt deleted file mode 100644 index 2c2efa6670..0000000000 --- a/modules/31_past/endo_jun13/not_used.txt +++ /dev/null @@ -1,4 +0,0 @@ -name,type,reason -vm_tau,input,questionnaire -fm_pastr_tau_hist,input,questionnaire -sm_fix_cc, input, not needed diff --git a/modules/31_past/static/not_used.txt b/modules/31_past/static/not_used.txt index 6bd07855f0..3b1a814ba5 100644 --- a/modules/31_past/static/not_used.txt +++ b/modules/31_past/static/not_used.txt @@ -2,6 +2,3 @@ name,type,reason vm_prod, input, not needed vm_yld, input, not needed pm_land_conservation,input,questionnaire -vm_tau,input,questionnaire -fm_pastr_tau_hist,input,questionnaire -sm_fix_cc, input, not needed From c03a11422bb960303a375ad9b882cbbb5ef77fcd Mon Sep 17 00:00:00 2001 From: florianh Date: Mon, 25 Nov 2024 12:42:00 +0100 Subject: [PATCH 192/206] renamed mapping --- modules/58_peatland/v2/equations.gms | 2 +- modules/58_peatland/v2/sets.gms | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/modules/58_peatland/v2/equations.gms b/modules/58_peatland/v2/equations.gms index 865e9089e0..1b3117ae8e 100644 --- a/modules/58_peatland/v2/equations.gms +++ b/modules/58_peatland/v2/equations.gms @@ -70,7 +70,7 @@ q58_peatland_cost_annuity(j2,cost58) .. v58_peatland_cost_annuity(j2,cost58) =g= - sum(intact2cost(intact58,cost58), v58_peatlandChange(j2,intact58)) * sum(ct, i58_cost_onetime(ct,cost58)) + sum(map_cost58(intact58,cost58), v58_peatlandChange(j2,intact58)) * sum(ct, i58_cost_onetime(ct,cost58)) * sum((cell(i2,j2),ct),pm_interest(ct,i2)/(1+pm_interest(ct,i2))); *' Detailed peatland GHG emissions diff --git a/modules/58_peatland/v2/sets.gms b/modules/58_peatland/v2/sets.gms index 907ba019b2..74c3372d96 100644 --- a/modules/58_peatland/v2/sets.gms +++ b/modules/58_peatland/v2/sets.gms @@ -22,7 +22,7 @@ sets cost58 annunity cost categories / drain_intact, drain_rewetted, rewetted / - intact2cost(intact58,cost58) Mapping between intact58 and cost58 + map_cost58(intact58,cost58) Mapping between intact58 and cost58 / intact .(drain_intact) rewetted .(drain_rewetted) rewetted .(rewetted) / From 48f84f50f01d69555c991196a8c0203fc66634b6 Mon Sep 17 00:00:00 2001 From: florianh Date: Mon, 25 Nov 2024 13:01:47 +0100 Subject: [PATCH 193/206] update start script --- scripts/start/projects/paper_peatlandTax.R | 42 ++++++++++++++-------- 1 file changed, 27 insertions(+), 15 deletions(-) diff --git a/scripts/start/projects/paper_peatlandTax.R b/scripts/start/projects/paper_peatlandTax.R index 85e37353c1..c0ae8b6ad3 100644 --- a/scripts/start/projects/paper_peatlandTax.R +++ b/scripts/start/projects/paper_peatlandTax.R @@ -23,11 +23,10 @@ source("scripts/start_functions.R") source("config/default.cfg") # create additional information to describe the runs -cfg$info$flag <- "PTax45" +cfg$info$flag <- "PTax48" cfg$results_folder <- "output/:title:" cfg$results_folder_highres <- "output" -#cfg$output <- c(cfg$output, "extra/highres") cfg$force_replace <- TRUE cfg$force_download <- FALSE cfg$qos <- "standby_dayMax" @@ -51,7 +50,7 @@ calc_ghgprice <- function() { T0 <- read.magpie("modules/56_ghg_policy/input/f56_pollutant_prices.cs3") T0 <- collapseNames(T0[, , getNames(T0, dim = 2)[1]]) T0[, , ] <- 0 - + #T200 200 USD/tCO2 in 2050 T200 <- new.magpie(getRegions(T0), c(seq(1995, 2025, by = 5), 2050, 2100, 2150), getNames(T0), fill = 0) T200[, "y2025", "co2_c"] <- 0 @@ -64,13 +63,13 @@ calc_ghgprice <- function() { T200[, , "n2o_n_direct"] <- T200[, , "co2_c"] * 265 * 44 / 28 T200[, , "n2o_n_indirect"] <- T200[, , "co2_c"] * 265 * 44 / 28 T200[, , "co2_c"] <- T200[, , "co2_c"] * 44 / 12 - + T25 <- T200 * 0.125 T50 <- T200 * 0.25 T100 <- T200 * 0.5 T400 <- T200 * 2 T800 <- T200 * 4 - + GHG <- mbind( add_dimension(T0, dim = 3.2, add = "scen", nm = "T0-GHG"), add_dimension( @@ -110,16 +109,16 @@ calc_ghgprice <- function() { nm = "T800-GHG" ) ) - + CO2 <- GHG CO2[, , c("ch4", "n2o_n_direct", "n2o_n_indirect")] <- 0 getNames(CO2, dim = 2) <- gsub("GHG", "CO2", getNames(CO2, dim = 2)) - + GHGCH4GWP20 <- GHG GHGCH4GWP20[, , "ch4"] <- GHGCH4GWP20[, , "ch4"] / 28 * 84 getNames(GHGCH4GWP20, dim = 2) <- gsub("GHG", "GHG-GWP20", getNames(GHGCH4GWP20, dim = 2)) - + GHG <- mbind(CO2, GHG, GHGCH4GWP20) if (!dir.exists("./patch_inputdata")) dir.create("./patch_inputdata") @@ -129,7 +128,7 @@ calc_ghgprice <- function() { write.magpie(GHG, file_name = "patch_inputdata/patchGHGprices/f56_pollutant_prices.cs3") tardir("patch_inputdata/patchGHGprices", "patch_inputdata/patchGHGprices.tgz") - + unlink("patch_inputdata/patchGHGprices", recursive = TRUE) return(getNames(GHG, dim = 2)) } @@ -144,7 +143,6 @@ cfg$gms$c56_pollutant_prices_noselect <- "T0-CO2" cfg$gms$policy_countries56 <- isoCountriesEUR cfg$gms$policy_countries58 <- isoCountriesEUR cfg$gms$c56_emis_policy <- "sdp_peatland" -cfg$gms$factor_costs <- "sticky_feb18" cfg$gms$s56_c_price_induced_aff <- 0 ## Start scenarios @@ -197,28 +195,42 @@ for (tax in c("T0-CO2", cfg$title <- .title(cfg, paste(ssp, tax, sep = "-")) cfg$gms$c56_mute_ghgprices_until <- "y2025" cfg$gms$c56_pollutant_prices <- tax - cfg$gms$s58_intact_prot_exo <- 1 start_run(cfg, codeCheck = FALSE) } ## Exo rewet scenarios -cfg$title <- .title(cfg, paste(ssp, "NRL33", sep = "-")) +# 15% of currently drained peatland rewetted by 2050 (0.3 * 0.5) +cfg$title <- .title(cfg, paste(ssp, "NRL15", sep = "-")) cfg$gms$c56_mute_ghgprices_until <- "y2150" cfg$gms$c56_pollutant_prices <- "T0-CO2" -cfg$gms$s58_rewetting_exo <- 0.33 +cfg$gms$s58_rewetting_exo <- 0.3 +cfg$gms$s58_rewet_exo_target_value <- 0.5 cfg$gms$s58_intact_prot_exo <- 1 start_run(cfg, codeCheck = FALSE) -cfg$title <- .title(cfg, paste(ssp, "NRL50", sep = "-")) +# 25% of currently drained peatland rewetted by 2050 (0.5 * 0.5) +cfg$title <- .title(cfg, paste(ssp, "NRL25", sep = "-")) cfg$gms$c56_mute_ghgprices_until <- "y2150" cfg$gms$c56_pollutant_prices <- "T0-CO2" cfg$gms$s58_rewetting_exo <- 0.5 +cfg$gms$s58_rewet_exo_target_value <- 0.5 cfg$gms$s58_intact_prot_exo <- 1 start_run(cfg, codeCheck = FALSE) -cfg$title <- .title(cfg, paste(ssp, "NRL100", sep = "-")) +# 50% of currently drained peatland rewetted by 2050 (1 * 0.5) +cfg$title <- .title(cfg, paste(ssp, "NRL50", sep = "-")) cfg$gms$c56_mute_ghgprices_until <- "y2150" cfg$gms$c56_pollutant_prices <- "T0-CO2" cfg$gms$s58_rewetting_exo <- 1 +cfg$gms$s58_rewet_exo_target_value <- 0.5 +cfg$gms$s58_intact_prot_exo <- 1 +start_run(cfg, codeCheck = FALSE) + +# 100% of currently drained peatland rewetted by 2050 (2 * 0.5) +cfg$title <- .title(cfg, paste(ssp, "NRL100", sep = "-")) +cfg$gms$c56_mute_ghgprices_until <- "y2150" +cfg$gms$c56_pollutant_prices <- "T0-CO2" +cfg$gms$s58_rewetting_exo <- 2 +cfg$gms$s58_rewet_exo_target_value <- 0.5 cfg$gms$s58_intact_prot_exo <- 1 start_run(cfg, codeCheck = FALSE) From c49c11ff484f2661acdea0810fbe2cb9cfa49651 Mon Sep 17 00:00:00 2001 From: florianh Date: Fri, 29 Nov 2024 11:00:09 +0100 Subject: [PATCH 194/206] bugfix fader --- CHANGELOG.md | 1 + modules/56_ghg_policy/price_aug22/preloop.gms | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 4b8ebe68ef..eff26e9489 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -42,6 +42,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). - **10_land** Simplified land transition matrix for improved feasibility - **44_biodiversity** bugfix biorealm_biome.cs3 in input data (shares did not add-up to 1) - **config** additional data increased to `additional_data_rev4.58.tgz` which fixes missing gdp2017 conversions in f20_processing_unitcosts +- **56_ghg_policy** Fader for GHG emission pricing policy ## [4.8.2] - 2024-09-24 diff --git a/modules/56_ghg_policy/price_aug22/preloop.gms b/modules/56_ghg_policy/price_aug22/preloop.gms index 460c233115..247128c527 100644 --- a/modules/56_ghg_policy/price_aug22/preloop.gms +++ b/modules/56_ghg_policy/price_aug22/preloop.gms @@ -69,9 +69,9 @@ im_pollutant_prices(t_all,i,"co2_c",emis_source) = im_pollutant_prices(t_all,i," im_pollutant_prices(t_all,i,pollutants,emis_source)$(s56_ghgprice_devstate_scaling = 1) = im_pollutant_prices(t_all,i,pollutants,emis_source)*im_development_state(t_all,i); if (s56_fader_functional_form = 1, - m_linear_time_interpol(p56_fader,s56_fader_start,s56_fader_target,0,s56_fader_target); + m_linear_time_interpol(p56_fader,s56_fader_start,s56_fader_end,0,s56_fader_target); elseif s56_fader_functional_form = 2, - m_sigmoid_time_interpol(p56_fader,s56_fader_start,s56_fader_target,0,s56_fader_target); + m_sigmoid_time_interpol(p56_fader,s56_fader_start,s56_fader_end,0,s56_fader_target); ); ***build and apply temporal fader for GHG policy From c0d3d3f5b22005ae8d73786d5275387280994bbf Mon Sep 17 00:00:00 2001 From: florianh Date: Fri, 29 Nov 2024 16:06:38 +0100 Subject: [PATCH 195/206] update fader default --- config/default.cfg | 2 +- modules/56_ghg_policy/price_aug22/input.gms | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/config/default.cfg b/config/default.cfg index d17577c82b..faafe8d480 100644 --- a/config/default.cfg +++ b/config/default.cfg @@ -1513,7 +1513,7 @@ cfg$gms$s56_ghgprice_fader <- 0 # def = 0 # * Pollutants on which the GHG policy fader will applied cfg$gms$pollutants_fader <- c("co2_c", "ch4", "n2o_n_direct", "n2o_n_indirect", "nh3_n", "no2_n", "no3_n") # def = all pollutants # * Start year of GHG policy fade-in -cfg$gms$s56_fader_start <- 2030 # def = 2030 +cfg$gms$s56_fader_start <- 2025 # def = 2025 # * End year of GHG policy fade-in cfg$gms$s56_fader_end <- 2050 # def = 2050 # * Target value of GHG policy fade-in in end year diff --git a/modules/56_ghg_policy/price_aug22/input.gms b/modules/56_ghg_policy/price_aug22/input.gms index fefaeaa640..b2a8398df1 100644 --- a/modules/56_ghg_policy/price_aug22/input.gms +++ b/modules/56_ghg_policy/price_aug22/input.gms @@ -78,7 +78,7 @@ scalars s56_timesteps Number of time steps for C price interpolation (1) / 0 / s56_offset Helper for C price interpolation (1) / 0 / s56_ghgprice_fader Switch for GHG policy fader (1=on 0=off) / 0 / - s56_fader_start Start year of GHG policy fade-in (1) / 2030 / + s56_fader_start Start year of GHG policy fade-in (1) / 2025 / s56_fader_end End year of GHG policy fade-in (1) / 2050 / s56_fader_target Target value of GHG policy fade-in in end year / 1 / s56_fader_functional_form Switch for functional form of GHG policy fader (1=linear 2=sigmoid) / 1 / From 711f9c28d1061c96d8708f4d63697c21a9d67ddb Mon Sep 17 00:00:00 2001 From: florianh Date: Mon, 2 Dec 2024 09:38:29 +0100 Subject: [PATCH 196/206] update magpie4 version --- DESCRIPTION | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/DESCRIPTION b/DESCRIPTION index 3e5397a00b..c96ed5b726 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -21,14 +21,14 @@ Imports: m4fsdp, madrat, magclass (>= 6.14.0), - magpie4 (>= 2.15.6), + magpie4 (>= 2.15.8), MagpieNCGains, magpiesets (>= 0.46.1), mip, mrcommons, patchwork, piamenv (>= 0.5.5), - piamInterfaces (>= 0.36.9), + piamInterfaces (>= 0.37.1), piamutils, quitte, raster, From 93403494b2cda970cd1fe2c4f257234cdde1881a Mon Sep 17 00:00:00 2001 From: florianh Date: Mon, 2 Dec 2024 12:57:25 +0100 Subject: [PATCH 197/206] bugfix timber config --- CHANGELOG.md | 1 + config/default.cfg | 19 +++++++------------ modules/58_peatland/v2/input.gms | 2 +- modules/73_timber/default/input.gms | 2 +- 4 files changed, 10 insertions(+), 14 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index eff26e9489..0ca7a9c1d7 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -43,6 +43,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). - **44_biodiversity** bugfix biorealm_biome.cs3 in input data (shares did not add-up to 1) - **config** additional data increased to `additional_data_rev4.58.tgz` which fixes missing gdp2017 conversions in f20_processing_unitcosts - **56_ghg_policy** Fader for GHG emission pricing policy +- **config** settings in default.cfg for some switches in `73_timber` did not work correctly ## [4.8.2] - 2024-09-24 diff --git a/config/default.cfg b/config/default.cfg index faafe8d480..e87cb942bf 100644 --- a/config/default.cfg +++ b/config/default.cfg @@ -2022,25 +2022,20 @@ cfg$gms$timber <- "default" # def = default # (implicitly assuming the same rate for plantation harvest and establishment). # * 1=on # * 0=off -cfg$gms$s73_timber_demand_switch <- 1 # def = 1 +cfg$gms$s73_timber_demand_switch <- 1 # def = 1 -# harvesting cost per ton of dry matter produced (USD17MER/tDM) +# harvesting cost of industrial roundwood per ton of dry matter produced (USD17MER/tDM) # * (inflated from default originally in USD05 using USD05 --> USD17 inflation rate: 1.23) -s73_timber_prod_cost <- 2460 # def = 2000 * 1.23 +cfg$gms$s73_timber_prod_cost_wood <- 148 # def = 120 * 1.23 -# harvesting cost per ha of forests (USD17MER/ha) +# harvesting cost of woodfuel per ton of dry matter produced (USD17MER/tDM) # * (inflated from default originally in USD05 using USD05 --> USD17 inflation rate: 1.23) -s73_timber_harvest_cost <- 2460 # def = 2000 * 1.23 - -# Cost multiplier for harvesting costs to make natural vegetation harvest expensive -# than timber plantation harvest. This provides a signal to the model to harvest -# timber plantations first. -s73_cost_multiplier <- 1.5 # def = 1.5 +cfg$gms$s73_timber_prod_cost_woodfuel <- 74 # def = 60 * 1.23 # Cost of production without using any land in case the model is running into infeasibilities. -# This is a last ditch effort for the model and the variable associated with this cost +# This is a last ditch effort for the model and the slack variable associated with this cost # should not be used in a normally feasible model run (USD17MER/tDM) -s73_free_prod_cost <- 1000000 # def = 1000000 +cfg$gms$s73_free_prod_cost <- 1000000 # def = 1000000 # Switch for modifying woody biomass demand starting in 2035 # * ("default") = Default paper demand diff --git a/modules/58_peatland/v2/input.gms b/modules/58_peatland/v2/input.gms index 2c570b4383..2f1c3ea4d9 100644 --- a/modules/58_peatland/v2/input.gms +++ b/modules/58_peatland/v2/input.gms @@ -9,7 +9,7 @@ scalars s58_cost_rewet_recur Recurring costs for rewetted peatland (USD17MER per ha) / 37 / s58_cost_rewet_onetime One-time costs for peatland rewetting (USD17MER per ha) / 1230 / s58_cost_drain_recur Recurring costs for drained and managed peatlands (USD17MER per ha) / 0 / - s58_cost_drain_intact_onetime One-time costs for drainage of intact peatland (USD17MER per ha) / 0 / + s58_cost_drain_intact_onetime One-time costs for drainage of intact peatland (USD17MER per ha) / 1230 / s58_cost_drain_rewet_onetime One-time costs for drainage of rewetted peatland (USD17MER per ha) / 0 / s58_rewetting_switch Peatland rewetting on (Inf) or off (0) / Inf / s58_fix_peatland Year indicating until when peatland area should be fixed (year) / 2020 / diff --git a/modules/73_timber/default/input.gms b/modules/73_timber/default/input.gms index 2e2f7d9356..50c4676f57 100644 --- a/modules/73_timber/default/input.gms +++ b/modules/73_timber/default/input.gms @@ -18,7 +18,7 @@ scalars * inflated using USD05 --> USD17 rate of 1.23 s73_timber_prod_cost_wood Cost for producing one unit of wood (USD17MER per tDM) / 148 / s73_timber_prod_cost_woodfuel Cost for prodcing one unit of woodfuel (USD17MER per tDM) / 74 / - s73_free_prod_cost Very high cost for settling demand without production (USD17MER per tDM) / 24600 / + s73_free_prod_cost Very high cost for settling demand without production (USD17MER per tDM) / 1e+06 / s73_timber_demand_switch Logical switch to turn on or off timber demand 1=on 0=off (1) / 1 / s73_increase_ceiling Limiter for not allowing a demand jump between time steps beyond a certain limit (1) / 1.025 / s73_residue_ratio Proportion of overall industrial roundwood production which ends up as residue during harvest (1) / 0.15 / From 2f1efb91c5ec0d871b2c46e1f6e12113bf015122 Mon Sep 17 00:00:00 2001 From: mishkos <32301623+mishkos@users.noreply.github.com> Date: Mon, 2 Dec 2024 13:02:36 +0100 Subject: [PATCH 198/206] Update default.cfg new additional_data version with upgraded npi_ndc policy settings. --- config/default.cfg | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config/default.cfg b/config/default.cfg index e87cb942bf..4ce56bdef9 100644 --- a/config/default.cfg +++ b/config/default.cfg @@ -25,7 +25,7 @@ cfg$model <- "main.gms" #def = "main.gms" cfg$input <- c(regional = "rev4.116_h12_magpie.tgz", cellular = "rev4.116_h12_fd712c0b_cellularmagpie_c200_MRI-ESM2-0-ssp370_lpjml-8e6c5eb1.tgz", validation = "rev4.116_h12_validation.tgz", - additional = "additional_data_rev4.58.tgz", + additional = "additional_data_rev4.59.tgz", calibration = "calibration_H12_27Sep24.tgz") # NOTE: It is recommended to recalibrate the model when changing cellular input data From adc36ccf9a63c674d016924aa3aa0c40cebe0c5a Mon Sep 17 00:00:00 2001 From: mishkos <32301623+mishkos@users.noreply.github.com> Date: Mon, 2 Dec 2024 13:04:06 +0100 Subject: [PATCH 199/206] Update start_npi_ndc.R syncing npi and ndc policies to year 2025. --- scripts/npi_ndc/start_npi_ndc.R | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/scripts/npi_ndc/start_npi_ndc.R b/scripts/npi_ndc/start_npi_ndc.R index 68ecf70a37..6cd0d67e72 100644 --- a/scripts/npi_ndc/start_npi_ndc.R +++ b/scripts/npi_ndc/start_npi_ndc.R @@ -121,8 +121,8 @@ calc_NPI_NDC <- function(policyregions = "iso", map_file=map_file) getNames(ndc_ad) <- "ndc.forest" #Set all values before 2015 to NPI values; copy the values til 2010 from the NPI data - ndc_ad[,which(getYears(ndc_ad,as.integer=TRUE)<=2020),] <- - npi_ad[,which(getYears(npi_ad,as.integer=TRUE)<=2020),] + ndc_ad[,which(getYears(ndc_ad,as.integer=TRUE)<=2025),] <- + npi_ad[,which(getYears(npi_ad,as.integer=TRUE)<=2025),] cat(paste0(" (time elapsed: ",format(proc.time()["elapsed"]-ptm,width=6,nsmall=2,digits=2),"s)\n")) @@ -155,8 +155,8 @@ calc_NPI_NDC <- function(policyregions = "iso", pol_mapping=pol_mapping, map_file=map_file) getNames(ndc_aolc) <- "ndc.other" #Set all values before 2015 to NPI values; copy the values til 2010 from the NPI data - ndc_aolc[,which(getYears(ndc_aolc,as.integer=TRUE)<=2020),] <- - npi_aolc[,which(getYears(npi_aolc,as.integer=TRUE)<=2020),] + ndc_aolc[,which(getYears(ndc_aolc,as.integer=TRUE)<=2025),] <- + npi_aolc[,which(getYears(npi_aolc,as.integer=TRUE)<=2025),] #write AD and AOLC policies together none_ad_aolc_pol <- mbind(npi_ad,npi_aolc) @@ -199,8 +199,8 @@ calc_NPI_NDC <- function(policyregions = "iso", map_file=map_file) getNames(ndc_aff) <- "ndc" #set all values before 2015 to NPI values; copy the values til 2010 from the NPI data - ndc_aff[,which(getYears(ndc_aff,as.integer=TRUE)<=2020),] <- - npi_aff[,which(getYears(npi_aff,as.integer=TRUE)<=2020),] + ndc_aff[,which(getYears(ndc_aff,as.integer=TRUE)<=2025),] <- + npi_aff[,which(getYears(npi_aff,as.integer=TRUE)<=2025),] #write AFF policies none_aff_pol <- npi_aff From 9e79cb7497fba0a47c1d82bb80032bb0532b6b4e Mon Sep 17 00:00:00 2001 From: mishkos <32301623+mishkos@users.noreply.github.com> Date: Mon, 2 Dec 2024 13:06:48 +0100 Subject: [PATCH 200/206] Update CHANGELOG.md --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 0ca7a9c1d7..23a5c8f529 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -19,6 +19,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). - **modules** update of scaling factors in several modules - **scripts** renamed disaggregation_mrdownscale.R -> mrdownscale_LUH2.R - **config** default for `c60_bioenergy_subsidy` changed from 369 to 246 USD17MER per ton +- **scripts** NPI/NDC policies synced to the year 2025 ### added - **62_material** added switch to turn off future material demand for bioplastic From 87428b99fd487bd15984f3ef3f74d6a36a3e6e51 Mon Sep 17 00:00:00 2001 From: florianh Date: Mon, 2 Dec 2024 13:34:24 +0100 Subject: [PATCH 201/206] additional_data_rev4.59.tgz --- CHANGELOG.md | 2 +- config/projects/scenario_config_fsec.csv | 2 +- main.gms | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 23a5c8f529..8590c01286 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -19,7 +19,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). - **modules** update of scaling factors in several modules - **scripts** renamed disaggregation_mrdownscale.R -> mrdownscale_LUH2.R - **config** default for `c60_bioenergy_subsidy` changed from 369 to 246 USD17MER per ton -- **scripts** NPI/NDC policies synced to the year 2025 +- **scripts** NPI/NDC policies synced to the year 2025 - update of additional data to `additional_data_rev4.59.tgz` ### added - **62_material** added switch to turn off future material demand for bioplastic diff --git a/config/projects/scenario_config_fsec.csv b/config/projects/scenario_config_fsec.csv index 9967f88400..c830f7fed0 100644 --- a/config/projects/scenario_config_fsec.csv +++ b/config/projects/scenario_config_fsec.csv @@ -79,6 +79,6 @@ gms$c73_build_demand;;;;;;;;;;;;;;;;;;;;;;;;50pc;;;;;;;;;;;;;;;;;;;;;;;;;;; input['cellular'];rev4.116_FSEC_3c888fa5_cellularmagpie_c200_MRI-ESM2-0-ssp460_lpjml-8e6c5eb1.tgz;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;rev4.116_FSEC_0bd54110_cellularmagpie_c200_MRI-ESM2-0-ssp119_lpjml-8e6c5eb1.tgz;rev4.116_FSEC_6819938d_cellularmagpie_c200_MRI-ESM2-0-ssp126_lpjml-8e6c5eb1.tgz;;rev4.116_FSEC_1b5c3817_cellularmagpie_c200_MRI-ESM2-0-ssp245_lpjml-8e6c5eb1.tgz;rev4.116_FSEC_3c888fa5_cellularmagpie_c200_MRI-ESM2-0-ssp460_lpjml-8e6c5eb1.tgz;rev4.116_FSEC_fd712c0b_cellularmagpie_c200_MRI-ESM2-0-ssp370_lpjml-8e6c5eb1.tgz;rev4.116_FSEC_09a63995_cellularmagpie_c200_MRI-ESM2-0-ssp585_lpjml-8e6c5eb1.tgz;;; input['regional'];rev4.116_FSEC_magpie.tgz;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; input['validation'];rev4.116_FSEC_validation.tgz;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -input['additional'];additional_data_rev4.58.tgz;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +input['additional'];additional_data_rev4.59.tgz;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; input['calibration'];calibration_FSEC_19Nov24.tgz;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; magicc_emis_scen;bjoernAR6_C_SSP2-NDC.mif;;;bjoernAR6_C_SSP2-PkBudg900.mif;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;bjoernAR6_C_SSP1-NDC.mif;;;;;;;;;;;;bjoernAR6_C_RemSDP-900-MagSSP1.mif;; diff --git a/main.gms b/main.gms index 3a47f34650..9b70d4a2ed 100644 --- a/main.gms +++ b/main.gms @@ -160,7 +160,7 @@ $title magpie * md5sum: NA * Repository: https://rse.pik-potsdam.de/data/magpie/public * -* Used data set: additional_data_rev4.58.tgz +* Used data set: additional_data_rev4.59.tgz * md5sum: NA * Repository: https://rse.pik-potsdam.de/data/magpie/public * From 41624b575a4c2afba00a7f13a908025b7a949a88 Mon Sep 17 00:00:00 2001 From: florianh Date: Mon, 2 Dec 2024 15:15:48 +0100 Subject: [PATCH 202/206] bugfix vm_carbon_stock.l in equations --- CHANGELOG.md | 1 + modules/44_biodiversity/bv_btc_mar21/declarations.gms | 1 + modules/44_biodiversity/bv_btc_mar21/equations.gms | 2 +- modules/44_biodiversity/bv_btc_mar21/postsolve.gms | 2 ++ modules/44_biodiversity/bv_btc_mar21/preloop.gms | 2 +- modules/52_carbon/normal_dec17/equations.gms | 2 +- modules/56_ghg_policy/price_aug22/declarations.gms | 1 + modules/56_ghg_policy/price_aug22/equations.gms | 2 +- modules/56_ghg_policy/price_aug22/postsolve.gms | 2 ++ modules/56_ghg_policy/price_aug22/preloop.gms | 3 ++- modules/59_som/cellpool_aug16/preloop.gms | 6 ++++-- modules/59_som/cellpool_jan23/preloop.gms | 6 ++++-- modules/59_som/static_jan19/preloop.gms | 4 ++-- 13 files changed, 23 insertions(+), 11 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 8590c01286..45b75328de 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -29,6 +29,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). - **32_forestry** added option s32_npi_ndc_reversal - **35_natveg** added option s35_npi_ndc_reversal - **58_peatland** added option for exogenous peatland rewetting +- **56_ghg_policy** added new interface pcm_carbon_stock to avoid use of vm_carbon_stock.l in equations ### removed - **31_past** removed `grasslands_apr22` realization diff --git a/modules/44_biodiversity/bv_btc_mar21/declarations.gms b/modules/44_biodiversity/bv_btc_mar21/declarations.gms index 37dbf62bdc..8863193b89 100644 --- a/modules/44_biodiversity/bv_btc_mar21/declarations.gms +++ b/modules/44_biodiversity/bv_btc_mar21/declarations.gms @@ -7,6 +7,7 @@ parameters p44_price_bv_loss(t_all) Price (subsidy) for biodiversity stock loss (gain) (USD17MER per ha) + pc44_bv_weighted(j) Range-rarity weighted biodiversity stock (Mha) ; variables diff --git a/modules/44_biodiversity/bv_btc_mar21/equations.gms b/modules/44_biodiversity/bv_btc_mar21/equations.gms index 9e63f8b295..c035c49c5c 100644 --- a/modules/44_biodiversity/bv_btc_mar21/equations.gms +++ b/modules/44_biodiversity/bv_btc_mar21/equations.gms @@ -15,7 +15,7 @@ *' Change in biodiversity stock compared to previous time step, divided by time step length. q44_bv_loss(j2) .. v44_bv_loss(j2) =e= - (v44_bv_weighted.l(j2) - v44_bv_weighted(j2))/m_timestep_length; + (pc44_bv_weighted(j2) - v44_bv_weighted(j2))/m_timestep_length; *' Biodiversity stock weighted by range-rarity restoration prioritization layer (`f44_rr_layer`) q44_bv_weighted(j2) .. v44_bv_weighted(j2) diff --git a/modules/44_biodiversity/bv_btc_mar21/postsolve.gms b/modules/44_biodiversity/bv_btc_mar21/postsolve.gms index 33256efc86..b800f0ff71 100644 --- a/modules/44_biodiversity/bv_btc_mar21/postsolve.gms +++ b/modules/44_biodiversity/bv_btc_mar21/postsolve.gms @@ -5,6 +5,8 @@ *** | MAgPIE License Exception, version 1.0 (see LICENSE file). *** | Contact: magpie@pik-potsdam.de +pc44_bv_weighted(j) = v44_bv_weighted.l(j) + *#################### R SECTION START (OUTPUT DEFINITIONS) ##################### ov44_bv_loss(t,j,"marginal") = v44_bv_loss.m(j); ov_cost_bv_loss(t,j,"marginal") = vm_cost_bv_loss.m(j); diff --git a/modules/44_biodiversity/bv_btc_mar21/preloop.gms b/modules/44_biodiversity/bv_btc_mar21/preloop.gms index fdf1d31b12..7606b7d46d 100644 --- a/modules/44_biodiversity/bv_btc_mar21/preloop.gms +++ b/modules/44_biodiversity/bv_btc_mar21/preloop.gms @@ -5,7 +5,7 @@ *** | MAgPIE License Exception, version 1.0 (see LICENSE file). *** | Contact: magpie@pik-potsdam.de -v44_bv_weighted.l(j) = 0.3; +pc44_bv_weighted(j) = 0.3; m_linear_time_interpol(p44_price_bv_loss,s44_start_year,s44_target_year,s44_start_price,s44_target_price); p44_price_bv_loss(t_all)$(m_year(t_all) < s44_start_year) = 0; display p44_price_bv_loss; diff --git a/modules/52_carbon/normal_dec17/equations.gms b/modules/52_carbon/normal_dec17/equations.gms index af3515e047..056d6bfbd4 100644 --- a/modules/52_carbon/normal_dec17/equations.gms +++ b/modules/52_carbon/normal_dec17/equations.gms @@ -16,4 +16,4 @@ q52_emis_co2_actual(i2,emis_oneoff) .. vm_emissions_reg(i2,emis_oneoff,"co2_c") =e= sum((cell(i2,j2),emis_land(emis_oneoff,land,c_pools)), - (vm_carbon_stock.l(j2,land,c_pools,"actual") - vm_carbon_stock(j2,land,c_pools,"actual"))/m_timestep_length); + (pcm_carbon_stock(j2,land,c_pools,"actual") - vm_carbon_stock(j2,land,c_pools,"actual"))/m_timestep_length); diff --git a/modules/56_ghg_policy/price_aug22/declarations.gms b/modules/56_ghg_policy/price_aug22/declarations.gms index 2c10d62171..93a708ff16 100644 --- a/modules/56_ghg_policy/price_aug22/declarations.gms +++ b/modules/56_ghg_policy/price_aug22/declarations.gms @@ -16,6 +16,7 @@ parameters p56_country_dummy2(iso) Dummy parameter indicating whether country is affected by selected GHG policy fader (1) p56_fader(t_all) GHG policy fader (1) p56_fader_reg(t_all,i) Regional GHG policy fader (1) + pcm_carbon_stock(j,land,c_pools,stockType) Carbon stock in vegetation soil and litter for different land types (mio. tC) ; equations diff --git a/modules/56_ghg_policy/price_aug22/equations.gms b/modules/56_ghg_policy/price_aug22/equations.gms index 00555e1d33..97bf20ea22 100644 --- a/modules/56_ghg_policy/price_aug22/equations.gms +++ b/modules/56_ghg_policy/price_aug22/equations.gms @@ -19,7 +19,7 @@ q56_emis_pricing_co2(i2,emis_oneoff) .. v56_emis_pricing(i2,emis_oneoff,"co2_c") =e= sum((cell(i2,j2),emis_land(emis_oneoff,land,c_pools)), - (vm_carbon_stock.l(j2,land,c_pools,"actual") - vm_carbon_stock(j2,land,c_pools,"%c56_carbon_stock_pricing%"))/m_timestep_length); + (pcm_carbon_stock(j2,land,c_pools,"actual") - vm_carbon_stock(j2,land,c_pools,"%c56_carbon_stock_pricing%"))/m_timestep_length); *** Emission costs diff --git a/modules/56_ghg_policy/price_aug22/postsolve.gms b/modules/56_ghg_policy/price_aug22/postsolve.gms index f17662cdce..a1a4a4a9ce 100644 --- a/modules/56_ghg_policy/price_aug22/postsolve.gms +++ b/modules/56_ghg_policy/price_aug22/postsolve.gms @@ -5,6 +5,8 @@ *** | MAgPIE License Exception, version 1.0 (see LICENSE file). *** | Contact: magpie@pik-potsdam.de +pcm_carbon_stock(j,land,ag_pools,stockType) = vm_carbon_stock.l(j,land,ag_pools,stockType); + *#################### R SECTION START (OUTPUT DEFINITIONS) ##################### ov_carbon_stock(t,j,land,c_pools,stockType,"marginal") = vm_carbon_stock.m(j,land,c_pools,stockType); ov_emission_costs(t,i,"marginal") = vm_emission_costs.m(i); diff --git a/modules/56_ghg_policy/price_aug22/preloop.gms b/modules/56_ghg_policy/price_aug22/preloop.gms index 247128c527..fed1fc18ef 100644 --- a/modules/56_ghg_policy/price_aug22/preloop.gms +++ b/modules/56_ghg_policy/price_aug22/preloop.gms @@ -7,7 +7,8 @@ * starting value of above ground carbon stocks 1995 is only an estimate. * ATTENTION: emissions in 1995 are not meaningful -vm_carbon_stock.l(j,land,ag_pools,stockType) = fm_carbon_density("y1995",j,land,ag_pools)*pcm_land(j,land); +pcm_carbon_stock(j,land,ag_pools,stockType) = fm_carbon_density("y1995",j,land,ag_pools)*pcm_land(j,land); +vm_carbon_stock.l(j,land,ag_pools,stockType) = pcm_carbon_stock(j,land,ag_pools,stockType); v56_emis_pricing.fx(i,emis_oneoff,pollutants)$(not sameas(pollutants,"co2_c")) = 0; diff --git a/modules/59_som/cellpool_aug16/preloop.gms b/modules/59_som/cellpool_aug16/preloop.gms index a2625bdf21..a006b92294 100644 --- a/modules/59_som/cellpool_aug16/preloop.gms +++ b/modules/59_som/cellpool_aug16/preloop.gms @@ -27,10 +27,12 @@ pc59_som_pool(j,noncropland59) = * starting value of carbon stocks 1995 is only an estimate. * ATTENTION: emissions in 1995 are not meaningful -vm_carbon_stock.l(j,"crop","soilc",stockType) = +pcm_carbon_stock(j,"crop","soilc",stockType) = pc59_som_pool(j,"crop") + i59_subsoilc_density("y1995",j) * pm_land_start(j,"crop"); -vm_carbon_stock.l(j,noncropland59,"soilc",stockType) = +vm_carbon_stock.l(j,"crop","soilc",stockType) = pcm_carbon_stock(j,"crop","soilc",stockType); +pcm_carbon_stock(j,noncropland59,"soilc",stockType) = fm_carbon_density("y1995",j,noncropland59,"soilc") * pm_land_start(j,noncropland59); +vm_carbon_stock.l(j,noncropland59,"soilc",stockType) = pcm_carbon_stock(j,noncropland59,"soilc",stockType); ***************************** *** cshare calculation *** diff --git a/modules/59_som/cellpool_jan23/preloop.gms b/modules/59_som/cellpool_jan23/preloop.gms index 8393b1f201..d919df335b 100644 --- a/modules/59_som/cellpool_jan23/preloop.gms +++ b/modules/59_som/cellpool_jan23/preloop.gms @@ -27,10 +27,12 @@ pc59_som_pool(j,noncropland59) = * starting value of carbon stocks 1995 is only an estimate. * ATTENTION: emissions in 1995 are not meaningful -vm_carbon_stock.l(j,"crop","soilc",stockType) = +pcm_carbon_stock(j,"crop","soilc",stockType) = pc59_som_pool(j,"crop") + i59_subsoilc_density("y1995",j) * pm_land_start(j,"crop"); -vm_carbon_stock.l(j,noncropland59,"soilc",stockType) = +vm_carbon_stock.l(j,"crop","soilc",stockType) = pcm_carbon_stock(j,"crop","soilc",stockType); +pcm_carbon_stock(j,noncropland59,"soilc",stockType) = fm_carbon_density("y1995",j,noncropland59,"soilc") * pm_land_start(j,noncropland59); +vm_carbon_stock.l(j,noncropland59,"soilc",stockType) = pcm_carbon_stock(j,noncropland59,"soilc",stockType); ***************************** *** cshare calculation *** diff --git a/modules/59_som/static_jan19/preloop.gms b/modules/59_som/static_jan19/preloop.gms index a0c6694ddd..d79a616ac2 100644 --- a/modules/59_som/static_jan19/preloop.gms +++ b/modules/59_som/static_jan19/preloop.gms @@ -8,8 +8,8 @@ * starting value of carbon stocks 1995 is only an estimate. * ATTENTION: emissions in 1995 are not meaningful -vm_carbon_stock.l(j,land,"soilc","actual") = fm_carbon_density("y1995",j,land,"soilc") * pcm_land(j,land); -*pcm_carbon_stock(j,land,"soilc") = vm_carbon_stock.l(j,land,"soilc"); +pcm_carbon_stock(j,land,"soilc","actual") = fm_carbon_density("y1995",j,land,"soilc") * pcm_land(j,land); +vm_carbon_stock.l(j,land,"soilc","actual") = pcm_carbon_stock(j,land,"soilc","actual"); * Soilc is not different for all non cropland vegetated land types * No age-class soil carbon density distribution is nessessary From f5e1215c7e84c41a4d7ce2437fb962f13a7f8917 Mon Sep 17 00:00:00 2001 From: florianh Date: Mon, 2 Dec 2024 15:19:02 +0100 Subject: [PATCH 203/206] renamed _country_dummy to _country_switch in all modules --- .../select_apr20/declarations.gms | 2 +- .../12_interest_rate/select_apr20/preloop.gms | 6 +++--- .../15_food/anthro_iso_jun22/declarations.gms | 2 +- modules/15_food/anthro_iso_jun22/preloop.gms | 20 +++++++++---------- modules/15_food/anthro_iso_jun22/presolve.gms | 16 +++++++-------- .../anthropometrics_jan18/declarations.gms | 2 +- .../15_food/anthropometrics_jan18/preloop.gms | 6 +++--- .../anthropometrics_jan18/presolve.gms | 16 +++++++-------- .../area_based_apr22/declarations.gms | 2 +- .../area_based_apr22/preloop.gms | 6 +++--- .../29_cropland/detail_apr24/declarations.gms | 2 +- modules/29_cropland/detail_apr24/preloop.gms | 6 +++--- .../29_cropland/simple_apr24/declarations.gms | 2 +- modules/29_cropland/simple_apr24/preloop.gms | 6 +++--- .../30_croparea/detail_apr24/declarations.gms | 2 +- modules/30_croparea/detail_apr24/preloop.gms | 6 +++--- .../30_croparea/simple_apr24/declarations.gms | 2 +- modules/30_croparea/simple_apr24/preloop.gms | 6 +++--- .../agr_sector_aug13/declarations.gms | 2 +- .../agr_sector_aug13/presolve.gms | 6 +++--- .../all_sectors_aug13/declarations.gms | 2 +- .../all_sectors_aug13/presolve.gms | 6 +++--- .../macceff_aug22/declarations.gms | 4 ++-- .../macceff_aug22/preloop.gms | 12 +++++------ .../55_awms/ipcc2006_aug16/declarations.gms | 2 +- modules/55_awms/ipcc2006_aug16/presolve.gms | 6 +++--- .../price_aug22/declarations.gms | 4 ++-- modules/56_ghg_policy/price_aug22/preloop.gms | 12 +++++------ modules/58_peatland/v2/declarations.gms | 2 +- modules/58_peatland/v2/preloop.gms | 6 +++--- .../1st2ndgen_priced_feb24/declarations.gms | 2 +- .../1st2ndgen_priced_feb24/preloop.gms | 6 +++--- .../1stgen_priced_dec18/declarations.gms | 2 +- .../1stgen_priced_dec18/preloop.gms | 6 +++--- .../70_livestock/fbask_jan16/declarations.gms | 2 +- modules/70_livestock/fbask_jan16/preloop.gms | 6 +++--- .../fbask_jan16_sticky/declarations.gms | 2 +- .../fbask_jan16_sticky/preloop.gms | 6 +++--- 38 files changed, 103 insertions(+), 103 deletions(-) diff --git a/modules/12_interest_rate/select_apr20/declarations.gms b/modules/12_interest_rate/select_apr20/declarations.gms index 903d83e08d..8fdfce2de8 100644 --- a/modules/12_interest_rate/select_apr20/declarations.gms +++ b/modules/12_interest_rate/select_apr20/declarations.gms @@ -8,6 +8,6 @@ parameters pm_interest(t_all,i) Interest rate in each region and timestep (% per yr) * country-specific region scenario switch - p12_country_dummy(iso) Dummy parameter indicating whether country is affected by interest rate scenario (1) + p12_country_switch(iso) Switch indicating whether country is affected by interest rate scenario (1) p12_reg_shr(t_all,i) Weighted share of region with regards to interest rate scenario of countries (1) ; diff --git a/modules/12_interest_rate/select_apr20/preloop.gms b/modules/12_interest_rate/select_apr20/preloop.gms index 2f2f490305..71eaace15d 100644 --- a/modules/12_interest_rate/select_apr20/preloop.gms +++ b/modules/12_interest_rate/select_apr20/preloop.gms @@ -9,12 +9,12 @@ * shall be applied. * In the default case, the interest rate scenario affects all countries when * activated. -p12_country_dummy(iso) = 0; -p12_country_dummy(select_countries12) = 1; +p12_country_switch(iso) = 0; +p12_country_switch(select_countries12) = 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. -p12_reg_shr(t_all,i) = sum(i_to_iso(i,iso), p12_country_dummy(iso) * im_pop_iso(t_all,iso)) / sum(i_to_iso(i,iso), im_pop_iso(t_all,iso)); +p12_reg_shr(t_all,i) = sum(i_to_iso(i,iso), p12_country_switch(iso) * im_pop_iso(t_all,iso)) / sum(i_to_iso(i,iso), im_pop_iso(t_all,iso)); * Interest rate in countries selected in select_countries12 $ifthen "%c12_interest_rate%" == "coupling" diff --git a/modules/15_food/anthro_iso_jun22/declarations.gms b/modules/15_food/anthro_iso_jun22/declarations.gms index 7d9fc7a1f9..2c7adc6de7 100644 --- a/modules/15_food/anthro_iso_jun22/declarations.gms +++ b/modules/15_food/anthro_iso_jun22/declarations.gms @@ -176,7 +176,7 @@ parameters i15_exo_foodscen_fader(t,iso) Fader that converges per capita food consumption to an exogenous diet scenario (1) * country-specific scenario switch - p15_country_dummy(iso) Dummy parameter indicating whether country is affected by diet scenarios (1) + p15_country_switch(iso) Switch indicating whether country is affected by diet scenarios (1) * calculate diet iteration breakpoint p15_income_pc_real_ppp(t,i) Regional per capita income after price shock on regional level (USD17PPP per capita) diff --git a/modules/15_food/anthro_iso_jun22/preloop.gms b/modules/15_food/anthro_iso_jun22/preloop.gms index 77b11ab436..8c05f5927c 100644 --- a/modules/15_food/anthro_iso_jun22/preloop.gms +++ b/modules/15_food/anthro_iso_jun22/preloop.gms @@ -58,8 +58,8 @@ Elseif s15_milk_share_fadeout_india = 1, * Switch to determine countries for which exogenous food scenarios (EAT Lancet diet and * food waste scenarios), and food substitution scenarios shall be applied. * In the default case, the exogenous food scenarios affect all countries. -p15_country_dummy(iso) = 0; -p15_country_dummy(scen_countries15) = 1; +p15_country_switch(iso) = 0; +p15_country_switch(scen_countries15) = 1; ** The following lines define scenario faders for substituting different food groups * If s15_exo_foodscen_functional_form = 1, the exogenous food scenario is faded in linearly. @@ -96,13 +96,13 @@ elseif s15_food_subst_functional_form = 2, * Food substitution scenarios including functional forms, targets and transition periods -i15_ruminant_fadeout(t,iso) = 1 - p15_country_dummy(iso)*p15_ruminant_subst_fader(t); -i15_fish_fadeout(t,iso) = 1 - p15_country_dummy(iso)*p15_fish_subst_fader(t); -i15_alcohol_fadeout(t,iso) = 1 - p15_country_dummy(iso)*p15_alcohol_subst_fader(t); -i15_livestock_fadeout(t,iso) = 1 - p15_country_dummy(iso)*p15_livestock_subst_fader(t); -i15_rumdairy_fadeout(t,iso) = 1 - p15_country_dummy(iso)*p15_rumdairy_subst_fader(t); -i15_rumdairy_scp_fadeout(t,iso) = 1 - p15_country_dummy(iso)*p15_rumdairy_scp_subst_fader(t); -i15_livestock_fadeout_threshold(t,iso) = 1 - p15_country_dummy(iso)*p15_livestock_threshold_subst_fader(t); +i15_ruminant_fadeout(t,iso) = 1 - p15_country_switch(iso)*p15_ruminant_subst_fader(t); +i15_fish_fadeout(t,iso) = 1 - p15_country_switch(iso)*p15_fish_subst_fader(t); +i15_alcohol_fadeout(t,iso) = 1 - p15_country_switch(iso)*p15_alcohol_subst_fader(t); +i15_livestock_fadeout(t,iso) = 1 - p15_country_switch(iso)*p15_livestock_subst_fader(t); +i15_rumdairy_fadeout(t,iso) = 1 - p15_country_switch(iso)*p15_rumdairy_subst_fader(t); +i15_rumdairy_scp_fadeout(t,iso) = 1 - p15_country_switch(iso)*p15_rumdairy_scp_subst_fader(t); +i15_livestock_fadeout_threshold(t,iso) = 1 - p15_country_switch(iso)*p15_livestock_threshold_subst_fader(t); ** The following lines define the scenario fader for the exogeneous food scenario @@ -117,7 +117,7 @@ elseif s15_exo_foodscen_functional_form = 2, ); * Fade in scenarios at country level -i15_exo_foodscen_fader(t,iso) = p15_exo_food_scenario_fader(t) * p15_country_dummy(iso); +i15_exo_foodscen_fader(t,iso) = p15_exo_food_scenario_fader(t) * p15_country_switch(iso); * Select from the data set of EAT Lancet scenarios the target years that are * consistent with the target year of the fader: diff --git a/modules/15_food/anthro_iso_jun22/presolve.gms b/modules/15_food/anthro_iso_jun22/presolve.gms index 1fed66b995..b76d8279d5 100644 --- a/modules/15_food/anthro_iso_jun22/presolve.gms +++ b/modules/15_food/anthro_iso_jun22/presolve.gms @@ -13,14 +13,14 @@ if(m_year(t) <= sm_fix_SSP2, i15_dem_halfsat(iso,regr15) = f15_demand_paras(regr15,"SSP2","halfsaturation"); i15_dem_nonsat(iso,regr15) = f15_demand_paras(regr15,"SSP2","non_saturation"); else - i15_dem_intercept(iso,regr15) = f15_demand_paras(regr15,"%c15_food_scenario%","intercept")*p15_country_dummy(iso) - + f15_demand_paras(regr15,"%c15_food_scenario_noselect%","intercept")*(1-p15_country_dummy(iso)); - i15_dem_saturation(iso,regr15) = f15_demand_paras(regr15,"%c15_food_scenario%","saturation")*p15_country_dummy(iso) - + f15_demand_paras(regr15,"%c15_food_scenario_noselect%","saturation")*(1-p15_country_dummy(iso)); - i15_dem_halfsat(iso,regr15) = f15_demand_paras(regr15,"%c15_food_scenario%","halfsaturation")*p15_country_dummy(iso) - + f15_demand_paras(regr15,"%c15_food_scenario_noselect%","halfsaturation")*(1-p15_country_dummy(iso)); - i15_dem_nonsat(iso,regr15) = f15_demand_paras(regr15,"%c15_food_scenario%","non_saturation")*p15_country_dummy(iso) - + f15_demand_paras(regr15,"%c15_food_scenario_noselect%","non_saturation")*(1-p15_country_dummy(iso)); + i15_dem_intercept(iso,regr15) = f15_demand_paras(regr15,"%c15_food_scenario%","intercept")*p15_country_switch(iso) + + f15_demand_paras(regr15,"%c15_food_scenario_noselect%","intercept")*(1-p15_country_switch(iso)); + i15_dem_saturation(iso,regr15) = f15_demand_paras(regr15,"%c15_food_scenario%","saturation")*p15_country_switch(iso) + + f15_demand_paras(regr15,"%c15_food_scenario_noselect%","saturation")*(1-p15_country_switch(iso)); + i15_dem_halfsat(iso,regr15) = f15_demand_paras(regr15,"%c15_food_scenario%","halfsaturation")*p15_country_switch(iso) + + f15_demand_paras(regr15,"%c15_food_scenario_noselect%","halfsaturation")*(1-p15_country_switch(iso)); + i15_dem_nonsat(iso,regr15) = f15_demand_paras(regr15,"%c15_food_scenario%","non_saturation")*p15_country_switch(iso) + + f15_demand_paras(regr15,"%c15_food_scenario_noselect%","non_saturation")*(1-p15_country_switch(iso)); ); option nlp = conopt4; diff --git a/modules/15_food/anthropometrics_jan18/declarations.gms b/modules/15_food/anthropometrics_jan18/declarations.gms index 9bd4ef6563..607dac6395 100644 --- a/modules/15_food/anthropometrics_jan18/declarations.gms +++ b/modules/15_food/anthropometrics_jan18/declarations.gms @@ -172,7 +172,7 @@ parameters i15_exo_foodscen_fader(t,i) Fader that converges per capita food consumption to an exogenous diet scenario (1) * country-specific scenario switch - p15_country_dummy(iso) Dummy parameter indicating whether country is affected by diet scenarios (1) + p15_country_switch(iso) Switch indicating whether country is affected by diet scenarios (1) p15_foodscen_region_shr(t_all,i) Weighted share of region with regards to diet scenario of countries (1) * calculate diet iteration breakpoint diff --git a/modules/15_food/anthropometrics_jan18/preloop.gms b/modules/15_food/anthropometrics_jan18/preloop.gms index 6e4bae5792..ad58642464 100644 --- a/modules/15_food/anthropometrics_jan18/preloop.gms +++ b/modules/15_food/anthropometrics_jan18/preloop.gms @@ -64,13 +64,13 @@ p15_demand2intake_ratio_ref(i) = 0; * Switch to determine countries for which exogenous food scenarios (EAT Lancet diet and * food waste scenarios), and food substitution scenarios shall be applied. * In the default case, the food scenario affects all countries when activated. -p15_country_dummy(iso) = 0; -p15_country_dummy(scen_countries15) = 1; +p15_country_switch(iso) = 0; +p15_country_switch(scen_countries15) = 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. -p15_foodscen_region_shr(t_all,i) = sum(i_to_iso(i,iso), p15_country_dummy(iso) * im_pop_iso(t_all,iso)) / sum(i_to_iso(i,iso), im_pop_iso(t_all,iso)); +p15_foodscen_region_shr(t_all,i) = sum(i_to_iso(i,iso), p15_country_switch(iso) * im_pop_iso(t_all,iso)) / sum(i_to_iso(i,iso), im_pop_iso(t_all,iso)); ** The following lines define scenario faders for substituting different food groups diff --git a/modules/15_food/anthropometrics_jan18/presolve.gms b/modules/15_food/anthropometrics_jan18/presolve.gms index 772a0a383d..1bf780458e 100644 --- a/modules/15_food/anthropometrics_jan18/presolve.gms +++ b/modules/15_food/anthropometrics_jan18/presolve.gms @@ -13,14 +13,14 @@ if(m_year(t) <= sm_fix_SSP2, i15_dem_halfsat(iso,regr15) = f15_demand_paras(regr15,"SSP2","halfsaturation"); i15_dem_nonsat(iso,regr15) = f15_demand_paras(regr15,"SSP2","non_saturation"); else - i15_dem_intercept(iso,regr15) = f15_demand_paras(regr15,"%c15_food_scenario%","intercept")*p15_country_dummy(iso) - + f15_demand_paras(regr15,"%c15_food_scenario_noselect%","intercept")*(1-p15_country_dummy(iso)); - i15_dem_saturation(iso,regr15) = f15_demand_paras(regr15,"%c15_food_scenario%","saturation")*p15_country_dummy(iso) - + f15_demand_paras(regr15,"%c15_food_scenario_noselect%","saturation")*(1-p15_country_dummy(iso)); - i15_dem_halfsat(iso,regr15) = f15_demand_paras(regr15,"%c15_food_scenario%","halfsaturation")*p15_country_dummy(iso) - + f15_demand_paras(regr15,"%c15_food_scenario_noselect%","halfsaturation")*(1-p15_country_dummy(iso)); - i15_dem_nonsat(iso,regr15) = f15_demand_paras(regr15,"%c15_food_scenario%","non_saturation")*p15_country_dummy(iso) - + f15_demand_paras(regr15,"%c15_food_scenario_noselect%","non_saturation")*(1-p15_country_dummy(iso)); + i15_dem_intercept(iso,regr15) = f15_demand_paras(regr15,"%c15_food_scenario%","intercept")*p15_country_switch(iso) + + f15_demand_paras(regr15,"%c15_food_scenario_noselect%","intercept")*(1-p15_country_switch(iso)); + i15_dem_saturation(iso,regr15) = f15_demand_paras(regr15,"%c15_food_scenario%","saturation")*p15_country_switch(iso) + + f15_demand_paras(regr15,"%c15_food_scenario_noselect%","saturation")*(1-p15_country_switch(iso)); + i15_dem_halfsat(iso,regr15) = f15_demand_paras(regr15,"%c15_food_scenario%","halfsaturation")*p15_country_switch(iso) + + f15_demand_paras(regr15,"%c15_food_scenario_noselect%","halfsaturation")*(1-p15_country_switch(iso)); + i15_dem_nonsat(iso,regr15) = f15_demand_paras(regr15,"%c15_food_scenario%","non_saturation")*p15_country_switch(iso) + + f15_demand_paras(regr15,"%c15_food_scenario_noselect%","non_saturation")*(1-p15_country_switch(iso)); ); option nlp = conopt4; diff --git a/modules/22_land_conservation/area_based_apr22/declarations.gms b/modules/22_land_conservation/area_based_apr22/declarations.gms index c036eee1ea..7a4302d79a 100644 --- a/modules/22_land_conservation/area_based_apr22/declarations.gms +++ b/modules/22_land_conservation/area_based_apr22/declarations.gms @@ -19,7 +19,7 @@ parameters p22_past_restore_pot(t,j) Potential pasture restoration area (mio. ha) p22_other_restore_pot(t,j) Potential other land restoration area (mio. ha) p22_country_weight(i) Land conservation country weight per region (1) - p22_country_dummy(iso) Dummy parameter indicating whether country is affected by selected land conservation policy (1) + p22_country_switch(iso) Switch indicating whether country is affected by selected land conservation policy (1) i22_land_iso(iso) Total land area at ISO level (mio. ha) ; diff --git a/modules/22_land_conservation/area_based_apr22/preloop.gms b/modules/22_land_conservation/area_based_apr22/preloop.gms index ab4b497f81..ab856aaf83 100644 --- a/modules/22_land_conservation/area_based_apr22/preloop.gms +++ b/modules/22_land_conservation/area_based_apr22/preloop.gms @@ -12,13 +12,13 @@ * Regional share of land conservation policies in selective countries: * Country switch to determine countries for which land conservation shall be applied. * In the default case, the land conservation affects all countries when activated. -p22_country_dummy(iso) = 0; -p22_country_dummy(policy_countries22) = 1; +p22_country_switch(iso) = 0; +p22_country_switch(policy_countries22) = 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 total land area. i22_land_iso(iso) = sum(land, fm_land_iso("y1995",iso,land)); -p22_country_weight(i) = sum(i_to_iso(i,iso), p22_country_dummy(iso) * i22_land_iso(iso)) / sum(i_to_iso(i,iso), i22_land_iso(iso)); +p22_country_weight(i) = sum(i_to_iso(i,iso), p22_country_switch(iso) * i22_land_iso(iso)) / sum(i_to_iso(i,iso), i22_land_iso(iso)); * --------------------------------------------------------------------- * Initialise baseline protection and conservation priority areas diff --git a/modules/29_cropland/detail_apr24/declarations.gms b/modules/29_cropland/detail_apr24/declarations.gms index d43f24181c..01ec807afd 100644 --- a/modules/29_cropland/detail_apr24/declarations.gms +++ b/modules/29_cropland/detail_apr24/declarations.gms @@ -16,7 +16,7 @@ parameters i29_snv_relocation_target(j) Overall cropland area that requires relocation due to SNV policy (mio. ha) p29_snv_relocation(t,j) Cropland area that is actually relocated during time step (mio. ha) p29_max_snv_relocation(t,j) Maximum cropland relocation during time step (mio. ha) - p29_country_dummy(iso) Dummy parameter indicating whether country is affected by selected cropland policy (1) + p29_country_switch(iso) Switch indicating whether country is affected by selected cropland policy (1) pm_avl_cropland_iso(iso) Available land area for cropland at ISO level (mio. ha) i29_snv_scenario_fader(t_all) SNV scenario fader (1) diff --git a/modules/29_cropland/detail_apr24/preloop.gms b/modules/29_cropland/detail_apr24/preloop.gms index d116470844..2d87573ce5 100644 --- a/modules/29_cropland/detail_apr24/preloop.gms +++ b/modules/29_cropland/detail_apr24/preloop.gms @@ -59,13 +59,13 @@ elseif s29_treecover_bii_coeff = 1, * Country switch to determine countries for which certain policies shall be applied. * In the default case, the policy affects all countries when activated. -p29_country_dummy(iso) = 0; -p29_country_dummy(policy_countries29) = 1; +p29_country_switch(iso) = 0; +p29_country_switch(policy_countries29) = 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 available cropland area. pm_avl_cropland_iso(iso) = f29_avl_cropland_iso(iso,"%c29_marginal_land%"); -p29_country_weight(i) = sum(i_to_iso(i,iso), p29_country_dummy(iso) * pm_avl_cropland_iso(iso)) / sum(i_to_iso(i,iso), pm_avl_cropland_iso(iso)); +p29_country_weight(i) = sum(i_to_iso(i,iso), p29_country_switch(iso) * pm_avl_cropland_iso(iso)) / sum(i_to_iso(i,iso), pm_avl_cropland_iso(iso)); * Initialize biodiversity value vm_fallow.l(j) = 0; diff --git a/modules/29_cropland/simple_apr24/declarations.gms b/modules/29_cropland/simple_apr24/declarations.gms index a9e37fac6e..d7aaf7f4ff 100644 --- a/modules/29_cropland/simple_apr24/declarations.gms +++ b/modules/29_cropland/simple_apr24/declarations.gms @@ -12,7 +12,7 @@ parameters i29_snv_relocation_target(j) Overall cropland area that requires relocation due to SNV policy (mio. ha) p29_snv_relocation(t,j) Cropland area that is actually relocated during time step (mio. ha) p29_max_snv_relocation(t,j) Maximum cropland relocation during time step (mio. ha) - p29_country_dummy(iso) Dummy parameter indicating whether country is affected by selected cropland policy (1) + p29_country_switch(iso) Switch indicating whether country is affected by selected cropland policy (1) pm_avl_cropland_iso(iso) Available land area for cropland at ISO level (mio. ha) i29_snv_scenario_fader(t_all) SNV scenario fader (1) ; diff --git a/modules/29_cropland/simple_apr24/preloop.gms b/modules/29_cropland/simple_apr24/preloop.gms index 9b06b11d8f..3b4d075840 100644 --- a/modules/29_cropland/simple_apr24/preloop.gms +++ b/modules/29_cropland/simple_apr24/preloop.gms @@ -27,10 +27,10 @@ elseif s29_snv_shr > s29_snv_relocation_data_x1, * Country switch to determine countries for which certain policies shall be applied. * In the default case, the policy affects all countries when activated. -p29_country_dummy(iso) = 0; -p29_country_dummy(policy_countries29) = 1; +p29_country_switch(iso) = 0; +p29_country_switch(policy_countries29) = 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 available cropland area. pm_avl_cropland_iso(iso) = f29_avl_cropland_iso(iso,"%c29_marginal_land%"); -p29_country_weight(i) = sum(i_to_iso(i,iso), p29_country_dummy(iso) * pm_avl_cropland_iso(iso)) / sum(i_to_iso(i,iso), pm_avl_cropland_iso(iso)); +p29_country_weight(i) = sum(i_to_iso(i,iso), p29_country_switch(iso) * pm_avl_cropland_iso(iso)) / sum(i_to_iso(i,iso), pm_avl_cropland_iso(iso)); diff --git a/modules/30_croparea/detail_apr24/declarations.gms b/modules/30_croparea/detail_apr24/declarations.gms index f5eedf4e2b..dfb1647f1d 100644 --- a/modules/30_croparea/detail_apr24/declarations.gms +++ b/modules/30_croparea/detail_apr24/declarations.gms @@ -14,7 +14,7 @@ parameters i30_betr_target(t,j) Target share for bioenergy land on total cropland (1) i30_betr_penalty(t) Penalty for violation of betr target (USD17MER per ha) p30_country_weight(i) Policy country weight per region (1) - p30_country_dummy(iso) Dummy parameter indicating whether country is affected by selected policy (1) + p30_country_switch(iso) Switch indicating whether country is affected by selected policy (1) ; positive variables diff --git a/modules/30_croparea/detail_apr24/preloop.gms b/modules/30_croparea/detail_apr24/preloop.gms index 54fe834d90..c392b62370 100644 --- a/modules/30_croparea/detail_apr24/preloop.gms +++ b/modules/30_croparea/detail_apr24/preloop.gms @@ -33,12 +33,12 @@ if(s30_implementation = 1, * Country switch to determine countries for which certain policies shall be applied. * In the default case, the policy affects all countries when activated. -p30_country_dummy(iso) = 0; -p30_country_dummy(policy_countries30) = 1; +p30_country_switch(iso) = 0; +p30_country_switch(policy_countries30) = 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 available cropland area. -p30_country_weight(i) = sum(i_to_iso(i,iso), p30_country_dummy(iso) * pm_avl_cropland_iso(iso)) / sum(i_to_iso(i,iso), pm_avl_cropland_iso(iso)); +p30_country_weight(i) = sum(i_to_iso(i,iso), p30_country_switch(iso) * pm_avl_cropland_iso(iso)) / sum(i_to_iso(i,iso), pm_avl_cropland_iso(iso)); * Initialize biodiversity value vm_bv.l(j,"crop_ann",potnatveg) = diff --git a/modules/30_croparea/simple_apr24/declarations.gms b/modules/30_croparea/simple_apr24/declarations.gms index 3cfdfb3833..d1584ebe44 100644 --- a/modules/30_croparea/simple_apr24/declarations.gms +++ b/modules/30_croparea/simple_apr24/declarations.gms @@ -11,7 +11,7 @@ parameters i30_betr_target(t,j) Target share for bioenergy land on total cropland (1) i30_betr_penalty(t) Penalty for violation of betr target (USD17MER per ha) p30_country_weight(i) Policy country weight per region (1) - p30_country_dummy(iso) Dummy parameter indicating whether country is affected by selected policy (1) + p30_country_switch(iso) Switch indicating whether country is affected by selected policy (1) ; positive variables diff --git a/modules/30_croparea/simple_apr24/preloop.gms b/modules/30_croparea/simple_apr24/preloop.gms index 119943f4a2..97c5e5f7c9 100644 --- a/modules/30_croparea/simple_apr24/preloop.gms +++ b/modules/30_croparea/simple_apr24/preloop.gms @@ -17,12 +17,12 @@ fm_croparea(t_past,j,w,kcr)$(fm_croparea(t_past,j,w,kcr)<0) = 0; * Country switch to determine countries for which certain policies shall be applied. * In the default case, the policy affects all countries when activated. -p30_country_dummy(iso) = 0; -p30_country_dummy(policy_countries30) = 1; +p30_country_switch(iso) = 0; +p30_country_switch(policy_countries30) = 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 available cropland area. -p30_country_weight(i) = sum(i_to_iso(i,iso), p30_country_dummy(iso) * pm_avl_cropland_iso(iso)) / sum(i_to_iso(i,iso), pm_avl_cropland_iso(iso)); +p30_country_weight(i) = sum(i_to_iso(i,iso), p30_country_switch(iso) * pm_avl_cropland_iso(iso)) / sum(i_to_iso(i,iso), pm_avl_cropland_iso(iso)); * Initialize biodiversity value vm_bv.l(j,"crop_ann",potnatveg) = diff --git a/modules/42_water_demand/agr_sector_aug13/declarations.gms b/modules/42_water_demand/agr_sector_aug13/declarations.gms index 3562706f56..b2de51776b 100644 --- a/modules/42_water_demand/agr_sector_aug13/declarations.gms +++ b/modules/42_water_demand/agr_sector_aug13/declarations.gms @@ -14,7 +14,7 @@ parameters i42_env_flow_policy(t,i) Determines whether environmental flow protection is enforced (1) p42_efp(t_all,scen42) Determines whether environmental flow protection is enforced and its fading in of environmental flow policy (1) p42_efp_fader(t_all) Determines the fading in of environmental flow policy (1) - p42_country_dummy(iso) Dummy parameter indicating whether country is affected by EFP (1) + p42_country_switch(iso) Switch indicating whether country is affected by EFP (1) p42_EFP_region_shr(t_all,i) Weighted share of region with regards to EFP (1) ic42_pumping_cost(i) Parameter to capture values for pumping costs in a particular time step (USD17MER per m^3) i42_watdem_total(t,j,watdem_ineldo,wtype) Non-agricultural water demand for entire year used in post-processing (mio. m^3 per yr) diff --git a/modules/42_water_demand/agr_sector_aug13/presolve.gms b/modules/42_water_demand/agr_sector_aug13/presolve.gms index 42b824cdad..b99925d4a7 100644 --- a/modules/42_water_demand/agr_sector_aug13/presolve.gms +++ b/modules/42_water_demand/agr_sector_aug13/presolve.gms @@ -45,12 +45,12 @@ i42_watdem_total(t,j,"manufacturing","withdrawal") = sum(wat_src, im_wat_avail(t * Country switch to determine countries for which EFP holds. * In the default case, the EFP affects all countries when activated. -p42_country_dummy(iso) = 0; -p42_country_dummy(EFP_countries) = 1; +p42_country_switch(iso) = 0; +p42_country_switch(EFP_countries) = 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. -p42_EFP_region_shr(t_all,i) = sum(i_to_iso(i,iso), p42_country_dummy(iso) * im_pop_iso(t_all,iso)) / sum(i_to_iso(i,iso), im_pop_iso(t_all,iso)); +p42_EFP_region_shr(t_all,i) = sum(i_to_iso(i,iso), p42_country_switch(iso) * im_pop_iso(t_all,iso)) / sum(i_to_iso(i,iso), im_pop_iso(t_all,iso)); * Environmental policy switch: $ifthen "%c42_env_flow_policy%" == "mixed" diff --git a/modules/42_water_demand/all_sectors_aug13/declarations.gms b/modules/42_water_demand/all_sectors_aug13/declarations.gms index 1fa50b6846..9dddf95d94 100644 --- a/modules/42_water_demand/all_sectors_aug13/declarations.gms +++ b/modules/42_water_demand/all_sectors_aug13/declarations.gms @@ -14,7 +14,7 @@ parameters i42_env_flow_policy(t,i) Determines whether environmental flow protection is enforced (1) p42_efp(t_all,scen42) Determines whether environmental flow protection is enforced and its fading in of environmental flow policy (1) p42_efp_fader(t_all) Determines the fading in of environmental flow policy (1) - p42_country_dummy(iso) Dummy parameter indicating whether country is affected by EFP (1) + p42_country_switch(iso) Switch indicating whether country is affected by EFP (1) p42_EFP_region_shr(t_all,i) Weighted share of region with regards to EFP (1) ic42_pumping_cost(i) Parameter to capture values for pumping costs in a particular time step (USD17MER per m^3) i42_watdem_total(t,j,watdem_ineldo,wtype) Non-agricultural water demand for entire year used in post-processing (mio. m^3 per yr) diff --git a/modules/42_water_demand/all_sectors_aug13/presolve.gms b/modules/42_water_demand/all_sectors_aug13/presolve.gms index db3266e241..ea02be6521 100644 --- a/modules/42_water_demand/all_sectors_aug13/presolve.gms +++ b/modules/42_water_demand/all_sectors_aug13/presolve.gms @@ -66,12 +66,12 @@ Elseif (s42_env_flow_scenario = 1), * Country switch to determine countries for which EFP holds. * In the default case, the EFP affects all countries when activated. -p42_country_dummy(iso) = 0; -p42_country_dummy(EFP_countries) = 1; +p42_country_switch(iso) = 0; +p42_country_switch(EFP_countries) = 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. -p42_EFP_region_shr(t_all,i) = sum(i_to_iso(i,iso), p42_country_dummy(iso) * im_pop_iso(t_all,iso)) / sum(i_to_iso(i,iso), im_pop_iso(t_all,iso)); +p42_EFP_region_shr(t_all,i) = sum(i_to_iso(i,iso), p42_country_switch(iso) * im_pop_iso(t_all,iso)) / sum(i_to_iso(i,iso), im_pop_iso(t_all,iso)); * Environmental policy switch: $ifthen "%c42_env_flow_policy%" == "mixed" diff --git a/modules/50_nr_soil_budget/macceff_aug22/declarations.gms b/modules/50_nr_soil_budget/macceff_aug22/declarations.gms index 51180277ef..80f59176aa 100644 --- a/modules/50_nr_soil_budget/macceff_aug22/declarations.gms +++ b/modules/50_nr_soil_budget/macceff_aug22/declarations.gms @@ -36,8 +36,8 @@ equations parameters i50_atmospheric_deposition_rates(t,j,land) Atmospheric deposition rate (t N per ha) * country-specific scenario switch - p50_country_dummy_cropneff(iso) Dummy parameter indicating whether country is affected by crop neff scenario (1) - p50_country_dummy_pastneff(iso) Dummy parameter indicating whether country is affected by pasture neff scenario (1) + p50_country_switch_cropneff(iso) Switch indicating whether country is affected by crop neff scenario (1) + p50_country_switch_pastneff(iso) Switch indicating whether country is affected by pasture neff scenario (1) p50_cropneff_region_shr(t,i) Weighted share of region with regards to crop neff scenario of countries (1) p50_pastneff_region_shr(t,i) Weighted share of region with regards to pasture neff scenario of countries (1) i50_nr_eff_bau(t_all,i) Business as usual soil nitrogen uptake efficiency before MACCs mitigation (1) diff --git a/modules/50_nr_soil_budget/macceff_aug22/preloop.gms b/modules/50_nr_soil_budget/macceff_aug22/preloop.gms index bd7819097a..6b6249fd23 100644 --- a/modules/50_nr_soil_budget/macceff_aug22/preloop.gms +++ b/modules/50_nr_soil_budget/macceff_aug22/preloop.gms @@ -10,15 +10,15 @@ * Country switches to determine countries for which chosen Neff scenario * shall be applied. * In the default case, the scenarios affects all countries when activated. -p50_country_dummy_cropneff(iso) = 0; -p50_country_dummy_cropneff(cropneff_countries) = 1; -p50_country_dummy_pastneff(iso) = 0; -p50_country_dummy_pastneff(pastneff_countries) = 1; +p50_country_switch_cropneff(iso) = 0; +p50_country_switch_cropneff(cropneff_countries) = 1; +p50_country_switch_pastneff(iso) = 0; +p50_country_switch_pastneff(pastneff_countries) = 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. -p50_cropneff_region_shr(t,i) = sum(i_to_iso(i,iso), p50_country_dummy_cropneff(iso) * im_pop_iso(t,iso)) / sum(i_to_iso(i,iso), im_pop_iso(t,iso)); -p50_pastneff_region_shr(t,i) = sum(i_to_iso(i,iso), p50_country_dummy_pastneff(iso) * im_pop_iso(t,iso)) / sum(i_to_iso(i,iso), im_pop_iso(t,iso)); +p50_cropneff_region_shr(t,i) = sum(i_to_iso(i,iso), p50_country_switch_cropneff(iso) * im_pop_iso(t,iso)) / sum(i_to_iso(i,iso), im_pop_iso(t,iso)); +p50_pastneff_region_shr(t,i) = sum(i_to_iso(i,iso), p50_country_switch_pastneff(iso) * im_pop_iso(t,iso)) / sum(i_to_iso(i,iso), im_pop_iso(t,iso)); * Nitrogen use efficiency loop(t, diff --git a/modules/55_awms/ipcc2006_aug16/declarations.gms b/modules/55_awms/ipcc2006_aug16/declarations.gms index cc9ac5258e..26c8af2ced 100644 --- a/modules/55_awms/ipcc2006_aug16/declarations.gms +++ b/modules/55_awms/ipcc2006_aug16/declarations.gms @@ -11,7 +11,7 @@ parameters ic55_manure_fuel_shr(i,kli) Share of manure excreted on pastures used for fuel (tNr per tNr) ic55_awms_shr(i,kli,awms_conf) Share of manure Nr managed in each animal waste management systems (tNr per tNr) p55_region_shr(t_all,i) AWM scenario share of the region (1) - p55_country_dummy(iso) Dummy parameter indicating whether country is affected by selected awm scenario (1) + p55_country_switch(iso) Switch indicating whether country is affected by selected awm scenario (1) ; diff --git a/modules/55_awms/ipcc2006_aug16/presolve.gms b/modules/55_awms/ipcc2006_aug16/presolve.gms index ef9510280e..5b041fb51a 100644 --- a/modules/55_awms/ipcc2006_aug16/presolve.gms +++ b/modules/55_awms/ipcc2006_aug16/presolve.gms @@ -8,12 +8,12 @@ ****** Region price share for awm scenario of selective countries: * Country switch to determine countries for which awm scenario shall be applied. * In the default case, the awm scenario affects all countries when activated. -p55_country_dummy(iso) = 0; -p55_country_dummy(scen_countries55) = 1; +p55_country_switch(iso) = 0; +p55_country_switch(scen_countries55) = 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. -p55_region_shr(t_all,i) = sum(i_to_iso(i,iso), p55_country_dummy(iso) * im_pop_iso(t_all,iso)) / sum(i_to_iso(i,iso), im_pop_iso(t_all,iso)); +p55_region_shr(t_all,i) = sum(i_to_iso(i,iso), p55_country_switch(iso) * im_pop_iso(t_all,iso)) / sum(i_to_iso(i,iso), im_pop_iso(t_all,iso)); if(m_year(t) <= sm_fix_SSP2, diff --git a/modules/56_ghg_policy/price_aug22/declarations.gms b/modules/56_ghg_policy/price_aug22/declarations.gms index 93a708ff16..b5963fd3c8 100644 --- a/modules/56_ghg_policy/price_aug22/declarations.gms +++ b/modules/56_ghg_policy/price_aug22/declarations.gms @@ -11,9 +11,9 @@ parameters p56_c_price_aff(t_all,i,ac) C price used for afforestation decision-making (USD17MER per tC) pc56_c_price_induced_aff Helper for fixing C price driven afforestation to zero for historic time steps (binary) p56_region_price_shr(t_all,i) GHG price share of the region (1) - p56_country_dummy(iso) Dummy parameter indicating whether country is affected by selected GHG policy (1) + p56_country_switch(iso) Switch indicating whether country is affected by selected GHG policy (1) p56_region_fader_shr(t_all,i) GHG policy fader share of the region (1) - p56_country_dummy2(iso) Dummy parameter indicating whether country is affected by selected GHG policy fader (1) + p56_country_switch2(iso) Switch indicating whether country is affected by selected GHG policy fader (1) p56_fader(t_all) GHG policy fader (1) p56_fader_reg(t_all,i) Regional GHG policy fader (1) pcm_carbon_stock(j,land,c_pools,stockType) Carbon stock in vegetation soil and litter for different land types (mio. tC) diff --git a/modules/56_ghg_policy/price_aug22/preloop.gms b/modules/56_ghg_policy/price_aug22/preloop.gms index fed1fc18ef..3922e0cca3 100644 --- a/modules/56_ghg_policy/price_aug22/preloop.gms +++ b/modules/56_ghg_policy/price_aug22/preloop.gms @@ -15,22 +15,22 @@ v56_emis_pricing.fx(i,emis_oneoff,pollutants)$(not sameas(pollutants,"co2_c")) = ****** Region price share for ghg policy of selective countries: * Country switch to determine countries for which ghg policy shall be applied. * In the default case, the ghg policy affects all countries when activated. -p56_country_dummy(iso) = 0; -p56_country_dummy(policy_countries56) = 1; +p56_country_switch(iso) = 0; +p56_country_switch(policy_countries56) = 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. -p56_region_price_shr(t_all,i) = sum(i_to_iso(i,iso), p56_country_dummy(iso) * im_pop_iso(t_all,iso)) / sum(i_to_iso(i,iso), im_pop_iso(t_all,iso)); +p56_region_price_shr(t_all,i) = sum(i_to_iso(i,iso), p56_country_switch(iso) * im_pop_iso(t_all,iso)) / sum(i_to_iso(i,iso), im_pop_iso(t_all,iso)); ****** Regional fader share for ghg policy fader of selective countries: * Country switch to determine countries for which ghg policy fader shall be applied. * In the default case, the ghg policy fader affects all countries when activated. -p56_country_dummy2(iso) = 0; -p56_country_dummy2(fader_countries56) = 1; +p56_country_switch2(iso) = 0; +p56_country_switch2(fader_countries56) = 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. -p56_region_fader_shr(t_all,i) = sum(i_to_iso(i,iso), p56_country_dummy2(iso) * im_pop_iso(t_all,iso)) / sum(i_to_iso(i,iso), im_pop_iso(t_all,iso)); +p56_region_fader_shr(t_all,i) = sum(i_to_iso(i,iso), p56_country_switch2(iso) * im_pop_iso(t_all,iso)) / sum(i_to_iso(i,iso), im_pop_iso(t_all,iso)); ****select ghg prices $ifthen "%c56_pollutant_prices%" == "coupling" diff --git a/modules/58_peatland/v2/declarations.gms b/modules/58_peatland/v2/declarations.gms index 4151322e15..ced2ebeda0 100644 --- a/modules/58_peatland/v2/declarations.gms +++ b/modules/58_peatland/v2/declarations.gms @@ -18,7 +18,7 @@ parameters p58_availLandExp(t,j) Available area for expansion of managed land (mio. ha) i58_peatland_rewetting_fader(t_all) Temporal fader for exogenous peatland rewetting (1) p58_peatland_ref(j,land58) Peatland area in reference period (mio. ha) - p58_country_dummy(iso) Dummy parameter indicating whether country is affected by exogenous peatland rewetting (1) + p58_country_switch(iso) Switch indicating whether country is affected by exogenous peatland rewetting (1) p58_country_weight(i) Policy country weight per region (1) i58_rewetting_exo(t,j) Cellular share of drained peatland in reference period to be rewetted (1) i58_intact_protection_exo(j) Cellular share of intact peatland that should be protected (1) diff --git a/modules/58_peatland/v2/preloop.gms b/modules/58_peatland/v2/preloop.gms index ea9fd54f81..beda385ea5 100644 --- a/modules/58_peatland/v2/preloop.gms +++ b/modules/58_peatland/v2/preloop.gms @@ -10,12 +10,12 @@ m_linear_time_interpol(i58_peatland_rewetting_fader,s58_rewet_exo_start_year,s58 * Country switch to determine countries for which certain policies shall be applied. * In the default case, the policy affects all countries when activated. -p58_country_dummy(iso) = 0; -p58_country_dummy(policy_countries58) = 1; +p58_country_switch(iso) = 0; +p58_country_switch(policy_countries58) = 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 total peatland area. -p58_country_weight(i) = sum(i_to_iso(i,iso), p58_country_dummy(iso) * sum(land58, f58_peatland_area_iso(iso,land58))) +p58_country_weight(i) = sum(i_to_iso(i,iso), p58_country_switch(iso) * sum(land58, f58_peatland_area_iso(iso,land58))) / sum(i_to_iso(i,iso), sum(land58, f58_peatland_area_iso(iso,land58))); * construct exogenous peatland rewetting scenario diff --git a/modules/60_bioenergy/1st2ndgen_priced_feb24/declarations.gms b/modules/60_bioenergy/1st2ndgen_priced_feb24/declarations.gms index d3efbe17da..41aef0e838 100644 --- a/modules/60_bioenergy/1st2ndgen_priced_feb24/declarations.gms +++ b/modules/60_bioenergy/1st2ndgen_priced_feb24/declarations.gms @@ -14,7 +14,7 @@ parameters i60_1stgen_bioenergy_subsidy_gj(t) Global 1st generation bioenergy subsidy per GJ (USD17MER per GJ) i60_2ndgen_bioenergy_subsidy(t) Global 2nd generation bioenergy subsidy (USD17MER per GHJ) p60_region_BE_shr(t_all,i) Bioenergy demand share of the region (1) - p60_country_dummy(iso) Dummy parameter indicating whether country is selected for selected bioenergy demand scenario (1) + p60_country_switch(iso) Switch indicating whether country is selected for selected bioenergy demand scenario (1) ; positive variables diff --git a/modules/60_bioenergy/1st2ndgen_priced_feb24/preloop.gms b/modules/60_bioenergy/1st2ndgen_priced_feb24/preloop.gms index edd93ec225..ea45f9af15 100644 --- a/modules/60_bioenergy/1st2ndgen_priced_feb24/preloop.gms +++ b/modules/60_bioenergy/1st2ndgen_priced_feb24/preloop.gms @@ -9,12 +9,12 @@ * Country switch to determine countries for which scenario shall be applied. * In the default case, the selected scneario (c60_2ndgen_biodem) affects * all countries. -p60_country_dummy(iso) = 0; -p60_country_dummy(scen_countries60) = 1; +p60_country_switch(iso) = 0; +p60_country_switch(scen_countries60) = 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. -p60_region_BE_shr(t_all,i) = sum(i_to_iso(i,iso), p60_country_dummy(iso) * im_pop_iso(t_all,iso)) / sum(i_to_iso(i,iso), im_pop_iso(t_all,iso)); +p60_region_BE_shr(t_all,i) = sum(i_to_iso(i,iso), p60_country_switch(iso) * im_pop_iso(t_all,iso)) / sum(i_to_iso(i,iso), im_pop_iso(t_all,iso)); $ifthen "%c60_2ndgen_biodem%" == "coupling" i60_bioenergy_dem(t,i) = f60_bioenergy_dem_coupling(t,i); diff --git a/modules/60_bioenergy/1stgen_priced_dec18/declarations.gms b/modules/60_bioenergy/1stgen_priced_dec18/declarations.gms index 9894f55c98..573b3a974c 100644 --- a/modules/60_bioenergy/1stgen_priced_dec18/declarations.gms +++ b/modules/60_bioenergy/1stgen_priced_dec18/declarations.gms @@ -11,7 +11,7 @@ parameters i60_res_2ndgenBE_dem(t,i) Regional residue demand for 2nd generation bioenergy per year (mio. GJ per yr) i60_1stgen_bioenergy_dem(t,i,kall) Regional 1st generation bioenergy demand (mio. GJ per yr) p60_region_BE_shr(t_all,i) Bioenergy demand share of the region (1) - p60_country_dummy(iso) Dummy parameter indicating whether country is selected for selected bioenergy demand scenario (1) + p60_country_switch(iso) Switch indicating whether country is selected for selected bioenergy demand scenario (1) ; positive variables diff --git a/modules/60_bioenergy/1stgen_priced_dec18/preloop.gms b/modules/60_bioenergy/1stgen_priced_dec18/preloop.gms index f92a9a2590..5ad503452c 100644 --- a/modules/60_bioenergy/1stgen_priced_dec18/preloop.gms +++ b/modules/60_bioenergy/1stgen_priced_dec18/preloop.gms @@ -9,12 +9,12 @@ * Country switch to determine countries for which scenario shall be applied. * In the default case, the selected scneario (c60_2ndgen_biodem) affects * all countries. -p60_country_dummy(iso) = 0; -p60_country_dummy(scen_countries60) = 1; +p60_country_switch(iso) = 0; +p60_country_switch(scen_countries60) = 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. -p60_region_BE_shr(t_all,i) = sum(i_to_iso(i,iso), p60_country_dummy(iso) * im_pop_iso(t_all,iso)) / sum(i_to_iso(i,iso), im_pop_iso(t_all,iso)); +p60_region_BE_shr(t_all,i) = sum(i_to_iso(i,iso), p60_country_switch(iso) * im_pop_iso(t_all,iso)) / sum(i_to_iso(i,iso), im_pop_iso(t_all,iso)); $ifthen "%c60_2ndgen_biodem%" == "coupling" i60_bioenergy_dem(t,i) = f60_bioenergy_dem_coupling(t,i); diff --git a/modules/70_livestock/fbask_jan16/declarations.gms b/modules/70_livestock/fbask_jan16/declarations.gms index 0b1503dba5..eb9caad503 100644 --- a/modules/70_livestock/fbask_jan16/declarations.gms +++ b/modules/70_livestock/fbask_jan16/declarations.gms @@ -30,7 +30,7 @@ parameters 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_country_switch(iso) Switch 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) i70_cost_regr(i,kap,cost_regr) Regression coefficients for livestock factor requirements (1) i70_fac_req_livst(t_all,i,kli) Factor requirements (USD17MER per tDM) diff --git a/modules/70_livestock/fbask_jan16/preloop.gms b/modules/70_livestock/fbask_jan16/preloop.gms index 4564602ff2..5a8c12632b 100644 --- a/modules/70_livestock/fbask_jan16/preloop.gms +++ b/modules/70_livestock/fbask_jan16/preloop.gms @@ -21,14 +21,14 @@ i70_livestock_productivity(t_all,i,sys)$(i70_livestock_productivity(t_all,i,sys) * 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; +p70_country_switch(iso) = 0; +p70_country_switch(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)); +p70_feedscen_region_shr(t_all,i) = sum(i_to_iso(i,iso), p70_country_switch(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, diff --git a/modules/70_livestock/fbask_jan16_sticky/declarations.gms b/modules/70_livestock/fbask_jan16_sticky/declarations.gms index 4e00176562..3d342abd78 100644 --- a/modules/70_livestock/fbask_jan16_sticky/declarations.gms +++ b/modules/70_livestock/fbask_jan16_sticky/declarations.gms @@ -32,7 +32,7 @@ parameters 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_country_switch(iso) Switch 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) i70_cost_regr(i,kap,cost_regr) Regression coefficients for livestock factor requirements (1) i70_fac_req_livst(t_all,i,kli) Factor requirements (USD17MER per tDM) diff --git a/modules/70_livestock/fbask_jan16_sticky/preloop.gms b/modules/70_livestock/fbask_jan16_sticky/preloop.gms index 1e223d4a72..7ef03f7794 100644 --- a/modules/70_livestock/fbask_jan16_sticky/preloop.gms +++ b/modules/70_livestock/fbask_jan16_sticky/preloop.gms @@ -21,14 +21,14 @@ i70_livestock_productivity(t_all,i,sys)$(i70_livestock_productivity(t_all,i,sys) * 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; +p70_country_switch(iso) = 0; +p70_country_switch(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)); +p70_feedscen_region_shr(t_all,i) = sum(i_to_iso(i,iso), p70_country_switch(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, From 93ef0e90608b7bfa440374746b30eabd19471679 Mon Sep 17 00:00:00 2001 From: florianh Date: Mon, 2 Dec 2024 15:49:02 +0100 Subject: [PATCH 204/206] renamed _country_dummy to _country_switch in all modules --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 45b75328de..7bb08f23d8 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -69,7 +69,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). - **scripts** `.nc` files are no longer created by default after disaggregation - **scripts** output/extra/highres.R use default 13_tc realization - **scripts** rewrite of merge_report.R based on rds files and rbind, which allows for more flexibility when merging reports. Avoid inconsistent use of "GLO" instead of "World" in report.rds files. - +- **modules** renamed `country_dummy` to `country_switch` in all modules ### added - **42_water_demand** added water abstraction type dimension for non-ag uses From e2e6481924d67ee30da38820d92a832193e614fd Mon Sep 17 00:00:00 2001 From: florianh Date: Mon, 2 Dec 2024 18:56:53 +0100 Subject: [PATCH 205/206] add source --- config/default.cfg | 2 ++ 1 file changed, 2 insertions(+) diff --git a/config/default.cfg b/config/default.cfg index 4ce56bdef9..8b5941ac4c 100644 --- a/config/default.cfg +++ b/config/default.cfg @@ -2025,10 +2025,12 @@ cfg$gms$timber <- "default" # def = default cfg$gms$s73_timber_demand_switch <- 1 # def = 1 # harvesting cost of industrial roundwood per ton of dry matter produced (USD17MER/tDM) +# based on https://unece.org/forests/prices: 60 EUR/m3 = 72 USD/m3; 72 USD/m3 / 0.6 = 120 USD/tDM # * (inflated from default originally in USD05 using USD05 --> USD17 inflation rate: 1.23) cfg$gms$s73_timber_prod_cost_wood <- 148 # def = 120 * 1.23 # harvesting cost of woodfuel per ton of dry matter produced (USD17MER/tDM) +# based on https://unece.org/forests/prices # * (inflated from default originally in USD05 using USD05 --> USD17 inflation rate: 1.23) cfg$gms$s73_timber_prod_cost_woodfuel <- 74 # def = 60 * 1.23 From 7056f39a47378f97811bd7af595191b1a7a48fbf Mon Sep 17 00:00:00 2001 From: Pascal Sauer <156898545+pascal-sauer@users.noreply.github.com> Date: Thu, 5 Dec 2024 14:50:41 +0100 Subject: [PATCH 206/206] magpie release 4.9.0 --- .zenodo.json | 4 ++-- CHANGELOG.md | 44 ++++++++++++++++++++++---------------------- CITATION.cff | 4 ++-- README.md | 6 +++--- 4 files changed, 29 insertions(+), 29 deletions(-) diff --git a/.zenodo.json b/.zenodo.json index 35a98995c9..89137ae877 100644 --- a/.zenodo.json +++ b/.zenodo.json @@ -1,6 +1,6 @@ { "title": "MAgPIE - An Open Source land-use modeling framework", - "version": "4.8.2dev", + "version": "4.9.0", "creators": [ { "name": "Dietrich, Jan Philipp", @@ -123,5 +123,5 @@ "license": { "id": "AGPL-3.0-or-later" }, - "publication_date": "2024-09-24" + "publication_date": "2024-12-05" } diff --git a/CHANGELOG.md b/CHANGELOG.md index 7bb08f23d8..27f5724625 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,49 +3,50 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). -## [Unreleased] +## [4.9.0] - 2024-12-05 ### changed +- **35_natveg** revised age-class initialization of secondary forest - **38_factor_costs** updated use of USDA cost shares -- **inputdata** changed GDP base year from 2005USD to 2017USD - **config** changed default input data to use 2017USD -- **module_documentation** all references to USD05 changed to USD17 -- **scripts** REMIND coupling reads data in US$2017, not US$2005 -- **config** updated input data to rev4.114 +- **config** default for `c60_bioenergy_subsidy` changed from 369 to 246 USD17MER per ton - **config** SHAPE scenarios start year of dietary shift changed to 2025 -- **extra/disaggregation** Peatland now considered in disaggregation of land pools +- **config** updated input data to rev4.114 - **core** number of age-classes doubled from 150 to 300 years for better match of growth curves with potential natural vegetation. -- **35_natveg** revised age-class initialization of secondary forest +- **extra/disaggregation** Peatland now considered in disaggregation of land pools +- **inputdata** changed GDP base year from 2005USD to 2017USD +- **module_documentation** all references to USD05 changed to USD17 - **modules** update of scaling factors in several modules -- **scripts** renamed disaggregation_mrdownscale.R -> mrdownscale_LUH2.R -- **config** default for `c60_bioenergy_subsidy` changed from 369 to 246 USD17MER per ton - **scripts** NPI/NDC policies synced to the year 2025 - update of additional data to `additional_data_rev4.59.tgz` +- **scripts** REMIND coupling reads data in US$2017, not US$2005 +- **scripts** renamed disaggregation_mrdownscale.R -> mrdownscale_LUH2.R ### added +- **32_forestry** added option s32_npi_ndc_reversal +- **35_natveg** added option s35_npi_ndc_reversal +- **56_ghg_policy** added new interface pcm_carbon_stock to avoid use of vm_carbon_stock.l in equations +- **58_peatland** added option for exogenous peatland rewetting - **62_material** added switch to turn off future material demand for bioplastic - **config** added SSP1-POP-GDP SSP2-POP-GDP and SSP5-POP-GDP - **modules[29-35]** added initial values for ov_bv for better starting point - **scripts** add mrdownscale script (0.5deg downscaling using LandUseInit as reference) -- **32_forestry** added option s32_npi_ndc_reversal -- **35_natveg** added option s35_npi_ndc_reversal -- **58_peatland** added option for exogenous peatland rewetting -- **56_ghg_policy** added new interface pcm_carbon_stock to avoid use of vm_carbon_stock.l in equations ### removed -- **31_past** removed `grasslands_apr22` realization - **13_tau** removed interface `fm_pastr_tau_hist` +- **31_past** removed `grasslands_apr22` realization ### fixed +- **10_land** Simplified land transition matrix for improved feasibility - **11_costs** changed equation to fix bug in total water cost calculation -- **29_cropland** treecover age-class growth was not working properly because ac_sub was erroneously not fixed -- **scripts** script/output/extra/resubmit.R - **28_ageclass** bugfix input data unit and code clean-up. Renamed `feb21` realization to `oct24` -- **70_livestock** bugfix scaling.gms file in wrong folder -- **10_land** Simplified land transition matrix for improved feasibility +- **29_cropland** treecover age-class growth was not working properly because ac_sub was erroneously not fixed - **44_biodiversity** bugfix biorealm_biome.cs3 in input data (shares did not add-up to 1) -- **config** additional data increased to `additional_data_rev4.58.tgz` which fixes missing gdp2017 conversions in f20_processing_unitcosts - **56_ghg_policy** Fader for GHG emission pricing policy +- **70_livestock** bugfix scaling.gms file in wrong folder +- **config** additional data increased to `additional_data_rev4.58.tgz` which fixes missing gdp2017 conversions in f20_processing_unitcosts - **config** settings in default.cfg for some switches in `73_timber` did not work correctly +- **scripts** script/output/extra/resubmit.R + ## [4.8.2] - 2024-09-24 @@ -86,7 +87,6 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). - **scripts** added script for automatic submission of SEALS allocation runs `./extra/runSEALSallocation.R` - **scripts** added start script for 'Healthly Landscapes' paper `paper_healthyLscps.R` - ### fixed - **15_food** fixing parameter declaration of i15_processed_kcal_structure_iso - **35_natveg** bugfix secdforest and other land restoration to avoid double-counting of restoration in equation `q29_land_snv` @@ -122,7 +122,6 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). - **config** update to input data rev4.109. In the previous rev4.108, MER GDP was wrong and was identical to PPP GDP - ## [4.8.0] - 2024-06-10 ### changed @@ -1052,7 +1051,8 @@ This release version is focussed on consistency between the MAgPIE setup and the First open source release of the framework. See [MAgPIE 4.0 paper](https://doi.org/10.5194/gmd-12-1299-2019) for more information. -[Unreleased]: https://github.com/magpiemodel/magpie/compare/v4.8.2...develop +[Unreleased]: https://github.com/magpiemodel/magpie/compare/v4.9.0...develop +[4.9.0]: https://github.com/magpiemodel/magpie/compare/v4.8.2...v4.9.0 [4.8.2]: https://github.com/magpiemodel/magpie/compare/v4.8.1...v4.8.2 [4.8.1]: https://github.com/magpiemodel/magpie/compare/v4.8.0...v4.8.1 [4.8.0]: https://github.com/magpiemodel/magpie/compare/v4.7.3...v4.8.0 diff --git a/CITATION.cff b/CITATION.cff index d33ccc484f..6b70e4bcc6 100644 --- a/CITATION.cff +++ b/CITATION.cff @@ -156,8 +156,8 @@ abstract: The *Model of Agricultural Production and its Impact on the Environmen exogenously given population in 10 food energy categories, based on regional diets. Future trends in food demand are derived from a cross-country regression analysis, based on future scenarios on GDP and population growth. -version: 4.8.2dev -date-released: 2024-09-24 +version: 4.9.0 +date-released: 2024-12-05 repository-code: https://github.com/magpiemodel/magpie keywords: - landuse diff --git a/README.md b/README.md index 6e6e8f8bac..e4b5f3321d 100644 --- a/README.md +++ b/README.md @@ -24,8 +24,8 @@ https://www.pik-potsdam.de/research/projects/activities/land-use-modelling/magpi A framework description paper has been published in Geoscientific Model Development (GMD): https://doi.org/10.5194/gmd-12-1299-2019 -The model documentation for version 4.8.2 can be found at -https://rse.pik-potsdam.de/doc/magpie/4.8.2/ +The model documentation for version 4.9.0 can be found at +https://rse.pik-potsdam.de/doc/magpie/4.9.0/ A most recent version of the documentation can also be extracted from the model source code via the R package goxygen @@ -226,7 +226,7 @@ magpie@pik-potsdam.de Please contact magpie@pik-potsdam.de ## CITATION -See file CITATION.cff or the [How-to-Cite section](https://rse.pik-potsdam.de/doc/magpie/4.8.2/#how-to-cite) in the model documentation for information how to cite the model. +See file CITATION.cff or the [How-to-Cite section](https://rse.pik-potsdam.de/doc/magpie/4.9.0/#how-to-cite) in the model documentation for information how to cite the model. ## AUTHORS See list of authors in CITATION.cff