Skip to content

Commit

Permalink
renamed old and unused function
Browse files Browse the repository at this point in the history
  • Loading branch information
FelicitasBeier committed Nov 1, 2024
1 parent d94b6f0 commit 78d29f5
Show file tree
Hide file tree
Showing 13 changed files with 77 additions and 77 deletions.
2 changes: 1 addition & 1 deletion .buildlibrary
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
ValidationKey: '12856050'
ValidationKey: '12878004'
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.64.2
date-released: '2024-10-29'
version: 0.64.3
date-released: '2024-11-01'
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.64.2
Date: 2024-10-29
Version: 0.64.3
Date: 2024-11-01
Authors@R: c(
person("Jan Philipp", "Dietrich", , "dietrich@pik-potsdam.de", role = c("aut", "cre")),
person("Abhijeet", "Mishra", role = "aut"),
Expand Down
2 changes: 1 addition & 1 deletion NAMESPACE
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ export(calcPlantationContribution)
export(calcPlantedForest)
export(calcSOMexogenous)
export(calcTimberDemandExt)
export(readEvapotranspiration)
export(readH08evapotranspiration)
export(readPYieldCoeff)
export(spatial_header)
export(toolPatternScaling)
Expand Down
10 changes: 5 additions & 5 deletions R/calcEvapotranspiration.R → R/calcH08evapotranspiration.R
Original file line number Diff line number Diff line change
@@ -1,31 +1,31 @@
#' @title calcEvapotranspiration
#' @title calcH08evapotranspiration
#' @description Calc evapotranspiration data for SSP cenarios in mm/month
#' @param subtype Switch between different inputs
#' @return magpie object in cellular resolution
#' @author Marcos Alves
#'
#' @examples
#' \dontrun{
#' calcOutput("Evapotranspiration", subtype = "H08:mri-esm2-0")
#' calcOutput("H08evapotranspiration", subtype = "H08:mri-esm2-0")
#' }
#'
#' @import madrat
#' @import magclass
#' @importFrom magpiesets findset
#'

calcEvapotranspiration <- function(subtype = "H08:mri-esm2-0") {
calcH08evapotranspiration <- function(subtype = "H08:mri-esm2-0") {

time <- findset("time")
timePast <- time[1:match("y2010", time)]
timeFuture <- time[match("y2015", time):match("y2100", time)]

y <- readSource("Evapotranspiration", subtype = paste0(subtype, ":", "historical"),
y <- readSource("H08evapotranspiration", subtype = paste0(subtype, ":", "historical"),
convert = FALSE)[, timePast, ]
scenarios <- c("ssp126", "ssp370", "ssp585") # Current ISIMIP3bv2 scenarios
x <- list()
for (scenario in scenarios) {
x[[scenario]] <- mbind(setNames(y, scenario), readSource("Evapotranspiration",
x[[scenario]] <- mbind(setNames(y, scenario), readSource("H08evapotranspiration",
subtype = paste0(subtype, ":", scenario),
convert = FALSE)[, timeFuture, ])
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
#' @title downloadEvapotranspiration
#' @title downloadH08evapotranspiration
#' @description Download water models evapotranspiration data
#' @param subtype Switch between different inputs
#' @author Marcos Alves
#' @examples
#'
#' \dontrun{readSource("Evapotranspiration", convert="onlycorrect")}
#' \dontrun{readSource("H08evapotranspiration", convert="onlycorrect")}

downloadEvapotranspiration <- function(subtype = "H08:mri-esm2-0:historical") {
downloadH08vapotranspiration <- function(subtype = "H08:mri-esm2-0:historical") {

x <- toolSplitSubtype(subtype,
list(waterModel = NULL,
Expand Down
8 changes: 4 additions & 4 deletions R/readEvapotranspiration.R → R/readH08evapotranspiration.R
Original file line number Diff line number Diff line change
@@ -1,21 +1,21 @@
#' @title readEvapotranspiration
#' @title readH08evapotranspiration
#' @description Read evapotranspiration data
#' @param subtype Switch between different inputs
#' @return MAgPIE objects with results on cellular level.
#' @author Marcos Alves
#' @seealso
#' \code{\link{readEvapotranspiration}}
#' \code{\link{readH08evapotranspiration}}
#' @examples
#' \dontrun{
#' readSource("Evapotranspiration", subtype, convert = "onlycorrect")
#' readSource("H08evapotranspiration", subtype, convert = "onlycorrect")
#' }
#'
#' @importFrom terra rast
#' @importFrom raster brick
#' @importFrom magclass as.magpie
#' @export

readEvapotranspiration <-
readH08evapotranspiration <-
function(subtype = "H08:mri-esm2-0:historical") {
x <- toolSplitSubtype(subtype, list(water_model = NULL, climate_model = NULL, scenario = NULL))
files <- Sys.glob("*.nc")
Expand Down
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.64.2**
R package **mrland**, version **0.64.3**

[![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, Sauer P, Tommey J (2024). _mrland: MadRaT land data package_. doi:10.5281/zenodo.3822083 <https://doi.org/10.5281/zenodo.3822083>, R package version 0.64.2, <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, Sauer P, Tommey J (2024). _mrland: MadRaT land data package_. doi:10.5281/zenodo.3822083 <https://doi.org/10.5281/zenodo.3822083>, R package version 0.64.3, <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 and Pascal Sauer and Jake Tommey},
year = {2024},
note = {R package version 0.64.2},
note = {R package version 0.64.3},
url = {https://github.com/pik-piam/mrland},
doi = {10.5281/zenodo.3822083},
}
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

21 changes: 0 additions & 21 deletions man/downloadEvapotranspiration.Rd

This file was deleted.

21 changes: 21 additions & 0 deletions man/downloadH08vapotranspiration.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

29 changes: 0 additions & 29 deletions man/readEvapotranspiration.Rd

This file was deleted.

29 changes: 29 additions & 0 deletions man/readH08evapotranspiration.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 78d29f5

Please sign in to comment.