-
Notifications
You must be signed in to change notification settings - Fork 6
/
Mkinclude
133 lines (107 loc) · 3.22 KB
/
Mkinclude
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
.DEFAULT_GOAL := all
# Backward compatibility of SCALE environments for ver < 5.1
include $(TOPDIR)/utils/make/Make_compatibility
INST_DIR = $(TOPDIR)
DCUTILSDIR = $(TOPDIR)/dc_utils
SCALELIBDIR = $(TOPDIR)/scalelib
SCALERMDIR = $(TOPDIR)/scale-rm
SCALEGMDIR = $(TOPDIR)/scale-gm
CONTRIBDIR = $(TOPDIR)/contrib
ifeq ($(SCALE_DEBUG),T)
FFLAGS = $(FFLAGS_DEBUG) $(FFLAGS_SYSDEPEND) -DDEBUG -DQUICKDEBUG
CFLAGS = $(CFLAGS_DEBUG) $(CFLAGS_SYSDEPEND)
POSTFIX = _debug
else
FFLAGS = $(FFLAGS_FAST) $(FFLAGS_SYSDEPEND)
CFLAGS = $(CFLAGS_FAST) $(CFLAGS_SYSDEPEND)
ifeq ($(SCALE_USE_AGGRESSIVEOPT),T)
FFLAGS += $(FFLAGS_AGGRESSIVE)
CFLAGS += $(CFLAGS_AGGRESSIVE)
endif
ifeq ($(SCALE_QUICKDEBUG),T)
FFLAGS += $(FFLAGS_QUICKDEBUG) -DQUICKDEBUG
POSTFIX = _quickdebug
else
POSTFIX =
endif
endif
ifeq ($(findstring undefined, $(origin BUILD_DIR) $(BUILD_DIR)), undefined)
BUILD_DIR = $(abspath ./.libs$(POSTFIX))
endif
ifeq ($(SCALE_USE_SINGLEFP),T)
FFLAGS += -DSINGLE
POSTFIX := $(POSTFIX)_single
endif
ifeq ($(SCALE_ENABLE_OPENMP),T)
FFLAGS += $(FFLAGS_OPENMP)
endif
ifeq ($(SCALE_ENABLE_OPENACC),T)
FFLAGS += $(FFLAGS_OPENACC)
endif
ifeq ($(SCALE_ENABLE_OPENACC),T)
FFLAGS += -DLSIZE=1
else
ifneq ($(origin LSIZE),undefined)
FFLAGS += -DLSIZE=$(LSIZE)
endif
endif
ifeq ($(origin BINDIR),undefined)
BINDIR = $(INST_DIR)/bin
endif
ifeq ($(origin LIBDIR),undefined)
LIBDIR = $(INST_DIR)/lib
endif
ifeq ($(origin MODDIR),undefined)
MODDIR = $(INST_DIR)/include$(POSTFIX)
endif
# NetCDF library setting
# library location are inquired in order of: environment variable->Makedef.XXX->here
include $(TOPDIR)/utils/make/Make_checknetcdf
ifeq ($(SCALE_ENABLE_PNETCDF),T)
SCALE_NETCDF_INCLUDE += -DPNETCDF
ifeq ($(shell pnetcdf-config --help > /dev/null 2>&1 && echo yes),yes)
SCALE_NETCDF_INCLUDE += -I$(shell pnetcdf-config --includedir)
SCALE_NETCDF_LIBS := -L$(shell pnetcdf-config --libdir) -lpnetcdf $(SCALE_NETCDF_LIBS)
endif
endif
ifeq ($(SCALE_COMPAT_NETCDF3),T)
CFLAGS += -DNETCDF3
endif
ifeq ($(SCALE_COMPAT_MPI),T)
FFLAGS += -DNO_MPI08
endif
# Math library setting
# library location are inquired in order of: environment variable->Makedef.XXX
ifeq ($(SCALE_ENABLE_MATHLIB),T)
FFLAGS += -DMATHLIB
endif
# PAPI library setting
# library location are inquired in order of: environment variable->Makedef.XXX
ifeq ($(SCALE_ENABLE_PAPI),T)
FFLAGS += -DPAPI
endif
CONTRIB_LIBS =
CONTRIB_INCLUDE =
# Super Droplet Method (SDM)
ifeq ($(SCALE_ENABLE_SDM),T)
FFLAGS += -DSDM $(ADDITIONAL_FFLAGS_SDM)
GAGETRYDIR = $(TOPDIR)/contrib/Gadgetry
MTDIR = $(TOPDIR)/contrib/mt
SDMDIR = $(TOPDIR)/contrib/SDM
CONTRIB_LIBS += $(LIBDIR)/libgagetry.a $(LIBDIR)/libmt.a $(LIBDIR)/libsdm.a
CONTRIB_INCLUDE += -I$(GAGETRYDIR) -I$(MTDIR) -I$(SDMDIR)
else
GAGETRYDIR =
MTDIR =
SDMDIR =
endif
# Data Assimilation
ifeq ($(SCALE_ENABLE_DA),T)
FFLAGS += -DDA
endif
# JMA Physic Process Library
ifeq ($(SCALE_ENABLE_JMAPPLIB),T)
JMAPPLIB_DIR = $(CONTRIBDIR)/JMA/physlib/pp/src
FFLAGS += -DJMAPPLIB -I$(JMAPPLIB_DIR)
CONTRIB_LIBS += -L$(JMAPPLIB_DIR) -lpp
endif