1 | # L. Fita, CIMA. October 2017 |
---|
2 | # Compilation of all required Fortran modules in `hydra' with gcc compilers |
---|
3 | # A following python 'library' creation is required |
---|
4 | # Diagnostics compilation _______ |
---|
5 | # f2py -m module_ForDiag -h module_ForDiag.pyf module_generic.f90 module_ForDiagnosticsVars.f90 module_ForDiagnostics.f90 >& run_f2py_ForDiag_wrapper.log |
---|
6 | # make |
---|
7 | # f2py -m module_ForDiag -c --f90exec=/usr/bin/gfortran-6 module_ForDiag.pyf module_generic.f90 module_ForDiagnosticsVars.f90 module_ForDiagnostics.f90 >& run_f2py_ForDiag_compile.log |
---|
8 | # Interpolation compilation _______ |
---|
9 | # f2py -m module_ForInt -h module_ForInt.pyf module_generic.f90 module_ForInterpolate.f90 >& run_f2py_ForInt_wrapper.log |
---|
10 | # f2py -m module_ForInt -c --f90exec=/usr/bin/gfortran-6 module_ForInt.pyf module_generic.f90 module_ForInterpolate.f90 >& run_f2py_ForInt_compile.log |
---|
11 | |
---|
12 | FC = /usr/bin/gfortran |
---|
13 | FCF = -c |
---|
14 | LIB_INC = |
---|
15 | RM = rm -f |
---|
16 | F2PY = /usr/bin/f2py2.7 |
---|
17 | F2PYF = |
---|
18 | #DBGFLAGS = g -Wall -Wextra -Warray-temporaries -Wconversion -fimplicit-none -fbacktrace -ffree-line-length-0 -fcheck=all -ffpe-trap=zero,overflow,underflow -finit-real=nan |
---|
19 | NCLIBFOLD = /usr/lib/x86_64-linux-gnu |
---|
20 | NCINCFOLD = /usr/include |
---|
21 | NCLIBFFOLD = /usr/lib/x86_64-linux-gnu |
---|
22 | NCINCFFOLD = /usr/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 | |
---|