Commit 4d3cf421 authored by Delaigue Olivier's avatar Delaigue Olivier
Browse files

refactor: replace the use of as.integer(0) by 0L in CreateRunOptions

parent e893d6a3
Pipeline #21718 canceled with stages
......@@ -117,7 +117,7 @@ CreateRunOptions <- function(FUN_MOD, InputsModel,
WTxt <- paste(WTxt, "model warm up period not defined: default configuration used", sep = "")
##If_the_run_period_starts_at_the_very_beginning_of_the_time_series
if (IndPeriod_Run[1L] == 1L) {
IndPeriod_WarmUp <- as.integer(0)
IndPeriod_WarmUp <- 0L
WTxt <- paste0(WTxt,"\n no data were found for model warm up!")
##We_look_for_the_longest_period_preceeding_the_run_period_with_a_maximum_of_one_year
} else {
......@@ -159,10 +159,10 @@ CreateRunOptions <- function(FUN_MOD, InputsModel,
if (storage.mode(IndPeriod_WarmUp) != "integer") {
stop("'IndPeriod_WarmUp' should be of type integer")
}
if (identical(IndPeriod_WarmUp, as.integer(0)) & verbose) {
if (identical(IndPeriod_WarmUp, 0L) & verbose) {
message(paste0(WTxt, " No warm up period is used"))
}
if ((IndPeriod_Run[1] - 1) != tail(IndPeriod_WarmUp, 1) & !identical(IndPeriod_WarmUp, as.integer(0))) {
if ((IndPeriod_Run[1] - 1) != tail(IndPeriod_WarmUp, 1) & !identical(IndPeriod_WarmUp, 0L)) {
WTxt <- paste0(WTxt, " Model warm up period is not directly before the model run period")
}
}
......
Markdown is supported
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