diff --git a/DESCRIPTION b/DESCRIPTION index 5e006f13c0c72d29fcbfe283a3dc0876a0f8d912..eb60b7a1747505dae76bda2ef0e57b9aa487e7be 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,8 +1,8 @@ Package: airGR Type: Package Title: Suite of GR Hydrological Models for Precipitation-Runoff Modelling -Version: 1.0.5.22 -Date: 2017-02-23 +Version: 1.0.5.24 +Date: 2017-03-15 Authors@R: c( person("Laurent", "Coron", role = c("aut", "trl")), person("Charles", "Perrin", role = c("aut", "ths")), diff --git a/R/RunModel_CemaNeigeGR4J.R b/R/RunModel_CemaNeigeGR4J.R index fc9a2f685b02cc684b08914011746117b1fc0ae6..8ce9b7a7f92b9f8905e8f0000a97cf103f8cd385 100644 --- a/R/RunModel_CemaNeigeGR4J.R +++ b/R/RunModel_CemaNeigeGR4J.R @@ -16,6 +16,16 @@ RunModel_CemaNeigeGR4J <- function(InputsModel,RunOptions,Param){ if(sum(!is.na(Param))!=NParam){ stop(paste("Param must be a vector of length ",NParam," and contain no NA \n",sep="")); return(NULL); } Param <- as.double(Param); + Param_X1X3_threshold <- 1e-2 + if (Param[1L] < Param_X1X3_threshold) { + warning(sprintf("Param[1] (X1: production store capacity [mm]) < %.2f\n New X1 value: %.2f", Param_X1X3_threshold, Param_X1X3_threshold)) + Param[1L] <- Param_X1X3_threshold + } + if (Param[3L] < Param_X1X3_threshold) { + warning(sprintf("Param[1] (X3: routing store capacity [mm]) < %.2f\n New X3 value: %.2f", Param_X1X3_threshold, Param_X1X3_threshold)) + Param[3L] <- Param_X1X3_threshold + } + ##Input_data_preparation if(identical(RunOptions$IndPeriod_WarmUp,as.integer(0))){ RunOptions$IndPeriod_WarmUp <- NULL; } IndPeriod1 <- c(RunOptions$IndPeriod_WarmUp,RunOptions$IndPeriod_Run); diff --git a/R/RunModel_CemaNeigeGR5J.R b/R/RunModel_CemaNeigeGR5J.R index 3121c8973bcbdeccf8d89bce392d6fe7a2d294a0..f7e3b98209e77e43daf9a023a9f710431f1b20d1 100644 --- a/R/RunModel_CemaNeigeGR5J.R +++ b/R/RunModel_CemaNeigeGR5J.R @@ -15,6 +15,16 @@ RunModel_CemaNeigeGR5J <- function(InputsModel,RunOptions,Param){ if(!is.vector(Param)){ stop("Param must be a vector \n"); return(NULL); } if(sum(!is.na(Param))!=NParam){ stop(paste("Param must be a vector of length ",NParam," and contain no NA \n",sep="")); return(NULL); } Param <- as.double(Param); + + Param_X1X3_threshold <- 1e-2 + if (Param[1L] < Param_X1X3_threshold) { + warning(sprintf("Param[1] (X1: production store capacity [mm]) < %.2f\n New X1 value: %.2f", Param_X1X3_threshold, Param_X1X3_threshold)) + Param[1L] <- Param_X1X3_threshold + } + if (Param[3L] < Param_X1X3_threshold) { + warning(sprintf("Param[1] (X3: routing store capacity [mm]) < %.2f\n New X3 value: %.2f", Param_X1X3_threshold, Param_X1X3_threshold)) + Param[3L] <- Param_X1X3_threshold + } ##Input_data_preparation if(identical(RunOptions$IndPeriod_WarmUp,as.integer(0))){ RunOptions$IndPeriod_WarmUp <- NULL; } diff --git a/R/RunModel_CemaNeigeGR6J.R b/R/RunModel_CemaNeigeGR6J.R index af07973fe7f1b3b27d19e971b8ba2c5c170e37b4..641922d79e821be25d07cdeac5b5da492e535020 100644 --- a/R/RunModel_CemaNeigeGR6J.R +++ b/R/RunModel_CemaNeigeGR6J.R @@ -15,6 +15,16 @@ RunModel_CemaNeigeGR6J <- function(InputsModel,RunOptions,Param){ if(!is.vector(Param)){ stop("Param must be a vector \n"); return(NULL); } if(sum(!is.na(Param))!=NParam){ stop(paste("Param must be a vector of length ",NParam," and contain no NA \n",sep="")); return(NULL); } Param <- as.double(Param); + + Param_X1X3_threshold <- 1e-2 + if (Param[1L] < Param_X1X3_threshold) { + warning(sprintf("Param[1] (X1: production store capacity [mm]) < %.2f\n New X1 value: %.2f", Param_X1X3_threshold, Param_X1X3_threshold)) + Param[1L] <- Param_X1X3_threshold + } + if (Param[3L] < Param_X1X3_threshold) { + warning(sprintf("Param[1] (X3: routing store capacity [mm]) < %.2f\n New X3 value: %.2f", Param_X1X3_threshold, Param_X1X3_threshold)) + Param[3L] <- Param_X1X3_threshold + } ##Input_data_preparation if(identical(RunOptions$IndPeriod_WarmUp,as.integer(0))){ RunOptions$IndPeriod_WarmUp <- NULL; } diff --git a/R/RunModel_GR2M.R b/R/RunModel_GR2M.R index c0415938cbdf6b619cde71d86c0c467f39547c13..cbefa5ddb96c4af85abf7613a6f3f216431512aa 100644 --- a/R/RunModel_GR2M.R +++ b/R/RunModel_GR2M.R @@ -12,6 +12,12 @@ RunModel_GR2M <- function(InputsModel,RunOptions,Param){ if(!is.vector(Param)){ stop("Param must be a vector \n"); return(NULL); } if(sum(!is.na(Param))!=NParam){ stop(paste("Param must be a vector of length ",NParam," and contain no NA \n",sep="")); return(NULL); } Param <- as.double(Param); + + Param_X1_threshold <- 1e-2 + if (Param[1L] < Param_X1_threshold) { + warning(sprintf("Param[1] (X1: production store capacity [mm]) < %.2f\n New X1 value: %.2f", Param_X1_threshold, Param_X1_threshold)) + Param[1L] <- Param_X1_threshold + } ##Input_data_preparation if(identical(RunOptions$IndPeriod_WarmUp,as.integer(0))){ RunOptions$IndPeriod_WarmUp <- NULL; } diff --git a/R/RunModel_GR4H.R b/R/RunModel_GR4H.R index 792642f6f833888b066c680a1000bbeddffa4c6c..d803c7e49f019cf5edbb4a5fd3a4b6479c54722e 100644 --- a/R/RunModel_GR4H.R +++ b/R/RunModel_GR4H.R @@ -12,6 +12,16 @@ RunModel_GR4H <- function(InputsModel,RunOptions,Param){ if(!is.vector(Param)){ stop("Param must be a vector \n"); return(NULL); } if(sum(!is.na(Param))!=NParam){ stop(paste("Param must be a vector of length ",NParam," and contain no NA \n",sep="")); return(NULL); } Param <- as.double(Param); + + Param_X1X3_threshold <- 1e-2 + if (Param[1L] < Param_X1X3_threshold) { + warning(sprintf("Param[1] (X1: production store capacity [mm]) < %.2f\n New X1 value: %.2f", Param_X1X3_threshold, Param_X1X3_threshold)) + Param[1L] <- Param_X1X3_threshold + } + if (Param[3L] < Param_X1X3_threshold) { + warning(sprintf("Param[1] (X3: routing store capacity [mm]) < %.2f\n New X3 value: %.2f", Param_X1X3_threshold, Param_X1X3_threshold)) + Param[3L] <- Param_X1X3_threshold + } ##Input_data_preparation if(identical(RunOptions$IndPeriod_WarmUp,as.integer(0))){ RunOptions$IndPeriod_WarmUp <- NULL; } diff --git a/R/RunModel_GR4J.R b/R/RunModel_GR4J.R index 193dc91fa812ed61cd042884ae9c63d7d9b0c269..a5f6e7d5905f7b5b2d9cc5ed00b2ee1b6d67f818 100644 --- a/R/RunModel_GR4J.R +++ b/R/RunModel_GR4J.R @@ -12,6 +12,16 @@ RunModel_GR4J <- function(InputsModel,RunOptions,Param){ if(!is.vector(Param)){ stop("Param must be a vector \n"); return(NULL); } if(sum(!is.na(Param))!=NParam){ stop(paste("Param must be a vector of length ",NParam," and contain no NA \n",sep="")); return(NULL); } Param <- as.double(Param); + + Param_X1X3_threshold <- 1e-2 + if (Param[1L] < Param_X1X3_threshold) { + warning(sprintf("Param[1] (X1: production store capacity [mm]) < %.2f\n New X1 value: %.2f", Param_X1X3_threshold, Param_X1X3_threshold)) + Param[1L] <- Param_X1X3_threshold + } + if (Param[3L] < Param_X1X3_threshold) { + warning(sprintf("Param[1] (X3: routing store capacity [mm]) < %.2f\n New X3 value: %.2f", Param_X1X3_threshold, Param_X1X3_threshold)) + Param[3L] <- Param_X1X3_threshold + } ##Input_data_preparation if(identical(RunOptions$IndPeriod_WarmUp,as.integer(0))){ RunOptions$IndPeriod_WarmUp <- NULL; } diff --git a/R/RunModel_GR5J.R b/R/RunModel_GR5J.R index 63d0a9e58e89dfd9bdab6a03a06d5f22a18ebc5b..e0ee240a51d37dc261bae42b112d6aa4ac5bc0d4 100644 --- a/R/RunModel_GR5J.R +++ b/R/RunModel_GR5J.R @@ -12,7 +12,17 @@ RunModel_GR5J <- function(InputsModel,RunOptions,Param){ if(!is.vector(Param)){ stop("Param must be a vector \n"); return(NULL); } if(sum(!is.na(Param))!=NParam){ stop(paste("Param must be a vector of length ",NParam," and contain no NA \n",sep="")); return(NULL); } Param <- as.double(Param); - + + Param_X1X3_threshold <- 1e-2 + if (Param[1L] < Param_X1X3_threshold) { + warning(sprintf("Param[1] (X1: production store capacity [mm]) < %.2f\n New X1 value: %.2f", Param_X1X3_threshold, Param_X1X3_threshold)) + Param[1L] <- Param_X1X3_threshold + } + if (Param[3L] < Param_X1X3_threshold) { + warning(sprintf("Param[1] (X3: routing store capacity [mm]) < %.2f\n New X3 value: %.2f", Param_X1X3_threshold, Param_X1X3_threshold)) + Param[3L] <- Param_X1X3_threshold + } + ##Input_data_preparation if(identical(RunOptions$IndPeriod_WarmUp,as.integer(0))){ RunOptions$IndPeriod_WarmUp <- NULL; } IndPeriod1 <- c(RunOptions$IndPeriod_WarmUp,RunOptions$IndPeriod_Run); diff --git a/R/RunModel_GR6J.R b/R/RunModel_GR6J.R index a3227689eb37b6e134aa1d524a627def4402804f..8bfd01b8c047019cacc84c176883028acb5c7934 100644 --- a/R/RunModel_GR6J.R +++ b/R/RunModel_GR6J.R @@ -12,6 +12,16 @@ RunModel_GR6J <- function(InputsModel,RunOptions,Param){ if(!is.vector(Param)){ stop("Param must be a vector \n"); return(NULL); } if(sum(!is.na(Param))!=NParam){ stop(paste("Param must be a vector of length ",NParam," and contain no NA \n",sep="")); return(NULL); } Param <- as.double(Param); + + Param_X1X3_threshold <- 1e-2 + if (Param[1L] < Param_X1X3_threshold) { + warning(sprintf("Param[1] (X1: production store capacity [mm]) < %.2f\n New X1 value: %.2f", Param_X1X3_threshold, Param_X1X3_threshold)) + Param[1L] <- Param_X1X3_threshold + } + if (Param[3L] < Param_X1X3_threshold) { + warning(sprintf("Param[1] (X3: routing store capacity [mm]) < %.2f\n New X3 value: %.2f", Param_X1X3_threshold, Param_X1X3_threshold)) + Param[3L] <- Param_X1X3_threshold + } ##Input_data_preparation if(identical(RunOptions$IndPeriod_WarmUp,as.integer(0))){ RunOptions$IndPeriod_WarmUp <- NULL; }