#!/bin/csh -f
#
# Nov. 13, 1998 clh change ez line to refer to
#   (lowercase) JGOFSTEMPDIR was jgofsdir - 
#   shown here in upcase so that makefile does not 
#   alter this comment
#
# Dec. 15, 1998 clh some hosts do not have DNS names
#   make conditional use of REMOTE_HOST - docs say
#   that REMOTE_ADDR always available
#
#
if ( $#argv < 4) then
  echo "Usage : p2 objectname [-r] [-l] x1var [-r] [-l] x2var [-r] [-l] yvar"
  exit(1)
  endif
set obj = "$argv[1]"
#echo "$obj"
set stuff=

set icnt=2
set argc = 0
while ( ( $icnt <= $#argv ) && ( $argc <= 2 ) )
  set stuff = "$stuff $argv[$icnt]"
  if ( "$argv[$icnt]" != "-l"  && "$argv[$icnt]" != "-r" ) then
    @ argc += 1
  endif
  @ icnt += 1
  end

if ( $argc != 3) then
  echo $argv[0] requires object xvar1 xvar2 yvar
  exit(1)
  endif

echo scaling...
if (${?REMOTE_HOST}) then
  ez "$obj" $stuff /home/wsass/port8200/test_GEOTRACE_protected_OOserver/htdocs/jgofsopt/8200/${REMOTE_HOST}/pxxy
else 
  ez "$obj" $stuff /home/wsass/port8200/test_GEOTRACE_protected_OOserver/htdocs/jgofsopt/8200/${REMOTE_ADDR}/pxxy
end
if ( $status )then
  exit(1)
  endif

echo plotting...
chmod +x tmp.plt
ers
tmp.plt $argv[$icnt-]
