Source

Target

Showing with 1678 additions and 661 deletions
+1678 -661
\encoding{UTF-8}
\name{Imax}
\alias{Imax}
\title{Computation of the maximum capacity of the GR5H interception store}
\description{
Function which calculates the maximal capacity of the GR5H interception store. This function compares the interception evapotranspiration from the GR5H interception store for different maximal capacity values with the interception evapotranspiration classically used in the daily GR models (e.g. GR4J). Among all the \code{TestedValues}, the value that gives the closest interception evapotranspiration flux over the whole period is kept.
}
\usage{
Imax(InputsModel, IndPeriod_Run,
TestedValues = seq(from = 0.1, to = 3, by = 0.1))
}
\arguments{
\item{InputsModel}{[object of class \emph{InputsModel}] see \code{\link{CreateInputsModel}} for details}
\item{IndPeriod_Run}{[numeric] index of period to be used for the model run [-]}
\item{TestedValues}{[numeric] vector of tested Imax values [mm]}
}
\value{
Optimal Imax value [mm].
}
\examples{
library(airGR)
## loading catchment data
data(L0123003)
## preparation of the InputsModel object
InputsModel <- CreateInputsModel(FUN_MOD = RunModel_GR5H, DatesR = BasinObs$DatesR,
Precip = BasinObs$P, PotEvap = BasinObs$E)
## run period selection
Ind_Run <- seq(which(format(BasinObs$DatesR, format = "\%Y-\%m-\%d \%H")=="2006-01-01 00"),
which(format(BasinObs$DatesR, format = "\%Y-\%m-\%d \%H")=="2006-12-31 23"))
## Imax computation
Imax <- Imax(InputsModel = InputsModel, IndPeriod_Run = Ind_Run,
TestedValues = seq(from = 0, to = 3, by = 0.2))
## preparation of the RunOptions object
RunOptions <- CreateRunOptions(FUN_MOD = RunModel_GR5H, Imax = Imax,
InputsModel = InputsModel, IndPeriod_Run = Ind_Run)
## simulation
Param <- c(X1 = 706.912, X2 = -0.163, X3 = 188.880, X4 = 2.575, X5 = 0.104)
OutputsModel <- RunModel_GR5H(InputsModel = InputsModel,
RunOptions = RunOptions, Param = Param)
## results preview
plot(OutputsModel, Qobs = BasinObs$Qmm[Ind_Run])
## efficiency criterion: Nash-Sutcliffe Efficiency
InputsCrit <- CreateInputsCrit(FUN_CRIT = ErrorCrit_NSE, InputsModel = InputsModel,
RunOptions = RunOptions, Obs = BasinObs$Qmm[Ind_Run])
OutputsCrit <- ErrorCrit_NSE(InputsCrit = InputsCrit, OutputsModel = OutputsModel)
}
\author{
Guillaume Thirel, Olivier Delaigue
}
\references{
Ficchi, A. (2017).
An adaptive hydrological model for multiple time-steps:
Diagnostics and improvements based on fluxes consistency.
PhD thesis, UPMC - Irstea Antony, Paris, France.
\cr\cr
Ficchi, A., Perrin, C. and Andréassian, V. (2019).
Hydrological modelling at multiple sub-daily time steps: model improvement via flux-matching.
Journal of Hydrology, 575, 1308-1327, \doi{10.1016/j.jhydrol.2019.05.084}.
}
\seealso{
\code{\link{RunModel_GR5H}},
\code{\link{CreateInputsModel}}, \code{\link{CreateRunOptions}}.
}
\encoding{UTF-8}
\name{PE_Oudin}
\alias{PE_Oudin}
\title{Computation of series of potential evapotranspiration at the daily or hourly time steps with Oudin's formula}
\usage{
PE_Oudin(JD, Temp, Lat, LatUnit = c("rad", "deg"),
TimeStepIn = "daily", TimeStepOut = "daily",
RunFortran = FALSE)
}
\arguments{
\item{JD}{[numeric] time series of Julian day of the year [-]; see details}
\item{Temp}{[numeric] time series of daily (or hourly) mean air temperature [°C]}
\item{Lat}{[numeric] latitude of measurement for the temperature series [radians or degrees]. Atomic vector, except if \code{RunFortran = TRUE}, it can be a vector of the same length as \code{Temp}}
\item{LatUnit}{[character] latitude unit (default = \code{"rad"} or \code{"deg"})}
\item{TimeStepIn}{[character] time step of inputs (e.g. \code{"daily"} or \code{"hourly"}, default = \code{"daily"})}
\item{TimeStepOut}{[character] time step of outputs (e.g. \code{"daily"} or \code{"hourly"}, default = \code{"daily"})}
\item{RunFortran}{[boolean] to run the code in the Fortran mode or in the R mode (default)}
}
\value{
[numeric] time series of daily potential evapotranspiration [mm/time step]
}
\description{
Function which computes PE using the formula from Oudin et al. (2005). PE can be computed at the daily time step from hourly or daily temperature and at the hourly time step with hourly or daily temperature through a disaggregation of daily PE . See details.
}
\details{
To calculate basin-wide Oudin potential evapotranspiration, it is advised, when possible, to use either station temperature or gridded temperature data to calculate PE and then average these PE values at the basin scale.
In the \code{JD} argument, the Julian day of the year of the 1st of January is equal to 1 and the 31st of December to 365 (366 in leap years). If the Julian day of the year is computed on an object of the \code{POSIXlt} class, the user has to add 1 to the returned value (e.g. \code{as.POSIXlt("2016-12-31")$yday + 1}).
When hourly temperature is provided, all the values of the same day have to be set to the same Julian day of the year (e.g. \code{as.POSIXlt("2016-12-31 00:00:00")$yday + 1} and \code{as.POSIXlt("2016-12-31 00:01:00")$yday + 1}). Each single day must be provided 24 identical Julian day values (one for each hour).
Four cases are possible:
\itemize{
\item \code{TimeStepIn = "daily"} and \code{TimeStepOut = "daily"}: this is the classical application of the Oudin et al. (2005) formula
\item \code{TimeStepIn = "daily"} and \code{TimeStepOut = "hourly"}: the daily temperature is used inside the \code{PE_Oudin} function to calculate daily PE, which is then disaggregated at the hourly time step with use of a sinusoidal function (see Lobligeois, 2014, p. 78)
\item \code{TimeStepIn = "hourly"} and \code{TimeStepOut = "daily"}: the hourly temperature is aggregated at the daily time step and the daily PE is calculated normally within \code{PE_Oudin}
\item \code{TimeStepIn = "hourly"} and \code{TimeStepOut = "hourly"}: the hourly temperature is aggregated at the daily time step, the daily PE is then calculated normally within \code{PE_Oudin}, which is finally disaggregated at the hourly time step with use of a sinusoidal function (see Lobligeois, 2014, p. 78)
}
The use of the \code{PEdaily_Oudin} corresponds to the first case of the use of \code{PE_Oudin}.
}
\examples{
library(airGR)
data(L0123001)
PotEvap <- PE_Oudin(JD = as.POSIXlt(BasinObs$DatesR)$yday + 1,
Temp = BasinObs$T,
Lat = 0.8, LatUnit = "rad")
}
\author{
Laurent Coron, Ludovic Oudin, Olivier Delaigue, Guillaume Thirel, François Bourgin
}
\references{
Oudin, L., Hervieu, F., Michel, C., Perrin, C., Andréassian, V., Anctil, F. and Loumagne, C. (2005).
Which potential evapotranspiration input for a lumped rainfall-runoff model?
Part 2 - Towards a simple and efficient potential evapotranspiration model for rainfall-runoff modelling.
Journal of Hydrology, 303(1-4), 290-306, \doi{10.1016/j.jhydrol.2004.08.026}.
\cr\cr
Lobligeois, F. (2014).
Mieux connaitre la distribution spatiale des pluies améliore-t-il la modélisation des crues ? Diagnostic sur 181 bassins versants français.
PhD thesis (in French), AgroParisTech - Irstea Antony, Paris, France.
}
\encoding{UTF-8}
\name{PEdaily_Oudin}
\alias{PEdaily_Oudin}
\title{Computation of daily series of potential evapotranspiration with Oudin's formula}
\usage{
PEdaily_Oudin(JD, Temp, LatRad, Lat, LatUnit)
}
\arguments{
\item{JD}{[numeric] time series of julian day [-]}
\item{Temp}{[numeric] time series of daily mean air temperature [°C]}
\item{LatRad}{(deprecated)[numeric] latitude of measurement for the temperature series [rad]. Please use \code{Lat} instead}
\item{Lat}{[numeric] latitude of measurement for the temperature series [radian or degrees]}
\item{LatUnit}{[character] latitude unit (default = \code{"rad"} or \code{"deg"})), default = \code{"all"}}
}
\value{
[numeric] time series of daily potential evapotranspiration [mm/d]
}
\description{
Function which computes daily PE using the formula from Oudin et al. (2005).
}
\examples{
library(airGR)
data(L0123001)
PotEvap <- PEdaily_Oudin(JD = as.POSIXlt(BasinObs$DatesR)$yday, Temp = BasinObs$T,
Lat = 0.8, LatUnit = "rad")
}
\author{
Laurent Coron, Ludovic Oudin, Olivier Delaigue
}
\references{
Oudin, L., F. Hervieu, C. Michel, C. Perrin, V. Andréassian, F. Anctil and C. Loumagne (2005),
Which potential evapotranspiration input for a lumped rainfall-runoff model?: Part 2-Towards a
simple and efficient potential evapotranspiration model for rainfall-runoff modelling, Journal of Hydrology,
303(1-4), 290-306, doi:10.1016/j.jhydrol.2004.08.026.
}
......@@ -9,31 +9,32 @@
\title{Generalist parameter sets for the GR4J model}
\format{Data frame of parameters containing four numeric vectors
\itemize{
\item {GR4J X1} {production store capacity [mm]}
\item {GR4J X2} {intercatchment exchange coefficient [mm/d]}
\item {GR4J X3} {routing store capacity [mm]}
\item {GR4J X4u} {unajusted unit hydrograph time constant [d]}
}}
\description{
These parameter sets can be used as an alternative for the grid-screening calibration procedure (i.e. first step in \code{\link{Calibration_Michel}}).
Please note that the given GR4J X4u variable does not correspond to the actual GR4J X4 parameter. As explained in Andréassian et al. (2014; section 2.1), the given GR4J X4u value has to be adjusted (rescaled) using catchment area (S) [km2] as follows: {X4 = X4u / 5.995 * S^0.3} (please note that the formula is erroneous in the publication). Please, see the example below. \cr
Please note that the given GR4J X4u variable does not correspond to the actual GR4J X4 parameter. As explained in Andréassian et al. (2014; section 2.1), the given GR4J X4u value has to be adjusted (rescaled) using catchment area (S) [km2] as follows: \eqn{X4 = X4u / 5.995 \times S^{0.3}} (please note that the formula is erroneous in the publication). Please, see the example below. \cr
As shown in Andréassian et al. (2014; figure 4), only using these parameters sets as the tested values for calibration is more efficient than a classical calibration when the amount of data is low (6 months or less).
}
\format{Data frame of parameters containing four numeric vectors:
\tabular{ll}{
GR4J X1 \tab production store capacity [mm] \cr
GR4J X2 \tab intercatchment exchange coefficient [mm/d] \cr
GR4J X3 \tab routing store capacity [mm] \cr
GR4J X4u \tab unajusted unit hydrograph time constant [d]\cr
}
}
\seealso{
\code{\link{RunModel_GR4J}}, \code{\link{Calibration_Michel}}, \code{\link{CreateCalibOptions}}.
}
\references{
Andréassian, V., F. Bourgin, L. Oudin, T. Mathevet, C. Perrin, J. Lerat, L. Coron, L. Berthet (2014).
Seeking genericity in the selection of parameter sets: impact on hydrological model efficiency.
Water Resources Research, 50(10), 8356-8366, doi: 10.1002/2013WR014761.
Andréassian, V., Bourgin, F., Oudin, L., Mathevet, T., Perrin, C., Lerat, J., Coron, L. and Berthet, L. (2014).
Seeking genericity in the selection of parameter sets: Impact on hydrological model efficiency.
Water Resources Research, 50(10), 8356-8366, \doi{10.1002/2013WR014761}.
}
......@@ -53,18 +54,18 @@ Param_Sets_GR4J$X4u <- NULL
Param_Sets_GR4J <- as.matrix(Param_Sets_GR4J)
## preparation of the InputsModel object
InputsModel <- CreateInputsModel(FUN_MOD = RunModel_GR4J, DatesR = BasinObs$DatesR,
InputsModel <- CreateInputsModel(FUN_MOD = RunModel_GR4J, DatesR = BasinObs$DatesR,
Precip = BasinObs$P, PotEvap = BasinObs$E)
## ---- calibration step
## --- calibration step
## short calibration period selection (< 6 months)
Ind_Cal <- seq(which(format(BasinObs$DatesR, format = "\%d/\%m/\%Y")=="01/01/1990"),
which(format(BasinObs$DatesR, format = "\%d/\%m/\%Y")=="28/02/1990"))
Ind_Cal <- seq(which(format(BasinObs$DatesR, format = "\%Y-\%m-\%d")=="1990-01-01"),
which(format(BasinObs$DatesR, format = "\%Y-\%m-\%d")=="1990-02-28"))
## preparation of the RunOptions object for the calibration period
RunOptions_Cal <- CreateRunOptions(FUN_MOD = RunModel_GR4J,
InputsModel = InputsModel, IndPeriod_Run = Ind_Cal)
InputsModel = InputsModel, IndPeriod_Run = Ind_Cal)
## simulation and efficiency criterion (Nash-Sutcliffe Efficiency)
## with all generalist parameter sets on the calibration period
......@@ -72,8 +73,8 @@ OutputsCrit_Loop <- apply(Param_Sets_GR4J, 1, function(Param) {
OutputsModel_Cal <- RunModel_GR4J(InputsModel = InputsModel,
RunOptions = RunOptions_Cal,
Param = Param)
InputsCrit <- CreateInputsCrit(FUN_CRIT = ErrorCrit_NSE, InputsModel = InputsModel,
RunOptions = RunOptions_Cal, Qobs = BasinObs$Qmm[Ind_Cal])
InputsCrit <- CreateInputsCrit(FUN_CRIT = ErrorCrit_NSE, InputsModel = InputsModel,
RunOptions = RunOptions_Cal, Obs = BasinObs$Qmm[Ind_Cal])
OutputsCrit <- ErrorCrit_NSE(InputsCrit = InputsCrit, OutputsModel = OutputsModel_Cal)
return(OutputsCrit$CritValue)
})
......@@ -82,11 +83,11 @@ OutputsCrit_Loop <- apply(Param_Sets_GR4J, 1, function(Param) {
Param_Best <- unlist(Param_Sets_GR4J[which.max(OutputsCrit_Loop), ])
## ---- validation step
## --- validation step
## validation period selection
Ind_Val <- seq(which(format(BasinObs$DatesR, format = "\%d/\%m/\%Y")=="01/03/1990"),
which(format(BasinObs$DatesR, format = "\%d/\%m/\%Y")=="31/12/1999"))
Ind_Val <- seq(which(format(BasinObs$DatesR, format = "\%Y-\%m-\%d")=="1990-03-01"),
which(format(BasinObs$DatesR, format = "\%Y-\%m-\%d")=="1999-12-31"))
## preparation of the RunOptions object for the validation period
RunOptions_Val <- CreateRunOptions(FUN_MOD = RunModel_GR4J,
......@@ -101,7 +102,7 @@ OutputsModel_Val <- RunModel_GR4J(InputsModel = InputsModel,
plot(OutputsModel_Val, Qobs = BasinObs$Qmm[Ind_Val])
## efficiency criterion (Nash-Sutcliffe Efficiency) on the validation period
InputsCrit_Val <- CreateInputsCrit(FUN_CRIT = ErrorCrit_NSE, InputsModel = InputsModel,
RunOptions = RunOptions_Val, Qobs = BasinObs$Qmm[Ind_Val])
InputsCrit_Val <- CreateInputsCrit(FUN_CRIT = ErrorCrit_NSE, InputsModel = InputsModel,
RunOptions = RunOptions_Val, Obs = BasinObs$Qmm[Ind_Val])
OutputsCrit_Val <- ErrorCrit_NSE(InputsCrit = InputsCrit_Val, OutputsModel = OutputsModel_Val)
}
\ No newline at end of file
}
......@@ -3,11 +3,21 @@
\name{RunModel}
\alias{RunModel}
%\alias{[.OutputsModel}
\title{Run with the provided hydrological model function}
\description{
Function which performs a single model run with the provided function over the selected period.
}
\usage{
RunModel(InputsModel, RunOptions, Param, FUN_MOD)
RunModel(InputsModel, RunOptions, Param, FUN_MOD, ...)
%
%\method{[}{OutputsModel}(x, i)
}
......@@ -16,21 +26,28 @@ RunModel(InputsModel, RunOptions, Param, FUN_MOD)
\item{RunOptions}{[object of class \emph{RunOptions}] see \code{\link{CreateRunOptions}} for details}
\item{Param}{[numeric] vector of model parameters}
\item{Param}{[numeric] vector of model parameters (See details for SD lag model)}
\item{FUN_MOD}{[function] hydrological model function (e.g. \code{\link{RunModel_GR4J}}, \code{\link{RunModel_CemaNeigeGR4J}})}
\item{...}{(optional) arguments to pass to \code{FUN_MOD}}
%
%\item{x}{[InputsModel] object of class InputsModel}
%
%\item{i}{[integer] of the indices to subset a time series or [character] names of the elements to extract}
}
\value{
[list] see \code{\link{RunModel_GR4J}} or \code{\link{RunModel_CemaNeigeGR4J}} for details
}
\value{
[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 over the selected period.
If \code{InputsModel} parameter has been created for using a semi-distributed (SD) lag model (See \code{\link{CreateInputsModel}}), the list value contains an extra item named \code{QsimDown} which is a numeric series of simulated discharge [mm/time step] related to the run-off contribution of the downstream sub-catchment.
}
\details{
If \code{InputsModel} parameter has been created for using a semi-distributed (SD) lag model (See \code{\link{CreateInputsModel}}), the first item of \code{Param} parameter should contain a constant lag parameter expressed as a velocity in m/s, parameters for the hydrological model are then shift one position to the right.
}
\examples{
library(airGR)
......@@ -39,38 +56,40 @@ library(airGR)
data(L0123001)
## preparation of the InputsModel object
InputsModel <- CreateInputsModel(FUN_MOD = RunModel_GR4J, DatesR = BasinObs$DatesR,
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")=="01/01/1990"),
which(format(BasinObs$DatesR, format = "\%d/\%m/\%Y")=="31/12/1999"))
Ind_Run <- seq(which(format(BasinObs$DatesR, format = "\%Y-\%m-\%d")=="1990-01-01"),
which(format(BasinObs$DatesR, format = "\%Y-\%m-\%d")=="1999-12-31"))
## preparation of the RunOptions object
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,
Param <- c(X1 = 734.568, X2 = -0.840, X3 = 109.809, X4 = 1.971)
OutputsModel <- RunModel(InputsModel = InputsModel,
RunOptions = RunOptions, Param = Param,
FUN_MOD = RunModel_GR4J)
## results preview
plot(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])
InputsCrit <- CreateInputsCrit(FUN_CRIT = ErrorCrit_NSE, InputsModel = InputsModel,
RunOptions = RunOptions, Obs = BasinObs$Qmm[Ind_Run])
OutputsCrit <- ErrorCrit_NSE(InputsCrit = InputsCrit, OutputsModel = OutputsModel)
}
\author{
Laurent Coron
Laurent Coron, Olivier Delaigue
}
\seealso{
\code{\link{RunModel_GR4J}}, \code{\link{RunModel_CemaNeigeGR4J}}, \code{\link{CreateInputsModel}}, \code{\link{CreateRunOptions}}, \code{\link{CreateIniStates}}.
\code{\link{RunModel_GR4J}}, \code{\link{RunModel_CemaNeigeGR4J}}, \code{\link{CreateInputsModel}},
\code{\link{CreateRunOptions}}, \code{\link{CreateIniStates}}.
}
......@@ -8,6 +8,11 @@
\title{Run with the CemaNeige snow module}
\description{
Function which performs a single run for the CemaNeige snow module at the daily or hourly time step.
}
\usage{
RunModel_CemaNeige(InputsModel, RunOptions, Param)
}
......@@ -18,41 +23,41 @@ RunModel_CemaNeige(InputsModel, RunOptions, Param)
\item{RunOptions}{[object of class \emph{RunOptions}] see \code{\link{CreateRunOptions}} for details}
\item{Param}{[numeric] vector of 2 parameters
\tabular{ll}{
CemaNeige X1 \tab weighting coefficient for snow pack thermal state [-] \cr
CemaNeige X2 \tab degree-day melt coefficient [mm/°C/d] \cr
}}
\item{Param}{[numeric] vector of 2 (or 4 parameters if \code{IsHyst = TRUE}, see \code{\link{CreateRunOptions}} for details)
\tabular{ll}{
CemaNeige X1 \tab weighting coefficient for snow pack thermal state [-] \cr
CemaNeige X2 \tab degree-day melt coefficient [mm/°C/time step] \cr
CemaNeige X3 \tab (optional) accumulation threshold [mm] (needed if \code{IsHyst = TRUE}) \cr
CemaNeige X4 \tab (optional) percentage (between 0 and 1) of annual snowfall defining the melt threshold [-] (needed if \code{IsHyst = TRUE}) \cr
}}
}
\value{
[list] list containing the function outputs organised as follows:
\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
\emph{$CemaNeigeLayers[[iLayer]]$SnowPack } \tab [numeric] series of snow pack [mm] \cr
\emph{$CemaNeigeLayers[[iLayer]]$ThermalState } \tab [numeric] series of snow pack thermal state [°C] \cr
\emph{$CemaNeigeLayers[[iLayer]]$Gratio } \tab [numeric] series of Gratio [0-1] \cr
\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{$CemaNeigeLayers[[iLayer]]$Temp } \tab [numeric] series of air temperature [°C] \cr
\emph{$StateEnd} \tab [numeric] states at the end of the run: CemaNeige states [mm & °C], \cr\tab see \code{\link{CreateIniStates}} for more details \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 daily snow module.
[list] containing the function outputs organised as follows:
\tabular{ll}{
\emph{$DatesR } \tab [POSIXlt] series of dates \cr
\emph{$CemaNeigeLayers} \tab [list] CemaNeige outputs (1 element per layer) \cr
\emph{$CemaNeigeLayers[[iLayer]]$Pliq } \tab [numeric] series of liquid precip. [mm/time step] \cr
\emph{$CemaNeigeLayers[[iLayer]]$Psol } \tab [numeric] series of solid precip. [mm/time step] \cr
\emph{$CemaNeigeLayers[[iLayer]]$SnowPack } \tab [numeric] series of snow pack (snow water equivalent) [mm] \cr
\emph{$CemaNeigeLayers[[iLayer]]$ThermalState} \tab [numeric] series of snow pack thermal state [°C] \cr
\emph{$CemaNeigeLayers[[iLayer]]$Gratio } \tab [numeric] series of Gratio [0-1] \cr
\emph{$CemaNeigeLayers[[iLayer]]$PotMelt } \tab [numeric] series of potential snow melt [mm/time step] \cr
\emph{$CemaNeigeLayers[[iLayer]]$Melt } \tab [numeric] series of actual snow melt [mm/time step] \cr
\emph{$CemaNeigeLayers[[iLayer]]$PliqAndMelt } \tab [numeric] series of liquid precip. + actual snow melt [mm/time step] \cr
\emph{$CemaNeigeLayers[[iLayer]]$Temp } \tab [numeric] series of air temperature [°C] \cr
\emph{$CemaNeigeLayers[[iLayer]]$Gthreshold } \tab [numeric] series of melt threshold [mm] \cr
\emph{$CemaNeigeLayers[[iLayer]]$Glocalmax } \tab [numeric] series of local melt threshold for hysteresis [mm] \cr
\emph{$StateEnd} \tab [numeric] states at the end of the run: CemaNeige states [mm & °C]. See \code{\link{CreateIniStates}} for more details \cr
}
Refer to the provided references or to the package source code for further details on these model outputs.
}
\details{
For further details on the model, see the references section.
The choice of the CemaNeige version (i.e. with or without hysteresis) is explained in \code{\link{CreateRunOptions}}. \cr
For further details on the model, see the references section. \cr
For further details on the argument structures and initialisation options, see \code{\link{CreateRunOptions}}.
}
......@@ -70,40 +75,65 @@ InputsModel <- CreateInputsModel(FUN_MOD = RunModel_CemaNeige, DatesR = BasinObs
NLayers = 5)
## run period selection
Ind_Run <- seq(which(format(BasinObs$DatesR, format = "\%d/\%m/\%Y")=="01/01/1990"),
which(format(BasinObs$DatesR, format = "\%d/\%m/\%Y")=="31/12/1999"))
Ind_Run <- seq(which(format(BasinObs$DatesR, format = "\%Y-\%m-\%d")=="1990-01-01"),
which(format(BasinObs$DatesR, format = "\%Y-\%m-\%d")=="1999-12-31"))
## --- original version of CemaNeige
## preparation of the RunOptions object
RunOptions <- CreateRunOptions(FUN_MOD = RunModel_CemaNeige, InputsModel = InputsModel,
IndPeriod_Run = Ind_Run)
## simulation
Param <- c(0.962, 2.249)
Param <- c(CNX1 = 0.962, CNX2 = 2.249)
OutputsModel <- RunModel_CemaNeige(InputsModel = InputsModel,
RunOptions = RunOptions, Param = Param)
## results preview
plot(OutputsModel)
## --- version of CemaNeige with the Linear Hysteresis
## preparation of the RunOptions object
RunOptions <- CreateRunOptions(FUN_MOD = RunModel_CemaNeige, InputsModel = InputsModel,
IndPeriod_Run = Ind_Run, IsHyst = TRUE)
## simulation
Param <- c(CNX1 = 0.962, CNX2 = 2.249, CNX3 = 100, CNX4 = 0.4)
OutputsModel <- RunModel_CemaNeige(InputsModel = InputsModel,
RunOptions = RunOptions, Param = Param)
## results preview
plot(OutputsModel)
}
\author{
Laurent Coron
Laurent Coron, Audrey Valéry, Vazken Andréassian, Olivier Delaigue, Guillaume Thirel
}
\references{
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 1 - Comparison of six snow accounting routines on 380 catchments, Journal of Hydrology, doi:10.1016/j.jhydrol.2014.04.059. \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, doi:10.1016/j.jhydrol.2014.04.058.
Riboust, P., Thirel, G., Le Moine, N. and Ribstein, P. (2019).
Revisiting a simple degree-day model for integrating satellite data: Implementation of SWE-SCA hystereses.
Journal of Hydrology and Hydromechanics, 67(1), 70–81, \doi{10.2478/johh-2018-0004}.
\cr\cr
Valéry, A., Andréassian, V. and Perrin, C. (2014).
"As simple as possible but not simpler": What is useful in a temperature-based snow-accounting routine?
Part 1 - Comparison of six snow accounting routines on 380 catchments.
Journal of Hydrology, 517(0), 1166-1175, \doi{10.1016/j.jhydrol.2014.04.059}.
\cr\cr
Valéry, A., Andréassian, V. and Perrin, C. (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}.
}
\seealso{
\code{\link{RunModel_CemaNeigeGR4J}}, \code{\link{CreateInputsModel}}, \code{\link{CreateRunOptions}}, \code{\link{CreateIniStates}}.
\code{\link{RunModel_CemaNeigeGR4J}}, \code{\link{CreateInputsModel}}, \code{\link{CreateRunOptions}},
\code{\link{CreateIniStates}}, \code{\link{CreateCalibOptions}}.
}
\encoding{UTF-8}
\name{RunModel_CemaNeigeGR4H}
\alias{RunModel_CemaNeigeGR4H}
\title{Run with the CemaNeigeGR4H hydrological model}
\description{
Function which performs a single run for the CemaNeige-GR4H hourly lumped model over the test period.
}
\usage{
RunModel_CemaNeigeGR4H(InputsModel, RunOptions, Param)
}
\arguments{
\item{InputsModel}{[object of class \emph{InputsModel}] see \code{\link{CreateInputsModel}} for details}
\item{RunOptions}{[object of class \emph{RunOptions}] see \code{\link{CreateRunOptions}} for details}
\item{Param}{[numeric] vector of 6 (or 8 parameters if \code{IsHyst = TRUE}, see \code{\link{CreateRunOptions}} for details)
\tabular{ll}{
GR4H X1 \tab production store capacity [mm] \cr
GR4H X2 \tab intercatchment exchange coefficient [mm/h] \cr
GR4H X3 \tab routing store capacity [mm] \cr
GR4H X4 \tab unit hydrograph time constant [h] \cr
CemaNeige X1 \tab weighting coefficient for snow pack thermal state [-] \cr
CemaNeige X2 \tab degree-hour melt coefficient [mm/°C/h] \cr
CemaNeige X3 \tab (optional) accumulation threshold [mm] (needed if \code{IsHyst = TRUE}) \cr
CemaNeige X4 \tab (optional) percentage (between 0 and 1) of annual snowfall defining the melt threshold [-] (needed if \code{IsHyst = TRUE}) \cr
}}
}
\value{
[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 (E) [mm/h] \cr
\emph{$Precip } \tab [numeric] series of input total precipitation (P) [mm/h] \cr
\emph{$Prod } \tab [numeric] series of production store level (S) [mm] \cr
\emph{$Pn } \tab [numeric] series of net rainfall (Pn) [mm/h] \cr
\emph{$Ps } \tab [numeric] series of the part of Pn filling the production store (Ps) [mm/h] \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 (Pr) [mm/h] \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 (R1) [mm] \cr
\emph{$Exch } \tab [numeric] series of potential semi-exchange between catchments [mm/h] \cr
\emph{$AExch1 } \tab [numeric] series of actual exchange between catchments for branch 1 [mm/h] \cr
\emph{$AExch2 } \tab [numeric] series of actual exchange between catchments for branch 2 [mm/h] \cr
\emph{$AExch } \tab [numeric] series of actual exchange between catchments (AExch1+AExch2) [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 UH2 after exchange (Qd) [mm/h] \cr
\emph{$Qsim } \tab [numeric] series of simulated discharge (Q) [mm/h] \cr
\emph{$CemaNeigeLayers} \tab [list] CemaNeige outputs (1 element per layer) \cr
\emph{$CemaNeigeLayers[[iLayer]]$Pliq } \tab [numeric] series of liquid precip. [mm/h] \cr
\emph{$CemaNeigeLayers[[iLayer]]$Psol } \tab [numeric] series of solid precip. [mm/h] \cr
\emph{$CemaNeigeLayers[[iLayer]]$SnowPack } \tab [numeric] series of snow pack (snow water equivalent)[mm] \cr
\emph{$CemaNeigeLayers[[iLayer]]$ThermalState} \tab [numeric] series of snow pack thermal state [°C] \cr
\emph{$CemaNeigeLayers[[iLayer]]$Gratio } \tab [numeric] series of Gratio [0-1] \cr
\emph{$CemaNeigeLayers[[iLayer]]$PotMelt } \tab [numeric] series of potential snow melt [mm/h] \cr
\emph{$CemaNeigeLayers[[iLayer]]$Melt } \tab [numeric] series of actual snow melt [mm/h] \cr
\emph{$CemaNeigeLayers[[iLayer]]$PliqAndMelt } \tab [numeric] series of liquid precip. + actual snow melt [mm/h] \cr
\emph{$CemaNeigeLayers[[iLayer]]$Temp } \tab [numeric] series of air temperature [°C] \cr
\emph{$CemaNeigeLayers[[iLayer]]$Gthreshold } \tab [numeric] series of melt threshold [mm] \cr
\emph{$CemaNeigeLayers[[iLayer]]$Glocalmax } \tab [numeric] series of local melt threshold for hysteresis [mm] \cr
\emph{RunOptions$WarmUpQsim} \tab [numeric] series of simulated discharge (Q) on the warm-up period [mm/h] \cr
\emph{RunOptions$Param } \tab [numeric] parameter set parameter set used by the model \cr
\emph{$StateEnd} \tab [numeric] states at the end of the run: store & unit hydrographs levels [mm], CemaNeige states [mm & °C]. See \code{\link{CreateIniStates}} for more details \cr
}
Refer to the provided references or to the package source code for further details on these model outputs.
}
\details{
It is advised to run the GR5H model with an interception store (see Ficchi et al. (2019)) as it improves the consistency of the model fluxes and provides better performance. To do so, the \code{\link{Imax}} functions allows to estimates the maximal capacity of the interception store, which can then be given to \code{\link{CreateRunOptions}}. \cr
The choice of the CemaNeige version is explained in \code{\link{CreateRunOptions}}. \cr
For further details on the model, see the references section. \cr
For further details on the argument structures and initialisation options, see \code{\link{CreateRunOptions}}.
\cr
\cr
See \code{\link{RunModel_GR4J}} to look at the diagram of the hydrological model.
}
\examples{
\dontrun{
library(airGR)
## loading catchment data
data(U2345030)
## preparation of the InputsModel object
InputsModel <- CreateInputsModel(FUN_MOD = RunModel_CemaNeigeGR4H, DatesR = BasinObs$DatesR,
Precip = BasinObs$P, PotEvap = BasinObs$E, TempMean = BasinObs$T,
ZInputs = BasinInfo$ZInputs,
HypsoData = BasinInfo$HypsoData, NLayers = 5)
## run period selection
Ind_Run <- seq(which(format(BasinObs$DatesR, format = "\%Y-\%m-\%d \%H")=="2004-03-01 00"),
which(format(BasinObs$DatesR, format = "\%Y-\%m-\%d \%H")=="2008-12-31 23"))
## --- original version of CemaNeige
## preparation of the RunOptions object
RunOptions <- CreateRunOptions(FUN_MOD = RunModel_CemaNeigeGR4H, InputsModel = InputsModel,
IndPeriod_Run = Ind_Run)
## simulation
Param <- c(X1 = 149.905, X2 = -0.487, X3 = 391.506, X4 = 9.620,
CNX1 = 0.520, CNX2 = 0.133)
OutputsModel <- RunModel_CemaNeigeGR4H(InputsModel = InputsModel,
RunOptions = RunOptions, Param = Param)
## results preview
plot(OutputsModel, Qobs = BasinObs$Qmm[Ind_Run])
## efficiency criterion: Nash-Sutcliffe Efficiency
InputsCrit <- CreateInputsCrit(FUN_CRIT = ErrorCrit_NSE, InputsModel = InputsModel,
RunOptions = RunOptions, Obs = BasinObs$Qmm[Ind_Run])
OutputsCrit <- ErrorCrit_NSE(InputsCrit = InputsCrit, OutputsModel = OutputsModel)
}
}
\author{
Laurent Coron, Claude Michel, Charles Perrin, Thibault Mathevet, Audrey Valéry, Vazken Andréassian, Olivier Delaigue, Guillaume Thirel
}
\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.
\cr\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 (in French), UPMC - Cemagref Antony, Paris, France.
\cr\cr
Riboust, P., Thirel, G., Le Moine, N. and Ribstein, P. (2019).
Revisiting a simple degree-day model for integrating satellite data: Implementation of SWE-SCA hystereses.
Journal of Hydrology and Hydromechanics, 67(1), 70–81, \doi{10.2478/johh-2018-0004}.
\cr\cr
Valéry, A., Andréassian, V. and Perrin, C. (2014).
"As simple as possible but not simpler": What is useful in a temperature-based snow-accounting routine?
Part 1 - Comparison of six snow accounting routines on 380 catchments.
Journal of Hydrology, 517(0), 1166-1175, \doi{10.1016/j.jhydrol.2014.04.059}.
\cr\cr
Valéry, A., Andréassian, V. and Perrin, C. (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}.
}
\seealso{
\code{\link{RunModel_CemaNeige}}, \code{\link{RunModel_CemaNeigeGR4J}}, \code{\link{RunModel_CemaNeigeGR5J}},
\code{\link{RunModel_CemaNeigeGR6J}}, \code{\link{RunModel_GR4H}},
\code{\link{CreateInputsModel}}, \code{\link{CreateRunOptions}}, \code{\link{CreateIniStates}}.
}
......@@ -8,6 +8,11 @@
\title{Run with the CemaNeigeGR4J hydrological model}
\description{
Function which performs a single run for the CemaNeige-GR4J daily lumped model over the test period.
}
\usage{
RunModel_CemaNeigeGR4J(InputsModel, RunOptions, Param)
}
......@@ -18,64 +23,69 @@ RunModel_CemaNeigeGR4J(InputsModel, RunOptions, Param)
\item{RunOptions}{[object of class \emph{RunOptions}] see \code{\link{CreateRunOptions}} for details}
\item{Param}{[numeric] vector of 6 parameters
\tabular{ll}{
GR4J X1 \tab production store capacity [mm] \cr
GR4J X2 \tab intercatchment exchange coefficient [mm/d] \cr
GR4J X3 \tab routing store capacity [mm] \cr
GR4J X4 \tab unit hydrograph time constant [d] \cr
CemaNeige X1 \tab weighting coefficient for snow pack thermal state [-] \cr
CemaNeige X2 \tab degree-day melt coefficient [mm/°C/d] \cr
}}
\item{Param}{[numeric] vector of 6 (or 8 parameters if \code{IsHyst = TRUE}, see \code{\link{CreateRunOptions}} for details)
\tabular{ll}{
GR4J X1 \tab production store capacity [mm] \cr
GR4J X2 \tab intercatchment exchange coefficient [mm/d] \cr
GR4J X3 \tab routing store capacity [mm] \cr
GR4J X4 \tab unit hydrograph time constant [d] \cr
CemaNeige X1 \tab weighting coefficient for snow pack thermal state [-] \cr
CemaNeige X2 \tab degree-day melt coefficient [mm/°C/d] \cr
CemaNeige X3 \tab (optional) accumulation threshold [mm] (needed if \code{IsHyst = TRUE}) \cr
CemaNeige X4 \tab (optional) percentage (between 0 and 1) of annual snowfall defining the melt threshold [-] (needed if \code{IsHyst = TRUE}) \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/d] \cr
\emph{$Precip } \tab [numeric] series of input total precipitation [mm/d] \cr
\emph{$Prod } \tab [numeric] series of production store level [mm] \cr
\emph{$Pn } \tab [numeric] series of net rainfall [mm/d] \cr
\emph{$Ps } \tab [numeric] series of the part of Pn filling the production store [mm/d] \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 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{$AExch1 } \tab [numeric] series of actual exchange between catchments for branch 1 [mm/d] \cr
\emph{$AExch2 } \tab [numeric] series of actual exchange between catchments for branch 2 [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 UH2 after exchange (QD) [mm/d] \cr
\emph{$Qsim } \tab [numeric] series of simulated discharge [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
\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
\emph{$CemaNeigeLayers[[iLayer]]$ThermalState } \tab [numeric] series of snow pack thermal state [°C] \cr
\emph{$CemaNeigeLayers[[iLayer]]$Gratio } \tab [numeric] series of Gratio [0-1] \cr
\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{$CemaNeigeLayers[[iLayer]]$Temp } \tab [numeric] series of air temperature [°C] \cr
\emph{$StateEnd} \tab [numeric] states at the end of the run: \cr\tab store & unit hydrographs levels [mm], CemaNeige states [mm & °C], \cr\tab see \code{\link{CreateIniStates}} for more details \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 over the test period.
[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/d] (E) \cr
\emph{$Precip } \tab [numeric] series of input total precipitation (P) [mm/d] \cr
\emph{$Prod } \tab [numeric] series of production store level (S) [mm] \cr
\emph{$Pn } \tab [numeric] series of net rainfall (Pn) [mm/d] \cr
\emph{$Ps } \tab [numeric] series of the part of Pn filling the production store (Ps) [mm/d] \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 (Pr) [mm/d] \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 (R1) [mm] \cr
\emph{$Exch } \tab [numeric] series of potential semi-exchange between catchments [mm/d] \cr
\emph{$AExch1 } \tab [numeric] series of actual exchange between catchments for branch 1 [mm/d] \cr
\emph{$AExch2 } \tab [numeric] series of actual exchange between catchments for branch 2 [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 UH2 after exchange (Qd) [mm/d] \cr
\emph{$Qsim } \tab [numeric] series of simulated discharge (Q) [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
\emph{$CemaNeigeLayers[[iLayer]]$Psol } \tab [numeric] series of solid precip. [mm/d] \cr
\emph{$CemaNeigeLayers[[iLayer]]$SnowPack } \tab [numeric] series of snow pack (snow water equivalent) [mm] \cr
\emph{$CemaNeigeLayers[[iLayer]]$ThermalState } \tab [numeric] series of snow pack thermal state [°C] \cr
\emph{$CemaNeigeLayers[[iLayer]]$Gratio } \tab [numeric] series of Gratio [0-1] \cr
\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{$CemaNeigeLayers[[iLayer]]$Temp } \tab [numeric] series of air temperature [°C] \cr
\emph{$CemaNeigeLayers[[iLayer]]$Gthreshold } \tab [numeric] series of melt threshold [mm] \cr
\emph{$CemaNeigeLayers[[iLayer]]$Glocalmax } \tab [numeric] series of local melt threshold for hysteresis [mm] \cr
\emph{RunOptions$WarmUpQsim} \tab [numeric] series of simulated discharge (Q) on the warm-up period [mm/d] \cr
\emph{RunOptions$Param } \tab [numeric] parameter set parameter set used by the model \cr
\emph{$StateEnd} \tab [numeric] states at the end of the run: store & unit hydrographs levels [mm], CemaNeige states [mm & °C]. See \code{\link{CreateIniStates}} for more details \cr
}
Refer to the provided references or to the package source code for further details on these model outputs.
}
\details{
For further details on the model, see the references section.
The choice of the CemaNeige version is explained in \code{\link{CreateRunOptions}}. \cr
For further details on the model, see the references section. \cr
For further details on the argument structures and initialisation options, see \code{\link{CreateRunOptions}}.
\cr
\cr
See \code{\link{RunModel_GR4J}} to look at the diagram of the hydrological model.
}
......@@ -86,21 +96,46 @@ 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,
InputsModel <- CreateInputsModel(FUN_MOD = RunModel_CemaNeigeGR4J, DatesR = BasinObs$DatesR,
Precip = BasinObs$P, PotEvap = BasinObs$E, TempMean = BasinObs$T,
ZInputs = median(BasinInfo$HypsoData),
HypsoData = BasinInfo$HypsoData, NLayers = 5)
## run period selection
Ind_Run <- seq(which(format(BasinObs$DatesR, format = "\%d/\%m/\%Y")=="01/01/1990"),
which(format(BasinObs$DatesR, format = "\%d/\%m/\%Y")=="31/12/1999"))
Ind_Run <- seq(which(format(BasinObs$DatesR, format = "\%Y-\%m-\%d")=="1990-01-01"),
which(format(BasinObs$DatesR, format = "\%Y-\%m-\%d")=="1999-12-31"))
## --- original version of CemaNeige
## preparation of the RunOptions object
RunOptions <- CreateRunOptions(FUN_MOD = RunModel_CemaNeigeGR4J, InputsModel = InputsModel,
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)
Param <- c(X1 = 408.774, X2 = 2.646, X3 = 131.264, X4 = 1.174,
CNX1 = 0.962, CNX2 = 2.249)
OutputsModel <- RunModel_CemaNeigeGR4J(InputsModel = InputsModel,
RunOptions = RunOptions, Param = Param)
## results preview
plot(OutputsModel, Qobs = BasinObs$Qmm[Ind_Run])
## efficiency criterion: Nash-Sutcliffe Efficiency
InputsCrit <- CreateInputsCrit(FUN_CRIT = ErrorCrit_NSE, InputsModel = InputsModel,
RunOptions = RunOptions, Obs = BasinObs$Qmm[Ind_Run])
OutputsCrit <- ErrorCrit_NSE(InputsCrit = InputsCrit, OutputsModel = OutputsModel)
## --- version of CemaNeige with the Linear Hysteresis
## preparation of the RunOptions object
RunOptions <- CreateRunOptions(FUN_MOD = RunModel_CemaNeigeGR4J, InputsModel = InputsModel,
IndPeriod_Run = Ind_Run, IsHyst = TRUE)
## simulation
Param <- c(X1 = 408.774, X2 = 2.646, X3 = 131.264, X4 = 1.174,
CNX1 = 0.962, CNX2 = 2.249, CNX3 = 100, CNX4 = 0.4)
OutputsModel <- RunModel_CemaNeigeGR4J(InputsModel = InputsModel,
RunOptions = RunOptions, Param = Param)
......@@ -108,32 +143,41 @@ OutputsModel <- RunModel_CemaNeigeGR4J(InputsModel = InputsModel,
plot(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])
InputsCrit <- CreateInputsCrit(FUN_CRIT = ErrorCrit_NSE, InputsModel = InputsModel,
RunOptions = RunOptions, Obs = BasinObs$Qmm[Ind_Run])
OutputsCrit <- ErrorCrit_NSE(InputsCrit = InputsCrit, OutputsModel = OutputsModel)
}
\author{
Laurent Coron, Audrey Valéry, Claude Michel, Charles Perrin, Vazken Andréassian
Laurent Coron, Claude Michel, Charles Perrin, Audrey Valéry, Vazken Andréassian, Olivier Delaigue, Guillaume Thirel
}
\references{
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
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 1 - Comparison of six snow accounting routines on 380 catchments, Journal of Hydrology, doi:10.1016/j.jhydrol.2014.04.059. \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, doi:10.1016/j.jhydrol.2014.04.058.
Perrin, C., Michel, C. and Andréassian, V. (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\cr
Riboust, P., Thirel, G., Le Moine, N. and Ribstein, P. (2019).
Revisiting a simple degree-day model for integrating satellite data: Implementation of SWE-SCA hystereses.
Journal of Hydrology and Hydromechanics, 67(1), 70–81, \doi{10.2478/johh-2018-0004}.
\cr\cr
Valéry, A., Andréassian, V. and Perrin, C. (2014).
"As simple as possible but not simpler": What is useful in a temperature-based snow-accounting routine?
Part 1 - Comparison of six snow accounting routines on 380 catchments.
Journal of Hydrology, 517(0), 1166-1175, \doi{10.1016/j.jhydrol.2014.04.059}.
\cr\cr
Valéry, A., Andréassian, V. and Perrin, C. (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}.
}
\seealso{
\code{\link{RunModel_CemaNeigeGR5J}}, \code{\link{RunModel_CemaNeigeGR6J}}, \code{\link{RunModel_GR4J}},
\code{\link{CreateInputsModel}}, \code{\link{CreateRunOptions}}, \code{\link{CreateIniStates}}.
\code{\link{RunModel_CemaNeige}}, \code{\link{RunModel_CemaNeigeGR5J}},
\code{\link{RunModel_CemaNeigeGR6J}}, \code{\link{RunModel_GR4J}},
\code{\link{CreateInputsModel}}, \code{\link{CreateRunOptions}}, \code{\link{CreateIniStates}}.
}
\encoding{UTF-8}
\name{RunModel_CemaNeigeGR5H}
\alias{RunModel_CemaNeigeGR5H}
\title{Run with the CemaNeigeGR5H hydrological model}
\description{
Function which performs a single run for the CemaNeige-GR5H hourly lumped model over the test period.
}
\usage{
RunModel_CemaNeigeGR5H(InputsModel, RunOptions, Param)
}
\arguments{
\item{InputsModel}{[object of class \emph{InputsModel}] see \code{\link{CreateInputsModel}} for details}
\item{RunOptions}{[object of class \emph{RunOptions}] see \code{\link{CreateRunOptions}} for details}
\item{Param}{[numeric] vector of 7 (or 9 parameters if \code{IsHyst = TRUE}, see \code{\link{CreateRunOptions}} for details)
\tabular{ll}{
GR5H X1 \tab production store capacity [mm] \cr
GR5H X2 \tab intercatchment exchange coefficient [mm/h] \cr
GR5H X3 \tab routing store capacity [mm] \cr
GR5H X4 \tab unit hydrograph time constant [h] \cr
GR5H X5 \tab intercatchment exchange threshold [-] \cr
CemaNeige X1 \tab weighting coefficient for snow pack thermal state [-] \cr
CemaNeige X2 \tab degree-hour melt coefficient [mm/°C/h] \cr
CemaNeige X3 \tab (optional) accumulation threshold [mm] (needed if \code{IsHyst = TRUE}) \cr
CemaNeige X4 \tab (optional) percentage (between 0 and 1) of annual snowfall defining the melt threshold [-] (needed if \code{IsHyst = TRUE}) \cr
}}
}
\value{
[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 (E) [mm/h] \cr
\emph{$Precip } \tab [numeric] series of input total precipitation (P) [mm/h] \cr
\emph{$Interc } \tab [numeric] series of interception store level (I) [mm] \cr
\emph{$Prod } \tab [numeric] series of production store level (S) [mm] \cr
\emph{$Pn } \tab [numeric] series of net rainfall (Pn) [mm/h] \cr
\emph{$Ps } \tab [numeric] series of the part of Pn filling the production store (Ps) [mm/h] \cr
\emph{$AE } \tab [numeric] series of actual evapotranspiration (Ei+Es) [mm/h] \cr
\emph{$EI } \tab [numeric] series of evapotranspiration from rainfall neutralisation or interception store (Ei) [mm/h] \cr
\emph{$ES } \tab [numeric] series of evapotranspiration from production store (Es) [mm/h] \cr
\emph{$Perc } \tab [numeric] series of percolation (Perc) [mm/h] \cr
\emph{$PR } \tab [numeric] series of Pr=Pn-Ps+Perc (Pr) [mm/h] \cr
\emph{$Q9 } \tab [numeric] series of UH outflow going into branch 9 (Q9) [mm/h] \cr
\emph{$Q1 } \tab [numeric] series of UH outflow going into branch 1 (Q1) [mm/h] \cr
\emph{$Rout } \tab [numeric] series of routing store level (R1) [mm] \cr
\emph{$Exch } \tab [numeric] series of potential semi-exchange between catchments [mm/h] \cr
\emph{$AExch1 } \tab [numeric] series of actual exchange between catchments for branch 1 [mm/h] \cr
\emph{$AExch2 } \tab [numeric] series of actual exchange between catchments for branch 2 [mm/h] \cr
\emph{$AExch } \tab [numeric] series of actual exchange between catchments (AExch1+AExch2) [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 UH after exchange (Qd) [mm/h] \cr
\emph{$Qsim } \tab [numeric] series of simulated discharge (Q) [mm/h] \cr
\emph{$CemaNeigeLayers} \tab [list] CemaNeige outputs (1 element per layer) \cr
\emph{$CemaNeigeLayers[[iLayer]]$Pliq } \tab [numeric] series of liquid precip. [mm/h] \cr
\emph{$CemaNeigeLayers[[iLayer]]$Psol } \tab [numeric] series of solid precip. [mm/h] \cr
\emph{$CemaNeigeLayers[[iLayer]]$SnowPack } \tab [numeric] series of snow pack (snow water equivalent) [mm] \cr
\emph{$CemaNeigeLayers[[iLayer]]$ThermalState } \tab [numeric] series of snow pack thermal state [°C] \cr
\emph{$CemaNeigeLayers[[iLayer]]$Gratio } \tab [numeric] series of Gratio [0-1] \cr
\emph{$CemaNeigeLayers[[iLayer]]$PotMelt } \tab [numeric] series of potential snow melt [mm/h] \cr
\emph{$CemaNeigeLayers[[iLayer]]$Melt } \tab [numeric] series of actual snow melt [mm/h] \cr
\emph{$CemaNeigeLayers[[iLayer]]$PliqAndMelt } \tab [numeric] series of liquid precip. + actual snow melt [mm/h] \cr
\emph{$CemaNeigeLayers[[iLayer]]$Temp } \tab [numeric] series of air temperature [°C] \cr
\emph{$CemaNeigeLayers[[iLayer]]$Gthreshold } \tab [numeric] series of melt threshold [mm] \cr
\emph{$CemaNeigeLayers[[iLayer]]$Glocalmax } \tab [numeric] series of local melt threshold for hysteresis [mm] \cr
\emph{RunOptions$WarmUpQsim} \tab [numeric] series of simulated discharge (Q) on the warm-up period [mm/h] \cr
\emph{RunOptions$Param } \tab [numeric] parameter set parameter set used by the model \cr
\emph{$StateEnd} \tab [numeric] states at the end of the run: store & unit hydrographs levels [mm], CemaNeige states [mm & °C]. See \code{\link{CreateIniStates}} for more details \cr
}
Refer to the provided references or to the package source code for further details on these model outputs.
}
\details{
The choice of the CemaNeige version is explained in \code{\link{CreateRunOptions}}. \cr
For further details on the model, see the references section. \cr
For further details on the argument structures and initialisation options, see \code{\link{CreateRunOptions}}.
\cr
\cr
See \code{\link{RunModel_GR5H}} to look at the diagram of the hydrological model or \code{\link{RunModel_GR5J}} when no interception store is used.
}
\examples{
\dontrun{
library(airGR)
## loading catchment data
data(U2345030)
## preparation of the InputsModel object
InputsModel <- CreateInputsModel(FUN_MOD = RunModel_CemaNeigeGR5H, DatesR = BasinObs$DatesR,
Precip = BasinObs$P, PotEvap = BasinObs$E, TempMean = BasinObs$T,
ZInputs = BasinInfo$ZInputs,
HypsoData = BasinInfo$HypsoData, NLayers = 5)
## run period selection
Ind_Run <- seq(which(format(BasinObs$DatesR, format = "\%Y-\%m-\%d \%H")=="2004-03-01 00"),
which(format(BasinObs$DatesR, format = "\%Y-\%m-\%d \%H")=="2008-12-31 23"))
## --- original version of CemaNeige
## Imax computation
Imax <- Imax(InputsModel = InputsModel, IndPeriod_Run = Ind_Run,
TestedValues = seq(from = 0, to = 3, by = 0.2))
## preparation of the RunOptions object
RunOptions <- CreateRunOptions(FUN_MOD = RunModel_CemaNeigeGR5H, InputsModel = InputsModel,
Imax = Imax, IndPeriod_Run = Ind_Run)
## simulation
Param <- c(X1 = 218.537, X2 = -0.009, X3 = 174.862, X4 = 6.674, X5 = 0.000,
CNX1 = 0.002, CNX2 = 3.787)
OutputsModel <- RunModel_CemaNeigeGR5H(InputsModel = InputsModel,
RunOptions = RunOptions, Param = Param)
## results preview
plot(OutputsModel, Qobs = BasinObs$Qmm[Ind_Run])
## efficiency criterion: Nash-Sutcliffe Efficiency
InputsCrit <- CreateInputsCrit(FUN_CRIT = ErrorCrit_NSE, InputsModel = InputsModel,
RunOptions = RunOptions, Obs = BasinObs$Qmm[Ind_Run])
OutputsCrit <- ErrorCrit_NSE(InputsCrit = InputsCrit, OutputsModel = OutputsModel)
}
}
\author{
Laurent Coron, Guillaume Thirel, Olivier Delaigue, Audrey Valéry, Vazken Andréassian
}
\references{
Ficchi, A. (2017).
An adaptive hydrological model for multiple time-steps:
Diagnostics and improvements based on fluxes consistency.
PhD thesis, UPMC - Irstea Antony, Paris, France.
\cr\cr
Ficchi, A., Perrin, C. and Andréassian, V. (2019).
Hydrological modelling at multiple sub-daily time steps: model improvement via flux-matching.
Journal of Hydrology, 575, 1308-1327, \doi{10.1016/j.jhydrol.2019.05.084}.
\cr\cr
Perrin, C., Michel, C. and Andréassian, V. (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\cr
Riboust, P., Thirel, G., Le Moine, N. and Ribstein, P. (2019).
Revisiting a simple degree-day model for integrating satellite data: Implementation of SWE-SCA hystereses.
Journal of Hydrology and Hydromechanics, 67(1), 70–81, \doi{10.2478/johh-2018-0004}.
\cr\cr
Valéry, A., Andréassian, V. and Perrin, C. (2014).
"As simple as possible but not simpler": What is useful in a temperature-based snow-accounting routine?
Part 1 - Comparison of six snow accounting routines on 380 catchments.
Journal of Hydrology, 517(0), 1166-1175, \doi{10.1016/j.jhydrol.2014.04.059}.
\cr\cr
Valéry, A., Andréassian, V. and Perrin, C. (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}.
}
\seealso{
\code{\link{RunModel_CemaNeige}}, \code{\link{RunModel_CemaNeigeGR4H}}, \code{\link{RunModel_GR5H}}, \code{\link{Imax}},
\code{\link{CreateInputsModel}}, \code{\link{CreateRunOptions}}, \code{\link{CreateIniStates}}.
}
......@@ -8,6 +8,11 @@
\title{Run with the CemaNeigeGR5J hydrological model}
\description{
Function which performs a single run for the CemaNeige-GR5J daily lumped model.
}
\usage{
RunModel_CemaNeigeGR5J(InputsModel, RunOptions, Param)
}
......@@ -18,65 +23,70 @@ RunModel_CemaNeigeGR5J(InputsModel, RunOptions, Param)
\item{RunOptions}{[object of class \emph{RunOptions}] see \code{\link{CreateRunOptions}} for details}
\item{Param}{[numeric] vector of 7 parameters
\tabular{ll}{
GR5J X1 \tab production store capacity [mm] \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 threshold [-] \cr
CemaNeige X1 \tab weighting coefficient for snow pack thermal state [-] \cr
CemaNeige X2 \tab degree-day melt coefficient [mm/°C/d] \cr
}}
\item{Param}{[numeric] vector of 7 (or 9 parameters if \code{IsHyst = TRUE}, see \code{\link{CreateRunOptions}} for details)
\tabular{ll}{
GR5J X1 \tab production store capacity [mm] \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 threshold [-] \cr
CemaNeige X1 \tab weighting coefficient for snow pack thermal state [-] \cr
CemaNeige X2 \tab degree-day melt coefficient [mm/°C/d] \cr
CemaNeige X3 \tab (optional) accumulation threshold [mm] (needed if \code{IsHyst = TRUE}) \cr
CemaNeige X4 \tab (optional) percentage (between 0 and 1) of annual snowfall defining the melt threshold [-] (needed if \code{IsHyst = TRUE}) \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/d] \cr
\emph{$Precip } \tab [numeric] series of input total precipitation [mm/d] \cr
\emph{$Prod } \tab [numeric] series of production store level [mm] \cr
\emph{$Pn } \tab [numeric] series of net rainfall [mm/d] \cr
\emph{$Ps } \tab [numeric] series of the part of Pn filling the production store [mm/d] \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 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{$AExch1 } \tab [numeric] series of actual exchange between catchments for branch 1 [mm/d] \cr
\emph{$AExch2 } \tab [numeric] series of actual exchange between catchments for branch 2 [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 UH2 after exchange (QD) [mm/d] \cr
\emph{$Qsim } \tab [numeric] series of simulated discharge [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
\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
\emph{$CemaNeigeLayers[[iLayer]]$ThermalState } \tab [numeric] series of snow pack thermal state [°C] \cr
\emph{$CemaNeigeLayers[[iLayer]]$Gratio } \tab [numeric] series of Gratio [0-1] \cr
\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{$CemaNeigeLayers[[iLayer]]$Temp } \tab [numeric] series of air temperature [°C] \cr
\emph{$StateEnd} \tab [numeric] states at the end of the run: \cr\tab store & unit hydrographs levels [mm], CemaNeige states [mm & °C], \cr\tab see \code{\link{CreateIniStates}} for more details \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-GR5J daily lumped model.
[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 (E) [mm/d] \cr
\emph{$Precip } \tab [numeric] series of input total precipitation (P) [mm/d] \cr
\emph{$Prod } \tab [numeric] series of production store level (S) [mm] \cr
\emph{$Pn } \tab [numeric] series of net rainfall (Pn) [mm/d] \cr
\emph{$Ps } \tab [numeric] series of the part of Pn filling the production store (Ps) [mm/d] \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 (Pr) [mm/d] \cr
\emph{$Q9 } \tab [numeric] series of UH outflow going into branch 9 (Q9) [mm/d] \cr
\emph{$Q1 } \tab [numeric] series of UH outflow going into branch 1 (Q1) [mm/d] \cr
\emph{$Rout } \tab [numeric] series of routing store level (R1) [mm] \cr
\emph{$Exch } \tab [numeric] series of potential semi-exchange between catchments [mm/d] \cr
\emph{$AExch1 } \tab [numeric] series of actual exchange between catchments for branch 1 [mm/d] \cr
\emph{$AExch2 } \tab [numeric] series of actual exchange between catchments for branch 2 [mm/d] \cr
\emph{$AExch } \tab [numeric] series of actual exchange between catchments (AExch1+AExch2) [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 UH after exchange (Qd) [mm/d] \cr
\emph{$Qsim } \tab [numeric] series of simulated discharge (Q) [mm/d] \cr
\emph{$CemaNeigeLayers} \tab [list] CemaNeige outputs (1 element 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 (snow water equivalent) [mm] \cr
\emph{$CemaNeigeLayers[[iLayer]]$ThermalState} \tab [numeric] series of snow pack thermal state [°C] \cr
\emph{$CemaNeigeLayers[[iLayer]]$Gratio } \tab [numeric] series of Gratio [0-1] \cr
\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{$CemaNeigeLayers[[iLayer]]$Temp } \tab [numeric] series of air temperature [°C] \cr
\emph{$CemaNeigeLayers[[iLayer]]$Gthreshold } \tab [numeric] series of melt threshold [mm] \cr
\emph{$CemaNeigeLayers[[iLayer]]$Glocalmax } \tab [numeric] series of local melt threshold for hysteresis [mm] \cr
\emph{RunOptions$WarmUpQsim} \tab [numeric] series of simulated discharge (Q) on the warm-up period [mm/d] \cr
\emph{RunOptions$Param } \tab [numeric] parameter set parameter set used by the model \cr
\emph{$StateEnd} \tab [numeric] states at the end of the run: store & unit hydrographs levels [mm], CemaNeige states [mm & °C]. See \code{\link{CreateIniStates}} for more details \cr
}
Refer to the provided references or to the package source code for further details on these model outputs
}
\details{
For further details on the model, see the references section.
The choice of the CemaNeige version is explained in \code{\link{CreateRunOptions}}. \cr
For further details on the model, see the references section. \cr
For further details on the argument structures and initialisation options, see \code{\link{CreateRunOptions}}.
\cr
\cr
See \code{\link{RunModel_GR5J}} to look at the diagram of the hydrological model.
}
......@@ -87,21 +97,39 @@ 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,
InputsModel <- CreateInputsModel(FUN_MOD = RunModel_CemaNeigeGR5J, DatesR = BasinObs$DatesR,
Precip = BasinObs$P, PotEvap = BasinObs$E, TempMean = BasinObs$T,
ZInputs = median(BasinInfo$HypsoData),
HypsoData = BasinInfo$HypsoData, NLayers = 5)
## run period selection
Ind_Run <- seq(which(format(BasinObs$DatesR, format = "\%d/\%m/\%Y")=="01/01/1990"),
which(format(BasinObs$DatesR, format = "\%d/\%m/\%Y")=="31/12/1999"))
Ind_Run <- seq(which(format(BasinObs$DatesR, format = "\%Y-\%m-\%d")=="1990-01-01"),
which(format(BasinObs$DatesR, format = "\%Y-\%m-\%d")=="1999-12-31"))
## preparation of the RunOptions object
RunOptions <- CreateRunOptions(FUN_MOD = RunModel_CemaNeigeGR5J, InputsModel = InputsModel,
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)
Param <- c(X1 = 179.139, X2 = -0.100, X3 = 203.815, X4 = 1.174, X5 = 2.478,
CNX1 = 0.977, CNX2 = 2.774)
OutputsModel <- RunModel_CemaNeigeGR5J(InputsModel = InputsModel,
RunOptions = RunOptions, Param = Param)
## results preview
plot(OutputsModel, Qobs = BasinObs$Qmm[Ind_Run])
## efficiency criterion: Nash-Sutcliffe Efficiency
InputsCrit <- CreateInputsCrit(FUN_CRIT = ErrorCrit_NSE, InputsModel = InputsModel,
RunOptions = RunOptions, Obs = BasinObs$Qmm[Ind_Run])
OutputsCrit <- ErrorCrit_NSE(InputsCrit = InputsCrit, OutputsModel = OutputsModel)
## simulation with the Linear Hysteresis
## preparation of the RunOptions object
RunOptions <- CreateRunOptions(FUN_MOD = RunModel_CemaNeigeGR5J, InputsModel = InputsModel,
IndPeriod_Run = Ind_Run, IsHyst = TRUE)
Param <- c(179.139, -0.100, 203.815, 1.174, 2.478, 0.977, 2.774, 100, 0.4)
OutputsModel <- RunModel_CemaNeigeGR5J(InputsModel = InputsModel,
RunOptions = RunOptions, Param = Param)
......@@ -109,34 +137,45 @@ OutputsModel <- RunModel_CemaNeigeGR5J(InputsModel = InputsModel,
plot(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])
InputsCrit <- CreateInputsCrit(FUN_CRIT = ErrorCrit_NSE, InputsModel = InputsModel,
RunOptions = RunOptions, Obs = BasinObs$Qmm[Ind_Run])
OutputsCrit <- ErrorCrit_NSE(InputsCrit = InputsCrit, OutputsModel = OutputsModel)
}
\author{
Laurent Coron, Audrey Valéry, Claude Michel, Nicolas Le Moine, Charles Perrin, Vazken Andréassian
Laurent Coron, Claude Michel, Nicolas Le Moine, Audrey Valéry, Vazken Andréassian, Olivier Delaigue, Guillaume Thirel
}
\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),
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 1 - Comparison of six snow accounting routines on 380 catchments, Journal of Hydrology, doi:10.1016/j.jhydrol.2014.04.059. \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, doi:10.1016/j.jhydrol.2014.04.058.
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.
\cr\cr
Pushpalatha, R., Perrin, C., Le Moine, N., Mathevet, T. and Andréassian, V. (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\cr
Riboust, P., Thirel, G., Le Moine, N. and Ribstein, P. (2019).
Revisiting a simple degree-day model for integrating satellite data: Implementation of SWE-SCA hystereses.
Journal of Hydrology and Hydromechanics, 67(1), 70–81, \doi{10.2478/johh-2018-0004}.
\cr\cr
Valéry, A., Andréassian, V. and Perrin, C. (2014).
"As simple as possible but not simpler": What is useful in a temperature-based snow-accounting routine?
Part 1 - Comparison of six snow accounting routines on 380 catchments.
Journal of Hydrology, 517(0), 1166-1175, \doi{10.1016/j.jhydrol.2014.04.059}.
\cr\cr
Valéry, A., Andréassian, V. and Perrin, C. (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}.
}
\seealso{
\code{\link{RunModel_CemaNeigeGR4J}}, \code{\link{RunModel_CemaNeigeGR6J}}, \code{\link{RunModel_GR5J}},
\code{\link{RunModel_CemaNeige}}, \code{\link{RunModel_CemaNeigeGR4J}}, \code{\link{RunModel_CemaNeigeGR6J}}, \code{\link{RunModel_GR5J}},
\code{\link{CreateInputsModel}}, \code{\link{CreateRunOptions}}, \code{\link{CreateIniStates}}.
}
......@@ -8,6 +8,11 @@
\title{Run with the CemaNeigeGR6J hydrological model}
\description{
Function which performs a single run for the CemaNeige-GR6J daily lumped model.
}
\usage{
RunModel_CemaNeigeGR6J(InputsModel, RunOptions, Param)
}
......@@ -18,69 +23,76 @@ RunModel_CemaNeigeGR6J(InputsModel, RunOptions, Param)
\item{RunOptions}{[object of class \emph{RunOptions}] see \code{\link{CreateRunOptions}} for details}
\item{Param}{[numeric] vector of 8 parameters
\tabular{ll}{
GR6J X1 \tab production store capacity [mm] \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 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/°C/d] \cr
}}
\item{Param}{[numeric] vector of 8 (or 10 parameters if \code{IsHyst = TRUE}, see \code{\link{CreateRunOptions}} for details)
\tabular{ll}{
GR6J X1 \tab production store capacity [mm] \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 threshold [-] \cr
GR6J X6 \tab exponential store depletion coefficient [mm] \cr
CemaNeige X1 \tab weighting coefficient for snow pack thermal state [-] \cr
CemaNeige X2 \tab degree-day melt coefficient [mm/°C/d] \cr
CemaNeige X3 \tab (optional) accumulation threshold [mm] (needed if \code{IsHyst = TRUE}) \cr
CemaNeige X4 \tab (optional) percentage (between 0 and 1) of annual snowfall defining the melt threshold [-] (needed if \code{IsHyst = TRUE})\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/d] \cr
\emph{$Precip } \tab [numeric] series of input total precipitation [mm/d] \cr
\emph{$Prod } \tab [numeric] series of production store level [mm] \cr
\emph{$Pn } \tab [numeric] series of net rainfall [mm/d] \cr
\emph{$Ps } \tab [numeric] series of the part of Ps filling the production store [mm/d] \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 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{$AExch1 } \tab [numeric] series of actual exchange between catchments for branch 1 [mm/d] \cr
\emph{$AExch2 } \tab [numeric] series of actual exchange between catchments for branch 2 [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{$QRExp } \tab [numeric] series of exponential store outflow (QRExp) [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
\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
\emph{$CemaNeigeLayers[[iLayer]]$ThermalState} \tab [numeric] series of snow pack thermal state [°C] \cr
\emph{$CemaNeigeLayers[[iLayer]]$Gratio } \tab [numeric] series of Gratio [0-1] \cr
\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{$CemaNeigeLayers[[iLayer]]$Temp } \tab [numeric] series of air temperature [°C] \cr
\emph{$StateEnd} \tab [numeric] states at the end of the run: \cr\tab store & unit hydrographs levels [mm], CemaNeige states [mm & °C], \cr\tab see \code{\link{CreateIniStates}} for more details \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-GR6J daily lumped model.
[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 (E) [mm/d] \cr
\emph{$Precip } \tab [numeric] series of input total precipitation (P) [mm/d] \cr
\emph{$Prod } \tab [numeric] series of production store level (S) [mm] \cr
\emph{$Pn } \tab [numeric] series of net rainfall (Pn) [mm/d] \cr
\emph{$Ps } \tab [numeric] series of the part of Pn filling the production store (Ps) [mm/d] \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 (Pr) [mm/d] \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 (R1) [mm] \cr
\emph{$Exch } \tab [numeric] series of potential semi-exchange between catchments [mm/d] \cr
\emph{$AExch1 } \tab [numeric] series of actual exchange between catchments for branch 1 [mm/d] \cr
\emph{$AExch2 } \tab [numeric] series of actual exchange between catchments for branch 2 [mm/d] \cr
\emph{$AExch } \tab [numeric] series of actual exchange between catchments (AExch1+AExch2) [mm/d] \cr
\emph{$QR } \tab [numeric] series of routing store outflow (Qr) [mm/d] \cr
\emph{$QRExp } \tab [numeric] series of exponential store outflow (QrExp) [mm/d] \cr
\emph{$Exp } \tab [numeric] series of exponential store level (negative) (R2) [mm] \cr
\emph{$QD } \tab [numeric] series of direct flow from UH2 after exchange (Qd) [mm/d] \cr
\emph{$Qsim } \tab [numeric] series of simulated discharge (Q) [mm/d] \cr
\emph{$CemaNeigeLayers} \tab [list] CemaNeige outputs (1 element 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 (snow water equivalent) [mm] \cr
\emph{$CemaNeigeLayers[[iLayer]]$ThermalState} \tab [numeric] series of snow pack thermal state [°C] \cr
\emph{$CemaNeigeLayers[[iLayer]]$Gratio } \tab [numeric] series of Gratio [0-1] \cr
\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{$CemaNeigeLayers[[iLayer]]$Temp } \tab [numeric] series of air temperature [°C] \cr
\emph{$CemaNeigeLayers[[iLayer]]$Gthreshold } \tab [numeric] series of melt threshold [mm] \cr
\emph{$CemaNeigeLayers[[iLayer]]$Glocalmax } \tab [numeric] series of local melt threshold for hysteresis [mm] \cr
\emph{RunOptions$WarmUpQsim} \tab [numeric] series of simulated discharge (Q) on the warm-up period [mm/d] \cr
\emph{RunOptions$Param } \tab [numeric] parameter set parameter set used by the model \cr
\emph{$StateEnd} \tab [numeric] states at the end of the run: store & unit hydrographs levels [mm], CemaNeige states [mm & °C]. See \code{\link{CreateIniStates}} for more details \cr
}
Refer to the provided references or to the package source code for further details on these model outputs
}
\details{
For further details on the model, see the references section.
The choice of the CemaNeige version is explained in \code{\link{CreateRunOptions}}. \cr
For further details on the model, see the references section. \cr
For further details on the argument structures and initialisation options, see \code{\link{CreateRunOptions}}.
\cr
\cr
See \code{\link{RunModel_GR6J}} to look at the diagram of the hydrological model.
}
\examples{
library(airGR)
......@@ -88,21 +100,25 @@ 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,
InputsModel <- CreateInputsModel(FUN_MOD = RunModel_CemaNeigeGR6J, DatesR = BasinObs$DatesR,
Precip = BasinObs$P, PotEvap = BasinObs$E, TempMean = BasinObs$T,
ZInputs = median(BasinInfo$HypsoData),
HypsoData = BasinInfo$HypsoData, NLayers = 5)
## run period selection
Ind_Run <- seq(which(format(BasinObs$DatesR, format = "\%d/\%m/\%Y")=="01/01/1990"),
which(format(BasinObs$DatesR, format = "\%d/\%m/\%Y")=="31/12/1999"))
Ind_Run <- seq(which(format(BasinObs$DatesR, format = "\%Y-\%m-\%d")=="1990-01-01"),
which(format(BasinObs$DatesR, format = "\%Y-\%m-\%d")=="1999-12-31"))
## --- original version of CemaNeige
## preparation of the RunOptions object
RunOptions <- CreateRunOptions(FUN_MOD = RunModel_CemaNeigeGR6J, InputsModel = InputsModel,
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)
Param <- c(X1 = 116.482, X2 = 0.500, X3 = 72.733, X4 = 1.224, X5 = 0.278, X6 = 30.333,
CNX1 = 0.977, CNX2 = 2.776)
OutputsModel <- RunModel_CemaNeigeGR6J(InputsModel = InputsModel,
RunOptions = RunOptions, Param = Param)
......@@ -110,32 +126,63 @@ OutputsModel <- RunModel_CemaNeigeGR6J(InputsModel = InputsModel,
plot(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])
InputsCrit <- CreateInputsCrit(FUN_CRIT = ErrorCrit_NSE, InputsModel = InputsModel,
RunOptions = RunOptions, Obs = BasinObs$Qmm[Ind_Run])
OutputsCrit <- ErrorCrit_NSE(InputsCrit = InputsCrit, OutputsModel = OutputsModel)
## --- version of CemaNeige with the Linear Hysteresis
## preparation of the RunOptions object
RunOptions <- CreateRunOptions(FUN_MOD = RunModel_CemaNeigeGR6J, InputsModel = InputsModel,
IndPeriod_Run = Ind_Run, IsHyst = TRUE)
## simulation
Param <- c(X1 = 116.482, X2 = 0.500, X3 = 72.733, X4 = 1.224, X5 = 0.278, X6 = 30.333,
CNX1 = 0.977, CNX2 = 2.774, CNX3 = 100, CNX4 = 0.4)
OutputsModel <- RunModel_CemaNeigeGR6J(InputsModel = InputsModel,
RunOptions = RunOptions, Param = Param)
## results preview
plot(OutputsModel, Qobs = BasinObs$Qmm[Ind_Run])
## efficiency criterion: Nash-Sutcliffe Efficiency
InputsCrit <- CreateInputsCrit(FUN_CRIT = ErrorCrit_NSE, InputsModel = InputsModel,
RunOptions = RunOptions, Obs = BasinObs$Qmm[Ind_Run])
OutputsCrit <- ErrorCrit_NSE(InputsCrit = InputsCrit, OutputsModel = OutputsModel)
}
\author{
Laurent Coron, Audrey Valéry, Claude Michel, Charles Perrin, Raji Pushpalatha, Nicolas Le Moine, Vazken Andréassian
Laurent Coron, Claude Michel, Charles Perrin, Raji Pushpalatha, Nicolas Le Moine, Audrey Valéry, Vazken Andréassian, Olivier Delaigue, Guillaume Thirel
}
\references{
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 1 - Comparison of six snow accounting routines on 380 catchments, Journal of Hydrology, doi:10.1016/j.jhydrol.2014.04.059. \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, doi:10.1016/j.jhydrol.2014.04.058.
Pushpalatha, R., Perrin, C., Le Moine, N., Mathevet, T. and Andréassian, V. (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\cr
Riboust, P., Thirel, G., Le Moine, N. and Ribstein, P. (2019).
Revisiting a simple degree-day model for integrating satellite data: Implementation of SWE-SCA hystereses.
Journal of Hydrology and Hydromechanics, 67(1), 70–81, \doi{10.2478/johh-2018-0004}.
\cr\cr
Valéry, A., Andréassian, V. and Perrin, C. (2014).
"As simple as possible but not simpler": What is useful in a temperature-based snow-accounting routine?
Part 1 - Comparison of six snow accounting routines on 380 catchments.
Journal of Hydrology, 517(0), 1166-1175, \doi{10.1016/j.jhydrol.2014.04.059}.
\cr\cr
Valéry, A., Andréassian, V. and Perrin, C. (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}.
}
\seealso{
\code{\link{RunModel_CemaNeigeGR4J}}, \code{\link{RunModel_CemaNeigeGR5J}}, \code{\link{RunModel_GR6J}},
\code{\link{CreateInputsModel}}, \code{\link{CreateRunOptions}}.
\code{\link{RunModel_CemaNeige}}, \code{\link{RunModel_CemaNeigeGR4J}},
\code{\link{RunModel_CemaNeigeGR5J}}, \code{\link{RunModel_GR6J}},
\code{\link{CreateInputsModel}}, \code{\link{CreateRunOptions}}.
}
......@@ -8,6 +8,11 @@
\title{Run with the GR1A hydrological model}
\description{
Function which performs a single run for the GR1A annual lumped model over the test period.
}
\usage{
RunModel_GR1A(InputsModel, RunOptions, Param)
}
......@@ -19,32 +24,29 @@ RunModel_GR1A(InputsModel, RunOptions, Param)
\item{RunOptions}{[object of class \emph{RunOptions}] see \code{\link{CreateRunOptions}} for details}
\item{Param}{[numeric] vector of 1 parameter
\tabular{ll}{
GR1A X1 \tab model parameter [-] \cr
}}
\tabular{ll}{
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/y] \cr
\emph{$Precip } \tab [numeric] series of input total precipitation [mm/y] \cr
\emph{$Qsim } \tab [numeric] series of simulated discharge [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 annual lumped model over the test period.
[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/y] \cr
\emph{$Precip } \tab [numeric] series of input total precipitation [mm/y] \cr
\emph{$Qsim } \tab [numeric] series of simulated discharge [mm/y] \cr
\emph{RunOptions$WarmUpQsim} \tab [numeric] series of simulated discharge (Q) on the warm-up period [mm/y] \cr
\emph{RunOptions$Param } \tab [numeric] parameter set parameter set used by the model \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.
}
\details{
For further details on the model, see the references section.
For further details on the model, see the references section. \cr
For further details on the argument structures and initialisation options, see \code{\link{CreateRunOptions}}.
}
......@@ -56,23 +58,21 @@ 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)
TimeFormat <- "daily"
NewTimeFormat <- "yearly"
ConvertFun <- c("sum", "sum", "mean", "sum")
YearFirstMonth <- 09;
NewTabSeries <- SeriesAggreg(TabSeries = TabSeries, TimeFormat = TimeFormat,
NewTimeFormat = NewTimeFormat, ConvertFun = ConvertFun,
YearFirstMonth = YearFirstMonth)
BasinObs <- NewTabSeries
names(BasinObs) <- c("DatesR", "P", "E", "T", "Qmm")
TabSeries <- data.frame(DatesR = BasinObs$DatesR,
P = BasinObs$P,
E = BasinObs$E,
Qmm = BasinObs$Qmm)
TabSeries <- TabSeries[TabSeries$DatesR < as.POSIXct("2012-09-01", tz = "UTC"), ]
BasinObs <- SeriesAggreg(TabSeries, Format = "\%Y",
YearFirstMonth = 09,
ConvertFun = c("sum", "sum", "sum"))
## preparation of the InputsModel object
InputsModel <- CreateInputsModel(FUN_MOD = RunModel_GR1A, DatesR = BasinObs$DatesR,
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"),
Ind_Run <- seq(which(format(BasinObs$DatesR, format = "\%Y")=="1990"),
which(format(BasinObs$DatesR, format = "\%Y")=="1999"))
## preparation of the RunOptions object
......@@ -80,28 +80,28 @@ RunOptions <- CreateRunOptions(FUN_MOD = RunModel_GR1A,
InputsModel = InputsModel, IndPeriod_Run = Ind_Run)
## simulation
Param <- c(0.840)
Param <- c(X1 = 0.840)
OutputsModel <- RunModel_GR1A(InputsModel = InputsModel, RunOptions = RunOptions, Param = Param)
## results preview
plot(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])
InputsCrit <- CreateInputsCrit(FUN_CRIT = ErrorCrit_NSE, InputsModel = InputsModel,
RunOptions = RunOptions, Obs = BasinObs$Qmm[Ind_Run])
OutputsCrit <- ErrorCrit_NSE(InputsCrit = InputsCrit, OutputsModel = OutputsModel)
}
\author{
Laurent Coron, Claude Michel
Laurent Coron, Claude Michel, Olivier Delaigue, Guillaume Thirel
}
\references{
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, France. \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, France.
}
......
......@@ -8,6 +8,11 @@
\title{Run with the GR2M hydrological model}
\description{
Function which performs a single run for the GR2M monthly lumped model over the test period.
}
\usage{
RunModel_GR2M(InputsModel, RunOptions, Param)
}
......@@ -19,41 +24,43 @@ RunModel_GR2M(InputsModel, RunOptions, Param)
\item{RunOptions}{[object of class \emph{RunOptions}] see \code{\link{CreateRunOptions}} for details}
\item{Param}{[numeric] vector of 2 parameters
\tabular{ll}{
GR2M X1 \tab production store capacity [mm] \cr
GR2M X2 \tab groundwater exchange coefficient [-] \cr
}}
\tabular{ll}{
GR2M X1 \tab production store capacity [mm] \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/month] \cr
\emph{$Precip } \tab [numeric] series of input total precipitation [mm/month] \cr
\emph{$AE } \tab [numeric] series of actual evapotranspiration [mm/month] \cr
\emph{$Pn } \tab [numeric] series of net rainfall (P1) [mm/month] \cr
\emph{$Perc } \tab [numeric] series of percolation (P2) [mm/month] \cr
\emph{$PR } \tab [numeric] series of PR=Pn+Perc (P3) [mm/month] \cr
\emph{$Exch } \tab [numeric] series of potential exchange between catchments [mm/month] \cr
\emph{$Prod } \tab [numeric] series of production store level [mm] \cr
\emph{$Rout } \tab [numeric] series of routing store level [mm] \cr
\emph{$Qsim } \tab [numeric] series of simulated discharge [mm/month] \cr
\emph{$StateEnd} \tab [numeric] states at the end of the run (production store level and routing store level) [mm], \cr\tab see \code{\link{CreateIniStates}} for more details \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 over the test period.
[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/month] (E) \cr
\emph{$Precip } \tab [numeric] series of input total precipitation [mm/month] (P) \cr
\emph{$AE } \tab [numeric] series of actual evapotranspiration [mm/month] \cr
\emph{$Pn } \tab [numeric] series of net rainfall (P1) [mm/month] \cr
\emph{$Ps } \tab [numeric] series of part of P filling the production store [mm/month] \cr
\emph{$Perc } \tab [numeric] series of percolation (P2) [mm/month] \cr
\emph{$PR } \tab [numeric] series of PR=Pn+Perc (P3) [mm/month] \cr
\emph{$AExch } \tab [numeric] series of actual exchange between catchments [mm/month] \cr
\emph{$Prod } \tab [numeric] series of production store level (S) [mm] \cr
\emph{$Rout } \tab [numeric] series of routing store level (R1) [mm] \cr
\emph{$Qsim } \tab [numeric] series of simulated discharge [mm/month] (Q) \cr
\emph{RunOptions$WarmUpQsim} \tab [numeric] series of simulated discharge (Q) on the warm-up period [mm/month] \cr
\emph{RunOptions$Param } \tab [numeric] parameter set parameter set used by the model \cr
\emph{$StateEnd} \tab [numeric] states at the end of the run (production store level and routing store level) [mm]. See \code{\link{CreateIniStates}} for more details \cr
}
Refer to the provided references or to the package source code for further details on these model outputs.
}
\details{
For further details on the model, see the references section.
For further details on the model, see the references section. \cr
For further details on the argument structures and initialisation options, see \code{\link{CreateRunOptions}}.
\cr
\cr
\if{html}{\figure{diagramGR2M-EN.png}{options: width="60\%" alt="Figure: diagramGR4J-EN.png"}}
\if{latex}{\figure{diagramGR2M-EN.pdf}{options: width=6cm}}
}
......@@ -63,54 +70,54 @@ library(airGR)
## loading catchment data
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)
TimeFormat <- "daily"
NewTimeFormat <- "monthly"
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")
## preparation of the InputsModel object
InputsModel <- CreateInputsModel(FUN_MOD = RunModel_GR2M, DatesR = BasinObs$DatesR,
## preparation of the InputsModel object with daily time step data
InputsModel <- CreateInputsModel(FUN_MOD = RunModel_GR4J, DatesR = BasinObs$DatesR,
Precip = BasinObs$P, PotEvap = BasinObs$E)
## conversion of InputsModel to monthly time step
InputsModel <- SeriesAggreg(InputsModel, Format = "\%Y\%m")
## 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(InputsModel$DatesR, format = "\%Y-\%m")=="1990-01"),
which(format(InputsModel$DatesR, format = "\%Y-\%m")=="1999-12"))
## preparation of the RunOptions object
RunOptions <- CreateRunOptions(FUN_MOD = RunModel_GR2M,
InputsModel = InputsModel, IndPeriod_Run = Ind_Run)
## simulation
Param <- c(265.072, 1.040)
Param <- c(X1 = 265.072, X2 = 1.040)
OutputsModel <- RunModel_GR2M(InputsModel = InputsModel, RunOptions = RunOptions, Param = Param)
## conversion of observed discharge to monthly time step
Qobs <- SeriesAggreg(data.frame(BasinObs$DatesR, BasinObs$Qmm),
Format = "\%Y\%m",
ConvertFun = "sum")
Qobs <- Qobs[Ind_Run, 2]
## results preview
plot(OutputsModel, Qobs = BasinObs$Qmm[Ind_Run])
plot(OutputsModel, Qobs = Qobs)
## efficiency criterion: Nash-Sutcliffe Efficiency
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, Obs = Qobs)
OutputsCrit <- ErrorCrit_NSE(InputsCrit = InputsCrit, OutputsModel = OutputsModel)
}
\author{
Laurent Coron, Claude Michel, Safouane Mouelhi
Laurent Coron, Claude Michel, Safouane Mouelhi, Olivier Delaigue, Guillaume Thirel
}
\references{
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, France. \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.
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, France.
\cr\cr
Mouelhi, S., Michel, C., Perrin, C. and Andréassian, V. (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}.
}
......
......@@ -8,6 +8,11 @@
\title{Run with the GR4H hydrological model}
\description{
Function which performs a single run for the GR4H hourly lumped model.
}
\usage{
RunModel_GR4H(InputsModel, RunOptions, Param)
}
......@@ -19,47 +24,51 @@ RunModel_GR4H(InputsModel, RunOptions, Param)
\item{RunOptions}{[object of class \emph{RunOptions}] see \code{\link{CreateRunOptions}} for details}
\item{Param}{[numeric] vector of 4 parameters
\tabular{ll}{
GR4H X1 \tab production store capacity [mm] \cr
GR4H X2 \tab groundwater exchange coefficient [mm/h] \cr
GR4H X3 \tab routing store capacity [mm] \cr
GR4H X4 \tab unit hydrograph time constant [h] \cr
}}
\tabular{ll}{
GR4H X1 \tab production store capacity [mm] \cr
GR4H X2 \tab groundwater exchange coefficient [mm/h] \cr
GR4H X3 \tab routing store capacity [mm] \cr
GR4H X4 \tab unit hydrograph time constant [h] \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 [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 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 UH2 after exchange (QD) [mm/h] \cr
\emph{$Qsim } \tab [numeric] series of simulated discharge [mm/h] \cr
\emph{$StateEnd} \tab [numeric] states at the end of the run (res. levels, UH1 levels, UH2 levels) [mm], see \code{\link{CreateIniStates}} for more details \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 GR4H hourly lumped model.
[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 (E) [mm/h] \cr
\emph{$Precip } \tab [numeric] series of input total precipitation (P) [mm/h] \cr
\emph{$Prod } \tab [numeric] series of production store level (S) [mm] \cr
\emph{$Pn } \tab [numeric] series of net rainfall (Pn) [mm/h] \cr
\emph{$Ps } \tab [numeric] series of the part of Pn filling the production store (Ps) [mm/h \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 (Pr) [mm/h] \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 (R1) [mm] \cr
\emph{$Exch } \tab [numeric] series of potential semi-exchange between catchments [mm/h] \cr
\emph{$AExch1 } \tab [numeric] series of actual exchange between catchments for branch 1 [mm/h] \cr
\emph{$AExch2 } \tab [numeric] series of actual exchange between catchments for branch 2 [mm/h] \cr
\emph{$AExch } \tab [numeric] series of actual exchange between catchments (AExch1+AExch2) [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 UH2 after exchange (Qd) [mm/h] \cr
\emph{$Qsim } \tab [numeric] series of simulated discharge (Q) [mm/h] \cr
\emph{RunOptions$WarmUpQsim} \tab [numeric] series of simulated discharge (Q) on the warm-up period [mm/h] \cr
\emph{RunOptions$Param } \tab [numeric] parameter set parameter set used by the model \cr
\emph{$StateEnd} \tab [numeric] states at the end of the run (res. levels, UH1 levels, UH2 levels) [mm]. See \code{\link{CreateIniStates}} for more details \cr
}
Refer to the provided references or to the package source code for further details on these model outputs.
}
\details{
For further details on the model, see the references section.
For further details on the model, see the references section. \cr
For further details on the argument structures and initialisation options, see \code{\link{CreateRunOptions}}.
\cr
\cr
See \code{\link{RunModel_GR4J}} to look at the diagram of the hydrological model.
}
......@@ -74,15 +83,15 @@ InputsModel <- CreateInputsModel(FUN_MOD = RunModel_GR4H, DatesR = BasinObs$Date
Precip = BasinObs$P, PotEvap = BasinObs$E)
## run period selection
Ind_Run <- seq(which(format(BasinObs$DatesR, format = "\%d/\%m/\%Y \%H:\%M")=="01/03/2004 00:00"),
which(format(BasinObs$DatesR, format = "\%d/\%m/\%Y \%H:\%M")=="31/12/2008 23:00"))
Ind_Run <- seq(which(format(BasinObs$DatesR, format = "\%Y-\%m-\%d \%H")=="2005-01-01 00"),
which(format(BasinObs$DatesR, format = "\%Y-\%m-\%d \%H")=="2008-12-31 23"))
## preparation of the RunOptions object
RunOptions <- CreateRunOptions(FUN_MOD = RunModel_GR4H,
InputsModel = InputsModel, IndPeriod_Run = Ind_Run)
## simulation
Param <- c(521.113, -2.918, 218.009, 4.124)
Param <- c(X1 = 756.930, X2 = -0.773, X3 = 138.638, X4 = 5.247)
OutputsModel <- RunModel_GR4H(InputsModel = InputsModel, RunOptions = RunOptions, Param = Param)
## results preview
......@@ -90,27 +99,31 @@ plot(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])
RunOptions = RunOptions, Obs = BasinObs$Qmm[Ind_Run])
OutputsCrit <- ErrorCrit_NSE(InputsCrit = InputsCrit, OutputsModel = OutputsModel)
}
\author{
Laurent Coron, Charles Perrin, Thibaut Mathevet
Laurent Coron, Charles Perrin, Thibaut Mathevet, Olivier Delaigue, Guillaume Thirel
}
\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. \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
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.
\cr\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 (in French), UPMC - Cemagref Antony, Paris, France.
}
\seealso{
\code{\link{RunModel_GR4J}},
\code{\link{RunModel_GR4J}}, \code{\link{RunModel_CemaNeigeGR4H}},
\code{\link{CreateInputsModel}}, \code{\link{CreateRunOptions}}, \code{\link{CreateIniStates}}.
}
......@@ -8,6 +8,11 @@
\title{Run with the GR4J hydrological model}
\description{
Function which performs a single run for the GR4J daily lumped model over the test period.
}
\usage{
RunModel_GR4J(InputsModel, RunOptions, Param)
}
......@@ -19,51 +24,52 @@ RunModel_GR4J(InputsModel, RunOptions, Param)
\item{RunOptions}{[object of class \emph{RunOptions}] see \code{\link{CreateRunOptions}} for details}
\item{Param}{[numeric] vector of 4 parameters
\tabular{ll}{
GR4J X1 \tab production store capacity [mm] \cr
GR4J X2 \tab intercatchment exchange coefficient [mm/d] \cr
GR4J X3 \tab routing store capacity [mm] \cr
GR4J X4 \tab unit hydrograph time constant [d] \cr
}}
\tabular{ll}{
GR4J X1 \tab production store capacity [mm] \cr
GR4J X2 \tab intercatchment exchange coefficient [mm/d] \cr
GR4J X3 \tab routing store capacity [mm] \cr
GR4J X4 \tab unit hydrograph time constant [d] \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/d] \cr
\emph{$Precip } \tab [numeric] series of input total precipitation [mm/d] \cr
\emph{$Prod } \tab [numeric] series of production store level [mm] \cr
\emph{$Pn } \tab [numeric] series of net rainfall [mm/d] \cr
\emph{$Ps } \tab [numeric] series of the part of Pn filling the production store [mm/d] \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 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{$AExch1 } \tab [numeric] series of actual exchange between catchments for branch 1 [mm/d] \cr
\emph{$AExch2 } \tab [numeric] series of actual exchange between catchments for branch 2 [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 UH2 after exchange (QD) [mm/d] \cr
\emph{$Qsim } \tab [numeric] series of simulated discharge [mm/d] \cr
\emph{$StateEnd} \tab [numeric] states at the end of the run (res. levels, UH1 levels, UH2 levels) [mm], \cr\tab see \code{\link{CreateIniStates}} for more details \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 over the test period.
[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/d] (E) \cr
\emph{$Precip } \tab [numeric] series of input total precipitation (P) [mm/d] \cr
\emph{$Prod } \tab [numeric] series of production store level (S) [mm] \cr
\emph{$Pn } \tab [numeric] series of net rainfall (Pn) [mm/d] \cr
\emph{$Ps } \tab [numeric] series of the part of Pn filling the production store (Ps) [mm/d] \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 (Pr) [mm/d] \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 (R1) [mm] \cr
\emph{$Exch } \tab [numeric] series of potential semi-exchange between catchments [mm/d] \cr
\emph{$AExch1 } \tab [numeric] series of actual exchange between catchments for branch 1 [mm/d] \cr
\emph{$AExch2 } \tab [numeric] series of actual exchange between catchments for branch 2 [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 UH2 after exchange (Qd) [mm/d] \cr
\emph{$Qsim } \tab [numeric] series of simulated discharge (Q) [mm/d] \cr
\emph{RunOptions$WarmUpQsim} \tab [numeric] series of simulated discharge (Q) on the warm-up period [mm/d] \cr
\emph{RunOptions$Param } \tab [numeric] parameter set parameter set used by the model \cr
\emph{$StateEnd} \tab [numeric] states at the end of the run (res. levels, UH1 levels, UH2 levels) [mm]. See \code{\link{CreateIniStates}} for more details \cr
}
Refer to the provided references or to the package source code for further details on these model outputs.
}
\details{
For further details on the model, see the references section.
For further details on the model, see the references section. \cr
For further details on the argument structures and initialisation options, see \code{\link{CreateRunOptions}}.
\cr
\cr
\if{html}{\figure{diagramGR4J-EN.png}{options: width="60\%" alt="Figure: diagramGR4J-EN.png"}}
\if{latex}{\figure{diagramGR4J-EN.pdf}{options: width=6cm}}
}
......@@ -74,45 +80,46 @@ library(airGR)
data(L0123001)
## preparation of the InputsModel object
InputsModel <- CreateInputsModel(FUN_MOD = RunModel_GR4J, DatesR = BasinObs$DatesR,
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")=="01/01/1990"),
which(format(BasinObs$DatesR, format = "\%d/\%m/\%Y")=="31/12/1999"))
Ind_Run <- seq(which(format(BasinObs$DatesR, format = "\%Y-\%m-\%d")=="1990-01-01"),
which(format(BasinObs$DatesR, format = "\%Y-\%m-\%d")=="1999-12-31"))
## preparation of the RunOptions object
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(X1 = 257.238, X2 = 1.012, X3 = 88.235, X4 = 2.208)
OutputsModel <- RunModel_GR4J(InputsModel = InputsModel,
RunOptions = RunOptions, Param = Param)
## results preview
plot(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])
InputsCrit <- CreateInputsCrit(FUN_CRIT = ErrorCrit_NSE, InputsModel = InputsModel,
RunOptions = RunOptions, Obs = BasinObs$Qmm[Ind_Run])
OutputsCrit <- ErrorCrit_NSE(InputsCrit = InputsCrit, OutputsModel = OutputsModel)
}
\author{
Laurent Coron, Claude Michel, Charles Perrin
Laurent Coron, Claude Michel, Charles Perrin, Olivier Delaigue
}
\references{
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.
Perrin, C., Michel, C. and Andréassian, V. (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}.
}
\seealso{
\code{\link{RunModel_GR5J}}, \code{\link{RunModel_GR6J}}, \code{\link{RunModel_CemaNeigeGR4J}},
\code{\link{CreateInputsModel}}, \code{\link{CreateRunOptions}}, \code{\link{CreateIniStates}}.
\code{\link{CreateInputsModel}}, \code{\link{CreateRunOptions}}, \code{\link{CreateIniStates}}.
}
\encoding{UTF-8}
\name{RunModel_GR5H}
\alias{RunModel_GR5H}
\title{Run with the GR5H hydrological model}
\description{
Function which performs a single run for the GR5H hourly lumped model.
}
\usage{
RunModel_GR5H(InputsModel, RunOptions, Param)
}
\arguments{
\item{InputsModel}{[object of class \emph{InputsModel}] see \code{\link{CreateInputsModel}} for details}
\item{RunOptions}{[object of class \emph{RunOptions}] see \code{\link{CreateRunOptions}} for details}
\item{Param}{[numeric] vector of 5 parameters
\tabular{ll}{
GR5H X1 \tab production store capacity [mm] \cr
GR5H X2 \tab intercatchment exchange coefficient [mm/h] \cr
GR5H X3 \tab routing store capacity [mm] \cr
GR5H X4 \tab unit hydrograph time constant [h] \cr
GR5H X5 \tab intercatchment exchange threshold [-] \cr
}}
}
\value{
[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 (E) [mm/h] \cr
\emph{$Precip } \tab [numeric] series of input total precipitation (P) [mm/h] \cr
\emph{$Interc } \tab [numeric] series of interception store level (I) [mm] \cr
\emph{$Prod } \tab [numeric] series of production store level (S) [mm] \cr
\emph{$Pn } \tab [numeric] series of net rainfall (Pn) [mm/h] \cr
\emph{$Ps } \tab [numeric] series of the part of Pn filling the production store (Ps) [mm/h] \cr
\emph{$AE } \tab [numeric] series of actual evapotranspiration (Ei+Es) [mm/h] \cr
\emph{$EI } \tab [numeric] series of evapotranspiration from rainfall neutralisation or interception store (Ei) [mm/h] \cr
\emph{$ES } \tab [numeric] series of evapotranspiration from production store (Es) [mm/h] \cr
\emph{$Perc } \tab [numeric] series of percolation (Perc) [mm/h] \cr
\emph{$PR } \tab [numeric] series of Pr=Pn-Ps+Perc (Pr) [mm/h] \cr
\emph{$Q9 } \tab [numeric] series of UH outflow going into branch 9 (Q9) [mm/h] \cr
\emph{$Q1 } \tab [numeric] series of UH outflow going into branch 1 (Q1) [mm/h] \cr
\emph{$Rout } \tab [numeric] series of routing store level (R1) [mm] \cr
\emph{$Exch } \tab [numeric] series of potential semi-exchange between catchments [mm/h] \cr
\emph{$AExch1 } \tab [numeric] series of actual exchange between catchments for branch 1 [mm/h] \cr
\emph{$AExch2 } \tab [numeric] series of actual exchange between catchments for branch 2 [mm/h] \cr
\emph{$AExch } \tab [numeric] series of actual exchange between catchments (AExch1+AExch2) [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 UH after exchange (Qd) [mm/h] \cr
\emph{$Qsim } \tab [numeric] series of simulated discharge (Q) [mm/h] \cr
\emph{RunOptions$WarmUpQsim} \tab [numeric] series of simulated discharge (Q) on the warm-up period [mm/h] \cr
\emph{RunOptions$Param } \tab [numeric] parameter set parameter set used by the model \cr
\emph{$StateEnd} \tab [numeric] states at the end of the run (res. levels, UH levels) [mm]. See \code{\link{CreateIniStates}} for more details \cr
}
Refer to the provided references or to the package source code for further details on these model outputs.
}
\details{
It is advised to run the GR5H model with an interception store (see Ficchi (2017) and Ficchi et al. (2019)) as it improves the consistency of the model fluxes and provides better performance. To do so, the \code{\link{Imax}} function allows to estimate the maximal capacity of the interception store, which can then be given to \code{\link{CreateRunOptions}}. \cr
For further details on the model, see the references section. \cr
For further details on the argument structures and initialisation options, see \code{\link{CreateRunOptions}}.
\cr
\cr
\if{html}{\figure{diagramGR5H-EN.png}{options: width="60\%" alt="Figure: diagramGR5H-EN.png"}}
\if{latex}{\figure{diagramGR5H-EN.pdf}{options: width=6cm}}
\cr
\cr
See \code{\link{RunModel_GR5J}} to look at the diagram of the hydrological model when no interception store is used.
}
\examples{
library(airGR)
## load of catchment data
data(L0123003)
## preparation of the InputsModel object
InputsModel <- CreateInputsModel(FUN_MOD = RunModel_GR5H, DatesR = BasinObs$DatesR,
Precip = BasinObs$P, PotEvap = BasinObs$E)
## run period selection
Ind_Run <- seq(which(format(BasinObs$DatesR, format = "\%Y-\%m-\%d \%H")=="2006-01-01 00"),
which(format(BasinObs$DatesR, format = "\%Y-\%m-\%d \%H")=="2006-12-31 23"))
## Imax computation
Imax <- Imax(InputsModel = InputsModel, IndPeriod_Run = Ind_Run,
TestedValues = seq(from = 0, to = 3, by = 0.2))
## preparation of the RunOptions object
RunOptions <- CreateRunOptions(FUN_MOD = RunModel_GR5H, Imax = Imax,
InputsModel = InputsModel, IndPeriod_Run = Ind_Run)
## simulation
Param <- c(X1 = 706.912, X2 = -0.163, X3 = 188.880, X4 = 2.575, X5 = 0.104)
OutputsModel <- RunModel_GR5H(InputsModel = InputsModel, RunOptions = RunOptions, Param = Param)
## results preview
plot(OutputsModel, Qobs = BasinObs$Qmm[Ind_Run])
## efficiency criterion: Nash-Sutcliffe Efficiency
InputsCrit <- CreateInputsCrit(FUN_CRIT = ErrorCrit_NSE, InputsModel = InputsModel,
RunOptions = RunOptions, Obs = BasinObs$Qmm[Ind_Run])
OutputsCrit <- ErrorCrit_NSE(InputsCrit = InputsCrit, OutputsModel = OutputsModel)
}
\author{
Laurent Coron, Guillaume Thirel, Olivier Delaigue
}
\references{
Ficchi, A. (2017).
An adaptive hydrological model for multiple time-steps:
Diagnostics and improvements based on fluxes consistency.
PhD thesis, UPMC - Irstea Antony, Paris, France.
\cr\cr
Ficchi, A., Perrin, C. and Andréassian, V. (2019).
Hydrological modelling at multiple sub-daily time steps: model improvement via flux-matching.
Journal of Hydrology, 575, 1308-1327, \doi{10.1016/j.jhydrol.2019.05.084}.
}
\seealso{
\code{\link{RunModel_GR4H}}, \code{\link{RunModel_CemaNeigeGR5H}}, \code{\link{Imax}},
\code{\link{CreateInputsModel}}, \code{\link{CreateRunOptions}}, \code{\link{CreateIniStates}}.
}
......@@ -8,6 +8,11 @@
\title{Run with the GR5J hydrological model}
\description{
Function which performs a single run for the GR5J daily lumped model over the test period.
}
\usage{
RunModel_GR5J(InputsModel, RunOptions, Param)
}
......@@ -19,52 +24,53 @@ RunModel_GR5J(InputsModel, RunOptions, Param)
\item{RunOptions}{[object of class \emph{RunOptions}] see \code{\link{CreateRunOptions}} for details}
\item{Param}{[numeric] vector of 5 parameters
\tabular{ll}{
GR5J X1 \tab production store capacity [mm] \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 threshold [-] \cr
}}
\tabular{ll}{
GR5J X1 \tab production store capacity [mm] \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 threshold [-] \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/d] \cr
\emph{$Precip } \tab [numeric] series of input total precipitation [mm/d] \cr
\emph{$Prod } \tab [numeric] series of production store level [mm] \cr
\emph{$Pn } \tab [numeric] series of net rainfall [mm/d] \cr
\emph{$Ps } \tab [numeric] series of the part of Pn filling the production store [mm/d] \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 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{$AExch1 } \tab [numeric] series of actual exchange between catchments for branch 1 [mm/d] \cr
\emph{$AExch2 } \tab [numeric] series of actual exchange between catchments for branch 2 [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 UH2 after exchange (QD) [mm/d] \cr
\emph{$Qsim } \tab [numeric] series of simulated discharge [mm/d] \cr
\emph{$StateEnd} \tab [numeric] states at the end of the run (res. levels, UH1 levels, UH2 levels) [mm], \cr\tab see \code{\link{CreateIniStates}} for more details \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 over the test period.
[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 (E) [mm/d] \cr
\emph{$Precip } \tab [numeric] series of input total precipitation (P) [mm/d] \cr
\emph{$Prod } \tab [numeric] series of production store level (S) [mm] \cr
\emph{$Pn } \tab [numeric] series of net rainfall (Pn) [mm/d] \cr
\emph{$Ps } \tab [numeric] series of the part of Pn filling the production store (Ps) [mm/d] \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 (Pr) [mm/d] \cr
\emph{$Q9 } \tab [numeric] series of UH outflow going into branch 9 (Q9) [mm/d] \cr
\emph{$Q1 } \tab [numeric] series of UH outflow going into branch 1 (Q1) [mm/d] \cr
\emph{$Rout } \tab [numeric] series of routing store level (R1) [mm] \cr
\emph{$Exch } \tab [numeric] series of potential semi-exchange between catchments [mm/d] \cr
\emph{$AExch1 } \tab [numeric] series of actual exchange between catchments for branch 1 [mm/d] \cr
\emph{$AExch2 } \tab [numeric] series of actual exchange between catchments for branch 2 [mm/d] \cr
\emph{$AExch } \tab [numeric] series of actual exchange between catchments (AExch1+AExch2) [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 UH after exchange (Qd) [mm/d] \cr
\emph{$Qsim } \tab [numeric] series of simulated discharge (Q) [mm/d] \cr
\emph{RunOptions$WarmUpQsim} \tab [numeric] series of simulated discharge (Q) on the warm-up period [mm/d] \cr
\emph{RunOptions$Param } \tab [numeric] parameter set parameter set used by the model \cr
\emph{$StateEnd} \tab [numeric] states at the end of the run (res. levels, UH levels) [mm]. See \code{\link{CreateIniStates}} for more details \cr
}
Refer to the provided references or to the package source code for further details on these model outputs.
}
\details{
For further details on the model, see the references section.
For further details on the model, see the references section. \cr
For further details on the argument structures and initialisation options, see \code{\link{CreateRunOptions}}.
\cr
\cr
\if{html}{\figure{diagramGR5J-EN.png}{options: width="60\%" alt="Figure: diagramGR5J-EN.png"}}
\if{latex}{\figure{diagramGR5J-EN.pdf}{options: width=6cm}}
}
......@@ -75,19 +81,19 @@ library(airGR)
data(L0123001)
## preparation of the InputsModel object
InputsModel <- CreateInputsModel(FUN_MOD = RunModel_GR5J, DatesR = BasinObs$DatesR,
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")=="01/01/1990"),
which(format(BasinObs$DatesR, format = "\%d/\%m/\%Y")=="31/12/1999"))
Ind_Run <- seq(which(format(BasinObs$DatesR, format = "\%Y-\%m-\%d")=="1990-01-01"),
which(format(BasinObs$DatesR, format = "\%Y-\%m-\%d")=="1999-12-31"))
## preparation of the RunOptions object
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)
Param <- c(X1 = 245.918, X2 = 1.027, X3 = 90.017, X4 = 2.198, X5 = 0.434)
OutputsModel <- RunModel_GR5J(InputsModel = InputsModel,
RunOptions = RunOptions, Param = Param)
......@@ -95,23 +101,26 @@ OutputsModel <- RunModel_GR5J(InputsModel = InputsModel,
plot(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])
InputsCrit <- CreateInputsCrit(FUN_CRIT = ErrorCrit_NSE, InputsModel = InputsModel,
RunOptions = RunOptions, Obs = BasinObs$Qmm[Ind_Run])
OutputsCrit <- ErrorCrit_NSE(InputsCrit = InputsCrit, OutputsModel = OutputsModel)
}
\author{
Laurent Coron, Claude Michel, Nicolas Le Moine
Laurent Coron, Claude Michel, Nicolas Le Moine, Olivier Delaigue, Guillaume Thirel
}
\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),
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
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.
\cr\cr
Pushpalatha, R., Perrin, C., Le Moine, N., Mathevet, T. and Andréassian, V. (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}.
}
......
......@@ -8,6 +8,11 @@
\title{Run with the GR6J hydrological model}
\description{
Function which performs a single run for the GR6J daily lumped model over the test period.
}
\usage{
RunModel_GR6J(InputsModel, RunOptions, Param)
}
......@@ -19,55 +24,56 @@ RunModel_GR6J(InputsModel, RunOptions, Param)
\item{RunOptions}{[object of class \emph{RunOptions}] see \code{\link{CreateRunOptions}} for details}
\item{Param}{[numeric] vector of 6 parameters
\tabular{ll}{
GR6J X1 \tab production store capacity [mm] \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 threshold [-] \cr
GR6J X6 \tab coefficient for emptying exponential store [mm] \cr
}}
\tabular{ll}{
GR6J X1 \tab production store capacity [mm] \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 threshold [-] \cr
GR6J X6 \tab exponential store depletion coefficient [mm] \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/d] \cr
\emph{$Precip } \tab [numeric] series of input total precipitation [mm/d] \cr
\emph{$Prod } \tab [numeric] series of production store level [mm] \cr
\emph{$Pn } \tab [numeric] series of net rainfall [mm/d] \cr
\emph{$Ps } \tab [numeric] series of the part of Pn filling the production store [mm/d] \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 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{$AExch1 } \tab [numeric] series of actual exchange between catchments for branch 1 [mm/d] \cr
\emph{$AExch2 } \tab [numeric] series of actual exchange between catchments for branch 2 [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{$QRExp } \tab [numeric] series of exponential store outflow (QRExp) [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, UH1 levels, UH2 levels) [mm], \cr\tab see \code{\link{CreateIniStates}} for more details \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 over the test period.
[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 (E) [mm/d] \cr
\emph{$Precip } \tab [numeric] series of input total precipitation (P) [mm/d] \cr
\emph{$Prod } \tab [numeric] series of production store level (S) [mm] \cr
\emph{$Pn } \tab [numeric] series of net rainfall (Pn) [mm/d] \cr
\emph{$Ps } \tab [numeric] series of the part of Pn filling the production store (Ps) [mm/d] \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 (Pr) [mm/d] \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 (R1) [mm] \cr
\emph{$Exch } \tab [numeric] series of potential semi-exchange between catchments [mm/d] \cr
\emph{$AExch1 } \tab [numeric] series of actual exchange between catchments for branch 1 [mm/d] \cr
\emph{$AExch2 } \tab [numeric] series of actual exchange between catchments for branch 2 [mm/d] \cr
\emph{$AExch } \tab [numeric] series of actual exchange between catchments (AExch1+AExch2) [mm/d] \cr
\emph{$QR } \tab [numeric] series of routing store outflow (Qr) [mm/d] \cr
\emph{$QRExp } \tab [numeric] series of exponential store outflow (QrExp) [mm/d] \cr
\emph{$Exp } \tab [numeric] series of exponential store level (negative) (R2) [mm] \cr
\emph{$QD } \tab [numeric] series of direct flow from UH2 after exchange (Qd) [mm/d] \cr
\emph{$Qsim } \tab [numeric] series of simulated discharge (Q) [mm/d] \cr
\emph{RunOptions$WarmUpQsim} \tab [numeric] series of simulated discharge (Q) on the warm-up period [mm/d] \cr
\emph{RunOptions$Param } \tab [numeric] parameter set parameter set used by the model \cr
\emph{$StateEnd} \tab [numeric] states at the end of the run (res. levels, UH1 levels, UH2 levels) [mm]. See \code{\link{CreateIniStates}} for more details \cr
}
Refer to the provided references or to the package source code for further details on these model outputs.
}
\details{
For further details on the model, see the references section.
For further details on the model, see the references section. \cr
For further details on the argument structures and initialisation options, see \code{\link{CreateRunOptions}}.
\cr
\cr
\if{html}{\figure{diagramGR6J-EN.png}{options: width="60\%" alt="Figure: diagramGR6J-EN.png"}}
\if{latex}{\figure{diagramGR6J-EN.pdf}{options: width=6cm}}
}
......@@ -78,45 +84,46 @@ library(airGR)
data(L0123001)
## preparation of the InputsModel object
InputsModel <- CreateInputsModel(FUN_MOD = RunModel_GR6J, DatesR = BasinObs$DatesR,
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")=="01/01/1990"),
which(format(BasinObs$DatesR, format = "\%d/\%m/\%Y")=="31/12/1999"))
Ind_Run <- seq(which(format(BasinObs$DatesR, format = "\%Y-\%m-\%d")=="1990-01-01"),
which(format(BasinObs$DatesR, format = "\%Y-\%m-\%d")=="1999-12-31"))
## preparation of the RunOptions object
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(X1 = 242.257, X2 = 0.637, X3 = 53.517, X4 = 2.218, X5 = 0.424, X6 = 4.759)
OutputsModel <- RunModel_GR6J(InputsModel = InputsModel,
RunOptions = RunOptions, Param = Param)
## results preview
plot(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])
InputsCrit <- CreateInputsCrit(FUN_CRIT = ErrorCrit_NSE, InputsModel = InputsModel,
RunOptions = RunOptions, Obs = BasinObs$Qmm[Ind_Run])
OutputsCrit <- ErrorCrit_NSE(InputsCrit = InputsCrit, OutputsModel = OutputsModel)
}
\author{
Laurent Coron, Claude Michel, Charles Perrin, Raji Pushpalatha, Nicolas Le Moine
Laurent Coron, Claude Michel, Charles Perrin, Raji Pushpalatha, Nicolas Le Moine, Olivier Delaigue, Guillaume Thirel
}
\references{
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
Pushpalatha, R., Perrin, C., Le Moine, N., Mathevet, T. and Andréassian, V. (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}.
}
\seealso{
\code{\link{RunModel_GR4J}}, \code{\link{RunModel_GR5J}}, \code{\link{RunModel_CemaNeigeGR6J}},
\code{\link{CreateInputsModel}}, \code{\link{CreateRunOptions}}, \code{\link{CreateIniStates}}.
\code{\link{CreateInputsModel}}, \code{\link{CreateRunOptions}}, \code{\link{CreateIniStates}}.
}
\encoding{UTF-8}
\name{RunModel_Lag}
\alias{RunModel_Lag}
\title{Run with the Lag model}
\description{
Function which performs a single run for the Lag model over the test period.
}
\usage{
RunModel_Lag(InputsModel, RunOptions, Param, QcontribDown)
}
\arguments{
\item{InputsModel}{[object of class \emph{InputsModel}] created with SD model inputs, see \code{\link{CreateInputsModel}} for details. The object should also contain a key \emph{OutputsModel} of class \code{\link{CreateInputsModel}} coming from the simulation of the downstream subcatchment runoff.}
\item{RunOptions}{[object of class \emph{RunOptions}] see \code{\link{CreateRunOptions}} for details}
\item{Param}{[numeric] vector of 1 parameter
\tabular{ll}{
Velocity \tab mean flow velocity [m/s]
}
}
\item{QcontribDown}{[numeric] vector or [OutputsModel] containing the time series of the runoff contribution of the downstream sub-basin}
}
\value{
[list] see \code{\link{RunModel_GR4J}} or \code{\link{RunModel_CemaNeigeGR4J}} for details.
The list value contains an extra item named \code{QsimDown} which is a copy of the runoff contribution of the downstream sub-basin contained in argument \code{QcontribDown} in [mm/time step].
}
\examples{
#####################################################################
## Simulation of a reservoir with a purpose of low-flow mitigation ##
#####################################################################
## ---- preparation of the InputsModel object
## loading package and catchment data
library(airGR)
data(L0123001)
## ---- simulation of the hydrological catchment with GR4J
InputsModelDown <- 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 = "\%Y-\%m-\%d")=="1990-01-01"),
which(format(BasinObs$DatesR, format = "\%Y-\%m-\%d")=="1999-12-31"))
## creation of the RunOptions object
RunOptionsDown <- CreateRunOptions(FUN_MOD = RunModel_GR4J,
InputsModel = InputsModelDown, IndPeriod_Run = Ind_Run)
## simulation of the runoff of the catchment with a GR4J model
Param <- c(X1 = 257.238, X2 = 1.012, X3 = 88.235, X4 = 2.208)
OutputsModelDown <- RunModel_GR4J(InputsModel = InputsModelDown,
RunOptions = RunOptionsDown, Param = Param)
## ---- specifications of the reservoir
## the reservoir withdraws 1 m3/s when it's possible considering the flow observed in the basin
Qupstream <- matrix(-sapply(BasinObs$Qls / 1000 - 1, function(x) {
min(1, max(0, x, na.rm = TRUE))
}), ncol = 1)
## except between July and September when the reservoir releases 3 m3/s for low-flow mitigation
month <- as.numeric(format(BasinObs$DatesR, "\%m"))
Qupstream[month >= 7 & month <= 9] <- 3
Qupstream <- Qupstream * 86400 ## Conversion in m3/day
## the reservoir is not an upstream subcachment: its areas is NA
BasinAreas <- c(NA, BasinInfo$BasinArea)
## delay time between the reservoir and the catchment outlet is 2 days and the distance is 150 km
LengthHydro <- 150
## ---- simulation of the basin with the reservoir influence
InputsModelInf <- CreateInputsModel(FUN_MOD = RunModel_GR4J, DatesR = BasinObs$DatesR,
Precip = BasinObs$P, PotEvap = BasinObs$E,
Qupstream = Qupstream, LengthHydro = LengthHydro,
BasinAreas = BasinAreas)
## creation of the RunOptions object
RunOptions <- CreateRunOptions(FUN_MOD = RunModel_GR4J,
InputsModel = InputsModelInf, IndPeriod_Run = Ind_Run)
## with a delay of 2 days for 150 km, the flow velocity is 75 km per day
Velocity <- (LengthHydro * 1e3 / 2) / (24 * 60 * 60) ## Conversion km/day -> m/s
## run the lag model which routes precipitation-runoff model and upstream flows
OutputsModel <- RunModel_Lag(InputsModel = InputsModelInf,
RunOptions = RunOptions,
Param = Velocity,
QcontribDown = OutputsModelDown)
## results preview of comparison between naturalised (observed) and influenced flow (simulated)
plot(OutputsModel, Qobs = OutputsModel$QsimDown)
}
\author{
Olivier Delaigue, David Dorchies, Guillaume Thirel
}
\seealso{
\code{\link{RunModel}}, \code{\link{CreateInputsModel}}, \code{\link{CreateRunOptions}}.
}
......@@ -3,46 +3,92 @@
\name{SeriesAggreg}
\alias{SeriesAggreg}
\alias{SeriesAggreg.list}
\alias{SeriesAggreg.data.frame}
\alias{SeriesAggreg.InputsModel}
\alias{SeriesAggreg.OutputsModel}
\title{Conversion of time series to another time step (aggregation only)}
\title{Conversion of time series to another time step (aggregation only) and regime computation}
\description{
Conversion of time series to another time step (aggregation only) and regime computation. \cr
Warning: on the aggregated outputs, the dates correspond to the beginning of the time step \cr
(e.g. for daily time series 2005-03-01 00:00 = value for period 2005-03-01 00:00 - 2005-03-01 23:59) \cr
(e.g. for monthly time series 2005-03-01 00:00 = value for period 2005-03-01 00:00 - 2005-03-31 23:59) \cr
(e.g. for yearly time series 2005-03-01 00:00 = value for period 2005-03-01 00:00 - 2006-02-28 23:59)
}
\details{
\code{\link{SeriesAggreg.InputsModel}} and \code{\link{SeriesAggreg.OutputsModel}}
call \code{\link{SeriesAggreg.list}} which itself calls \code{\link{SeriesAggreg.data.frame}}.
So, all arguments passed to any \code{\link{SeriesAggreg}} method will be passed to \code{\link{SeriesAggreg.data.frame}}.
Argument \code{ConvertFun} also supports quantile calculation by using the syntax "Q[nn]" with [nn] the requested percentile.
E.g. use "Q90" for calculating 90th percentile in the aggregation.
The formula used is: \code{quantile(x, probs = perc / 100, type = 8, na.rm = TRUE)}.
As there are multiple ways to take into account missing values in aggregation functions, \code{NA}s are not supported by \code{SeriesAggreg} and it provides \code{NA} values when \code{NA}s are present in the \code{x} input.
}
\usage{
SeriesAggreg(TabSeries, TimeFormat, NewTimeFormat, ConvertFun,
YearFirstMonth = 1, TimeLag = 0, verbose = TRUE)
\method{SeriesAggreg}{data.frame}(x,
Format,
ConvertFun,
TimeFormat = NULL,
NewTimeFormat = NULL,
YearFirstMonth = 1,
TimeLag = 0,
\dots)
\method{SeriesAggreg}{list}(x,
Format,
ConvertFun,
NewTimeFormat = NULL,
simplify = FALSE,
except = NULL,
recursive = TRUE,
\dots)
\method{SeriesAggreg}{InputsModel}(x, Format, \dots)
\method{SeriesAggreg}{OutputsModel}(x, Format, \dots)
}
\arguments{
\item{TabSeries}{[POSIXt+numeric] data.frame containing the vector of dates (POSIXt) and the time series values numeric)}
\item{x}{[InputsModel], [OutputsModel], [list] or [data.frame] containing the vector of dates (\emph{POSIXt}) and the time series of numeric values}
\item{Format}{[character] output time step format (i.e. yearly times series: \code{"\%Y"}, monthly time series: \code{"\%Y\%m"}, daily time series: \code{"\%Y\%m\%d"}, monthly regimes: \code{"\%m"}, daily regimes: \code{"\%d"})}
\item{TimeFormat}{[character] desired format (i.e. \code{"hourly"}, \code{"daily"}, \code{"monthly"} or \code{"yearly"})}
\item{TimeFormat}{(deprecated) [character] input time step format (i.e. \code{"hourly"}, \code{"daily"}, \code{"monthly"} or \code{"yearly"}). Use the \code{x} argument instead}
\item{NewTimeFormat}{[character] desired format (i.e. \code{"hourly"}, \code{"daily"}, \code{"monthly"} or \code{"yearly"})}
\item{NewTimeFormat}{(deprecated) [character] output time step format (i.e. \code{"hourly"}, \code{"daily"}, \code{"monthly"} or \code{"yearly"}). Use the \code{Format} argument instead}
\item{ConvertFun}{[character] names of aggregation functions (e.g. for P[mm], T[degC], Q[mm] : \code{ConvertFun = c("sum", "mean", "sum"}))}
\item{ConvertFun}{[character] names of aggregation functions (e.g. for P[mm], T[degC], Q[mm]: \code{ConvertFun = c("sum", "mean", "sum"})) or name of aggregation function to apply to all elements if the parameter 'x' is a [list] . See details}
\item{YearFirstMonth}{(optional) [numeric] integer used when \code{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 \code{Format = "\%Y"} to set when the starting month of the year (e.g. 01 for calendar year or 09 for hydrological year starting in September)}
\item{TimeLag}{(optional) [numeric] numeric indicating a time lag (in seconds) for the time series aggregation (especially useful to aggregate hourly time series in daily time series)}
\item{TimeLag}{(optional) [numeric] numeric indicating a time lag (in seconds) for the time series aggregation (especially useful to aggregate hourly time series into daily time series)}
\item{verbose}{(optional) [boolean] boolean indicating if the function is run in verbose mode or not, default = \code{FALSE}}
\item{simplify}{(optional) [boolean] if set to \code{TRUE}, a \code{\link{data.frame}} is returned instead of a \code{\link{list}}. Embedded lists are then ignored. (default = \code{FALSE})}
\item{except}{(optional) [character] the name of the items to skip in the aggregation (default = \code{NULL})}
\item{recursive}{(optional) [boolean] if set to \code{FALSE}, embedded lists and dataframes are not aggregated (default = \code{TRUE})}
\item{\dots}{Arguments passed to \code{\link{SeriesAggreg.list}} and then to \code{\link{SeriesAggreg.data.frame}}}
}
\value{
[POSIXct+numeric] data.frame containing a vector of aggregated dates (POSIXct) and time series values numeric)
}
\description{
Conversion of time series to another time step (aggregation only). \cr
Warning : on the aggregated outputs, the dates correspond 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{
library(airGR)
......@@ -50,23 +96,31 @@ library(airGR)
data(L0123002)
## preparation of the initial time series data frame at the daily time step
TabSeries <- data.frame(BasinObs$DatesR, BasinObs$P, BasinObs$E, BasinObs$T, BasinObs$Qmm)
TimeFormat <- "daily"
TabSeries <- BasinObs[, c("DatesR", "P", "E", "T", "Qmm")]
## monthly time series
NewTabSeries <- SeriesAggreg(TabSeries,
Format = "\%Y\%m",
ConvertFun = c("sum", "sum", "mean", "sum"))
str(NewTabSeries)
## monthly regimes
NewTabSeries <- SeriesAggreg(TabSeries,
Format = "\%m",
ConvertFun = c("sum", "sum", "mean", "sum"))
str(NewTabSeries)
## conversion at the monthly time step
NewTimeFormat <- "monthly"
ConvertFun <- c("sum", "sum", "mean", "sum")
NewTabSeries <- SeriesAggreg(TabSeries = TabSeries, TimeFormat, NewTimeFormat, ConvertFun)
## conversion of InputsModel
example("RunModel_GR2M")
## conversion at the yearly time step
NewTimeFormat <- "yearly"
ConvertFun <- c("sum", "sum", "mean", "sum")
NewTabSeries <- SeriesAggreg(TabSeries = TabSeries, TimeFormat, NewTimeFormat, ConvertFun)
## monthly regimes on OutputsModel object
SimulatedMonthlyRegime <- SeriesAggreg(OutputsModel, Format = "\%m")
str(SimulatedMonthlyRegime)
}
\author{
Laurent Coron
Olivier Delaigue, David Dorchies
}