#! /bin/sh
# 
# Here is a simple way to change the Fortran tests to Fortran 90 tests
# First, this compiles all of the .f files with the selected compiler.
# Note that this *will not work* with Fortran programs that require another
# file.
$bindir=@BINDIR@
MPIF90BASE="$bindir/mpif90 -choicemod"
for file in *.f ; do
    rm -f t90.f
    basefile=`basename $file .f`
    # We must remove implicit none because implicit none must come BEFORE
    # include 'mpif.h' but AFTER use mpi
    sed -e 's/^[ ]*include[ ]*.mpif\.h.[ ]*$/         use mpi/g' \
	-e '/^[ ]*implicit[ ]*none[ ]*$/d' \
	$file > t90.f
    echo "Compiling $file as Fortran 90"
    $MPIF90BASE -o $basefile.o t90.f 
done
rm -f t90.f

