Skip to content

Commit

Permalink
Merge pull request pik-piam#603 from nicobauer/master
Browse files Browse the repository at this point in the history
added emissions and emission factors for SSP3
  • Loading branch information
nicobauer authored Dec 4, 2024
2 parents 221cd9f + 3d21644 commit 7193697
Show file tree
Hide file tree
Showing 5 changed files with 48 additions and 10 deletions.
2 changes: 1 addition & 1 deletion .buildlibrary
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
ValidationKey: '40400840'
ValidationKey: '40523220'
AcceptedWarnings:
- Invalid URL: .*
- 'Warning: package ''.*'' was built under R version'
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: 'mrremind: MadRat REMIND Input Data Package'
version: 0.201.4
date-released: '2024-12-03'
version: 0.202.0
date-released: '2024-12-04'
abstract: The mrremind packages contains data preprocessing for the REMIND model.
authors:
- family-names: Baumstark
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: mrremind
Title: MadRat REMIND Input Data Package
Version: 0.201.4
Date: 2024-12-03
Version: 0.202.0
Date: 2024-12-04
Authors@R: c(
person("Lavinia", "Baumstark", , "[email protected]", role = c("aut", "cre")),
person("Renato", "Rodrigues", role = "aut"),
Expand Down
40 changes: 39 additions & 1 deletion R/calcEmissionFactors.R
Original file line number Diff line number Diff line change
Expand Up @@ -352,7 +352,45 @@ calcEmissionFactors <- function(subtype = "emission_factors", sectoral_resolutio
# Low: 2030 CLE20; 2050 Min CLE30; 2100 EUR CLE30 [AFR, IND, OAS] = [1 4 8]

# ----------------- SSP3 --------------------------------------
# TODO
# Emission factors
# High-Medium income countries with strong pollution policies in place
ef[r_HMStrong, 2030, "SSP3"] <- ef_eclipse[r_HMStrong, 2030, "CLE"] # 2030: CLE30
ef[r_HMStrong, 2050, "SSP3"] <- pmin(setYears(ef[r_HMStrong, 2030, "SSP3"]),
setYears(ef_eclipse[r_HMStrong, 2030, "CLE"])) # 2050: CLE30
ef[r_HMStrong, 2100, "SSP3"] <- pmin(setYears(ef[r_HMStrong, 2050, "SSP3"]),
setYears(allocate_min2r_ef(ef_eclipse, r_HMStrong, r_oecd, 2030, "CLE"))) # 2100: Lowest CLE30 or lower
# High-Medium income countries with lower emissions goals
ef[r_HMRest, 2030, "SSP3"] <- ef_eclipse[r_HMRest, 2030, "CLE"] # 2030: CLE30
ef[r_HMRest, 2050, "SSP3"] <- pmin(setYears(ef[r_HMRest, 2030, "SSP3"]),
setYears(allocate_min2r_ef(ef_eclipse, r_HMRest, r_HMRest, 2030, "CLE"))) # 2050: Min CLE30
ef[r_HMRest, 2100, "SSP3"] <- pmin(setYears(ef[r_HMRest, 2050, "SSP3"]),
setYears(allocate_c2r_ef(ef_eclipse, r_HMRest, select_weu, 2030, "CLE"))) # 2100: CLE30 WEU
# low income countries
ef[r_L, 2030, "SSP3"] <- setYears(ef_eclipse[r_L, 2020, "CLE"]) # 2030: CLE20
ef[r_L, 2050, "SSP3"] <- pmin(setYears(ef[r_L, 2030, "SSP3"]),
setYears(allocate_min2r_ef(ef_eclipse, r_L, r_L, 2030, "CLE"))) # 2050: Min CLE30
ef[r_L, 2100, "SSP3"] <- pmin(setYears(ef[r_L, 2050, "SSP3"]),
setYears(allocate_c2r_ef(ef_eclipse, r_L, select_weu, 2030, "CLE"))) # 2100: CLE30 WEU

# Emissions
# High-Medium income countries with strong pollution policies in place
emi[r_HMStrong, 2030, "SSP3"] <- emissions_exogenous[r_HMStrong, 2030, "CLE"] # 2030: CLE30
emi[r_HMStrong, 2050, "SSP3"] <- pmin(setYears(emi[r_HMStrong, 2030, "SSP3"]),
setYears(emissions_exogenous[r_HMStrong, 2030, "CLE"])) # 2050: CLE30
emi[r_HMStrong, 2100, "SSP3"] <- pmin(setYears(emi[r_HMStrong, 2050, "SSP3"]),
setYears(emissions_exogenous[r_HMStrong, 2030, "CLE"] )) # 2100: Lowest CLE30 or lower -> 0.8*CLE30
# High-Medium income countries with lower emissions goals
emi[r_HMRest, 2030, "SSP3"] <- emissions_exogenous[r_HMRest, 2030, "CLE"] # 2030: CLE30
emi[r_HMRest, 2050, "SSP3"] <- pmin(setYears(emi[r_HMRest, 2030, "SSP3"]),
setYears(emissions_exogenous[r_HMRest, 2030, "CLE"])) # 2050: Min CLE30 -> CLE30
emi[r_HMRest, 2100, "SSP3"] <- pmin(setYears(emi[r_HMRest, 2050, "SSP3"]),
setYears(emissions_exogenous[r_HMRest, 2030, "CLE"] )) # 2100: CLE30 WEU -> 0.8*CLE30
# low income countries
emi[r_L, 2030, "SSP3"] <- setYears(emissions_exogenous[r_L, 2020, "CLE"]) # 2030: CLE20
emi[r_L, 2050, "SSP3"] <- pmin(setYears(emi[r_L, 2030, "SSP3"]),
setYears(emissions_exogenous[r_L, 2030, "CLE"])) # 2050: Min CLE30 -> CLE30
emi[r_L, 2100, "SSP3"] <- pmin(setYears(emi[r_L, 2050, "SSP3"]),
setYears(emissions_exogenous[r_L, 2030, "CLE"] )) # 2100: CLE30 WEU -> 0.95*CLE30

# ----------------- SSP4 --------------------------------------
# TODO
Expand Down
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
# MadRat REMIND Input Data Package

R package **mrremind**, version **0.201.4**
R package **mrremind**, version **0.202.0**

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

## Purpose and Functionality

Expand Down Expand Up @@ -39,7 +39,7 @@ In case of questions / problems please contact Lavinia Baumstark <lavinia@pik-po

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

Baumstark L, Rodrigues R, Levesque A, Oeser J, Bertram C, Mouratiadou I, Malik A, Schreyer F, Soergel B, Rottoli M, Mishra A, Dirnaichner A, Pehl M, Giannousakis A, Klein D, Strefler J, Feldhaus L, Brecha R, Rauner S, Dietrich J, Bi S, Benke F, Weigmann P, Richters O, Hasse R, Fuchs S, Mandaroux R, Koch J (2024). _mrremind: MadRat REMIND Input Data Package_. R package version 0.201.4, <https://github.com/pik-piam/mrremind>.
Baumstark L, Rodrigues R, Levesque A, Oeser J, Bertram C, Mouratiadou I, Malik A, Schreyer F, Soergel B, Rottoli M, Mishra A, Dirnaichner A, Pehl M, Giannousakis A, Klein D, Strefler J, Feldhaus L, Brecha R, Rauner S, Dietrich J, Bi S, Benke F, Weigmann P, Richters O, Hasse R, Fuchs S, Mandaroux R, Koch J (2024). _mrremind: MadRat REMIND Input Data Package_. R package version 0.202.0, <https://github.com/pik-piam/mrremind>.

A BibTeX entry for LaTeX users is

Expand All @@ -48,7 +48,7 @@ A BibTeX entry for LaTeX users is
title = {mrremind: MadRat REMIND Input Data Package},
author = {Lavinia Baumstark and Renato Rodrigues and Antoine Levesque and Julian Oeser and Christoph Bertram and Ioanna Mouratiadou and Aman Malik and Felix Schreyer and Bjoern Soergel and Marianna Rottoli and Abhijeet Mishra and Alois Dirnaichner and Michaja Pehl and Anastasis Giannousakis and David Klein and Jessica Strefler and Lukas Feldhaus and Regina Brecha and Sebastian Rauner and Jan Philipp Dietrich and Stephen Bi and Falk Benke and Pascal Weigmann and Oliver Richters and Robin Hasse and Sophie Fuchs and Rahel Mandaroux and Johannes Koch},
year = {2024},
note = {R package version 0.201.4},
note = {R package version 0.202.0},
url = {https://github.com/pik-piam/mrremind},
}
```

0 comments on commit 7193697

Please sign in to comment.