From: Neelanjana Sengupta (
Date: Sun Jun 20 2010 - 06:27:02 CDT

Dear VMD experts,

I am using NAMDenergy (in the text mode) for evaluating the interaction
energy between 2 selections, one of which actually changes at each frame.
Hence, I wrote out a data file containing the second selection at each time
step. I then load the trajectory step by step, and evaluate with namdenergy.
My code has the foll. key parts in a loop:

mol new sys.psf
mol addfile sys.dcd first $n last $n waitfor all

namdenergy -sel $sel1 $sel3 -par ../par_all22_prot.inp -nonb -extsys sys.xsc
-ofile files/en_frm$n

Curiously, while this *worked well* for 2 of my dcd files, for another dcd
file corresponding to a latter part of the timeline for the same simulation,
this does not work!! I am getting the foll. error message:

*Info) Opened coordinate file namd-temp.pdb for writing.
ERROR) write_timestep returned nonzero
Info) Finished with coordinate file namd-temp.pdb.
atomsel: writepdb failed.*

However, the namd-temp.pdb is written out.

Can someone help me zero in on the problem here?

Thanks in advance,
Neelanjana Sengupta