
$(info --> Reading configuration from $(lastword $(MAKEFILE_LIST)))

# ============================================================================
# *** Configuration for gimle-intel-scampi
# ============================================================================

COUPLE := ${HOME}/models/ecearth_3.3.3.2/sources/oasis3-mct

# CHAN : MPI1/MPI2
CHAN   := MPI1

# MPI library
MPIDIR      := 
ifneq ($(strip $(MPIDIR)),)
MPIBIN      := $(MPIDIR)/bin
MPI_INCLUDE := $(MPIDIR)$(addprefix /,)
MPILIB      := -L$(MPIDIR)$(addprefix /,)
endif
MPILIB      += $(addprefix -l,)

# NETCDF library
NETCDF_DIR      := /
NETCDF_INCLUDE  := $(addprefix $(addsuffix /,$(NETCDF_DIR)),$(EBROOTNETCDF)/include $(EBROOTNETCDFMINFORTRAN)/include)
NETCDF_LIBRARY  := $(addprefix -L,$(addprefix $(addsuffix /,$(NETCDF_DIR)),$(EBROOTNETCDF)/lib64 $(EBROOTNETCDFMINFORTRAN)/lib))
NETCDF_LIBRARY  += $(addprefix -l,netcdff netcdf)

# Compiling and other commands
MAKE    := make
F90     := mpif90 -march=core-avx2 
F       := $(F90)
f90     := $(F90)
f       := $(F)
CC      := mpicc
LD      := mpif90
AR      := ar
ARFLAGS := curv

# CPP/FPP macros
MACROS   := use_libMPI use_comm_$(CHAN) use_netCDF TREAT_OVERLAY
MACROS   += 

# Compiler options
F90FLAGS := -r8 -O3 -ip -fp-model precise -extend-source 132 
F90FLAGS += 
F90FLAGS += $(addprefix -D,$(MACROS))
F90FLAGS += $(addprefix -I,$(MPI_INCLUDE))
F90FLAGS += $(addprefix -I,$(NETCDF_INCLUDE))

f90FLAGS := $(F90FLAGS)
FFLAGS   := $(F90FLAGS)
fFLAGS   := $(F90FLAGS)

CCFLAGS  := -O2 -fp-model precise -march=core-avx2 
CCFLAGS  += $(addprefix -D,$(MACROS))
CCFLAGS  := $(addprefix -I,$(MPI_INCLUDE))
CCFLAGS  += $(addprefix -I,$(NETCDF_INCLUDE))

LDFLAGS  := 
LDFLAGS  += 

# MPP_IOOPT needed for compiling mpp_io
MPP_IOOPT :=
