From 5a7cbe6c4a846937371a83271fa5d33fc2470bb7 Mon Sep 17 00:00:00 2001
From: Dorchies David <david.dorchies@inrae.fr>
Date: Wed, 4 Aug 2021 10:34:41 +0200
Subject: [PATCH] fix: crash of regularisation with cemaneige

- fix missing "Param" in Outputs_Cal

Refs #111
---
 R/CreateRunOptions.R | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)

diff --git a/R/CreateRunOptions.R b/R/CreateRunOptions.R
index 36a462e0..04fe0c81 100644
--- a/R/CreateRunOptions.R
+++ b/R/CreateRunOptions.R
@@ -334,14 +334,13 @@ CreateRunOptions <- function(FUN_MOD, InputsModel,
   if (is.null(Outputs_Cal)) {
     if ("GR" %in% ObjectClass) {
       Outputs_Cal <- c("Qsim", "Param")
+      if ("CemaNeige" %in% ObjectClass) {
+        Outputs_Cal <- c("PliqAndMelt", Outputs_Cal)
+      }
     }
     if ("CemaNeige" %in% ObjectClass) {
       Outputs_Cal <- c("all")
     }
-    if ("GR" %in% ObjectClass &
-        "CemaNeige" %in% ObjectClass) {
-      Outputs_Cal <- c("PliqAndMelt", "Qsim")
-    }
   } else {
     if (!is.vector(Outputs_Cal)) {
       stop("'Outputs_Cal' must be a vector of characters")
-- 
GitLab