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

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

Showing with 3 additions and 3 deletions
+3 -3
...@@ -117,7 +117,7 @@ CreateRunOptions <- function(FUN_MOD, InputsModel, ...@@ -117,7 +117,7 @@ CreateRunOptions <- function(FUN_MOD, InputsModel,
WTxt <- paste(WTxt, "model warm up period not defined: default configuration used", sep = "") 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_the_run_period_starts_at_the_very_beginning_of_the_time_series
if (IndPeriod_Run[1L] == 1L) { 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!") 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 ##We_look_for_the_longest_period_preceeding_the_run_period_with_a_maximum_of_one_year
} else { } else {
...@@ -159,10 +159,10 @@ CreateRunOptions <- function(FUN_MOD, InputsModel, ...@@ -159,10 +159,10 @@ CreateRunOptions <- function(FUN_MOD, InputsModel,
if (storage.mode(IndPeriod_WarmUp) != "integer") { if (storage.mode(IndPeriod_WarmUp) != "integer") {
stop("'IndPeriod_WarmUp' should be of type 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")) 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") WTxt <- paste0(WTxt, " Model warm up period is not directly before the model run period")
} }
} }
......
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