Skip to content

Commit 57c1fa0

Browse files
authored
Merge pull request #633 from fbenke-pik/update_2024
switch to US017 in reporting functions
2 parents 443e733 + 9e98c8b commit 57c1fa0

22 files changed

+696
-698
lines changed

.buildlibrary

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
ValidationKey: '231038160'
1+
ValidationKey: '231092829'
22
AcceptedWarnings:
33
- 'Warning: package ''.*'' was built under R version'
44
- 'Warning: namespace ''.*'' is not available and has been replaced'

CITATION.cff

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@ cff-version: 1.2.0
22
message: If you use this software, please cite it using the metadata from this file.
33
type: software
44
title: 'remind2: The REMIND R package (2nd generation)'
5-
version: 1.156.0
6-
date-released: '2024-09-20'
5+
version: 1.156.1
6+
date-released: '2024-09-23'
77
abstract: Contains the REMIND-specific routines for data and model output manipulation.
88
authors:
99
- family-names: Rodrigues

DESCRIPTION

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
Type: Package
22
Package: remind2
33
Title: The REMIND R package (2nd generation)
4-
Version: 1.156.0
5-
Date: 2024-09-20
4+
Version: 1.156.1
5+
Date: 2024-09-23
66
Authors@R: c(
77
person("Renato", "Rodrigues", , "renato.rodrigues@pik-potsdam.de", role = c("aut", "cre")),
88
person("Lavinia", "Baumstark", role = "aut"),

R/readConsumption.R

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,16 @@
11
#' Read Consumption from GDX file
2-
#'
2+
#'
33
#' Read Consumption data from a GDX file into a magpie object.
4-
#'
5-
#'
4+
#'
5+
#'
66
#' @param gdx a GDX list as created by readGDX, or the file name of a gdx
77
#' file(file name is recommended as this speeds up the code)
88
#' @param field one of 'l', 'm', 's', 'lo', 'up'
99
#' @author Jonas Hoersch
1010
#' @examples
11-
#'
11+
#'
1212
#' \dontrun{cons <- readConsumption(gdx)}
13-
#'
13+
#'
1414
#' @export
1515
#' @importFrom gdx readGDX
1616
#' @importFrom magclass mbind getNames<-
@@ -19,6 +19,6 @@ readConsumption <- function(gdx, field="l"){
1919
tmp <- readGDX(gdx, name='vm_cons', field=field, format="first_found")
2020
tmp <- tmp * 1000
2121
tmp <- mbind(tmp["GLO",,,invert=T],dimSums(tmp,dim=1))
22-
getNames(tmp) <- "Consumption (billion US$2005/yr)"
22+
getNames(tmp) <- "Consumption (billion US$2017/yr)"
2323
return(tmp)
24-
}
24+
}

R/reportCapitalStock.R

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -54,15 +54,15 @@ reportCapitalStock <- function(gdx,regionSubsetList=NULL,t=c(seq(2005,2060,5),se
5454
if (tran_mod == "complex"){
5555
LDV35 <- readGDX(gdx,name=c("LDV35"),format="first_found")
5656
tmp <- mbind(tmp,setNames(dimSums( (vm_cap * v_investcost)[teue2rlf]
57-
,dim=c(3.1,3.2)) * 1000, "Est Capital Stock|ESM|Transp vehic (billion US$2005)"))
57+
,dim=c(3.1,3.2)) * 1000, "Est Capital Stock|ESM|Transp vehic (billion US$2017)"))
5858
tmp <- mbind(tmp,setNames(dimSums( (vm_cap * v_investcost)[teall2rlf][,,LDV35]
59-
,dim=c(3.1,3.2)) * 1000, "Est Capital Stock|ESM|Pet/EV LDV (billion US$2005)"))
59+
,dim=c(3.1,3.2)) * 1000, "Est Capital Stock|ESM|Pet/EV LDV (billion US$2017)"))
6060

6161
tmp <- mbind(tmp,
6262
setNames(
6363
dimSums(mbind(vm_cap * v_investcost),
6464
dim = 3) * 1000,
65-
"Estimated Capital Stock|ESM (billion US$2005)"
65+
"Estimated Capital Stock|ESM (billion US$2017)"
6666
)
6767
)
6868

@@ -124,7 +124,7 @@ reportCapitalStock <- function(gdx,regionSubsetList=NULL,t=c(seq(2005,2060,5),se
124124
eek_Ind <- setNames(vm_cesIO[,y,ppfKap_Ind],
125125
paste0('Capital|Energy Efficiency|Industry|',
126126
mixer[mixer$pf %in% ppfKap_Ind,][['name']],
127-
' (billion US$2005)'))
127+
' (billion US$2017)'))
128128
# add industry EEK and global totals
129129
tmp <- mbind(tmp, mbind(eek_Ind, dimSums(eek_Ind, dim = 1)))
130130
}

R/reportCosts.R

Lines changed: 92 additions & 92 deletions
Large diffs are not rendered by default.

R/reportCrossVariables.R

Lines changed: 26 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -84,8 +84,8 @@ reportCrossVariables <- function(gdx, output = NULL, regionSubsetList = NULL,
8484

8585

8686
tmp <- mbind(tmp,setNames(
87-
output[r,,"Energy Investments (billion US$2005/yr)"]
88-
-output[r,,"Energy Investments|Electricity (billion US$2005/yr)"],"Energy Investments|Non-Electricity (billion US$2005/yr)"))
87+
output[r,,"Energy Investments (billion US$2017/yr)"]
88+
-output[r,,"Energy Investments|Electricity (billion US$2017/yr)"],"Energy Investments|Non-Electricity (billion US$2017/yr)"))
8989
# gas capacity factor
9090
tmp <- mbind(tmp,setNames(
9191
output[r,,"SE|Electricity|Gas (EJ/yr)"] / output[r,,"Cap|Electricity|Gas (GW)"] / TWa_2_EJ * 1000 * 100,
@@ -143,18 +143,18 @@ reportCrossVariables <- function(gdx, output = NULL, regionSubsetList = NULL,
143143

144144
setNames(
145145
output[,,"FE (EJ/yr)"] * 1000
146-
/ output[,,"GDP|MER (billion US$2005/yr)"],
147-
"Intensity|GDP|Final Energy (MJ/US$2005)"),
146+
/ output[,,"GDP|MER (billion US$2017/yr)"],
147+
"Intensity|GDP|Final Energy (MJ/US$2017)"),
148148

149149
setNames(
150-
output[,,"GDP|MER (billion US$2005/yr)"]
150+
output[,,"GDP|MER (billion US$2017/yr)"]
151151
/ output[,,"FE (EJ/yr)"],
152-
"Productivity|GDP|MER|Final Energy (US$2005/GJ)"),
152+
"Productivity|GDP|MER|Final Energy (US$2017/GJ)"),
153153

154154
setNames(
155-
output[,,"GDP|PPP (billion US$2005/yr)"]
155+
output[,,"GDP|PPP (billion US$2017/yr)"]
156156
/ output[,,"FE (EJ/yr)"],
157-
"Productivity|GDP|PPP|Final Energy (US$2005/GJ)"),
157+
"Productivity|GDP|PPP|Final Energy (US$2017/GJ)"),
158158

159159
setNames(
160160
output[,,"Emi|CO2|Energy and Industrial Processes (Mt CO2/yr)"]
@@ -168,18 +168,18 @@ reportCrossVariables <- function(gdx, output = NULL, regionSubsetList = NULL,
168168

169169
setNames(
170170
output[,,"Emi|GHG (Mt CO2eq/yr)"]
171-
/ output[,,"GDP|MER (billion US$2005/yr)"],
172-
"Intensity|GDP|GHG (Mt CO2-equiv/US$2005)"),
171+
/ output[,,"GDP|MER (billion US$2017/yr)"],
172+
"Intensity|GDP|GHG (Mt CO2-equiv/US$2017)"),
173173

174174
setNames(
175-
output[,,"GDP|MER (billion US$2005/yr)"]
175+
output[,,"GDP|MER (billion US$2017/yr)"]
176176
/ output[,,"Population (million)"],
177-
"GDP|per capita|MER (kUS$2005/per capita)"),
177+
"GDP|per capita|MER (kUS$2017/per capita)"),
178178

179179
setNames(
180-
output[,,"GDP|PPP (billion US$2005/yr)"]
180+
output[,,"GDP|PPP (billion US$2017/yr)"]
181181
/ output[,,"Population (million)"],
182-
"GDP|per capita|PPP (kUS$2005/per capita)"),
182+
"GDP|per capita|PPP (kUS$2017/per capita)"),
183183

184184
setNames(
185185
output[,,"Welfare|Real and undiscounted|Yearly (arbitrary unit/yr)"]
@@ -232,10 +232,10 @@ reportCrossVariables <- function(gdx, output = NULL, regionSubsetList = NULL,
232232

233233
# Energy expenditures
234234
tmp <- mbind(tmp,setNames(
235-
output[,,"FE|Transport|Liquids (EJ/yr)"] * output[,,"Price|Final Energy|Transport|Liquids (US$2005/GJ)"] +
236-
output[,,"FE|Transport|Hydrogen (EJ/yr)"] * output[,,"Price|Final Energy|Transport|Hydrogen (US$2005/GJ)"] +
237-
output[,,"FE|Transport|Electricity (EJ/yr)"] * output[,,"Price|Final Energy|Transport|Electricity (US$2005/GJ)"],
238-
"Expenditure|Transport|Fuel (billion US$2005/yr)"))
235+
output[,,"FE|Transport|Liquids (EJ/yr)"] * output[,,"Price|Final Energy|Transport|Liquids (US$2017/GJ)"] +
236+
output[,,"FE|Transport|Hydrogen (EJ/yr)"] * output[,,"Price|Final Energy|Transport|Hydrogen (US$2017/GJ)"] +
237+
output[,,"FE|Transport|Electricity (EJ/yr)"] * output[,,"Price|Final Energy|Transport|Electricity (US$2017/GJ)"],
238+
"Expenditure|Transport|Fuel (billion US$2017/yr)"))
239239

240240
# calculate intensities growth
241241
int_gr <- new.magpie(getRegions(tmp),getYears(tmp),c("Intensity Growth|GDP|Final Energy (% pa)","Intensity Growth|GDP|Final Energy to 2005 (% pa)",
@@ -246,14 +246,14 @@ reportCrossVariables <- function(gdx, output = NULL, regionSubsetList = NULL,
246246
int_gr[,t,"Intensity Growth|GDP|Final Energy (% pa)"] <-
247247
(
248248
(
249-
(tmp[,t,"Intensity|GDP|Final Energy (MJ/US$2005)"] / setYears(tmp[,(which(getYears(tmp)==t)-1),"Intensity|GDP|Final Energy (MJ/US$2005)"],t))
249+
(tmp[,t,"Intensity|GDP|Final Energy (MJ/US$2017)"] / setYears(tmp[,(which(getYears(tmp)==t)-1),"Intensity|GDP|Final Energy (MJ/US$2017)"],t))
250250
^ (1 / ( getYears(tmp[,t,],as.integer=TRUE) - getYears(tmp[,(which(getYears(tmp)==t)-1),],as.integer=TRUE) ) )
251251
) - 1
252252
) * 100
253253
int_gr[,t,"Intensity Growth|GDP|Final Energy to 2005 (% pa)"] <-
254254
(
255255
(
256-
(tmp[,t,"Intensity|GDP|Final Energy (MJ/US$2005)"] / setYears(tmp[,2005,"Intensity|GDP|Final Energy (MJ/US$2005)"],t))
256+
(tmp[,t,"Intensity|GDP|Final Energy (MJ/US$2017)"] / setYears(tmp[,2005,"Intensity|GDP|Final Energy (MJ/US$2017)"],t))
257257
^ (1 / ( getYears(tmp[,t,],as.integer=TRUE) - 2005 ) )
258258
) - 1
259259
) * 100
@@ -274,14 +274,14 @@ reportCrossVariables <- function(gdx, output = NULL, regionSubsetList = NULL,
274274
int_gr[,t,"Intensity Growth|GDP|CO2-equiv (% pa)"] <-
275275
(
276276
(
277-
(tmp[,t,"Intensity|GDP|GHG (Mt CO2-equiv/US$2005)"] / setYears(tmp[,(which(getYears(tmp)==t)-1),"Intensity|GDP|GHG (Mt CO2-equiv/US$2005)"],t))
277+
(tmp[,t,"Intensity|GDP|GHG (Mt CO2-equiv/US$2017)"] / setYears(tmp[,(which(getYears(tmp)==t)-1),"Intensity|GDP|GHG (Mt CO2-equiv/US$2017)"],t))
278278
^ (1 / ( getYears(tmp[,t,],as.integer=TRUE) - getYears(tmp[,(which(getYears(tmp)==t)-1),],as.integer=TRUE) ) )
279279
) - 1
280280
) * 100
281281
int_gr[,t,"Intensity Growth|GDP|CO2-equiv to 2005 (% pa)"] <-
282282
(
283283
(
284-
(tmp[,t,"Intensity|GDP|GHG (Mt CO2-equiv/US$2005)"] / setYears(tmp[,2005,"Intensity|GDP|GHG (Mt CO2-equiv/US$2005)"],t))
284+
(tmp[,t,"Intensity|GDP|GHG (Mt CO2-equiv/US$2017)"] / setYears(tmp[,2005,"Intensity|GDP|GHG (Mt CO2-equiv/US$2017)"],t))
285285
^ (1 / ( getYears(tmp[,t,],as.integer=TRUE) - 2005 ) )
286286
) - 1
287287
) * 100
@@ -335,7 +335,7 @@ reportCrossVariables <- function(gdx, output = NULL, regionSubsetList = NULL,
335335
tribble(
336336
~unit, ~new.unit, ~factor,
337337
'Mt/yr', 't/yr', 1,
338-
'billion US$2005/yr', 'US$2005/yr', 1e-3),
338+
'billion US$2017/yr', 'US$2017/yr', 1e-3),
339339

340340
'unit'
341341
) %>%
@@ -362,7 +362,7 @@ reportCrossVariables <- function(gdx, output = NULL, regionSubsetList = NULL,
362362
select(-'Cell') %>%
363363
# join with population numbers
364364
left_join(
365-
output[,,'GDP|PPP (billion US$2005/yr)'] %>%
365+
output[,,'GDP|PPP (billion US$2017/yr)'] %>%
366366
as.data.frame() %>%
367367
as_tibble() %>%
368368
select('Region', 'Year', population = 'Value'),
@@ -375,8 +375,8 @@ reportCrossVariables <- function(gdx, output = NULL, regionSubsetList = NULL,
375375
tribble(
376376
~unit, ~new.unit, ~factor,
377377
# Mt/$bn * 1e6 t/Mt * 1e-3 $bn/$m = t/$m
378-
'Mt/yr', 't/million US$2005', 1e3,
379-
'billion US$2005/yr', 'US$2005/US$2005', 1 # $bn/$bn = $/$
378+
'Mt/yr', 't/million US$2017', 1e3,
379+
'billion US$2017/yr', 'US$2017/US$2017', 1 # $bn/$bn = $/$
380380
),
381381

382382
'unit'

R/reportEmployment.R

Lines changed: 24 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -41,30 +41,30 @@ reportEmployment <- function(gdx, improvements, multiplier, subtype, shareManf,
4141
reportTech <- reportTechnology(gdx)
4242
reportTech <- collapseNames(reportTech)
4343
var <- c(
44-
"Tech|Electricity|Coal|Pulverised Coal w/o CC|Capital Costs (US$2005/kW)",
45-
"Tech|Electricity|Gas|Combined Cycle w/o CC|Capital Costs (US$2005/kW)",
46-
"Tech|Electricity|Hydro|Capital Costs (US$2005/kW)",
47-
"Tech|Electricity|Nuclear|Capital Costs (US$2005/kW)",
48-
"Tech|Electricity|Solar|PV|Capital Costs (US$2005/kW)",
49-
"Tech|Electricity|Solar|CSP|Capital Costs (US$2005/kW)",
50-
"Tech|Electricity|Wind|Onshore|Capital Costs (US$2005/kW)",
51-
"Tech|Electricity|Wind|Offshore|Capital Costs (US$2005/kW)",
52-
"Tech|Electricity|Biomass|Combined Heat and Power w/o CC|Capital Costs (US$2005/kW)",
53-
"Tech|Electricity|Storage|Battery|For PV|Capital Costs (US$2005/kW)",
54-
"Tech|Electricity|Oil|DOT|Capital Costs (US$2005/kW)",
55-
"Tech|Electricity|Geothermal|Capital Costs (US$2005/kW)",
56-
"Tech|Electricity|Coal|Pulverised Coal w/o CC|OM Cost|fixed (US$2005/kW/yr)",
57-
"Tech|Electricity|Gas|Combined Cycle w/o CC|OM Cost|fixed (US$2005/kW/yr)",
58-
"Tech|Electricity|Hydro|OM Cost|fixed (US$2005/kW/yr)",
59-
"Tech|Electricity|Nuclear|OM Cost|fixed (US$2005/kW/yr)",
60-
"Tech|Electricity|Solar|PV|OM Cost|fixed (US$2005/kW/yr)",
61-
"Tech|Electricity|Solar|CSP|OM Cost|fixed (US$2005/kW/yr)",
62-
"Tech|Electricity|Wind|Onshore|OM Cost|fixed (US$2005/kW/yr)",
63-
"Tech|Electricity|Wind|Offshore|OM Cost|fixed (US$2005/kW/yr)",
64-
"Tech|Electricity|Biomass|Combined Heat and Power w/o CC|OM Cost|fixed (US$2005/kW/yr)",
65-
"Tech|Electricity|Oil|DOT|OM Cost|fixed (US$2005/kW/yr)",
66-
"Tech|Electricity|Geothermal|OM Cost|fixed (US$2005/kW/yr)",
67-
"Tech|Electricity|Storage|Battery|For PV|OM Cost|fixed (US$2005/kW/yr)",
44+
"Tech|Electricity|Coal|Pulverised Coal w/o CC|Capital Costs (US$2017/kW)",
45+
"Tech|Electricity|Gas|Combined Cycle w/o CC|Capital Costs (US$2017/kW)",
46+
"Tech|Electricity|Hydro|Capital Costs (US$2017/kW)",
47+
"Tech|Electricity|Nuclear|Capital Costs (US$2017/kW)",
48+
"Tech|Electricity|Solar|PV|Capital Costs (US$2017/kW)",
49+
"Tech|Electricity|Solar|CSP|Capital Costs (US$2017/kW)",
50+
"Tech|Electricity|Wind|Onshore|Capital Costs (US$2017/kW)",
51+
"Tech|Electricity|Wind|Offshore|Capital Costs (US$2017/kW)",
52+
"Tech|Electricity|Biomass|Combined Heat and Power w/o CC|Capital Costs (US$2017/kW)",
53+
"Tech|Electricity|Storage|Battery|For PV|Capital Costs (US$2017/kW)",
54+
"Tech|Electricity|Oil|DOT|Capital Costs (US$2017/kW)",
55+
"Tech|Electricity|Geothermal|Capital Costs (US$2017/kW)",
56+
"Tech|Electricity|Coal|Pulverised Coal w/o CC|OM Cost|fixed (US$2017/kW/yr)",
57+
"Tech|Electricity|Gas|Combined Cycle w/o CC|OM Cost|fixed (US$2017/kW/yr)",
58+
"Tech|Electricity|Hydro|OM Cost|fixed (US$2017/kW/yr)",
59+
"Tech|Electricity|Nuclear|OM Cost|fixed (US$2017/kW/yr)",
60+
"Tech|Electricity|Solar|PV|OM Cost|fixed (US$2017/kW/yr)",
61+
"Tech|Electricity|Solar|CSP|OM Cost|fixed (US$2017/kW/yr)",
62+
"Tech|Electricity|Wind|Onshore|OM Cost|fixed (US$2017/kW/yr)",
63+
"Tech|Electricity|Wind|Offshore|OM Cost|fixed (US$2017/kW/yr)",
64+
"Tech|Electricity|Biomass|Combined Heat and Power w/o CC|OM Cost|fixed (US$2017/kW/yr)",
65+
"Tech|Electricity|Oil|DOT|OM Cost|fixed (US$2017/kW/yr)",
66+
"Tech|Electricity|Geothermal|OM Cost|fixed (US$2017/kW/yr)",
67+
"Tech|Electricity|Storage|Battery|For PV|OM Cost|fixed (US$2017/kW/yr)",
6868
NULL
6969
)
7070
# only capital costs

0 commit comments

Comments
 (0)