From bdd4298a43bf8bef76bd3bb46659334859fb15a3 Mon Sep 17 00:00:00 2001
From: Marianna Rottoli <marianna.rottoli@mail.polimi.it>
Date: Mon, 27 Apr 2020 17:52:29 +0200
Subject: [PATCH] Bugfix: calibration file name has edge transport description
 only if edge_esm is called.

---
 scripts/start/prepare_and_run.R | 16 ++++++++++------
 1 file changed, 10 insertions(+), 6 deletions(-)

diff --git a/scripts/start/prepare_and_run.R b/scripts/start/prepare_and_run.R
index ce92b62..9b4c442 100644
--- a/scripts/start/prepare_and_run.R
+++ b/scripts/start/prepare_and_run.R
@@ -227,11 +227,15 @@ prepare <- function() {
   #  create_ExogSameAsPrevious_CO2price_file(as.character(cfg$files2export$start["input_ref.gdx"]))
   #}  
   
-  # select demand pathway for transportation: options are conv (conventional demand pathway) and wise (wiseways, limited demand)
-  if(grepl("Wise", cfg$gms$cm_EDGEtr_scen)){
-  demTrsp = "wise"
-  } else {
-  demTrsp = "conv"
+  # select demand pathway for transportation when using the EDGE-T model: options are conv (conventional demand pathway) and wise (wiseways, limited demand)
+  if(transport == "edge_esm"){
+
+    if(grepl("Wise", cfg$gms$cm_EDGEtr_scen)){
+       demTrsp = "wise"
+    } else {
+       demTrsp = "conv"
+    }
+
   }
 
   # Calculate CES configuration string
@@ -242,7 +246,7 @@ prepare <- function() {
                                          "POP_", cfg$gms$cm_POPscen, "-",
                                          "GDP_", cfg$gms$cm_GDPscen, "-",
                                          "Kap_", cfg$gms$capitalMarket, "-",
-                                         "demTrsp_", demTrsp, "-",
+                                         ifelse(transport == "edge_esm", paste0( "demTrsp_", demTrsp, "-"), ""),
                                          "Reg_", substr(regionscode(cfg$regionmapping),1,10))
   
   # write name of corresponding CES file to datainput.gms
-- 
GitLab