-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathrun_STURM_offline_TEST.R
105 lines (74 loc) · 3.38 KB
/
run_STURM_offline_TEST.R
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
# Script to be run in Rstudio
library(rstudioapi)
library(tidyverse)
library(readxl)
setwd(dirname(rstudioapi::getSourceEditorContext()$path))
source("./STURM_model/F10_scenario_runs_MESSAGE_2100.R")
#Paths
rcode_path <- paste(getwd(),"/STURM_model/",sep="")
data_path <- paste(getwd(),"/STURM_data/",sep="")
rout_path <- paste(getwd(),"/STURM_output/",sep="")
prices <- read.csv(paste0(data_path,"input_prices_R12.csv"))
# call STURM
sturm_scenarios <- run_scenario(run = "NAV_Dem-NPi-ref",
scenario_name = "NAV_Dem-NPi-ref",
sector = "resid",
path_in=data_path,
path_rcode=rcode_path,
path_out=rout_path,
prices=prices,
file_inputs = "input_list_resid.csv",
file_scenarios = "scenarios_TEST.csv",
geo_level = "region_bld", # Level for analysis
geo_level_aggr = "region_gea", # Level for aggregation
geo_levels = c("region_bld", "region_gea"), # Levels to keep track of
geo_level_report="R12",
yrs = seq(2015,2050,5),
input_mode = "csv",
mod_arch = "stock",
report_type = c("MESSAGE","STURM","NAVIGATE"), # Available reports: c("MESSAGE","STURM","IRP","NGFS","NAVIGATE")
report_var = c("energy","material") # Available report variables: c("energy","material","vintage","dle")
)
#
# # write results to csv file
# write.csv(sturm_scenarios,paste("./temp/",sect,"_sturm.csv",sep=""),row.names=F)
##############################################
## Run out of the function - For debugging
# Run the commands below and then the content of function "run_scenario" in the script "F10_scenario_runs_MESSAGE_2100.R"
rcode_path <- paste(getwd(),"/STURM_model/",sep="")
data_path <- paste(getwd(),"/STURM_data/",sep="")
rout_path <- paste(getwd(),"/STURM_output/",sep="")
file_input <- "input_list_resid.csv"
file_scenario <- "scenarios_TEST.csv"
prices<-read.csv(paste0(data_path,"input_prices_R12.csv"))
scen <- "NAV_Dem-NPi-ref"
#scen <- "NAV_Dem-NPi-all"
#scen <- "SDP_EI-NPi"
#scen <- "NAV_Dem-NPi-tec"
#clim_scen <- "BL"
sect <- "resid"
#sect <- "comm"
run = scen
scenario_name = scen
prices=prices
path_in=data_path
path_rcode=rcode_path
path_out=rout_path
sector=sect
geo_level = "region_bld" # Level for analysis
geo_level_aggr = "region_gea" # Level for aggregation
geo_levels <- c("region_bld", "region_gea") # Levels to keep track of
geo_level_report="R12"
yrs = seq(2015,2050,5)
# yrs <- c(seq(2015,2060,5),seq(2070,2100,10))
# # Input data type:
# Values allowed: "RData", "csv"
input_mode <- "csv"
#input_mode <- "rdata"
# Running setting: # Share of buildings archetypes:
# mod_arch = "new", # provided for new buildings (on the margin)
mod_arch <- "stock" # provided for the entire stock - Default
# Report types
report_type = c("MESSAGE","STURM","NAVIGATE") # Available reports: c("MESSAGE","STURM","IRP","NGFS","NAVIGATE")
# Reporting variables
report_var=c("energy","material") # Available report variables: c("energy","material","vintage","dle")