Learn R Programming

airGRteaching (version 0.3.3)

SimGR: Running one of the GR hydrological models

Description

Function for running the GR hydrological models

Usage

SimGR(PrepGR, CalGR = NULL, Param, EffCrit = c("NSE", "KGE", "KGE2", "RMSE"),
  WupPer = NULL, SimPer,
  transfo = c("", "sqrt", "log", "inv", "sort"), verbose = TRUE)

Value

[list] object of class SimGR containing:

OptionsSimul

[list] object of class RunOptions (see: CreateRunOptions)

OptionsCrit

[list] object of class InputsCrit (see: CreateInputsCrit)

OutputsModel

[list] object of class OutputsModel (see: RunModel)

Qobs

[numeric] series of observed discharges [mm/time step]

TypeModel

[character] name of the function of the hydrological model used

CalCrit

[character] name of the function that computes the error criterion during the calibration step

EffCrit

[list] name of the function that computes the error criterion during the simulation step

PeriodModel

[list] $WarmUp: vector of 2 POSIXct values defining the beginning and end of the warm-up period; $Run: vector of 2 POSIXct values defining the beginning and end of the calibration period

Arguments

PrepGR

[object of class PrepGR] see PrepGR for details

CalGR

(deprecated) use the Param argument instead

Param

[object of class CalGR or numeric] see CalGR. The length of the vector of parameters depends on the model used, see below for details

EffCrit

[character] name of the efficiency criterion (must be one of "NSE", "KGE", "KGE2" or "RMSE")

WupPer

(optional) [character] vector of 2 values to define the beginning and end of the warm-up period ["YYYY-mm-dd" or "YYYY-mm-dd HH:MM:SS"]; [0L] to disable the warm-up period. See details

SimPer

[character] vector of 2 values to define the beginning and end of the simulation period ["YYYY-mm-dd" or "YYYY-mm-dd HH:MM:SS"]

transfo

(optional) [character] name of the transformation applied to discharge for calculating the error criterion (must be one of "", "sqrt", "log", "inv" or "sort")

verbose

(optional) [boolean] logical value indicating if the function is run in verbose mode or not

Author

Olivier Delaigue, Guillaume Thirel

Details

The user can customize the parameters with the Param argument. The user can also use the parameters resulting from a calibration. In this case, it is necessary to use the CalGR function.

WupPer = NULL indicates that, if available, a period of one year immediately present before the CalPer period is used. WupPer = 0L allows to disable the warm up of the model.

See Also

airGRteaching plot and dyplot functions to display static and dynamic plots

airGR CreateRunOptions, CreateInputsCrit, RunModel, ErrorCrit_RMSE, ErrorCrit_NSE, ErrorCrit_KGE, ErrorCrit_KGE2 functions

Examples

Run this code
library(airGRteaching)

## data.frame of observed data
data(L0123001, package = "airGR")
BasinObs2 <- BasinObs[, c("DatesR", "P", "E", "Qmm", "T")]

## Preparation of observed data for modelling
PREP <- PrepGR(ObsDF = BasinObs2, HydroModel = "GR4J", CemaNeige = FALSE)

## Calibration step
CAL <- CalGR(PrepGR = PREP, CalCrit = "KGE2",
             WupPer = NULL, CalPer = c("1990-01-01", "1993-12-31"))

## Simulation step using the result of the automatic calibration method to set the model parameters
SIM <- SimGR(PrepGR = PREP, Param = CAL, EffCrit = "KGE2",
             WupPer = NULL, SimPer = c("1994-01-01", "1998-12-31"))

## Simulation step using model parameter set by the user
SIM <- SimGR(PrepGR = PREP, Param = c(270.426, 0.984, 108.853, 2.149), EffCrit = "KGE2",
             WupPer = NULL, SimPer = c("1994-01-01", "1998-12-31"))


## Structure of SimGR object
str(SIM)

## Plot diagnostics
plot(SIM)

## Static plot of observed and simulated time series
plot(SIM, which = "ts")
plot(SIM, which = c("Precip", "Flows"))

## Dynamic plot of observed and simulated time series
dyplot(SIM)

Run the code above in your browser using DataLab