#
# ---------------------------------------------------------------------
# common definitions for Intel Linux/PGI, MPICH, real*8
# see http://www.pgroup.com  for Portland Group f90 compiler
# see http://www-unix.mcs.anl.gov/mpi/mpich  for MPICH
# ---------------------------------------------------------------------
#
# MACROS      DESCRIPTIONS:
#
# FC:         Fortran 90 compiler.
# FCFFLAGS:   Fortran 90 compilation flags.
# CC:         C compiler.
# CCFLAGS:    C compilation flags.
# CPP:        cpp preprocessor (may be implied by FC).
# CPPFLAGS:   cpp -D macro flags.
# LD:         Loader.
# LDFLAGS:    Loader flags.
# EXTRALIBS:  Extra local libraries (if any).
#

FC            = mpiifort
#FCFFLAGS      = -xAVX -fp-model precise -no-fma -ftz -r8 -warn nogeneral -diag-disable 10212 -mcmodel=large 
FCFFLAGS      = -g -convert big_endian -assume byterecl -warn -qopt-report -w -O3 -fp-model fast=2 -mtune=core-avx-i -mavx -r8 -mcmodel=large
CC            = mpicc
#CCFLAGS       =	-xAVX -O -mcmodel=large 
CCFLAGS       = #-traceback -xAVX -O -mcmodel=large -shared-intel 
CPP           = mpiicc
CPPFLAGS      = -DMPI -DSERIAL_IO -DTIMER -DRELO $(CPP_EXTRAS)
LD            = $(FC)
LDFLAGS       = $(FCFFLAGS)
#EXTRAFLAGS    = -I/home/anacarinelara/local/fabm/hycom/include -L/home/anacarinelara/local/fabm/hycom/lib -I/home/anacarinelara/HYCOM-ECOSMO/nersc/
#EXTRAFLAGS    = -I/work3/work6/hycom/netcdf_NETUNO/include -I/opt/intel/mkl/include
#EXTRALIBS     = -L/work3/work6/hycom/netcdf_NETUNO/lib -L/opt/intel/mkl/lib -lnetcdf -lnetcdff -lmkl_intel_lp64 -lmkl_sequential -lmkl_core
#
# ---FABM
#
#CPPFLAGS      += -D_FABM_ -I/petrobr/parceirosbr/home/ana.lara2/local/fabm_grazing_quadratico/hycom/include
#EXTRALIBS     += -L/petrobr/parceirosbr/home/ana.lara2/local/fabm/hycom/lib -lfabm


#
# --- generic make definitions
#
SHELL         = /bin/csh
RM            = \rm -f

#
# rules.
#

.c.o:
	$(CC) $(CPPFLAGS) $(CCFLAGS) $(EXTRAFLAGS)  -c $*.c

.f.o:
	$(FC)             $(FCFFLAGS) -c -convert big_endian $*.f

.F90.o:

	$(FC) $(CPPFLAGS) $(FCFFLAGS) $(EXTRAFLAGS) -c -convert big_endian $*.F90
.F.o:
	$(FC) $(CPPFLAGS) $(FCFFLAGS) $(EXTRAFLAGS) -c -convert big_endian $*.F
