From 219c8d2a47f05c14d0e18f5b2936f35223f25f2a Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?S=C3=A9bastien=20Villemot?= <sebastien@dynare.org>
Date: Tue, 18 Oct 2022 17:28:25 +0200
Subject: [PATCH] =?UTF-8?q?Do=20not=20error=20out=20in=20stochastic=20mode?=
 =?UTF-8?q?=20if=20mfs=20>=200=20but=20=E2=80=9Cblock=E2=80=9D=20option=20?=
 =?UTF-8?q?not=20passed?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

In that case, the block-DR routines will not be called.
---
 src/ModFile.cc | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/src/ModFile.cc b/src/ModFile.cc
index 48027e60..933f0cf7 100644
--- a/src/ModFile.cc
+++ b/src/ModFile.cc
@@ -369,9 +369,12 @@ ModFile::checkPass(bool nostrict, bool stochastic)
     }
 
   // See dynare#1726
-  if ((stochastic_statement_present || mod_file_struct.check_present) && dynamic_model.mfs > 0)
+  if ((stochastic_statement_present || mod_file_struct.check_present) && block && 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;
+      /* NB: If mfs>0 but “block” is not passed, the block-DR routines will not
+         be called, so do not fail in that case (we may want to use the sparse
+         block representation) */
+      cerr << "ERROR: the `block` option used in conjunction with `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);
     }
 }
-- 
GitLab