Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
HYCAR-Hydro
airGR
Commits
480878a5
Commit
480878a5
authored
Oct 10, 2018
by
Delaigue Olivier
Browse files
v1.0.15.0 BUG: leap years now considered in CreateRunOptions
parent
e9a48d75
Changes
3
Hide whitespace changes
Inline
Side-by-side
DESCRIPTION
View file @
480878a5
Package: airGR
Type: Package
Title: Suite of GR Hydrological Models for Precipitation-Runoff Modelling
Version: 1.0.1
4.3
Version: 1.0.1
5.0
Date: 2018-10-05
Authors@R: c(
person("Laurent", "Coron", role = c("aut", "trl"), comment = c(ORCID = "0000-0002-1503-6204")),
...
...
NEWS.rmd
View file @
480878a5
...
...
@@ -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.
____________________________________________________________________________________
...
...
R/CreateRunOptions.R
View file @
480878a5
...
...
@@ -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
);
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment