FC       = gfortran
FCFLAGS  = -std=f2018 -O3
FCFLAGS += -Wall -Wno-unused-dummy-argument -Wno-unused-variable

# MARCH=neoverse-v1,neoverse-n1,icelake-server,znver3,cortex-a78ae
ARCH=$(shell uname -m)
ifeq ($(ARCH),aarch64)
     ifdef MCPU
         FCFLAGS += -mcpu=$(MCPU)
     else
         FCFLAGS += -mcpu=native
     endif
else
     ifdef MARCH
         FCFLAGS += -march=$(MARCH)
     else
         FCFLAGS += -march=native
     endif
endif

DOCONCURRENT_FLAG   = -ftree-parallelize-loops=4
ARRAY_FLAG          =
OPENMP_FLAG         = -fopenmp
OPENACC_FLAG        = -fopenacc
CUDA_FLAG           =
SEQUENTIAL_FLAG     =

ifeq ($(IMPLEMENTATION),CUDA)
    $(error IMPLEMENTATION=$(IMPLEMENTATION) is not supported by this compiler.)
endif
ifeq ($(IMPLEMENTATION),CUDAKernels)
    $(error IMPLEMENTATION=$(IMPLEMENTATION) is not supported by this compiler.)
endif
