1 | # L. Fita, LMD. February 2018 |
---|
2 | # Compilation of all required Fortran modules in `trueno' (debian 9) with gcc compilers |
---|
3 | # A following python 'library' creation is required |
---|
4 | ## Compilation |
---|
5 | # Prior to compilation, a copy of the file __test_Fmods.f90__ has to be done |
---|
6 | # $ cp __test_Fmods.f90__ test_Fmods.f90 |
---|
7 | # make >& run_make.log |
---|
8 | # NOTE: One will not be able to compile all the set of programs within an anaconda environment |
---|
9 | # due to problems with anaconda. Installation of netcdf4 colides with installed libnetcdff |
---|
10 | # - netcdf4 |
---|
11 | # The following packages will be downloaded: |
---|
12 | # |
---|
13 | # package | build |
---|
14 | # ---------------------------|----------------- |
---|
15 | # libnetcdf-4.6.1 | h10edf3e_2 1.3 MB |
---|
16 | # |
---|
17 | # The following NEW packages will be INSTALLED: |
---|
18 | # |
---|
19 | # netcdf4: 1.4.2-py27h4b4f87f_0 |
---|
20 | # |
---|
21 | # The following packages will be REMOVED: |
---|
22 | # |
---|
23 | # libnetcdff: 4.4.4-0 matthewharrison |
---|
24 | # |
---|
25 | # The following packages will be UPDATED: |
---|
26 | # |
---|
27 | # libnetcdf: 4.4.0-hf6ef953_0 matthewharrison --> 4.6.1-h10edf3e_2 |
---|
28 | ##### |
---|
29 | # Because of that, Makefile is splitted in two compilation sub-sets |
---|
30 | ## |
---|
31 | # $ make pymods: compilation of Fortran modules used in the python scripts |
---|
32 | # $ make NCfortran: compiation of Fortran modules and main programs which require |
---|
33 | # netCDF-fortran interface: (for: DistriCorrection and trajectories_overlap) |
---|
34 | # $ make: compiles all components |
---|
35 | ## |
---|
36 | |
---|
37 | FC = gfortran |
---|
38 | FCF = -c |
---|
39 | LIB_INC = |
---|
40 | RM = rm -f |
---|
41 | F2PY = /usr/bin/f2py |
---|
42 | F2PYF = |
---|
43 | DBGFLAGS = -g -Wall -Wextra -Warray-temporaries -Wconversion -fimplicit-none -fbacktrace -ffree-line-length-0 -fcheck=all -ffpe-trap=zero,overflow,underflow -finit-real=nan |
---|
44 | NCLIBFOLD = /usr/lib/x86_64-linux-gnu |
---|
45 | NCINCFOLD = /usr/include |
---|
46 | NCLIBFFOLD = /usr/lib/x86_64-linux-gnu |
---|
47 | NCINCFFOLD = /usr/include |
---|
48 | LIB_NETCDF = -L$(NCLIBFOLD) -L$(NCLIBFFOLD) -lnetcdff -lnetcdf -I$(NCINCFOLD) -I$(NCINCFFOLD) |
---|
49 | |
---|
50 | FCFLAGS = $(FCF) $(DBGFLAGS) |
---|
51 | |
---|
52 | # Sources for f2py |
---|
53 | srcs = module_definitions.f90 module_basic.f90 module_generic.f90 module_scientific.f90 |
---|
54 | distrisrcs = $(srcs) module_DistriCorrection.f90 |
---|
55 | diagsrcs = $(srcs) module_ForDiagnosticsVars.f90 module_ForDiagnostics.f90 |
---|
56 | intsrcs = $(srcs) module_ForInterpolate.f90 |
---|
57 | scisrcs = $(srcs) |
---|
58 | gensrcs = module_definitions.f90 module_basic.f90 module_generic.f90 |
---|
59 | defsrcs = module_definitions.f90 |
---|
60 | |
---|
61 | ####### ###### ##### #### ### ## # |
---|
62 | |
---|
63 | MODULES = \ |
---|
64 | module_definitions.o \ |
---|
65 | module_basic.o \ |
---|
66 | module_generic.o \ |
---|
67 | module_NCgeneric.o \ |
---|
68 | module_scientific.o \ |
---|
69 | module_ForInterpolate.o \ |
---|
70 | module_ForDiagnosticsVars.o \ |
---|
71 | module_ForDiagnostics.o |
---|
72 | |
---|
73 | FINTMODULES = \ |
---|
74 | module_definitions.o \ |
---|
75 | module_basic.o \ |
---|
76 | module_generic.o \ |
---|
77 | module_scientific.o \ |
---|
78 | module_ForInterpolate.o |
---|
79 | |
---|
80 | FEXECMODULES = \ |
---|
81 | module_definitions.o \ |
---|
82 | module_basic.o \ |
---|
83 | module_generic.o \ |
---|
84 | module_scientific.o \ |
---|
85 | module_NCgeneric.o \ |
---|
86 | module_ForInterpolate.o \ |
---|
87 | module_DistriCorrection.o |
---|
88 | |
---|
89 | FTESTMODULES = \ |
---|
90 | module_definitions.o \ |
---|
91 | module_basic.o \ |
---|
92 | module_generic.o \ |
---|
93 | module_NCgeneric.o \ |
---|
94 | module_scientific.o \ |
---|
95 | module_ForDiagnosticsVars.o \ |
---|
96 | module_ForDiagnostics.o |
---|
97 | |
---|
98 | all : \ |
---|
99 | module_ForDiagnostics.o \ |
---|
100 | interpolate.o \ |
---|
101 | DistriCorrection.o \ |
---|
102 | pydistrimods.o \ |
---|
103 | pydiagmods.o \ |
---|
104 | pyintmods.o \ |
---|
105 | pyscimods.o \ |
---|
106 | pygenmods.o \ |
---|
107 | pydefmods.o \ |
---|
108 | trajectories_overlap.o \ |
---|
109 | test_Fmods.o |
---|
110 | |
---|
111 | pymods : \ |
---|
112 | module_ForDiagnostics.o \ |
---|
113 | pydistrimods.o \ |
---|
114 | pydiagmods.o \ |
---|
115 | pyintmods.o \ |
---|
116 | pyscimods.o \ |
---|
117 | pygenmods.o \ |
---|
118 | pydefmods.o |
---|
119 | |
---|
120 | NCfortran : \ |
---|
121 | module_definitions.o \ |
---|
122 | module_basic.o \ |
---|
123 | module_generic.o \ |
---|
124 | module_NCgeneric.o \ |
---|
125 | module_ForInterpolate.o \ |
---|
126 | DistriCorrection.o \ |
---|
127 | trajectories_overlap.o |
---|
128 | |
---|
129 | diags : \ |
---|
130 | module_ForDiagnostics.o |
---|
131 | |
---|
132 | clean : |
---|
133 | $(RM) *.mod *.o interpolate test_Fmods module_ForDiag.so module_ForInt.so module_ForDistriCorrect.so module_ForSci.so module_ForGen.so module_ForDef.so |
---|
134 | |
---|
135 | ######## ####### |
---|
136 | ## |
---|
137 | ######## |
---|
138 | |
---|
139 | module_definitions.o: |
---|
140 | $(FC) $(FCFLAGS) module_definitions.f90 |
---|
141 | |
---|
142 | module_basic.o: module_definitions.o |
---|
143 | $(FC) $(FCFLAGS) module_basic.f90 |
---|
144 | |
---|
145 | module_generic.o: module_definitions.o module_basic.o |
---|
146 | $(FC) $(FCFLAGS) $(LIB_INC) module_generic.f90 |
---|
147 | |
---|
148 | module_NCgeneric.o: module_definitions.o module_basic.o module_generic.o |
---|
149 | $(FC) $(FCFLAGS) $(LIB_NETCDF) $(LIB_INC) module_NCgeneric.f90 |
---|
150 | |
---|
151 | module_scientific.o: module_definitions.o module_basic.o module_generic.o |
---|
152 | $(FC) $(FCFLAGS) module_scientific.f90 |
---|
153 | |
---|
154 | module_ForInterpolate.o: module_definitions.o module_generic.o |
---|
155 | $(FC) $(FCFLAGS) $(LIB_INC) module_ForInterpolate.f90 |
---|
156 | |
---|
157 | module_ForDiagnosticsVars.o: module_definitions.o module_basic.o module_generic.o module_scientific.o |
---|
158 | $(FC) $(FCFLAGS) $(LIB_INC) module_ForDiagnosticsVars.f90 |
---|
159 | |
---|
160 | module_ForDiagnostics.o: module_definitions.o module_basic.o module_generic.o module_ForDiagnosticsVars.o |
---|
161 | $(FC) $(FCFLAGS) $(LIB_INC) module_ForDiagnostics.f90 |
---|
162 | |
---|
163 | module_DistriCorrection.o: module_definitions.o module_basic.o module_generic.o module_scientific.o |
---|
164 | $(FC) $(FCFLAGS) module_DistriCorrection.f90 |
---|
165 | |
---|
166 | FCEXEFINTCFLAGS = $(FINTMODULES) $(LIB_NETCDF) $(LIB_INC) |
---|
167 | FCEXECFLAGS = $(FEXECMODULES) $(LIB_NETCDF) $(LIB_INC) |
---|
168 | FCEXECTESTFLAGS = $(FTESTMODULES) $(LIB_NETCDF) $(LIB_INC) |
---|
169 | |
---|
170 | interpolate.o: module_definitions.o module_basic.o module_generic.o module_scientific.o module_ForInterpolate.o |
---|
171 | $(FC) $(FCEXEFINTCFLAGS) interpolate.f90 -o interpolate |
---|
172 | |
---|
173 | DistriCorrection.o: module_definitions.o module_basic.o module_generic.o module_NCgeneric.o module_scientific.o module_DistriCorrection.o |
---|
174 | $(FC) $(FCEXECFLAGS) DistriCorrection.f90 -o DistriCorrection |
---|
175 | |
---|
176 | test_Fmods.o: module_definitions.o module_basic.o module_generic.o module_scientific.o module_ForDiagnostics.o module_ForDiagnosticsVars.o |
---|
177 | $(FC) $(FCEXECTESTFLAGS) test_Fmods.f90 -o test_Fmods |
---|
178 | |
---|
179 | pydistrimods.o: |
---|
180 | $(F2PY) -c $(F2PYF) -I$(NCINCFOLD) -m module_ForDistriCorrect $(distrisrcs) -L$(NCLIBFOLD) |
---|
181 | |
---|
182 | pydiagmods.o: |
---|
183 | $(F2PY) -c $(F2PYF) -I$(NCINCFOLD) -m module_ForDiag $(diagsrcs) -L$(NCLIBFOLD) |
---|
184 | |
---|
185 | pyintmods.o: |
---|
186 | $(F2PY) -c $(F2PYF) -I$(NCINCFOLD) -m module_ForInt $(intsrcs) -L$(NCLIBFOLD) |
---|
187 | |
---|
188 | pyscimods.o: |
---|
189 | $(F2PY) -c $(F2PYF) -I$(NCINCFOLD) -m module_ForSci $(scisrcs) -L$(NCLIBFOLD) |
---|
190 | |
---|
191 | pygenmods.o: |
---|
192 | $(F2PY) -c $(F2PYF) -I$(NCINCFOLD) -m module_ForGen $(gensrcs) -L$(NCLIBFOLD) |
---|
193 | |
---|
194 | pydefmods.o: |
---|
195 | $(F2PY) -c $(F2PYF) -I$(NCINCFOLD) -m module_ForDef $(defsrcs) -L$(NCLIBFOLD) |
---|
196 | |
---|
197 | trajectories_overlap.o: module_definitions.o module_basic.o module_generic.o module_NCgeneric.o module_scientific.o |
---|
198 | $(FC) $(FCEXECFLAGS) trajectories_overlap.f90 -o trajectories_overlap |
---|
199 | |
---|