Re: namd cvs 26.06.09, tcl 8.5, loadcoords

From: Vlad Cojocaru (
Date: Tue Jun 30 2009 - 02:45:21 CDT

Dear NAMD users,

Just a short follow up on my previous mail. I recompiled with tcl
8.4.19 and the problem I reported disappeared. So, it must be a tcl 8.5
issue. Maybe you guys would like to look into this ...

To be more precise about the problem that comes up when compiling agains
tcl8.5 .... If I have a tcl script
        foreach a $atoms {addatom $a}
        set group [ addgroup $atoms ]

Then I use loadcoords to retrieve the coordinates (of course within a
calcforces procedure)
       loadcoords coords
       set xyz $coords($group)

I get the error "coords(g1) ... no such element in array "...
I did some investigation and add some array checks and it turns out that
the array "coords" exists and it has the correct size ... but then when
I try to collect the array keys using "[array names coords]", instead of
getting a list of atomids plus "g1", as the id of the defined group, I
get the list of all coordinates of the atoms I added (a list of
3-element lists). ...

This does not occur when compiled agains tcl8.4.19

Best regards

Vlad Cojocaru wrote:
> Dear NAMD users,
> I noticed that when the cvs code of namd (on 26th of June 2009) was
> compiled using tcl 8.5.7 (with gcc 4.1) on a x86_64 arch, I got a
> rather unexpected behavior of the tcl command "loadcoords". This
> command instead of returning a tcl array , it returns a tcl list in
> which each element of the list is a list with the coordinates of the
> atoms and groups defined. The coordinates are what I expect but of
> course this means I need to change the script accordingly ...
> Has somebody already observed this ? If yes, is this valid for
> loadforces and loadtotalforces ?
> If this was not observed by anybody else, I will do more tests to see
> if this is reproducible with the tclforces tutorial files ...
> Thanks
> Best wishes
> Vlad

Dr. Vlad Cojocaru
EML Research gGmbH
Schloss-Wolfsbrunnenweg 33
69118 Heidelberg
Tel: ++49-6221-533202
Fax: ++49-6221-533298
EML Research gGmbH
Amtgericht Mannheim / HRB 337446
Managing Partner: Dr. h.c. Klaus Tschira
Scientific and Managing Director: Prof. Dr.-Ing. Andreas Reuter

This archive was generated by hypermail 2.1.6 : Wed Feb 29 2012 - 15:52:59 CST