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
87bb2834
Commit
87bb2834
authored
Apr 18, 2021
by
Delaigue Olivier
Browse files
fix(test): use the 365.25 day by a year accordinf to the complete leap cycle of 400 years
parent
22d3f5ff
Pipeline
#22383
passed with stages
in 8 minutes and 13 seconds
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
R/CreateRunOptions.R
View file @
87bb2834
...
...
@@ -387,10 +387,10 @@ CreateRunOptions <- function(FUN_MOD, InputsModel,
}
Factor
<-
NULL
if
(
inherits
(
InputsModel
,
"hourly"
))
{
Factor
<-
365.
24
25
*
24
Factor
<-
365.25
*
24
}
if
(
inherits
(
InputsModel
,
"daily"
))
{
Factor
<-
365.
24
25
Factor
<-
365.25
}
if
(
inherits
(
InputsModel
,
"monthly"
))
{
Factor
<-
12
...
...
R/Utils.R
View file @
87bb2834
...
...
@@ -55,10 +55,10 @@
monthly
=
28
:
31
*
24
,
yearly
=
365
:
366
*
24
)
res
$
TimeStepMean
<-
switch
(
res
$
TimeUnit
,
hourly
=
1
,
daily
=
1
*
24
,
monthly
=
365.
24
25
/
12
*
24
,
yearly
=
365.
24
25
*
24
)
hourly
=
1
,
daily
=
1
*
24
,
monthly
=
365.25
/
12
*
24
,
yearly
=
365.25
*
24
)
res
$
TimeStep
<-
res
$
TimeStep
*
3600
res
$
TimeStepMean
<-
as.integer
(
res
$
TimeStepMean
*
3600
)
res
$
Class
<-
c
(
res
$
TimeUnit
,
res
$
Class
)
...
...
@@ -68,7 +68,7 @@
res
$
Class
<-
res
$
Class
[
!
is.na
(
res
$
Class
)]
if
(
!
is.null
(
DatesR
))
{
if
(
all
(
DiffTimeStep
!=
res
$
TimeStep
))
{
stop
(
"the time step of the model inputs must be "
,
res
$
TimeUnit
,
"\n"
)
stop
(
"the time step of the model inputs must be "
,
res
$
TimeUnit
)
}
}
return
(
res
)
...
...
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