Newer
Older

WAUTELET Philippe
committed
#MNH_LIC Copyright 1994-2022 CNRS, Meteo-France and Universite Paul Sabatier
#MNH_LIC This is part of the Meso-NH software governed by the CeCILL-C licence

WAUTELET Philippe
committed
#MNH_LIC version 1. See LICENSE, CeCILL-C_V1-en.txt and CeCILL-C_V1-fr.txt
#MNH_LIC for details. version 1.
##########################################################
# #
# Compiler Options #
# #
##########################################################
#OBJDIR_PATH=/home/escj/azertyuiopqsdfghjklm/wxcvbn/azertyuiopqsdfghjklmwxcvbn
#

WAUTELET Philippe
committed
OPT_BASE = -hpic -emf
OPT_PERF0 = -O0 -g
OPT_PERF1 = -O1 -hflex_mp=intolerant -Ofp0 -hnoomp -hcpu=istanbul -hfp0 -K trap=fp

WAUTELET Philippe
committed
OPT_PERF2 = -O2 -hflex_mp=intolerant -Ofp0 -hnoomp
#
OPT_NOOPENACC = -hnoacc
OPT_OPENACC = -hacc
#
OPT_CHECK = -Rbc

WAUTELET Philippe
committed
OPT_I8 = -sinteger64
OPT_R8 = -sreal64

WAUTELET Philippe
committed
ifeq "$(VER_USER)" "ZSOLVER"
CPPFLAGS += -DCARTESIANGEOMETRY -DOVERLAPCOMMS -DPIECEWISELINEAR
PROG_LIST += MG_MAIN MG_MAIN_MNH_ALL
endif

WAUTELET Philippe
committed
# Real/integer 4/8 option
#
MNH_REAL ?=8

WAUTELET Philippe
committed
ifneq "$(MNH_REAL)" "4"
OPT_BASE += $(OPT_R8)
endif
#

WAUTELET Philippe
committed
OPT_BASE_I4 := $(OPT_BASE)

WAUTELET Philippe
committed
OPT_BASE += $(OPT_I8)
LFI_INT ?=8
else
LFI_INT ?=4
endif
#
OPT = $(OPT_BASE) $(OPT_PERF2)
OPT0 = $(OPT_BASE) $(OPT_PERF0)
OPT_NOCB = $(OPT_BASE) $(OPT_PERF2)
#
ifeq "$(OPTLEVEL)" "DEBUG"
OPT = $(OPT_BASE) $(OPT_PERF0) $(OPT_CHECK)
OPT0 = $(OPT_BASE) $(OPT_PERF0) $(OPT_CHECK)
OPT_NOCB = $(OPT_BASE) $(OPT_PERF0)
CFLAGS += -g
endif

WAUTELET Philippe
committed
#
ifeq "$(OPTLEVEL)" "OPENACC"
CPPFLAGS += -DMNH_OPENACC

WAUTELET Philippe
committed
OPT = $(OPT_BASE) $(OPT_PERF2) $(OPT_OPENACC)
OPT0 = $(OPT_BASE) $(OPT_PERF0) $(OPT_OPENACC)
OPT_NOCB = $(OPT_BASE) $(OPT_PERF2) $(OPT_OPENACC)

WAUTELET Philippe
committed
#CXXFLAGS = -acc -Kieee -Mnofma $(OPT_OPENACC)
#OBJS_REPROD= spll_mode_sum_ll.o

WAUTELET Philippe
committed
#$(OBJS_REPROD) : OPT = $(OPT_BASE) $(OPT_PERF2) $(OPT_OPENACC) -Mvect=nosimd -Minfo=all -g

WAUTELET Philippe
committed
#OBJS_O1_OPENACC= spll_ice4_tendencies.o spll_turb_ver_thermo_flux.o

WAUTELET Philippe
committed
#$(OBJS_O1_OPENACC) : OPT = $(OPT_BASE) $(OPT_PERF1) $(OPT_OPENACC)

WAUTELET Philippe
committed
#
ifeq "$(OPTLEVEL)" "OPENACCDEFONLY"
CPPFLAGS += -DMNH_OPENACC -D_FAKEOPENACC

WAUTELET Philippe
committed
OPT = $(OPT_BASE) $(OPT_PERF2) $(OPT_NOOPENACC)
OPT0 = $(OPT_BASE) $(OPT_PERF0) $(OPT_NOOPENACC)
OPT_NOCB = $(OPT_BASE) $(OPT_PERF2) $(OPT_NOOPENACC)

WAUTELET Philippe
committed
#CXXFLAGS = -Kieee -Mnofma $(OPT_NOOPENACC)
#OBJS_REPROD= spll_mode_sum_ll.o

WAUTELET Philippe
committed
#$(OBJS_REPROD) : OPT = $(OPT_BASE) $(OPT_PERF2) $(OPT_NOOPENACC) -Mvect=nosimd -Minfo=all -g

WAUTELET Philippe
committed
endif
#
ifeq "$(OPTLEVEL)" "NOOPENACC"

WAUTELET Philippe
committed
OPT = $(OPT_BASE) $(OPT_PERF2) $(OPT_NOOPENACC)
OPT0 = $(OPT_BASE) $(OPT_PERF0) $(OPT_NOOPENACC)
OPT_NOCB = $(OPT_BASE) $(OPT_PERF2) $(OPT_NOOPENACC)

WAUTELET Philippe
committed
#CXXFLAGS = -Kieee -Mnofma $(OPT_NOOPENACC)
#OBJS_REPROD= spll_mode_sum_ll.o

WAUTELET Philippe
committed
#$(OBJS_REPROD) : OPT = $(OPT_BASE) $(OPT_PERF2) $(OPT_NOOPENACC) -Mvect=nosimd -Minfo=all -g

WAUTELET Philippe
committed
endif
#
ifeq "$(OPTLEVEL)" "O2NOVEC"
OPT = $(OPT_BASE) $(OPT_PERF2) -O vector0
OPT0 = $(OPT_BASE) $(OPT_PERF0) -O vector0
OPT_NOCB = $(OPT_BASE) $(OPT_PERF2) -O vector0
endif

WAUTELET Philippe
committed
ifeq "$(OPTLEVEL)" "O2"
OPT = $(OPT_BASE) $(OPT_PERF2)
OPT0 = $(OPT_BASE) $(OPT_PERF0)
OPT_NOCB = $(OPT_BASE) $(OPT_PERF2)
endif
ifeq "$(OPTLEVEL)" "O1"
OPT = $(OPT_BASE) $(OPT_PERF1)
OPT0 = $(OPT_BASE) $(OPT_PERF0)
OPT_NOCB = $(OPT_BASE) $(OPT_PERF1)
endif
#
#
FC = ftn

WAUTELET Philippe
committed
FCFLAGS = -emf
CC=cc
export FC CC FCFLAGS
F90 = ftn
F90FLAGS = $(OPT)
F77 = $(F90)
F77FLAGS = $(OPT)
# -132
FX90 = $(F90)
FX90FLAGS = $(OPT)
# -132
#
#LDFLAGS = -Wl,-noinhibit-exec -Wl,-warn-once $(PAR)
LDFLAGS = -Wl,-warn-once $(PAR) $(OPT_BASE)
#
# preprocessing flags
#

WAUTELET Philippe
committed
#CPP = /bin/cpp -P -traditional -Wcomment
CPP = cpp -P -Wcomment

WAUTELET Philippe
committed
CPPFLAGS_C = -DLITTLE_endian
CPPFLAGS_SURFEX = -traditional

WAUTELET Philippe
committed
CPPFLAGS_SURCOUCHE = -traditional -DDEV_NULL -DUSE_MPI -DMNH_COMPILER_CCE

WAUTELET Philippe
committed
CPPFLAGS_RAD = -traditional
CPPFLAGS_NEWLFI = -traditional -DSWAPIO -DLINUX -DLFI_INT=${LFI_INT}
CPPFLAGS_MNH = -traditional -DMNH -DSFX_MNH -DMNH_NO_MPI_LOGICAL48 -DUSE_MPI -DMNH_COMPILER_CCE
ifdef VER_GA
CPPFLAGS_SURCOUCHE += -DMNH_GA
INC += -I${GA_ROOT}/include
LIBS += -L${GA_ROOT}/lib -larmci -lga -lgfortran
endif

WAUTELET Philippe
committed
#
# BITREP flags
#
#if MNH_BITREP exists => compile with the BITREP library

WAUTELET Philippe
committed
MNH_BITREP = NO
ifeq "$(MNH_BITREP)" "YES"
CPPFLAGS_MNH += -DMNH_BITREP
endif
#

WAUTELET Philippe
committed
# LIBTOOLS flags
#
#if MNH_TOOLS exists => compile the tools
MNH_TOOLS = yes
#

WAUTELET Philippe
committed
## IOLFI flag
#
#if MNH_IOLFI exists => compile the NEWLFI library (for LFI files)
MNH_IOLFI=yes
#
## COMPRESS flag
#
#if MNH_COMPRESS exists => compile the COMPRESS library (for LFI files)
MNH_COMPRESS=yes
#

WAUTELET Philippe
committed
## S4PY flag
#
#if MNH_S4PY exists => compile the libs4py library (for epygram)
#MNH_S4PY=no

WAUTELET Philippe
committed
#

WAUTELET Philippe
committed
## ecCodes or grib_api selection
#MNH_GRIBAPI: if set to no: use ecCodes
# if set to yes: use grib_api (deprecated library)
#
MNH_GRIBAPI=no
#

WAUTELET Philippe
committed
NETCDF_SUPPFLAGS='-emf'
ECCODES_FFLAGS='-emf'
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
##########################################################
# #
# Source of MESONH PACKAGE Distribution #
# #
##########################################################
#DIR_SURCOUCHE += ARCH_SRC/bug_surcouche
#DIR_MNH += ARCH_SRC/bug_mnh
#DIR_RAD += ARCH_SRC/bug_rad
#DIR_SURFEX += ARCH_SRC/surfex
#
include Makefile.MESONH.mk
#
##########################################################
# #
# extra VPATH, Compilation flag modification #
# systeme module , etc ... #
# external precompiled module librairie #
# etc ... #
# #
##########################################################
# Juan & Maud 20/03/2008 --> Ifort 10.1.008 Bug O2 optimization
#OPT_PERF1 = -O1
OBJS_O1= spll_schu.o spll_ps2str.o spll_p_abs.o spll_ini_one_way_n.o spll_urban_solar_abs.o
$(OBJS_O1) : OPT = $(OPT_BASE) $(OPT_PERF1)
OBJS_O0= spll_mode_gridproj.o spll_ini_dynamics.o spll_sunpos_n.o spll_ground_param_n.o
$(OBJS_O0) : OPT = $(OPT_BASE) $(OPT_PERF0)
ifneq "$(findstring 8,$(LFI_INT))" ""
OBJS_I8=spll_NEWLFI_ALL.o
$(OBJS_I8) : OPT = $(OPT_BASE) $(OPT_PERF2) $(OPT_I8)
endif

WAUTELET Philippe
committed
ifeq "$(MNH_INT)" "8"
OBJS_I4=spll_modd_netcdf.o
$(OBJS_I4) : OPT = $(OPT_BASE_I4)
endif