From 266bb26c1e6a36f9f367d45851a825ba110952cb Mon Sep 17 00:00:00 2001
From: Delaigue Olivier <olivier.delaigue@irstea.priv>
Date: Thu, 30 Aug 2018 09:33:30 +0200
Subject: [PATCH] v1.0.13.10 warning in CreateInputsCrit when Qobs = 0 and
 epsilon = NULL

---
 DESCRIPTION          | 2 +-
 NEWS.rmd             | 4 +++-
 R/CreateInputsCrit.R | 3 ++-
 3 files changed, 6 insertions(+), 3 deletions(-)

diff --git a/DESCRIPTION b/DESCRIPTION
index 4bfc5252..738d6bd9 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.13.9
+Version: 1.0.13.10
 Date: 2018-08-31
 Authors@R: c(
   person("Laurent", "Coron", role = c("aut", "trl"), comment = c(ORCID = "0000-0002-1503-6204")),
diff --git a/NEWS.rmd b/NEWS.rmd
index 9d066e0a..2357128c 100644
--- a/NEWS.rmd
+++ b/NEWS.rmd
@@ -14,7 +14,7 @@ output:
 
 
 
-### 1.0.13.8 Release Notes (2018-08-31) 
+### 1.0.13.10 Release Notes (2018-08-31) 
 
 
 #### Deprectated and defunct
@@ -34,6 +34,8 @@ output:
 
 - <code>CreateInputsCrit()</code> now returns an error when <code>epsilon</code is not positive.
 
+- <code>CreateInputsCrit()</code> now returns a warning message if the era zeroes values in <code>Qobs<$code> and <code>epsilon = NULL</code>.
+
 
 #### Minor user-visible changes
 
diff --git a/R/CreateInputsCrit.R b/R/CreateInputsCrit.R
index 8a6aa1d1..83b3b025 100644
--- a/R/CreateInputsCrit.R
+++ b/R/CreateInputsCrit.R
@@ -93,7 +93,8 @@ CreateInputsCrit <- function(FUN_CRIT,
         stop("epsilon must a be single positive value \n")
         return(NULL)
       }
-      epsilon = as.double(epsilon)
+    } else if (transfo %in% c("log", "inv") & any(Qobs %in% 0) & verbose) {
+      warning("zeroes detected in Qobs: the corresponding time-steps will be exclude by the 'ErrorCrit*' functions if the epsilon agrument = NULL")
     }
     
     if (transfo == "log" & verbose) {
-- 
GitLab