error about tclForcesScript

From: xiaojing gong (gongxiaojing1981_at_yahoo.com.cn)
Date: Mon Apr 10 2006 - 09:21:13 CDT

Dear all.
      I use the tclForcesScript provided by the nanotube tutoral on the NAMD website, but there is often a fatal error when I use a line of command, it is "set z [expr $z-round($z/$cellLengthZ)*$cellLengthZ]" and I don't know why it causes the error. The attachment is the tclForceScript and the error message. Hope you can help me.
  Gong Xiaojing

                
---------------------------------
 雅虎1G免费邮箱百分百防垃圾信

#############################################################
## EXTRA PARAMETERS ##
#############################################################

tclForces on

tclForcesScript {
  set cellLengthZ 73.104 ;# The length of the unit cell in the z-direction, should be the same as the value in "cellBasisVector3"
  set LowerBoundary 33.0
  set UpperBoundary 38.0
  set force {0 0 -0.15}
  set watIdList {}
  for {set i 33162} {$i<62341} {incr i 3} {
    lappend watIdList $i
    addatom $i
  }
  proc calcforces {} {
    global cellLengthZ LowerBoundary UpperBoundary force watIdList
    loadcoords coorList
    foreach i $watIdList {
      set z [lindex $coorList($i) 2]
      #set z [expr $z-round($z/$cellLengthZ)*$cellLengthZ] ;# Translate this coordinate into its corresponding value in the original unit cell
      if {$z<$UpperBoundary || $z>$LowerBoundary} {
        addforce $i $force
      }
    }
  }
}
                                                                   

run 5500000
                                                             
                                                             

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