Skip to content

Commit

Permalink
co26 deforestation tests
Browse files Browse the repository at this point in the history
  • Loading branch information
abhimishr committed Aug 7, 2023
1 parent cfd949c commit dea8e97
Showing 1 changed file with 51 additions and 0 deletions.
51 changes: 51 additions & 0 deletions scripts/start/projects/cop26_deforestation.R
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
# | (C) 2008-2021 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: Simulations for COP26 deforestation declaration
# ----------------------------------------------------------

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

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

# Load start_run(cfg) function which is needed to start MAgPIE runs
source("scripts/start_functions.R")

log_folder <- "run_details"
dir.create(log_folder, showWarnings = FALSE)

identifier_flag = "DEF02"

xx <- c()
all_configs <- list()

scen_vector <- c("ForestryEndo")

for (s10_cop26_deforestation in c(0, 1)){

source("config/default.cfg")

cfg <- setScenario(cfg, c("SSP2", "NPI", "ForestryEndo"))

cfg$gms$s10_cop26_deforestation <- s10_cop26_deforestation

if(cfg$gms$s10_cop26_deforestation == 0) cop26_flag = "BAU"
if(cfg$gms$s10_cop26_deforestation == 1) cop26_flag = "COP26"

cfg$title <- paste(identifier_flag, cop26_flag, sep = "_")

xx <- c(xx,cfg$title)
all_configs[[cfg$title]] <- cfg
cfg$gms$s80_optfile <- 0
cfg$results_folder <- "output/:title:"
start_run(cfg,codeCheck=FALSE)
}

0 comments on commit dea8e97

Please sign in to comment.