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.12 |
---|
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 | |
---|
12 | FC = /ccc/products/ifort-17.0.4.196/system/default/17.0.4.196/bin/intel64/ifort |
---|
13 | FCF = -c -fPIC |
---|
14 | LIB_INC = |
---|
15 | RM = rm -f |
---|
16 | F2PY = ./f2py |
---|
17 | F2PYF = --fcompiler=intelem |
---|
18 | DBGFLAGS = -g -check all -fpe0 -warn -traceback -debug extended |
---|
19 | NCLIBFOLD = /ccc/products/netcdf-c-4.6.0/intel--17.0.4.196/hdf5__serial/lib |
---|
20 | NCINCFOLD = /ccc/products/netcdf-c-4.6.0/intel--17.0.4.196/hdf5__serial/include |
---|
21 | NCLIBFFOLD = /ccc/products/ccc_users_env/compil/Atos_7__x86_64/netcdf-fortran-4.4.4/intel--17.0.4.196/hdf5__serial/lib |
---|
22 | NCINCFFOLD = /ccc/products/ccc_users_env/compil/Atos_7__x86_64/netcdf-fortran-4.4.4/intel--17.0.4.196/hdf5__serial/include |
---|
23 | LIB_NETCDF = -L$(NCLIBFOLD) -L$(NCLIBFFOLD) -lnetcdff -lnetcdf -I$(NCINCFOLD) -I$(NCINCFFOLD) |
---|
24 | |
---|
25 | FCFLAGS = $(FCF) $(DBGFLAGS) |
---|
26 | |
---|
27 | # Sources for f2py |
---|
28 | srcs = module_definitions.f90 module_basic.f90 module_generic.f90 module_scientific.f90 |
---|
29 | distrisrcs = $(srcs) module_DistriCorrection.f90 |
---|
30 | diagsrcs = $(srcs) module_ForDiagnosticsVars.f90 module_ForDiagnostics.f90 |
---|
31 | intsrcs = $(srcs) module_ForInterpolate.f90 |
---|
32 | scisrcs = $(srcs) |
---|
33 | defsrcs = module_definitions.f90 |
---|
34 | |
---|
35 | ####### ###### ##### #### ### ## # |
---|
36 | |
---|
37 | MODULES = \ |
---|
38 | module_definitions.o \ |
---|
39 | module_basic.o \ |
---|
40 | module_generic.o \ |
---|
41 | module_NCgeneric.o \ |
---|
42 | module_scientific.o \ |
---|
43 | module_ForInterpolate.o \ |
---|
44 | module_ForDiagnosticsVars.o \ |
---|
45 | module_ForDiagnostics.o \ |
---|
46 | module_DistriCorrection.o |
---|
47 | |
---|
48 | FINTMODULES = \ |
---|
49 | module_definitions.o \ |
---|
50 | module_basic.o \ |
---|
51 | module_generic.o \ |
---|
52 | module_scientific.o \ |
---|
53 | module_ForInterpolate.o |
---|
54 | |
---|
55 | all : \ |
---|
56 | module_ForDiagnostics.o \ |
---|
57 | interpolate.o \ |
---|
58 | DistriCorrection.o \ |
---|
59 | pydistrimods.o \ |
---|
60 | pydiagmods.o \ |
---|
61 | pyintmods.o \ |
---|
62 | pyscimods.o \ |
---|
63 | pydefmods.o \ |
---|
64 | trajectories_overlap.o |
---|
65 | |
---|
66 | diags : \ |
---|
67 | module_ForDiagnostics.o |
---|
68 | |
---|
69 | clean : |
---|
70 | $(RM) *.mod *.o interpolate module_ForDiag.so module_ForInt.so module_ForDistriCorrect.so module_ForSci.so module_ForDef.so |
---|
71 | |
---|
72 | ######## ####### |
---|
73 | ## |
---|
74 | ######## |
---|
75 | |
---|
76 | module_definitions.o: |
---|
77 | $(FC) $(FCFLAGS) module_definitions.f90 |
---|
78 | |
---|
79 | module_basic.o: module_definitions.o |
---|
80 | $(FC) $(FCFLAGS) module_basic.f90 |
---|
81 | |
---|
82 | module_generic.o: module_definitions.o module_basic.o |
---|
83 | $(FC) $(FCFLAGS) $(LIB_INC) module_generic.f90 |
---|
84 | |
---|
85 | module_NCgeneric.o: module_definitions.o module_basic.o module_generic.o |
---|
86 | $(FC) $(FCFLAGS) $(LIB_NETCDF) $(LIB_INC) module_NCgeneric.f90 |
---|
87 | |
---|
88 | module_scientific.o: module_definitions.o module_basic.o module_generic.o |
---|
89 | $(FC) $(FCFLAGS) module_scientific.f90 |
---|
90 | |
---|
91 | module_ForInterpolate.o: module_definitions.o module_generic.o |
---|
92 | $(FC) $(FCFLAGS) $(LIB_INC) module_ForInterpolate.f90 |
---|
93 | |
---|
94 | module_ForDiagnosticsVars.o: module_definitions.o module_basic.o module_generic.o module_scientific.o |
---|
95 | $(FC) $(FCFLAGS) $(LIB_INC) module_ForDiagnosticsVars.f90 |
---|
96 | |
---|
97 | module_ForDiagnostics.o: module_definitions.o module_basic.o module_generic.o module_ForDiagnosticsVars.o |
---|
98 | $(FC) $(FCFLAGS) $(LIB_INC) module_ForDiagnostics.f90 |
---|
99 | |
---|
100 | module_DistriCorrection.o: module_definitions.o module_basic.o module_generic.o module_scientific.o |
---|
101 | $(FC) $(FCFLAGS) module_DistriCorrection.f90 |
---|
102 | |
---|
103 | FCEXEFINTCFLAGS = $(FINTMODULES) $(LIB_NETCDF) $(LIB_INC) |
---|
104 | FCEXECFLAGS = $(MODULES) $(LIB_NETCDF) $(LIB_INC) |
---|
105 | |
---|
106 | interpolate.o: module_definitions.o module_basic.o module_generic.o module_scientific.o module_ForInterpolate.o |
---|
107 | $(FC) $(FCEXEFINTCFLAGS) interpolate.f90 -o interpolate |
---|
108 | |
---|
109 | DistriCorrection.o: module_definitions.o module_basic.o module_generic.o module_NCgeneric.o module_scientific.o module_DistriCorrection.o |
---|
110 | $(FC) $(FCEXECFLAGS) DistriCorrection.f90 -o DistriCorrection |
---|
111 | |
---|
112 | pydistrimods.o: |
---|
113 | $(F2PY) -c $(F2PYF) -I$(NCINCFOLD) -m module_ForDistriCorrect $(distrisrcs) -L$(NCLIBFOLD) |
---|
114 | |
---|
115 | pydiagmods.o: |
---|
116 | $(F2PY) -c $(F2PYF) -I$(NCINCFOLD) -m module_ForDiag $(diagsrcs) -L$(NCLIBFOLD) |
---|
117 | |
---|
118 | pyintmods.o: |
---|
119 | $(F2PY) -c $(F2PYF) -I$(NCINCFOLD) -m module_ForInt $(intsrcs) -L$(NCLIBFOLD) |
---|
120 | |
---|
121 | pyscimods.o: |
---|
122 | $(F2PY) -c $(F2PYF) -I$(NCINCFOLD) -m module_ForSci $(scisrcs) -L$(NCLIBFOLD) |
---|
123 | |
---|
124 | pydefmods.o: |
---|
125 | $(F2PY) -c $(F2PYF) -I$(NCINCFOLD) -m module_ForDef $(defsrcs) -L$(NCLIBFOLD) |
---|
126 | |
---|
127 | trajectories_overlap.o: module_definitions.o module_basic.o module_generic.o module_NCgeneric.o module_scientific.o |
---|
128 | $(FC) $(FCEXECFLAGS) trajectories_overlap.f90 -o trajectories_overlap |
---|
129 | |
---|