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
d70aa709
Commit
d70aa709
authored
Mar 12, 2019
by
Delaigue Olivier
Browse files
v1.2.8.11 CLEAN: input checks added to PEdaily_Oudin
parent
90f76f91
Changes
3
Hide whitespace changes
Inline
Side-by-side
DESCRIPTION
View file @
d70aa709
Package: airGR
Type: Package
Title: Suite of GR Hydrological Models for Precipitation-Runoff Modelling
Version: 1.2.8.1
0
Version: 1.2.8.1
1
Date: 2019-03-12
Authors@R: c(
person("Laurent", "Coron", role = c("aut", "trl"), comment = c(ORCID = "0000-0002-1503-6204")),
...
...
NEWS.rmd
View file @
d70aa709
...
...
@@ -13,7 +13,7 @@ output:
### 1.2.8.1
0
Release Notes (2019-03-12)
### 1.2.8.1
1
Release Notes (2019-03-12)
...
...
@@ -73,6 +73,8 @@ output:
- <code>Calibration()</code> function now returns an error message if <code>FUN_CALIB</code> is not a function
- Inputs of <code>PEdaily_Oudin()</code> are now checked
- <code>PEdaily_Oudin()</code> example corrected (the Julian day was one day too early)
____________________________________________________________________________________
...
...
R/PEdaily_Oudin.R
View file @
d70aa709
PEdaily_Oudin
<-
function
(
JD
,
Temp
,
LatRad
,
Lat
,
LatUnit
=
c
(
"rad"
,
"deg"
))
{
## ---------- check arguments
if
(
!
missing
(
LatRad
))
{
warning
(
"Deprecated \"LatRad\" argument. Please, use \"Lat\" instead."
)
if
(
missing
(
Lat
))
{
Lat
<-
LatRad
}
}
if
(
!
any
(
LatUnit
%in%
c
(
"rad"
,
"deg"
)))
{
stop
(
"\"LatUnit\" must be \"rad\" or \"deg\"."
)
if
(
!
inherits
(
JD
,
"numeric"
))
{
stop
(
"'JD' must be of class 'numeric'"
)
}
if
(
!
inherits
(
Temp
,
"numeric"
))
{
stop
(
"'Temp' must be of class 'numeric'"
)
}
if
(
length
(
JD
)
!=
length
(
Temp
))
{
stop
(
"'Temp' and 'LatUnit' must have the same length"
)
}
if
(
!
any
(
LatUnit
%in%
c
(
"rad"
,
"deg"
)))
{
stop
(
"'LatUnit' must be \"rad\" or \"deg\""
)
}
if
(
!
inherits
(
Lat
,
"numeric"
)
|
length
(
Lat
)
!=
1
)
{
stop
(
"'Lat' must be a 'numeric' of length one"
)
}
PE_Oudin_D
<-
rep
(
NA
,
length
(
Temp
))
if
(
LatUnit
[
1L
]
==
"rad"
)
{
FI
<-
Lat
}
...
...
@@ -20,6 +31,10 @@ PEdaily_Oudin <- function(JD, Temp, LatRad, Lat, LatUnit = c("rad", "deg")) {
FI
<-
Lat
/
(
180
/
pi
)
}
## ---------- Oudin's formula
PE_Oudin_D
<-
rep
(
NA
,
length
(
Temp
))
COSFI
<-
cos
(
FI
)
AFI
<-
abs
(
FI
/
42
)
...
...
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