#!/bin/bash
#
# To be used with the suite of cray compilers (PrgEnv-cray).
# To get netcdf, add:
# module load cray-hdf5-parallel/1.10.0.1
# module load cray-netcdf-hdf5parallel/4.4.1.1


CC='cc'
FC='ftn'
F90C='ftn'

DEFINES='-DWORDLENGTH=4 -D_BYTESWAPIO -DHAVE_LAPACK'
CPP='cpp -traditional -P'
EXTENDED_SRC_FLAG='-Mextend'
GET_FC_VERSION="-V"
CHECK_FOR_LAPACK=t

INCLUDES='-I/opt/cray/netcdf-hdf5parallel/4.4.1.1/cray/83/include -I/opt/cray/mpt/7.5.5/gni/mpich-cray/84/include'
LIBS='-L/opt/cray/netcdf-hdf5parallel/4.4.1.1/cray/83/lib -L/opt/cray/mpt/7.5.5/gni/mpich-cray/84/lib'

NOOPTFLAGS='-O0'
NOOPTFILES=''

if test "x$IEEE" = x ; then   #- with optimisation:
#   FOPTIM='-O2 -hfp3 -Oipa5' for less agressive optimization 
#   Be aware not all experiments pass the restart test with optimization 
    FOPTIM='-O3 -hfp3 -Oipa5'
else
    if test "x$DEVEL" = x ; then  #- no optimisation + IEEE :
      FOPTIM='-O0 -hfp0'
    else                          #- development/check options:
      FOPTIM='-O0 -hfp0'
      FOPTIM="$FOPTIM -g -Rbc -rm -hmsgs -hnegmsgs"
    fi
fi

#- For big executable, this could help:
#FFLAGS='-h pic -dynamic'
#CFLAGS='-h pic -dynamic'

