From 3c6a23137b6d15a672acdffe1c4d2a1774a9808d Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?St=C3=A9phane=20Adjemian=20=28Charybdis=29?=
 <stepan@adjemian.eu>
Date: Fri, 28 Feb 2020 18:28:09 +0100
Subject: [PATCH] Throw an error if mh_tune_jscale is used with mh_jscale.

---
 src/ComputingTasks.cc | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/src/ComputingTasks.cc b/src/ComputingTasks.cc
index b0609cd5..8f5c5a54 100644
--- a/src/ComputingTasks.cc
+++ b/src/ComputingTasks.cc
@@ -1215,6 +1215,13 @@ EstimationStatement::checkPass(ModFileStructure &mod_file_struct, WarningConsoli
       exit(EXIT_FAILURE);
     }
 
+  if (options_list.num_options.find("mh_tune_jscale.target") != options_list.num_options.end()
+      && options_list.num_options.find("mh_jscale") != options_list.num_options.end())
+    {
+      cerr << "ERROR: The mh_tune_jscale and mh_jscale options of the estimation statement are incompatible." << endl;
+      exit(EXIT_FAILURE);
+    }
+
   /* Check that we are not trying to estimate a parameter appearing in the
      planner discount factor (see dynare#1173) */
   vector<int> estimated_params_in_planner_discount;
-- 
GitLab