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

v1.6.3.26 refactor(R): remove GR1A R code; now Fortran cod is used

Refs #65
Showing with 3 additions and 16 deletions
+3 -16
Package: airGR
Type: Package
Title: Suite of GR Hydrological Models for Precipitation-Runoff Modelling
Version: 1.6.3.25
Date: 2020-11-05
Version: 1.6.3.26
Date: 2020-11-06
Authors@R: c(
person("Laurent", "Coron", role = c("aut", "trl"), comment = c(ORCID = "0000-0002-1503-6204")),
person("Olivier", "Delaigue", role = c("aut", "cre"), comment = c(ORCID = "0000-0002-7668-8468"), email = "airGR@inrae.fr"),
......
......@@ -4,7 +4,7 @@
### 1.6.3.25 Release Notes (2020-11-06)
### 1.6.3.26 Release Notes (2020-11-06)
#### New features
......
......@@ -25,7 +25,6 @@ RunModel_GR1A <- function(InputsModel,RunOptions,Param){
ExportDatesR <- "DatesR" %in% RunOptions$Outputs_Sim;
ExportStateEnd <- "StateEnd" %in% RunOptions$Outputs_Sim;
BOOL_Fortran <- FALSE; if(BOOL_Fortran){
##Call_fortan
RESULTS <- .Fortran("frun_gr1a",PACKAGE="airGR",
##inputs
......@@ -45,18 +44,6 @@ RunModel_GR1A <- function(InputsModel,RunOptions,Param){
RESULTS$Outputs[ round(RESULTS$Outputs ,3)==(-999.999)] <- NA;
RESULTS$StateEnd[round(RESULTS$StateEnd,3)==(-999.999)] <- NA;
} else {
##R_version
L <- length(IndPeriod1)
P0 <- InputsModel$Precip[ IndPeriod1][1:(L-1)]
P1 <- InputsModel$Precip[ IndPeriod1][2: L ]
E1 <- InputsModel$PotEvap[IndPeriod1][2: L ]
Q1 <- P1*(1.-1./(1.+((0.7*P1+0.3*P0)/Param[1]/E1)^2.0)^0.5)
PEQ <- rbind(c(NA,NA,NA),cbind(E1,P1,Q1))
Outputs <- PEQ[,IndOutputs]
if(is.vector(Outputs)){ Outputs <- cbind(Outputs); }
RESULTS <- list(NOutputs=length(IndOutputs),IndOutputs=IndOutputs,Outputs=Outputs,StatesEnd=NA)
}
##Output_data_preparation
......
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