Commit c764c87a authored by Dorchies David's avatar Dorchies David
Browse files

ci: solve R CMD check issues

- Missing documentation
- wrong variable
- use x[length(x)] instead of tail(x,1)

Refs #19
Showing with 7 additions and 4 deletions
+7 -4
......@@ -26,6 +26,8 @@ CreateInputsModel.GRiwrm <- function(x, DatesR, Precip, PotEvap, Qobs, ...) {
#' Create an empty InputsModel object for **airGRiwrm** nodes
#'
#' @param griwrm a `GRiwrm` object (See [GRiwrm])
#'
#' @return \emph{GRiwrmInputsModel} empty object
CreateEmptyGRiwrmInputsModel <- function(griwrm) {
InputsModel <- list()
......
......@@ -2,7 +2,7 @@
#'
#' @inheritParams airGR::RunModel_Lag
#' @param x `InputsModel` used as `InputsModel` parameter for [airGR::RunModel_Lag]
#' @param QSimDown a [numeric] corresponding to the runoff of the sub-basin (Typically the `Qsim` outputs of the GR model)
#' @param QsimDown a [numeric] corresponding to the runoff of the sub-basin (Typically the `Qsim` outputs of the GR model)
#' @param ... further arguments passed to or from other methods
#'
#' @return `OutputsModel` object. See [airGR::RunModel_Lag]
......
......@@ -63,7 +63,7 @@ RunModel.Supervisor <- function(x, RunOptions, Param, ...) {
Qsim[[id]][x$ts.index] <- x$OutputsModel[[id]]$Qsim
# Routing Qsim to the downstream node
if(!is.na(x$InputsModel[[id]]$down)) {
x$InputsModel[[x$InputsModel[[id]]$down]]$Qupstream[iTS, i] <-
x$InputsModel[[x$InputsModel[[id]]$down]]$Qupstream[iTS, id] <-
x$OutputsModel[[id]]$Qsim
}
}
......
......@@ -101,8 +101,8 @@ RunModel_Lag <- function(InputsModel, RunOptions, Param) {
if ("StateEnd" %in% RunOptions$Outputs_Sim) {
OutputsModel$StateEnd$SD <- lapply(seq(NbUpBasins), function(x) {
LengthTs <- tail(RunOptions$IndPeriod_Run,1)
InputsModel$Qupstream[(LengthTs - floor(PT[x])):LengthTs, x]
lastTS <- RunOptions$IndPeriod_Run[length(RunOptions$IndPeriod_Run)]
InputsModel$Qupstream[(lastTS - floor(PT[x])):lastTS, x]
})
#message("StateEnd: ",paste(OutputsModel$StateEnd$SD, collapse = ", "))
}
......
......@@ -87,6 +87,7 @@ doSupervision <- function(supervisor) {
#'
#' Stop the execution if an error is detected.
#'
#' @param InputsModel a `GRiwrmInputsModel` object (See [CreateInputsModel.GRiwrm])
#' @param RunOptions a `GRiwrmRunOptions` object (See [CreateRunOptions.GRiwrmInputsModel])
#' @param Param a [list] of [numeric] containing model parameters of each node of the network
#'
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment