#! /bin/csh
echo "Remove old *.f files? (y/n) "
set ans = $<
if( $ans == y ) /bin/rm -f ../../src/*.f >& /dev/null
foreach file (*.r)
set stem = `basename $file .r`
if ( -e ../../src/$stem.f ) then
echo "Remove $stem.f? (y/n)"
set ans = $<
else
set ans = y
endif
if( $ans == y ) then
/bin/rm -f ../../src/$stem.f
ratfor $file > ../../src/$stem.f
e ../../src/$stem.f << EOF >& /dev/null
g/^&     /s//     */
w
q
EOF
else
echo "Leaving $stem.f unchanged."
endif
end
