From de1d4d95e0867a78c39941e41f6a00592ac21ecf Mon Sep 17 00:00:00 2001 From: unknown <olivier.delaigue@ANPI1430.antony.irstea.priv> Date: Thu, 3 Nov 2016 15:50:51 +0100 Subject: [PATCH] #4414 define if CreateInputsModel() arguments are required or optionel for the use of CemaNeige --- R/CreateInputsModel.R | 4 ++-- man/CreateInputsModel.Rd | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/R/CreateInputsModel.R b/R/CreateInputsModel.R index fed45306..8cd52e5b 100644 --- a/R/CreateInputsModel.R +++ b/R/CreateInputsModel.R @@ -79,7 +79,7 @@ CreateInputsModel <- function(FUN_MOD,DatesR,Precip,PotEvap=NULL,TempMean=NULL,T } if(is.null(ZInputs)){ if(verbose & !identical(HypsoData,as.numeric(rep(NA,101)))){ warning("\t ZInputs is missing => HypsoData[51] is used \n"); } - ZInputs <- HypsoData[51]; + ZInputs <- HypsoData[51L]; } } @@ -101,7 +101,7 @@ CreateInputsModel <- function(FUN_MOD,DatesR,Precip,PotEvap=NULL,TempMean=NULL,T WTxt <- NULL; WTxt <- paste(WTxt,"\t Missing values are not allowed in InputsModel \n",sep=""); Select <- (max(which(BOOL_NA))+1):length(BOOL_NA); - if(Select[1]>Select[2]){ stop(paste("time series could not be trunced since missing values were detected at the list time-step \n",sep="")); return(NULL); } + if(Select[1L]>Select[2L]){ stop(paste("time series could not be trunced since missing values were detected at the list time-step \n",sep="")); return(NULL); } if("GR" %in% ObjectClass){ Precip <- Precip[Select]; PotEvap <- PotEvap[Select]; } if("CemaNeige" %in% ObjectClass){ diff --git a/man/CreateInputsModel.Rd b/man/CreateInputsModel.Rd index c3e25330..865d37f0 100644 --- a/man/CreateInputsModel.Rd +++ b/man/CreateInputsModel.Rd @@ -22,11 +22,11 @@ CreateInputsModel(FUN_MOD, DatesR, Precip, PotEvap = NULL, TempMean = NULL, \item{TempMax}{(optional) [numeric] time series of max air temperature [°C], possibly used to create the CemaNeige module inputs} -\item{ZInputs}{(optional) [numeric] real giving the mean elevation of the Precip and Temp series (before extrapolation) [m]} +\item{ZInputs}{(optional) [numeric] real giving the mean elevation of the Precip and Temp series (before extrapolation) [m], possibly used to create the CemaNeige module inputs} -\item{HypsoData}{(optional) [numeric] vector of 101 reals: min, q01 to q99 and max of catchment elevation distribution [m], required to create the GR model inputs, if not defined a single elevation is used for CemaNeige} +\item{HypsoData}{(optional) [numeric] vector of 101 reals: min, q01 to q99 and max of catchment elevation distribution [m], if not defined a single elevation is used for CemaNeige} -\item{NLayers}{(optional) [numeric] integer giving the number of elevation layers requested [-], required to create the GR model inputs, default=5} +\item{NLayers}{(optional) [numeric] integer giving the number of elevation layers requested [-], required to create CemaNeige module inputs, default=5} \item{verbose}{(optional) [boolean] boolean indicating if the function is run in verbose mode or not, default=TRUE} } -- GitLab