• Dorchies David's avatar
    feat: add RunModel.Supervisor (test failed) · 93ee57f9
    Dorchies David authored
    - Test comparing outputs of RunModel.GRiwrmInputsModel and RunModel.Supervisor without regulation fails (still initial states issues to solve)
    - Temporarly add corrected version of RunModel_lag for debugging initial states issue.
    
    Refs #19
    93ee57f9
RunModel.GR.R 626 bytes
#' Run rainfall-runoff part of a sub-basin model
#'
#' @inherit airGR::RunModel
#' @param x `InputsModel` used as `InputsModel` parameter for [airGR::RunModel]
#' @param ... further arguments passed to or from other methods
#'
#' @export
#'
RunModel.GR <- function(x, RunOptions, Param, ...) {
  if (inherits(x, "SD")) {
    # Lag model take one parameter at the beginning of the vector
    iFirstParamRunOffModel <- 2
  } else {
    # All parameters
    iFirstParamRunOffModel <- 1
  FUN_MOD <- match.fun(x$FUN_MOD)
  FUN_MOD(x, RunOptions = RunOptions,
          Param = Param[iFirstParamRunOffModel:length(Param)])