forked from ImperialCollegeLondon/WInc3D
-
Notifications
You must be signed in to change notification settings - Fork 4
/
Makefile.cx1
84 lines (66 loc) · 1.89 KB
/
Makefile.cx1
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
#=======================================================================
# Makefile for Incompact3D
#=======================================================================
#SET COMPILER AND VERSION BASED ON WHETHER a HPC or local PC is used
HOST=$(shell domainname | sed 's/\.//g')
HOSTCX1=cx1hpcicacuk
HOSTCX2=cx2hpcicacuk
OPTIONS = -DDOUBLE_PREC
HOST=cx1hpcicacuk
FFT = fftw3
FFTW3_INCLUDE =
FFTW3_LIB = -lfftw3 -lfftw3f
FC = mpif90
OPTFC = -O3 -xAVX -cpp
CC=cc
CFLAGS= -O3 -xAVX
#include PATH
ifeq ($(FFT),generic)
INC=
else ifeq ($(FFT),fftw3)
INC=$(FFTW3_INCLUDE)
else ifeq ($(FFT),essl)
INC=$(ESSL_INCLUDE)
endif
# library path
ifeq ($(FFT),generic)
LIBFFT=
else ifeq ($(FFT),fftw3)
LIBFFT=$(FFTW3_LIB)
else ifeq ($(FFT),essl)
LIBFFT=$(ESSL_LIB)
endif
SRC = decomp_2d.f90 glassman.f90 fft_$(FFT).f90 module_param.f90 io.f90 variables.f90 poisson.f90 les_models.f90 schemes.f90 convdiff.f90 acl_utils.f90 airfoils.f90 dynstall.f90 acl_elem.f90 acl_turb.f90 acl_controller.f90 acl_out.f90 acl_model.f90 acl_source.f90 incompact3d.f90 navier.f90 filter.f90 derive.f90 parameters.f90 tools.f90 visu.f90 probe.f90 cfl.f90 ABL.f90
ifneq (,$(findstring DSHM,$(OPTIONS)))
SRC := FreeIPC.f90 $(SRC)
OBJ = $(SRC:.f90=.o) alloc_shm.o FreeIPC_c.o
else
OBJ = $(SRC:.f90=.o)
endif
OPTION=$(OPTIONS)
from:=-D
to:=-WF,-D
TMP=$(subst $(from),$(to),$(OPTIONS))
ifeq ($(PLATFORM),bgp_xlf)
OPTION=$(TMP)
endif
ifeq ($(PLATFORM),bgq_xlf)
OPTION=$(TMP)
endif
all: incompact3d visualize
alloc_shm.o: alloc_shm.c
$(CC) $(CFLAGS) -c $<
FreeIPC_c.o: FreeIPC_c.c
$(CC) $(CFLAGS) -c $<
incompact3d : $(OBJ)
$(FC) -O3 -o $@ $(OBJ) $(LIBFFT) $(LIBS) $(DEBUG)
%.o : %.f90
$(FC) $(OPTFC) $(OPTIONS) $(INC) $(DEBUG) -c $<
visualize :
gfortran paraview_incompact3d.f90 -o visualize
.PHONY: clean
clean:
rm -f *.o *.mod incompact3d visualize
.PHONY: realclean
realclean: clean
rm -f *~ \#*\#