#! /bin/csh

# This is a typical Unix script for running a program such as MINOS.
# It should be called "run" and marked executable (via chmod +x run).
# Note that file names of the form fort.* may be machine-dependent.
#
# 30 May 1991: Original version written by Philip Gill for a DECstation 3100.
#              DECstation and Sun systems use names like fort.4.
# 15 Dec 1995: HP 9000 systems use names like ftn04.
# 23 Jul 2003: Executables no longer have .exe suffix.


if ({$1}x == x) then
     echo './run minos pilots       runs minos with pilots.mps, pilot.spc'
     echo './run minos pilots lp    runs minos with pilots.mps, lp.spc'
     exit
endif

set PROB = $1
if ({$2}x != x)  then
     set PROB = $2
endif

set SPECS = $PROB
if ({$3}x != x)  then
     set SPECS = $3
endif
echo "Defining $2 files"
echo "Will use $SPECS.spc"

#rm	fort.4	>& /dev/null
#rm	fort.10	>& /dev/null


\cp -fp $SPECS.spc  fort.4	
\cp -p  $PROB.mps   fort.10	
\cp -fp $PROB.basis fort.11  >& /dev/null
ls -l {$PROB}*   
if ($SPECS != $PROB) then 
   ls  -l {$SPECS}*
endif

# Run the specified executable.
./$1

\cp -fp fort.9  $PROB.out		
\cp -fp fort.12 $PROB.newbasis  >& /dev/null

#rm fort.4	
#rm fort.9	>& /dev/null
#rm fort.10	
#rm fort.12	>& /dev/null
