-
Notifications
You must be signed in to change notification settings - Fork 3
/
run_STURM_offline_SSP_2023_ex.R
121 lines (84 loc) · 4.01 KB
/
run_STURM_offline_SSP_2023_ex.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
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
# 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="")
input_path <- paste(getwd(),"/STURM_data/input_csv_SSP_2023_ex/",sep="")
rout_path <- paste(getwd(),"/STURM_output/",sep="")
prices <- read_csv(paste0(data_path,"input_prices_R12.csv"))
scenarios = c("IND_SSP2","IND_SSP1","IND_SSP3")
for(s in scenarios[1:3]){
s="IND_SSP2"
# call STURM
sturm_scenarios <- run_scenario(run = s,
sector = "resid",
path_in=data_path,
path_inputs=input_path,
path_rcode=rcode_path,
path_out=rout_path,
prices=prices,
file_inputs = "input_list_resid_SSP_2023_ex.csv",
#file_data_model = "data_model_resid_SSP_2023.csv",
#file_scenarios = "scenarios_SSP_2023.csv",
geo_level = "region_bld", # Level for analysis
geo_level_aggr = "region_gea", # Level for aggregated data
geo_levels = c("region_bld", "region_gea"), # Levels to keep track of
geo_level_report="R12", # Level for reporting
region_select = NULL, #list("region_bld", c("R32IND")),
yrs = seq(2020,2030,5),
input_mode = "csv",
mod_arch = "stock",
mod_new = "exogenous",
mod_ren = "exogenous",
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="")
input_path <- paste(getwd(),"/STURM_data/input_csv_SSP_2023_ex/",sep="")
rout_path <- paste(getwd(),"/STURM_output/",sep="")
file_inputs <- "input_list_resid_SSP_2023_ex.csv"
#file_scenario <- "scenarios_SSP_2023.csv"
#file_data_model = "data_model_resid_SSP_2023.csv"
#prices<-read_csv(paste0(getwd(),"/STURM_data/","input_prices_R12.csv"))
scen <- "IND_SSP2"
sect <- "resid"
#sect <- "comm"
run = scen
prices=prices
path_in=data_path
path_inputs=input_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(2020,2030,5)
# yrs <- c(seq(2020,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")
region_select = NULL
mod_new = "exogenous"
mod_ren = "exogenous"