Skip to content

Commit

Permalink
Merge pull request #762 from FelicitasBeier/DeepDive_Develop
Browse files Browse the repository at this point in the history
Deep dive develop
  • Loading branch information
pascal-sauer authored Jan 17, 2025
2 parents 183c89c + 68fd7b7 commit 0cae50d
Show file tree
Hide file tree
Showing 5 changed files with 235 additions and 4 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
## [4.9.0] - 2024-12-05

### changed
- **scripts** changed EL2 Deep Dive c30_bioen_water switch to all and added sensitivity for paper revision
- **35_natveg** revised age-class initialization of secondary forest
- **38_factor_costs** updated use of USDA cost shares
- **config** changed default input data to use 2017USD
Expand Down
1 change: 1 addition & 0 deletions config/projects/scenario_config_el2.csv
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ 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$c30_bioen_water;all;all;all
gms$factor_costs;sticky_labor;sticky_labor;sticky_labor
gms$c70_feed_scen;ssp1;ssp2;ssp2
input['cellular'];rev4.116EL2_h12_c6a7458f_cellularmagpie_c200_IPSL-CM6A-LR-ssp370_lpjml-8e6c5eb1.tgz;;
Expand Down
8 changes: 6 additions & 2 deletions scripts/start/projects/project_EAT2p0.R
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,10 @@ cfg$output <- c(
"rds_report"
)

# Set path to own coupled runs:
path2MitigationRun <- "/p/projects/magpie/users/beier/EL2_DeepDive_release_v3/remind/output/C_SSP2EU-DSPkB650-DS_betax_AgMIP-rem-12/REMIND_generic_C_SSP2EU-DSPkB650-DS_betax_AgMIP-rem-12.mif"


#######################
# SCENARIO DEFINITION #
#######################
Expand Down Expand Up @@ -136,9 +140,9 @@ waste <- function(cfg) {
# starting from 2020.
miti <- function(cfg) {
# Mitigation: consistent with 1.5C considering diet change
cfg$path_to_report_ghgprices <- "/p/projects/magpie/users/beier/EL2_DeepDive_release/remind/output/C_SSP2EU-DSPkB650-DS_betax_AgMIP-rem-12/REMIND_generic_C_SSP2EU-DSPkB650-DS_betax_AgMIP-rem-12.mif"
cfg$path_to_report_ghgprices <- path2MitigationRun
cfg$gms$c56_pollutant_prices <- "coupling"
cfg$path_to_report_bioenergy <- "/p/projects/magpie/users/beier/EL2_DeepDive_release/remind/output/C_SSP2EU-DSPkB650-DS_betax_AgMIP-rem-12/REMIND_generic_C_SSP2EU-DSPkB650-DS_betax_AgMIP-rem-12.mif"
cfg$path_to_report_bioenergy <- path2MitigationRun
cfg$gms$c60_2ndgen_biodem <- "coupling"

return(cfg)
Expand Down
6 changes: 4 additions & 2 deletions scripts/start/projects/project_EAT2p0_DeepDive.R
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
# | Contact: magpie@pik-potsdam.de

# ----------------------------------------------------------
# description: EAT2p0 project simulations 2024
# description: EAT2p0 simulations for Beier et al. 2025
# ----------------------------------------------------------

######################################
Expand Down Expand Up @@ -41,7 +41,7 @@ cfg$output <- c(
)

# Set path to own coupled runs:
path2MitigationRun <- "/p/projects/magpie/users/beier/EL2_DeepDive_release/remind/output/C_SSP2EU-DSPkB650-DS_betax_DeepDive_noNDC-rem-12/REMIND_generic_C_SSP2EU-DSPkB650-DS_betax_DeepDive_noNDC-rem-12.mif"
path2MitigationRun <- "/p/projects/magpie/users/beier/EL2_DeepDive_release_v3/remind/output/C_SSP2EU-DSPkB650-DS_betax_DeepDive_noNDC-rem-12/REMIND_generic_C_SSP2EU-DSPkB650-DS_betax_DeepDive_noNDC-rem-12.mif"


#######################
Expand Down Expand Up @@ -92,6 +92,8 @@ bau <- function(cfg) {
cfg$gms$c56_pollutant_prices <- "R21M42-SSP2-NPi" # default
cfg$path_to_report_bioenergy <- NA
cfg$gms$c60_2ndgen_biodem <- "R21M42-SSP2-NPi" # default
# Allow irrigated and rainfed bioenergy production
cfg$gms$c30_bioen_water <- "all"

# Setting REMIND scenario for blackmagicc
cfg$magicc_emis_scen <- "REMIND_generic_C_SSP2EU-DSPkB650-DS_betax_DeepDive_noNDC-rem-12.mif"
Expand Down
223 changes: 223 additions & 0 deletions scripts/start/projects/project_EAT2p0_DeepDive_Sensitivity.R
Original file line number Diff line number Diff line change
@@ -0,0 +1,223 @@
# | (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: EAT2p0 sensitivity simulations for Beier et al. 2025
# ----------------------------------------------------------

######################################
#### Script to start a MAgPIE run ####
######################################

library(lucode2)
library(magclass)
library(gms)

# Load start function needed to start MAgPIE runs
source("scripts/start_functions.R")
# obtain settings from default config
source("config/default.cfg")

# set title and date
cfg$results_folder <- "output/:title::date:"
cfg$force_download <- TRUE

# Special outputs required for Deep Dive
cfg$qos <- "standby_highMem_dayMax"
cfg$output <- c(
"output_check",
"extra/disaggregation",
"projects/FSEC_nitrogenPollution",
"projects/FSEC_water",
"projects/agmip_report",
"rds_report",
"runBlackmagicc"
# add output file: pb_report (magpie (special mif created by getReportPBindicators & remind mif (REMIND_generic_scenName.mif))
)

# Set path to own coupled runs:
path2MitigationRun <- "/p/projects/magpie/users/beier/EL2_DeepDive_release_v3/remind/output/C_SSP2EU-DSPkB650-DS_betax_DeepDive_noNDC-rem-12/REMIND_generic_C_SSP2EU-DSPkB650-DS_betax_DeepDive_noNDC-rem-12.mif"

#####################################
### Sensitivity Settings and Runs ###
#####################################

for (ssp in c("SSP1", "SSP2", "SSP3", "SSP4", "SSP5")) {

#######################
# SCENARIO DEFINITION #
#######################
cfg <- setScenario(cfg, c("nocc_hist", ssp, "NPI"))
cfg <- setScenario(cfg, c("EL2_default"), scenario_config = "config/projects/scenario_config_el2.csv")

# Note: The climate change impacts setting differs from the global AgMIP model comparision set-up.
# We do not include climate change impacts in the coupled REMIND-MAgPIE runs for the PB Deep Dive
# because we focus exclusively on the mitigation aspect without climate change impacts.

### BAU Scenario ###
# SSP: SSP2
# Diet: BAU-SSP2
# Waste: BAU-SSP2
# Crop and Livestock productivity: BAU-SSP2
# Mitigation policies: current policies
# Land-use policies: current policies
# RCP/GCM: 7p0 shocks on crops, livestock, labor
# Trade: BAU
bau <- function(cfg) {

# time steps until 2150
cfg$gms$c_timesteps <- "less_TS"

# for feasibility
cfg$gms$s80_optfile <- 1

cfg$gms$factor_costs <- "sticky_labor"
### Components for Decomposition ###
# Diets: exogenous EATLancet diet
cfg$gms$s15_exo_diet <- 0 # default
cfg$gms$c15_kcal_scen <- "healthy_BMI" # default (but not active b/c of s15_exo_diet = 0)
cfg$gms$c15_EAT_scen <- "FLX" # default (but not active b/c of s15_exo_diet = 0)
cfg$gms$c09_pal_scenario <- ssp
# Waste: half food waste
cfg$gms$s15_exo_waste <- 0 # default
cfg$gms$s15_waste_scen <- 1.2 # default (but not active b/c of s15_exo_waste = 0)
# Default interest rate (for default productivity)
cfg$gms$s12_interest_lic <- 0.1 # default
cfg$gms$s12_interest_hic <- 0.04 # default
# Default livestock productivity
cfg$gms$c70_feed_scen <- ssp
# Mitigation: no mitigation beyond NPI
cfg$gms$c56_emis_policy <- "redd+natveg_nosoil" # default
cfg$path_to_report_ghgprices <- NA
cfg$gms$c56_pollutant_prices <- "R21M42-SSP2-NPi" # default
cfg$path_to_report_bioenergy <- NA
cfg$gms$c60_2ndgen_biodem <- "R21M42-SSP2-NPi" # default

# Allow irrigated and rainfed bioenergy production
cfg$gms$c30_bioen_water <- "all"

# Setting REMIND scenario for blackmagicc
cfg$magicc_emis_scen <- "REMIND_generic_C_SSP2EU-DSPkB650-DS_betax_DeepDive_noNDC-rem-12.mif"

return(cfg)
}

### Diet component ##
# Globally achieves EL2 diet by 2050
diet <- function(cfg) {
# Transition towards EL2 food intake recommendations until 2050
cfg$gms$s15_exo_diet <- 3
# Physical inactivity levels are reduced to 0 from 2020 to 2050
cfg$gms$c09_pal_scenario <- "SDP"
return(cfg)
}

### Waste component ##
# Reduction (halving) of food loss and waste
waste <- function(cfg) {
# Waste: half food waste
cfg$gms$s15_exo_waste <- 1
cfg$gms$s15_waste_scen <- 1.2
return(cfg)
}

### Mitigation component ##
# Adds mitigation and land-use policies consistent with 1.5C by 2050 to BAU
# Note on our implementation:
# We use a GHG pricing pathway based on a peak budget of 500 with overshoot
# starting from 2020 and diet shift.
miti <- function(cfg) {
# Mitigation: consistent with 1.5C considering Diet change
cfg$path_to_report_ghgprices <- path2MitigationRun
cfg$gms$c56_pollutant_prices <- "coupling"
cfg$path_to_report_bioenergy <- path2MitigationRun
cfg$gms$c60_2ndgen_biodem <- "coupling"
# ecoSysProtAll: (Above ground CO2 emis from LUC in forest, forestry, natveg; All types of emis from peatland; All CH4 and N2O emis),
cfg$gms$c56_emis_policy <- "ecoSysProtAll"

return(cfg)
}

# Bioenergy demand only. No carbon price on land included.
bioenergy <- function(cfg) {
# Mitigation: only Bioenergy demand from coupled REMIND-MAgPIE run where 1.5 is reached with ghg prices on land and considering diet shift
cfg$path_to_report_bioenergy <- path2MitigationRun
cfg$gms$c60_2ndgen_biodem <- "coupling"

return(cfg)
}

# CO2 from land use change is priced.
priceCO2 <- function(cfg) {
# Mitigation: only price land CO2
cfg$gms$c56_pollutant_prices <- "coupling"
cfg$path_to_report_ghgprices <- path2MitigationRun
cfg$gms$c56_emis_policy <- "ecoSysProtAll_agMgmtOff" #### double-check Florian or Leon

return(cfg)
}

# Pricing of all CH4 and N2O emissions except for peatland
priceNonCO2 <- function(cfg) {
# Mitigation: only CH4 and N2O price
cfg$gms$c56_pollutant_prices <- "coupling"
cfg$path_to_report_ghgprices <- path2MitigationRun
cfg$gms$c56_emis_policy <- "ecoSysProtOff" ### double-check Florian or Leon

return(cfg)
}


#################
# SCENARIO RUNS #
#################
# BAU #
# Business as usual scenario based on SSP2 (NPis)
cfg$title <- paste0(ssp, "_BAU_NPi")
cfg <- setScenario(cfg, c("nocc_hist", ssp, "NPI"))
cfg <- setScenario(cfg, c("EL2_default"), scenario_config = "config/projects/scenario_config_el2.csv")
cfg <- bau(cfg = cfg)
start_run(cfg, codeCheck = FALSE)

# (1a,b,c,d) BAU_MIT #
# All production-side land-based mitigation measures
cfg$title <- paste0(ssp, "_BAU_Miti")
# standard setting, but with NDC for miti
cfg <- setScenario(cfg, c("nocc_hist", ssp, "NPI"))
cfg <- setScenario(cfg, c("EL2_default"), scenario_config = "config/projects/scenario_config_el2.csv")
# BAU settings
cfg <- bau(cfg = cfg)
# Mitigation (CO2, non-CO2, bioenergy)
cfg <- miti(cfg = cfg)
start_run(cfg, codeCheck = FALSE)

# (1e,f,g) Demand-side options (Diet+Waste) by 2050
cfg$title <- paste0(ssp, "_BAU_Dem")
cfg <- setScenario(cfg, c("nocc_hist", ssp, "NPI"))
cfg <- setScenario(cfg, c("EL2_default"), scenario_config = "config/projects/scenario_config_el2.csv")
cfg <- bau(cfg = cfg)
cfg <- diet(cfg = cfg)
cfg <- waste(cfg = cfg)
start_run(cfg, codeCheck = FALSE)

### All measures ###
# MITI_All #
# All production-side land-based mitigation measures and demand-side mitigation (diet change)
cfg$title <- paste0(ssp, "_MITI_All")
# standard setting, but with NDC for miti
cfg <- setScenario(cfg, c("nocc_hist", ssp, "NPI"))
cfg <- setScenario(cfg, c("EL2_default"), scenario_config = "config/projects/scenario_config_el2.csv")
# BAU settings
cfg <- bau(cfg = cfg)
# Mitigation (CO2, non-CO2, bioenergy)
cfg <- miti(cfg = cfg)
# PHD (diet, waste)
cfg <- diet(cfg = cfg)
cfg <- waste(cfg = cfg)
start_run(cfg, codeCheck = FALSE)

}

0 comments on commit 0cae50d

Please sign in to comment.