Re: [AMBER] cpptraj -- doesn't like reading Amber restart files with more than 99, 999 atoms

From: Daniel Roe <>
Date: Fri, 23 Dec 2011 11:42:43 -0500


This is a case of me writing the restart parser based on what the file
format is said to be:

vs based on what the MD code can actually write (I see now there are
cases in there to allow one more digit for atom #s). This is one of
the annoying things about fixed fortran format strings I guess. If you
want a quick fix just change line ~56 of AmberRestart.cpp (function
AmberRestart::open) from:



nread=sscanf(buffer,"%i %lE %lE",&restartAtoms,&restartTime,&restartTemp);

and recompile, that should fix it. In the meantime I will work on a patch.


On Fri, Dec 23, 2011 at 11:25 AM, Ben Roberts <> wrote:
> Hi,
> I just tried running a wrap command using cpptraj, on an Amber ASCII restart file. The restart file in question contains 311,677 atoms, and is declared to contain such in its header. However, when I tried the trajin command, I got this response:
> INPUT: Reading Input from file wrap_and_centre.ptraj
>  [trajin BPR-20111213-001_out.rst7]
> Error: AmberRestart::SetupRead(): Number of atoms in restart (31167)
>       does not match number of atoms in parmtop (311677)
> ERROR: Setting up BPR-20111213-001_out.rst7 for read.
> The restart file header looks like this:
> <start of file>
> 311677  0.1000000E+03
>  28.3626573  14.0009538 -28.1877328  27.4850731  14.2777715 -28.6040488
> Now, it appears as though the parsing of the restart file may not cope with more than five characters in the "number of atoms" field. Is this the case? If so, has it been fixed or patched in AT 1.5, or for that matter in the version under development?
> Cheers,
> Ben
> _______________________________________________
> AMBER mailing list

Daniel R. Roe, PhD
Postdoctoral Associate
BioMaPS Institute, Rutgers University
610 Taylor Road
Piscataway, NJ   08854
AMBER mailing list
Received on Fri Dec 23 2011 - 09:00:03 PST
Custom Search