2 #----------------------------------------------------------------------------------------------------------------------------------
9 #----------------------------------------------------------------------------------------------------------------------------------
11 #----------------------------------------------------------------------------------------------------------------------------------
23 DEFAULTRULE: $(DEXE)DCS
28 @echo -e '\033[1;31m Make options of DCS code\033[0m'
30 @echo -e '\033[1;31m Compiler choice: COMPILER=$(COMPILER)\033[0m\033[1m => default\033[0m'
31 @echo -e '\033[1;31m COMPILER=gnu \033[0m\033[1m => GNU gfortran \033[0m'
32 @echo -e '\033[1;31m COMPILER=intel\033[0m\033[1m => Intel Fortran \033[0m'
34 @echo -e '\033[1;31m Compiling options\033[0m'
35 @echo -e '\033[1;31m DEBUG=yes(no) \033[0m\033[1m => on(off) debug (default $(DEBUG))\033[0m'
36 @echo -e '\033[1;31m F03STD=yes(no) \033[0m\033[1m => on(off) check standard fortran (default $(F03STD))\033[0m'
37 @echo -e '\033[1;31m OPTIMIZE=yes(no) \033[0m\033[1m => on(off) optimization (default $(OPTIMIZE))\033[0m'
38 @echo -e '\033[1;31m OPENMP=yes(no) \033[0m\033[1m => on(off) OpenMP directives (default $(OPENMP))\033[0m'
40 @echo -e '\033[1;31m Provided Rules: default=DCS\033[0m\033[1m => compile the code\033[0m'
41 @echo -e '\033[1;31m cleanobj =>\033[0m\033[1m cleaning compiled
object\033[0m'
42 @echo -e '\033[1;31m cleanmod =>\033[0m\033[1m cleaning .mod files\033[0m'
43 @echo -e '\033[1;31m cleanmsg =>\033[0m\033[1m cleaning make-log massage files\033[0m'
44 @echo -e '\033[1;31m clean =>\033[0m\033[1m running cleanobj, cleanmod and cleanmsg\033[0m'
45 @echo -e '\033[1;31m cleanall =>\033[0m\033[1m running clean and cleanexe\033[0m'
46 @echo -e '\033[1;31m tar =>\033[0m\033[1m creating a tar archive of the project\033[0m'
47 @echo -e '\033[1;31m doc =>\033[0m\033[1m building the documentation\033[0m'
48 #----------------------------------------------------------------------------------------------------------------------------------
50 #----------------------------------------------------------------------------------------------------------------------------------
56 VPATH = $(DSRC) $(DOBJ) $(DMOD)
58 MKDIRS = $(DOBJ) $(DMOD) $(DEXE)
59 #-----------------------------------------------------------------------------------------------------------------------------------
61 #-----------------------------------------------------------------------------------------------------------------------------------
62 # compiler specific rules
64 WRN_GNU = -fmax-errors=0 -Wall -Wno-array-temporaries -Warray-bounds -Wcharacter-truncation -Wline-truncation -Wconversion-extra -Wimplicit-
interface -Wimplicit-procedure -Wunderflow -Wextra -Wuninitialized
66 DEB_GNU = -fmodule-
private -ffree-line-length-132 -fimplicit-none -ffpe-trap=invalid,overflow -fbacktrace -fdump-core -finit-real=nan #-fno-range-check ,precision,denormal,underflow
67 STD_GNU = -std=f2003 -fall-intrinsics
73 DEB_INT = -debug all -extend-source 132 -fpe-all=0 -fp-stack-check -fstack-protector-all -ftrapuv -no-ftz -traceback -gen-interfaces
75 OPT_INT = -O3 -ipo -
inline all -ipo-jobs4 -vec-report1
77 # setting rules according user options
78 ifeq
"$(COMPILER)" "gnu"
80 OPTSC = -cpp -c -J$(DMOD) -
static -fprotect-parens -fno-realloc-lhs
88 ifeq "$(COMPILER)" "intel"
90 OPTSC = -cpp -c -module $(DMOD) -static -assume protect_parens -assume norealloc_lhs -fp-model source
99 PREPROC := $(PREPROC) -DDEBUG
100 OPTSC := $(OPTSC) -O0 -C -g $(WRN) $(CHK) $(DEB)
101 OPTSL := $(OPTSL) -O0 -C -g $(WRN) $(CHK) $(DEB)
103 ifeq "$(F03STD)" "yes"
104 OPTSC := $(OPTSC) $(STD)
105 OPTSL := $(OPTSL) $(STD)
107 ifeq "$(OPTIMIZE)" "yes"
108 OPTSC := $(OPTSC) $(OPT)
109 OPTSL := $(OPTSL) $(OPT)
111 ifeq "$(OPENMP)" "yes"
112 PREPROC := $(PREPROC) -DOPENMP
113 OPTSC := $(OPTSC) $(OMP)
114 OPTSL := $(OPTSL) $(OMP)
116 OPTSC := $(OPTSC) $(PREPROC)
117 OPTSL := $(OPTSL) $(PREPROC)
119 WHICHFC = $(shell which $(FC))
121 PRINTCHK = "\\033[1;31m Compiler used \\033[0m\\033[1m $(COMPILER) => $(WHICHFC)\\033[0m \n\
122 \\033[1;31mSource dir \\033[0m\\033[1m $(DSRC)\\033[0m \n\
123 \\033[1;31m Debug \\033[0m\\033[1m $(DEBUG)\\033[0m \n\
124 \\033[1;31m F-standard \\033[0m\\033[1m $(F03STD)\\033[0m \n\
125 \\033[1;31m Optimize \\033[0m\\033[1m $(OPTIMIZE)\\033[0m"
126 #-----------------------------------------------------------------------------------------------------------------------------------
128 #-----------------------------------------------------------------------------------------------------------------------------------
131 .NOTPARALLEL : PRINTINFO
134 @echo -e $(PRINTCHK) | tee -a make.log
135 @echo | tee -a make.log
136 @echo -e
"\033[1;31m Compiling options\033[0m" | tee -a make.log
137 @echo -e
"\033[1m [$(OPTSC)]\033[0m" | tee -a make.log
138 @echo | tee -a make.log
139 @echo -e
"\033[1;31m Linking options \033[0m" | tee -a make.log
140 @echo -e
"\033[1m [$(OPTSL)]\033[0m" | tee -a make.log
141 @echo | tee -a make.log
149 @echo -e
"\033[1;31m deleting objects \033[0m" | tee make.log
154 @echo -e
"\033[1;31m deleting mods \033[0m" | tee -a make.log
159 @echo -e
"\033[1;31m deleting exes \033[0m" | tee -a make.log
160 @rm -f $(addprefix $(DEXE),DCS)
164 @rm -f diagnostic_messages
165 @rm -f error_messages
168 clean: cleanobj cleanmod cleanmsg
171 cleanall: clean cleanexe
175 @echo -e
"\033[1;31m Creating tar archive of the code \033[0m" | tee make.log
177 @mkdir -p Driven_Cavity
178 @cp -rL src makefile Driven_Cavity/
179 @tar czf Driven_Cavity.tgz Driven_Cavity
180 @rm -rf Driven_Cavity
184 @echo -e
"\033[1;31m Building documentation\033[0m" | tee make.log
185 @doxygen .doxygenconfig
186 #-----------------------------------------------------------------------------------------------------------------------------------
188 #-----------------------------------------------------------------------------------------------------------------------------------
189 # rules of linking and compiling
190 COTEXT = -e
"\033[1;31m Compiling\033[0m\033[1m $(<F)\033[0m"
191 LITEXT = -e
"\033[1;31m Assembling\033[0m\033[1m $@\033[0m"
193 $(DEXE)DCS : PRINTINFO $(MKDIRS) $(DOBJ)
dcs.o
194 @echo | tee -a make.log
195 @echo $(LITEXT) | tee -a make.log
196 @$(FC) $(OPTSL) $(DOBJ)*.o $(LIBS) -o $@ 1>> diagnostic_messages 2>> error_messages
199 @echo $(COTEXT) | tee -a make.log
200 @$(FC) $(OPTSC) $< -o $@ 1>> diagnostic_messages 2>> error_messages
204 @echo $(COTEXT) | tee -a make.log
205 @$(FC) $(OPTSC) $< -o $@ 1>> diagnostic_messages 2>> error_messages
210 @echo $(COTEXT) | tee -a make.log
211 @$(FC) $(OPTSC) $< -o $@ 1>> diagnostic_messages 2>> error_messages
217 @echo $(COTEXT) | tee -a make.log
218 @$(FC) $(OPTSC) $< -o $@ 1>> diagnostic_messages 2>> error_messages
224 @echo $(COTEXT) | tee -a make.log
225 @$(FC) $(OPTSC) $< -o $@ 1>> diagnostic_messages 2>> error_messages
232 @echo $(COTEXT) | tee -a make.log
233 @$(FC) $(OPTSC) $< -o $@ 1>> diagnostic_messages 2>> error_messages
238 @echo $(COTEXT) | tee -a make.log
239 @$(FC) $(OPTSC) $< -o $@ 1>> diagnostic_messages 2>> error_messages
243 @echo $(COTEXT) | tee -a make.log
244 @$(FC) $(OPTSC) $< -o $@ 1>> diagnostic_messages 2>> error_messages
246 $(DOBJ)
dcs.o : DCS.f90 \
251 @echo $(COTEXT) | tee -a make.log
252 @$(FC) $(OPTSC) $< -o $@ 1>> diagnostic_messages 2>> error_messages
253 #-----------------------------------------------------------------------------------------------------------------------------------
This module contains the definition of Type_Node and its procedures.
This module contains the definition of Type_Cavity and its procedures.
This module contains the definition of Type_Face and its procedures.
program dcs
DCS is an Open source program for simulating driven cavity problems.
This module contains the definition of Type_Vector and its procedures.
This module contains the definition of Type_Conservative and its procedures.
This module contains the definition of Type_Mesh and its procedures.
This module contains the definition of Type_Cell_Quad and its procedures.
Module IR_Precision makes available some portable kind-parameters and some useful procedures to deal ...