Skip to content

Commit 33eaffe

Browse files
authored
Merge pull request #657 from fschreyer/SmallFixes
Add some missing emissions and cdr variables with national LULUCF accounting
2 parents 6762149 + 598e28f commit 33eaffe

File tree

5 files changed

+23
-11
lines changed

5 files changed

+23
-11
lines changed

.buildlibrary

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
ValidationKey: '231339003'
1+
ValidationKey: '231393712'
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.157.1
6-
date-released: '2024-09-27'
5+
version: 1.157.2
6+
date-released: '2024-09-30'
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.157.1
5-
Date: 2024-09-27
4+
Version: 1.157.2
5+
Date: 2024-09-30
66
Authors@R: c(
77
person("Renato", "Rodrigues", , "[email protected]", role = c("aut", "cre")),
88
person("Lavinia", "Baumstark", role = "aut"),

R/reportEmi.R

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2520,17 +2520,24 @@ reportEmi <- function(gdx, output = NULL, regionSubsetList = NULL,
25202520
as.numeric(out["DEU", "y2015", "Emi|CO2|Energy|Supply|++|Electricity and Heat (Mt CO2/yr)"])
25212521
}
25222522

2523-
# emissions with Grassi Correction (LULUCF emissions adjusted to national LULUCF accounting)
2523+
# emissions national LULUCF accounting
2524+
# (including carbon sink from existing forests calculated by difference between historic Magpie and UNFCCC data)
25242525

25252526
p47_LULUCFEmi_GrassiShift <- readGDX(gdx, "p47_LULUCFEmi_GrassiShift", restore_zeros = T, react = "silent")[getRegions(out), getYears(out),]
25262527

25272528
if (!is.null(p47_LULUCFEmi_GrassiShift)) {
25282529

2529-
# variables of which version with Grassi correction should be reported
2530+
2531+
# variables of which version with national LULUCF accounting should be added
25302532
vars.lulucf <- c("Emi|GHG (Mt CO2eq/yr)",
25312533
"Emi|CO2 (Mt CO2/yr)",
25322534
"Emi|GHG|+++|Land-Use Change (Mt CO2eq/yr)",
2533-
"Emi|CO2|+|Land-Use Change (Mt CO2/yr)")
2535+
"Emi|CO2|+|Land-Use Change (Mt CO2/yr)",
2536+
"Emi|CO2|CDR|Land-Use Change (Mt CO2/yr)",
2537+
"Emi|CO2|CDR (Mt CO2/yr)",
2538+
"Emi|GHG|Outside ETS and ESR|+|Land-Use Change (Mt CO2eq/yr)",
2539+
"Emi|GHG|++|Outside ETS and ESR (Mt CO2eq/yr)",
2540+
"Emi|GHG|AFOLU (Mt CO2eq/yr)")
25342541

25352542
out.lulucf <- out[,,vars.lulucf]
25362543
# subtract shift of LULUCF emissions to be in line with national accounting
@@ -2546,6 +2553,11 @@ reportEmi <- function(gdx, output = NULL, regionSubsetList = NULL,
25462553
names.lulucf <- gsub("\\|\\+\\+\\+\\|", "\\|", names.lulucf )
25472554
getNames(out.lulucf) <- names.lulucf
25482555

2556+
# also report carbon sink from existing forests which is the difference between historic Magpie and UNFCCC land-use change emissions
2557+
out.lulucf <- mbind(out.lulucf,
2558+
setNames(p47_LULUCFEmi_GrassiShift * GtC_2_MtCO2,
2559+
"Emi|CO2|CDR|existing forest sink|LULUCF national accounting (Mt CO2/yr)"))
2560+
25492561
out <- mbind(out, out.lulucf)
25502562
}
25512563

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# The REMIND R package (2nd generation)
22

3-
R package **remind2**, version **1.157.1**
3+
R package **remind2**, version **1.157.2**
44

55
[![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)
66

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

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

52-
Rodrigues R, Baumstark L, Benke F, Dietrich J, Dirnaichner A, Duerrwaechter J, 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, Rüter T (2024). _remind2: The REMIND R package (2nd generation)_. R package version 1.157.1, <https://github.com/pik-piam/remind2>.
52+
Rodrigues R, Baumstark L, Benke F, Dietrich J, Dirnaichner A, Duerrwaechter J, 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, Rüter T (2024). _remind2: The REMIND R package (2nd generation)_. R package version 1.157.2, <https://github.com/pik-piam/remind2>.
5353

5454
A BibTeX entry for LaTeX users is
5555

@@ -58,7 +58,7 @@ A BibTeX entry for LaTeX users is
5858
title = {remind2: The REMIND R package (2nd generation)},
5959
author = {Renato Rodrigues and Lavinia Baumstark and Falk Benke and Jan Philipp Dietrich and Alois Dirnaichner and Jakob Duerrwaechter 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 and Tonn Rüter},
6060
year = {2024},
61-
note = {R package version 1.157.1},
61+
note = {R package version 1.157.2},
6262
url = {https://github.com/pik-piam/remind2},
6363
}
6464
```

0 commit comments

Comments
 (0)