diff --git a/doc/src/Errors_details.rst b/doc/src/Errors_details.rst index b63d80a9ae..2a08a308f4 100644 --- a/doc/src/Errors_details.rst +++ b/doc/src/Errors_details.rst @@ -13,15 +13,27 @@ discussions of such cases. Unknown identifier in data file ------------------------------- -This error happens when LAMMPS encounters a line of text in an unexpected format -while reading a data file. This is most commonly cause by inconsistent header and -section data. The header section informs LAMMPS how many entries or lines are expected in the -various sections (like Atoms, Masses, Pair Coeffs, *etc.*\ ) of the data file. -If there is a mismatch, LAMMPS will either keep reading beyond the end of a section -or stop reading before the section has ended. +This error happens when LAMMPS encounters a line of text with an +unexpected keyword while :doc:`reading a data file `. This +would be either header keywords or section header keywords. This is +most commonly due to a mistyped keyword or due to a keyword that is +inconsistent with the :doc:`atom style ` used. -Such a mismatch can happen unexpectedly when the first line of the data -is *not* a comment as required by the format. That would result in -LAMMPS expecting, for instance, 0 atoms because the "atoms" header line -is treated as a comment. +The header section informs LAMMPS how many entries or lines are expected +in the various sections (like Atoms, Masses, Pair Coeffs, *etc.*\ ) of +the data file. If there is a mismatch, LAMMPS will either keep reading +beyond the end of a section or stop reading before the section has +ended. In that case the next line will not contain a recognized keyword. +Such a mismatch can also happen when the first line of the data +is *not* a comment as required by the format, but a line with a valid +header keyword. That would result in LAMMPS expecting, for instance, +0 atoms because the "atoms" header line is the first line and thus +treated as a comment. + +Another possibility to trigger this error is to have a keyword in the +data file that corresponds to a fix (e.g. :doc:`fix cmap `) +but the :doc:`read_data ` command is missing the (optional) +arguments that identify the fix and the header keyword and section +keyword or those arguments are inconsistent with the keywords in the +data file. diff --git a/src/read_data.cpp b/src/read_data.cpp index 657369d5d0..36bbce605f 100644 --- a/src/read_data.cpp +++ b/src/read_data.cpp @@ -1360,7 +1360,8 @@ void ReadData::header(int firstpass) // check that exiting string is a valid section keyword parse_keyword(1); - if (!is_data_section(keyword)) error->all(FLERR, "Unknown identifier in data file: {}", keyword); + if (!is_data_section(keyword)) + error->all(FLERR, "Unknown identifier in data file: {}{}", keyword, utils::errorurl(1)); // error checks on header values // must be consistent with atom style and other header values