Skip to content

Commit

Permalink
Updating documentation and readme
Browse files Browse the repository at this point in the history
  • Loading branch information
Paul Schmidt-Walter committed May 11, 2019
1 parent 2a366f7 commit bc228cd
Show file tree
Hide file tree
Showing 4 changed files with 35 additions and 21 deletions.
6 changes: 3 additions & 3 deletions DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@ Package: LWFBrook90R
Title: Run the LWF-Brook90 Hydrological Model Within R
Version: 0.1.0
Authors@R: c(
person("Paul", "Schmidt-Walter", email = "[email protected]", role = c("aut", "cre")),
person("Volodymyr", "Trotsiuk", , "[email protected]", role = c("aut")),
person("Paul", "Schmidt-Walter", ,"[email protected]", role = c("aut", "cre")),
person("Volodymyr", "Trotsiuk", ,"[email protected]", role = c("aut")),
person("Klaus", "Hammel", , , role = c("aut","cph")),
person("Martin", "Kennel", , , role = c("aut","cph")),
person("Tony", "Federer", , "[email protected]", role = c("aut","cph"))
person("Tony", "Federer", "[email protected]", role = c("aut","cph"))
)
Description: Run the LWF-BROOK90 hydrological model within R. The central
function creates the input from model control options, parameters, soil and
Expand Down
36 changes: 21 additions & 15 deletions R/mrunLWFB90.R
Original file line number Diff line number Diff line change
@@ -1,16 +1,11 @@
#' Make a multirun simulation using a set of variable input parameters.
#'
#' Repeatedly calls \code{\link{runLWFB90}} in parallel, with varying input parameters.
#'
#' @param paramvar data.frame of variable input parameters with realisations for each single run.
#' The ith values replace the list elements in param.b90 of the ith simulation,
#' with the column names of paramvar being matched to the names in param.b90.
#' In order to match values from paramvar to data.frame or vector elements in param.b90,
#' the respective column name of paramvar has to be setup from the name and index.
#' For example, to place the 2nd value of 'ths' in the soil_materials data.frame,
#' the respective column name of paramvar has to be called 'soil_materials.ths2'.
#' In order to replace the 3 value of pdur in param.b90, the column name has to be named 'pdur3'.
#' The function for replacing values in vector element and data.frames is \code{\link{replace_vecelements}}.
#' Wrapper function for \code{\link{runLWFB90}} to make multiple simulations parallel,
#' with varying input parameters.
#'
#' @param paramvar data.frame of variable input parameters. For each row,
#' a simulation is performed, with the elements in param.b90 being replaced by the
#' respective column of paramvar. All parameter names (column names) in paramvar must be found in param.b90.
#' @param param.b90 Named list of parameters, in which the parameters defined in paramvar will be replaced.
#' @param options.b90 Named list of model control option to be used in all simulations.
#' @param soil data.frame with soil properties passed to \code{\link{runLWFB90}}, or a list of lists with different soil profiles
Expand All @@ -20,16 +15,27 @@
#' @param keep.subdirs keep sub-directories of the single runs? Default is FALSE.
#' @param cores number of CPUs to use for parallel processing. Default is 2.
#' @param showProgress Show progressbar? Default is TRUE.
#' @param ... Further arguments passed to \code{\link{runLWFB90}} for selecting output and return values of the single runs.
#' @param ... Further arguments passed to \code{\link{runLWFB90}} to select model output
#' and return values for the single run simulations.
#'
#' @return A named list with the results of the single runs as returned by \code{\link{runLWFB90}}.
#' Simulation errors or processing errrors are passed on.
#' Simulation or processing errrors are passed on.
#'
#' @details The LWF-Brook90 output files of the single runs are stored in subdirectories within 'multirun.dir'.
#' @details
#' @section The LWF-Brook90 output files of the single runs are stored in subdirectories within 'multirun.dir'.
#' If \code{keep.subdirs=FALSE}, they are deleted after successful singlerun simulation. In case of an error,
#' the respective subdirectory is not deleted. The returned list of single run results can become very large,
#' the respective subdirectory is not deleted. Care must be taken, as the returned list of single run results can become very large,
#' if many simulations are done and the selected output contains daily resolution datasets.
#'
#' @section The transfer of values from a row in paramvar to param.b90 before each single run
#' simulation is done by matching names from paramvar and \code{param.b90}. In order to adress data.frame
#' or vector elements in \code{param.b90} with a column name in \code{paramvar}, the respective column name
#' has to be setup from its name and index in param.b90. For example, to place the 2nd value of \code{ths}
#' in the \code{soil_materials} data.frame, the respective column name in \code{paramvar}
#' has to be called 'soil_materials.ths2'. In order to replace the 3rd value of vector element \code{maxlai} in \code{param.b90},
#' the column name has to be named 'maxlai3'. The function used for replacing values in vector elements
#' and data.frames is \code{\link{replace_vecelements}}.
#'
#' @export
#'
#' @examples
Expand Down
7 changes: 5 additions & 2 deletions README.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ knitr::opts_chunk$set(
LWFBrook90R: Run the LWF-BROOK90 hydrological model from within R.

# Motivation
In hydrology, many R-packages exist that deal with pre- and post-processing of input data and results of hydrological process models. In addition, many ready-to-use algorithms exist in R providing automatic calibration, sensitivity analysis, and parallelisation techniques. In order to make the vast resources of R directly available to the 1D-SVAT model [LWF-BROOK90](https://www.lwf.bayern.de/boden-klima/wasserhaushalt/index.php), *LWFBrook90R* was developed. The Fortran model code is integrated into the package as dynamic library and compiles, when installing *LWFBrook90R*.
Basically, *LWFBrook90R* features the following functionality in one function call to the package core function `runLWFB90()`:
In hydrology, many R-packages exist that deal with pre- and post-processing of input data and results of hydrological process models. In addition, many ready-to-use algorithms exist in R providing automatic calibration, sensitivity analysis, and parallelisation techniques. In order to make the vast resources of R directly available to the 1D-SVAT model [LWF-BROOK90](https://www.lwf.bayern.de/boden-klima/wasserhaushalt/index.php), *LWFBrook90R* was developed. The Fortran model code is integrated into the package as dynamic library and compiles when the package is installed.
*LWFBrook90R* features the following functionality in one function call to the package core function `runLWFB90()`:

* create model input objects from climate driving data, model control options and parameters,
* execute the LWF-BROOK90 model code,
Expand Down Expand Up @@ -107,3 +107,6 @@ Tony Federer's original Brook90 Fortran 77 code was enhanced by Klaus Hammel and

# License
GPL-3

## Notes
All changes made to the Fortran code of LWF-Brook90R should be returned to
7 changes: 6 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ LWFBrook90R: Run the LWF-BROOK90 hydrological model from within R.
Motivation
==========

In hydrology, many R-packages exist that deal with pre- and post-processing of input data and results of hydrological process models. In addition, many ready-to-use algorithms exist in R providing automatic calibration, sensitivity analysis, and parallelisation techniques. In order to make the vast resources of R directly available to the 1D-SVAT model [LWF-BROOK90](https://www.lwf.bayern.de/boden-klima/wasserhaushalt/index.php), *LWFBrook90R* was developed. The Fortran model code is integrated into the package as dynamic library and compiles, when installing *LWFBrook90R*. Basically, *LWFBrook90R* features the following functionality in one function call to the package core function `runLWFB90()`:
In hydrology, many R-packages exist that deal with pre- and post-processing of input data and results of hydrological process models. In addition, many ready-to-use algorithms exist in R providing automatic calibration, sensitivity analysis, and parallelisation techniques. In order to make the vast resources of R directly available to the 1D-SVAT model [LWF-BROOK90](https://www.lwf.bayern.de/boden-klima/wasserhaushalt/index.php), *LWFBrook90R* was developed. The Fortran model code is integrated into the package as dynamic library and compiles when the package is installed. *LWFBrook90R* features the following functionality in one function call to the package core function `runLWFB90()`:

- create model input objects from climate driving data, model control options and parameters,
- execute the LWF-BROOK90 model code,
Expand Down Expand Up @@ -115,3 +115,8 @@ License
=======

GPL-3

Notes
-----

All changes made to the Fortran code of LWF-Brook90R should be returned to

0 comments on commit bc228cd

Please sign in to comment.