#!/bin/csh

echo ''
      ./configure
source .configure

set fname = rsg3_vinterp

if( -e ${fname}_${ARCH}.x ) /bin/rm ${fname}_${ARCH}.x
if( -e test.o ) /bin/rm test.o
if( -e test.F ) /bin/rm test.F
cat $fname.F  > test.F

echo ''
echo Compiling ${fname}.F ...


# Linux Compilation
# -----------------
if( ${ARCH} == 'Linux' ) then

     set gfio = GMAO_gfio_r8
     set cfio = MAPL_cfio_r8
     set hdf  = GMAO_mfhdf3

ifort -c -DESMA  -I$BASEDIR/$ARCH/include/esmf \
         -O3 -assume byterecl  -extend_source -fpe0  -align dcommons -Dmpi -r8 test.F

ifort -c -DESMA  -I$BASEDIR/$ARCH/include/esmf \
         -O3 -assume byterecl  -extend_source -fpe0  -align dcommons -Dmpi -r8 set_eta.F90

ifort -c -DESMA  -I$BASEDIR/$ARCH/include/esmf \
         -O3 -assume byterecl  -extend_source -fpe0  -align dcommons -Dmpi -r8 PWSSSP.F

ifort -o test.x test.o set_eta.o PWSSSP.o

endif


/bin/rm test.F
/bin/rm test.o
if( -e  test.x ) then
/bin/mv test.x  ${fname}.x
echo "Created   ${fname}.x"
echo " "
              ./${fname}.x
endif
