Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bugfix #137

Merged
merged 3 commits into from
Nov 9, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .buildlibrary
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
ValidationKey: '29291170'
ValidationKey: '29312668'
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: 'mrcommons: MadRat commons Input Data Library'
version: 1.46.2
date-released: '2024-11-08'
version: 1.46.3
date-released: '2024-11-09'
abstract: Provides useful functions and a common structure to all the input data required
to run models like MAgPIE and REMIND of model input data.
authors:
Expand Down
4 changes: 2 additions & 2 deletions DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
Package: mrcommons
Type: Package
Title: MadRat commons Input Data Library
Version: 1.46.2
Date: 2024-11-08
Version: 1.46.3
Date: 2024-11-09
Authors@R: c(person("Benjamin Leon", "Bodirsky", email = "bodirsky@pik-potsdam.de", role = "aut"),
person("Kristine", "Karstens", role = "aut"),
person("Lavinia", "Baumstark", role = "aut"),
Expand Down
12 changes: 11 additions & 1 deletion R/calcMacBaseLandUse.R
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ calcMacBaseLandUse <- function(subtype) {
y <- add_dimension(y,
dim = 3.2,
add = "c_LU_emi_scen",
nm = c("SSP1", "SSP2", "SSP3", "SSP5", "SDP", "SDP_EI", "SDP_RC", "SDP_MC", "SSP2EU"))
nm = c("SSP1", "SSP2", "SSP3", "SSP5", "SDP", "SDP_EI", "SDP_RC", "SDP_MC", "SSP2EU","SSP2_lowEn"))
y <- add_dimension(y,
dim = 3.3,
add = "rcp",
Expand Down Expand Up @@ -83,6 +83,11 @@ calcMacBaseLandUse <- function(subtype) {
getNames(tmp) <- gsub("SSP2", "SSP3", getNames(tmp))
x <- mbind(x, tmp)

# add values for SSP2_lowEn copying the values from SSP2
tmp <- x[,,"SSP2"]
getNames(tmp) <- gsub("SSP2", "SSP2_lowEn", getNames(tmp))
x <- mbind(x, tmp)

# Replace CH4 and N2O LUC baseline for SSP2 and SSP1, since there is newer data from a
# coupled REMIND-MAgPIE 4.0 Baseline run
# Read ch4 and n2o emissions from MAgpIE Base scenario
Expand Down Expand Up @@ -214,6 +219,11 @@ calcMacBaseLandUse <- function(subtype) {
getNames(tmp) <- gsub("SSP2", "SSP3", getNames(tmp))
x <- mbind(x, tmp)

# add values for SSP2_lowEn copying the values from SSP2
tmp <- x[,,"SSP2"]
getNames(tmp) <- gsub("SSP2", "SSP2_lowEn", getNames(tmp))
x <- mbind(x, tmp)

} else {
stop("Unkown subtype: ", subtype)
}
Expand Down