Commit d6f27bc0 authored by Delaigue Olivier's avatar Delaigue Olivier
Browse files

v1.6.3.70 style: clean PE_Oudin R code

Refs #62
Showing with 4 additions and 8 deletions
+4 -8
Package: airGR Package: airGR
Type: Package Type: Package
Title: Suite of GR Hydrological Models for Precipitation-Runoff Modelling Title: Suite of GR Hydrological Models for Precipitation-Runoff Modelling
Version: 1.6.3.69 Version: 1.6.3.70
Date: 2020-11-23 Date: 2020-11-23
Authors@R: c( Authors@R: c(
person("Laurent", "Coron", role = c("aut", "trl"), comment = c(ORCID = "0000-0002-1503-6204")), person("Laurent", "Coron", role = c("aut", "trl"), comment = c(ORCID = "0000-0002-1503-6204")),
......
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
### 1.6.3.69 Release Notes (2020-11-23) ### 1.6.3.70 Release Notes (2020-11-23)
#### New features #### New features
......
...@@ -28,10 +28,10 @@ PE_Oudin <- function(JD, Temp, ...@@ -28,10 +28,10 @@ PE_Oudin <- function(JD, Temp,
if (LatUnit[1L] == "deg" & (all(Lat >= 90) | all(Lat <= -90))) { if (LatUnit[1L] == "deg" & (all(Lat >= 90) | all(Lat <= -90))) {
stop("'Lat' must be comprised between -90 and +90 degrees") stop("'Lat' must be comprised between -90 and +90 degrees")
} }
if (!RunFortran & LatUnit[1L] == "rad") { if (LatUnit[1L] == "rad") {
FI <- Lat FI <- Lat
} }
if (!RunFortran & LatUnit[1L] == "deg") { if (LatUnit[1L] == "deg") {
FI <- Lat / (180 / pi) FI <- Lat / (180 / pi)
} }
if (any(JD < 0) | any(JD > 366)) { if (any(JD < 0) | any(JD > 366)) {
...@@ -61,9 +61,6 @@ PE_Oudin <- function(JD, Temp, ...@@ -61,9 +61,6 @@ PE_Oudin <- function(JD, Temp,
## ---------- Oudin's formula ## ---------- Oudin's formula
if (RunFortran) { if (RunFortran) {
if (LatUnit[1L] == "rad") {
Lat = Lat * 180 / pi
}
LInputs = as.integer(length(Temp)) LInputs = as.integer(length(Temp))
...@@ -86,7 +83,6 @@ PE_Oudin <- function(JD, Temp, ...@@ -86,7 +83,6 @@ PE_Oudin <- function(JD, Temp,
PE_Oudin_D <- rep(NA, length(Temp)) PE_Oudin_D <- rep(NA, length(Temp))
COSFI <- cos(FI) COSFI <- cos(FI)
AFI <- abs(FI / 42)
for (k in seq_along(Temp)) { for (k in seq_along(Temp)) {
......
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