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