From 6e4a2c89586b4e6091a46ebe6b8b374a88d78abd Mon Sep 17 00:00:00 2001 From: Olivier Delaigue <olivier.delaigue@irstea.fr> Date: Thu, 14 Apr 2016 16:05:01 +0200 Subject: [PATCH] =?UTF-8?q?R=C3=A9vision=20g=C3=A9n=C3=A9rale=20de=20la=20?= =?UTF-8?q?documentation=20#4109?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- man/BasinObs.Rd | 8 +-- man/Calibration.Rd | 64 ++++++++++++------------ man/Calibration_optim.Rd | 65 +++++++++++++------------ man/CreateCalibOptions.Rd | 70 +++++++++++++++------------ man/CreateInputsCrit.Rd | 91 ++++++++++++++++++----------------- man/CreateInputsModel.Rd | 35 +++++++------- man/CreateRunOptions.Rd | 46 +++++++++--------- man/ErrorCrit.Rd | 80 +++++++++++++++--------------- man/ErrorCrit_KGE.Rd | 2 +- man/ErrorCrit_KGE2.Rd | 2 +- man/ErrorCrit_NSE.Rd | 2 +- man/ErrorCrit_RMSE.Rd | 4 +- man/PEdaily_Oudin.Rd | 2 +- man/RunModel.Rd | 33 +++++++------ man/RunModel_CemaNeige.Rd | 4 +- man/RunModel_CemaNeigeGR4J.Rd | 51 ++++++++++---------- man/RunModel_CemaNeigeGR5J.Rd | 55 ++++++++++----------- man/RunModel_CemaNeigeGR6J.Rd | 57 +++++++++++----------- man/RunModel_GR1A.Rd | 58 +++++++++++----------- man/RunModel_GR2M.Rd | 70 ++++++++++++--------------- man/RunModel_GR4H.Rd | 16 +++--- man/RunModel_GR4J.Rd | 45 ++++++++--------- man/RunModel_GR5J.Rd | 52 ++++++++++---------- man/RunModel_GR6J.Rd | 53 ++++++++++---------- man/SeriesAggreg.Rd | 38 +++++++-------- man/TransfoParam.Rd | 30 ++++++------ man/TransfoParam_CemaNeige.Rd | 32 ++++++------ man/TransfoParam_GR1A.Rd | 6 +-- man/TransfoParam_GR2M.Rd | 6 +-- man/TransfoParam_GR4H.Rd | 8 +-- man/TransfoParam_GR4J.Rd | 32 ++++++------ man/TransfoParam_GR5J.Rd | 32 ++++++------ man/TransfoParam_GR6J.Rd | 32 ++++++------ man/airGR.Rd | 57 ++++++++++++---------- man/plot_OutputsModel.Rd | 6 +-- 35 files changed, 639 insertions(+), 605 deletions(-) diff --git a/man/BasinObs.Rd b/man/BasinObs.Rd index d3f1d652..3dab677a 100644 --- a/man/BasinObs.Rd +++ b/man/BasinObs.Rd @@ -8,15 +8,15 @@ \format{Data frame named 'BasinObs' containing \itemize{ \item one POSIXlt vector: time series dates in the POSIXlt format -\item five numeric vectors: time series of catchment average precipitation [mm], catchment average air temperature [degC], catchment average potential evapotranspiration [mm], outlet discharge [l/s], outlet discharge [mm] +\item five numeric vectors: time series of catchment average precipitation [mm/time step], catchment average air temperature [degC], catchment average potential evapotranspiration [mm/time step], outlet discharge [l/s], outlet discharge [mm/time step] }} \description{ R-object containing the times series of precipitation, temperature, potential evapotranspiration and discharges. \cr -Times series for L0123001 or L0123002 are at the daily time-step for use with daily models such as GR4J, GR5J, GR6J, CemaNeigeGR4J, CemaNeigeGR5J and CemaNeigeGR6J. -Times series for L0123003 are at the hourly time-step for use with hourly models such as GR4H. +Times series for L0123001 or L0123002 are at the daily time step for use with daily models such as GR4J, GR5J, GR6J, CemaNeigeGR4J, CemaNeigeGR5J and CemaNeigeGR6J. +Times series for L0123003 are at the hourly time step for use with hourly models such as GR4H. } \examples{ - require(airGR) + library(airGR) data(L0123001) str(BasinObs) } diff --git a/man/Calibration.Rd b/man/Calibration.Rd index 73b052ae..b632ec87 100644 --- a/man/Calibration.Rd +++ b/man/Calibration.Rd @@ -3,10 +3,10 @@ \encoding{UTF-8} \name{Calibration} \alias{Calibration} -\title{Calibration algorithm which minimises an error criterion on the model outputs using the provided functions} +\title{Calibration algorithm which optimises the error criterion selected as objective function using the provided functions} \usage{ Calibration(InputsModel, RunOptions, InputsCrit, CalibOptions, FUN_MOD, - FUN_CRIT, FUN_CALIB = Calibration_HBAN, FUN_TRANSFO = NULL, + FUN_CRIT, FUN_CALIB = Calibration_Michel, FUN_TRANSFO = NULL, quiet = FALSE) } \arguments{ @@ -22,65 +22,69 @@ Calibration(InputsModel, RunOptions, InputsCrit, CalibOptions, FUN_MOD, \item{FUN_CRIT}{[function] error criterion function (e.g. ErrorCrit_RMSE, ErrorCrit_NSE)} -\item{FUN_CALIB}{(optional) [function] calibration algorithm function (e.g. Calibration_HBAN, Calibration_optim), default=Calibration_HBAN} +\item{FUN_CALIB}{(optional) [function] calibration algorithm function (e.g. Calibration_Michel, Calibration_optim), default=Calibration_Michel} \item{FUN_TRANSFO}{(optional) [function] model parameters transformation function, if the FUN_MOD used is native in the package FUN_TRANSFO is automatically defined} \item{quiet}{(optional) [boolean] boolean indicating if the function is run in quiet mode or not, default=FALSE} } \value{ -[list] see \code{\link{Calibration_HBAN}} or \code{\link{Calibration_optim}} +[list] see \code{\link{Calibration_Michel}} or \code{\link{Calibration_optim}} } \description{ -Calibration algorithm which minimises the error criterion using the provided functions. \cr +Calibration algorithm which optimises the error criterion selected as objective function using the provided functions. \cr } \examples{ -## load of catchment data -require(airGR) +## loading catchment data +library(airGR) data(L0123001) ## preparation of InputsModel object -InputsModel <- CreateInputsModel(FUN_MOD=RunModel_GR4J,DatesR=BasinObs$DatesR, - Precip=BasinObs$P,PotEvap=BasinObs$E) +InputsModel <- CreateInputsModel(FUN_MOD = RunModel_GR4J, DatesR = BasinObs$DatesR, + Precip = BasinObs$P, PotEvap = BasinObs$E) ## calibration period selection -Ind_Run <- seq(which(format(BasinObs$DatesR,format="\%d/\%m/\%Y \%H:\%M")=="01/01/1990 00:00"), - which(format(BasinObs$DatesR,format="\%d/\%m/\%Y \%H:\%M")=="31/12/1999 00:00")) +Ind_Run <- seq(which(format(BasinObs$DatesR, format = "\%d/\%m/\%Y \%H:\%M")=="01/01/1990 00:00"), + which(format(BasinObs$DatesR, format = "\%d/\%m/\%Y \%H:\%M")=="31/12/1999 00:00")) ## preparation of RunOptions object -RunOptions <- CreateRunOptions(FUN_MOD=RunModel_GR4J,InputsModel=InputsModel,IndPeriod_Run=Ind_Run) +RunOptions <- CreateRunOptions(FUN_MOD = RunModel_GR4J, + InputsModel = InputsModel, IndPeriod_Run = Ind_Run) ## calibration criterion: preparation of the InputsCrit object -InputsCrit <- CreateInputsCrit(FUN_CRIT=ErrorCrit_NSE,InputsModel=InputsModel, - RunOptions=RunOptions,Qobs=BasinObs$Qmm[Ind_Run]) +InputsCrit <- CreateInputsCrit(FUN_CRIT = ErrorCrit_NSE, InputsModel = InputsModel, + RunOptions = RunOptions, Qobs = BasinObs$Qmm[Ind_Run]) ## preparation of CalibOptions object -CalibOptions <- CreateCalibOptions(FUN_MOD=RunModel_GR4J,FUN_CALIB=Calibration_HBAN) +CalibOptions <- CreateCalibOptions(FUN_MOD = RunModel_GR4J, FUN_CALIB = Calibration_Michel) ## calibration -OutputsCalib <- Calibration(InputsModel=InputsModel,RunOptions=RunOptions,InputsCrit=InputsCrit, - CalibOptions=CalibOptions,FUN_MOD=RunModel_GR4J,FUN_CRIT=ErrorCrit_NSE, - FUN_CALIB=Calibration_HBAN) +OutputsCalib <- Calibration(InputsModel = InputsModel, RunOptions = RunOptions, + InputsCrit = InputsCrit, CalibOptions = CalibOptions, + FUN_MOD = RunModel_GR4J, FUN_CRIT = ErrorCrit_NSE, + FUN_CALIB = Calibration_Michel) ## simulation Param <- OutputsCalib$ParamFinalR -OutputsModel <- RunModel(InputsModel=InputsModel,RunOptions=RunOptions, - Param=Param,FUN=RunModel_GR4J) +OutputsModel <- RunModel(InputsModel = InputsModel, RunOptions = RunOptions, + Param = Param, FUN = RunModel_GR4J) ## results preview -plot_OutputsModel(OutputsModel=OutputsModel,Qobs=BasinObs$Qmm[Ind_Run]) +plot_OutputsModel(OutputsModel = OutputsModel, Qobs = BasinObs$Qmm[Ind_Run]) ## efficiency criterion: Nash-Sutcliffe Efficiency -InputsCrit <- CreateInputsCrit(FUN_CRIT=ErrorCrit_NSE,InputsModel=InputsModel, - RunOptions=RunOptions,Qobs=BasinObs$Qmm[Ind_Run]) -OutputsCrit <- ErrorCrit_NSE(InputsCrit=InputsCrit,OutputsModel=OutputsModel) -cat(paste(" Crit ",OutputsCrit$CritName," ",round(OutputsCrit$CritValue,4),"\\n",sep="")) +InputsCrit <- CreateInputsCrit(FUN_CRIT = ErrorCrit_NSE, InputsModel = InputsModel, + RunOptions = RunOptions, Qobs = BasinObs$Qmm[Ind_Run]) +OutputsCrit <- ErrorCrit_NSE(InputsCrit = InputsCrit, OutputsModel = OutputsModel) +cat(paste(" Crit ", OutputsCrit$CritName, " ", + round(OutputsCrit$CritValue, 4), "\\n", sep = "")) ## efficiency criterion: Kling-Gupta Efficiency -InputsCrit <- CreateInputsCrit(FUN_CRIT=ErrorCrit_KGE,InputsModel=InputsModel, - RunOptions=RunOptions,Qobs=BasinObs$Qmm[Ind_Run]) -OutputsCrit <- ErrorCrit_KGE(InputsCrit=InputsCrit,OutputsModel=OutputsModel) -cat(paste(" Crit ",OutputsCrit$CritName," ",round(OutputsCrit$CritValue,4),"\\n",sep="")) +InputsCrit <- CreateInputsCrit(FUN_CRIT = ErrorCrit_KGE, InputsModel = InputsModel, + RunOptions = RunOptions, Qobs = BasinObs$Qmm[Ind_Run]) +OutputsCrit <- ErrorCrit_KGE(InputsCrit = InputsCrit, OutputsModel = OutputsModel) +cat(paste(" Crit ", OutputsCrit$CritName, " ", + round(OutputsCrit$CritValue, 4), "\\n", sep = "")) } @@ -88,7 +92,7 @@ cat(paste(" Crit ",OutputsCrit$CritName," ",round(OutputsCrit$CritValue,4),"\ Laurent Coron (June 2014) } \seealso{ -\code{\link{Calibration_HBAN}}, \code{\link{Calibration_optim}}, +\code{\link{Calibration_Michel}}, \code{\link{Calibration_optim}}, \code{\link{RunModel}}, \code{\link{ErrorCrit}}, \code{\link{TransfoParam}}, \code{\link{CreateInputsModel}}, \code{\link{CreateRunOptions}}, \code{\link{CreateInputsCrit}}, \code{\link{CreateCalibOptions}}. diff --git a/man/Calibration_optim.Rd b/man/Calibration_optim.Rd index 1aed7cdc..d24d91b0 100644 --- a/man/Calibration_optim.Rd +++ b/man/Calibration_optim.Rd @@ -3,7 +3,7 @@ \encoding{UTF-8} \name{Calibration_optim} \alias{Calibration_optim} -\title{Calibration algorithm which minimises the error criterion using the stats::optim function} +\title{Calibration algorithm which optimises the error criterion selected as objective function using the stats::optim function} \usage{ Calibration_optim(InputsModel, RunOptions, InputsCrit, CalibOptions, FUN_MOD, FUN_CRIT, FUN_TRANSFO = NULL, quiet = FALSE) @@ -21,7 +21,7 @@ Calibration_optim(InputsModel, RunOptions, InputsCrit, CalibOptions, FUN_MOD, \item{FUN_CRIT}{[function] error criterion function (e.g. ErrorCrit_RMSE, ErrorCrit_NSE)} -\item{FUN_TRANSFO}{(optional) [function] model parameters transformation function, if the FUN_MOD used is native in the package FUN_TRANSFO is automatically defined} +\item{FUN_TRANSFO}{(optional) [function] model parameters transformation function, if the FUN_MOD used is native in the package, FUN_TRANSFO is automatically defined} \item{quiet}{(optional) [boolean] boolean indicating if the function is run in quiet mode or not, default=FALSE} } @@ -29,16 +29,16 @@ Calibration_optim(InputsModel, RunOptions, InputsCrit, CalibOptions, FUN_MOD, [list] list containing the function outputs organised as follows: \tabular{ll}{ \emph{$ParamFinalR } \tab [numeric] parameter set obtained at the end of the calibration \cr - \emph{$CritFinal } \tab [numeric] error criterion obtained at the end of the calibration \cr + \emph{$CritFinal } \tab [numeric] error criterion selected as objective function obtained at the end of the calibration \cr \emph{$Nruns } \tab [numeric] number of model runs done during the calibration \cr - \emph{$CritName } \tab [character] name of the calibration criterion \cr + \emph{$CritName } \tab [character] name of the calibration criterion selected as objective function \cr \emph{$CritBestValue} \tab [numeric] theoretical best criterion value \cr } } \description{ -Calibration algorithm which minimises the error criterion. \cr +Calibration algorithm which optimises the error criterion selected as objective function. \cr \cr -The algorithm is based on the "optim" function from the "stats" R-package +The algorithm is based on the \code{\link{optim}} function from the "stats" R-package (using method="L-BFGS-B", i.e. a local optimization quasi-Newton method). } \details{ @@ -46,57 +46,62 @@ To optimise the exploration of the parameter space, transformation functions are the model parameters. This is done using the TransfoParam functions. } \examples{ -## load of catchment data -require(airGR) +## loading catchment data +library(airGR) data(L0123001) ## preparation of InputsModel object -InputsModel <- CreateInputsModel(FUN_MOD=RunModel_GR4J,DatesR=BasinObs$DatesR, - Precip=BasinObs$P,PotEvap=BasinObs$E) +InputsModel <- CreateInputsModel(FUN_MOD = RunModel_GR4J, DatesR = BasinObs$DatesR, + Precip = BasinObs$P, PotEvap = BasinObs$E) ## calibration period selection -Ind_Run <- seq(which(format(BasinObs$DatesR,format="\%d/\%m/\%Y \%H:\%M")=="01/01/1990 00:00"), - which(format(BasinObs$DatesR,format="\%d/\%m/\%Y \%H:\%M")=="31/12/1999 00:00")) +Ind_Run <- seq(which(format(BasinObs$DatesR, format = "\%d/\%m/\%Y \%H:\%M")=="01/01/1990 00:00"), + which(format(BasinObs$DatesR, format="\%d/\%m/\%Y \%H:\%M")=="31/12/1999 00:00")) ## preparation of RunOptions object -RunOptions <- CreateRunOptions(FUN_MOD=RunModel_GR4J,InputsModel=InputsModel,IndPeriod_Run=Ind_Run) +RunOptions <- CreateRunOptions(FUN_MOD = RunModel_GR4J, + InputsModel = InputsModel, IndPeriod_Run = Ind_Run) ## calibration criterion: preparation of the InputsCrit object -InputsCrit <- CreateInputsCrit(FUN_CRIT=ErrorCrit_NSE,InputsModel=InputsModel, - RunOptions=RunOptions,Qobs=BasinObs$Qmm[Ind_Run]) +InputsCrit <- CreateInputsCrit(FUN_CRIT = ErrorCrit_NSE, InputsModel = InputsModel, + RunOptions = RunOptions, Qobs = BasinObs$Qmm[Ind_Run]) ## preparation of CalibOptions object -CalibOptions <- CreateCalibOptions(FUN_MOD=RunModel_GR4J,FUN_CALIB=Calibration_optim) +CalibOptions <- CreateCalibOptions(FUN_MOD = RunModel_GR4J, + FUN_CALIB = Calibration_optim) ## calibration -OutputsCalib <- Calibration_optim(InputsModel=InputsModel,RunOptions=RunOptions, - InputsCrit=InputsCrit,CalibOptions=CalibOptions, - FUN_MOD=RunModel_GR4J,FUN_CRIT=ErrorCrit_NSE) +OutputsCalib <- Calibration_optim(InputsModel = InputsModel, RunOptions = RunOptions, + InputsCrit = InputsCrit, CalibOptions = CalibOptions, + FUN_MOD = RunModel_GR4J, FUN_CRIT = ErrorCrit_NSE) ## simulation Param <- OutputsCalib$ParamFinalR -OutputsModel <- RunModel_GR4J(InputsModel=InputsModel,RunOptions=RunOptions,Param=Param) +OutputsModel <- RunModel_GR4J(InputsModel = InputsModel, + RunOptions = RunOptions, Param = Param) ## results preview -plot_OutputsModel(OutputsModel=OutputsModel,Qobs=BasinObs$Qmm[Ind_Run]) +plot_OutputsModel(OutputsModel = OutputsModel, Qobs = BasinObs$Qmm[Ind_Run]) ## efficiency criterion: Nash-Sutcliffe Efficiency -InputsCrit <- CreateInputsCrit(FUN_CRIT=ErrorCrit_NSE,InputsModel=InputsModel, - RunOptions=RunOptions,Qobs=BasinObs$Qmm[Ind_Run]) -OutputsCrit <- ErrorCrit_NSE(InputsCrit=InputsCrit,OutputsModel=OutputsModel) -cat(paste(" Crit ",OutputsCrit$CritName," ",round(OutputsCrit$CritValue,4),"\\n",sep="")) +InputsCrit <- CreateInputsCrit(FUN_CRIT = ErrorCrit_NSE, InputsModel = InputsModel, + RunOptions = RunOptions, Qobs = BasinObs$Qmm[Ind_Run]) +OutputsCrit <- ErrorCrit_NSE(InputsCrit = InputsCrit, OutputsModel = OutputsModel) +cat(paste(" Crit ", OutputsCrit$CritName, " ", + round(OutputsCrit$CritValue, 4), "\\n", sep = "")) ## efficiency criterion: Kling-Gupta Efficiency -InputsCrit <- CreateInputsCrit(FUN_CRIT=ErrorCrit_KGE,InputsModel=InputsModel, - RunOptions=RunOptions,Qobs=BasinObs$Qmm[Ind_Run]) -OutputsCrit <- ErrorCrit_KGE(InputsCrit=InputsCrit,OutputsModel=OutputsModel) -cat(paste(" Crit ",OutputsCrit$CritName," ",round(OutputsCrit$CritValue,4),"\\n",sep="")) +InputsCrit <- CreateInputsCrit(FUN_CRIT = ErrorCrit_KGE, InputsModel = InputsModel, + RunOptions = RunOptions, Qobs = BasinObs$Qmm[Ind_Run]) +OutputsCrit <- ErrorCrit_KGE(InputsCrit = InputsCrit, OutputsModel = OutputsModel) +cat(paste(" Crit ", OutputsCrit$CritName, " ", + round(OutputsCrit$CritValue, 4), "\\n", sep = "")) } \author{ Laurent Coron (August 2013) } \seealso{ -\code{\link{Calibration}}, \code{\link{Calibration_HBAN}}, +\code{\link{Calibration}}, \code{\link{Calibration_Michel}}, \code{\link{RunModel_GR4J}}, \code{\link{TransfoParam_GR4J}}, \code{\link{ErrorCrit_RMSE}}, \code{\link{CreateInputsModel}}, \code{\link{CreateRunOptions}}, \code{\link{CreateInputsCrit}}, \code{\link{CreateCalibOptions}}. diff --git a/man/CreateCalibOptions.Rd b/man/CreateCalibOptions.Rd index 29dc744a..83b86bf3 100644 --- a/man/CreateCalibOptions.Rd +++ b/man/CreateCalibOptions.Rd @@ -3,9 +3,9 @@ \encoding{UTF-8} \name{CreateCalibOptions} \alias{CreateCalibOptions} -\title{Creation of the CalibOptions object required to the Calibration functions} +\title{Creation of the CalibOptions object required bu the Calibration functions} \usage{ -CreateCalibOptions(FUN_MOD, FUN_CALIB = Calibration_HBAN, +CreateCalibOptions(FUN_MOD, FUN_CALIB = Calibration_Michel, FUN_TRANSFO = NULL, OptimParam = NULL, FixedParam = NULL, SearchRanges = NULL, StartParam = NULL, StartParamList = NULL, StartParamDistrib = NULL) @@ -13,15 +13,16 @@ CreateCalibOptions(FUN_MOD, FUN_CALIB = Calibration_HBAN, \arguments{ \item{FUN_MOD}{[function] hydrological model function (e.g. RunModel_GR4J, RunModel_CemaNeigeGR4J)} -\item{FUN_CALIB}{(optional) [function] calibration algorithm function (e.g. Calibration_HBAN, Calibration_optim), default=Calibration_HBAN} +\item{FUN_CALIB}{(optional) [function] calibration algorithm function (e.g. Calibration_Michel, Calibration_optim), default=Calibration_Michel} -\item{FUN_TRANSFO}{(optional) [function] model parameters transformation function, if the FUN_MOD used is native in the package FUN_TRANSFO is automatically defined} +\item{FUN_TRANSFO}{(optional) [function] model parameters transformation function, if the FUN_MOD used is native in the package, FUN_TRANSFO is automatically defined} \item{OptimParam}{(optional) [boolean] vector of booleans indicating which parameters must be optimised (NParam columns, 1 line)} -\item{FixedParam}{(optional) [numeric] vector giving the values to allocate to non-optimised parameter values (NParam columns, 1 line)} +\item{FixedParam}{(optional) [numeric] vector giving the values set for the non-optimised parameter values (NParam columns, 1 line)} \item{SearchRanges}{(optional) [numeric] matrix giving the ranges of real parameters (NParam columns, 2 lines) +\cr Example: \tabular{llllll}{ \tab [X1] \tab [X2] \tab [X3] \tab [...] \tab [Xi] \cr [1,] \tab 0 \tab -1 \tab 0 \tab ... \tab 0.0 \cr @@ -29,12 +30,14 @@ CreateCalibOptions(FUN_MOD, FUN_CALIB = Calibration_HBAN, }} \item{StartParam}{(optional) [numeric] vector of parameter values used to start global search calibration procedure (e.g. Calibration_optim) +\cr Example: \tabular{llllll}{ \tab [X1] \tab [X2] \tab [X3] \tab [...] \tab [Xi] \cr \tab 1000 \tab -0.5 \tab 22 \tab ... \tab 1.1 \cr }} \item{StartParamList}{(optional) [numeric] matrix of parameter sets used for grid-screening calibration procedure (values in columns, sets in line) +\cr Example: \tabular{llllll}{ \tab [X1] \tab [X2] \tab [X3] \tab [...] \tab [Xi] \cr [set1] \tab 800 \tab -0.7 \tab 25 \tab ... \tab 1.0 \cr @@ -43,7 +46,8 @@ CreateCalibOptions(FUN_MOD, FUN_CALIB = Calibration_HBAN, [set n] \tab 200 \tab -0.3 \tab 17 \tab ... \tab 1.0 \cr }} -\item{StartParamDistrib}{(optional) [numeric] matrix of parameter values used for grid-screening calibration procedure (values in columns, percentiles in line) \cr +\item{StartParamDistrib}{(optional) [numeric] matrix of parameter values used for grid-screening calibration procedure (values in columns, percentiles in line) +\cr Example: \tabular{llllll}{ \tab [X1] \tab [X2] \tab [X3] \tab [...] \tab [Xi] \cr [value1] \tab 800 \tab -0.7 \tab 25 \tab ... \tab 1.0 \cr @@ -56,66 +60,68 @@ CreateCalibOptions(FUN_MOD, FUN_CALIB = Calibration_HBAN, \tabular{ll}{ \emph{$OptimParam } \tab [boolean] vector of booleans indicating which parameters must be optimised \cr \emph{$FixedParam } \tab [numeric] vector giving the values to allocate to non-optimised parameter values \cr - \emph{$SearchRanges } \tab [numeric] matrix giving the ranges of real parameters \cr + \emph{$SearchRanges } \tab [numeric] matrix giving the ranges of raw parameters \cr \emph{$StartParam } \tab [numeric] vector of parameter values used to start global search calibration procedure \cr \emph{$StartParamList } \tab [numeric] matrix of parameter sets used for grid-screening calibration procedure \cr \emph{$StartParamDistrib} \tab [numeric] matrix of parameter values used for grid-screening calibration procedure \cr } } \description{ -Creation of the CalibOptions object required to the Calibration functions. +Creation of the CalibOptions object required by the Calibration functions. } \details{ Users wanting to use FUN_MOD, FUN_CALIB or FUN_TRANSFO functions that are not included in the package must create their own CalibOptions object accordingly. } \examples{ -## load of catchment data -require(airGR) +## loading catchment data +library(airGR) data(L0123001) ## preparation of InputsModel object -InputsModel <- CreateInputsModel(FUN_MOD=RunModel_GR4J,DatesR=BasinObs$DatesR, - Precip=BasinObs$P,PotEvap=BasinObs$E) +InputsModel <- CreateInputsModel(FUN_MOD = RunModel_GR4J, DatesR = BasinObs$DatesR, + Precip = BasinObs$P, PotEvap = BasinObs$E) ## calibration period selection -Ind_Run <- seq(which(format(BasinObs$DatesR,format="\%d/\%m/\%Y \%H:\%M")=="01/01/1990 00:00"), - which(format(BasinObs$DatesR,format="\%d/\%m/\%Y \%H:\%M")=="31/12/1999 00:00")) +Ind_Run <- seq(which(format(BasinObs$DatesR, format = "\%d/\%m/\%Y \%H:\%M")=="01/01/1990 00:00"), + which(format(BasinObs$DatesR, format = "\%d/\%m/\%Y \%H:\%M")=="31/12/1999 00:00")) ## preparation of RunOptions object -RunOptions <- CreateRunOptions(FUN_MOD=RunModel_GR4J,InputsModel=InputsModel,IndPeriod_Run=Ind_Run) +RunOptions <- CreateRunOptions(FUN_MOD = RunModel_GR4J, + InputsModel = InputsModel, IndPeriod_Run = Ind_Run) ## calibration criterion: preparation of the InputsCrit object -InputsCrit <- CreateInputsCrit(FUN_CRIT=ErrorCrit_NSE,InputsModel=InputsModel, - RunOptions=RunOptions,Qobs=BasinObs$Qmm[Ind_Run]) +InputsCrit <- CreateInputsCrit(FUN_CRIT = ErrorCrit_NSE, InputsModel = InputsModel, + RunOptions = RunOptions, Qobs = BasinObs$Qmm[Ind_Run]) ## preparation of CalibOptions object -CalibOptions <- CreateCalibOptions(FUN_MOD=RunModel_GR4J,FUN_CALIB=Calibration_HBAN) +CalibOptions <- CreateCalibOptions(FUN_MOD = RunModel_GR4J, FUN_CALIB = Calibration_Michel) ## calibration -OutputsCalib <- Calibration(InputsModel=InputsModel,RunOptions=RunOptions,InputsCrit=InputsCrit, - CalibOptions=CalibOptions,FUN_MOD=RunModel_GR4J,FUN_CRIT=ErrorCrit_NSE, - FUN_CALIB=Calibration_HBAN) +OutputsCalib <- Calibration(InputsModel = InputsModel, RunOptions = RunOptions, + InputsCrit = InputsCrit, CalibOptions = CalibOptions, + FUN_MOD = RunModel_GR4J, FUN_CRIT = ErrorCrit_NSE, + FUN_CALIB = Calibration_Michel) ## simulation Param <- OutputsCalib$ParamFinalR -OutputsModel <- RunModel(InputsModel=InputsModel,RunOptions=RunOptions, - Param=Param,FUN=RunModel_GR4J) +OutputsModel <- RunModel(InputsModel = InputsModel, RunOptions = RunOptions, + Param = Param, FUN = RunModel_GR4J) ## results preview -plot_OutputsModel(OutputsModel=OutputsModel,Qobs=BasinObs$Qmm[Ind_Run]) +plot_OutputsModel(OutputsModel = OutputsModel, Qobs = BasinObs$Qmm[Ind_Run]) ## efficiency criterion: Nash-Sutcliffe Efficiency -InputsCrit <- CreateInputsCrit(FUN_CRIT=ErrorCrit_NSE,InputsModel=InputsModel, - RunOptions=RunOptions,Qobs=BasinObs$Qmm[Ind_Run]) -OutputsCrit <- ErrorCrit_NSE(InputsCrit=InputsCrit,OutputsModel=OutputsModel) -cat(paste(" Crit ",OutputsCrit$CritName," ",round(OutputsCrit$CritValue,4),"\\n",sep="")) +InputsCrit <- CreateInputsCrit(FUN_CRIT = ErrorCrit_NSE, InputsModel = InputsModel, + RunOptions = RunOptions, Qobs = BasinObs$Qmm[Ind_Run]) +OutputsCrit <- ErrorCrit_NSE(InputsCrit = InputsCrit, OutputsModel = OutputsModel) +cat(paste(" Crit ", OutputsCrit$CritName, " ", round(OutputsCrit$CritValue, 4), "\\n", sep = "")) ## efficiency criterion: Kling-Gupta Efficiency -InputsCrit <- CreateInputsCrit(FUN_CRIT=ErrorCrit_KGE,InputsModel=InputsModel, - RunOptions=RunOptions,Qobs=BasinObs$Qmm[Ind_Run]) -OutputsCrit <- ErrorCrit_KGE(InputsCrit=InputsCrit,OutputsModel=OutputsModel) -cat(paste(" Crit ",OutputsCrit$CritName," ",round(OutputsCrit$CritValue,4),"\\n",sep="")) +InputsCrit <- CreateInputsCrit(FUN_CRIT = ErrorCrit_KGE, InputsModel = InputsModel, + RunOptions = RunOptions, Qobs = BasinObs$Qmm[Ind_Run]) +OutputsCrit <- ErrorCrit_KGE(InputsCrit = InputsCrit, OutputsModel = OutputsModel) +cat(paste(" Crit ", OutputsCrit$CritName, " ", round(OutputsCrit$CritValue, 4), "\\n",sep = "")) } diff --git a/man/CreateInputsCrit.Rd b/man/CreateInputsCrit.Rd index 50e84cfd..02c79dd6 100644 --- a/man/CreateInputsCrit.Rd +++ b/man/CreateInputsCrit.Rd @@ -15,23 +15,23 @@ CreateInputsCrit(FUN_CRIT, InputsModel, RunOptions, Qobs, BoolCrit = NULL, \item{RunOptions}{[object of class \emph{RunOptions}] see \code{\link{CreateRunOptions}} for details} -\item{Qobs}{[numeric] series of observed discharges [mm]} +\item{Qobs}{[numeric] series of observed discharges [mm/time step]} \item{BoolCrit}{(optional) [boolean] boolean giving the time steps to consider in the computation (all time steps are consider by default)} \item{transfo}{(optional) [character] name of the transformation (e.g. "", "sqrt", "log", "inv", "sort")} -\item{Ind_zeroes}{(optional) [numeric] indices of the time-steps where zeroes are observed} +\item{Ind_zeroes}{(optional) [numeric] indices of the time steps where zeroes are observed} \item{epsilon}{(optional) [numeric] epsilon to add to all Qobs and Qsim if \emph{$Ind_zeroes} is not empty} } \value{ [list] object of class \emph{InputsCrit} containing the data required to evaluate the model outputs; it can include the following: \tabular{ll}{ - \emph{$BoolCrit } \tab [boolean] boolean giving the time steps to consider in the computation \cr - \emph{$Qobs } \tab [numeric] series of observed discharges [mm] \cr + \emph{$BoolCrit } \tab [boolean] boolean giving the time steps considered in the computation \cr + \emph{$Qobs } \tab [numeric] series of observed discharges [mm/time step] \cr \emph{$transfo } \tab [character] name of the transformation (e.g. "", "sqrt", "log", "inv", "sort") \cr - \emph{$Ind_zeroes} \tab [numeric] indices of the time-steps where zeroes are observed \cr + \emph{$Ind_zeroes} \tab [numeric] indices of the time steps where zeroes are observed \cr \emph{$epsilon } \tab [numeric] epsilon to add to all Qobs and Qsim if \emph{$Ind_zeroes} is not empty \cr } } @@ -43,65 +43,70 @@ Users wanting to use FUN_CRIT functions that are not included in the package must create their own InputsCrit object accordingly. } \examples{ -## load of catchment data -require(airGR) +## loading catchment data +library(airGR) data(L0123001) ## preparation of the InputsModel object -InputsModel <- CreateInputsModel(FUN_MOD=RunModel_GR4J,DatesR=BasinObs$DatesR, - Precip=BasinObs$P,PotEvap=BasinObs$E) +InputsModel <- CreateInputsModel(FUN_MOD = RunModel_GR4J, DatesR = BasinObs$DatesR, + Precip = BasinObs$P, PotEvap = BasinObs$E) ## run period selection -Ind_Run <- seq(which(format(BasinObs$DatesR,format="\%d/\%m/\%Y \%H:\%M")=="01/01/1990 00:00"), - which(format(BasinObs$DatesR,format="\%d/\%m/\%Y \%H:\%M")=="31/12/1999 00:00")) +Ind_Run <- seq(which(format(BasinObs$DatesR, format = "\%d/\%m/\%Y \%H:\%M")=="01/01/1990 00:00"), + which(format(BasinObs$DatesR, format = "\%d/\%m/\%Y \%H:\%M")=="31/12/1999 00:00")) ## preparation of the RunOptions object -RunOptions <- CreateRunOptions(FUN_MOD=RunModel_GR4J,InputsModel=InputsModel,IndPeriod_Run=Ind_Run) +RunOptions <- CreateRunOptions(FUN_MOD = RunModel_GR4J, + InputsModel = InputsModel, IndPeriod_Run = Ind_Run) ## simulation -Param <- c(734.568,-0.840,109.809,1.971) -OutputsModel <- RunModel(InputsModel=InputsModel,RunOptions=RunOptions, - Param=Param,FUN=RunModel_GR4J) +Param <- c(734.568, -0.840, 109.809, 1.971) +OutputsModel <- RunModel(InputsModel = InputsModel, RunOptions = RunOptions, + Param = Param, FUN = RunModel_GR4J) ## efficiency criterion: Nash-Sutcliffe Efficiency -InputsCrit <- CreateInputsCrit(FUN_CRIT=ErrorCrit_NSE,InputsModel=InputsModel, - RunOptions=RunOptions,Qobs=BasinObs$Qmm[Ind_Run]) -OutputsCrit <- ErrorCrit_NSE(InputsCrit=InputsCrit,OutputsModel=OutputsModel) -cat(paste(" Crit ",OutputsCrit$CritName," ",round(OutputsCrit$CritValue,4),"\\n",sep="")) +InputsCrit <- CreateInputsCrit(FUN_CRIT = ErrorCrit_NSE, InputsModel = InputsModel, + RunOptions = RunOptions, Qobs = BasinObs$Qmm[Ind_Run]) +OutputsCrit <- ErrorCrit_NSE(InputsCrit = InputsCrit, OutputsModel = OutputsModel) +cat(paste(" Crit ", OutputsCrit$CritName, " ", round(OutputsCrit$CritValue, 4), "\\n", sep = "")) ## efficiency criterion: Nash-Sutcliffe Efficiency on log-transformed flows transfo <- "log" -InputsCrit <- CreateInputsCrit(FUN_CRIT=ErrorCrit_NSE,InputsModel=InputsModel, - RunOptions=RunOptions,Qobs=BasinObs$Qmm[Ind_Run],transfo=transfo) -OutputsCrit <- ErrorCrit_NSE(InputsCrit=InputsCrit,OutputsModel=OutputsModel) -cat(paste(" Crit ",OutputsCrit$CritName," ",round(OutputsCrit$CritValue,4),"\\n",sep="")) +InputsCrit <- CreateInputsCrit(FUN_CRIT = ErrorCrit_NSE, InputsModel = InputsModel, + RunOptions = RunOptions, Qobs = BasinObs$Qmm[Ind_Run], + transfo = transfo) +OutputsCrit <- ErrorCrit_NSE(InputsCrit = InputsCrit, OutputsModel = OutputsModel) +cat(paste(" Crit ", OutputsCrit$CritName, " ", + round(OutputsCrit$CritValue, 4), "\\n", sep = "")) ## efficiency criterion: Nash-Sutcliffe Efficiency above a threshold (q75\%) -BoolCrit <- rep(TRUE,length(BasinObs$Qmm[Ind_Run])); -BoolCrit[BasinObs$Qmm[Ind_Run]<quantile(BasinObs$Qmm[Ind_Run],0.75,na.rm=TRUE)] <- FALSE; -InputsCrit <- CreateInputsCrit(FUN_CRIT=ErrorCrit_NSE,InputsModel=InputsModel, - RunOptions=RunOptions,Qobs=BasinObs$Qmm[Ind_Run],BoolCrit=BoolCrit) -OutputsCrit <- ErrorCrit_NSE(InputsCrit=InputsCrit,OutputsModel=OutputsModel) -cat(paste(" Crit ",OutputsCrit$CritName," ",round(OutputsCrit$CritValue,4),"\\n",sep="")) +BoolCrit <- rep(TRUE, length(BasinObs$Qmm[Ind_Run])); +BoolCrit[BasinObs$Qmm[Ind_Run]<quantile(BasinObs$Qmm[Ind_Run], 0.75, na.rm = TRUE)] <- FALSE +InputsCrit <- CreateInputsCrit(FUN_CRIT = ErrorCrit_NSE, InputsModel = InputsModel, + RunOptions = RunOptions, Qobs = BasinObs$Qmm[Ind_Run], + BoolCrit = BoolCrit) +OutputsCrit <- ErrorCrit_NSE(InputsCrit = InputsCrit, OutputsModel = OutputsModel) +cat(paste(" Crit ", OutputsCrit$CritName, " ", round(OutputsCrit$CritValue, 4), "\\n", sep = "")) ## efficiency criterion: Kling-Gupta Efficiency -InputsCrit <- CreateInputsCrit(FUN_CRIT=ErrorCrit_KGE,InputsModel=InputsModel, - RunOptions=RunOptions,Qobs=BasinObs$Qmm[Ind_Run]) -OutputsCrit <- ErrorCrit_KGE(InputsCrit=InputsCrit,OutputsModel=OutputsModel) -cat(paste(" Crit ",OutputsCrit$CritName," ",round(OutputsCrit$CritValue,4),"\\n",sep="")) -cat(paste("SubCrit ",OutputsCrit$SubCritNames," ",round(OutputsCrit$SubCritValues,4),"\\n",sep="")) +InputsCrit <- CreateInputsCrit(FUN_CRIT = ErrorCrit_KGE, InputsModel = InputsModel, + RunOptions = RunOptions, Qobs = BasinObs$Qmm[Ind_Run]) +OutputsCrit <- ErrorCrit_KGE(InputsCrit = InputsCrit, OutputsModel = OutputsModel) +cat(paste(" Crit ", OutputsCrit$CritName, " ", round(OutputsCrit$CritValue, 4), "\\n", sep = "")) +cat(paste("SubCrit ", OutputsCrit$SubCritNames, " ", + round(OutputsCrit$SubCritValues, 4), "\\n", sep = "")) ## efficiency criterion: Kling-Gupta Efficiency below a threshold (q10\%) on log-trqansformed flows transfo <- "log" -BoolCrit <- rep(TRUE,length(BasinObs$Qmm[Ind_Run])); -BoolCrit[BasinObs$Qmm[Ind_Run]>quantile(BasinObs$Qmm[Ind_Run],0.10,na.rm=TRUE)] <- FALSE; -InputsCrit <- CreateInputsCrit(FUN_CRIT=ErrorCrit_KGE,InputsModel=InputsModel,RunOptions=RunOptions, - Qobs=BasinObs$Qmm[Ind_Run],BoolCrit=BoolCrit,transfo=transfo) -OutputsCrit <- ErrorCrit_KGE(InputsCrit=InputsCrit,OutputsModel=OutputsModel) -cat(paste(" Crit ",OutputsCrit$CritName," ",round(OutputsCrit$CritValue,4),"\\n",sep="")) -cat(paste("SubCrit ",OutputsCrit$SubCritNames," ",round(OutputsCrit$SubCritValues,4),"\\n",sep="")) - - +BoolCrit <- rep(TRUE, length(BasinObs$Qmm[Ind_Run])); +BoolCrit[BasinObs$Qmm[Ind_Run]>quantile(BasinObs$Qmm[Ind_Run], 0.10, na.rm = TRUE)] <- FALSE +InputsCrit <- CreateInputsCrit(FUN_CRIT = ErrorCrit_KGE, + InputsModel = InputsModel,RunOptions = RunOptions, + Qobs = BasinObs$Qmm[Ind_Run], BoolCrit = BoolCrit, transfo = transfo) +OutputsCrit <- ErrorCrit_KGE(InputsCrit = InputsCrit, OutputsModel = OutputsModel) +cat(paste(" Crit ", OutputsCrit$CritName, " ", round(OutputsCrit$CritValue, 4), "\\n", sep = "")) +cat(paste("SubCrit ", OutputsCrit$SubCritNames, " ", + round(OutputsCrit$SubCritValues, 4), "\\n", sep = "")) } diff --git a/man/CreateInputsModel.Rd b/man/CreateInputsModel.Rd index 8f3637f8..4aebe122 100644 --- a/man/CreateInputsModel.Rd +++ b/man/CreateInputsModel.Rd @@ -40,7 +40,7 @@ CreateInputsModel(FUN_MOD, DatesR, Precip, PotEvap = NULL, TempMean = NULL, \emph{$PotEvap } \tab [numeric] time series of potential evapotranspiration (catchment average) [mm], \cr\tab defined if FUN_MOD includes GR4H, GR4J, GR5J, GR6J, GR2M or GR1A \cr \cr \emph{$LayerPrecip } \tab [list] list of time series of precipitation (layer average) [mm], \cr\tab defined if FUN_MOD includes CemaNeige \cr \cr \emph{$LayerTempMean } \tab [list] list of time series of mean air temperature (layer average) [degC], \cr\tab defined if FUN_MOD includes CemaNeige \cr \cr - \emph{$LayerFracSolidPrecip} \tab [list] list of time series of solid precip. fract. (layer average) [-], \cr\tab defined if FUN_MOD includes CemaNeige \cr \cr + \emph{$LayerFracSolidPrecip} \tab [list] list of time series of solid precipitation fraction (layer average) [-], \cr\tab defined if FUN_MOD includes CemaNeige \cr \cr } } \description{ @@ -51,40 +51,41 @@ Users wanting to use FUN_MOD functions that are not included in the package must create their own InputsModel object accordingly. } \examples{ -## load of catchment data -require(airGR) +## loading catchment data +library(airGR) data(L0123001) ## preparation of the InputsModel object -InputsModel <- CreateInputsModel(FUN_MOD=RunModel_GR4J,DatesR=BasinObs$DatesR, - Precip=BasinObs$P,PotEvap=BasinObs$E) +InputsModel <- CreateInputsModel(FUN_MOD = RunModel_GR4J, DatesR = BasinObs$DatesR, + Precip = BasinObs$P, PotEvap = BasinObs$E) ## run period selection -Ind_Run <- seq(which(format(BasinObs$DatesR,format="\%d/\%m/\%Y \%H:\%M")=="01/01/1990 00:00"), - which(format(BasinObs$DatesR,format="\%d/\%m/\%Y \%H:\%M")=="31/12/1999 00:00")) +Ind_Run <- seq(which(format(BasinObs$DatesR, format = "\%d/\%m/\%Y \%H:\%M")=="01/01/1990 00:00"), + which(format(BasinObs$DatesR, format = "\%d/\%m/\%Y \%H:\%M")=="31/12/1999 00:00")) ## preparation of the RunOptions object -RunOptions <- CreateRunOptions(FUN_MOD=RunModel_GR4J,InputsModel=InputsModel,IndPeriod_Run=Ind_Run) +RunOptions <- CreateRunOptions(FUN_MOD = RunModel_GR4J, + InputsModel = InputsModel, IndPeriod_Run = Ind_Run) ## simulation -Param <- c(734.568,-0.840,109.809,1.971) -OutputsModel <- RunModel(InputsModel=InputsModel,RunOptions=RunOptions,Param=Param, - FUN_MOD=RunModel_GR4J) +Param <- c(734.568, -0.840, 109.809, 1.971) +OutputsModel <- RunModel(InputsModel = InputsModel, RunOptions = RunOptions, Param = Param, + FUN_MOD = RunModel_GR4J) ## results preview -plot_OutputsModel(OutputsModel=OutputsModel,Qobs=BasinObs$Qmm[Ind_Run]) +plot_OutputsModel(OutputsModel = OutputsModel, Qobs = BasinObs$Qmm[Ind_Run]) ## efficiency criterion: Nash-Sutcliffe Efficiency -InputsCrit <- CreateInputsCrit(FUN_CRIT=ErrorCrit_NSE,InputsModel=InputsModel, - RunOptions=RunOptions,Qobs=BasinObs$Qmm[Ind_Run]) -OutputsCrit <- ErrorCrit_NSE(InputsCrit=InputsCrit,OutputsModel=OutputsModel) -cat(paste(" Crit ",OutputsCrit$CritName," ",round(OutputsCrit$CritValue,4),"\\n",sep="")) +InputsCrit <- CreateInputsCrit(FUN_CRIT = ErrorCrit_NSE, InputsModel = InputsModel, + RunOptions = RunOptions, Qobs = BasinObs$Qmm[Ind_Run]) +OutputsCrit <- ErrorCrit_NSE(InputsCrit = InputsCrit, OutputsModel = OutputsModel) +cat(paste(" Crit ", OutputsCrit$CritName, " ", round(OutputsCrit$CritValue, 4), "\\n", sep = "")) } \author{ Laurent Coron (June 2014) } \seealso{ -\code{\link{RunModel}}, \code{\link{CreateRunOptions}}, \code{\link{CreateInputsCrit}}, \code{\link{CreateCalibOptions}}, \code{\link{DataAltiExtrapolation_HBAN}} +\code{\link{RunModel}}, \code{\link{CreateRunOptions}}, \code{\link{CreateInputsCrit}}, \code{\link{CreateCalibOptions}}, \code{\link{DataAltiExtrapolation_Valery}} } diff --git a/man/CreateRunOptions.Rd b/man/CreateRunOptions.Rd index 84963d84..913bef1a 100644 --- a/man/CreateRunOptions.Rd +++ b/man/CreateRunOptions.Rd @@ -19,11 +19,12 @@ CreateRunOptions(FUN_MOD, InputsModel, IndPeriod_WarmUp = NULL, IndPeriod_Run, \item{IndPeriod_Run}{[numeric] index of period to be used for the model run [-]} -\item{IniStates}{(optional) [numeric] vector of initial model states [mm]} +\item{IniStates}{(optional) [numeric] vector of initial model internal states [mm]} \item{IniResLevels}{(optional) [numeric] vector of initial filling rates for production and routing stores (2 values between 0 and 1) [-]} -\item{Outputs_Cal}{(optional) [character] vector giving the outputs needed for the calibration \cr (e.g. c("Qsim")), the least outputs the fastest the calibration} +\item{Outputs_Cal}{(optional) [character] vector giving the outputs needed for the calibration \cr (e.g. c("Qsim")), the fewer outputs + the fastest the calibration} \item{Outputs_Sim}{(optional) [character] vector giving the requested outputs \cr (e.g. c("DatesR","Qsim","SnowPack")), default="all"} @@ -63,19 +64,19 @@ A default configuration is used for initialisation if these vectors are not defi (1) Default initialisation options: \itemize{ -\item \emph{IndPeriod_WarmUp} default setting ensures a one-year warm-up using the time-steps preceding the \emph{IndPeriod_Run}. -The actual length of this warm-up might be shorter depending on data availability (no missing value being allowed on model input series). +\item \emph{IndPeriod_WarmUp} default setting ensures a one-year warm-up using the time steps preceding the \emph{IndPeriod_Run}. +The actual length of this warm-up might be shorter depending on data availability (no missing value of climate inputs being allowed in model input series). -\item \emph{IniStates} and \emph{IniResLevels} are automatically set to initialise all the model states at 0, except for the production and routing stores which are initialised at 50\% of their capacity. This initialisation is made at the very beginning of the model call (i.e. at the beginning of \emph{IndPeriod_WarmUp} or at the beginning of IndPeriod_Run if the warm-up period is disabled). +\item \emph{IniStates} and \emph{IniResLevels} are automatically set to initialise all the model states at 0, except for the production and routing stores which are initialised at 50 \% of their capacity. This initialisation is made at the very beginning of the model call (i.e. at the beginning of \emph{IndPeriod_WarmUp} or at the beginning of IndPeriod_Run if the warm-up period is disabled). } (2) Customisation of initialisation options: \itemize{ \item \emph{IndPeriod_WarmUp} can be used to specify the indices of the warm-up period (within the time-series prepared in InputsModel). \cr -- remark 1: for most common cases, indices corresponding to one or several years preceding \emph{IndPeriod_Run} are used (e.g. \emph{IndPeriod_WarmUp <- 1000:1365} and \emph{IndPeriod_Run <- 1366:5000)}. \cr +- remark 1: for most common cases, indices corresponding to one or several years preceding \emph{IndPeriod_Run} are used (e.g. \emph{IndPeriod_WarmUp = 1000:1365} and \emph{IndPeriod_Run = 1366:5000)}. \cr However, it is also possible to perform a long-term initialisation if other indices than the warm-up ones are set in \emph{IndPeriod_WarmUp} (e.g. \emph{IndPeriod_WarmUp <- c( 1:5000 , 1:5000 , 1:5000 ,1000:1365 )}). \cr -- remark 2: it is also possible to completely disable the warm-up period when using \emph{IndPeriod_WarmUp <- 0}. +- remark 2: it is also possible to completely disable the warm-up period when using \emph{IndPeriod_WarmUp = 0L}. \item \emph{IniStates} and \emph{IniResLevels} can be used to specify the initial model states. \cr - remark 1: if \emph{IniStates} is used, all model states must be provided (e.g. 60 floats [mm] are required for GR4J, GR5J and GR6J; 60+2*NLayers floats [mm] are required for CemaNeigeGR4J, CemaNeigeGR5J and CemaNeigeGR6J; see fortran source code for details). \cr @@ -83,34 +84,35 @@ However, it is also possible to perform a long-term initialisation if other indi } } \examples{ -## load of catchment data -require(airGR) +## loading catchment data +library(airGR) data(L0123001) ## preparation of the InputsModel object -InputsModel <- CreateInputsModel(FUN_MOD=RunModel_GR4J,DatesR=BasinObs$DatesR, - Precip=BasinObs$P,PotEvap=BasinObs$E) +InputsModel <- CreateInputsModel(FUN_MOD = RunModel_GR4J, DatesR = BasinObs$DatesR, + Precip = BasinObs$P, PotEvap = BasinObs$E) ## run period selection -Ind_Run <- seq(which(format(BasinObs$DatesR,format="\%d/\%m/\%Y \%H:\%M")=="01/01/1990 00:00"), - which(format(BasinObs$DatesR,format="\%d/\%m/\%Y \%H:\%M")=="31/12/1999 00:00")) +Ind_Run <- seq(which(format(BasinObs$DatesR, format = "\%d/\%m/\%Y \%H:\%M")=="01/01/1990 00:00"), + which(format(BasinObs$DatesR, format = "\%d/\%m/\%Y \%H:\%M")=="31/12/1999 00:00")) ## preparation of the RunOptions object -RunOptions <- CreateRunOptions(FUN_MOD=RunModel_GR4J,InputsModel=InputsModel,IndPeriod_Run=Ind_Run) +RunOptions <- CreateRunOptions(FUN_MOD = RunModel_GR4J, + InputsModel = InputsModel, IndPeriod_Run = Ind_Run) ## simulation -Param <- c(734.568,-0.840,109.809,1.971) -OutputsModel <- RunModel(InputsModel=InputsModel,RunOptions=RunOptions,Param=Param, - FUN_MOD=RunModel_GR4J) +Param <- c(734.568, -0.840, 109.809, 1.971) +OutputsModel <- RunModel(InputsModel = InputsModel, RunOptions = RunOptions, Param = Param, + FUN_MOD = RunModel_GR4J) ## results preview -plot_OutputsModel(OutputsModel=OutputsModel,Qobs=BasinObs$Qmm[Ind_Run]) +plot_OutputsModel(OutputsModel = OutputsModel, Qobs = BasinObs$Qmm[Ind_Run]) ## efficiency criterion: Nash-Sutcliffe Efficiency -InputsCrit <- CreateInputsCrit(FUN_CRIT=ErrorCrit_NSE,InputsModel=InputsModel, - RunOptions=RunOptions,Qobs=BasinObs$Qmm[Ind_Run]) -OutputsCrit <- ErrorCrit_NSE(InputsCrit=InputsCrit,OutputsModel=OutputsModel) -cat(paste(" Crit ",OutputsCrit$CritName," ",round(OutputsCrit$CritValue,4),"\\n",sep="")) +InputsCrit <- CreateInputsCrit(FUN_CRIT = ErrorCrit_NSE, InputsModel = InputsModel, + RunOptions = RunOptions, Qobs = BasinObs$Qmm[Ind_Run]) +OutputsCrit <- ErrorCrit_NSE(InputsCrit = InputsCrit, OutputsModel = OutputsModel) +cat(paste(" Crit ", OutputsCrit$CritName, " ", round(OutputsCrit$CritValue, 4), "\\n", sep = "")) } \author{ diff --git a/man/ErrorCrit.Rd b/man/ErrorCrit.Rd index 8db84a90..b4070a34 100644 --- a/man/ErrorCrit.Rd +++ b/man/ErrorCrit.Rd @@ -23,65 +23,69 @@ ErrorCrit(InputsCrit, OutputsModel, FUN_CRIT, quiet = FALSE) Function which computes an error criterion with the provided function. } \examples{ -## load of catchment data -require(airGR) +## loading catchment data +library(airGR) data(L0123001) ## preparation of the InputsModel object -InputsModel <- CreateInputsModel(FUN_MOD=RunModel_GR4J,DatesR=BasinObs$DatesR, - Precip=BasinObs$P,PotEvap=BasinObs$E) +InputsModel <- CreateInputsModel(FUN_MOD = RunModel_GR4J, DatesR = BasinObs$DatesR, + Precip = BasinObs$P, PotEvap = BasinObs$E) ## run period selection -Ind_Run <- seq(which(format(BasinObs$DatesR,format="\%d/\%m/\%Y \%H:\%M")=="01/01/1990 00:00"), - which(format(BasinObs$DatesR,format="\%d/\%m/\%Y \%H:\%M")=="31/12/1999 00:00")) +Ind_Run <- seq(which(format(BasinObs$DatesR, format = "\%d/\%m/\%Y \%H:\%M")=="01/01/1990 00:00"), + which(format(BasinObs$DatesR, format = "\%d/\%m/\%Y \%H:\%M")=="31/12/1999 00:00")) ## preparation of the RunOptions object -RunOptions <- CreateRunOptions(FUN_MOD=RunModel_GR4J,InputsModel=InputsModel,IndPeriod_Run=Ind_Run) +RunOptions <- CreateRunOptions(FUN_MOD = RunModel_GR4J, + InputsModel = InputsModel, IndPeriod_Run = Ind_Run) ## simulation -Param <- c(734.568,-0.840,109.809,1.971) -OutputsModel <- RunModel(InputsModel=InputsModel,RunOptions=RunOptions, - Param=Param,FUN=RunModel_GR4J) +Param <- c(734.568, -0.840, 109.809, 1.971) +OutputsModel <- RunModel(InputsModel = InputsModel, RunOptions = RunOptions, + Param = Param, FUN = RunModel_GR4J) ## efficiency criterion: Nash-Sutcliffe Efficiency -InputsCrit <- CreateInputsCrit(FUN_CRIT=ErrorCrit_NSE,InputsModel=InputsModel, - RunOptions=RunOptions,Qobs=BasinObs$Qmm[Ind_Run]) -OutputsCrit <- ErrorCrit_NSE(InputsCrit=InputsCrit,OutputsModel=OutputsModel) -cat(paste(" Crit ",OutputsCrit$CritName," ",round(OutputsCrit$CritValue,4),"\\n",sep="")) +InputsCrit <- CreateInputsCrit(FUN_CRIT = ErrorCrit_NSE, InputsModel = InputsModel, + RunOptions = RunOptions, Qobs = BasinObs$Qmm[Ind_Run]) +OutputsCrit <- ErrorCrit_NSE(InputsCrit = InputsCrit, OutputsModel = OutputsModel) +cat(paste(" Crit ", OutputsCrit$CritName, " ", round(OutputsCrit$CritValue, 4), "\\n", sep = "")) ## efficiency criterion: Nash-Sutcliffe Efficiency on log-transformed flows transfo <- "log" -InputsCrit <- CreateInputsCrit(FUN_CRIT=ErrorCrit_NSE,InputsModel=InputsModel, - RunOptions=RunOptions,Qobs=BasinObs$Qmm[Ind_Run],transfo=transfo) -OutputsCrit <- ErrorCrit_NSE(InputsCrit=InputsCrit,OutputsModel=OutputsModel) -cat(paste(" Crit ",OutputsCrit$CritName," ",round(OutputsCrit$CritValue,4),"\\n",sep="")) +InputsCrit <- CreateInputsCrit(FUN_CRIT = ErrorCrit_NSE, InputsModel = InputsModel, + RunOptions = RunOptions, Qobs = BasinObs$Qmm[Ind_Run], + transfo = transfo) +OutputsCrit <- ErrorCrit_NSE(InputsCrit = InputsCrit, OutputsModel = OutputsModel) +cat(paste(" Crit ", OutputsCrit$CritName, " ", round(OutputsCrit$CritValue, 4), "\\n", sep = "")) ## efficiency criterion: Nash-Sutcliffe Efficiency above a threshold (q75\%) -BoolCrit <- rep(TRUE,length(BasinObs$Qmm[Ind_Run])); -BoolCrit[BasinObs$Qmm[Ind_Run]<quantile(BasinObs$Qmm[Ind_Run],0.75,na.rm=TRUE)] <- FALSE; -InputsCrit <- CreateInputsCrit(FUN_CRIT=ErrorCrit_NSE,InputsModel=InputsModel, - RunOptions=RunOptions,Qobs=BasinObs$Qmm[Ind_Run],BoolCrit=BoolCrit) -OutputsCrit <- ErrorCrit_NSE(InputsCrit=InputsCrit,OutputsModel=OutputsModel) -cat(paste(" Crit ",OutputsCrit$CritName," ",round(OutputsCrit$CritValue,4),"\\n",sep="")) +BoolCrit <- rep(TRUE, length(BasinObs$Qmm[Ind_Run])) +BoolCrit[BasinObs$Qmm[Ind_Run]<quantile(BasinObs$Qmm[Ind_Run], 0.75, na.rm = TRUE)] <- FALSE +InputsCrit <- CreateInputsCrit(FUN_CRIT = ErrorCrit_NSE, InputsModel = InputsModel, + RunOptions = RunOptions, Qobs = BasinObs$Qmm[Ind_Run], + BoolCrit = BoolCrit) +OutputsCrit <- ErrorCrit_NSE(InputsCrit = InputsCrit, OutputsModel = OutputsModel) +cat(paste(" Crit ", OutputsCrit$CritName, " ", round(OutputsCrit$CritValue, 4), "\\n", sep = "")) ## efficiency criterion: Kling-Gupta Efficiency -InputsCrit <- CreateInputsCrit(FUN_CRIT=ErrorCrit_KGE,InputsModel=InputsModel, - RunOptions=RunOptions,Qobs=BasinObs$Qmm[Ind_Run]) -OutputsCrit <- ErrorCrit_KGE(InputsCrit=InputsCrit,OutputsModel=OutputsModel) -cat(paste(" Crit ",OutputsCrit$CritName," ",round(OutputsCrit$CritValue,4),"\\n",sep="")) -cat(paste("SubCrit ",OutputsCrit$SubCritNames," ",round(OutputsCrit$SubCritValues,4),"\\n",sep="")) +InputsCrit <- CreateInputsCrit(FUN_CRIT = ErrorCrit_KGE, InputsModel = InputsModel, + RunOptions = RunOptions, Qobs = BasinObs$Qmm[Ind_Run]) +OutputsCrit <- ErrorCrit_KGE(InputsCrit = InputsCrit, OutputsModel = OutputsModel) +cat(paste(" Crit ", OutputsCrit$CritName, " ", round(OutputsCrit$CritValue, 4), "\\n", sep = "")) +cat(paste("SubCrit ", OutputsCrit$SubCritNames, " ", + round(OutputsCrit$SubCritValues, 4), "\\n", sep = "")) ## efficiency criterion: Kling-Gupta Efficiency below a threshold (q10\%) on log-trqansformed flows transfo <- "log" -BoolCrit <- rep(TRUE,length(BasinObs$Qmm[Ind_Run])); -BoolCrit[BasinObs$Qmm[Ind_Run]>quantile(BasinObs$Qmm[Ind_Run],0.10,na.rm=TRUE)] <- FALSE; -InputsCrit <- CreateInputsCrit(FUN_CRIT=ErrorCrit_KGE,InputsModel=InputsModel,RunOptions=RunOptions, - Qobs=BasinObs$Qmm[Ind_Run],BoolCrit=BoolCrit,transfo=transfo) -OutputsCrit <- ErrorCrit_KGE(InputsCrit=InputsCrit,OutputsModel=OutputsModel) -cat(paste(" Crit ",OutputsCrit$CritName," ",round(OutputsCrit$CritValue,4),"\\n",sep="")) -cat(paste("SubCrit ",OutputsCrit$SubCritNames," ",round(OutputsCrit$SubCritValues,4),"\\n",sep="")) - - +BoolCrit <- rep(TRUE, length(BasinObs$Qmm[Ind_Run])) +BoolCrit[BasinObs$Qmm[Ind_Run]>quantile(BasinObs$Qmm[Ind_Run], 0.10, na.rm = TRUE)] <- FALSE +InputsCrit <- CreateInputsCrit(FUN_CRIT = ErrorCrit_KGE, InputsModel = InputsModel, + RunOptions = RunOptions, Qobs = BasinObs$Qmm[Ind_Run], + BoolCrit = BoolCrit, transfo = transfo) +OutputsCrit <- ErrorCrit_KGE(InputsCrit = InputsCrit, OutputsModel = OutputsModel) +cat(paste(" Crit ", OutputsCrit$CritName, " ", round(OutputsCrit$CritValue, 4), "\\n", sep = "")) +cat(paste("SubCrit ", OutputsCrit$SubCritNames, " ", + round(OutputsCrit$SubCritValues, 4), "\\n", sep = "")) } diff --git a/man/ErrorCrit_KGE.Rd b/man/ErrorCrit_KGE.Rd index 51a677ac..d4814b05 100644 --- a/man/ErrorCrit_KGE.Rd +++ b/man/ErrorCrit_KGE.Rd @@ -23,7 +23,7 @@ ErrorCrit_KGE(InputsCrit, OutputsModel, quiet = FALSE) \emph{$SubCritNames } \tab [character] names of the sub-criteria \cr \emph{$CritBestValue } \tab [numeric] theoretical best criterion value \cr \emph{$Multiplier } \tab [numeric] integer indicating whether the criterion is indeed an error (+1) or an efficiency (-1) \cr - \emph{$Ind_notcomputed} \tab [numeric] indices of the time-steps where InputsCrit$BoolCrit=FALSE or no data is available \cr + \emph{$Ind_notcomputed} \tab [numeric] indices of the time steps where InputsCrit$BoolCrit=FALSE or no data is available \cr } } \description{ diff --git a/man/ErrorCrit_KGE2.Rd b/man/ErrorCrit_KGE2.Rd index 0631d5f7..4f01b674 100644 --- a/man/ErrorCrit_KGE2.Rd +++ b/man/ErrorCrit_KGE2.Rd @@ -23,7 +23,7 @@ ErrorCrit_KGE2(InputsCrit, OutputsModel, quiet = FALSE) \emph{$SubCritNames } \tab [character] names of the sub-criteria \cr \emph{$CritBestValue } \tab [numeric] theoretical best criterion value \cr \emph{$Multiplier } \tab [numeric] integer indicating whether the criterion is indeed an error (+1) or an efficiency (-1) \cr - \emph{$Ind_notcomputed} \tab [numeric] indices of the time-steps where InputsCrit$BoolCrit=FALSE or no data is available \cr + \emph{$Ind_notcomputed} \tab [numeric] indices of the time steps where InputsCrit$BoolCrit=FALSE or no data is available \cr } } \description{ diff --git a/man/ErrorCrit_NSE.Rd b/man/ErrorCrit_NSE.Rd index f12ae8e4..a7a9a54a 100644 --- a/man/ErrorCrit_NSE.Rd +++ b/man/ErrorCrit_NSE.Rd @@ -21,7 +21,7 @@ ErrorCrit_NSE(InputsCrit, OutputsModel, quiet = FALSE) \emph{$CritName } \tab [character] name of the criterion \cr \emph{$CritBestValue } \tab [numeric] theoretical best criterion value \cr \emph{$Multiplier } \tab [numeric] integer indicating whether the criterion is indeed an error (+1) or an efficiency (-1) \cr - \emph{$Ind_notcomputed} \tab [numeric] indices of the time-steps where InputsCrit$BoolCrit=FALSE or no data is available \cr + \emph{$Ind_notcomputed} \tab [numeric] indices of the time steps where InputsCrit$BoolCrit=FALSE or no data is available \cr } } \description{ diff --git a/man/ErrorCrit_RMSE.Rd b/man/ErrorCrit_RMSE.Rd index fdc8194b..7c996fef 100644 --- a/man/ErrorCrit_RMSE.Rd +++ b/man/ErrorCrit_RMSE.Rd @@ -21,7 +21,7 @@ ErrorCrit_RMSE(InputsCrit, OutputsModel, quiet = FALSE) \emph{$CritName } \tab [character] name of the criterion \cr \emph{$CritBestValue } \tab [numeric] theoretical best criterion value \cr \emph{$Multiplier } \tab [numeric] integer indicating whether the criterion is indeed an error (+1) or an efficiency (-1) \cr - \emph{$Ind_notcomputed} \tab [numeric] indices of the time-steps where InputsCrit$BoolCrit=FALSE or no data is available \cr + \emph{$Ind_notcomputed} \tab [numeric] indices of the time steps where InputsCrit$BoolCrit=FALSE or no data is available \cr } } \description{ @@ -36,7 +36,7 @@ the use of the function for model calibration: the product CritValue*Multiplier ## see example of the ErrorCrit function } \author{ -Laurent Coron (June 2014) +Laurent Coron, Ludovic Oudin (June 2014) } \seealso{ \code{\link{ErrorCrit_NSE}}, \code{\link{ErrorCrit_KGE}}, \code{\link{ErrorCrit_KGE2}} diff --git a/man/PEdaily_Oudin.Rd b/man/PEdaily_Oudin.Rd index 1bcc308c..c01f2984 100644 --- a/man/PEdaily_Oudin.Rd +++ b/man/PEdaily_Oudin.Rd @@ -26,7 +26,7 @@ Function which computes daily PE using the formula from Oudin et al. (2005). PotEvap <- PEdaily_Oudin(JD=as.POSIXlt(BasinObs$DatesR)$yday,Temp=BasinObs$T,LatRad=0.8) } \author{ -Laurent Coron (December 2013) +Laurent Coron, Ludovic Oudin (December 2013) } \references{ Oudin, L., F. Hervieu, C. Michel, C. Perrin, V. Andréassian, F. Anctil and C. Loumagne (2005), diff --git a/man/RunModel.Rd b/man/RunModel.Rd index 608cf333..c042c3ec 100644 --- a/man/RunModel.Rd +++ b/man/RunModel.Rd @@ -20,37 +20,38 @@ RunModel(InputsModel, RunOptions, Param, FUN_MOD) [list] see \code{\link{RunModel_GR4J}} or \code{\link{RunModel_CemaNeigeGR4J}} for details } \description{ -Function which performs a single model run with the provided function. +Function which performs a single model run with the provided function over the selected period. } \examples{ -## load of catchment data -require(airGR) +## loading catchment data +library(airGR) data(L0123001) ## preparation of the InputsModel object -InputsModel <- CreateInputsModel(FUN_MOD=RunModel_GR4J,DatesR=BasinObs$DatesR, - Precip=BasinObs$P,PotEvap=BasinObs$E) +InputsModel <- CreateInputsModel(FUN_MOD = RunModel_GR4J, DatesR = BasinObs$DatesR, + Precip = BasinObs$P, PotEvap = BasinObs$E) ## run period selection -Ind_Run <- seq(which(format(BasinObs$DatesR,format="\%d/\%m/\%Y \%H:\%M")=="01/01/1990 00:00"), - which(format(BasinObs$DatesR,format="\%d/\%m/\%Y \%H:\%M")=="31/12/1999 00:00")) +Ind_Run <- seq(which(format(BasinObs$DatesR, format = "\%d/\%m/\%Y \%H:\%M")=="01/01/1990 00:00"), + which(format(BasinObs$DatesR, format = "\%d/\%m/\%Y \%H:\%M")=="31/12/1999 00:00")) ## preparation of the RunOptions object -RunOptions <- CreateRunOptions(FUN_MOD=RunModel_GR4J,InputsModel=InputsModel,IndPeriod_Run=Ind_Run) +RunOptions <- CreateRunOptions(FUN_MOD = RunModel_GR4J, + InputsModel = InputsModel, IndPeriod_Run = Ind_Run) ## simulation -Param <- c(734.568,-0.840,109.809,1.971) -OutputsModel <- RunModel(InputsModel=InputsModel,RunOptions=RunOptions,Param=Param, - FUN_MOD=RunModel_GR4J) +Param <- c(734.568, -0.840, 109.809, 1.971) +OutputsModel <- RunModel(InputsModel = InputsModel, RunOptions = RunOptions, Param = Param, + FUN_MOD = RunModel_GR4J) ## results preview -plot_OutputsModel(OutputsModel=OutputsModel,Qobs=BasinObs$Qmm[Ind_Run]) +plot_OutputsModel(OutputsModel = OutputsModel, Qobs = BasinObs$Qmm[Ind_Run]) ## efficiency criterion: Nash-Sutcliffe Efficiency -InputsCrit <- CreateInputsCrit(FUN_CRIT=ErrorCrit_NSE,InputsModel=InputsModel, - RunOptions=RunOptions,Qobs=BasinObs$Qmm[Ind_Run]) -OutputsCrit <- ErrorCrit_NSE(InputsCrit=InputsCrit,OutputsModel=OutputsModel) -cat(paste(" Crit ",OutputsCrit$CritName," ",round(OutputsCrit$CritValue,4),"\\n",sep="")) +InputsCrit <- CreateInputsCrit(FUN_CRIT = ErrorCrit_NSE, InputsModel = InputsModel, + RunOptions = RunOptions, Qobs = BasinObs$Qmm[Ind_Run]) +OutputsCrit <- ErrorCrit_NSE(InputsCrit = InputsCrit, OutputsModel = OutputsModel) +cat(paste(" Crit ", OutputsCrit$CritName, " ", round(OutputsCrit$CritValue, 4), "\\n", sep = "")) } \author{ diff --git a/man/RunModel_CemaNeige.Rd b/man/RunModel_CemaNeige.Rd index d6ec2d39..9fe3d0c1 100644 --- a/man/RunModel_CemaNeige.Rd +++ b/man/RunModel_CemaNeige.Rd @@ -20,8 +20,8 @@ CemaNeige X2 \tab degree-day melt coefficient [mm/degC/d] } \value{ [list] list containing the function outputs organised as follows: - \tabular{ll}{ - \emph{$DatesR } \tab [POSIXlt] series of dates \cr + \tabular{ll}{ + \emph{$DatesR} \tab [POSIXlt] series of dates \cr \emph{$CemaNeigeLayers} \tab [list] list of CemaNeige outputs (1 list per layer) \cr \emph{$CemaNeigeLayers[[iLayer]]$Pliq } \tab [numeric] series of liquid precip. [mm/d] \cr \emph{$CemaNeigeLayers[[iLayer]]$Psol } \tab [numeric] series of solid precip. [mm/d] \cr diff --git a/man/RunModel_CemaNeigeGR4J.Rd b/man/RunModel_CemaNeigeGR4J.Rd index 5dc1a968..038cff29 100644 --- a/man/RunModel_CemaNeigeGR4J.Rd +++ b/man/RunModel_CemaNeigeGR4J.Rd @@ -28,17 +28,17 @@ CemaNeige X2 \tab degree-day melt coefficient [mm/degC/d] \emph{$DatesR } \tab [POSIXlt] series of dates \cr \emph{$PotEvap } \tab [numeric] series of input potential evapotranspiration [mm/d] \cr \emph{$Precip } \tab [numeric] series of input total precipitation [mm/d] \cr - \emph{$Prod } \tab [numeric] series of production store level (X(2)) [mm] \cr + \emph{$Prod } \tab [numeric] series of production store level [mm] \cr \emph{$AE } \tab [numeric] series of actual evapotranspiration [mm/d] \cr \emph{$Perc } \tab [numeric] series of percolation (PERC) [mm/d] \cr \emph{$PR } \tab [numeric] series of PR=PN-PS+PERC [mm/d] \cr - \emph{$Q9 } \tab [numeric] series of HU1 outflow (Q9) [mm/d] \cr - \emph{$Q1 } \tab [numeric] series of HU2 outflow (Q1) [mm/d] \cr - \emph{$Rout } \tab [numeric] series of routing store level (X(1)) [mm] \cr + \emph{$Q9 } \tab [numeric] series of UH1 outflow (Q9) [mm/d] \cr + \emph{$Q1 } \tab [numeric] series of UH2 outflow (Q1) [mm/d] \cr + \emph{$Rout } \tab [numeric] series of routing store level [mm] \cr \emph{$Exch } \tab [numeric] series of potential semi-exchange between catchments [mm/d] \cr \emph{$AExch } \tab [numeric] series of actual exchange between catchments (1+2) [mm/d] \cr \emph{$QR } \tab [numeric] series of routing store outflow (QR) [mm/d] \cr - \emph{$QD } \tab [numeric] series of direct flow from HU2 after exchange (QD) [mm/d] \cr + \emph{$QD } \tab [numeric] series of direct flow from UH2 after exchange (QD) [mm/d] \cr \emph{$Qsim } \tab [numeric] series of Qsim [mm/d] \cr \emph{$CemaNeigeLayers} \tab [list] list of CemaNeige outputs (1 list per layer) \cr \emph{$CemaNeigeLayers[[iLayer]]$Pliq } \tab [numeric] series of liquid precip. [mm/d] \cr @@ -49,52 +49,53 @@ CemaNeige X2 \tab degree-day melt coefficient [mm/degC/d] \emph{$CemaNeigeLayers[[iLayer]]$PotMelt } \tab [numeric] series of potential snow melt [mm/d] \cr \emph{$CemaNeigeLayers[[iLayer]]$Melt } \tab [numeric] series of actual snow melt [mm/d] \cr \emph{$CemaNeigeLayers[[iLayer]]$PliqAndMelt } \tab [numeric] series of liquid precip. + actual snow melt [mm/d] \cr - \emph{$StateEnd} \tab [numeric] states at the end of the run: \cr\tab res. & HU levels [mm], CemaNeige states [mm & degC] \cr + \emph{$StateEnd} \tab [numeric] states at the end of the run: \cr\tab res. & UH levels [mm], CemaNeige states [mm & degC] \cr } (refer to the provided references or to the package source code for further details on these model outputs) } \description{ -Function which performs a single run for the CemaNeige-GR4J daily lumped model. +Function which performs a single run for the CemaNeige-GR4J daily lumped model over the test period. } \details{ For further details on the model, see the references section. For further details on the argument structures and initialisation options, see \code{\link{CreateRunOptions}}. } \examples{ -## load of catchment data -require(airGR) +## loading catchment data +library(airGR) data(L0123002) ## preparation of the InputsModel object -InputsModel <- CreateInputsModel(FUN_MOD=RunModel_CemaNeigeGR4J,DatesR=BasinObs$DatesR, - Precip=BasinObs$P,PotEvap=BasinObs$E,TempMean=BasinObs$T, - ZInputs=BasinInfo$HypsoData[51],HypsoData=BasinInfo$HypsoData, - NLayers=5) +InputsModel <- CreateInputsModel(FUN_MOD = RunModel_CemaNeigeGR4J, DatesR = BasinObs$DatesR, + Precip = BasinObs$P, PotEvap = BasinObs$E, TempMean = BasinObs$T, + ZInputs = BasinInfo$HypsoData[51], + HypsoData = BasinInfo$HypsoData, NLayers = 5) ## run period selection -Ind_Run <- seq(which(format(BasinObs$DatesR,format="\%d/\%m/\%Y \%H:\%M")=="01/01/1990 00:00"), - which(format(BasinObs$DatesR,format="\%d/\%m/\%Y \%H:\%M")=="31/12/1999 00:00")) +Ind_Run <- seq(which(format(BasinObs$DatesR, format = "\%d/\%m/\%Y \%H:\%M")=="01/01/1990 00:00"), + which(format(BasinObs$DatesR, format = "\%d/\%m/\%Y \%H:\%M")=="31/12/1999 00:00")) ## preparation of the RunOptions object -RunOptions <- CreateRunOptions(FUN_MOD=RunModel_CemaNeigeGR4J,InputsModel=InputsModel, - IndPeriod_Run=Ind_Run) +RunOptions <- CreateRunOptions(FUN_MOD = RunModel_CemaNeigeGR4J, InputsModel = InputsModel, + IndPeriod_Run = Ind_Run) ## simulation -Param <- c(408.774,2.646,131.264,1.174,0.962,2.249) -OutputsModel <- RunModel_CemaNeigeGR4J(InputsModel=InputsModel,RunOptions=RunOptions,Param=Param) +Param <- c(408.774, 2.646, 131.264, 1.174, 0.962, 2.249) +OutputsModel <- RunModel_CemaNeigeGR4J(InputsModel = InputsModel, + RunOptions = RunOptions, Param = Param) ## results preview -plot_OutputsModel(OutputsModel=OutputsModel,Qobs=BasinObs$Qmm[Ind_Run]) +plot_OutputsModel(OutputsModel = OutputsModel, Qobs = BasinObs$Qmm[Ind_Run]) ## efficiency criterion: Nash-Sutcliffe Efficiency -InputsCrit <- CreateInputsCrit(FUN_CRIT=ErrorCrit_NSE,InputsModel=InputsModel, - RunOptions=RunOptions,Qobs=BasinObs$Qmm[Ind_Run]) -OutputsCrit <- ErrorCrit_NSE(InputsCrit=InputsCrit,OutputsModel=OutputsModel) -cat(paste(" Crit ",OutputsCrit$CritName," ",round(OutputsCrit$CritValue,4),"\\n",sep="")) +InputsCrit <- CreateInputsCrit(FUN_CRIT = ErrorCrit_NSE, InputsModel = InputsModel, + RunOptions = RunOptions, Qobs = BasinObs$Qmm[Ind_Run]) +OutputsCrit <- ErrorCrit_NSE(InputsCrit = InputsCrit, OutputsModel = OutputsModel) +cat(paste(" Crit ", OutputsCrit$CritName, " ", round(OutputsCrit$CritValue, 4), "\\n", sep = "")) } \author{ -Laurent Coron (December 2013) +Laurent Coron, Audrey Valéry, Claude Michel, Charles Perrin, Vazken Andréassian (December 2013) } \references{ Perrin, C., C. Michel and V. Andréassian (2003), diff --git a/man/RunModel_CemaNeigeGR5J.Rd b/man/RunModel_CemaNeigeGR5J.Rd index 2c114c41..5a169773 100644 --- a/man/RunModel_CemaNeigeGR5J.Rd +++ b/man/RunModel_CemaNeigeGR5J.Rd @@ -15,10 +15,10 @@ RunModel_CemaNeigeGR5J(InputsModel, RunOptions, Param) \item{Param}{[numeric] vector of 7 parameters \tabular{ll}{ GR5J X1 \tab production store capacity [mm] \cr -GR5J X2 \tab intercatchment exchange coefficient 1 [mm/d] \cr +GR5J X2 \tab intercatchment exchange coefficient [mm/d] \cr GR5J X3 \tab routing store capacity [mm] \cr GR5J X4 \tab unit hydrograph time constant [d] \cr -GR5J X5 \tab intercatchment exchange coefficient 2 [-] \cr +GR5J X5 \tab intercatchment exchange threshold [-] \cr CemaNeige X1 \tab weighting coefficient for snow pack thermal state [-] \cr CemaNeige X2 \tab degree-day melt coefficient [mm/degC/d] \cr }} @@ -29,19 +29,19 @@ CemaNeige X2 \tab degree-day melt coefficient [mm/degC/d] \emph{$DatesR } \tab [POSIXlt] series of dates \cr \emph{$PotEvap } \tab [numeric] series of input potential evapotranspiration [mm/d] \cr \emph{$Precip } \tab [numeric] series of input total precipitation [mm/d] \cr - \emph{$Prod } \tab [numeric] series of production store level (X(2)) [mm] \cr + \emph{$Prod } \tab [numeric] series of production store level [mm] \cr \emph{$AE } \tab [numeric] series of actual evapotranspiration [mm/d] \cr \emph{$Perc } \tab [numeric] series of percolation (PERC) [mm/d] \cr \emph{$PR } \tab [numeric] series of PR=PN-PS+PERC [mm/d] \cr - \emph{$Q9 } \tab [numeric] series of HU1 outflow (Q9) [mm/d] \cr - \emph{$Q1 } \tab [numeric] series of HU2 outflow (Q1) [mm/d] \cr - \emph{$Rout } \tab [numeric] series of routing store level (X(1)) [mm] \cr + \emph{$Q9 } \tab [numeric] series of UH1 outflow (Q9) [mm/d] \cr + \emph{$Q1 } \tab [numeric] series of UH2 outflow (Q1) [mm/d] \cr + \emph{$Rout } \tab [numeric] series of routing store level [mm] \cr \emph{$Exch } \tab [numeric] series of potential semi-exchange between catchments [mm/d] \cr \emph{$AExch } \tab [numeric] series of actual exchange between catchments (1+2) [mm/d] \cr \emph{$QR } \tab [numeric] series of routing store outflow (QR) [mm/d] \cr - \emph{$QD } \tab [numeric] series of direct flow from HU2 after exchange (QD) [mm/d] \cr + \emph{$QD } \tab [numeric] series of direct flow from UH2 after exchange (QD) [mm/d] \cr \emph{$Qsim } \tab [numeric] series of Qsim [mm/d] \cr - \emph{$CemaNeigeLayers} \tab [list] list of CemaNeige outputs (1 list per layer) \cr + \emph{$CemaNeigeLayers} \tab [list] list of CemaNeige outputs (1 list per layer) \cr \emph{$CemaNeigeLayers[[iLayer]]$Pliq } \tab [numeric] series of liquid precip. [mm/d] \cr \emph{$CemaNeigeLayers[[iLayer]]$Psol } \tab [numeric] series of solid precip. [mm/d] \cr \emph{$CemaNeigeLayers[[iLayer]]$SnowPack } \tab [numeric] series of snow pack [mm] \cr @@ -50,7 +50,7 @@ CemaNeige X2 \tab degree-day melt coefficient [mm/degC/d] \emph{$CemaNeigeLayers[[iLayer]]$PotMelt } \tab [numeric] series of potential snow melt [mm/d] \cr \emph{$CemaNeigeLayers[[iLayer]]$Melt } \tab [numeric] series of actual snow melt [mm/d] \cr \emph{$CemaNeigeLayers[[iLayer]]$PliqAndMelt } \tab [numeric] series of liquid precip. + actual snow melt [mm/d] \cr - \emph{$StateEnd} \tab [numeric] states at the end of the run: \cr\tab res. & HU levels [mm], CemaNeige states [mm & degC] \cr + \emph{$StateEnd} \tab [numeric] states at the end of the run: \cr\tab res. & UH levels [mm], CemaNeige states [mm & degC] \cr } (refer to the provided references or to the package source code for further details on these model outputs) } @@ -62,40 +62,41 @@ For further details on the model, see the references section. For further details on the argument structures and initialisation options, see \code{\link{CreateRunOptions}}. } \examples{ -## load of catchment data -require(airGR) +## loading catchment data +library(airGR) data(L0123002) ## preparation of the InputsModel object -InputsModel <- CreateInputsModel(FUN_MOD=RunModel_CemaNeigeGR5J,DatesR=BasinObs$DatesR, - Precip=BasinObs$P,PotEvap=BasinObs$E,TempMean=BasinObs$T, - ZInputs=BasinInfo$HypsoData[51],HypsoData=BasinInfo$HypsoData, - NLayers=5) +InputsModel <- CreateInputsModel(FUN_MOD = RunModel_CemaNeigeGR5J, DatesR = BasinObs$DatesR, + Precip = BasinObs$P, PotEvap = BasinObs$E, TempMean = BasinObs$T, + ZInputs = BasinInfo$HypsoData[51], + HypsoData = BasinInfo$HypsoData, NLayers = 5) ## run period selection -Ind_Run <- seq(which(format(BasinObs$DatesR,format="\%d/\%m/\%Y \%H:\%M")=="01/01/1990 00:00"), - which(format(BasinObs$DatesR,format="\%d/\%m/\%Y \%H:\%M")=="31/12/1999 00:00")) +Ind_Run <- seq(which(format(BasinObs$DatesR, format = "\%d/\%m/\%Y \%H:\%M")=="01/01/1990 00:00"), + which(format(BasinObs$DatesR, format = "\%d/\%m/\%Y \%H:\%M")=="31/12/1999 00:00")) ## preparation of the RunOptions object -RunOptions <- CreateRunOptions(FUN_MOD=RunModel_CemaNeigeGR5J,InputsModel=InputsModel, - IndPeriod_Run=Ind_Run) +RunOptions <- CreateRunOptions(FUN_MOD = RunModel_CemaNeigeGR5J, InputsModel = InputsModel, + IndPeriod_Run = Ind_Run) ## simulation -Param <- c(179.139,-0.100,203.815,1.174,2.478,0.977,2.774) -OutputsModel <- RunModel_CemaNeigeGR5J(InputsModel=InputsModel,RunOptions=RunOptions,Param=Param) +Param <- c(179.139, -0.100, 203.815, 1.174, 2.478, 0.977, 2.774) +OutputsModel <- RunModel_CemaNeigeGR5J(InputsModel = InputsModel, + RunOptions = RunOptions, Param = Param) ## results preview -plot_OutputsModel(OutputsModel=OutputsModel,Qobs=BasinObs$Qmm[Ind_Run]) +plot_OutputsModel(OutputsModel = OutputsModel, Qobs = BasinObs$Qmm[Ind_Run]) ## efficiency criterion: Nash-Sutcliffe Efficiency -InputsCrit <- CreateInputsCrit(FUN_CRIT=ErrorCrit_NSE,InputsModel=InputsModel, - RunOptions=RunOptions,Qobs=BasinObs$Qmm[Ind_Run]) -OutputsCrit <- ErrorCrit_NSE(InputsCrit=InputsCrit,OutputsModel=OutputsModel) -cat(paste(" Crit ",OutputsCrit$CritName," ",round(OutputsCrit$CritValue,4),"\\n",sep="")) +InputsCrit <- CreateInputsCrit(FUN_CRIT = ErrorCrit_NSE, InputsModel = InputsModel, + RunOptions = RunOptions, Qobs = BasinObs$Qmm[Ind_Run]) +OutputsCrit <- ErrorCrit_NSE(InputsCrit = InputsCrit, OutputsModel = OutputsModel) +cat(paste(" Crit ", OutputsCrit$CritName, " ", round(OutputsCrit$CritValue, 4), "\\n", sep = "")) } \author{ -Laurent Coron (December 2013) +Laurent Coron, Audrey Valéry, Claude Michel, Nicolas Le Moine, Charles Perrin, Vazken Andréassian (December 2013) } \references{ Le Moine, N. (2008), Le bassin versant de surface vu par le souterrain : une voie d'amélioration des performances diff --git a/man/RunModel_CemaNeigeGR6J.Rd b/man/RunModel_CemaNeigeGR6J.Rd index 755866a9..d8a3b095 100644 --- a/man/RunModel_CemaNeigeGR6J.Rd +++ b/man/RunModel_CemaNeigeGR6J.Rd @@ -15,11 +15,11 @@ RunModel_CemaNeigeGR6J(InputsModel, RunOptions, Param) \item{Param}{[numeric] vector of 8 parameters \tabular{ll}{ GR6J X1 \tab production store capacity [mm] \cr -GR6J X2 \tab intercatchment exchange coefficient 1 [mm/d] \cr +GR6J X2 \tab intercatchment exchange coefficient [mm/d] \cr GR6J X3 \tab routing store capacity [mm] \cr GR6J X4 \tab unit hydrograph time constant [d] \cr -GR6J X5 \tab intercatchment exchange coefficient 2 [-] \cr -GR6J X6 \tab coefficient for emptying exponential store [-] \cr +GR6J X5 \tab intercatchment exchange threshold [-] \cr +GR6J X6 \tab coefficient for emptying exponential store [mm] \cr CemaNeige X1 \tab weighting coefficient for snow pack thermal state [-] \cr CemaNeige X2 \tab degree-day melt coefficient [mm/degC/d] \cr }} @@ -30,19 +30,19 @@ CemaNeige X2 \tab degree-day melt coefficient [mm/degC/d] \emph{$DatesR } \tab [POSIXlt] series of dates \cr \emph{$PotEvap } \tab [numeric] series of input potential evapotranspiration [mm/d] \cr \emph{$Precip } \tab [numeric] series of input total precipitation [mm/d] \cr - \emph{$Prod } \tab [numeric] series of production store level (X(2)) [mm] \cr + \emph{$Prod } \tab [numeric] series of production store level [mm] \cr \emph{$AE } \tab [numeric] series of actual evapotranspiration [mm/d] \cr \emph{$Perc } \tab [numeric] series of percolation (PERC) [mm/d] \cr \emph{$PR } \tab [numeric] series of PR=PN-PS+PERC [mm/d] \cr - \emph{$Q9 } \tab [numeric] series of HU1 outflow (Q9) [mm/d] \cr - \emph{$Q1 } \tab [numeric] series of HU2 outflow (Q1) [mm/d] \cr - \emph{$Rout } \tab [numeric] series of routing store level (X(1)) [mm] \cr + \emph{$Q9 } \tab [numeric] series of UH1 outflow (Q9) [mm/d] \cr + \emph{$Q1 } \tab [numeric] series of UH2 outflow (Q1) [mm/d] \cr + \emph{$Rout } \tab [numeric] series of routing store level [mm] \cr \emph{$Exch } \tab [numeric] series of potential semi-exchange between catchments [mm/d] \cr \emph{$AExch } \tab [numeric] series of actual exchange between catchments (1+2) [mm/d] \cr \emph{$QR } \tab [numeric] series of routing store outflow (QR) [mm/d] \cr \emph{$QR1 } \tab [numeric] series of exponential store outflow (QR1) [mm/d] \cr - \emph{$Exp } \tab [numeric] series of exponential store level (X(6)) (negative) [mm] \cr - \emph{$QD } \tab [numeric] series of direct flow from HU2 after exchange (QD) [mm/d] \cr + \emph{$Exp } \tab [numeric] series of exponential store level (negative) [mm] \cr + \emph{$QD } \tab [numeric] series of direct flow from UH2 after exchange (QD) [mm/d] \cr \emph{$Qsim } \tab [numeric] series of Qsim [mm/d] \cr \emph{$CemaNeigeLayers} \tab [list] list of CemaNeige outputs (1 list per layer) \cr \emph{$CemaNeigeLayers[[iLayer]]$Pliq } \tab [numeric] series of liquid precip. [mm/d] \cr @@ -53,7 +53,7 @@ CemaNeige X2 \tab degree-day melt coefficient [mm/degC/d] \emph{$CemaNeigeLayers[[iLayer]]$PotMelt } \tab [numeric] series of potential snow melt [mm/d] \cr \emph{$CemaNeigeLayers[[iLayer]]$Melt } \tab [numeric] series of actual snow melt [mm/d] \cr \emph{$CemaNeigeLayers[[iLayer]]$PliqAndMelt } \tab [numeric] series of liquid precip. + actual snow melt [mm/d] \cr - \emph{$StateEnd} \tab [numeric] states at the end of the run: \cr\tab res. & HU levels [mm], CemaNeige states [mm & degC] \cr + \emph{$StateEnd} \tab [numeric] states at the end of the run: \cr\tab res. & UH levels [mm], CemaNeige states [mm & degC] \cr } (refer to the provided references or to the package source code for further details on these model outputs) } @@ -65,40 +65,41 @@ For further details on the model, see the references section. For further details on the argument structures and initialisation options, see \code{\link{CreateRunOptions}}. } \examples{ -## load of catchment data -require(airGR) +## loading catchment data +library(airGR) data(L0123002) ## preparation of the InputsModel object -InputsModel <- CreateInputsModel(FUN_MOD=RunModel_CemaNeigeGR6J,DatesR=BasinObs$DatesR, - Precip=BasinObs$P,PotEvap=BasinObs$E,TempMean=BasinObs$T, - ZInputs=BasinInfo$HypsoData[51],HypsoData=BasinInfo$HypsoData, - NLayers=5) +InputsModel <- CreateInputsModel(FUN_MOD = RunModel_CemaNeigeGR6J, DatesR = BasinObs$DatesR, + Precip = BasinObs$P, PotEvap = BasinObs$E, TempMean = BasinObs$T, + ZInputs = BasinInfo$HypsoData[51], + HypsoData = BasinInfo$HypsoData, NLayers = 5) ## run period selection -Ind_Run <- seq(which(format(BasinObs$DatesR,format="\%d/\%m/\%Y \%H:\%M")=="01/01/1990 00:00"), - which(format(BasinObs$DatesR,format="\%d/\%m/\%Y \%H:\%M")=="31/12/1999 00:00")) +Ind_Run <- seq(which(format(BasinObs$DatesR, format = "\%d/\%m/\%Y \%H:\%M")=="01/01/1990 00:00"), + which(format(BasinObs$DatesR, format = "\%d/\%m/\%Y \%H:\%M")=="31/12/1999 00:00")) ## preparation of the RunOptions object -RunOptions <- CreateRunOptions(FUN_MOD=RunModel_CemaNeigeGR6J,InputsModel=InputsModel, - IndPeriod_Run=Ind_Run) +RunOptions <- CreateRunOptions(FUN_MOD = RunModel_CemaNeigeGR6J, InputsModel = InputsModel, + IndPeriod_Run = Ind_Run) ## simulation -Param <- c(116.482,0.500,72.733,1.224,0.278,30.333,0.977,2.776) -OutputsModel <- RunModel_CemaNeigeGR6J(InputsModel=InputsModel,RunOptions=RunOptions,Param=Param) +Param <- c(116.482, 0.500, 72.733, 1.224, 0.278, 30.333, 0.977, 2.776) +OutputsModel <- RunModel_CemaNeigeGR6J(InputsModel = InputsModel, + RunOptions = RunOptions, Param = Param) ## results preview -plot_OutputsModel(OutputsModel=OutputsModel,Qobs=BasinObs$Qmm[Ind_Run]) +plot_OutputsModel(OutputsModel = OutputsModel, Qobs = BasinObs$Qmm[Ind_Run]) ## efficiency criterion: Nash-Sutcliffe Efficiency -InputsCrit <- CreateInputsCrit(FUN_CRIT=ErrorCrit_NSE,InputsModel=InputsModel, - RunOptions=RunOptions,Qobs=BasinObs$Qmm[Ind_Run]) -OutputsCrit <- ErrorCrit_NSE(InputsCrit=InputsCrit,OutputsModel=OutputsModel) -cat(paste(" Crit ",OutputsCrit$CritName," ",round(OutputsCrit$CritValue,4),"\\n",sep="")) +InputsCrit <- CreateInputsCrit(FUN_CRIT = ErrorCrit_NSE, InputsModel = InputsModel, + RunOptions = RunOptions, Qobs = BasinObs$Qmm[Ind_Run]) +OutputsCrit <- ErrorCrit_NSE(InputsCrit = InputsCrit, OutputsModel = OutputsModel) +cat(paste(" Crit ", OutputsCrit$CritName, " ", round(OutputsCrit$CritValue, 4), "\\n", sep = "")) } \author{ -Laurent Coron (December 2013) +Laurent Coron, Audrey Valéry, Claude Michel, Charles Perrin, Raji Pushpalatha, Nicolas Le Moine, Vazken Andréassian (December 2013) } \references{ Pushpalatha, R., C. Perrin, N. Le Moine, T. Mathevet and V. Andréassian (2011), diff --git a/man/RunModel_GR1A.Rd b/man/RunModel_GR1A.Rd index 69a1952d..29593df9 100644 --- a/man/RunModel_GR1A.Rd +++ b/man/RunModel_GR1A.Rd @@ -12,72 +12,74 @@ RunModel_GR1A(InputsModel, RunOptions, Param) \item{RunOptions}{[object of class \emph{RunOptions}] see \code{\link{CreateRunOptions}} for details} -\item{Param}{[numeric] vector of 4 parameters +\item{Param}{[numeric] vector of 1 parameter \tabular{ll}{ -GR1A X1 \tab model parameter [mm] \cr +GR1A X1 \tab model parameter [-] \cr }} } \value{ [list] list containing the function outputs organised as follows: \tabular{ll}{ - \emph{$DatesR } \tab [POSIXlt] series of dates \cr - \emph{$PotEvap } \tab [numeric] series of input potential evapotranspiration [mm/h] \cr - \emph{$Precip } \tab [numeric] series of input total precipitation [mm/h] \cr - \emph{$Qsim } \tab [numeric] series of Qsim [mm/h] \cr + \emph{$DatesR } \tab [POSIXlt] series of dates \cr + \emph{$PotEvap } \tab [numeric] series of input potential evapotranspiration [mm/y] \cr + \emph{$Precip } \tab [numeric] series of input total precipitation [mm/y] \cr + \emph{$Qsim } \tab [numeric] series of Qsim [mm/y] \cr + \emph{$StateEnd} \tab [numeric] states at the end of the run (NULL) [-] \cr } (refer to the provided references or to the package source code for further details on these model outputs) } \description{ -Function which performs a single run for the GR1A yearly lumped model. +Function which performs a single run for the GR1A annual lumped model over the test period. } \details{ For further details on the model, see the references section. For further details on the argument structures and initialisation options, see \code{\link{CreateRunOptions}}. } \examples{ -## load of catchment data -require(airGR) +## loading catchment data +library(airGR) data(L0123001) -## conversion of example data from daily to yearly time-step -TabSeries <- data.frame(BasinObs$DatesR,BasinObs$P,BasinObs$E,BasinObs$T,BasinObs$Qmm) +## conversion of example data from daily to yearly time step +TabSeries <- data.frame(BasinObs$DatesR, BasinObs$P, BasinObs$E, BasinObs$T, BasinObs$Qmm) TimeFormat <- "daily" NewTimeFormat <- "yearly" -ConvertFun <- c("sum","sum","mean","sum") +ConvertFun <- c("sum", "sum", "mean", "sum") YearFirstMonth <- 09; -NewTabSeries <- SeriesAggreg(TabSeries=TabSeries,TimeFormat=TimeFormat, - NewTimeFormat=NewTimeFormat,ConvertFun=ConvertFun, - YearFirstMonth=YearFirstMonth) +NewTabSeries <- SeriesAggreg(TabSeries = TabSeries, TimeFormat = TimeFormat, + NewTimeFormat = NewTimeFormat, ConvertFun = ConvertFun, + YearFirstMonth = YearFirstMonth) BasinObs <- NewTabSeries -names(BasinObs) <- c("DatesR","P","E","T","Qmm") +names(BasinObs) <- c("DatesR", "P", "E", "T", "Qmm") ## preparation of the InputsModel object -InputsModel <- CreateInputsModel(FUN_MOD=RunModel_GR1A,DatesR=BasinObs$DatesR, - Precip=BasinObs$P,PotEvap=BasinObs$E) +InputsModel <- CreateInputsModel(FUN_MOD = RunModel_GR1A, DatesR = BasinObs$DatesR, + Precip = BasinObs$P, PotEvap = BasinObs$E) ## run period selection -Ind_Run <- seq(which(format(BasinObs$DatesR,format="\%Y")=="1990"), - which(format(BasinObs$DatesR,format="\%Y")=="1999")) +Ind_Run <- seq(which(format(BasinObs$DatesR, format = "\%Y")=="1990"), + which(format(BasinObs$DatesR, format = "\%Y")=="1999")) ## preparation of the RunOptions object -RunOptions <- CreateRunOptions(FUN_MOD=RunModel_GR1A,InputsModel=InputsModel,IndPeriod_Run=Ind_Run) +RunOptions <- CreateRunOptions(FUN_MOD = RunModel_GR1A, + InputsModel = InputsModel, IndPeriod_Run = Ind_Run) ## simulation Param <- c(0.840) -OutputsModel <- RunModel_GR1A(InputsModel=InputsModel,RunOptions=RunOptions,Param=Param) +OutputsModel <- RunModel_GR1A(InputsModel = InputsModel, RunOptions = RunOptions, Param = Param) ## results preview -plot_OutputsModel(OutputsModel=OutputsModel,Qobs=BasinObs$Qmm[Ind_Run]) +plot_OutputsModel(OutputsModel = OutputsModel, Qobs = BasinObs$Qmm[Ind_Run]) ## efficiency criterion: Nash-Sutcliffe Efficiency -InputsCrit <- CreateInputsCrit(FUN_CRIT=ErrorCrit_NSE,InputsModel=InputsModel, - RunOptions=RunOptions,Qobs=BasinObs$Qmm[Ind_Run]) -OutputsCrit <- ErrorCrit_NSE(InputsCrit=InputsCrit,OutputsModel=OutputsModel) -cat(paste(" Crit ",OutputsCrit$CritName," ",round(OutputsCrit$CritValue,4),"\\n",sep="")) +InputsCrit <- CreateInputsCrit(FUN_CRIT = ErrorCrit_NSE, InputsModel = InputsModel, + RunOptions = RunOptions, Qobs = BasinObs$Qmm[Ind_Run]) +OutputsCrit <- ErrorCrit_NSE(InputsCrit = InputsCrit, OutputsModel = OutputsModel) +cat(paste(" Crit ", OutputsCrit$CritName, " ", round(OutputsCrit$CritValue, 4), "\\n", sep = "")) } \author{ -Laurent Coron (March 2015) +Laurent Coron, Claude Michel (March 2015) } \references{ Mouelhi S. (2003), diff --git a/man/RunModel_GR2M.Rd b/man/RunModel_GR2M.Rd index f22cdbd8..194f35d1 100644 --- a/man/RunModel_GR2M.Rd +++ b/man/RunModel_GR2M.Rd @@ -12,83 +12,73 @@ RunModel_GR2M(InputsModel, RunOptions, Param) \item{RunOptions}{[object of class \emph{RunOptions}] see \code{\link{CreateRunOptions}} for details} -\item{Param}{[numeric] vector of 4 parameters +\item{Param}{[numeric] vector of 2 parameters \tabular{ll}{ GR2M X1 \tab production store capacity [mm] \cr -GR2M X2 \tab groundwater exchange coefficient [mm/month] \cr +GR2M X2 \tab groundwater exchange coefficient [-] \cr }} } \value{ [list] list containing the function outputs organised as follows: \tabular{ll}{ - \emph{$DatesR } \tab [POSIXlt] series of dates \cr - \emph{$PotEvap } \tab [numeric] series of input potential evapotranspiration [mm/h] \cr - \emph{$Precip } \tab [numeric] series of input total precipitation [mm/h] \cr - \emph{$Prod } \tab [numeric] series of production store level (X(2)) [mm] \cr - \emph{$AE } \tab [numeric] series of actual evapotranspiration [mm/h] \cr - \emph{$Perc } \tab [numeric] series of percolation (PERC) [mm/h] \cr - \emph{$PR } \tab [numeric] series of PR=PN-PS+PERC [mm/h] \cr - \emph{$Q9 } \tab [numeric] series of HU1 outflow (Q9) [mm/h] \cr - \emph{$Q1 } \tab [numeric] series of HU2 outflow (Q1) [mm/h] \cr - \emph{$Rout } \tab [numeric] series of routing store level (X(1)) [mm] \cr - \emph{$Exch } \tab [numeric] series of potential semi-exchange between catchments [mm/h] \cr - \emph{$AExch } \tab [numeric] series of actual exchange between catchments (1+2) [mm/h] \cr - \emph{$QR } \tab [numeric] series of routing store outflow (QR) [mm/h] \cr - \emph{$QD } \tab [numeric] series of direct flow from HU2 after exchange (QD) [mm/h] \cr - \emph{$Qsim } \tab [numeric] series of Qsim [mm/h] \cr - \emph{$StateEnd} \tab [numeric] states at the end of the run (res. levels, HU1 levels, HU2 levels) [mm] \cr + \emph{$DatesR } \tab [POSIXlt] series of dates \cr + \emph{$PotEvap } \tab [numeric] series of input potential evapotranspiration [mm/month] \cr + \emph{$Precip } \tab [numeric] series of input total precipitation [mm/month] \cr + \emph{$Qsim } \tab [numeric] series of Qsim [mm/month] \cr + \emph{$StateEnd} \tab [numeric] states at the end of the run (production store level and routing store level) [mm] \cr } (refer to the provided references or to the package source code for further details on these model outputs) } \description{ -Function which performs a single run for the GR2M monthly lumped model. +Function which performs a single run for the GR2M monthly lumped model over the test period. } \details{ For further details on the model, see the references section. For further details on the argument structures and initialisation options, see \code{\link{CreateRunOptions}}. } \examples{ -## load of catchment data -require(airGR) +## loading catchment data +library(airGR) data(L0123001) -## conversion of example data from daily to monthly time-step -TabSeries <- data.frame(BasinObs$DatesR,BasinObs$P,BasinObs$E,BasinObs$T,BasinObs$Qmm) +## conversion of example data from daily to monthly time step +TabSeries <- data.frame(BasinObs$DatesR, BasinObs$P, BasinObs$E, BasinObs$T, BasinObs$Qmm) TimeFormat <- "daily" NewTimeFormat <- "monthly" -ConvertFun <- c("sum","sum","mean","sum") -NewTabSeries <- SeriesAggreg(TabSeries=TabSeries,TimeFormat=TimeFormat, - NewTimeFormat=NewTimeFormat,ConvertFun=ConvertFun) +ConvertFun <- c("sum", "sum", "mean", "sum") +NewTabSeries <- SeriesAggreg(TabSeries = TabSeries, TimeFormat = TimeFormat, + NewTimeFormat = NewTimeFormat, ConvertFun = ConvertFun) BasinObs <- NewTabSeries -names(BasinObs) <- c("DatesR","P","E","T","Qmm") +names(BasinObs) <- c("DatesR", "P", "E", "T", "Qmm") ## preparation of the InputsModel object -InputsModel <- CreateInputsModel(FUN_MOD=RunModel_GR2M,DatesR=BasinObs$DatesR, - Precip=BasinObs$P,PotEvap=BasinObs$E) +InputsModel <- CreateInputsModel(FUN_MOD = RunModel_GR2M, DatesR = BasinObs$DatesR, + Precip = BasinObs$P, PotEvap = BasinObs$E) ## run period selection -Ind_Run <- seq(which(format(BasinObs$DatesR,format="\%m/\%Y")=="01/1990"), - which(format(BasinObs$DatesR,format="\%m/\%Y")=="12/1999")) +Ind_Run <- seq(which(format(BasinObs$DatesR, format = "\%m/\%Y")=="01/1990"), + which(format(BasinObs$DatesR, format = "\%m/\%Y")=="12/1999")) ## preparation of the RunOptions object -RunOptions <- CreateRunOptions(FUN_MOD=RunModel_GR2M,InputsModel=InputsModel,IndPeriod_Run=Ind_Run) +RunOptions <- CreateRunOptions(FUN_MOD = RunModel_GR2M, + InputsModel = InputsModel, IndPeriod_Run = Ind_Run) ## simulation -Param <- c(265.072,1.040) -OutputsModel <- RunModel_GR2M(InputsModel=InputsModel,RunOptions=RunOptions,Param=Param) +Param <- c(265.072, 1.040) +OutputsModel <- RunModel_GR2M(InputsModel = InputsModel, RunOptions = RunOptions, Param = Param) ## results preview -plot_OutputsModel(OutputsModel=OutputsModel,Qobs=BasinObs$Qmm[Ind_Run]) +plot_OutputsModel(OutputsModel = OutputsModel, Qobs = BasinObs$Qmm[Ind_Run]) ## efficiency criterion: Nash-Sutcliffe Efficiency -InputsCrit <- CreateInputsCrit(FUN_CRIT=ErrorCrit_NSE,InputsModel=InputsModel, - RunOptions=RunOptions,Qobs=BasinObs$Qmm[Ind_Run]) -OutputsCrit <- ErrorCrit_NSE(InputsCrit=InputsCrit,OutputsModel=OutputsModel) -cat(paste(" Crit ",OutputsCrit$CritName," ",round(OutputsCrit$CritValue,4),"\\n",sep="")) +InputsCrit <- CreateInputsCrit(FUN_CRIT = ErrorCrit_NSE, InputsModel = InputsModel, + RunOptions = RunOptions, Qobs = BasinObs$Qmm[Ind_Run]) +OutputsCrit <- ErrorCrit_NSE(InputsCrit = InputsCrit, OutputsModel = OutputsModel) +cat(paste(" Crit ", OutputsCrit$CritName, " ", round(OutputsCrit$CritValue, 4), "\\n", sep = "")) } \author{ -Laurent Coron (March 2015) +Laurent Coron, Claude Michel, Safouane Mouelhi (March 2015) } \references{ Mouelhi S. (2003), diff --git a/man/RunModel_GR4H.Rd b/man/RunModel_GR4H.Rd index 52132060..4c78262f 100644 --- a/man/RunModel_GR4H.Rd +++ b/man/RunModel_GR4H.Rd @@ -26,19 +26,19 @@ GR4H X4 \tab unit hydrograph time constant [h] \emph{$DatesR } \tab [POSIXlt] series of dates \cr \emph{$PotEvap } \tab [numeric] series of input potential evapotranspiration [mm/h] \cr \emph{$Precip } \tab [numeric] series of input total precipitation [mm/h] \cr - \emph{$Prod } \tab [numeric] series of production store level (X(2)) [mm] \cr + \emph{$Prod } \tab [numeric] series of production store level [mm] \cr \emph{$AE } \tab [numeric] series of actual evapotranspiration [mm/h] \cr \emph{$Perc } \tab [numeric] series of percolation (PERC) [mm/h] \cr \emph{$PR } \tab [numeric] series of PR=PN-PS+PERC [mm/h] \cr - \emph{$Q9 } \tab [numeric] series of HU1 outflow (Q9) [mm/h] \cr - \emph{$Q1 } \tab [numeric] series of HU2 outflow (Q1) [mm/h] \cr - \emph{$Rout } \tab [numeric] series of routing store level (X(1)) [mm] \cr + \emph{$Q9 } \tab [numeric] series of UH1 outflow (Q9) [mm/h] \cr + \emph{$Q1 } \tab [numeric] series of UH2 outflow (Q1) [mm/h] \cr + \emph{$Rout } \tab [numeric] series of routing store level [mm] \cr \emph{$Exch } \tab [numeric] series of potential semi-exchange between catchments [mm/h] \cr \emph{$AExch } \tab [numeric] series of actual exchange between catchments (1+2) [mm/h] \cr \emph{$QR } \tab [numeric] series of routing store outflow (QR) [mm/h] \cr - \emph{$QD } \tab [numeric] series of direct flow from HU2 after exchange (QD) [mm/h] \cr + \emph{$QD } \tab [numeric] series of direct flow from UH2 after exchange (QD) [mm/h] \cr \emph{$Qsim } \tab [numeric] series of Qsim [mm/h] \cr - \emph{$StateEnd} \tab [numeric] states at the end of the run (res. levels, HU1 levels, HU2 levels) [mm] \cr + \emph{$StateEnd} \tab [numeric] states at the end of the run (res. levels, UH1 levels, UH2 levels) [mm] \cr } (refer to the provided references or to the package source code for further details on these model outputs) } @@ -85,7 +85,9 @@ Laurent Coron (July 2014) \references{ Mathevet, T. (2005), Quels modèles pluie-débit globaux pour le pas de temps horaire ? Développement empirique et comparaison de modèles sur un large échantillon de bassins versants, - PhD thesis (in French), ENGREF - Cemagref (Antony), Paris, France. + PhD thesis (in French), ENGREF - Cemagref (Antony), Paris, France. \cr +Le Moine, N. (2008), Le bassin versant de surface vu par le souterrain : une voie d'amélioration des performances + et du réalisme des modèles pluie-débit ?, PhD thesis (french), UPMC, Paris, France. \cr } \seealso{ \code{\link{RunModel_GR4J}}, diff --git a/man/RunModel_GR4J.Rd b/man/RunModel_GR4J.Rd index f3f39373..4f892436 100644 --- a/man/RunModel_GR4J.Rd +++ b/man/RunModel_GR4J.Rd @@ -26,61 +26,62 @@ GR4J X4 \tab unit hydrograph time constant [d] \emph{$DatesR } \tab [POSIXlt] series of dates \cr \emph{$PotEvap } \tab [numeric] series of input potential evapotranspiration [mm/d] \cr \emph{$Precip } \tab [numeric] series of input total precipitation [mm/d] \cr - \emph{$Prod } \tab [numeric] series of production store level (X(2)) [mm] \cr + \emph{$Prod } \tab [numeric] series of production store level [mm] \cr \emph{$AE } \tab [numeric] series of actual evapotranspiration [mm/d] \cr \emph{$Perc } \tab [numeric] series of percolation (PERC) [mm/d] \cr \emph{$PR } \tab [numeric] series of PR=PN-PS+PERC [mm/d] \cr - \emph{$Q9 } \tab [numeric] series of HU1 outflow (Q9) [mm/d] \cr - \emph{$Q1 } \tab [numeric] series of HU2 outflow (Q1) [mm/d] \cr - \emph{$Rout } \tab [numeric] series of routing store level (X(1)) [mm] \cr + \emph{$Q9 } \tab [numeric] series of UH1 outflow (Q9) [mm/d] \cr + \emph{$Q1 } \tab [numeric] series of UH2 outflow (Q1) [mm/d] \cr + \emph{$Rout } \tab [numeric] series of routing store level [mm] \cr \emph{$Exch } \tab [numeric] series of potential semi-exchange between catchments [mm/d] \cr \emph{$AExch } \tab [numeric] series of actual exchange between catchments (1+2) [mm/d] \cr \emph{$QR } \tab [numeric] series of routing store outflow (QR) [mm/d] \cr - \emph{$QD } \tab [numeric] series of direct flow from HU2 after exchange (QD) [mm/d] \cr + \emph{$QD } \tab [numeric] series of direct flow from UH2 after exchange (QD) [mm/d] \cr \emph{$Qsim } \tab [numeric] series of Qsim [mm/d] \cr - \emph{$StateEnd} \tab [numeric] states at the end of the run (res. levels, HU1 levels, HU2 levels) [mm] \cr + \emph{$StateEnd} \tab [numeric] states at the end of the run (res. levels, UH1 levels, UH2 levels) [mm] \cr } (refer to the provided references or to the package source code for further details on these model outputs) } \description{ -Function which performs a single run for the GR4J daily lumped model. +Function which performs a single run for the GR4J daily lumped model over the test period. } \details{ For further details on the model, see the references section. For further details on the argument structures and initialisation options, see \code{\link{CreateRunOptions}}. } \examples{ -## load of catchment data -require(airGR) +## loading catchment data +library(airGR) data(L0123001) ## preparation of the InputsModel object -InputsModel <- CreateInputsModel(FUN_MOD=RunModel_GR4J,DatesR=BasinObs$DatesR, - Precip=BasinObs$P,PotEvap=BasinObs$E) +InputsModel <- CreateInputsModel(FUN_MOD = RunModel_GR4J, DatesR = BasinObs$DatesR, + Precip = BasinObs$P, PotEvap = BasinObs$E) ## run period selection -Ind_Run <- seq(which(format(BasinObs$DatesR,format="\%d/\%m/\%Y \%H:\%M")=="01/01/1990 00:00"), - which(format(BasinObs$DatesR,format="\%d/\%m/\%Y \%H:\%M")=="31/12/1999 00:00")) +Ind_Run <- seq(which(format(BasinObs$DatesR, format = "\%d/\%m/\%Y \%H:\%M")=="01/01/1990 00:00"), + which(format(BasinObs$DatesR, format = "\%d/\%m/\%Y \%H:\%M")=="31/12/1999 00:00")) ## preparation of the RunOptions object -RunOptions <- CreateRunOptions(FUN_MOD=RunModel_GR4J,InputsModel=InputsModel,IndPeriod_Run=Ind_Run) +RunOptions <- CreateRunOptions(FUN_MOD = RunModel_GR4J, + InputsModel = InputsModel, IndPeriod_Run = Ind_Run) ## simulation -Param <- c(257.238,1.012,88.235,2.208) -OutputsModel <- RunModel_GR4J(InputsModel=InputsModel,RunOptions=RunOptions,Param=Param) +Param <- c(257.238, 1.012, 88.235, 2.208) +OutputsModel <- RunModel_GR4J(InputsModel = InputsModel, RunOptions = RunOptions, Param = Param) ## results preview -plot_OutputsModel(OutputsModel=OutputsModel,Qobs=BasinObs$Qmm[Ind_Run]) +plot_OutputsModel(OutputsModel = OutputsModel, Qobs = BasinObs$Qmm[Ind_Run]) ## efficiency criterion: Nash-Sutcliffe Efficiency -InputsCrit <- CreateInputsCrit(FUN_CRIT=ErrorCrit_NSE,InputsModel=InputsModel, - RunOptions=RunOptions,Qobs=BasinObs$Qmm[Ind_Run]) -OutputsCrit <- ErrorCrit_NSE(InputsCrit=InputsCrit,OutputsModel=OutputsModel) -cat(paste(" Crit ",OutputsCrit$CritName," ",round(OutputsCrit$CritValue,4),"\\n",sep="")) +InputsCrit <- CreateInputsCrit(FUN_CRIT = ErrorCrit_NSE, InputsModel = InputsModel, + RunOptions = RunOptions, Qobs = BasinObs$Qmm[Ind_Run]) +OutputsCrit <- ErrorCrit_NSE(InputsCrit = InputsCrit, OutputsModel = OutputsModel) +cat(paste(" Crit ", OutputsCrit$CritName, " ", round(OutputsCrit$CritValue, 4), "\\n", sep = "")) } \author{ -Laurent Coron (December 2013) +Laurent Coron, Claude Michel, Charles Perrin (December 2013) } \references{ Perrin, C., C. Michel and V. Andréassian (2003), diff --git a/man/RunModel_GR5J.Rd b/man/RunModel_GR5J.Rd index 99510f4e..7e9fe58a 100644 --- a/man/RunModel_GR5J.Rd +++ b/man/RunModel_GR5J.Rd @@ -15,10 +15,10 @@ RunModel_GR5J(InputsModel, RunOptions, Param) \item{Param}{[numeric] vector of 5 parameters \tabular{ll}{ GR5J X1 \tab production store capacity [mm] \cr -GR5J X2 \tab intercatchment exchange coefficient 1 [mm/d] \cr +GR5J X2 \tab intercatchment exchange coefficient [mm/d] \cr GR5J X3 \tab routing store capacity [mm] \cr GR5J X4 \tab unit hydrograph time constant [d] \cr -GR5J X5 \tab intercatchment exchange coefficient 2 [-] \cr +GR5J X5 \tab intercatchment exchange threshold [-] \cr }} } \value{ @@ -27,66 +27,68 @@ GR5J X5 \tab intercatchment exchange coefficient 2 [-] \emph{$DatesR } \tab [POSIXlt] series of dates \cr \emph{$PotEvap } \tab [numeric] series of input potential evapotranspiration [mm/d] \cr \emph{$Precip } \tab [numeric] series of input total precipitation [mm/d] \cr - \emph{$Prod } \tab [numeric] series of production store level (X(2)) [mm] \cr + \emph{$Prod } \tab [numeric] series of production store level [mm] \cr \emph{$AE } \tab [numeric] series of actual evapotranspiration [mm/d] \cr \emph{$Perc } \tab [numeric] series of percolation (PERC) [mm/d] \cr \emph{$PR } \tab [numeric] series of PR=PN-PS+PERC [mm/d] \cr - \emph{$Q9 } \tab [numeric] series of HU1 outflow (Q9) [mm/d] \cr - \emph{$Q1 } \tab [numeric] series of HU2 outflow (Q1) [mm/d] \cr - \emph{$Rout } \tab [numeric] series of routing store level (X(1)) [mm] \cr + \emph{$Q9 } \tab [numeric] series of UH1 outflow (Q9) [mm/d] \cr + \emph{$Q1 } \tab [numeric] series of UH2 outflow (Q1) [mm/d] \cr + \emph{$Rout } \tab [numeric] series of routing store level [mm] \cr \emph{$Exch } \tab [numeric] series of potential semi-exchange between catchments [mm/d] \cr \emph{$AExch } \tab [numeric] series of actual exchange between catchments (1+2) [mm/d] \cr \emph{$QR } \tab [numeric] series of routing store outflow (QR) [mm/d] \cr - \emph{$QD } \tab [numeric] series of direct flow from HU2 after exchange (QD) [mm/d] \cr + \emph{$QD } \tab [numeric] series of direct flow from UH2 after exchange (QD) [mm/d] \cr \emph{$Qsim } \tab [numeric] series of Qsim [mm/d] \cr - \emph{$StateEnd} \tab [numeric] states at the end of the run (res. levels, HU1 levels, HU2 levels) [mm] \cr + \emph{$StateEnd} \tab [numeric] states at the end of the run (res. levels, UH1 levels, UH2 levels) [mm] \cr } (refer to the provided references or to the package source code for further details on these model outputs) } \description{ -Function which performs a single run for the GR5J daily lumped model. +Function which performs a single run for the GR5J daily lumped model over the test period. } \details{ For further details on the model, see the references section. For further details on the argument structures and initialisation options, see \code{\link{CreateRunOptions}}. } \examples{ -## load of catchment data -require(airGR) +## loading catchment data +library(airGR) data(L0123001) ## preparation of the InputsModel object -InputsModel <- CreateInputsModel(FUN_MOD=RunModel_GR5J,DatesR=BasinObs$DatesR, - Precip=BasinObs$P,PotEvap=BasinObs$E) +InputsModel <- CreateInputsModel(FUN_MOD = RunModel_GR5J, DatesR = BasinObs$DatesR, + Precip = BasinObs$P, PotEvap = BasinObs$E) ## run period selection -Ind_Run <- seq(which(format(BasinObs$DatesR,format="\%d/\%m/\%Y \%H:\%M")=="01/01/1990 00:00"), - which(format(BasinObs$DatesR,format="\%d/\%m/\%Y \%H:\%M")=="31/12/1999 00:00")) +Ind_Run <- seq(which(format(BasinObs$DatesR, format = "\%d/\%m/\%Y \%H:\%M")=="01/01/1990 00:00"), + which(format(BasinObs$DatesR, format = "\%d/\%m/\%Y \%H:\%M")=="31/12/1999 00:00")) ## preparation of the RunOptions object -RunOptions <- CreateRunOptions(FUN_MOD=RunModel_GR5J,InputsModel=InputsModel,IndPeriod_Run=Ind_Run) +RunOptions <- CreateRunOptions(FUN_MOD = RunModel_GR5J, + InputsModel = InputsModel, IndPeriod_Run = Ind_Run) ## simulation -Param <- c(245.918,1.027,90.017,2.198,0.434) -OutputsModel <- RunModel_GR5J(InputsModel=InputsModel,RunOptions=RunOptions,Param=Param) +Param <- c(245.918, 1.027, 90.017, 2.198, 0.434) +OutputsModel <- RunModel_GR5J(InputsModel = InputsModel, + RunOptions = RunOptions, Param = Param) ## results preview -plot_OutputsModel(OutputsModel=OutputsModel,Qobs=BasinObs$Qmm[Ind_Run]) +plot_OutputsModel(OutputsModel = OutputsModel, Qobs = BasinObs$Qmm[Ind_Run]) ## efficiency criterion: Nash-Sutcliffe Efficiency -InputsCrit <- CreateInputsCrit(FUN_CRIT=ErrorCrit_NSE,InputsModel=InputsModel, - RunOptions=RunOptions,Qobs=BasinObs$Qmm[Ind_Run]) -OutputsCrit <- ErrorCrit_NSE(InputsCrit=InputsCrit,OutputsModel=OutputsModel) -cat(paste(" Crit ",OutputsCrit$CritName," ",round(OutputsCrit$CritValue,4),"\\n",sep="")) +InputsCrit <- CreateInputsCrit(FUN_CRIT = ErrorCrit_NSE, InputsModel = InputsModel, + RunOptions = RunOptions, Qobs = BasinObs$Qmm[Ind_Run]) +OutputsCrit <- ErrorCrit_NSE(InputsCrit = InputsCrit, OutputsModel = OutputsModel) +cat(paste(" Crit ", OutputsCrit$CritName, " ", round(OutputsCrit$CritValue, 4), "\\n", sep = "")) } \author{ -Laurent Coron (December 2013) +Laurent Coron, Claude Michel, Nicolas Le Moine (December 2013) } \references{ Le Moine, N. (2008), Le bassin versant de surface vu par le souterrain : une voie d'amélioration des performances et du réalisme des modèles pluie-débit ?, PhD thesis (french), UPMC, Paris, France. \cr - Pushpalatha, R., C. Perrin, N. Le Moine, T. Mathevet, and V. Andréassian (2011), +Pushpalatha, R., C. Perrin, N. Le Moine, T. Mathevet, and V. Andréassian (2011), A downward structural sensitivity analysis of hydrological models to improve low-flow simulation, Journal of Hydrology, 411(1-2), 66-76, doi:10.1016/j.jhydrol.2011.09.034. \cr } diff --git a/man/RunModel_GR6J.Rd b/man/RunModel_GR6J.Rd index 5e075d97..c342bf05 100644 --- a/man/RunModel_GR6J.Rd +++ b/man/RunModel_GR6J.Rd @@ -15,11 +15,11 @@ RunModel_GR6J(InputsModel, RunOptions, Param) \item{Param}{[numeric] vector of 6 parameters \tabular{ll}{ GR6J X1 \tab production store capacity [mm] \cr -GR6J X2 \tab intercatchment exchange coefficient 1 [mm/d] \cr +GR6J X2 \tab intercatchment exchange coefficient [mm/d] \cr GR6J X3 \tab routing store capacity [mm] \cr GR6J X4 \tab unit hydrograph time constant [d] \cr -GR6J X5 \tab intercatchment exchange coefficient 2 [-] \cr -GR6J X6 \tab coefficient for emptying exponential store [-] \cr +GR6J X5 \tab intercatchment exchange threshold [-] \cr +GR6J X6 \tab coefficient for emptying exponential store [mm] \cr }} } \value{ @@ -28,63 +28,64 @@ GR6J X6 \tab coefficient for emptying exponential store [-] \emph{$DatesR } \tab [POSIXlt] series of dates \cr \emph{$PotEvap } \tab [numeric] series of input potential evapotranspiration [mm/d] \cr \emph{$Precip } \tab [numeric] series of input total precipitation [mm/d] \cr - \emph{$Prod } \tab [numeric] series of production store level (X(2)) [mm] \cr + \emph{$Prod } \tab [numeric] series of production store level [mm] \cr \emph{$AE } \tab [numeric] series of actual evapotranspiration [mm/d] \cr \emph{$Perc } \tab [numeric] series of percolation (PERC) [mm/d] \cr \emph{$PR } \tab [numeric] series of PR=PN-PS+PERC [mm/d] \cr - \emph{$Q9 } \tab [numeric] series of HU1 outflow (Q9) [mm/d] \cr - \emph{$Q1 } \tab [numeric] series of HU2 outflow (Q1) [mm/d] \cr - \emph{$Rout } \tab [numeric] series of routing store level (X(1)) [mm] \cr + \emph{$Q9 } \tab [numeric] series of UH1 outflow (Q9) [mm/d] \cr + \emph{$Q1 } \tab [numeric] series of UH2 outflow (Q1) [mm/d] \cr + \emph{$Rout } \tab [numeric] series of routing store level [mm] \cr \emph{$Exch } \tab [numeric] series of potential semi-exchange between catchments [mm/d] \cr \emph{$AExch } \tab [numeric] series of actual exchange between catchments (1+2) [mm/d] \cr \emph{$QR } \tab [numeric] series of routing store outflow (QR) [mm/d] \cr \emph{$QR1 } \tab [numeric] series of exponential store outflow (QR1) [mm/d] \cr - \emph{$Exp } \tab [numeric] series of exponential store level (X(6)) (negative) [mm] \cr - \emph{$QD } \tab [numeric] series of direct flow from HU2 after exchange (QD) [mm/d] \cr + \emph{$Exp } \tab [numeric] series of exponential store level (negative) [mm] \cr + \emph{$QD } \tab [numeric] series of direct flow from UH2 after exchange (QD) [mm/d] \cr \emph{$Qsim } \tab [numeric] series of Qsim [mm/d] \cr - \emph{$StateEnd} \tab [numeric] states at the end of the run (res. levels, HU1 levels, HU2 levels) [mm] \cr + \emph{$StateEnd} \tab [numeric] states at the end of the run (res. levels, UH1 levels, UH2 levels) [mm] \cr } (refer to the provided references or to the package source code for further details on these model outputs) } \description{ -Function which performs a single run for the GR6J daily lumped model. +Function which performs a single run for the GR6J daily lumped model over the test period. } \details{ For further details on the model, see the references section. For further details on the argument structures and initialisation options, see \code{\link{CreateRunOptions}}. } \examples{ -## load of catchment data -require(airGR) +## loading catchment data +library(airGR) data(L0123001) ## preparation of the InputsModel object -InputsModel <- CreateInputsModel(FUN_MOD=RunModel_GR6J,DatesR=BasinObs$DatesR, - Precip=BasinObs$P,PotEvap=BasinObs$E) +InputsModel <- CreateInputsModel(FUN_MOD = RunModel_GR6J, DatesR = BasinObs$DatesR, + Precip = BasinObs$P, PotEvap = BasinObs$E) ## run period selection -Ind_Run <- seq(which(format(BasinObs$DatesR,format="\%d/\%m/\%Y \%H:\%M")=="01/01/1990 00:00"), - which(format(BasinObs$DatesR,format="\%d/\%m/\%Y \%H:\%M")=="31/12/1999 00:00")) +Ind_Run <- seq(which(format(BasinObs$DatesR, format = "\%d/\%m/\%Y \%H:\%M")=="01/01/1990 00:00"), + which(format(BasinObs$DatesR, format = "\%d/\%m/\%Y \%H:\%M")=="31/12/1999 00:00")) ## preparation of the RunOptions object -RunOptions <- CreateRunOptions(FUN_MOD=RunModel_GR6J,InputsModel=InputsModel,IndPeriod_Run=Ind_Run) +RunOptions <- CreateRunOptions(FUN_MOD = RunModel_GR6J, + InputsModel = InputsModel, IndPeriod_Run = Ind_Run) ## simulation -Param <- c(242.257,0.637,53.517,2.218,0.424,4.759) -OutputsModel <- RunModel_GR6J(InputsModel=InputsModel,RunOptions=RunOptions,Param=Param) +Param <- c(242.257, 0.637, 53.517, 2.218, 0.424, 4.759) +OutputsModel <- RunModel_GR6J(InputsModel = InputsModel, RunOptions = RunOptions, Param = Param) ## results preview -plot_OutputsModel(OutputsModel=OutputsModel,Qobs=BasinObs$Qmm[Ind_Run]) +plot_OutputsModel(OutputsModel = OutputsModel, Qobs = BasinObs$Qmm[Ind_Run]) ## efficiency criterion: Nash-Sutcliffe Efficiency -InputsCrit <- CreateInputsCrit(FUN_CRIT=ErrorCrit_NSE,InputsModel=InputsModel, - RunOptions=RunOptions,Qobs=BasinObs$Qmm[Ind_Run]) -OutputsCrit <- ErrorCrit_NSE(InputsCrit=InputsCrit,OutputsModel=OutputsModel) -cat(paste(" Crit ",OutputsCrit$CritName," ",round(OutputsCrit$CritValue,4),"\\n",sep="")) +InputsCrit <- CreateInputsCrit(FUN_CRIT = ErrorCrit_NSE, InputsModel = InputsModel, + RunOptions = RunOptions, Qobs = BasinObs$Qmm[Ind_Run]) +OutputsCrit <- ErrorCrit_NSE(InputsCrit = InputsCrit, OutputsModel = OutputsModel) +cat(paste(" Crit ", OutputsCrit$CritName, " ", round(OutputsCrit$CritValue, 4), "\\n", sep = "")) } \author{ -Laurent Coron (December 2013) +Laurent Coron, Claude Michel, Charles Perrin, Raji Pushpalatha, Nicolas Le Moine (December 2013) } \references{ Pushpalatha, R., C. Perrin, N. Le Moine, T. Mathevet and V. Andréassian (2011), diff --git a/man/SeriesAggreg.Rd b/man/SeriesAggreg.Rd index 5cb9ea09..908eb422 100644 --- a/man/SeriesAggreg.Rd +++ b/man/SeriesAggreg.Rd @@ -3,7 +3,7 @@ \encoding{UTF-8} \name{SeriesAggreg} \alias{SeriesAggreg} -\title{Conversion of time series to another time-step (aggregation only)} +\title{Conversion of time series to another time step (aggregation only)} \usage{ SeriesAggreg(TabSeries, TimeFormat, NewTimeFormat, ConvertFun, YearFirstMonth = 1, quiet = FALSE) @@ -15,40 +15,40 @@ SeriesAggreg(TabSeries, TimeFormat, NewTimeFormat, ConvertFun, \item{NewTimeFormat}{[character] desired format (i.e. "hourly", "daily", "monthly" or "yearly")} -\item{ConvertFun}{[character] names of aggregation functions (e.g. for P[mm],T[deg],Q[mm] : ConvertFun=c("sum","mean","sum"))} +\item{ConvertFun}{[character] names of aggregation functions (e.g. for P[mm], T[deg], Q[mm] : ConvertFun <- c("sum", "mean", "sum"))} -\item{YearFirstMonth}{(optional) [numeric] integer used when NewTimeFormat="yearly" to set when the starting month of the year (e.g. 01 for calendar year or 09 for hydrological year starting in september)} +\item{YearFirstMonth}{(optional) [numeric] integer used when NewTimeFormat = "yearly" to set when the starting month of the year (e.g. 01 for calendar year or 09 for hydrological year starting in september)} -\item{quiet}{(optional) [boolean] boolean indicating if the function is run in quiet mode or not, default=FALSE} +\item{quiet}{(optional) [boolean] boolean indicating if the function is run in quiet mode or not, default = FALSE} } \value{ [POSIXlt+numeric] dataframe containing a vector of aggregated dates and time series values } \description{ -Conversion of time series to another time-step (aggregation only). -Warning : on the aggregated outputs, the dates correpond to the beginning ot the time-step -(e.g. for daily time-series 01/03/2005 00:00 = value for period 01/03/2005 00:00 - 01/03/2005 23:59 ) -(e.g. for monthly time-series 01/03/2005 00:00 = value for period 01/03/2005 00:00 - 31/03/2005 23:59 ) -(e.g. for yearly time-series 01/03/2005 00:00 = value for period 01/03/2005 00:00 - 28/02/2006 23:59 ) +Conversion of time series to another time step (aggregation only). \cr +Warning : on the aggregated outputs, the dates correpond to the beginning of the time step \cr +(e.g. for daily time-series 01/03/2005 00:00 = value for period 01/03/2005 00:00 - 01/03/2005 23:59) \cr +(e.g. for monthly time-series 01/03/2005 00:00 = value for period 01/03/2005 00:00 - 31/03/2005 23:59) \cr +(e.g. for yearly time-series 01/03/2005 00:00 = value for period 01/03/2005 00:00 - 28/02/2006 23:59) } \examples{ -## load of catchment data -require(airGR) +## loading catchment data +library(airGR) -## preparation of the initial time series data frame at the daily time-step +## preparation of the initial time series data frame at the daily time step data(L0123002) -TabSeries <- data.frame(BasinObs$DatesR,BasinObs$P,BasinObs$E,BasinObs$T,BasinObs$Qmm) +TabSeries <- data.frame(BasinObs$DatesR, BasinObs$P, BasinObs$E, BasinObs$T, BasinObs$Qmm) TimeFormat <- "daily" -## conversion at the monthly time-step +## conversion at the monthly time step NewTimeFormat <- "monthly" -ConvertFun <- c("sum","sum","mean","sum") -NewTabSeries <- SeriesAggreg(TabSeries=TabSeries,TimeFormat,NewTimeFormat,ConvertFun) +ConvertFun <- c("sum", "sum", "mean", "sum") +NewTabSeries <- SeriesAggreg(TabSeries = TabSeries, TimeFormat, NewTimeFormat, ConvertFun) -## conversion at the yearly time-step +## conversion at the yearly time step NewTimeFormat <- "yearly" -ConvertFun <- c("sum","sum","mean","sum") -NewTabSeries <- SeriesAggreg(TabSeries=TabSeries,TimeFormat,NewTimeFormat,ConvertFun) +ConvertFun <- c("sum", "sum", "mean", "sum") +NewTabSeries <- SeriesAggreg(TabSeries = TabSeries, TimeFormat, NewTimeFormat, ConvertFun) } \author{ diff --git a/man/TransfoParam.Rd b/man/TransfoParam.Rd index 2833b0e5..941c0ea7 100644 --- a/man/TransfoParam.Rd +++ b/man/TransfoParam.Rd @@ -10,7 +10,7 @@ TransfoParam(ParamIn, Direction, FUN_TRANSFO) \arguments{ \item{ParamIn}{[numeric] matrix of parameter sets (sets in line, parameter values in column)} -\item{Direction}{[character] direction of the transformation: use "RT" for Real->Transformed and "TR" for Transformed->Real} +\item{Direction}{[character] direction of the transformation: use "RT" for Raw->Transformed and "TR" for Transformed->Raw} \item{FUN_TRANSFO}{[function] model parameters transformation function (e.g. TransfoParam_GR4J, TransfoParam_CemaNeigeGR4J)} } @@ -18,24 +18,24 @@ TransfoParam(ParamIn, Direction, FUN_TRANSFO) \emph{ParamOut} [numeric] matrix of parameter sets (sets in line, parameter values in column) } \description{ -Function which transforms model parameters (from real to transformed parameters and vice versa) using the provided function. +Function which transforms model parameters using the provided function (from raw to transformed parameters and vice versa). } \examples{ -require(airGR) +library(airGR) -## transformation Real->Transformed for the GR4J model - Xreal <- matrix( c( 221.41, -3.63, 30.00, 1.37, - 347.23, -1.03, 60.34, 1.76, - 854.06, -0.10, 148.41, 2.34), - ncol=4,byrow=TRUE) - Xtran <- TransfoParam(ParamIn=Xreal,Direction="RT",FUN_TRANSFO=TransfoParam_GR4J) +## transformation Raw->Transformed for the GR4J model + Xraw <- matrix(c(+221.41, -3.63, +30.00, +1.37, + +347.23, -1.03, +60.34, +1.76, + +854.06, -0.10, +148.41, +2.34), + ncol = 4, byrow = TRUE) + Xtran <- TransfoParam(ParamIn = Xraw, Direction = "RT", FUN_TRANSFO = TransfoParam_GR4J) -## transformation Transformed->Real for the GR4J model - Xtran <- matrix( c( +3.60, -2.00, +3.40, -9.10, - +3.90, -0.90, +4.10, -8.70, - +4.50, -0.10, +5.00, -8.10), - ncol=4,byrow=TRUE) - Xreal <- TransfoParam(ParamIn=Xtran,Direction="TR",FUN_TRANSFO=TransfoParam_GR4J) +## transformation Transformed->Raw for the GR4J model + Xtran <- matrix(c(+3.60, -2.00, +3.40, -9.10, + +3.90, -0.90, +4.10, -8.70, + +4.50, -0.10, +5.00, -8.10), + ncol = 4, byrow = TRUE) + Xraw <- TransfoParam(ParamIn = Xtran, Direction = "TR", FUN_TRANSFO = TransfoParam_GR4J) } \author{ Laurent Coron (June 2014) diff --git a/man/TransfoParam_CemaNeige.Rd b/man/TransfoParam_CemaNeige.Rd index 3be2eb83..76621958 100644 --- a/man/TransfoParam_CemaNeige.Rd +++ b/man/TransfoParam_CemaNeige.Rd @@ -3,37 +3,37 @@ \encoding{UTF-8} \name{TransfoParam_CemaNeige} \alias{TransfoParam_CemaNeige} -\title{Transformation of the parameters from the CemaNeige module} +\title{Transformation of the parameters of the CemaNeige module} \usage{ TransfoParam_CemaNeige(ParamIn, Direction) } \arguments{ \item{ParamIn}{[numeric] matrix of parameter sets (sets in line, parameter values in column)} -\item{Direction}{[character] direction of the transformation: use "RT" for Real->Transformed and "TR" for Transformed->Real} +\item{Direction}{[character] direction of the transformation: use "RT" for Raw->Transformed and "TR" for Transformed->Raw} } \value{ \emph{ParamOut} [numeric] matrix of parameter sets (sets in line, parameter values in column) } \description{ -Function which transforms model parameters (from real to transformed parameters and vice versa). +Function which transforms model parameters of the CemaNeige module (from raw to transformed parameters and vice versa). } \examples{ -require(airGR) +library(airGR) -## transformation Real->Transformed for the CemaNeige module - Xreal <- matrix( c( 0.19, 1.73, - 0.39, 2.51, - 0.74, 4.06), - ncol=2,byrow=TRUE) - Xtran <- TransfoParam_CemaNeige(ParamIn=Xreal,Direction="RT") +## transformation Raw->Transformed for the CemaNeige module + Xraw <- matrix(c(+0.19, +1.73, + +0.39, +2.51, + +0.74, +4.06), + ncol = 2, byrow = TRUE) + Xtran <- TransfoParam_CemaNeige(ParamIn = Xraw , Direction = "RT") -## transformation Transformed->Real for the CemaNeige module - Xtran <- matrix( c( -6.26, +0.55, - -2.13, +0.92, - +4.86, +1.40) - ,ncol=2,byrow=TRUE) - Xreal <- TransfoParam_CemaNeige(ParamIn=Xtran,Direction="TR") +## transformation Transformed->Raw for the CemaNeige module + Xtran <- matrix(c(-6.26, +0.55, + -2.13, +0.92, + +4.86, +1.40), + ncol = 2, byrow = TRUE) + Xraw <- TransfoParam_CemaNeige(ParamIn = Xtran, Direction = "TR") } \author{ Laurent Coron (December 2013) diff --git a/man/TransfoParam_GR1A.Rd b/man/TransfoParam_GR1A.Rd index 994aeae6..21b6bc31 100644 --- a/man/TransfoParam_GR1A.Rd +++ b/man/TransfoParam_GR1A.Rd @@ -3,20 +3,20 @@ \encoding{UTF-8} \name{TransfoParam_GR1A} \alias{TransfoParam_GR1A} -\title{Transformation of the parameters from the GR1A model} +\title{Transformation of the parameters of the GR1A model} \usage{ TransfoParam_GR1A(ParamIn, Direction) } \arguments{ \item{ParamIn}{[numeric] matrix of parameter sets (sets in line, parameter values in column)} -\item{Direction}{[character] direction of the transformation: use "RT" for Real->Transformed and "TR" for Transformed->Real} +\item{Direction}{[character] direction of the transformation: use "RT" for Raw->Transformed and "TR" for Transformed->Raw} } \value{ \emph{ParamOut} [numeric] matrix of parameter sets (sets in line, parameter values in column) } \description{ -Function which transforms model parameters (from real to transformed parameters and vice versa). +Function which transforms model parameters of the GR1A model (from real to transformed parameters and vice versa). } \author{ Laurent Coron (March 2015) diff --git a/man/TransfoParam_GR2M.Rd b/man/TransfoParam_GR2M.Rd index 2444ee17..34c8af2f 100644 --- a/man/TransfoParam_GR2M.Rd +++ b/man/TransfoParam_GR2M.Rd @@ -3,20 +3,20 @@ \encoding{UTF-8} \name{TransfoParam_GR2M} \alias{TransfoParam_GR2M} -\title{Transformation of the parameters from the GR2M model} +\title{Transformation of the parameters of the GR2M model} \usage{ TransfoParam_GR2M(ParamIn, Direction) } \arguments{ \item{ParamIn}{[numeric] matrix of parameter sets (sets in line, parameter values in column)} -\item{Direction}{[character] direction of the transformation: use "RT" for Real->Transformed and "TR" for Transformed->Real} +\item{Direction}{[character] direction of the transformation: use "RT" for Raw->Transformed and "TR" for Transformed->Raw} } \value{ \emph{ParamOut} [numeric] matrix of parameter sets (sets in line, parameter values in column) } \description{ -Function which transforms model parameters (from real to transformed parameters and vice versa). +Function which transforms model parameters of the GR2M model (from real to transformed parameters and vice versa). } \author{ Laurent Coron (March 2015) diff --git a/man/TransfoParam_GR4H.Rd b/man/TransfoParam_GR4H.Rd index 588c361e..5ee31267 100644 --- a/man/TransfoParam_GR4H.Rd +++ b/man/TransfoParam_GR4H.Rd @@ -3,22 +3,22 @@ \encoding{UTF-8} \name{TransfoParam_GR4H} \alias{TransfoParam_GR4H} -\title{Transformation of the parameters from the GR4H model} +\title{Transformation of the parameters of the GR4H model} \usage{ TransfoParam_GR4H(ParamIn, Direction) } \arguments{ \item{ParamIn}{[numeric] matrix of parameter sets (sets in line, parameter values in column)} -\item{Direction}{[character] direction of the transformation: use "RT" for Real->Transformed and "TR" for Transformed->Real} +\item{Direction}{[character] direction of the transformation: use "RT" for Raw->Transformed and "TR" for Transformed->Raw} } \value{ \emph{ParamOut} [numeric] matrix of parameter sets (sets in line, parameter values in column) } \description{ -Function which transforms model parameters (from real to transformed parameters and vice versa). +Function which transforms model parameters of the GR4H model (from real to transformed parameters and vice versa). } \author{ -Laurent Coron (July 2014) +Laurent Coron, Claude Michel, Thibault Mathevet (July 2014) } diff --git a/man/TransfoParam_GR4J.Rd b/man/TransfoParam_GR4J.Rd index a404e7b1..1c6617fc 100644 --- a/man/TransfoParam_GR4J.Rd +++ b/man/TransfoParam_GR4J.Rd @@ -3,37 +3,37 @@ \encoding{UTF-8} \name{TransfoParam_GR4J} \alias{TransfoParam_GR4J} -\title{Transformation of the parameters from the GR4J model} +\title{Transformation of the parameters of the GR4J model} \usage{ TransfoParam_GR4J(ParamIn, Direction) } \arguments{ \item{ParamIn}{[numeric] matrix of parameter sets (sets in line, parameter values in column)} -\item{Direction}{[character] direction of the transformation: use "RT" for Real->Transformed and "TR" for Transformed->Real} +\item{Direction}{[character] direction of the transformation: use "RT" for Raw->Transformed and "TR" for Transformed->Raw} } \value{ \emph{ParamOut} [numeric] matrix of parameter sets (sets in line, parameter values in column) } \description{ -Function which transforms model parameters (from real to transformed parameters and vice versa). +Function which transforms model parameters of the GR4J model (from real to transformed parameters and vice versa). } \examples{ -require(airGR) +library(airGR) -## transformation Real->Transformed for the GR4J model - Xreal <- matrix( c( 221.41, -3.63, 30.00, 1.37, - 347.23, -1.03, 60.34, 1.76, - 854.06, -0.10, 148.41, 2.34), - ncol=4,byrow=TRUE) - Xtran <- TransfoParam_GR4J(ParamIn=Xreal,Direction="RT") +## transformation Raw->Transformed for the GR4J model + Xraw <- matrix(c(+221.41, -3.63, +30.00, +1.37, + +347.23, -1.03, +60.34, +1.76, + +854.06, -0.10, +148.41, +2.34), + ncol = 4, byrow = TRUE) + Xtran <- TransfoParam_GR4J(ParamIn = Xraw , Direction = "RT") -## transformation Transformed->Real for the GR4J model - Xtran <- matrix( c( +3.60, -2.00, +3.40, -9.10, - +3.90, -0.90, +4.10, -8.70, - +4.50, -0.10, +5.00, -8.10), - ncol=4,byrow=TRUE) - Xreal <- TransfoParam_GR4J(ParamIn=Xtran,Direction="TR") +## transformation Transformed->Raw for the GR4J model + Xtran <- matrix(c(+3.60, -2.00, +3.40, -9.10, + +3.90, -0.90, +4.10, -8.70, + +4.50, -0.10, +5.00, -8.10), + ncol = 4, byrow = TRUE) + Xraw <- TransfoParam_GR4J(ParamIn = Xtran, Direction = "TR") } \author{ Laurent Coron (December 2013) diff --git a/man/TransfoParam_GR5J.Rd b/man/TransfoParam_GR5J.Rd index 61db77b9..d0977b61 100644 --- a/man/TransfoParam_GR5J.Rd +++ b/man/TransfoParam_GR5J.Rd @@ -3,37 +3,37 @@ \encoding{UTF-8} \name{TransfoParam_GR5J} \alias{TransfoParam_GR5J} -\title{Transformation of the parameters from the GR5J model} +\title{Transformation of the parameters of the GR5J model} \usage{ TransfoParam_GR5J(ParamIn, Direction) } \arguments{ \item{ParamIn}{[numeric] matrix of parameter sets (sets in line, parameter values in column)} -\item{Direction}{[character] direction of the transformation: use "RT" for Real->Transformed and "TR" for Transformed->Real} +\item{Direction}{[character] direction of the transformation: use "RT" for Raw->Transformed and "TR" for Transformed->Raw} } \value{ \emph{ParamOut} [numeric] matrix of parameter sets (sets in line, parameter values in column) } \description{ -Function which transforms model parameters (from real to transformed parameters and vice versa). +Function which transforms model parameters of the GR5J model (from real to transformed parameters and vice versa). } \examples{ -require(airGR) +library(airGR) -## transformation Real->Transformed for the GR5J model - Xreal <- matrix( c( 221.41, -2.65, 27.11, 1.37, -0.76, - 347.23, -0.64, 60.34, 1.76, 0.30, - 854.01, -0.10, 148.41, 2.34, 0.52), - ncol=5,byrow=TRUE) - Xtran <- TransfoParam_GR5J(ParamIn=Xreal,Direction="RT") +## transformation Raw->Transformed for the GR5J model + Xraw <- matrix(c(+221.41, -2.65, +27.11, +1.37, -0.76, + +347.23, -0.64, +60.34, +1.76, +0.30, + +854.01, -0.10, +148.41, +2.34, +0.52), + ncol = 5, byrow = TRUE) + Xtran <- TransfoParam_GR5J(ParamIn = Xraw , Direction = "RT") -## transformation Transformed->Real for the GR5J model - Xtran <- matrix( c( +3.60, -1.70, +3.30, -9.10, -0.70, - +3.90, -0.60, +4.10, -8.70, +0.30, - +4.50, -0.10, +5.00, -8.10, +0.50), - ncol=5,byrow=TRUE) - Xreal <- TransfoParam_GR5J(ParamIn=Xtran,Direction="TR") +## transformation Transformed->Raw for the GR5J model + Xtran <- matrix(c(+3.60, -1.70, +3.30, -9.10, -0.70, + +3.90, -0.60, +4.10, -8.70, +0.30, + +4.50, -0.10, +5.00, -8.10, +0.50), + ncol = 5, byrow = TRUE) + Xraw <- TransfoParam_GR5J(ParamIn = Xtran, Direction = "TR") } \author{ Laurent Coron (December 2013) diff --git a/man/TransfoParam_GR6J.Rd b/man/TransfoParam_GR6J.Rd index 7ed7b7a4..cc9a490e 100644 --- a/man/TransfoParam_GR6J.Rd +++ b/man/TransfoParam_GR6J.Rd @@ -3,37 +3,37 @@ \encoding{UTF-8} \name{TransfoParam_GR6J} \alias{TransfoParam_GR6J} -\title{Transformation of the parameters from the GR6J model} +\title{Transformation of the parameters of the GR6J model} \usage{ TransfoParam_GR6J(ParamIn, Direction) } \arguments{ \item{ParamIn}{[numeric] matrix of parameter sets (sets in line, parameter values in column)} -\item{Direction}{[character] direction of the transformation: use "RT" for Real->Transformed and "TR" for Transformed->Real} +\item{Direction}{[character] direction of the transformation: use "RT" for Raw->Transformed and "TR" for Transformed->Raw} } \value{ \emph{ParamOut} [numeric] matrix of parameter sets (sets in line, parameter values in column) } \description{ -Function which transforms model parameters (from real to transformed parameters and vice versa). +Function which transforms model parameters of the GR6J model (from real to transformed parameters and vice versa). } \examples{ -require(airGR) +library(airGR) -## transformation Real->Transformed for the GR6J model - Xreal <- matrix( c( 221.41, -1.18, 27.11, 1.37, -0.18, 20.09, - 347.23, -0.52, 60.34, 1.76, 0.02, 54.60, - 854.06, 0.52, 148.41, 2.34, 0.22, 148.41), - ncol=6,byrow=TRUE) - Xtran <- TransfoParam_GR6J(ParamIn=Xreal,Direction="RT") +## transformation Raw->Transformed for the GR6J model + Xraw <- matrix(c(+221.41, -1.18, +27.11, 1.37, -0.18, +20.09, + +347.23, -0.52, +60.34, 1.76, +0.02, +54.60, + +854.06, +0.52, +148.41, 2.34, +0.22, +148.41), + ncol = 6, byrow = TRUE) + Xtran <- TransfoParam_GR6J(ParamIn = Xraw , Direction = "RT") -## transformation Transformed->Real for the GR6J model - Xtran <- matrix( c( +3.60, -1.00, +3.30, -9.10, -0.90, +3.00, - +3.90, -0.50, +4.10, -8.70, +0.10, +4.00, - +4.50, +0.50, +5.00, -8.10, +1.10, +5.00), - ncol=6,byrow=TRUE) - Xreal <- TransfoParam_GR6J(ParamIn=Xtran,Direction="TR") +## transformation Transformed->Raw for the GR6J model + Xtran <- matrix(c(+3.60, -1.00, +3.30, -9.10, -0.90, +3.00, + +3.90, -0.50, +4.10, -8.70, +0.10, +4.00, + +4.50, +0.50, +5.00, -8.10, +1.10, +5.00), + ncol = 6, byrow = TRUE) + Xraw <- TransfoParam_GR6J(ParamIn = Xtran, Direction = "TR") } \author{ Laurent Coron (December 2013) diff --git a/man/airGR.Rd b/man/airGR.Rd index 749e4138..bc1c2f89 100644 --- a/man/airGR.Rd +++ b/man/airGR.Rd @@ -2,9 +2,10 @@ \alias{airGR} \docType{package} \encoding{UTF-8} -\title{Modelling tools used at Irstea-HBAN (France), including GR4J and CemaNeige} +\title{Suite of GR hydrological models for precipitation-runoff modelling} \description{ -This package brings into R the hydrological modelling tools used at Irstea-HBAN (France), including GR4H, GR4J, GR5J, GR6J, GR2M, GR1A and CemaNeige. Each model core is coded in FORTRAN to ensure low computational time. The other package functions (i.e. mainly the calibration algorithm and the efficiency criteria) are coded in R. \cr +This package brings into R the hydrological modelling tools used at Irstea-Antony (HBAN Research Unit, France), including rainfall-runoff models (GR4H, GR4J, GR5J, GR6J, GR2M, GR1A) and a snowmelt module (Cemaneige). Each model core is coded in FORTRAN to ensure low computational time. The other package functions (i.e. mainly the calibration algorithm and the computation of the efficiency criteria) are coded in R. \cr + ##### Functions and objects ##### @@ -17,20 +18,22 @@ The package is mostly based on three families of functions: \cr In order to limit the risk of mis-use and increase the flexibility of these main functions, we imposed the structure of their arguments and defined their class. Most users will not need to worry about these imposed structures since functions are provided to prepare these arguments for them: \code{\link{CreateInputsModel}}, \code{\link{CreateRunOptions}}, \code{\link{CreateInputsCrit}}, \code{\link{CreateCalibOptions}}. However, advanced users wishing to supplement the package with their own models will need to comply with these imposed structures and refer to the package source codes to get all the specification requirements. \cr + ##### Models ##### -Three hydrological models and one snow melt and accumulation module are implemented in airGR. The snow module can also be used alone and each hydrological model can either be used alone or together with the snow module. \cr +Six hydrological models and one snow melt and accumulation module are implemented in airGR. The snow module can also be used alone or with the daily hydrological models, and each hydrological model can either be used alone or together with the snow module. \cr These models can be called within airGR using the following functions: \cr -- \code{\link{RunModel_GR4H}}: four-parameter hourly lumped conceptual model (Mathevet, 2005) \cr -- \code{\link{RunModel_GR4J}}: four-parameter daily lumped conceptual model (Perrin et al., 2003) \cr -- \code{\link{RunModel_GR5J}}: five-parameter daily lumped conceptual model (Le Moine, 2008) \cr -- \code{\link{RunModel_GR6J}}: six-parameter daily lumped conceptual model (Pushpalatha et al., 2011) \cr -- \code{\link{RunModel_GR2M}}: two-parameter monthly lumped conceptual model (Mouelhi, 2003) \cr -- \code{\link{RunModel_GR1A}}: one-parameter yearly lumped conceptual model (Mouelhi, 2003, 2006) \cr +- \code{\link{RunModel_GR4H}}: four-parameter hourly lumped hydrological model (Mathevet, 2005) \cr +- \code{\link{RunModel_GR4J}}: four-parameter daily lumped hydrological model (Perrin et al., 2003) \cr +- \code{\link{RunModel_GR5J}}: five-parameter daily lumped hydrological model (Le Moine, 2008) \cr +- \code{\link{RunModel_GR6J}}: six-parameter daily lumped hydrological model (Pushpalatha et al., 2011) \cr +- \code{\link{RunModel_GR2M}}: two-parameter monthly lumped hydrological model (Mouelhi, 2003 ; Mouelhi et al., 2006a) \cr +- \code{\link{RunModel_GR1A}}: one-parameter yearly lumped hydrological model (Mouelhi, 2003 ; Mouelhi et al., 2006b) \cr - \code{\link{RunModel_CemaNeige}}: two-parameter degree-day snow melt and accumulation daily module (Valéry et al., 2014) \cr - \code{\link{RunModel_CemaNeigeGR4J}}: combined use of GR4J and CemaNeige \cr - \code{\link{RunModel_CemaNeigeGR5J}}: combined use of GR5J and CemaNeige \cr -- \code{\link{RunModel_CemaNeigeGR6J}}: combined use of GR6J and CemaNeige +- \code{\link{RunModel_CemaNeigeGR6J}}: combined use of GR6J and CemaNeige \cr + ##### How to get started ##### @@ -39,33 +42,35 @@ To learn how to use the functions from the airGR package, it is recommended to f 2. refer to the help for \code{\link{CreateInputsModel}} to understand how the inputs of a model are prepared/organised ; \cr 3. refer to the help for \code{\link{CreateRunOptions}} to understand how the run options of a model are parametrised/organised ; \cr 4. refer to the help for \code{\link{ErrorCrit_NSE}} and \code{\link{CreateInputsCrit}} to understand how the computation of an error criterion is prepared/made ; \cr -5. refer to the help for \code{\link{Calibration_HBAN}}, run the provided example and then refer to the help for \code{\link{CreateCalibOptions}} to understand how a model calibration is prepared/made ; +5. refer to the help for \code{\link{Calibration_Michel}}, run the provided example and then refer to the help for \code{\link{CreateCalibOptions}} to understand how a model calibration is prepared/made ; \cr + ##### References ##### - Le Moine, N. (2008), Le bassin versant de surface vu par le souterrain : une voie d'amélioration des performances et du réalisme des modèles pluie-débit ?, PhD thesis (in French), UPMC - Cemagref Antony, Paris, France, 324 pp. \cr - Mathevet, T. (2005), Quels modèles pluie-débit globaux pour le pas de temps horaire ? Développement empirique et comparaison de modèles sur un large échantillon de bassins versants, PhD thesis (in French), ENGREF - Cemagref Antony, Paris, France, 463 pp. \cr - Mouelhi S. (2003), Vers une chaîne cohérente de modèles pluie-débit conceptuels globaux aux pas de temps pluriannuel, annuel, mensuel et journalier, PhD thesis (in French), ENGREF - Cemagref Antony, Paris, France, 323 pp. \cr -- Mouelhi, S., C. Michel, C. Perrin and V. Andréassian (2006), Stepwise development of a two-parameter monthly water balance model, Journal of Hydrology, 318(1-4), 200-214, doi:10.1016/j.jhydrol.2005.06.014. \cr +- Mouelhi, S., C. Michel, C. Perrin and V. Andréassian (2006a), Stepwise development of a two-parameter monthly water balance model, Journal of Hydrology, 318(1-4), 200-214, doi:10.1016/j.jhydrol.2005.06.014. \cr +Mouelhi, S., C. Michel, C. Perrin. & V. Andreassian (2006b), Linking stream flow to rainfall at the annual time step: the Manabe bucket model revisited, Journal of Hydrology, 328, 283-296, doi:10.1016/j.jhydrol.2005.12.022. \cr - Perrin, C., C. Michel and V. Andréassian (2003), Improvement of a parsimonious model for streamflow simulation, Journal of Hydrology, 279(1-4), 275-289, doi:10.1016/S0022-1694(03)00225-7. \cr - Pushpalatha, R., C. Perrin, N. Le Moine, T. Mathevet and V. Andréassian (2011), A downward structural sensitivity analysis of hydrological models to improve low-flow simulation, Journal of Hydrology, 411(1-2), 66-76, doi:10.1016/j.jhydrol.2011.09.034. \cr -- Valéry, A., V. Andréassian and C. Perrin (2014), "As simple as possible but not simpler": What is useful in a temperature-based snow-accounting routine? Part 2 - Sensitivity analysis of the Cemaneige snow accounting routine on 380 catchments, Journal of Hydrology, 517(0): 1176-1187, doi:10.1016/j.jhydrol.2014.04.058. \cr +- Valéry, A., V. Andréassian and C. Perrin (2014), "As simple as possible but not simpler": What is useful in a temperature-based snow-accounting routine? Part 2 - Sensitivity analysis of the Cemaneige snow accounting routine on 380 catchments, Journal of Hydrology, 517(0): 1176-1187, doi: 1176-1187, doi:10.1016/j.jhydrol.2014.04.058. \cr } -\details{ -\tabular{ll}{ -Package: \tab airGR\cr -Type: \tab Package\cr -Version: \tab 0.8.1.1\cr -Date: \tab 2015-11-26\cr -License: \tab GPL-2\cr -} -} -\author{ -Author: Laurent CORON \cr -Maintainer: Laurent CORON, Olivier DELAIGUE <olivier.delaigue@irstea.fr> -} +%\details{ +%\tabular{ll}{ +%Package: \tab airGR\cr +%Type: \tab Package\cr +%Version: \tab 0.8.1.1\cr +%Date: \tab 2015-11-26\cr +%License: \tab GPL-2\cr +%} +%} +%\author{ +%Author: Laurent CORON \cr +%Maintainer: Laurent CORON, Olivier DELAIGUE <olivier.delaigue@irstea.fr> +%} \keyword{package, hydrology, modelling} diff --git a/man/plot_OutputsModel.Rd b/man/plot_OutputsModel.Rd index ea88a1fd..f4089950 100644 --- a/man/plot_OutputsModel.Rd +++ b/man/plot_OutputsModel.Rd @@ -11,13 +11,13 @@ plot_OutputsModel(OutputsModel, Qobs = NULL, IndPeriod_Plot = NULL, \arguments{ \item{OutputsModel}{[object of class \emph{OutputsModel}] list of model outputs (which must at least include DatesR, Precip and Qsim) [POSIXlt, mm, mm]} -\item{Qobs}{(optional) [numeric] time series of observed flow (for the same time-steps than simulated) [mm]} +\item{Qobs}{(optional) [numeric] time series of observed flow (for the same time steps than simulated) [mm/time step]} -\item{IndPeriod_Plot}{(optional) [numeric] indices of the time-steps to be plotted (among the OutputsModel series)} +\item{IndPeriod_Plot}{(optional) [numeric] indices of the time steps to be plotted (among the OutputsModel series)} \item{BasinArea}{(optional) [numeric] basin area [km2], used to plot flow axes in m3/s} -\item{PlotChoice}{(optional) [character] choice of plots \cr (e.g. c("Precip","SnowPack","Flows","Regime","CumFreq","CorQQ")), default="all"} +\item{PlotChoice}{(optional) [character] choice of plots \cr (e.g. c("Precip", "SnowPack", "Flows", "Regime", "CumFreq", "CorQQ")), default="all"} \item{quiet}{(optional) [boolean] boolean indicating if the function is run in quiet mode or not, default=FALSE} } -- GitLab