From faf4b7d8a7bbf0562cfc1284d51273c7c547929f Mon Sep 17 00:00:00 2001
From: clblatte <clemens.c.blattert@jyu.fi>
Date: Sat, 28 Mar 2020 12:03:15 +0200
Subject: [PATCH] include cpouta sim variants: CC45_p, CC85_p, CC26_p, CC0_p

---
 Main.R   | 14 +++++++++++---
 loadDB.R |  4 ++--
 2 files changed, 13 insertions(+), 5 deletions(-)

diff --git a/Main.R b/Main.R
index ed2cc47..c377a69 100644
--- a/Main.R
+++ b/Main.R
@@ -26,9 +26,17 @@ regime <- read.csv(paste0(path, "params/regimes.csv"), sep = ",", stringsAsFacto
 #                     "CC85_SA"     RCP 8.5 and set aside without deadwood extraction (no other management regimes!)
 #                     "without"     no climate change
 #                     "without_SA"  no climate change and set aside without deadwood extraction (no other management regimes!)
+#
+# variants simulated with SIMO Linux version on cPouta virtual machine are indicated by "p" -> output comparison.
+#
+#                     "CC45_p"      RCP scenario 4.5 
+#                     "CC85_p"      RCP scenario 8.5
+#                     "CC26_p"      NEW: RCP scenario 2.6, was not simulated before
+#                     "CC0_p        NEW: RCP scenario 0, represent NO CLIMATE CHANGE, NEEDS TO BE validated!!
+#
 
 
-sim_variant <- "CC45"  
+sim_variant <- "CC0_p"  
 
 
 ### Define the names of the databases (SIMO-output for 10 watersheds) that will be imported
@@ -59,7 +67,7 @@ first_load = FALSE
 if(first_load == TRUE){
 
   # If one of the follwing simulation variants is read ...
-  if(sim_variant %in% c("CC45", "CC85", "without")) {
+  if(sim_variant %in% c("CC45", "CC85", "without", "CC45_p", "CC85_p", "CC26_p", "CC0_p")) {
     
     # Run the script with the SQL query for all management regimes
     source(paste0(path, "structure_SIMO_rslDB_FBE.R"))  
@@ -107,7 +115,7 @@ columns <-  paste0("id,
 # If data is loaded for the firest time OR "new columns have to be loaded" (takes some time):     csv_exits = FALSE 
 
 
-csv_exist = FALSE
+csv_exist = TRUE
 
 
 ### the following lines do not need any changes ###
diff --git a/loadDB.R b/loadDB.R
index 551577b..0aca984 100644
--- a/loadDB.R
+++ b/loadDB.R
@@ -41,7 +41,7 @@ for (name in db_names){
   
   
   ### Rename set aside scenario if it considers deadwood extraction
-  if(sim_variant %in% c("CC45", "CC85", "without")) {
+  if(sim_variant %in% c("CC45", "CC85", "without", "CC45_p", "CC85_p", "CC26_p", "CC0_p")) {
     
    rsl <- rsl %>% mutate(regime = ifelse(regime %in% "SA", "SA_DWextract", regime))
     
@@ -76,7 +76,7 @@ rslt <- rslt %>%
 
 
 ### Rename set aside scenario if it considers deadwood extraction
-if(sim_variant %in% c("CC45", "CC85", "without")) {
+if(sim_variant %in% c("CC45", "CC85", "without", "CC45_p", "CC85_p", "CC26_p", "CC0_p")) {
   
   rslt <- rslt %>% mutate(regime = ifelse(regime %in% "SA", "SA_DWextract", regime))
   
-- 
GitLab