#!/bin/bash
#
# Build options for Darwin on G5 Mac with IBM XL Fortran compilers
# tested on G5 dual, 2GHz
# ( Darwin eaps-dhcp-162.lcs.mit.edu 6.7.5 Darwin Kernel Version 6.7.5: Mon Aug 11 19:28:40 PDT 2003; root:xnu/xnu-344.21.73.obj~1/RELEASE_PPC  Power Macintosh powerpc )
# cc-compiler is available only with the Apple Developer Tools,
# so make sure that those are installed
#
# **NOTES**
#   o with Darwin you must remember to build on a ufs file system. The default Darwin file system (hfs) treats
#     upper case and lower case file names as the same file. This breaks the current MITgcm build procedure.
#   o tim.c should use uembellished cloc() are the procedure name for XLF
#     ETIME (timers.F) and FDATE (utils.F) are not available with Darwin+XLF so need to be switched out.
#

#export TOOLSDIR=/Users/baylor/Research/MITgcm.up/tools

CPP='/usr/bin/cpp -traditional -P -xassembler-with-cpp'
FC=/opt/ibmcmp/xlf/8.1/bin/f77
LINK=/opt/ibmcmp/xlf/8.1/bin/f77
#LINK=/usr/local/bin/g77
FFLAGS='-qfixed=132 -qsuffix=f=for'
FOPTIM='-O5'
#SKIP_NETCDF_CHECK=t
#HAVE_NETCDF=t
LIBS='-L/Users/baylor/Research/netcdf-3.6.0-xlf/lib -lnetcdf -L/usr/lib -lSystemStubs'
INCLUDES='-I/Users/baylor/Research/netcdf-3.6.0-xlf/include'
# FC_NAMEMANGLE="#define FC_NAMEMANGLE(X) _ ## X"
FC_NAMEMANGLE="#define FC_NAMEMANGLE(X) X"

S64='$(TOOLSDIR)/set64bitConst.sh'
#MAKEDEPEND='${TOOLSDIR}/xmakedepend'
MAKEDEPEND=makedepend
DEFINES='-DWORDLENGTH=4'
NOOPTFILES='ini_curvilinear_grid.F'
NOOPTFLAGS='-O3'
