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