Commit 480878a5 authored by Delaigue Olivier's avatar Delaigue Olivier
Browse files

v1.0.15.0 BUG: leap years now considered in CreateRunOptions

Showing with 13 additions and 3 deletions
+13 -3
Package: airGR
Type: Package
Title: Suite of GR Hydrological Models for Precipitation-Runoff Modelling
Version: 1.0.14.3
Version: 1.0.15.0
Date: 2018-10-05
Authors@R: c(
person("Laurent", "Coron", role = c("aut", "trl"), comment = c(ORCID = "0000-0002-1503-6204")),
......
......@@ -13,7 +13,13 @@ output:
### 1.0.14.3 Release Notes (2018-10-05)
### 1.0.14.5 Release Notes (2018-10-10)
#### Bug fixes
- Fixed bug in <code>CreateRunOptions()</code>. The function now accounts correctly for leap years when no warm-up period is defined.
____________________________________________________________________________________
......
......@@ -71,7 +71,11 @@ CreateRunOptions <- function(FUN_MOD, InputsModel, IndPeriod_WarmUp = NULL, IndP
WTxt <- paste(WTxt,"\t No data were found for model warm up! \n",sep="");
##We_look_for_the_longest_period_preceeding_the_run_period_with_a_maximum_of_one_year
} else {
TmpDateR <- InputsModel$DatesR[IndPeriod_Run[1]] - 365*24*60*60; ### minimal date to start the warmup
TmpDateR0 <- InputsModel$DatesR[IndPeriod_Run[1]]
TmpDateR <- TmpDateR0 - 365*24*60*60; ### minimal date to start the warmup
if (format(TmpDateR, format = "%d") != format(TmpDateR0, format = "%d")) { ### leap year
TmpDateR <- TmpDateR - 1*24*60*60
}
IndPeriod_WarmUp <- which(InputsModel$DatesR==max(InputsModel$DatesR[1],TmpDateR)) : (IndPeriod_Run[1]-1);
if("hourly" %in% ObjectClass){ TimeStep <- as.integer( 60*60); }
if("daily" %in% ObjectClass){ TimeStep <- as.integer( 24*60*60); }
......
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