#
# Include file for OASIS3 Makefile for a Linux system using 
# Portland Group Fortran Compiler and MPICH
#
###############################################################################
#
# CHAN	: communication technique used in OASIS3 (MPI1/MPI2)
CHAN            = MPI1
#
# Paths for libraries, object files and binaries
#
# COUPLE	: path for oasis3-mct main directory
COUPLE          = $(HOME)/oasis3-mct
#
# ARCHDIR       : directory created when compiling
ARCHDIR         = $(COUPLE)/compile_oa3-mct
#
# MPI library
MPIDIR      = /opt/software/SGI/SGI/MPT/2.02
MPIBIN      = $(MPIDIR)/bin
MPI_INCLUDE = $(MPIDIR)/include
#MPILIB      = -L$(MPIDIR)/lib
MPILIB      = -lmpi 
#
# NETCDF library
NETCDF_INCLUDE  = /opt/software/SGI/netcdf/4.0/include
NETCDF_LIBRARY  = -L /opt/software/SGI/netcdf/4.0/lib -lnetcdff -lnetcdf 
#
# Compiling and other commands
MAKE        = gmake
#F90         = mpif90
F90         = ifort
F           = $(F90)
f90         = $(F90)
f           = $(F90)
CC          = icc
LD          = ifort
AR          = ar
ARFLAGS     = -ruv
#
# CPP keys and compiler options
# 
CPPDEF    = -Duse_comm_$(CHAN) -D__VERBOSE -DTREAT_OVERLAY
#
# 
F90FLAGS_1  = -O2 -I. -assume byterecl
#F90FLAGS_1  =  -g -check all -CB -assume byterecl  -I. 
f90FLAGS_1  = $(F90FLAGS_1)
FFLAGS_1    = $(F90FLAGS_1)
fFLAGS_1    = $(F90FLAGS_1)
CCFLAGS   = $(F90FLAGS_1) 
LDFLAGS     = 
#
###################
#
# Additional definitions that should not be changed
#
#FLIBS		= $(NETCDF_LIBRARY)
FLIBS		= $(NETCDF_LIBRARY) $(LCPP) $(LIBXML)
# BINDIR        : directory for executables
BINDIR          = $(ARCHDIR)/bin
# LIBBUILD      : contains a directory for each library
LIBBUILD        = $(ARCHDIR)/build/lib
# INCPSMILE     : includes all *o and *mod for each library
INCPSMILE       = -I$(LIBBUILD)/psmile.$(CHAN) -I$(LIBBUILD)/mct -I$(LIBBUILD)/scrip

F90FLAGS  = $(F90FLAGS_1) $(INCPSMILE) $(CPPDEF) -I$(NETCDF_INCLUDE)
f90FLAGS  = $(f90FLAGS_1) $(INCPSMILE) $(CPPDEF) -I$(NETCDF_INCLUDE)
FFLAGS    = $(FFLAGS_1) $(INCPSMILE) $(CPPDEF) -I$(NETCDF_INCLUDE)
fFLAGS    = $(fFLAGS_1) $(INCPSMILE) $(CPPDEF) -I$(NETCDF_INCLUDE)
CCFLAGS   = $(CCFLAGS_1) $(INCPSMILE) $(CPPDEF) -I$(NETCDF_INCLUDE)
#
#############################################################################
