Commit 088a5ddb authored by Dorchies David's avatar Dorchies David
Browse files

v1.6.1.13 feat: SD LenghtHydro in meters instead of km

Refs #34 in particular #34 (comment 20648)
Showing with 5 additions and 5 deletions
+5 -5
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.6.1.13 Version: 1.6.1.14
Date: 2020-05-22 Date: 2020-05-27
Authors@R: c( Authors@R: c(
person("Laurent", "Coron", role = c("aut", "trl"), comment = c(ORCID = "0000-0002-1503-6204")), person("Laurent", "Coron", role = c("aut", "trl"), comment = c(ORCID = "0000-0002-1503-6204")),
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"),
......
...@@ -18,7 +18,7 @@ RunModel <- function (InputsModel, RunOptions, Param, FUN_MOD) { ...@@ -18,7 +18,7 @@ RunModel <- function (InputsModel, RunOptions, Param, FUN_MOD) {
AreaTot <- sum(InputsModel$BasinAreas) AreaTot <- sum(InputsModel$BasinAreas)
# propagation time from upstream meshes to outlet # propagation time from upstream meshes to outlet
PT <- InputsModel$LengthHydro[1, ] * 1000 / Param[length(Param)] / TimeStep PT <- InputsModel$LengthHydro[1, ] / Param[length(Param)] / TimeStep
HUTRANS <- rbind(1 - (PT - floor(PT)), PT - floor(PT)) HUTRANS <- rbind(1 - (PT - floor(PT)), PT - floor(PT))
NbUpBasins <- length(InputsModel$LengthHydro) NbUpBasins <- length(InputsModel$LengthHydro)
......
...@@ -42,7 +42,7 @@ InputsModel <- CreateInputsModel( ...@@ -42,7 +42,7 @@ InputsModel <- CreateInputsModel(
Precip = BasinObs$P, Precip = BasinObs$P,
PotEvap = BasinObs$E, PotEvap = BasinObs$E,
QobsUpstr = matrix(QobsUpstr, ncol = 1), QobsUpstr = matrix(QobsUpstr, ncol = 1),
LengthHydro = matrix(c(1), nrow = 1), LengthHydro = matrix(c(1000), nrow = 1),
BasinAreas = matrix(c( BasinAreas = matrix(c(
BasinInfo$BasinArea * 2, BasinInfo$BasinArea BasinInfo$BasinArea * 2, BasinInfo$BasinArea
), nrow = 1) ), nrow = 1)
...@@ -96,7 +96,7 @@ test_that( ...@@ -96,7 +96,7 @@ test_that(
} }
) )
ParamSD = c(Param, InputsModel$LengthHydro * 1000 / (24 * 60 * 60)) ParamSD = c(Param, InputsModel$LengthHydro / (24 * 60 * 60)) # Speed corresponding to one time step delay
OutputsSD <- OutputsSD <-
RunModel(InputsModel, RunOptions, Param = ParamSD, FUN_MOD = RunModel_GR4J) RunModel(InputsModel, RunOptions, Param = ParamSD, FUN_MOD = RunModel_GR4J)
......
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