1 | # L. Fita, LMD. October 2016 |
---|
2 | # Compilation of all required Fortran modules in `ciclad' with gcc compilers |
---|
3 | # A following python 'library' creation is required |
---|
4 | ## Compilation |
---|
5 | # make >& run_make.log |
---|
6 | |
---|
7 | FC = gfortran |
---|
8 | FCF = -c -fPIC |
---|
9 | LIB_INC = -L/opt/canopy-1.3.0/Canopy_64bit/System/lib/ -L/usr/lib64/ -L/opt/canopy-1.3.0/Canopy_64bit/System/lib/ |
---|
10 | RM = rm -f |
---|
11 | F2PY = /opt/canopy-1.3.0/Canopy_64bit/System/bin/f2py |
---|
12 | #DBGFLAGS = -g -Wall -Wextra -Warray-temporaries -Wconversion -fimplicit-none -fbacktrace -ffree-line-length-0 -fcheck=all -ffpe-trap=zero,overflow,underflow -finit-real=nan |
---|
13 | NCLIBFOLD = /usr/lib/x86_64-linux-gnu |
---|
14 | NCINCFOLD = /usr/include |
---|
15 | LIB_NETCDF = -L$(NCLIBFOLD) -lnetcdff -lnetcdf -I$(NCINCFOLD) |
---|
16 | |
---|
17 | FCFLAGS = $(FCF) $(DBGFLAGS) |
---|
18 | |
---|
19 | # Sources for f2py |
---|
20 | srcs = module_definitions.f90 module_basic.f90 module_generic.f90 module_scientific.f90 |
---|
21 | distrisrcs = $(srcs) module_DistriCorrection.f90 |
---|
22 | diagsrcs = $(srcs) module_ForDiagnosticsVars.f90 module_ForDiagnostics.f90 |
---|
23 | intsrcs = $(srcs) module_ForInterpolate.f90 |
---|
24 | scisrcs = $(srcs) |
---|
25 | defsrcs = module_definitions.f90 |
---|
26 | |
---|
27 | ####### ###### ##### #### ### ## # |
---|
28 | |
---|
29 | MODULES = \ |
---|
30 | module_definitions.o \ |
---|
31 | module_basic.o \ |
---|
32 | module_generic.o \ |
---|
33 | module_NCgeneric.o \ |
---|
34 | module_scientific.o \ |
---|
35 | module_ForInterpolate.o \ |
---|
36 | module_ForDiagnosticsVars.o \ |
---|
37 | module_ForDiagnostics.o \ |
---|
38 | module_DistriCorrection.o |
---|
39 | |
---|
40 | FINTMODULES = \ |
---|
41 | module_definitions.o \ |
---|
42 | module_basic.o \ |
---|
43 | module_generic.o \ |
---|
44 | module_scientific.o \ |
---|
45 | module_ForInterpolate.o |
---|
46 | |
---|
47 | all : \ |
---|
48 | module_ForDiagnostics.o \ |
---|
49 | interpolate.o \ |
---|
50 | DistriCorrection.o \ |
---|
51 | pydistrimods.o \ |
---|
52 | pydiagmods.o \ |
---|
53 | pyintmods.o \ |
---|
54 | pyscimods.o \ |
---|
55 | pydefmods.o \ |
---|
56 | trajectories_overlap.o |
---|
57 | |
---|
58 | diags : \ |
---|
59 | module_ForDiagnostics.o |
---|
60 | |
---|
61 | clean : |
---|
62 | $(RM) *.mod *.o interpolate module_ForDiag.so module_ForInt.so module_ForDistriCorrect.so module_ForSci.so module_ForDef.so |
---|
63 | |
---|
64 | ######## ####### |
---|
65 | ## |
---|
66 | ######## |
---|
67 | |
---|
68 | module_definitions.o: |
---|
69 | $(FC) $(FCFLAGS) module_definitions.f90 |
---|
70 | |
---|
71 | module_basic.o: module_definitions.o |
---|
72 | $(FC) $(FCFLAGS) module_basic.f90 |
---|
73 | |
---|
74 | module_generic.o: module_definitions.o module_basic.o |
---|
75 | $(FC) $(FCFLAGS) $(LIB_INC) module_generic.f90 |
---|
76 | |
---|
77 | module_NCgeneric.o: module_definitions.o module_basic.o module_generic.o |
---|
78 | $(FC) $(FCFLAGS) $(LIB_NETCDF) $(LIB_INC) module_NCgeneric.f90 |
---|
79 | |
---|
80 | module_scientific.o: module_definitions.o module_basic.o module_generic.o |
---|
81 | $(FC) $(FCFLAGS) module_scientific.f90 |
---|
82 | |
---|
83 | module_ForInterpolate.o: module_definitions.o module_generic.o |
---|
84 | $(FC) $(FCFLAGS) $(LIB_INC) module_ForInterpolate.f90 |
---|
85 | |
---|
86 | module_ForDiagnosticsVars.o: module_definitions.o module_basic.o module_generic.o |
---|
87 | $(FC) $(FCFLAGS) $(LIB_INC) module_ForDiagnosticsVars.f90 |
---|
88 | |
---|
89 | module_ForDiagnostics.o: module_definitions.o module_basic.o module_generic.o module_ForDiagnosticsVars.o |
---|
90 | $(FC) $(FCFLAGS) $(LIB_INC) module_ForDiagnostics.f90 |
---|
91 | |
---|
92 | module_DistriCorrection.o: module_definitions.o module_basic.o module_generic.o module_scientific.o |
---|
93 | $(FC) $(FCFLAGS) module_DistriCorrection.f90 |
---|
94 | |
---|
95 | FCEXEFINTCFLAGS = $(FINTMODULES) $(LIB_NETCDF) $(LIB_INC) |
---|
96 | FCEXECFLAGS = $(MODULES) $(LIB_NETCDF) $(LIB_INC) |
---|
97 | |
---|
98 | interpolate.o: module_definitions.o module_basic.o module_generic.o module_scientific.o module_ForInterpolate.o |
---|
99 | $(FC) $(FCEXEFINTCFLAGS) interpolate.f90 -o interpolate |
---|
100 | |
---|
101 | DistriCorrection.o: module_definitions.o module_basic.o module_generic.o module_NCgeneric.o module_scientific.o module_DistriCorrection.o |
---|
102 | $(FC) $(FCEXECFLAGS) DistriCorrection.f90 -o DistriCorrection |
---|
103 | |
---|
104 | pydistrimods.o: |
---|
105 | $(F2PY) -c -I$(NCINCFOLD) -m module_ForDistriCorrect $(distrisrcs) -L$(NCLIBFOLD) |
---|
106 | |
---|
107 | pydiagmods.o: |
---|
108 | $(F2PY) -c -I$(NCINCFOLD) -m module_ForDiag $(diagsrcs) -L$(NCLIBFOLD) |
---|
109 | |
---|
110 | pyintmods.o: |
---|
111 | $(F2PY) -c -I$(NCINCFOLD) -m module_ForInt $(intsrcs) -L$(NCLIBFOLD) |
---|
112 | |
---|
113 | pyscimods.o: |
---|
114 | $(F2PY) -c -I$(NCINCFOLD) -m module_ForSci $(scisrcs) -L$(NCLIBFOLD) |
---|
115 | |
---|
116 | pydefmods.o: |
---|
117 | $(F2PY) -c -I$(NCINCFOLD) -m module_ForDef $(defsrcs) -L$(NCLIBFOLD) |
---|
118 | |
---|
119 | trajectories_overlap.o: module_definitions.o module_basic.o module_generic.o module_NCgeneric.o module_scientific.o |
---|
120 | $(FC) $(FCEXECFLAGS) trajectories_overlap.f90 -o trajectories_overlap |
---|
121 | |
---|