From 4282c98527817ed587d6df58b96a5d4432aa0072 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?S=C3=A9bastien=20Villemot?= <sebastien@dynare.org>
Date: Tue, 28 Mar 2023 18:46:06 +0200
Subject: [PATCH] New field: M_.discretionary_orig_eq_nbr

It indicates the number of equations written in the model block by the user in
the discretionary policy case.
---
 src/ModFile.cc | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/src/ModFile.cc b/src/ModFile.cc
index 8e4a9736..f46e60bc 100644
--- a/src/ModFile.cc
+++ b/src/ModFile.cc
@@ -900,6 +900,9 @@ ModFile::writeMOutput(const string &basename, bool clear_all, bool clear_global,
               << "options_.ramsey_policy = " << (mod_file_struct.ramsey_model_present || mod_file_struct.ramsey_policy_present) << ";" << endl
               << "options_.discretionary_policy = " << mod_file_struct.discretionary_policy_present << ";" << endl;
 
+  if (mod_file_struct.discretionary_policy_present)
+    mOutputFile << "M_.discretionary_orig_eq_nbr = " << original_model.equation_number() << ";" << endl;
+
   if (parallel_local_files.size() > 0)
     {
       mOutputFile << "options_.parallel_info.local_files = {" << endl;
-- 
GitLab