From cf5a68f265764b906a79ef17e9aa351151e6058c Mon Sep 17 00:00:00 2001
From: clblatte <clemens.c.blattert@jyu.fi>
Date: Mon, 30 Mar 2020 17:04:09 +0300
Subject: [PATCH] include sim variants for CanESM2 model, cPouta

---
 Main.R   | 45 ++++++++++++++++++++++++++++++---------------
 loadDB.R |  4 ++--
 2 files changed, 32 insertions(+), 17 deletions(-)

diff --git a/Main.R b/Main.R
index c377a69..c275ecb 100644
--- a/Main.R
+++ b/Main.R
@@ -20,23 +20,38 @@ regime <- read.csv(paste0(path, "params/regimes.csv"), sep = ",", stringsAsFacto
 
 
 ### Simulation variant that will be load
-# specify which one:  "CC45"        climate change with RCP scenraio 4.5 
-#                     "CC45_SA"     RCP 4.5 and set aside without deadwood extraction (no other management regimes!)
-#                     "CC85"        climate change with RCP scenario 8.5 
-#                     "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!!
+### The corresponding db files need to be stored in folder "input_data"
+### specify which one should be read:
+
+
+# FOR MSC STUDENTS - total watershed have been already simulated:
+# variant simulated with WIN version of NON-climate sensitive SIMO version
+#                    "without"     no climate change
+#                    "without_SA"  no climate change and set aside without deadwood extraction (no other management regimes!)
+# 
+# variants simulated with WIN version of climate sensitive SIMO version, climate model HadGEM2
+#                    "CC45"        climate change with RCP scenraio 4.5 
+#                    "CC45_SA"     RCP 4.5 and set aside without deadwood extraction (no other management regimes!)
+#                    "CC85"        climate change with RCP scenario 8.5 
+#                    "CC85_SA"     RCP 8.5 and set aside without deadwood extraction (no other management regimes!)
+
+
+# FOR COMPARISON OF CLIMATE MODEL AND SIMO VERSIONS - ONLY 5 stands per watershed so far simulated
+# variants simulated with SIMO Linux version on cPouta, indicated by "p"
+# with climate model HadGEM2
+#                   "CC45_p"      RCP scenario 4.5
+#                   "CC85_p"      RCP scenario 8.5
+#                   "CC26_p"      NEW: RCP scenario 2.6
+#                   "CC0_p        NEW: RCP scenario 0, represents NO CLIMATE CHANGE ?? 
 #
+# with climate model CanESM2 (like in FutureBioEcon), indicated further by "canesm"
+#                   "CC45_p_canesm"      RCP sceanrio 4.5
+#                   "CC85_p_canesm"      RCP scenario 8.5
+#                   "CC26_p_canesm"      NEW: RCP scenario 2.6
+#                   "CC0_p_canesm"       NEW: RCP scenario 0
 
 
-sim_variant <- "CC0_p"  
+sim_variant <- "CC0_p_canesm"  
 
 
 ### Define the names of the databases (SIMO-output for 10 watersheds) that will be imported
@@ -67,7 +82,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", "CC45_p", "CC85_p", "CC26_p", "CC0_p")) {
+  if(sim_variant %in% c("CC45", "CC85", "without", "CC45_p", "CC85_p", "CC26_p", "CC0_p", "CC45_p_canesm", "CC85_p_canesm", "CC26_p_canesm", "CC0_p_canesm")) {
     
     # Run the script with the SQL query for all management regimes
     source(paste0(path, "structure_SIMO_rslDB_FBE.R"))  
diff --git a/loadDB.R b/loadDB.R
index 0aca984..3f188b2 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", "CC45_p", "CC85_p", "CC26_p", "CC0_p")) {
+  if(sim_variant %in% c("CC45", "CC85", "without", "CC45_p", "CC85_p", "CC26_p", "CC0_p", "CC45_p_canesm", "CC85_p_canesm", "CC26_p_canesm", "CC0_p_canesm")) {
     
    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", "CC45_p", "CC85_p", "CC26_p", "CC0_p")) {
+if(sim_variant %in% c("CC45", "CC85", "without", "CC45_p", "CC85_p", "CC26_p", "CC0_p", "CC45_p_canesm", "CC85_p_canesm", "CC26_p_canesm", "CC0_p_canesm")) {
   
   rslt <- rslt %>% mutate(regime = ifelse(regime %in% "SA", "SA_DWextract", regime))
   
-- 
GitLab