Re: DCD file format

From: Andrew Emerson (
Date: Thu Oct 02 2008 - 02:32:08 CDT

Before I discovered catdcd I used this piece of fortran 90 to read in
DCD files and do simple operations on them:

   character*4 hdr
   integer nset,istart,nsavc,icntrl(5),namnf,jcntrl(9),natoms
   integer ntitle,i,inunit
   real*8 delta, xtable(6)
   real,dimension(:),allocatable :: x,y,z
   character*80 title(10)

   ! read in the header part (only once)
   read(inunit) hdr,nset,nsavc,istart,(icntrl(i),i=1,5),namnf,delta, &
   read(inunit) ntitle,(title(i),i=1,ntitle)
   read(inunit) natoms

   allocate (x(natoms),y(natoms),z(natoms))

  ! do this for each frame in the dcd
   read(inunit) (xtable(i),i=1,6)
   read(inunit) (x(i),i=1,natoms)
   read(inunit) (y(i),i=1,natoms)
   read(inunit) (z(i),i=1,natoms)

but unless you want to write your own analysis routines in C/fortran I
recommend using catdcd instead.

best wishes
Andy Emerson

Santanu Chatterjee wrote:
> Hi,
> I want to find out the DCD file format in NAMD. After googling for a
> bit, I could not find any written documentation on it. I was wondering
> if there is any other documentation available describing the NAMD DCD
> file format. Any help will be appreciated.
> -S

Dr Andrew Emerson
CINECA (High Performance Systems)
via Magnanelli, 6/3
40033 Casalecchio di Reno (BO)-ITALY
tel: +39-051-6171653, fax: +39-051-6137273

This archive was generated by hypermail 2.1.6 : Wed Feb 29 2012 - 05:21:21 CST