Skip to content

Commit

Permalink
Merge branch 'magpiemodel:develop' into develop
Browse files Browse the repository at this point in the history
  • Loading branch information
jansteinhauser authored Feb 27, 2024
2 parents e15220b + 94339ec commit 487bb59
Show file tree
Hide file tree
Showing 28 changed files with 1,076 additions and 379 deletions.
4 changes: 3 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
## [Unreleased]

### changed
- **15_food** Added improved EAT Lancet diet implementation (EAT 2p0)
- **default.cfg** update input data to rev 4.99 (new validation data, new EATLancet recommendations, new semi-natural vegtation cropland data)
- **start_functions** Check if cfg$recalibrate is consistent with cfg$gms$s14_use_yield_calib
- **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.
- **default.cfg** Default for cfg$gms$peatland changed from `on` to `v2`
Expand All @@ -16,7 +18,6 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
- **scenario_config.csv** settings for cfg$gms$s35_secdf_distribution in `ForestryEndo` and `ForestryExo` changed from `2` to `0`
- **scenario_config.csv** removed erroneous setting `cc` from column `input`
- **default.cfg** update default `cfg$gms$c56_pollutant_prices` and `cfg$gms$c60_2ndgen_biodem` to `R32M46-SSP2EU-NPi`
- **default.cfg** update input data to rev 4.96
- **default.cfg** changed default for `cfg$gms$s56_buffer_aff` from 0.2 to 0.5
- **default.cfg** changed default for `cfg$gms$s32_aff_prot` from 0 to 1
- **21_trade** s21_trade_bal_damper for roundwood changed from 0.75 to 0.65
Expand All @@ -40,6 +41,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
- **52_carbon** bugfix acx long-term carbon density
- **32_forestry** keep c-density for timber plantations constant after rotation length to avoid unrealistic carbon sequestration in unharvested timber plantation
- **32_forestry** bugfix unit p32_observed_gs_reg
- **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

## [4.7.0] - 2023-12-11

Expand Down
108 changes: 62 additions & 46 deletions config/default.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -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.96_h12_magpie.tgz",
cellular = "rev4.96_h12_fd712c0b_cellularmagpie_c200_MRI-ESM2-0-ssp370_lpjml-8e6c5eb1.tgz",
validation = "rev4.96_h12_validation.tgz",
additional = "additional_data_rev4.47.tgz",
cfg$input <- c(regional = "rev4.99_h12_magpie.tgz",
cellular = "rev4.99_h12_fd712c0b_cellularmagpie_c200_MRI-ESM2-0-ssp370_lpjml-8e6c5eb1.tgz",
validation = "rev4.99_h12_validation.tgz",
additional = "additional_data_rev4.48.tgz",
calibration = "calibration_H12_per_ton_fao_may22_glo_08Aug23.tgz")

# NOTE: It is recommended to recalibrate the model when changing cellular input data
Expand Down Expand Up @@ -56,8 +56,8 @@ cfg$force_download <- FALSE
cfg$force_replace <- FALSE

# Settings for the yield calibration
# For this yield calibration (that uses results from a special MAgPIE calibration run
# triggered by the recalibrate switch) to be activated the switch s14_use_yield_calib needs
# For this yield calibration (that uses results from a special MAgPIE calibration run
# triggered by the recalibrate switch) to be activated the switch s14_use_yield_calib needs
# to be turned on. (Default is off)
# This switch should only be activated for penalty_apr22 crop realization.
# For other realizations, it is recommended not to use this yield calibration.
Expand Down Expand Up @@ -325,7 +325,7 @@ cfg$gms$s14_degradation <- 0 # def = 0

# Switch to toggle the use of yield calibration factors (that resulted from a calibration run).
# If 0, no yield calibration factors are used, meaning all calibration factors are set to 1.
# If 1, yield calibration factors are used. (For this option to function, either an existing calibration file
# If 1, yield calibration factors are used. (For this option to function, either an existing calibration file
# must be supplied in the input directory, or yields must be recalibrated during preprocessing.)
# This switch should only be activated for penalty_apr22 crop realization.
# For other realizations, it is recommended not to use this yield calibration.
Expand Down Expand Up @@ -421,16 +421,25 @@ cfg$gms$s15_exo_waste <- 0 # def = 0
# * (1.2): corresponds to 20% food waste ~ half waste of HIC
cfg$gms$s15_waste_scen <- 1.2 # def = 1.2

# * switch for transition to exogenous diet scenarios (EAT Lancet and National Institute of Nutrition (NIN))
# * (2): transition towards exogenous diets (NIN for India and EAT for other regions)
# * Please use this switch in combination with cfg$gms$c15_EAT_scen <- "FLX_hmilk"
# * If only India's diet needs to be changed, then set cfg$gms$scen_countries15 <- "IND"
# * (1): transition towards exogenous diets and food demand
# * (0): regression-based estimation of diets and food demand
# * Switch for transition to exogenous diet scenarios
# * (EAT Lancet and National Institute of Nutrition (NIN))
# * (3): MAgPIE-specific realization of the EAT-Lancet diet, where model-internal
# * (regression-based) food demand projections are constrained by ranges for
# * intake targets of food groups to ensure healthy and sustainable diets as
# * recommended by the EAT-Lancet Commission (following Springmann et al. 2018 and Willett et al. 2019)
# * (2): transition towards exogenous diets (NIN for India and EAT for other regions)
# * Please use this switch in combination with cfg$gms$c15_EAT_scen <- "FLX_hmilk"
# * If only India's diet needs to be changed, then set cfg$gms$scen_countries15 <- "IND"
# * (1): transition towards exogenous diets and food demand parametrized
# * to a food-specific data set published by the EAT-Lancet Commission
# * (Willett et al., 2019). This EATLancet implementation is deprecated.
# * Please use MAgPIE-specific realization of the EAT-Lancet diet (3)
# * for EATLancet diet.
# * (0): regression-based estimation of diets and food demand
cfg$gms$s15_exo_diet <- 0 # def = 0

# * exogenous calorie scenario (EAT Lancet diet scenarios)
# * only activated if s15_exo_diet is set to 1
# * only activated if s15_exo_diet is > 0
# * options: healthy_BMI, 2100kcal, 2500kcal,
# * endo, no_underweight, no_overweight
# * half_overweight, no_underweight_half_overweight
Expand All @@ -445,35 +454,37 @@ cfg$gms$s15_exo_diet <- 0 # def = 0
cfg$gms$c15_kcal_scen <- "healthy_BMI" # def = healthy_BMI
#
# * exogenous food-specific diet scenario (EAT Lancet diet scenarios)
# * only activated if s15_exo_diet is set to 1
# * only activated if s15_exo_diet is 1 or 2
# * options: BMK, FLX, PSC, VEG, VGN, FLX_hmilk, FLX_hredmeat
cfg$gms$c15_EAT_scen <- "FLX" # def = FLX

# * Subspecifications: Which commodities shall be included in the diet shift
# * towards cfg$gms$c15_EAT_scen ? Only selected (1) commodities will be
# * Sub-specifications: Which commodities shall be included in the diet shift
# * towards the selected scenario diet? Only selected (1) commodities will be
# * included, while the others will remain to be endogenous.
# * Any shift will be compensated to reach the calorie target by adjusting
# * staple calories.
cfg$gms$s15_exo_monogastric <- 1 # def = 1, options: 0,1
cfg$gms$s15_exo_ruminant <- 1 # def = 1, options: 0,1
cfg$gms$s15_exo_fish <- 1 # def = 1, options: 0,1
cfg$gms$s15_exo_fruitvegnut <- 1 # def = 1, options: 0,1
cfg$gms$s15_exo_pulses <- 1 # def = 1, options: 0,1
cfg$gms$s15_exo_sugar <- 1 # def = 1, options: 0,1
cfg$gms$s15_exo_oils <- 1 # def = 1, options: 0,1
cfg$gms$s15_exo_brans <- 1 # def = 1, options: 0,1
cfg$gms$s15_exo_scp <- 1 # def = 1, options: 0,1
cfg$gms$s15_exo_monogastric <- 1 # def = 1, options: 0,1
cfg$gms$s15_exo_ruminant <- 1 # def = 1, options: 0,1
cfg$gms$s15_exo_fish <- 1 # def = 1, options: 0,1
cfg$gms$s15_exo_fruitvegnut <- 1 # def = 1, options: 0,1
cfg$gms$s15_exo_roots <- 1 # def = 1, options: 0,1 (only relevant for new EATLancet realization s15_exo_diet=3)
cfg$gms$s15_exo_pulses <- 1 # def = 1, options: 0,1
cfg$gms$s15_exo_sugar <- 1 # def = 1, options: 0,1
cfg$gms$s15_exo_oils <- 1 # def = 1, options: 0,1
cfg$gms$s15_exo_brans <- 0 # def = 0 (as no target defined in EATLancet, they are kept at their projected level, unless switch activated (1), then brans are set to 0), options: 0,1
cfg$gms$s15_exo_scp <- 1 # def = 1, options: 0,1

# * Scenario target for the inclusion of alcohol in the EAT-Lancet diet
# * The EAT-Lancet diet only allows for added sugars, but does not include processed food or
# * alcohol.
# * only activated if s15_exo_diet is set to 1
cfg$gms$s15_exo_alcohol <- 1 # default: 1
# * The EAT-Lancet diet only allows for added sugars,
# * but does not include processed food or alcohol.
# * Only activated if s15_exo_diet is set to 1 or 3
cfg$gms$s15_exo_alcohol <- 1 # def = 1, options: 0,1
# * Via 's15_alc_scen' a maximum target for alcohol consumption can be defined.
# * Only activated if s15_exo_alcohol = 1
# * (0): no alcohol consumption, as in the original version of the EAT-Lancet diet
# * (0.014): maximum target for alcohol consumption is 1.4% of total calorie consumption
# * (see Lassen et al., 2020)
cfg$gms$s15_alc_scen <- 0.014 # def = 0.014
cfg$gms$s15_alc_scen <- 0 # def = 0
#
#
# * Switch and specification of countries for which exogenous food scenarios
Expand Down Expand Up @@ -554,6 +565,11 @@ cfg$gms$c20_scp_type <- "sugar" # def = sugar
# * to exports
cfg$gms$trade <- "selfsuff_reduced" # def = selfsuff_reduced

# * option for `exo` realization only:
# * fix `v21_manna_from_heaven` to zero (0) or not (1)
# Note: Without fixing to zero, v21_manna_from_heaven might be used unnecessarily in runs started with highres.R
cfg$gms$s21_manna_from_heaven <- 0

# * trade balance reduction scenario
# * (l909090r808080): 10 percent trade liberalisation for secondary and
# * livestock products in 2030,2050,2100 and 20 percent for
Expand Down Expand Up @@ -775,11 +791,11 @@ cfg$gms$s32_max_aff_area <- Inf # def = Inf
# Protection of afforested areas (endogenous CO2 price driven)
# 0=until end of planning horizon (see s32_planing_horizon)
# 1=forever
# Note: Without a price on CO2 emissions from land-use change in module 32_forestry,
# which is the current default (c56_emis_policy <- "reddnatveg_nosoil"),
# the recommended setting for s32_aff_prot is 1.
# Otherwise, the model can do re/afforestation on existing re/afforestation areas
# after the end of planning horizon without penalty for CO2 emissions.
# Note: Without a price on CO2 emissions from land-use change in module 32_forestry,
# which is the current default (c56_emis_policy <- "reddnatveg_nosoil"),
# the recommended setting for s32_aff_prot is 1.
# Otherwise, the model can do re/afforestation on existing re/afforestation areas
# after the end of planning horizon without penalty for CO2 emissions.
cfg$gms$s32_aff_prot <- 1 # def = 1

# Type of afforestation constraint
Expand Down Expand Up @@ -1274,7 +1290,7 @@ cfg$gms$c50_scen_neff_noselect <- "baseeff_add3_add5_add10_max65" # def = base

# * For pastures, only two scenarios exist: a constant scenario, and one where
# * the minimum NUE increases to 55,60 and 65% for 2020,2050 and 2100, to avoid
# * that pastures which dont have a nutrient deficit are fertilized
# * that pastures which do not have a nutrient deficit are fertilized
# * (historical NUE may be low despite no fertilization)
# * Options:
# * constant, constant_min55_min60_min65
Expand Down Expand Up @@ -1367,7 +1383,7 @@ cfg$gms$s56_cprice_red_factor <- 1 # def = 1
# * Note: For best consistency it is recommended to use trajectories from the most recent
# * coupled REMIND-MAgPIE runs. Currently, this is R32M46.
# * Available options:
# * none: no 2nd generation bioenergy demand
# * none: no 2nd generation bioenergy demand
# * R32M46: Coupled REMIND-MAgPIE runs with REMIND 3.2.1.dev412 and MAgPIE 4.6.11
# * NPi: Current policies; limit peak warming to 3.0°C
# * NDC: Nationally determined contributions; limit peak warming to 2.5°C
Expand Down Expand Up @@ -1466,9 +1482,9 @@ cfg$gms$c56_cprice_aff <- "secdforest_vegc" # def = secdforest_vegc
# * should not be higher than s32_planing_horizon
cfg$gms$s56_c_price_exp_aff <- 50 # def = 50

# * Share of carbon credits for re/afforestation projects set aside in a buffer to
# * Share of carbon credits for re/afforestation projects set aside in a buffer to
# * account for potential failure of permanent carbon storage.
# * Alternatively, this parameter can be interpreted as a reduction factor
# * Alternatively, this parameter can be interpreted as a reduction factor
# * of the carbon price for non-permanent CDR.
# * Values > 0 will reduce the incentive for c-price-induced re/afforestation
cfg$gms$s56_buffer_aff <- 0.5 # def = 0.5
Expand Down Expand Up @@ -1551,10 +1567,10 @@ cfg$gms$s57_maxmac_ch4_awms <- -1 # def = -1

# ***--------------------- 58_peatland ------------------------------------
# * (off): Peatland area and associated GHG emissions are assumed zero
# * (v2): Peatland area is initialized with degraded and intact peatland area for the year 2022,
# * (v2): Peatland area is initialized with degraded and intact peatland area for the year 2022,
# * and projected into the future based on changes in managed land.
# * For boreal and tropical climates, GHG emissions are calculated using emission
# * factors from the IPCC 2013 Wetland supplement. For temperate climates, more recent
# * For boreal and tropical climates, GHG emissions are calculated using emission
# * factors from the IPCC 2013 Wetland supplement. For temperate climates, more recent
# * estimates from Tiemeyer et al 2020 are used.
cfg$gms$peatland <- "v2" # def = v2

Expand All @@ -1575,8 +1591,8 @@ cfg$gms$s58_cost_drain_rewet_onetime <- 0 # def = 0
cfg$gms$s58_cost_drain_recur <- 0 # def = 0


# * Switch for fixing peatland area until the year given by s58_fix_peatland to historic levels (not available in `off`).
# * Note: In the realisation `v2`, historic peatland area is only available for the year 2022.
# * Switch for fixing peatland area until the year given by s58_fix_peatland to historic levels (not available in `off`).
# * Note: In the realisation `v2`, historic peatland area is only available for the year 2022.
# * Due to the 5-year time step limitation in MAgPIE, the suggested default is 2020.
# * Fixing peatland area in previous time steps provides a better
# * proxy for GHG emissions from peatlands than assuming no peatland area.
Expand Down Expand Up @@ -1628,7 +1644,7 @@ cfg$gms$c60_1stgen_biodem <- "const2020" # def = const2020
# * Note: For best consistency it is recommended to use trajectories from the most recent
# * coupled REMIND-MAgPIE runs. Currently, this is R32M46.
# * Available options:
# * none: no 2nd generation bioenergy demand
# * none: no 2nd generation bioenergy demand
# * R32M46: Coupled REMIND-MAgPIE runs with REMIND 3.2.1.dev412 and MAgPIE 4.6.11
# * NPi: Current policies; limit peak warming to 3.0°C
# * NDC: Nationally determined contributions; limit peak warming to 2.5°C
Expand Down
Loading

0 comments on commit 487bb59

Please sign in to comment.