From 3c4d647cc33a14d3648ad0989557cf687a650487 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?S=C3=A9bastien=20Villemot?= <sebastien@dynare.org>
Date: Tue, 4 May 2021 17:10:36 +0200
Subject: [PATCH] Forbid mfs > 0 in a stochastic setup (or even when using
 check)

The result would be wrong.

Ref. dynare#1726
---
 src/ModFile.cc | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/src/ModFile.cc b/src/ModFile.cc
index d6bd0c28..32432c1e 100644
--- a/src/ModFile.cc
+++ b/src/ModFile.cc
@@ -358,6 +358,12 @@ ModFile::checkPass(bool nostrict, bool stochastic)
           exit(EXIT_FAILURE);
         }
     }
+
+  if ((stochastic_statement_present || mod_file_struct.check_present) && dynamic_model.mfs > 0)
+    {
+      cerr << "ERROR: mfs > 0 is incompatible with check, stoch_simul, estimation, osr, ramsey_policy, discretionary_policy, calib_smoother, identification, methods_of_moments and sensitivity commands" << endl;
+      exit(EXIT_FAILURE);
+    }
 }
 
 void
-- 
GitLab