From 60a3e08c7561087736905b01e94a55a6623bf616 Mon Sep 17 00:00:00 2001
From: unknown <olivier.delaigue@ANPI1430.antony.irstea.priv>
Date: Fri, 18 Aug 2017 10:40:11 +0200
Subject: [PATCH] v1.0.9.23 new example of CreateIniStates

---
 DESCRIPTION            |  2 +-
 man/CreateIniStates.Rd | 38 +++++++++++++++++++++++++++++++++-----
 2 files changed, 34 insertions(+), 6 deletions(-)

diff --git a/DESCRIPTION b/DESCRIPTION
index 50859b00..593cde05 100644
--- a/DESCRIPTION
+++ b/DESCRIPTION
@@ -1,7 +1,7 @@
 Package: airGR
 Type: Package
 Title: Suite of GR Hydrological Models for Precipitation-Runoff Modelling
-Version: 1.0.9.22
+Version: 1.0.9.23
 Date: 2017-08-18
 Authors@R: c(
   person("Laurent", "Coron", role = c("aut", "trl")),
diff --git a/man/CreateIniStates.Rd b/man/CreateIniStates.Rd
index deb3cd4f..2819b601 100644
--- a/man/CreateIniStates.Rd
+++ b/man/CreateIniStates.Rd
@@ -77,21 +77,49 @@ InputsModel <- CreateInputsModel(FUN_MOD = RunModel_GR4J, DatesR = BasinObs$Date
 
 ## 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"))
+               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,
-                             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)),
                              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, 
+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])                               
+  
+  
+### 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]) 
 }
 
 
-- 
GitLab