Commit 60a3e08c authored by unknown's avatar unknown
Browse files

v1.0.9.23 new example of CreateIniStates

parent c912ae67
Package: airGR Package: airGR
Type: Package Type: Package
Title: Suite of GR Hydrological Models for Precipitation-Runoff Modelling Title: Suite of GR Hydrological Models for Precipitation-Runoff Modelling
Version: 1.0.9.22 Version: 1.0.9.23
Date: 2017-08-18 Date: 2017-08-18
Authors@R: c( Authors@R: c(
person("Laurent", "Coron", role = c("aut", "trl")), person("Laurent", "Coron", role = c("aut", "trl")),
......
...@@ -77,21 +77,49 @@ InputsModel <- CreateInputsModel(FUN_MOD = RunModel_GR4J, DatesR = BasinObs$Date ...@@ -77,21 +77,49 @@ InputsModel <- CreateInputsModel(FUN_MOD = RunModel_GR4J, DatesR = BasinObs$Date
## run period selection ## run period selection
Ind_Run <- seq(which(format(BasinObs$DatesR, format = "\%d/\%m/\%Y \%H:\%M")=="01/01/1990 00:00"), 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")) which(format(BasinObs$DatesR, format = "\%d/\%m/\%Y \%H:\%M")=="31/12/1991 00:00"))
## preparation of the IniStates object ### preparation of the IniStates object with low values of ProdStore and RoutStore
IniStates <- CreateIniStates(FUN_MOD = RunModel_GR4J, InputsModel = InputsModel, IniStates <- CreateIniStates(FUN_MOD = RunModel_GR4J, InputsModel = InputsModel,
ProdStore = 0.1, RoutStore = 0.6, ExpStore = NULL, ProdStore = 0, RoutStore = 0, ExpStore = NULL,
UH1 = c(0.52, 0.54, 0.15, rep(0, 17)), UH1 = c(0.52, 0.54, 0.15, rep(0, 17)),
UH2 = c(0.057, 0.042, 0.015, 0.005, rep(0, 36)), UH2 = c(0.057, 0.042, 0.015, 0.005, rep(0, 36)),
GCemaNeigeLayers = NULL, eTGCemaNeigeLayers = NULL) GCemaNeigeLayers = NULL, eTGCemaNeigeLayers = NULL)
str(IniStates) str(IniStates)
## preparation of the RunOptions object ## preparation of the RunOptions object
RunOptions <- CreateRunOptions(FUN_MOD = RunModel_GR4J, InputsModel = InputsModel, RunOptions <- CreateRunOptions(FUN_MOD = RunModel_GR4J, InputsModel = InputsModel,
IndPeriod_WarmUp = 0L,
IndPeriod_Run = Ind_Run, IniStates = IniStates) IndPeriod_Run = Ind_Run, IniStates = IniStates)
## simulation
Param <- c(257.238, 1.012, 88.235, 2.208)
OutputsModel <- RunModel_GR4J(InputsModel = InputsModel, RunOptions = RunOptions, Param = Param)
## results preview
plot(OutputsModel, Qobs = BasinObs$Qmm[Ind_Run])
### preparation of the IniStates object with high values of ProdStore and RoutStore
IniStates <- CreateIniStates(FUN_MOD = RunModel_GR4J, InputsModel = InputsModel,
ProdStore = 450, RoutStore = 100, ExpStore = NULL,
UH1 = c(0.52, 0.54, 0.15, rep(0, 17)),
UH2 = c(0.057, 0.042, 0.015, 0.005, rep(0, 36)),
GCemaNeigeLayers = NULL, eTGCemaNeigeLayers = NULL)
str(IniStates)
## preparation of the RunOptions object
RunOptions <- CreateRunOptions(FUN_MOD = RunModel_GR4J, InputsModel = InputsModel,
IndPeriod_WarmUp = 0L,
IndPeriod_Run = Ind_Run, IniStates = IniStates)
## simulation
Param <- c(257.238, 1.012, 88.235, 2.208)
OutputsModel <- RunModel_GR4J(InputsModel = InputsModel, RunOptions = RunOptions, Param = Param)
## results preview
plot(OutputsModel, Qobs = BasinObs$Qmm[Ind_Run])
} }
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment