RunModel_GR1A.Rd 3.77 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
\name{RunModel_GR1A}
\alias{RunModel_GR1A}
6
7


Delaigue Olivier's avatar
Delaigue Olivier committed
8
\title{Run with the GR1A hydrological model}
9
10


Delaigue Olivier's avatar
Delaigue Olivier committed
11
12
13
\usage{
RunModel_GR1A(InputsModel, RunOptions, Param)
}
14
15


Delaigue Olivier's avatar
Delaigue Olivier committed
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}

21
\item{Param}{[numeric] vector of 1 parameter
Delaigue Olivier's avatar
Delaigue Olivier committed
22
\tabular{ll}{                                                                      
23
GR1A X1 \tab model parameter [-] \cr
Delaigue Olivier's avatar
Delaigue Olivier committed
24
25
}}
}
26
27


Delaigue Olivier's avatar
Delaigue Olivier committed
28
\value{
Delaigue Olivier's avatar
Delaigue Olivier committed
29
[list] list containing the function outputs organised as follows:                                         
30
31
32
33
34
35
36
37
  \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)
Delaigue Olivier's avatar
Delaigue Olivier committed
38
}
39
40


Delaigue Olivier's avatar
Delaigue Olivier committed
41
\description{
42
Function which performs a single run for the GR1A annual lumped model over the test period.
Delaigue Olivier's avatar
Delaigue Olivier committed
43
}
44
45


Delaigue Olivier's avatar
Delaigue Olivier committed
46
47
48
49
\details{
For further details on the model, see the references section.
For further details on the argument structures and initialisation options, see \code{\link{CreateRunOptions}}.
}
50
51


Delaigue Olivier's avatar
Delaigue Olivier committed
52
\examples{
53
library(airGR)
unknown's avatar
unknown committed
54
55

## loading catchment data
Delaigue Olivier's avatar
Delaigue Olivier committed
56
57
data(L0123001)

58
59
## conversion of example data from daily to yearly time step
TabSeries       <- data.frame(BasinObs$DatesR, BasinObs$P, BasinObs$E, BasinObs$T, BasinObs$Qmm)
Delaigue Olivier's avatar
Delaigue Olivier committed
60
61
TimeFormat      <- "daily"
NewTimeFormat   <- "yearly"
62
ConvertFun      <- c("sum", "sum", "mean", "sum")
Delaigue Olivier's avatar
Delaigue Olivier committed
63
YearFirstMonth  <- 09;
64
65
66
NewTabSeries    <- SeriesAggreg(TabSeries = TabSeries, TimeFormat = TimeFormat, 
                                NewTimeFormat = NewTimeFormat, ConvertFun = ConvertFun, 
                                YearFirstMonth = YearFirstMonth)
Delaigue Olivier's avatar
Delaigue Olivier committed
67
BasinObs        <- NewTabSeries
68
names(BasinObs) <- c("DatesR", "P", "E", "T", "Qmm")
Delaigue Olivier's avatar
Delaigue Olivier committed
69
70

## preparation of the InputsModel object
71
72
InputsModel <- CreateInputsModel(FUN_MOD = RunModel_GR1A, DatesR = BasinObs$DatesR, 
                                 Precip = BasinObs$P, PotEvap = BasinObs$E)
Delaigue Olivier's avatar
Delaigue Olivier committed
73
74

## run period selection
75
76
Ind_Run <- seq(which(format(BasinObs$DatesR, format = "\%Y")=="1990"), 
               which(format(BasinObs$DatesR, format = "\%Y")=="1999"))
Delaigue Olivier's avatar
Delaigue Olivier committed
77
78

## preparation of the RunOptions object
79
80
RunOptions <- CreateRunOptions(FUN_MOD = RunModel_GR1A,
                               InputsModel = InputsModel, IndPeriod_Run = Ind_Run)
Delaigue Olivier's avatar
Delaigue Olivier committed
81
82

## simulation
83
Param <- c(X1 = 0.840)
84
OutputsModel <- RunModel_GR1A(InputsModel = InputsModel, RunOptions = RunOptions, Param = Param)
Delaigue Olivier's avatar
Delaigue Olivier committed
85
86

## results preview
87
plot(OutputsModel, Qobs = BasinObs$Qmm[Ind_Run])
Delaigue Olivier's avatar
Delaigue Olivier committed
88
89

## efficiency criterion: Nash-Sutcliffe Efficiency
90
InputsCrit  <- CreateInputsCrit(FUN_CRIT = ErrorCrit_NSE, InputsModel = InputsModel, 
91
                                RunOptions = RunOptions, Obs = BasinObs$Qmm[Ind_Run])
92
OutputsCrit <- ErrorCrit_NSE(InputsCrit = InputsCrit, OutputsModel = OutputsModel)
Delaigue Olivier's avatar
Delaigue Olivier committed
93
}
94
95


Delaigue Olivier's avatar
Delaigue Olivier committed
96
\author{
97
Laurent Coron, Claude Michel
Delaigue Olivier's avatar
Delaigue Olivier committed
98
}
99
100


Delaigue Olivier's avatar
Delaigue Olivier committed
101
\references{
102
103
104
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.
Delaigue Olivier's avatar
Delaigue Olivier committed
105
}
106
107


108
\seealso{
109
\code{\link{CreateInputsModel}}, \code{\link{CreateRunOptions}}.
110
}
Delaigue Olivier's avatar
Delaigue Olivier committed
111