From c3d653b623f2d7f74c2e02b29efa89b53d4dbeb8 Mon Sep 17 00:00:00 2001
From: Ferhat Mihoubi <ferhat.mihoubi@univ-evry.fr>
Date: Fri, 18 Mar 2011 12:47:06 +0100
Subject: [PATCH] Check for varexo_det declaration and simul command
 incompatibility in the same mode-file

---
 preprocessor/ModFile.cc | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/preprocessor/ModFile.cc b/preprocessor/ModFile.cc
index f38fb2d71..b06b68057 100644
--- a/preprocessor/ModFile.cc
+++ b/preprocessor/ModFile.cc
@@ -286,7 +286,13 @@ ModFile::transformPass()
       cerr << "ERROR: There are " << dynamic_model.equation_number() << " equations but " << symbol_table.endo_nbr() << " endogenous variables!" << endl;
       exit(EXIT_FAILURE);
     }
-
+  
+  if (symbol_table.exo_det_nbr() > 0 && mod_file_struct.simul_present)
+    {
+      cerr << "ERROR: A .mod file cannot contain both a simul command and varexo_det declaration (all exogenous variables are deterministic in this case)" << endl;
+      exit(EXIT_FAILURE);
+    }
+  
   cout << "Found " << dynamic_model.equation_number() << " equation(s)." << endl;
 
   if (symbol_table.exists("dsge_prior_weight"))
-- 
GitLab