Skip to content

Commit

Permalink
Merge pull request #71 from johanneskoch94/main
Browse files Browse the repository at this point in the history
Add ISIMIP GDP scenario definitions
  • Loading branch information
johanneskoch94 authored Jul 13, 2023
2 parents 334373c + 1ccbf38 commit 38aea89
Show file tree
Hide file tree
Showing 7 changed files with 13 additions and 9 deletions.
2 changes: 1 addition & 1 deletion .buildlibrary
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
ValidationKey: '2365671'
ValidationKey: '2541630'
AutocreateReadme: yes
AcceptedWarnings:
- 'Warning: package ''.*'' was built under R version'
Expand Down
2 changes: 1 addition & 1 deletion CITATION.cff
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ cff-version: 1.2.0
message: If you use this software, please cite it using the metadata from this file.
type: software
title: 'mrdrivers: Create GDP and Population Scenarios'
version: 1.2.1
version: 1.3.0
date-released: '2023-07-13'
abstract: Create GDP and population scenarios This package constructs the GDP and
population scenarios used as drivers in both the REMIND and MAgPIE models.
Expand Down
2 changes: 1 addition & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Package: mrdrivers
Type: Package
Title: Create GDP and Population Scenarios
Version: 1.2.1
Version: 1.3.0
Authors@R: c(person(given = "Johannes",
family = "Koch",
email = "[email protected]",
Expand Down
6 changes: 4 additions & 2 deletions R/calcDriver.R
Original file line number Diff line number Diff line change
Expand Up @@ -125,8 +125,10 @@ calcScenarioConstructor <- function(driver,
weight <- calcOutput("Population", scenario = scenario, extension2150 = extension2150, aggregate = FALSE)
# Give weight same names as data, so that aggregate doesn't mess up data dim
getNames(weight) <- getNames(harmonizedData$x)
# Make sure weight has the same yearly resolution as harmonizedData
# (this relates specifically to the noCovid scenario)
# Make sure weight and harmonizedData have the same yearly resolution. Sometimes x has more years than weigth,
# thus the intersect operation. Then if weight has more years than x, only years that exist in x are used.
# (this applies specifically to the noCovid and ISIMIP scenarios)
harmonizedData$x <- harmonizedData$x[, intersect(getYears(harmonizedData$x), getYears(weight)), ]
weight <- weight[, getYears(harmonizedData$x), ]
}

Expand Down
2 changes: 1 addition & 1 deletion R/toolGetEUcountries.R
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# These countries are the ones (essentiall the EU-27) that receive special treatment
# in the SSP2EU scenario.
toolGetEUcountries <- function(onlyWithARIADNEgdpData = FALSE) {
x <- toolGetMapping("regionmappingH12.csv", where = "mappingfolder") %>%
x <- toolGetMapping("regionmappingH12.csv", type = "regional", where = "mappingfolder") %>%
tibble::as_tibble() %>%
dplyr::filter(.data$RegionCode == "EUR", .data$CountryCode != "GBR") %>%
dplyr::pull(.data$CountryCode)
Expand Down
2 changes: 2 additions & 0 deletions R/toolGetScenarioDefinition.R
Original file line number Diff line number Diff line change
Expand Up @@ -37,13 +37,15 @@ toolGetScenarioDefinition <- function(driver = NULL, scen = NULL, aslist = FALSE
"GDPpc", "SSPs", "WDI-MI", "SSPsOld-MI", "calibSSPs",
"GDPpc", "SDPs", "-", "-", "calibSDPs",
"GDPpc", "SSP2EU", "-", "-", "GDPoverPop",
"GDPpc", "ISIMIP", "WDI-MI", "SSPsOld-MI", "calibSSPs",
"GDPpc", "noCovid", "WDI-MI", "SSPsOld-MI", "calibNoCovid",
"GDPpc", "longCovid", "-", "-", "calibLongCovid",
"GDPpc", "shortCovid", "-", "-", "calibShortCovid",
"GDPpc", "SSPsOld", "-", "-", "GDPoverPop",
# GDP scenarios
"GDP", "SSPs", "-", "-", "GDPpcWithPop",
"GDP", "SDPs", "-", "-", "GDPpcWithPop",
"GDP", "ISIMIP", "-", "-", "GDPpcWithPop",
"GDP", "SSP2EU", "Eurostat-WDI-MI", "SSP2EU-MI", "calibSSP2EU",
"GDP", "noCovid", "-", "-", "GDPpcWithPop",
"GDP", "longCovid", "-", "-", "GDPpcWithPop",
Expand Down
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Create GDP and Population Scenarios

R package **mrdrivers**, version **1.2.1**
R package **mrdrivers**, version **1.3.0**

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

Expand Down Expand Up @@ -103,7 +103,7 @@ In case of questions / problems please contact Johannes Koch <jokoch@pik-potsdam

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

Koch J, Soergel B, Leip D, Benke F, Dietrich J (2023). _mrdrivers: Create GDP and Population Scenarios_. R package version 1.2.1, <URL: https://pik-piam.github.io/mrdrivershttps://github.com/pik-piam/mrdrivers>.
Koch J, Soergel B, Leip D, Benke F, Dietrich J (2023). _mrdrivers: Create GDP and Population Scenarios_. R package version 1.3.0, <https://pik-piam.github.io/mrdrivershttps://github.com/pik-piam/mrdrivers>.

A BibTeX entry for LaTeX users is

Expand All @@ -112,7 +112,7 @@ A BibTeX entry for LaTeX users is
title = {mrdrivers: Create GDP and Population Scenarios},
author = {Johannes Koch and Bjoern Soergel and Deborra Leip and Falk Benke and Jan Philipp Dietrich},
year = {2023},
note = {R package version 1.2.1},
note = {R package version 1.3.0},
url = {https://pik-piam.github.io/mrdrivers},
url = {https://github.com/pik-piam/mrdrivers},
}
Expand Down

0 comments on commit 38aea89

Please sign in to comment.