Skip to content

Commit

Permalink
bug fix: model_input was not accessible from with output_fun-function…
Browse files Browse the repository at this point in the history
…. Now it works.
  • Loading branch information
Paul Schmidt-Walter committed Apr 24, 2020
1 parent aba9125 commit 39e20da
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 6 deletions.
2 changes: 1 addition & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Package: LWFBrook90R
Title: Run the LWF-Brook90 Hydrological Model in R
Version: 0.3.1
Version: 0.3.2
Authors@R: c(person("Paul", "Schmidt-Walter", , "[email protected]", role = c("aut", "cre")),
person("Volodymyr", "Trotsiuk", , "[email protected]", role = c("aut")),
person("Klaus", "Hammel", , ,role = c("aut")),
Expand Down
13 changes: 9 additions & 4 deletions R/runLWFB90.R
Original file line number Diff line number Diff line change
Expand Up @@ -297,9 +297,8 @@ runLWFB90 <- function(project.dir = "runLWFB90/",
names(simout) <- list.files(".", pattern = ".ASC")

# append results
if (rtrn.output) {
simres[names(simout)] <- simout
}
simres[names(simout)] <- simout


# ---- apply functions on simulation output -------------------------------
if (!is.null(output_fun)) {
Expand All @@ -310,7 +309,7 @@ runLWFB90 <- function(project.dir = "runLWFB90/",
output_fun <- list(output_fun)
}

outfunargs <- list(x = simout,...)
outfunargs <- list(x = simres,...)

outfunargsnms <- lapply(output_fun, FUN = function(x,argsnms) {
match.arg(methods::formalArgs(x),
Expand All @@ -329,6 +328,12 @@ runLWFB90 <- function(project.dir = "runLWFB90/",
warning = function(wrn){return(wrn)},
error = function(err){return(err)})
}

# remove the basic results again if they are not required
if (!rtrn.output) {
simres <- simres[-which(names(simres) %in% names(simout))]
}

}

} else {
Expand Down
2 changes: 1 addition & 1 deletion dev/README.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ knitr::opts_chunk$set(

------

Run the [LWF-BROOK90](https://www.lwf.bayern.de/boden-klima/wasserhaushalt/index.php) hydrological model from within R
Run the [LWF-BROOK90](https://www.lwf.bayern.de/boden-klima/wasserhaushalt/index.php) hydrological model in R

## Installation

Expand Down

0 comments on commit 39e20da

Please sign in to comment.