Commit d006f696 authored by David's avatar David
Browse files

fix(CreateCalibOptions): allow full fixed set of parameters

Refs #183
1 merge request!109Draft: Resolve "Simulation of water losses on routed flows based on GR groundwater exchange function"
Pipeline #62611 passed with stage
in 7 minutes and 39 seconds
Showing with 12 additions and 2 deletions
+12 -2
......@@ -50,13 +50,23 @@ CreateCalibOptions.InputsModel <- function(x, FixedParam = NULL, ...) {
}
}
# Add FixedParam
dots$FixedParam <- FixedParam
if (!is.null(FixedParam) && !any(is.na(FixedParam))) {
dots$FixedParam <- NULL
} else {
dots$FixedParam <- FixedParam
}
# Automatically define IsSD for intermediate basin GR models
dots$IsSD = !is.null(x$Qupstream) & dots$FUN_MOD != "RunModel_Lag"
# Add IsHyst in parameters if carried by InputsModel
if (!is.null(x$model$IsHyst)) dots$IsHyst <- x$model$IsHyst
# Call airGR function
do.call(airGR::CreateCalibOptions, dots)
CalibOptions <- do.call(airGR::CreateCalibOptions, dots)
# airGR::CreateCalibOptions don't like when there are no param to calibrate
# But we need the full set of fixed parameters here for airGRiwrm Calibration
if (!is.null(FixedParam) && !any(is.na(FixedParam))) {
CalibOptions$FixedParam <- FixedParam
}
return(CalibOptions)
}
#' @rdname CreateCalibOptions
......
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