airGR (version 1.3.2.23)

RunModel: 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)

Arguments

InputsModel

[object of class InputsModel] see CreateInputsModel for details

RunOptions

[object of class RunOptions] see CreateRunOptions for details

Param

[numeric] vector of model parameters

FUN_MOD

[function] hydrological model function (e.g. RunModel_GR4J, RunModel_CemaNeigeGR4J)

Value

[list] see RunModel_GR4J or RunModel_CemaNeigeGR4J for details

See Also

RunModel_GR4J, RunModel_CemaNeigeGR4J, CreateInputsModel, CreateRunOptions, CreateIniStates.

Examples

Run this code
# NOT RUN {
library(airGR)

## loading catchment data
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 = "%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(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, Obs = BasinObs$Qmm[Ind_Run])
OutputsCrit <- ErrorCrit_NSE(InputsCrit = InputsCrit, OutputsModel = OutputsModel)
# }

Run the code above in your browser using DataCamp Workspace