Skip to content

Commit

Permalink
bugfix sugar cane value for SOC chanfe factors
Browse files Browse the repository at this point in the history
  • Loading branch information
k4rst3ns committed Dec 15, 2023
1 parent a001942 commit 63d3c19
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 17 deletions.
2 changes: 1 addition & 1 deletion .buildlibrary
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
ValidationKey: '10206154'
ValidationKey: '10227414'
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: 'mrland: MadRaT land data package'
version: 0.51.8
date-released: '2023-12-12'
version: 0.51.9
date-released: '2023-12-15'
abstract: The package provides land related data via the madrat framework.
authors:
- family-names: Dietrich
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: mrland
Title: MadRaT land data package
Version: 0.51.8
Date: 2023-12-12
Version: 0.51.9
Date: 2023-12-15
Authors@R: c(
person("Jan Philipp", "Dietrich", , "dietrich@pik-potsdam.de", role = c("aut", "cre")),
person("Abhijeet", "Mishra", role = "aut"),
Expand Down
19 changes: 10 additions & 9 deletions R/calcSoilStockChangeFactors.R
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,10 @@ calcSoilStockChangeFactors <- function() {

annCrop <- "Long_term_cultivated"
perTree <- "Perennial_Tree_Crop"
kcrInAnnCrop <- setdiff(kcr, c("betr", "begr", "oilpalm", "others", "rice_pro", "sugr_cane"))
kcrInAnnCrop <- setdiff(kcr, c("betr", "begr", "oilpalm", "others", "rice_pro"))
# sugar cane would be an perennial, but due to mostly highly managed systems (with peplanting every 2-5 years)
# or traditional systems with burning soc stocks might be closer to annual SOC change factors
# than to perennials (like trees)
kcrInPerTree <- c("betr", "begr", "oilpalm")
kcrInMix <- c("others", "rice_pro")
lu2kcr[, , annCrop][, , kcrInAnnCrop] <- 1
Expand All @@ -34,7 +37,7 @@ calcSoilStockChangeFactors <- function() {
noShare <- which(round(dimSums(othersPerShare, dim = 3.1)) != 1)
othersPerShare <- dimSums(othersPerShare[, , c("c3per", "c4per")], dim = 3.1)
othersPerShare[noShare] <- 0.62 # default assumption 62% perennials in others
# (as 62% of total others production is perennial)
# (as 62% of total others production is perennial)
riceNonFlood <- calcOutput("Ricearea", share = TRUE, aggregate = FALSE)[, "y1995", ]

lu2kcrIso <- magpie_expand(lu2kcr, riceNonFlood)
Expand All @@ -51,11 +54,9 @@ calcSoilStockChangeFactors <- function() {
weight <- collapseDim(calcOutput("Croparea", aggregate = FALSE, physical = TRUE)[, "y1995", ])
weight[, , setdiff(kcr, kcrInMix)] <- 1


return(
list(x = cShare,
weight = weight + 1e-10,
min = 0,
unit = "tC per tC",
description = "Stock change factors for first 30 cm of the soil profile"))
return(list(x = cShare,
weight = weight + 1e-10,
min = 0,
unit = "tC per tC",
description = "Stock change factors for first 30 cm of the soil profile"))
}
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# MadRaT land data package

R package **mrland**, version **0.51.8**
R package **mrland**, version **0.51.9**

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

Expand Down Expand Up @@ -39,7 +39,7 @@ In case of questions / problems please contact Jan Philipp Dietrich <dietrich@pi

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

Dietrich J, Mishra A, Weindl I, Bodirsky B, Wang X, Baumstark L, Kreidenweis U, Klein D, Steinmetz N, Chen D, Humpenoeder F, von Jeetze P, Wirth S, Beier F, Hoetten D (2023). _mrland: MadRaT land data package_. doi: 10.5281/zenodo.3822083 (URL: https://doi.org/10.5281/zenodo.3822083), R package version 0.51.8, <URL: https://github.com/pik-piam/mrland>.
Dietrich J, Mishra A, Weindl I, Bodirsky B, Wang X, Baumstark L, Kreidenweis U, Klein D, Steinmetz N, Chen D, Humpenoeder F, von Jeetze P, Wirth S, Beier F, Hoetten D (2023). _mrland: MadRaT land data package_. doi:10.5281/zenodo.3822083 <https://doi.org/10.5281/zenodo.3822083>, R package version 0.51.9, <https://github.com/pik-piam/mrland>.

A BibTeX entry for LaTeX users is

Expand All @@ -48,7 +48,7 @@ A BibTeX entry for LaTeX users is
title = {mrland: MadRaT land data package},
author = {Jan Philipp Dietrich and Abhijeet Mishra and Isabelle Weindl and Benjamin Leon Bodirsky and Xiaoxi Wang and Lavinia Baumstark and Ulrich Kreidenweis and David Klein and Nele Steinmetz and David Chen and Florian Humpenoeder and Patrick {von Jeetze} and Stephen Wirth and Felicitas Beier and David Hoetten},
year = {2023},
note = {R package version 0.51.8},
note = {R package version 0.51.9},
doi = {10.5281/zenodo.3822083},
url = {https://github.com/pik-piam/mrland},
}
Expand Down

0 comments on commit 63d3c19

Please sign in to comment.