#!/bin/csh -f
if ( $#argv >= 1 ) then
  if ( $#argv >= 2 ) then
    set cl_id=$2
    set cluster=$cl_id
  else
    set cl_id=
    set cluster=0
  endif
  echo "Sorted tracefile: $1.trf$cl_id"
  cat $1/node*.$cluster | grep -v '\-32768' | \
  sort +1n -2 +2n -3 +0n -1 > $1.trf$cl_id
  tachyon $1.trf$cl_id
endif

exit 0
