Skip to content

Commit

Permalink
Merge pull request pik-piam#503 from tabeado/master
Browse files Browse the repository at this point in the history
Update reporting after renaming v33_emi to vm_emiCdrTeDetail
  • Loading branch information
tabeado authored Jan 12, 2024
2 parents 36bc28e + 884afe8 commit f33dd29
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 19 deletions.
2 changes: 1 addition & 1 deletion .buildlibrary
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
ValidationKey: '222825036'
ValidationKey: '222856062'
AcceptedWarnings:
- 'Warning: package ''.*'' was built under R version'
- 'Warning: namespace ''.*'' is not available and has been replaced'
Expand Down
4 changes: 2 additions & 2 deletions CITATION.cff
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ cff-version: 1.2.0
message: If you use this software, please cite it using the metadata from this file.
type: software
title: 'remind2: The REMIND R package (2nd generation)'
version: 1.129.2
date-released: '2024-01-11'
version: 1.129.3
date-released: '2024-01-12'
abstract: Contains the REMIND-specific routines for data and model output manipulation.
authors:
- family-names: Rodrigues
Expand Down
4 changes: 2 additions & 2 deletions DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
Type: Package
Package: remind2
Title: The REMIND R package (2nd generation)
Version: 1.129.2
Date: 2024-01-11
Version: 1.129.3
Date: 2024-01-12
Authors@R: c(
person("Renato", "Rodrigues", , "[email protected]", role = c("aut", "cre")),
person("Lavinia", "Baumstark", role = "aut"),
Expand Down
22 changes: 11 additions & 11 deletions R/reportEmi.R
Original file line number Diff line number Diff line change
Expand Up @@ -173,9 +173,9 @@ reportEmi <- function(gdx, output = NULL, regionSubsetList = NULL, t = c(seq(200
# total captured CO2
vm_co2capture <- readGDX(gdx, "vm_co2capture", field = "l", restore_zeros = F)[, t, ]

v33_emi <- readGDX(gdx, "v33_emi", field = "l", restore_zeros = F, react = "silent")[, t, ]
vm_emiCdrTeDetail <- readGDX(gdx, c("vm_emiCdrTeDetail","v33_emi"), field = "l", restore_zeros = F, react = "silent")[, t, ]

if (is.null(v33_emi)) { # compatibility with the CDR module before the portfolio was added
if (is.null(vm_emiCdrTeDetail)) { # compatibility with the CDR module before the portfolio was added
# captured CO2 by DAC
v33_emiDAC <- readGDX(gdx, "v33_emiDAC", field = "l", restore_zeros = F, react = "silent")[, t, ]
if (is.null(v33_emiDAC)) {
Expand All @@ -187,8 +187,8 @@ reportEmi <- function(gdx, output = NULL, regionSubsetList = NULL, t = c(seq(200
v33_emiEW <- new.magpie(getItems(vm_co2capture, "all_regi"), getItems(vm_co2capture, "ttot"), fill = 0)
}
# variable used in the rest of the reporting
v33_emi <- mbind(v33_emiDAC, v33_emiEW)
v33_emi <- setNames(v33_emi, c("dac", "weathering"))
vm_emiCdrTeDetail <- mbind(v33_emiDAC, v33_emiEW)
vm_emiCdrTeDetail <- setNames(vm_emiCdrTeDetail, c("dac", "weathering"))
}
# stored CO2
vm_co2CCS <- readGDX(gdx, "vm_co2CCS", field = "l", restore_zeros = F)[, t, ]
Expand Down Expand Up @@ -1110,7 +1110,7 @@ if (!is.null(vm_plasticsCarbon)) {
# vm_emiTeMkt is variable in REMIND closest to energy co2 emissions
(dimSums(sel_vm_emiTeMkt_co2, dim = 3)
# subtract non-BECCS CCU CO2 (i.e., non-CCS part of DAC)
- (1 - p_share_CCS) * (-v33_emi[, , "dac"])
- (1 - p_share_CCS) * (-vm_emiCdrTeDetail[, , "dac"])
# deduce co2 captured by industrial processes which is not stored but used for CCU
# -> gets accounted in industrial process emissions
- vm_emiIndCCS[, , "co2cement_process"]*(1-p_share_CCS)) * GtC_2_MtCO2,
Expand Down Expand Up @@ -1160,7 +1160,7 @@ if (!is.null(vm_plasticsCarbon)) {
setNames(dimSums(vm_emiMacSector[, , "co2luc"], dim = 3) * GtC_2_MtCO2,
"Emi|CO2|+|Land-Use Change (Mt CO2/yr)"),
# negative emissions from (non-BECCS) CDR (DACCS, EW)
setNames((v33_emi[, , "weathering"] + v33_emi[, , "dac"] * p_share_CCS) * GtC_2_MtCO2,
setNames((vm_emiCdrTeDetail[, , "weathering"] + vm_emiCdrTeDetail[, , "dac"] * p_share_CCS) * GtC_2_MtCO2,
"Emi|CO2|+|non-BECCS CDR (Mt CO2/yr)")
)

Expand Down Expand Up @@ -1193,7 +1193,7 @@ if (!is.null(vm_plasticsCarbon)) {
setNames(dimSums(vm_emiMacSector[, , "co2luc"], dim = 3) * GtC_2_MtCO2,
"Emi|CO2|+|Land-Use Change (Mt CO2/yr)"),
# negative emissions from (non-BECCS) CDR (DACCS, EW)
setNames((v33_emi[, , "weathering"] + v33_emi[, , "dac"] * p_share_CCS) * GtC_2_MtCO2,
setNames((vm_emiCdrTeDetail[, , "weathering"] + vm_emiCdrTeDetail[, , "dac"] * p_share_CCS) * GtC_2_MtCO2,
"Emi|CO2|+|non-BECCS CDR (Mt CO2/yr)")
)

Expand Down Expand Up @@ -1381,7 +1381,7 @@ if (!is.null(vm_plasticsCarbon)) {
setNames(dimSums(vm_emiIndCCS[, , "co2cement_process"], dim = 3) * GtC_2_MtCO2,
"Carbon Management|Carbon Capture|Industry Process|+|Cement (Mt CO2/yr)"),
# total co2 captured by DAC
setNames(-v33_emi[, , "dac"] * GtC_2_MtCO2,
setNames(-vm_emiCdrTeDetail[, , "dac"] * GtC_2_MtCO2,
"Carbon Management|Carbon Capture|+|DAC (Mt CO2/yr)"),
# total co2 captured
setNames(vm_co2capture * GtC_2_MtCO2,
Expand Down Expand Up @@ -1744,7 +1744,7 @@ if (!is.null(vm_plasticsCarbon)) {
"Emi|CO2|CDR|DACCS (Mt CO2/yr)"),
# total EW
# total co2 captured by EW
setNames(v33_emi[, , "weathering"] * GtC_2_MtCO2,
setNames(vm_emiCdrTeDetail[, , "weathering"] * GtC_2_MtCO2,
"Emi|CO2|CDR|EW (Mt CO2/yr)"))

out <- mbind(out,
Expand Down Expand Up @@ -1783,7 +1783,7 @@ if (!is.null(vm_plasticsCarbon)) {
"Emi|CO2|CDR|DACCS (Mt CO2/yr)"),
# total EW
# total co2 captured by EW
setNames(v33_emi[, , "weathering"] * GtC_2_MtCO2,
setNames(vm_emiCdrTeDetail[, , "weathering"] * GtC_2_MtCO2,
"Emi|CO2|CDR|EW (Mt CO2/yr)"))

out <- mbind(out,
Expand Down Expand Up @@ -2397,7 +2397,7 @@ if (!is.null(vm_plasticsCarbon)) {
# CDR energy-related emissions
(dimSums(mselect(EmiFeCarrier[, , "ETS"], emi_sectors = "CDR"), dim = 3)
# Captured CO2 by non-BECCS capture technologies
+ (v33_emi[, , "weathering"] + v33_emi[, , "dac"] * p_share_CCS)) * GtC_2_MtCO2,
+ (vm_emiCdrTeDetail[, , "weathering"] + vm_emiCdrTeDetail[, , "dac"] * p_share_CCS)) * GtC_2_MtCO2,
"Emi|GHG|ETS|+|non-BECCS CDR (Mt CO2eq/yr)"),

# Extraction
Expand Down
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# The REMIND R package (2nd generation)

R package **remind2**, version **1.129.2**
R package **remind2**, version **1.129.3**

[![CRAN status](https://www.r-pkg.org/badges/version/remind2)](https://cran.r-project.org/package=remind2) [![R build status](https://github.com/pik-piam/remind2/workflows/check/badge.svg)](https://github.com/pik-piam/remind2/actions) [![codecov](https://codecov.io/gh/pik-piam/remind2/branch/master/graph/badge.svg)](https://app.codecov.io/gh/pik-piam/remind2) [![r-universe](https://pik-piam.r-universe.dev/badges/remind2)](https://pik-piam.r-universe.dev/builds)

Expand Down Expand Up @@ -49,7 +49,7 @@ In case of questions / problems please contact Renato Rodrigues <renato.rodrigue

To cite package **remind2** in publications use:

Rodrigues R, Baumstark L, Benke F, Dietrich J, Dirnaichner A, Führlich P, Giannousakis A, Hasse R, Hilaire J, Klein D, Koch J, Kowalczyk K, Levesque A, Malik A, Merfort A, Merfort L, Morena-Leiva S, Pehl M, Pietzcker R, Rauner S, Richters O, Rottoli M, Schötz C, Schreyer F, Siala K, Sörgel B, Spahr M, Strefler J, Verpoort P, Weigmann P (2024). _remind2: The REMIND R package (2nd generation)_. R package version 1.129.2, <URL: https://github.com/pik-piam/remind2>.
Rodrigues R, Baumstark L, Benke F, Dietrich J, Dirnaichner A, Führlich P, Giannousakis A, Hasse R, Hilaire J, Klein D, Koch J, Kowalczyk K, Levesque A, Malik A, Merfort A, Merfort L, Morena-Leiva S, Pehl M, Pietzcker R, Rauner S, Richters O, Rottoli M, Schötz C, Schreyer F, Siala K, Sörgel B, Spahr M, Strefler J, Verpoort P, Weigmann P (2024). _remind2: The REMIND R package (2nd generation)_. R package version 1.129.3, <URL: https://github.com/pik-piam/remind2>.

A BibTeX entry for LaTeX users is

Expand All @@ -58,7 +58,7 @@ A BibTeX entry for LaTeX users is
title = {remind2: The REMIND R package (2nd generation)},
author = {Renato Rodrigues and Lavinia Baumstark and Falk Benke and Jan Philipp Dietrich and Alois Dirnaichner and Pascal Führlich and Anastasis Giannousakis and Robin Hasse and Jérome Hilaire and David Klein and Johannes Koch and Katarzyna Kowalczyk and Antoine Levesque and Aman Malik and Anne Merfort and Leon Merfort and Simón Morena-Leiva and Michaja Pehl and Robert Pietzcker and Sebastian Rauner and Oliver Richters and Marianna Rottoli and Christof Schötz and Felix Schreyer and Kais Siala and Björn Sörgel and Mike Spahr and Jessica Strefler and Philipp Verpoort and Pascal Weigmann},
year = {2024},
note = {R package version 1.129.2},
note = {R package version 1.129.3},
url = {https://github.com/pik-piam/remind2},
}
```

0 comments on commit f33dd29

Please sign in to comment.