Commit a2ae0d35 authored by unknown's avatar unknown
Browse files

v1.0.5.20 function TransfoParam_GR1A() cleaned

Showing with 28 additions and 19 deletions
+28 -19
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.0.5.19 Version: 1.0.5.20
Date: 2017-01-23 Date: 2017-01-23
Authors@R: c( Authors@R: c(
person("Laurent", "Coron", role = c("aut", "trl")), person("Laurent", "Coron", role = c("aut", "trl")),
......
TransfoParam_GR1A <- function(ParamIn,Direction){ TransfoParam_GR1A <- function(ParamIn, Direction) {
NParam <- 1; NParam <- 1
Bool <- is.matrix(ParamIn); Bool <- is.matrix(ParamIn)
if(Bool==FALSE){ ParamIn <- rbind(ParamIn); }
if(ncol(ParamIn)!=NParam){ stop(paste("the GR1A model requires ",NParam," parameters \n",sep="")); return(NULL); } if (Bool == FALSE) {
ParamIn <- rbind(ParamIn)
if(Direction=="TR"){ }
ParamOut <- (ParamIn+10.0)/8;
} if (ncol(ParamIn) != NParam) {
if(Direction=="RT"){ stop(paste("the GR1A model requires ", NParam, " parameters \n", sep = ""))
ParamOut <- ParamIn*8-10.0; return(NULL)
} }
if(Bool==FALSE){ ParamOut <- ParamOut[1,]; } if (Direction == "TR") {
return(ParamOut); ParamOut <- (ParamIn + 10.0) / 8
}
if (Direction == "RT") {
ParamOut <- ParamIn * 8 - 10.0
}
if (Bool == FALSE) {
ParamOut <- ParamOut[1, ]
}
return(ParamOut)
} }
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