From 7b73e3308ecc4527644fddc3d5121dc9892510df Mon Sep 17 00:00:00 2001
From: Delaigue Olivier <olivier.delaigue@irstea.priv>
Date: Wed, 29 Aug 2018 14:12:43 +0200
Subject: [PATCH] v1.0.12.6 CreateCalibOptions return a warning message when
 all values are NA in FixedParam

---
 DESCRIPTION            | 2 +-
 NEWS.rmd               | 4 ++--
 R/CreateCalibOptions.R | 5 ++++-
 3 files changed, 7 insertions(+), 4 deletions(-)

diff --git a/DESCRIPTION b/DESCRIPTION
index 4fbef564..bcaec634 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.12.5
+Version: 1.0.12.6
 Date: 2018-08-29
 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 eec23539..bf7e6f74 100644
--- a/NEWS.rmd
+++ b/NEWS.rmd
@@ -14,7 +14,7 @@ output:
 
 
 
-### 5 Release Notes (2018-08-29) 
+### 1.0.12.6 Release Notes (2018-08-29) 
 
 
 #### Deprectated and defunct
@@ -28,7 +28,7 @@ output:
 
 - <code>Calibration_Michel()</code> is now faster during the grid-screening step when a parameter is set using <code>FixedParam</code> in <code>CreateCalibOptions()</code>.
 
-- <code>CreateCalibOptions()</code> now returns an error when all the parameters ar set in <code>FixedParam</code>.
+- <code>CreateCalibOptions()</code> now returns an error when all the parameters are set and a warning message when all the parameters are not set <code>FixedParam</code> in the <code>FixedParam</code> argument.
 
 
 #### Minor user-visible changes
diff --git a/R/CreateCalibOptions.R b/R/CreateCalibOptions.R
index 149e5ba4..1035b234 100644
--- a/R/CreateCalibOptions.R
+++ b/R/CreateCalibOptions.R
@@ -178,10 +178,13 @@ CreateCalibOptions <-
         stop("Incompatibility between FixedParam length and FUN_MOD \n")
         return(NULL)
       }
-      if (!all(is.na(FixedParam))) {
+      if (all(!is.na(FixedParam))) {
         stop("At least one parameter must be not set (NA) \n")
         return(NULL)
       }
+      if (all(is.na(FixedParam))) {
+        warning("You have not set any parameter in \"FixedParam\" \n")
+      }
     }
     
     ##check_SearchRanges
-- 
GitLab