diff --git a/DESCRIPTION b/DESCRIPTION index e5a61d67752277044b1e83c94347e8b485a81a66..cbcdadd29dfdcfd0c445ff7c4ca5e37810faf501 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.4.1.10 +Version: 1.4.1.11 Date: 2019-12-05 Authors@R: c( person("Laurent", "Coron", role = c("aut", "trl"), comment = c(ORCID = "0000-0002-1503-6204")), diff --git a/NEWS.md b/NEWS.md index 6bcb176d19c5399f7a14017458aecc9b2b813ad3..a575a5fe98128254d595ee9b8675464590d34a19 100644 --- a/NEWS.md +++ b/NEWS.md @@ -2,7 +2,7 @@ -### 1.4.1.10 Release Notes (2019-12-05) +### 1.4.1.11 Release Notes (2019-12-05) #### New features diff --git a/R/CreateInputsModel.R b/R/CreateInputsModel.R index 510ea517d40e075b206f1af096ec9ae24fc23829..20a0fd2feade2f9c4cc8cc88d3da1e3e53cff9a5 100644 --- a/R/CreateInputsModel.R +++ b/R/CreateInputsModel.R @@ -59,7 +59,7 @@ CreateInputsModel <- function(FUN_MOD, BOOL <- TRUE } - if (identical(FUN_MOD, RunModel_CemaNeigeGR4H) | identical(FUN_MOD, RunModel_CemaNeigeGR5H)) { + if (identical(FUN_MOD, RunModel_CemaNeigeGR4H)) {#} | identical(FUN_MOD, RunModel_CemaNeigeGR5H)) { ObjectClass <- c(ObjectClass, "hourly", "GR", "CemaNeige") TimeStep <- as.integer(60 * 60) diff --git a/R/CreateRunOptions.R b/R/CreateRunOptions.R index d0876e8e0455857bb3b9e5c8c7274672b55ce15b..b920da3db12efbb12f48e0331b79e78e08089f97 100644 --- a/R/CreateRunOptions.R +++ b/R/CreateRunOptions.R @@ -61,7 +61,8 @@ CreateRunOptions <- function(FUN_MOD, InputsModel, IndPeriod_WarmUp = NULL, IndP if (!"CemaNeige" %in% ObjectClass & "hysteresis" %in% ObjectClass) { stop("'IsHyst' cannot be TRUE for the chosen 'FUN_MOD'") } - if (!(identical(FUN_MOD, RunModel_GR5H)) & !(identical(FUN_MOD, RunModel_CemaNeigeGR5H)) & "interception" %in% ObjectClass) { +# if (!(identical(FUN_MOD, RunModel_GR5H)) & !(identical(FUN_MOD, RunModel_CemaNeigeGR5H)) & "interception" %in% ObjectClass) { + if (!(identical(FUN_MOD, RunModel_GR5H)) & "interception" %in% ObjectClass) { stop("'IsIntStore' cannot be TRUE for the chosen 'FUN_MOD'") } @@ -191,11 +192,15 @@ CreateRunOptions <- function(FUN_MOD, InputsModel, IndPeriod_WarmUp = NULL, IndP if (identical(FUN_MOD, RunModel_GR6J) | identical(FUN_MOD, RunModel_CemaNeigeGR6J)) { IniResLevels <- as.double(c(0.3, 0.5, 0, NA)) } - if ((identical(FUN_MOD, RunModel_GR5H) | identical(FUN_MOD, RunModel_CemaNeigeGR5H)) & IsIntStore) { + # if ((identical(FUN_MOD, RunModel_GR5H) | identical(FUN_MOD, RunModel_CemaNeigeGR5H)) & IsIntStore) { + if ((identical(FUN_MOD, RunModel_GR5H)) & IsIntStore) { + IniResLevels <- as.double(c(0.3, 0.5, NA, 0)) } + # if (!identical(FUN_MOD, RunModel_GR6J) & !identical(FUN_MOD, RunModel_CemaNeigeGR6J) & + # !identical(FUN_MOD, RunModel_GR5H) & !identical(FUN_MOD, RunModel_CemaNeigeGR5H)) { if (!identical(FUN_MOD, RunModel_GR6J) & !identical(FUN_MOD, RunModel_CemaNeigeGR6J) & - !identical(FUN_MOD, RunModel_GR5H) & !identical(FUN_MOD, RunModel_CemaNeigeGR5H)) { + !identical(FUN_MOD, RunModel_GR5H)) { IniResLevels <- as.double(c(0.3, 0.5, NA, NA)) } } @@ -242,20 +247,25 @@ CreateRunOptions <- function(FUN_MOD, InputsModel, IndPeriod_WarmUp = NULL, IndP if (identical(FUN_MOD, RunModel_GR1A) & !is.null(IniStates)) { ## GR1A stop(paste0("'IniStates' is not available for the chosen 'FUN_MOD'")) } - if ((identical(FUN_MOD, RunModel_GR5J) | identical(FUN_MOD, RunModel_CemaNeigeGR5J) | identical(FUN_MOD, RunModel_GR5H) | - identical(FUN_MOD, RunModel_CemaNeigeGR5H)) & !all(is.na(IniStates$UH$UH1))) { ## GR5J or GR5H + # if ((identical(FUN_MOD, RunModel_GR5J) | identical(FUN_MOD, RunModel_CemaNeigeGR5J) | identical(FUN_MOD, RunModel_GR5H) | + # identical(FUN_MOD, RunModel_CemaNeigeGR5H)) & !all(is.na(IniStates$UH$UH1))) { ## GR5J or GR5H + if ((identical(FUN_MOD, RunModel_GR5J) | identical(FUN_MOD, RunModel_CemaNeigeGR5J) | identical(FUN_MOD, RunModel_GR5H)) & + !all(is.na(IniStates$UH$UH1))) { ## GR5J or GR5H stop(paste0("non convenient 'IniStates' for the chosen 'FUN_MOD'.' In 'IniStates', 'UH1' has to be a vector of NA for GR5J")) } if ((identical(FUN_MOD, RunModel_GR6J) | identical(FUN_MOD, RunModel_CemaNeigeGR6J)) & is.na(IniStates$Store$Exp)) { ## GR6J stop(paste0("non convenient 'IniStates' for the chosen 'FUN_MOD'.' GR6J needs an exponential store value in 'IniStates'")) } - if ((identical(FUN_MOD, RunModel_GR5H) | identical(FUN_MOD, RunModel_CemaNeigeGR5H)) & is.na(IniStates$Store$Int)) { ## GR5H interception + # if ((identical(FUN_MOD, RunModel_GR5H) | identical(FUN_MOD, RunModel_CemaNeigeGR5H)) & is.na(IniStates$Store$Int)) { ## GR5H interception + if ((identical(FUN_MOD, RunModel_GR5H)) & is.na(IniStates$Store$Int)) { ## GR5H interception + stop(paste0("non convenient 'IniStates' for the chosen 'FUN_MOD'.' GR5H (with interception store) needs an interception store value in 'IniStates'")) } if (!(identical(FUN_MOD, RunModel_GR6J) | identical(FUN_MOD, RunModel_CemaNeigeGR6J)) & !is.na(IniStates$Store$Exp)) { ## except GR6J stop(paste0("non convenient 'IniStates' for the chosen 'FUN_MOD'.' No exponential store value needed in 'IniStates'")) } - if (!(identical(FUN_MOD, RunModel_GR5H) | identical(FUN_MOD, RunModel_CemaNeigeGR5H)) & !is.na(IniStates$Store$Int)) { ## except GR5H interception + # if (!(identical(FUN_MOD, RunModel_GR5H) | identical(FUN_MOD, RunModel_CemaNeigeGR5H)) & !is.na(IniStates$Store$Int)) { ## except GR5H interception + if (!(identical(FUN_MOD, RunModel_GR5H)) & !is.na(IniStates$Store$Int)) { ## except GR5H interception stop(paste0("non convenient 'IniStates' for the chosen 'FUN_MOD'.' No interception store value needed in 'IniStates'")) } # if (length(na.omit(unlist(IniStates))) != NState) { @@ -299,8 +309,8 @@ CreateRunOptions <- function(FUN_MOD, InputsModel, IndPeriod_WarmUp = NULL, IndP if (identical(FUN_MOD,RunModel_GR4H) | identical(FUN_MOD,RunModel_CemaNeigeGR4H)) { Outputs_all <- c(Outputs_all, .FortranOutputs(GR = "GR4H")$GR) } - if (identical(FUN_MOD,RunModel_GR5H) | identical(FUN_MOD,RunModel_CemaNeigeGR5H)) { - Outputs_all <- c(Outputs_all, .FortranOutputs(GR = "GR5H")$GR) + if (identical(FUN_MOD,RunModel_GR5H)) { + Outputs_all <- c(Outputs_all, .FortranOutputs(GR = "GR5H")$GR) # | identical(FUN_MOD,RunModel_CemaNeigeGR5H) } if (identical(FUN_MOD,RunModel_GR4J) | identical(FUN_MOD,RunModel_CemaNeigeGR4J)) { Outputs_all <- c(Outputs_all, .FortranOutputs(GR = "GR4J")$GR)