Skip to content

Commit

Permalink
docs(RunModel): various improvements
Browse files Browse the repository at this point in the history
Closes #133
  • Loading branch information
David committed Jul 31, 2024
1 parent fe52d03 commit dd845ad
Show file tree
Hide file tree
Showing 10 changed files with 72 additions and 37 deletions.
11 changes: 10 additions & 1 deletion R/RunModel.GRiwrmInputsModel.R
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,16 @@
#' @param Param [list] parameter values. The list item names are the IDs of the sub-basins. Each item is a [numeric] [vector]
#' @param ... Further arguments for compatibility with S3 methods
#'
#' @return An object of class \emph{GRiwrmOutputsModel}. This object is a [list] of *OutputsModel* objects produced by [RunModel.InputsModel] for each node of the semi-distributed model.
#' @return An object of class \emph{GRiwrmOutputsModel}.
#' This object is a [list] of *OutputsModel* objects produced by [RunModel.InputsModel]
#' for each node of the semi-distributed model.
#'
#' It also contains the following attributes (see [attr]):
#' - "Qm3s": a [data.frame] containing the dates of simulation and one column by node
#' with the simulated flows in cubic meters per seconds (See [plot.Qm3s])
#' - "GRiwrm": a copy of the *GRiwrm* object produced by [CreateGRiwrm] and used for the simulation
#' - "TimeStep": time step of the simulation in seconds
#'
#' @export
#' @seealso [CreateGRiwrm()], [CreateInputsModel.GRiwrm()], [CreateRunOptions()]
#' @example man-examples/RunModel.GRiwrmInputsModel.R
Expand Down
23 changes: 11 additions & 12 deletions R/RunModel.InputsModel.R
Original file line number Diff line number Diff line change
@@ -1,21 +1,20 @@
#' Wrapper for [airGR::RunModel] for one sub-basin
#'
#' @details This function calls [airGR::RunModel] (See [airGR::RunModel] for further details).
#'
#' The list produced by the function (See Value section of [airGR::RunModel_GR4J])
#' is here completed by:
#'
#' - an item `$Qsim_m3` storing the simulated discharge series in m3/s
#' - an item `$Qover_m3` storing the volumes of over abstraction which occurs
#' when `RunModel_Lag` warns for negative simulated flows. The latter reflects the volume
#' that was planned to be drawn from the sub-basin but could not be drawn because
#' of the lack of water.
#'
#' @inheritParams airGR::RunModel
#' @param x \[object of class \emph{InputsModel}\] see [airGR::CreateInputsModel] for details
#' @param ... Further arguments for compatibility with S3 methods
#'
#' @inherit airGR::RunModel return return
#' @returns \[object of class \emph{OutputsModel}\] returned by [airGR::RunModel]
#' (See Value section of [airGR::RunModel_GR4J]) completed by new items:
#' - `Qsim_m3`: simulated flow in cubic meters per time step
#' - `Qover_m3` volumes of over abstractions which occurs when `RunModel_Lag` warns
#' for negative simulated flows
#' - `Qnat`: only present in case of Diversion in the node, simulated flow in mm
#' per time step before application of the Diversion
#' - `Qdiv_m3`: only present in case of Diversion in the node, simulated diverted flow in
#' cubic meters per time step. The latter differs from the flows time series provided
#' in argument `Qinf` of [CreateInputsModel.GRiwrm] by the limitation of diversion
#' applied by the minimum flow threshold `Qmin` to keep flowing in the river
#'
#' @export
RunModel.InputsModel <- function(x = NULL,
Expand Down
11 changes: 10 additions & 1 deletion R/RunModel_Reservoir.R
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,16 @@
#' of the reservoir and (2) the celerity in m/s of the upstream inflows.
#'
#' @return An *OutputsModel* object like the one return by [airGR::RunModel] but
#' completed with an item `Vsim` representing the water volume time series in m3.
#' completed with the items:
#' - `Vsim`: representing the water volume time series in m3
#' - `Qsim_m3`: flow released by the reservoir in cubic meters by time step
#' (see Details)
#' - `Qdiv_m3`: only present in case of Diversion in the node, diverted flow in
#' cubic meters per time step. The latter differs from the flows time series provided
#' in argument `Qinf` of [CreateInputsModel.GRiwrm] by the limitation due to an
#' empty reservoir
#' - `Qover_m3`: only present in case of Diversion in the node, diverted volumes
#' that cannot be operated due to an empty reservoir
#' @export
#'
#' @example man-examples/RunModel_Reservoir.R
Expand Down
2 changes: 1 addition & 1 deletion man/CreateInputsModel.GRiwrm.Rd

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

2 changes: 1 addition & 1 deletion man/CreateRunOptions.Rd

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

14 changes: 12 additions & 2 deletions man/RunModel.GRiwrmInputsModel.Rd

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

29 changes: 13 additions & 16 deletions man/RunModel.InputsModel.Rd

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

13 changes: 12 additions & 1 deletion man/RunModel_Reservoir.Rd

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

2 changes: 1 addition & 1 deletion man/plot.GRiwrmOutputsModel.Rd

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

2 changes: 1 addition & 1 deletion man/plot.Qm3s.Rd

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

0 comments on commit dd845ad

Please sign in to comment.