knitr::opts_chunk$set(echo = TRUE)
The aim of this vignette is to perform a first calibration of the semi-distributed hydrological model, using naturalized discharge.
Run vignette("01_First_network", package = "airGRiwrm")
and vignette("02_First_run", package = "airGRiwrm")
before this one in order to create the Rdata files loaded below:
library(airGRiwrm) load("_cache/V01.RData") load("_cache/V02.RData") library(seinebasin) data(QNAT)
We need then to prepare the InputsCrit object that is necessary to define the calibration objective function. We chose here the KGE' criterion:
InputsCrit <- CreateInputsCrit( InputsModel = InputsModel, FUN_CRIT = ErrorCrit_KGE2, RunOptions = RunOptions, Obs = Qnat[IndPeriod_Run,] ) str(InputsCrit)
CalibOptions <- CreateCalibOptions(InputsModel) str(CalibOptions)
The optimization (i.e. calibration) of parameters can now be performed:
OutputsCalib <- Calibration(InputsModel, RunOptions, InputsCrit, CalibOptions)
Now that the model is calibrated, we can run it with the optimized parameter values:
ParamMichel <- extractParam(OutputsCalib) OutputsModels <- RunModel( InputsModel, RunOptions = RunOptions, Param = ParamMichel )
plot(OutputsModels, Qobs = Qnat[IndPeriod_Run,])
save(ParamMichel, file = "_cache/V03.RData")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.