Skip to content

Commit

Permalink
Merge branch 'develop' of https://github.com/magpiemodel/magpie into …
Browse files Browse the repository at this point in the history
…develop
  • Loading branch information
pascal-sauer committed Sep 16, 2024
2 parents 2db015e + 284c5a3 commit 3a0b9ba
Show file tree
Hide file tree
Showing 46 changed files with 706 additions and 395 deletions.
16 changes: 13 additions & 3 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,27 +8,37 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).

### changed
- **21_trade** refactor equations for enhanced readablility and improve documentation
- **script** 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.
- **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.
- **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.
- **80_optimization** abort GAMS in case of execution errors
- **80_optimization** abort GAMS in case of execution errors, added threads = 1 as default to avoid infeasibilites and Flg_NoDefc = TRUE as option
- **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

### added
- **scripts** added output report `EU_report.R` that uses `EU_report.Rmd`
- **script** added out of bounds check as output script
- **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
- **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
- **cropland** added option for discarding initial treecover on cropland
- **script** added output script for conversion of validation.mif file into validation.rds

### 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
Expand Down
5 changes: 2 additions & 3 deletions DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,7 @@ Imports:
curl,
data.table,
dplyr,
gdx,
gdxrrw,
gdx2,
ggplot2,
ggrepel,
gms (>= 0.24.0),
Expand All @@ -22,7 +21,7 @@ Imports:
m4fsdp,
madrat,
magclass (>= 6.14.0),
magpie4 (>= 2.5.6),
magpie4 (>= 2.10.3),
MagpieNCGains,
magpiesets,
mip,
Expand Down
20 changes: 12 additions & 8 deletions config/default.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ cfg$model <- "main.gms" #def = "main.gms"
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",
additional = "additional_data_rev4.53.tgz",
calibration = "calibration_H12_26Mar24.tgz")

# NOTE: It is recommended to recalibrate the model when changing cellular input data
Expand Down Expand Up @@ -742,6 +742,10 @@ cfg$gms$land_snv <- "secdforest, forestry, past, other" #def = "secdforest, f
# *** Options only available for `detail_apr24` realization ***

## Agroforestry settings for treecover on cropland
# * Initial tree cover
# * (0): tree cover on cropland starts from zero
# * (1): tree cover on cropland is initialized based on satellite data for 2015
cfg$gms$s29_treecover_map <- 0 # def = 0
# * Sigmoid fader for minimum area share of treecover on total cropland at cluster level
# * Minimum area share of treecover on total cropland in target year
# Note: s29_treecover_target applies to countries selected in policy_countries29
Expand All @@ -750,15 +754,15 @@ cfg$gms$s29_treecover_target <- 0 # def = 0
cfg$gms$s29_treecover_target_noselect <- 0 # def = 0
# * Avoid loss of existing treecover (1=yes 0=no).
# * If set to 1, `s29_treecover_target` will be adjusted based existing treecover area.
cfg$gms$s29_treecover_keep <- 1 # def = 1
cfg$gms$s29_treecover_keep <- 0 # def = 0
# * Maximum share of treecover on total cropland (1)
cfg$gms$s29_treecover_max <- 0.4 # def = 0.4
# * Start year of fader
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)
cfg$gms$s29_treecover_penalty_before <- 5000 # def = 5000
cfg$gms$s29_treecover_penalty_before <- 0 # def = 0
# * Penalty for violation of treecover target after scenario start (USD05MER per ha)
cfg$gms$s29_treecover_penalty <- 5000 # def = 5000
# * Tree cover establishment cost (USD05MER per ha)
Expand Down Expand Up @@ -1001,7 +1005,7 @@ cfg$gms$s32_est_cost_natveg <- 2000 # def = 2000
# * such that the total plantation area remains constant.
# * 2 = "Endogenous" scenario. Harvest from plantations including age-class shifting
# * All plantations are harvested at rotation age. Plantation establishment is endogenous.
cfg$gms$s32_hvarea = 2 # def = 2
cfg$gms$s32_hvarea <- 2 # def = 2

# Type of rotation length selection criteria
# * ("mean_annual_increment") = Harvesting when the average annual increment is maximum
Expand All @@ -1016,7 +1020,7 @@ cfg$gms$c32_rot_calc_type <- "current_annual_increment"
# * ("004lin2030") Disturbance applied to 0p4 percent per year linear phase-in over 20yrs from 0 in 2030
# * ("008lin2030") Disturbance applied to 0p8 percent per year linear phase-in over 20yrs from 0 in 2030
# * ("016lin2030") Disturbance applied to 1p6 percent per year linear phase-in over 20yrs from 0 in 2030
cfg$gms$c32_shock_scenario = "none" # def = "none"
cfg$gms$c32_shock_scenario <- "none" # def = "none"

# ***--------------------- 34_urban ---------------------------------------
# * 34_urban includes urban land
Expand Down Expand Up @@ -1720,14 +1724,14 @@ cfg$gms$peatland <- "v2" # def = v2
cfg$gms$s58_rewetting_switch <- Inf # def = Inf

# * One-time and recurring costs for peatland rewetting (USD05MER per ha)
cfg$gms$s58_cost_rewet_onetime <- 7000 # def = 7000
cfg$gms$s58_cost_rewet_recur <- 200 # def = 200
cfg$gms$s58_cost_rewet_onetime <- 1000 # def = 1000
cfg$gms$s58_cost_rewet_recur <- 30 # def = 30

# * One-time and recurring costs for peatland drainage (USD05MER 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_rewet_onetime <- 1000 # def = 1000
cfg$gms$s58_cost_drain_recur <- 0 # def = 0

# * Penalty for technical peatland balance term (USD05MER)
Expand Down
23 changes: 23 additions & 0 deletions config/projects/scenario_config_el2.csv
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
;EL2_PHD;EL2_Demand;EL2_default
gms$c09_pal_scenario;SDP;SDP;SSP2
gms$s12_interest_lic;0.06;0.1;0.1
gms$s12_interest_hic;0.04;0.04;0.04
gms$s15_exo_waste;1;1;0
gms$s15_waste_scen;1.2;1.2;1.2
gms$s15_exo_diet;3;3;0
gms$s15_exo_monogastric;1;1;1
gms$s15_exo_ruminant;1;1;1
gms$s15_exo_fish;1;1;1
gms$s15_exo_fruitvegnut;1;1;1
gms$s15_exo_roots;1;1;1
gms$s15_exo_pulses;1;1;1
gms$s15_exo_sugar;1;1;1
gms$s15_exo_oils;1;1;1
gms$s15_exo_brans;0;0;0
gms$s15_exo_scp;1;1;1
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;;
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
4 changes: 4 additions & 0 deletions config/projects/scenario_config_frst_shock.csv
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
;frst_shock_none;frst_shock_002lin2030;frst_shock_004lin2030;frst_shock_008lin2030;frst_shock_016lin2030
gms$c32_shock_scenario;none;002lin2030;004lin2030;008lin2030;016lin2030
gms$s35_forest_damage;4;4;4;4;4
gms$c35_shock_scenario;none;002lin2030;004lin2030;008lin2030;016lin2030
File renamed without changes.
38 changes: 38 additions & 0 deletions config/projects/scenario_config_gcs.csv
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
;GCSF;LNDlbs;LNDres;LNDfood;Tland
gms$food;anthro_iso_jun22;;;;
gms$s15_exo_foodscen_start;;;;2020;2020
gms$s15_exo_foodscen_target;;;;2050;2050
gms$s15_exo_waste;;;;1;1
gms$s15_waste_scen;;;;1.2;1.2
gms$s15_exo_diet;;;;1;1
gms$c15_kcal_scen;;;;healthy_BMI;healthy_BMI
gms$c15_EAT_scen;;;;FLX;FLX
gms$s15_exo_monogastric;;;;1;1
gms$s15_exo_ruminant;;;;1;1
gms$s15_exo_fish;;;;1;1
gms$s15_exo_fruitvegnut;;;;1;1
gms$s15_exo_pulses;;;;1;1
gms$s15_exo_sugar;;;;1;1
gms$s15_exo_oils;;;;1;1
gms$s15_exo_brans;;;;1;1
gms$s15_exo_scp;;;;1;1
gms$s15_exo_alcohol;;;;1;1
gms$c22_protect_scenario;;BH_IFL;;;BH_IFL
gms$s29_snv_shr;;0.2;;;0.2
gms$s29_snv_scenario_target;;2030;;;2030
gms$c30_bioen_water;;;rainfed;;rainfed
gms$s32_aff_plantation;;0;;;0
gms$s32_aff_bii_coeff;;0;;;0
gms$s32_max_aff_area;;500;;;500
gms$c32_aff_mask;;onlytropical;;;onlytropical
gms$s35_forest_damage_end;;2030;;;2030
gms$s42_irrig_eff_scenario;;;3;;3
gms$c42_env_flow_policy;;;on;;on
gms$s42_efp_targetyear;;;2040;;2040
gms$c50_scen_neff;;;baseeff_add3_add15_add25_max75;;baseeff_add3_add15_add25_max75
gms$c55_scen_conf;;;ssp1;;ssp1
gms$s56_buffer_aff;;0.2;;;0.2
gms$c56_emis_policy;;gcs_lbs;gcs_res;;redd+natveg_nosoil
gms$c60_1stgen_biodem;;;phaseout2020;;phaseout2020
gms$c60_res_2ndgenBE_dem;;;;sdp;sdp
gms$c70_feed_scen;;;ssp1;;ssp1
28 changes: 28 additions & 0 deletions config/projects/scenario_config_genie.csv
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
;GENIE_SCP
gms$c_timesteps;coup2110
gms$sm_fix_SSP2;2020
gms$sm_fix_cc;2020
gms$c13_tccost;high
gms$c14_yields_scenario;nocc
gms$food;anthropometrics_jan18
gms$kfo_rd;livst_rum,livst_milk
gms$s15_food_subst_functional_form;2
gms$c20_scp_type;hydrogen
gms$s21_trade_tariff_startyear;2020
gms$s22_conservation_start;2020
gms$s22_conservation_target;2030
gms$s30_annual_max_growth;0.02
gms$s32_hvarea;0
gms$s35_hvarea;0
gms$factor_costs;sticky_feb18
gms$s38_startyear_labor_substitution;2020
gms$s42_efp_startyear;2020
gms$s44_cost_bii_missing;10000000
gms$c56_pollutant_prices;R32M46-SSP2EU-NPi
gms$c56_pollutant_prices_noselect;R32M46-SSP2EU-NPi
gms$c56_mute_ghgprices_until;y2020
gms$bioenergy;1st2ndgen_priced_feb24
gms$c60_1stgen_biodem;phaseout2020
gms$c60_2ndgen_biodem;R32M46-SSP2EU-NPi
gms$c60_2ndgen_biodem_noselect;R32M46-SSP2EU-NPi
gms$s73_timber_demand_switch;0
39 changes: 39 additions & 0 deletions config/projects/scenario_config_lama.csv
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
;LAMA_Inequal;LAMA_Inequal-SustDemand;LAMA_Inequal-EnvirProt;LAMA_Inequal-GHGPrice;LAMA_Sustainability
gms$c_timesteps;5year;5year;5year;5year;5year
gms$c09_pop_scenario;SSP4;SSP1;SSP4;SSP4;SSP1
gms$c09_gdp_scenario;SSP4;SSP1;SSP4;SSP4;SSP1
gms$c09_pal_scenario;SSP4;SSP1;SSP4;SSP4;SSP1
gms$c15_food_scenario;SSP4;SSP1;SSP4;SSP4;SSP1
gms$c15_food_scenario_noselect;SSP4;SSP1;SSP4;SSP4;SSP1
gms$s15_exo_foodscen_start;;2020;;;2020
gms$s15_exo_foodscen_target;;2050;;;2050
gms$s15_exo_waste;0;1;0;0;1
gms$s15_waste_scen;1.2;1.2;1.2;1.2;1.2
gms$s15_exo_diet;0;1;0;0;1
gms$s15_exo_brans;1;1;1;1;1
gms$c21_trade_liberalization;l908080r807070;l908080r807070;l908080r807070;l908080r807070;l908080r807070
gms$c22_protect_scenario;BH_IFL;BH_IFL;BH_IFL;BH_IFL;BH_IFL
gms$c22_protect_scenario_noselect;none;none;BH_IFL;none;BH_IFL
gms$s29_snv_shr;0.2;0.2;0.2;0.2;0.2
gms$s29_snv_shr_noselect;0;0;0.2;0;0.2
gms$s29_snv_scenario_target;2030;2030;2030;2030;2030
gms$s32_max_aff_area;Inf;Inf;Inf;500;500
gms$c34_urban_scenario;SSP4;SSP1;SSP4;SSP4;SSP1
gms$c32_aff_policy;ndc;ndc;ndc;ndc;ndc
gms$c35_ad_policy;ndc;ndc;ndc;ndc;ndc
gms$c35_aolc_policy;ndc;ndc;ndc;ndc;ndc
gms$s35_forest_damage_end;2030;2030;2030;2030;2030
gms$s42_watdem_nonagr_scenario;2;1;2;2;1
gms$s42_irrig_eff_scenario;3;3;3;3;3
gms$c42_env_flow_policy;on;on;on;on;on
gms$c50_scen_neff;baseeff_add3_add15_add25_max75;baseeff_add3_add15_add25_max75;baseeff_add3_add15_add25_max75;baseeff_add3_add15_add25_max75;baseeff_add3_add15_add25_max75
gms$c50_scen_neff_noselect;baseeff_add3_add10_add15_max75;baseeff_add3_add10_add15_max75;baseeff_add3_add10_add15_max75;baseeff_add3_add10_add15_max75;baseeff_add3_add10_add15_max75
gms$c55_scen_conf;ssp1;ssp1;ssp1;ssp1;ssp1
gms$c55_scen_conf_noselect;ssp4;ssp4;ssp1;ssp4;ssp1
gms$c56_pollutant_prices;R21M42-SDP-PkBudg1000;R21M42-SDP-PkBudg1000;R21M42-SDP-PkBudg1000;R21M42-SDP-PkBudg1000;R21M42-SDP-PkBudg1000
gms$c56_pollutant_prices_noselect;R21M42-SDP-NPi;R21M42-SDP-NPi;R21M42-SDP-NPi;R21M42-SDP-PkBudg1000;R21M42-SDP-PkBudg1000
gms$c60_1stgen_biodem;phaseout2020;phaseout2020;phaseout2020;phaseout2020;phaseout2020
gms$c60_2ndgen_biodem;R21M42-SDP-PkBudg1000;R21M42-SDP-PkBudg1000;R21M42-SDP-PkBudg1000;R21M42-SDP-PkBudg1000;R21M42-SDP-PkBudg1000
gms$c60_2ndgen_biodem_noselect;R21M42-SDP-PkBudg1000;R21M42-SDP-PkBudg1000;R21M42-SDP-PkBudg1000;R21M42-SDP-PkBudg1000;R21M42-SDP-PkBudg1000
gms$c60_res_2ndgenBE_dem;ssp4;sdp;ssp4;ssp4;sdp
gms$c70_feed_scen;ssp4;ssp1;ssp4;ssp4;ssp1
6 changes: 6 additions & 0 deletions config/projects/scenario_config_navigate.csv
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
;NAVIGATE_AllOff;NAVIGATE_LandSup;NAVIGATE_LandDem;NAVIGATE_AllOn
gms$s15_exo_waste;0;0;1;1
gms$s15_exo_diet;0;0;1;1
gms$c57_macc_version;PBL_2022;PBL_2022;PBL_2022;PBL_2022
gms$c57_macc_scenario;Default;Optimistic;Default;Optimistic
gms$s58_rewetting_switch;0;1;0;1
11 changes: 11 additions & 0 deletions config/projects/scenario_config_ngfs.csv
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
;NGFS_o_lowdem
gms$c15_food_scenario;SSP2
gms$c15_food_scenario_noselect;SSP2
gms$s15_exo_foodscen_convergence;1
gms$s15_exo_foodscen_functional_form;1
gms$s15_exo_foodscen_start;2020
gms$s15_exo_foodscen_target;2050
gms$s15_exo_waste;1
gms$s15_waste_scen;1.2
gms$s15_exo_diet;1
gms$c15_kcal_scen;healthy_BMI
Loading

0 comments on commit 3a0b9ba

Please sign in to comment.