CreateInputsModel.Rd 4.64 KB
Newer Older
Delaigue Olivier's avatar
Delaigue Olivier committed
1
% Generated by roxygen2: do not edit by hand
Delaigue Olivier's avatar
Delaigue Olivier committed
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
% Please edit documentation in R/CreateInputsModel.R
\encoding{UTF-8}
\name{CreateInputsModel}
\alias{CreateInputsModel}
\title{Creation of the InputsModel object required to the RunModel functions}
\usage{
CreateInputsModel(FUN_MOD, DatesR, Precip, PotEvap = NULL, TempMean = NULL,
  TempMin = NULL, TempMax = NULL, ZInputs = NULL, HypsoData = NULL,
  NLayers = 5, quiet = FALSE)
}
\arguments{
\item{FUN_MOD}{[function] hydrological model function (e.g. RunModel_GR4J, RunModel_CemaNeigeGR4J)}

\item{DatesR}{[POSIXlt] vector of dates required to create the GR model and CemaNeige module inputs}

\item{Precip}{[numeric] time series of total precipitation (catchment average) [mm], required to create the GR model and CemaNeige module inputs}

\item{PotEvap}{[numeric] time series of potential evapotranspiration (catchment average) [mm], required to create the GR model inputs}

\item{TempMean}{(optional) [numeric] time series of mean air temperature [degC], required to create the CemaNeige module inputs}

\item{TempMin}{(optional) [numeric] time series of min air temperature [degC], possibly used to create the CemaNeige module inputs}

\item{TempMax}{(optional) [numeric] time series of max air temperature [degC], possibly used to create the CemaNeige module inputs}

\item{ZInputs}{(optional) [numeric] real giving the mean elevation of the Precip and Temp series (before extrapolation) [m]}

\item{HypsoData}{(optional) [numeric] vector of 101 reals: min, q01 to q99 and max of catchment elevation distribution [m], required to create the GR model inputs, if not defined a single elevation is used for CemaNeige}

\item{NLayers}{(optional) [numeric] integer giving the number of elevation layers requested [-], required to create the GR model inputs, default=5}

\item{quiet}{(optional) [boolean] boolean indicating if the function is run in quiet mode or not, default=FALSE}
}
\value{
[list] object of class \emph{InputsModel} containing the data required to evaluate the model outputs; it can include the following:
         \tabular{ll}{
         \emph{$DatesR              }  \tab   [POSIXlt] vector of dates \cr
         \emph{$Precip              }  \tab   [numeric] time series of total precipitation (catchment average) [mm] \cr
         \emph{$PotEvap             }  \tab   [numeric] time series of potential evapotranspiration (catchment average) [mm], \cr\tab defined if FUN_MOD includes GR4H, GR4J, GR5J, GR6J, GR2M or GR1A \cr \cr
         \emph{$LayerPrecip         }  \tab   [list] list of time series of precipitation (layer average) [mm], \cr\tab defined if FUN_MOD includes CemaNeige \cr \cr
         \emph{$LayerTempMean       }  \tab   [list] list of time series of mean air temperature (layer average) [degC], \cr\tab defined if FUN_MOD includes CemaNeige \cr \cr
         \emph{$LayerFracSolidPrecip}  \tab   [list] list of time series of solid precip. fract. (layer average) [-], \cr\tab defined if FUN_MOD includes CemaNeige \cr \cr
         }
}
\description{
Creation of the InputsModel object required to the RunModel functions.
}
\details{
Delaigue Olivier's avatar
Delaigue Olivier committed
50
Users wanting to use FUN_MOD functions that are not included in 
Delaigue Olivier's avatar
Delaigue Olivier committed
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
the package must create their own InputsModel object accordingly.
}
\examples{
## load of catchment data
require(airGR)
data(L0123001)

## preparation of the InputsModel object
InputsModel <- CreateInputsModel(FUN_MOD=RunModel_GR4J,DatesR=BasinObs$DatesR,
                                 Precip=BasinObs$P,PotEvap=BasinObs$E)

## run period selection
Ind_Run <- seq(which(format(BasinObs$DatesR,format="\%d/\%m/\%Y \%H:\%M")=="01/01/1990 00:00"),
               which(format(BasinObs$DatesR,format="\%d/\%m/\%Y \%H:\%M")=="31/12/1999 00:00"))

## 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,
                         FUN_MOD=RunModel_GR4J)

## results preview
plot_OutputsModel(OutputsModel=OutputsModel,Qobs=BasinObs$Qmm[Ind_Run])

## efficiency criterion: Nash-Sutcliffe Efficiency
InputsCrit  <- CreateInputsCrit(FUN_CRIT=ErrorCrit_NSE,InputsModel=InputsModel,
                                RunOptions=RunOptions,Qobs=BasinObs$Qmm[Ind_Run])
OutputsCrit <- ErrorCrit_NSE(InputsCrit=InputsCrit,OutputsModel=OutputsModel)
cat(paste("  Crit  ",OutputsCrit$CritName,"  ",round(OutputsCrit$CritValue,4),"\\n",sep=""))

}
\author{
Laurent Coron (June 2014)
}
\seealso{
\code{\link{RunModel}}, \code{\link{CreateRunOptions}}, \code{\link{CreateInputsCrit}}, \code{\link{CreateCalibOptions}}, \code{\link{DataAltiExtrapolation_HBAN}}
}