From bcd39ef2f7701a19e6cee838b8c16c238535ce2b Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?St=C3=A9phane=20Adjemian=20=28Hermes=29?=
 <stephane.adjemian@univ-lemans.fr>
Date: Thu, 19 May 2016 14:44:49 +0200
Subject: [PATCH] Made room for user written steady state file.

---
 julia/DynareModel.jl    | 2 ++
 preprocessor/ModFile.cc | 6 ++++++
 2 files changed, 8 insertions(+)

diff --git a/julia/DynareModel.jl b/julia/DynareModel.jl
index 58426148ab..cba72b0362 100644
--- a/julia/DynareModel.jl
+++ b/julia/DynareModel.jl
@@ -110,6 +110,7 @@ type Model
     lead_lag_incidence::Matrix{Int}
     nnzderivatives::Vector{Int}
     analytical_steady_state::Bool
+    user_written_analytical_steady_state::Bool
     static_and_dynamic_models_differ::Bool
     equation_tags::Vector{UTF8String}
     exo_names_orig_ord::Vector{Int}
@@ -158,6 +159,7 @@ function dynare_model()
                  Array(Int, 3, 0),      # lead_lag_incidence
                  zeros(Int, 3),         # nnzderivatives
                  false,                 # analytical_steady_state
+                 false,                 # user_written_analytical_steady_state
                  false,                 # static_and_dynamic_models_differ
                  Array(ASCIIString,0),  # equation_tags
                  Array(Int64,1),        # exo_names_orig_ord
diff --git a/preprocessor/ModFile.cc b/preprocessor/ModFile.cc
index 1ea0cccdf2..ce7318c9df 100644
--- a/preprocessor/ModFile.cc
+++ b/preprocessor/ModFile.cc
@@ -1111,6 +1111,9 @@ ModFile::writeExternalFilesJulia(const string &basename, FileOutputType output)
                << "using Utils" << endl
                << "using " << basename << "Static" << endl
                << "using " << basename << "Dynamic" << endl
+               << "if isfile(\"" << basename << "SteadyState.jl"  "\")" << endl
+               << "    using " << basename << "SteadyState" << endl
+               << "end" << endl
                << "if isfile(\"" << basename << "SteadyState2.jl"  "\")" << endl
                << "    using " << basename << "SteadyState2" << endl
                << "end" << endl << endl
@@ -1173,6 +1176,9 @@ ModFile::writeExternalFilesJulia(const string &basename, FileOutputType output)
 
   jlOutputFile << "model.static = " << basename << "Static.static!" << endl
                << "model.dynamic = " << basename << "Dynamic.dynamic!" << endl
+               << "if isfile(\"" << basename << "SteadyState.jl"  "\")" << endl
+               << "    model.user_written_analytical_steady_state = true" << endl
+               << "end" << endl
                << "if isfile(\"" << basename << "SteadyState2.jl"  "\")" << endl
                << "    model.analytical_steady_state = true" << endl
                << "    model.steady_state = " << basename << "SteadyState2.steady_state!" << endl
-- 
GitLab