Skip to content

Commit

Permalink
Merge pull request #137 from dklein-pik/master
Browse files Browse the repository at this point in the history
Bugfix
  • Loading branch information
LaviniaBaumstark authored Nov 9, 2024
2 parents 3a0d184 + a264aa9 commit ba0b8a9
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 6 deletions.
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 = "[email protected]", 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

0 comments on commit ba0b8a9

Please sign in to comment.