#!/bin/sh
# f77 interface for ratfor and xlf fortran compiler.
# Nicolas Brouard <brouard@frined51>

#set -x
#echo "Command $0 $*" 
#PATH=/bin:/usr/bin:/usr/ucb
#export PATH

# set up initial undefined variable values
stat=
statrat=
prog=$0
cwd=`pwd`
pname=`basename $cwd`
#echo $prog $cwd $pname

#RATDIR=/usr/local/bin
#export RATDIR

afile=
ofile=

while test $# != 0
do	
        case "$1" in
	-o)	ofile=$2 ; shift ;;
	-v)	echo "(ratfor):" $0 $*;;
	*.r)    rfile=`expr $1 : '\(.*\)\.r'`;#echo $rfile.r:;
		echo "ratfiv /f77 $rfile.r >$ofile";
		ratfiv /f77 $rfile.r >$ofile;
		statrat=$?; # echo "Statrat=" $statrat;
		;;
	esac
	shift
done
stat=$?
#echo "Status" $stat
case "$stat" in 
   0) ;;#echo $srfile   ;;
esac