RunModel.Rd 2.25 KB
Newer Older
Delaigue Olivier's avatar
Delaigue Olivier committed
1
\encoding{UTF-8}
2
3


Delaigue Olivier's avatar
Delaigue Olivier committed
4
5
6
\name{RunModel}
\alias{RunModel}
\title{Run with the provided hydrological model function}
7
8


Delaigue Olivier's avatar
Delaigue Olivier committed
9
10
11
\usage{
RunModel(InputsModel, RunOptions, Param, FUN_MOD)
}
12
13


Delaigue Olivier's avatar
Delaigue Olivier committed
14
15
16
17
18
19
20
\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 model parameters}

21
\item{FUN_MOD}{[function] hydrological model function (e.g. \code{\link{RunModel_GR4J}}, \code{\link{RunModel_CemaNeigeGR4J}})}
Delaigue Olivier's avatar
Delaigue Olivier committed
22
}
23
24


Delaigue Olivier's avatar
Delaigue Olivier committed
25
26
27
\value{
[list] see \code{\link{RunModel_GR4J}} or \code{\link{RunModel_CemaNeigeGR4J}} for details
}
28
29


Delaigue Olivier's avatar
Delaigue Olivier committed
30
\description{
31
Function which performs a single model run with the provided function over the selected period.
Delaigue Olivier's avatar
Delaigue Olivier committed
32
}
33
34


Delaigue Olivier's avatar
Delaigue Olivier committed
35
\examples{
36
library(airGR)
unknown's avatar
unknown committed
37
38

## loading catchment data
Delaigue Olivier's avatar
Delaigue Olivier committed
39
40
41
data(L0123001)

## preparation of the InputsModel object
42
43
InputsModel <- CreateInputsModel(FUN_MOD = RunModel_GR4J, DatesR = BasinObs$DatesR, 
                                 Precip = BasinObs$P, PotEvap = BasinObs$E)
Delaigue Olivier's avatar
Delaigue Olivier committed
44
45

## run period selection
46
47
48
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"))
               
Delaigue Olivier's avatar
Delaigue Olivier committed
49
## preparation of the RunOptions object
50
51
RunOptions <- CreateRunOptions(FUN_MOD = RunModel_GR4J,
                               InputsModel = InputsModel, IndPeriod_Run = Ind_Run)
Delaigue Olivier's avatar
Delaigue Olivier committed
52
53

## simulation
54
55
56
Param <- c(X1 = 734.568, X2 = -0.840, X3 = 109.809, X4 = 1.971)
OutputsModel <- RunModel(InputsModel = InputsModel,
                         RunOptions = RunOptions, Param = Param, 
57
                         FUN_MOD = RunModel_GR4J)
Delaigue Olivier's avatar
Delaigue Olivier committed
58
59

## results preview
60
plot(OutputsModel, Qobs = BasinObs$Qmm[Ind_Run])
Delaigue Olivier's avatar
Delaigue Olivier committed
61
62

## efficiency criterion: Nash-Sutcliffe Efficiency
63
InputsCrit  <- CreateInputsCrit(FUN_CRIT = ErrorCrit_NSE, InputsModel = InputsModel, 
64
                                RunOptions = RunOptions, Obs = BasinObs$Qmm[Ind_Run])
65
OutputsCrit <- ErrorCrit_NSE(InputsCrit = InputsCrit, OutputsModel = OutputsModel)
Delaigue Olivier's avatar
Delaigue Olivier committed
66
}
67
68


Delaigue Olivier's avatar
Delaigue Olivier committed
69
\author{
70
Laurent Coron, Olivier Delaigue
Delaigue Olivier's avatar
Delaigue Olivier committed
71
}
72
73


Delaigue Olivier's avatar
Delaigue Olivier committed
74
\seealso{
75
76
\code{\link{RunModel_GR4J}}, \code{\link{RunModel_CemaNeigeGR4J}}, \code{\link{CreateInputsModel}},
\code{\link{CreateRunOptions}}, \code{\link{CreateIniStates}}.
Delaigue Olivier's avatar
Delaigue Olivier committed
77
78
}