From abde60fbeaa36704054a23606057e4d35495b898 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?St=C3=A9phane=20Adjemian=20=28Charybdis=29?=
 <stepan@adjemian.io>
Date: Mon, 25 Feb 2019 16:19:59 +0100
Subject: [PATCH] pac: Changed logic of the tests on growth and
 steady_state_growth options.

---
 src/ParsingDriver.cc | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/src/ParsingDriver.cc b/src/ParsingDriver.cc
index 47698548..56465009 100644
--- a/src/ParsingDriver.cc
+++ b/src/ParsingDriver.cc
@@ -2627,12 +2627,12 @@ ParsingDriver::pac_model()
     else
       aux_model_name = it->second;
   else
-    if (pac_steady_state_growth_rate_number < 0 && pac_steady_state_growth_rate_symb_id < 0)
-      error("when aux_model_name is not passed to the pac_model statement, you must pass steady_state_growth option");
-    else if (pac_growth_symb_id >= 0 && mod_file->symbol_table.getType(pac_growth_symb_id) == SymbolType::parameter
-             && (pac_steady_state_growth_rate_number >= 0
-                 || pac_steady_state_growth_rate_symb_id != pac_growth_symb_id))
-      error("when aux_model_name is not passed to the pac_model statement, steady_state_growth must be a parameter equal to growth");
+    if (pac_growth_symb_id >= 0 && mod_file->symbol_table.getType(pac_growth_symb_id) == SymbolType::parameter
+        && (pac_steady_state_growth_rate_number >= 0 || pac_steady_state_growth_rate_symb_id >=0))
+      warning("If growth option is constant, steady_state_growth is ignored");
+    else if (pac_growth_symb_id >= 0 && mod_file->symbol_table.getType(pac_growth_symb_id) != SymbolType::parameter
+             && (pac_steady_state_growth_rate_number < 0 || pac_steady_state_growth_rate_symb_id < 0))
+      error("The steady state growth rate of the target must be provided (steady_state_growth option) if option growth is not constant");
 
   if (pac_steady_state_growth_rate_symb_id >= 0
       && mod_file->symbol_table.getType(pac_steady_state_growth_rate_symb_id) != SymbolType::parameter)
-- 
GitLab