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

v1.6.3.70 style: clean PE_Oudin R code

Refs #62
parent 52cf5081
Pipeline #17762 canceled with stages
Package: airGR
Type: Package
Title: Suite of GR Hydrological Models for Precipitation-Runoff Modelling
Version: 1.6.3.69
Version: 1.6.3.70
Date: 2020-11-23
Authors@R: c(
person("Laurent", "Coron", role = c("aut", "trl"), comment = c(ORCID = "0000-0002-1503-6204")),
......
......@@ -4,7 +4,7 @@
### 1.6.3.69 Release Notes (2020-11-23)
### 1.6.3.70 Release Notes (2020-11-23)
#### New features
......
......@@ -28,10 +28,10 @@ PE_Oudin <- function(JD, Temp,
if (LatUnit[1L] == "deg" & (all(Lat >= 90) | all(Lat <= -90))) {
stop("'Lat' must be comprised between -90 and +90 degrees")
}
if (!RunFortran & LatUnit[1L] == "rad") {
if (LatUnit[1L] == "rad") {
FI <- Lat
}
if (!RunFortran & LatUnit[1L] == "deg") {
if (LatUnit[1L] == "deg") {
FI <- Lat / (180 / pi)
}
if (any(JD < 0) | any(JD > 366)) {
......@@ -61,9 +61,6 @@ PE_Oudin <- function(JD, Temp,
## ---------- Oudin's formula
if (RunFortran) {
if (LatUnit[1L] == "rad") {
  • I think that the .Fortran call should used FI and not Lat anymore. Be careful with Lat = rep(Lat, LInputs), I think that FI should also be used here.

    Edited by François Bourgin
Please register or sign in to reply
Lat = Lat * 180 / pi
}
LInputs = as.integer(length(Temp))
......@@ -86,7 +83,6 @@ PE_Oudin <- function(JD, Temp,
PE_Oudin_D <- rep(NA, length(Temp))
COSFI <- cos(FI)
AFI <- abs(FI / 42)
for (k in seq_along(Temp)) {
......
Markdown is supported
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