Commit 2d7b8d75 authored by Delaigue Olivier's avatar Delaigue Olivier
Browse files

v0.2.10.28 CLEAN: minor code revisions in the server file (variables renamed) #14

Showing with 11 additions and 11 deletions
+11 -11
Package: airGRteaching Package: airGRteaching
Type: Package Type: Package
Title: Teaching Hydrological Modelling with the GR Rainfall-Runoff Models ('Shiny' Interface Included) Title: Teaching Hydrological Modelling with the GR Rainfall-Runoff Models ('Shiny' Interface Included)
Version: 0.2.10.27 Version: 0.2.10.28
Date: 2020-04-29 Date: 2020-04-29
Authors@R: c( Authors@R: c(
person("Olivier", "Delaigue", role = c("aut", "cre"), comment = c(ORCID = "0000-0002-7668-8468"), email = "airGR@inrae.fr"), person("Olivier", "Delaigue", role = c("aut", "cre"), comment = c(ORCID = "0000-0002-7668-8468"), email = "airGR@inrae.fr"),
......
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
### 0.2.10.27 Release Notes (2020-04-29) ### 0.2.10.28 Release Notes (2020-04-29)
#### New features #### New features
......
...@@ -217,13 +217,13 @@ shinyServer(function(input, output, session) { ...@@ -217,13 +217,13 @@ shinyServer(function(input, output, session) {
## Simulated flows computation ## Simulated flows computation
PREP <- getPrep()$PREP PREP <- getPrep()$PREP
if (input$HydroModel == "GR2M") { if (input$HydroModel == "GR2M") {
dd <- trunc(input$Period, units = "months") SimPer <- trunc(input$Period, units = "months")
} else { } else {
dd <- trunc(input$Period, units = "days") SimPer <- trunc(input$Period, units = "days")
} }
SIM <- SimGR(PrepGR = PREP, Param = PARAM, SIM <- SimGR(PrepGR = PREP, Param = PARAM,
WupPer = substr(getPrep()$WUPPER, 1, 10), WupPer = substr(getPrep()$WUPPER, 1, 10),
SimPer = c(substr(dd[1], 1, 10), substr(dd[2], 1, 10)), SimPer = c(substr(SimPer[1], 1, 10), substr(SimPer[2], 1, 10)),
verbose = FALSE) verbose = FALSE)
## Criteria computation ## Criteria computation
...@@ -296,14 +296,14 @@ shinyServer(function(input, output, session) { ...@@ -296,14 +296,14 @@ shinyServer(function(input, output, session) {
CemaNeige = input$SnowModel == "CemaNeige") CemaNeige = input$SnowModel == "CemaNeige")
} }
if (input$HydroModel == "GR2M") { if (input$HydroModel == "GR2M") {
dd <- trunc(input$Period, units = "months") SimPer <- trunc(input$Period, units = "months")
} else { } else {
dd <- trunc(input$Period, units = "days") SimPer <- trunc(input$Period, units = "days")
} }
SIMold <- SimGR(PrepGR = OBSold, SIMold <- SimGR(PrepGR = OBSold,
Param = .GlobalEnv$.ShinyGR.hist[[1]]$Param, Param = .GlobalEnv$.ShinyGR.hist[[1]]$Param,
WupPer = substr(getPrep()$WUPPER, 1, 10), WupPer = substr(getPrep()$WUPPER, 1, 10),
SimPer = substr(c(dd[1], dd[2]), 1, 10), SimPer = substr(c(SimPer[1], SimPer[2]), 1, 10),
verbose = FALSE) verbose = FALSE)
if (!getPrep()$isUngauged) { if (!getPrep()$isUngauged) {
InputsCritMultiold <- CreateInputsCrit(FUN_CRIT = CRIT_opt$Crit, InputsCritMultiold <- CreateInputsCrit(FUN_CRIT = CRIT_opt$Crit,
...@@ -867,16 +867,16 @@ shinyServer(function(input, output, session) { ...@@ -867,16 +867,16 @@ shinyServer(function(input, output, session) {
# OutputsModel2 <- getData()$OutputsModel # OutputsModel2 <- getData()$OutputsModel
# dateEvent <- trunc(input$Event, units = ifelse(input$HydroModel == "GR2M", "months", "days")) # dateEvent <- trunc(input$Event, units = ifelse(input$HydroModel == "GR2M", "months", "days"))
if (input$HydroModel == "GR2M") { if (input$HydroModel == "GR2M") {
dd <- trunc(input$Period, units = "months") SimPer <- trunc(input$Period, units = "months")
dateEvent <- trunc(input$EventGR2M, units = "months") dateEvent <- trunc(input$EventGR2M, units = "months")
} else { } else {
dd <- trunc(input$Period, units = "days") SimPer <- trunc(input$Period, units = "days")
dateEvent <- trunc(input$Event, units = "days") dateEvent <- trunc(input$Event, units = "days")
} }
par(getPlotPar()$par) par(getPlotPar()$par)
try(.DiagramGR(OutputsModel = getData()$OutputsModel, Param = getSim()$PARAM, try(.DiagramGR(OutputsModel = getData()$OutputsModel, Param = getSim()$PARAM,
SimPer = dd, EventDate = dateEvent, SimPer = SimPer, EventDate = dateEvent,
HydroModel = input$HydroModel, CemaNeige = input$SnowModel == "CemaNeige"), HydroModel = input$HydroModel, CemaNeige = input$SnowModel == "CemaNeige"),
silent = TRUE) silent = TRUE)
}, bg = "transparent") }, bg = "transparent")
......
Supports Markdown
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