Read_dump error expected integer parameter-10Aug15 version

Dear Lammps users,

I dumped an xyz file with lammps command:

dump coord1 oxyvac xyz 1 oxyvac.xyz
run 0

then use read_dump with the same xyz file without changing anything in the file:

read_dump oxyvac.xyz 0 x y z box no format xyz

an error generated saying: Expected integer parameter in input script or data file (/reader_xyz.cpp:62)

I went to the 62th line of reader_xyz.cpp and I found the error should be due to the natom parameter. It seems it can’t get the first line’s atom number. I tried the same script at 2012 version and all work fine.

I also compare the difference in reader_xyz.cpp regarding getting natom value between the 2012 version and 2015 version. The only thing might be a problem is that in 2015 version, it return ATOBIGINT(str), “str” is a char variable. While in 2012 version, ATOBIGINT(line) use the int variable “line” as input parameter.

I don’t know if this could also be due to compiling problem when building lammps.

Thank you for your help!

Sincerely,
Shenli Zhang

​this is a bug in reader_xyz.cpp
it does a more thorough check on the correct file format than before, but
the check is a bit ​too strict. the following change corrects for it.

[[email protected] src]$ git diff
diff --git a/src/reader_xyz.cpp b/src/reader_xyz.cpp
index 2c18e33..4ac6ba1 100644
--- a/src/reader_xyz.cpp
+++ b/src/reader_xyz.cpp
@@ -58,7 +58,14 @@ int ReaderXYZ::read_time(bigint &ntimestep)
   if (eof == NULL) return 1;

   // first line has to have the number of atoms

this will be in a patch today …

Steve