-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmakefile
More file actions
131 lines (66 loc) · 3.14 KB
/
Copy pathmakefile
File metadata and controls
131 lines (66 loc) · 3.14 KB
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
# on scrtp desktops for ifort, run the following:
# module purge; module load intel/2017.4.196-GCC-6.4.0-2.28 impi/2017.3.196 imkl/2017.3.196
# module load netCDF-Fortran/4.4.4
# Flags requird if compiling with Intel MKL
iflags= -DMKL
# Libraries required if compiling with Intel MKL
ildflibs=-Wl,--start-group ${MKLROOT}/lib/intel64/libmkl_intel_lp64.a ${MKLROOT}/lib/intel64/libmkl_intel_thread.a ${MKLROOT}/lib/intel64/libmkl_core.a -Wl,--end-group -liomp5 -lpthread -lm -ldl
gfc := gfortran
ifc := ifort
fflags ?= -O3
ldfflags := `nf-config --fflags`
ldfflibs := `nf-config --flibs`
extra ?=
finite_diff_solver : finite_diff_solver.o nc_output.mod read_inputs.mod checkpointing.mod
$(ifc) $(fflags) $(ldfflags) $(iflags) read_inputs.o nc_output.o checkpointing.o finite_diff_solver.o $(ldfflibs) $(ildflibs) -lnetcdf -o $@ $(extra)
finite_diff_solver.o : finite_diff_solver.f90 nc_output.mod read_inputs.mod checkpointing.mod
$(ifc) $(fflags) -c finite_diff_solver.f90
nc_output.mod : nc_output.f90
$(ifc) $(ldfflags) -c nc_output.f90 -lnetcdf $(ldfflibs)
read_inputs.mod : read_inputs.f90
$(ifc) $(fflags) -c read_inputs.f90
checkpointing.mod : checkpointing.f90 nc_output.mod read_inputs.mod
$(ifc) $(ldfflags) -c checkpointing.f90 -lnetcdf $(ldfflibs)
clean :
rm *.o *.mod ./finite_diff_solver
#finite_diff_solver.out : finite_diff_solver.f90 nc_output.mod read_inputs.mod
#nc_output.mod : nc_output.f90
#read_inputs.mod : read_inputs.f90
#finite_diff_solver.f90 : nc_output.mod read_inputs.mod
#finite_diff_solver.out : finite_diff_solver.f90 nc_output.mod read_inputs.mod
# $(fc) $(fstd) $(flags) finite_diff_solver.f90 -llapack -lnetcdf nc_output.mod read_inputs.mod -o $@ $(war)
#nc_output.mod : nc_output.f90
# $(fc) $(fstd) $(ldfflags) nc_output.f90 -lnetcdf $(ldfflibs)
#read_inputs.mod : read_inputs.f90
# $(fc) $(fstd) $(flags) read_inputs.f90
#execd : fortran_solver_exe.out
# ./fortran_solver_exe.out
#fortran_solver_exe.out : fortran_solver.f90
# $(fc) $(fstd) $(fflags) fortran_solver.f90 -llapack -o $@ $(war)
#py := python3
#ifeq ($(origin COMPILER), defined)
# fc:=$(COMPILER)
#else ifeq ($(origin COMPILER), undefined)
# fc := gfortran
#endif
#else ifeq ($(COMPILER), gfortran)#if gfortran specified in terminal use default.
# fc := $(fc)
#else ifeq ($(COMPILER), ifort)#if ifort specified in terminal use ifort.
# fc := ifort
#else ifeq ($(COMPILER), pgfortran)#if pgfortran specified in terminal use pgfortran.
# fc :=pgfortran
#else
# $(error The value you specified for COMPILER was not acceptable. Please choose one of: gfortran, ifort, pgfortran.)#if unsupported compiler is set in terminal, throw an error message and stop.
#endif
#.DEFAULT_GOAL := written_file_name, Exec, plots
#written_file_name : python_write_script
# $(py) python_write_script#use python write script to write input file for solver.
#
#.PHONY : Exec
#Exec : fortran_solver_exe:
# .\fortran_solver_exe#execute executable from fortran driver.
#fortran_solver_exe.out : fortran_solver.f90
# $(fc) $(fstd) $(flags) fortran_solver.f90 -llapack -o $@
#
#plots : python_visualisation_script
# $(py) python_visualisation_script