From: Axel Kohlmeyer (
Date: Sat Apr 05 2008 - 18:08:23 CDT

On Sat, 5 Apr 2008, Yinglong Miao wrote:

YM> Hi,

dear long,

apart from the other suggestions, which are good, the simples solution
to your problem is to chop your run into parts and name
your .dcd files for each part differently. this also is in general
considered good practice as this reduces the impact of any file
corruption on scratch disks.


YM> I have a question about reading big binary DCD files in FORTRAN. In my
YM> simulations with NAMD, there are cycles in which I want to read two frames
YM> at the end of the DCD output trajectory for analysis and go back to NAMD to
YM> continue. The problem is that the size of the DCD file keeps increasing as
YM> the simulation goes on, and so does the time needed for reading. I am
YM> wondering whether their are ways to read the last several frames of a DCD
YM> file directly without going through the big file from the beginning in
YM> I have tried to open the DCD file with position put at the end of the file
YM> (append for position) and use "backspace" to read the lines I want, but it
YM> turned out that the backspace doesn't work for unformatted files. I also
YM> tried reading DCD lines using "direct access", but it seemed that only 1
YM> record can be accessed. So my question is whether the DCD file supports
YM> "direct access" reading. Or are there any other ways you know for my
YM> purpose? I will appreciate it if you can share your experiences with me.
YM> Thanks,
YM> Long

Axel Kohlmeyer
   Center for Molecular Modeling   --   University of Pennsylvania
Department of Chemistry, 231 S.34th Street, Philadelphia, PA 19104-6323
tel: 1-215-898-1582,  fax: 1-215-573-6233,  office-tel: 1-215-898-5425
If you make something idiot-proof, the universe creates a better idiot.