From: Peter Freddolino (petefred_at_ks.uiuc.edu)
Date: Tue Oct 03 2006 - 11:07:52 CDT

Hi Sukesh,
this is quite possibly because you're making a new atomselect at each
step in the loop. You need to either put
$sel delete
at the end of the inside of your loop, or better, rewrite the script to
use one selection:

set outfile [open nitromethane.xyz w];
set nf [molinfo top get numframes];
set sel [atomselect top "resid 1"]
for { set i 0 } { $i <= $nf } { incr i } {
  $sel frame $i
  $sel writexyz w.xyz;
  set fd [open w.xyz r];
  set s [read $fd];
  close $fd;
  puts $outfile $s;
}
close $outfile;

Shenoy, Sukesh wrote:
> Howdy,
> I have loaded a 1000 nitromethane molecules on 16384 frames. However i
> need the position of just one particular molecule on all frames. So i wrote
> a script file to do this. However it gives me a generic windows error
> message after the script runs for a certain time and then VMD closes.
> Surprisingly the same script file runs for 1000 water molecules perfectly
> and using VMD menu i am able to store all the coordinates. I have a 1 GB
> memory, so i am not sure if this is a memory problem. My script file is
> below. please suggest ideas.
>
> set outfile [open nitromethane.xyz w];
> set nf [molinfo top get numframes];
> for { set i 0 } { $i <= $nf } { incr i } {
> set sel [atomselect top "resid 1" frame $i];
> $sel writexyz w.xyz;
> set fd [open w.xyz r];
> set s [read $fd];
> close $fd;
> puts $outfile $s;
> }
> close $outfile;
>
>
>
> Thanks,
> Sukesh
>
>
>
>