From: vladanstefanovic_at_kg.ac.rs
Date: Wed Feb 29 2012 - 13:51:58 CST

Hello VMD users,

I'm trying to calculate adsorption of molecules of glucose on silica
nanochannel wall.
I need to know how many molecules are adsorbed on the surface of the
silicate wall-SiO2 per time.
I made VMD Tk console script to count for each frame all molecules that
have coord z under min value of molecules distance from the wall; and put
the total number of those molecules into the array consisting of molecules
number for each frame.
The script doesn't work and I don't know why?

set frmnum [molinfo top get numframes]
set layer_min 17.64
set molnumb 29
set counter 0

set file_out [open Adsorption.dat w]

for {set i 0} {$i < $frmnum} {incr i} {
for {set j 1} {$j <= $molnumb} {incr j} {

set mol_select [atomselect top "segid GLUB and resid $j"]
$mol_select frame $i
set centmas [measure center $mol_select weight mass]
set coordz [$centmas get z]

if {$coordz <= $layer_min} {
incr counter
}
}
set array($i.r) $counter
puts $file_out "$array($i.r)"

set counter 0
}
close $file_out

After I start the script it shows message: "invalid command name" then
some three numbers and stops working.
Can somebody please explane to me, why it doesn't work and what would be
the best solution.

Best greetings,
Vlada