#!/usr/bin/tclsh
# Compute the total dimension of a simulation

set infile [open [lindex $argv 0] "r"]

gets $infile nextline

set total 0
while {[gets $infile nextline] >= 0} {
  set weight [lindex [split $nextline " "] 0]
  incr total $weight
}
puts stdout "** TOTAL DIMENSION: $total"

