#!/bin/bash
#
# build options files for trane (with or without MPI)
# uname -a
# Darwin trane.evsc.virginia.edu 9.8.0 Darwin Kernel Version 9.8.0: Wed Jul 15 16:55:01 PDT 2009; root:xnu-1228.15.4~1/RELEASE_I386 i386
#
# without MPI: genmake2 -of darwin_ia32_pgf95_trane
#    with MPI: genmake2 -of darwin_ia32_pgf95_trane -mpi

if test "x$MPI" = xtrue ; then
  CC='mpicc'
  FC='mpif90'
  LINK='mpif90'
else
  CC='pgcc'
  FC='pgf95'
  LINK='pgf90'
fi

DEFINES='-DWORDLENGTH=4 -DNML_TERMINATOR'
CPP='/usr/bin/cpp -traditional -P'
# make clean removes also these files
RMFILES='*.oo'
EXTENDED_SRC_FLAG='-Mextend'

FFLAGS="$FFLAGS -byteswapio"

if test "x$IEEE" = x ; then
   #  No need for IEEE-754
   FOPTIM='-fast -Mipa=fast,inline,safe'
else
   #  Try to follow IEEE-754
   FFLAGS="$FFLAGS -Mnodclchk -Ktrap=fp -Kieee"
   FOPTIM=
fi
CFLAGS='-fast -Mipa=fast,inline,safe'

# specific location for trane:
MPI_INC_DIR="/common/mpich2-mx-1.1.1p1..5/src/include"
if test "x$MPI" = xtrue ; then
    INCLUDES="$INCLUDES -I$MPI_INC_DIR"
fi 

NETCDF_INCDIR="/common/usr/local/include"
INCLUDES="$INCLUDES -I$NETCDF_INCDIR"
LIBS="-L/common/usr/local/lib"

