#!/bin/csh -f

# if netserver is Xinet or Helios

if ($argv[1] != "0") then
  if ($argv[3] == "no_grs") then
    cvw_to_ct -i$argv[2] -p $argv[5]
  else
    cvw_to_ct -i$argv[2] -p -l $argv[5]
  endif
  dtlgro BG_DTL_CTBRIX:cttoeps "$argv[5] -OUT=$argv[6] $argv[7-$#argv]"
  if ($argv[1] == "1") then
    ksimb $argv[6] -o=$argv[4]
  else  if ($argv[1] == "2") then
    hesimb $argv[6] -o=$argv[4]
  else
    pathworksimb $argv[6] -o=$argv[4]
  endif
  /bin/rm -f $argv[5]
  /bin/rm -f $argv[6]
# no netserver
else
  if ($argv[3] == "no_grs") then
    cvw_to_ct -i$argv[2] -p $argv[5]
  else
    cvw_to_ct -i$argv[2] -p -l $argv[5]
  endif
  dtlgro BG_DTL_CTBRIX:cttoeps "$argv[5] -OUT=$argv[6] $argv[7-$#argv] -DEBUG=1"
  /bin/rm -f $argv[5]
endif



