diff --git a/src/ComputingTasks.cc b/src/ComputingTasks.cc index f999bee05afd243fe873130ae8f76e2d5fc45a82..955d5bbbc8f8f6a3d239d83536080037876382f7 100644 --- a/src/ComputingTasks.cc +++ b/src/ComputingTasks.cc @@ -1275,7 +1275,11 @@ DynareSensitivityStatement::checkPass(ModFileStructure &mod_file_struct, Warning { if (auto it = options_list.num_options.find("identification"); it != options_list.num_options.end() && it->second == "1") - mod_file_struct.identification_present = true; + { + mod_file_struct.identification_present = true; + // The following triggers 3rd order derivatives, see preprocessor#40 + mod_file_struct.identification_order = max(mod_file_struct.identification_order, 2); + } mod_file_struct.sensitivity_present = true; } @@ -2731,7 +2735,7 @@ IdentificationStatement::checkPass(ModFileStructure &mod_file_struct, WarningCon mod_file_struct.identification_order = max(mod_file_struct.identification_order, order); } else - // The default value for order is 1 (which triggers 2nd order dynamic derivatives) + // The default value for order is 1 (which triggers 2nd order dynamic derivatives, see preprocessor#40) mod_file_struct.identification_order = max(mod_file_struct.identification_order, 1); } diff --git a/src/ModFile.cc b/src/ModFile.cc index 20c27c37bd1e5af18cd56e0a72c10b2b6555ba67..84e2588d02130fd70e3ef2b26aa9e8793ed4dec2 100644 --- a/src/ModFile.cc +++ b/src/ModFile.cc @@ -779,7 +779,7 @@ ModFile::computingPass(bool no_tmp_terms, FileOutputType output, int params_deri exit(EXIT_FAILURE); } int derivsOrder = max(mod_file_struct.order_option, - mod_file_struct.identification_order + 1); + mod_file_struct.identification_order + 1); // See preprocessor#40 if (mod_file_struct.sensitivity_present || linear || output == FileOutputType::second) derivsOrder = max(derivsOrder, 2); if (mod_file_struct.estimation_analytic_derivation || output == FileOutputType::third)