Skip to content

Commit

Permalink
Merge pull request #466 from 0UmfHxcvx5J7JoaOhFSs5mncnisTJJ6q/dev/emi…
Browse files Browse the repository at this point in the history
…_ind_origin

extend calculation of Emi|CO2|Energy|Demand|Industry|x by SE origin of FE carrier
  • Loading branch information
0UmfHxcvx5J7JoaOhFSs5mncnisTJJ6q authored Sep 21, 2023
2 parents 135887b + 1590112 commit b15ec05
Show file tree
Hide file tree
Showing 5 changed files with 72 additions and 34 deletions.
2 changes: 1 addition & 1 deletion .buildlibrary
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
ValidationKey: '219284520'
ValidationKey: '219547800'
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.118.0
date-released: '2023-09-14'
version: 1.119.0
date-released: '2023-09-20'
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.118.0
Date: 2023-09-14
Version: 1.119.0
Date: 2023-09-20
Authors@R: c(
person("Renato", "Rodrigues", , "renato.rodrigues@pik-potsdam.de", role = c("aut", "cre")),
person("Lavinia", "Baumstark", role = "aut"),
Expand Down
90 changes: 64 additions & 26 deletions R/reportEmi.R
Original file line number Diff line number Diff line change
Expand Up @@ -626,30 +626,67 @@ reportEmi <- function(gdx, output = NULL, regionSubsetList = NULL, t = c(seq(200
variable_postfix <- ' (Mt CO2/yr)'

mixer <- tribble(
~variable, ~secInd37, ~all_enty1,
'+|Solids', NULL, 'fesos',
'+|Liquids', NULL, 'fehos',
'+|Gases', NULL, 'fegas',

'++|Cement', 'cement', NULL,
'Cement|+|Solids', 'cement', 'fesos',
'Cement|+|Liquids', 'cement', 'fehos',
'Cement|+|Gases', 'cement', 'fegas',

'++|Chemicals', 'chemicals', NULL,
'Chemicals|+|Solids', 'chemicals', 'fesos',
'Chemicals|+|Liquids', 'chemicals', 'fehos',
'Chemicals|+|Gases', 'chemicals', 'fegas',

'++|Steel', 'steel', NULL,
'Steel|+|Solids', 'steel', 'fesos',
'Steel|+|Liquids', 'steel', 'fehos',
'Steel|+|Gases', 'steel', 'fegas',

'++|Other Industry', 'otherInd', NULL,
'Other Industry|+|Solids', 'otherInd', 'fesos',
'Other Industry|+|Liquids', 'otherInd', 'fehos',
'Other Industry|+|Gases', 'otherInd', 'fegas') %>%
~variable, ~secInd37, ~all_enty, ~all_enty1,
'+|Solids', NULL, NULL, 'fesos',
'+|Liquids', NULL, NULL, 'fehos',
'+|Gases', NULL, NULL, 'fegas',

'Solids|+|Fossil', NULL, 'sesofos', 'fesos',
'Solids|+|Biomass', NULL, 'sesobio', 'fesos',
'Liquids|+|Fossil', NULL, 'seliqfos', 'fehos',
'Liquids|+|Biomass', NULL, 'seliqbio', 'fehos',
'Liquids|+|Synfuel', NULL, 'seliqsyn', 'fehos',
'Gases|+|Fossil', NULL, 'segafos', 'fegas',
'Gases|+|Biomass', NULL, 'segabio', 'fegas',
'Gases|+|Synfuel', NULL, 'segasyn', 'fegas',

'++|Cement', 'cement', NULL, NULL,
'Cement|+|Solids', 'cement', NULL, 'fesos',
'Cement|Solids|+|Fossil', 'cement', 'sesofos', 'fesos',
'Cement|Solids|+|Biomass', 'cement', 'sesobio', 'fesos',
'Cement|+|Liquids', 'cement', NULL, 'fehos',
'Cement|Liquids|+|Fossil', 'cement', 'seliqfos', 'fehos',
'Cement|Liquids|+|Biomass', 'cement', 'seliqbio', 'fehos',
'Cement|Liquids|+|Synfuel', 'cement', 'seliqsyn', 'fehos',
'Cement|+|Gases', 'cement', NULL, 'fegas',
'Cement|Gases|+|Fossil', 'cement', 'segafos', 'fegas',
'Cement|Gases|+|Biomass', 'cement', 'segabio', 'fegas',
'Cement|Gases|+|Synfuel', 'cement', 'segasyn', 'fegas',

'++|Chemicals', 'chemicals', NULL, NULL,
'Chemicals|+|Solids', 'chemicals', NULL, 'fesos',
'Chemicals|Solids|+|Fossil', 'chemicals', 'sesofos', 'fesos',
'Chemicals|Solids|+|Biomass', 'chemicals', 'sesobio', 'fesos',
'Chemicals|+|Liquids', 'chemicals', NULL, 'fehos',
'Chemicals|Liquids|+|Fossil', 'chemicals', 'seliqfos', 'fehos',
'Chemicals|Liquids|+|Biomass', 'chemicals', 'seliqbio', 'fehos',
'Chemicals|Liquids|+|Synfuel', 'chemicals', 'seliqsyn', 'fehos',
'Chemicals|+|Gases', 'chemicals', NULL, 'fegas',
'Chemicals|Gases|+|Fossil', 'chemicals', 'segafos', 'fegas',
'Chemicals|Gases|+|Biomass', 'chemicals', 'segabio', 'fegas',
'Chemicals|Gases|+|Synfuel', 'chemicals', 'segasyn', 'fegas',

'++|Steel', 'steel', NULL, NULL,
'Steel|+|Solids', 'steel', NULL, 'fesos',
'Steel|Solids|+|Fossil', 'steel', 'sesofos', 'fesos',
'Steel|Solids|+|Biomass', 'steel', 'sesobio', 'fesos',
'Steel|+|Liquids', 'steel', NULL, 'fehos',
'Steel|Liquids|+|Fossil', 'steel', 'seliqfos', 'fehos',
'Steel|Liquids|+|Biomass', 'steel', 'seliqbio', 'fehos',
'Steel|Liquids|+|Synfuel', 'steel', 'seliqsyn', 'fehos',
'Steel|+|Gases', 'steel', NULL, 'fegas',
'Steel|Gases|+|Fossil', 'steel', 'segafos', 'fegas',
'Steel|Gases|+|Biomass', 'steel', 'segabio', 'fegas',
'Steel|Gases|+|Synfuel', 'steel', 'segasyn', 'fegas',

'++|Other Industry', 'otherInd', NULL, NULL,
'Other Industry|+|Solids', 'otherInd', NULL, 'fesos',
'Other Industry|Solids|+|Fossil', 'otherInd', 'sesofos', 'fesos',
'Other Industry|+|Liquids', 'otherInd', NULL, 'fehos',
'Other Industry|Liquids|+|Fossil', 'otherInd', 'seliqfos', 'fehos',
'Other Industry|+|Gases', 'otherInd', NULL, 'fegas',
'Other Industry|Gases|+|Fossil', 'otherInd', 'segafos', 'fegas'
) %>%
mutate(
variable = paste0(variable_prefix, .data$variable, variable_postfix))

Expand All @@ -663,14 +700,15 @@ reportEmi <- function(gdx, output = NULL, regionSubsetList = NULL, t = c(seq(200
( dimSums(mselect(EmiIndSubSec, x[setdiff(names(x), 'variable')]),
dim = 3)
- dimSums(
( mselect(vm_emiIndCCS_Sub, x[setdiff(names(x), 'variable')])
( mselect(pm_IndstCO2Captured, x[setdiff(names(x), 'variable')])
* p_share_CCS
),
dim = 3)
) * GtC_2_MtCO2,
x[['variable']])
}) %>%
mbind())
mbind()
)

# Baseline emission before CCS, corresponds to energy carbon content
out <- mbind(
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.118.0**
R package **remind2**, version **1.119.0**

[![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 (2023). _remind2: The REMIND R package (2nd generation)_. R package version 1.118.0, <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 (2023). _remind2: The REMIND R package (2nd generation)_. R package version 1.119.0, <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},
year = {2023},
note = {R package version 1.118.0},
note = {R package version 1.119.0},
url = {https://github.com/pik-piam/remind2},
}
```

0 comments on commit b15ec05

Please sign in to comment.