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 | |
---|
5 | # FOLLOWING: http://stackoverflow.com/questions/17156125/f2py-exposing-parameters-from-used-modules |
---|
6 | # FOLLOWING: http://osdir.com/ml/python.f2py.user/2006-08/msg00019.html |
---|
7 | # module load python/2.7.6-canopy-1.3 |
---|
8 | # Diagnostics compilation _______ |
---|
9 | # f2py -m module_ForDiag -h module_ForDiag.pyf module_generic.f90 module_ForDiagnosticsVars.f90 module_ForDiagnostics.f90 >& run_f2py_ForDiag_wrapper.log |
---|
10 | # make |
---|
11 | # f2py -L/opt/canopy-1.3.0/Canopy_64bit/System/lib/ -L/usr/lib64/ -L/opt/canopy-1.3.0/Canopy_64bit/System/lib/ -m module_ForDiag -c --fcompiler=gnu95 module_ForDiag.pyf module_generic.f90 module_ForDiagnosticsVars.f90 module_ForDiagnostics.f90 >& run_f2py_ForDiag_compile.log |
---|
12 | # Interpolation compilation _______ |
---|
13 | # f2py -m module_ForInt -h module_ForInt.pyf module_generic.f90 module_ForInterpolate.f90 >& run_f2py_ForInt_wrapper.log |
---|
14 | # f2py -L/opt/canopy-1.3.0/Canopy_64bit/System/lib/ -L/usr/lib64/ -L/opt/canopy-1.3.0/Canopy_64bit/System/lib/ -m module_ForInt -c --fcompiler=gnu95 module_ForInt.pyf module_generic.f90 module_ForInterpolate.f90 >& run_f2py_ForInt_compile.log |
---|
15 | # |
---|
16 | |
---|
17 | FC = gfortran |
---|
18 | FCF = -c -fPIC |
---|
19 | 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/ |
---|
20 | RM = rm -f |
---|
21 | #DBGFLAGS = -g -Wall -Wextra -Warray-temporaries -Wconversion -fimplicit-none -fbacktrace -ffree-line-length-0 -fcheck=all -ffpe-trap=zero,overflow,underflow -finit-real=nan |
---|
22 | NCFOLD = /usr |
---|
23 | LIB_NETCDF = -L$(NCFOLD)/lib -lnetcdff -lnetcdf -I$(NCFOLD)/include |
---|
24 | |
---|
25 | FCFLAGS = $(FCF) $(DBGFLAGS) |
---|
26 | |
---|
27 | # Sources for f2py |
---|
28 | distrisrcs = module_definitions.f90 module_generic.f90 module_scientific.f90 module_DistriCorrection.f90 |
---|
29 | diagsrcs = module_definitions.f90 module_generic.f90 module_scientific.f90 module_ForDiagnosticsVars.f90 module_ForDiagnostics.f90 |
---|
30 | intsrcs = module_definitions.f90 module_generic.f90 module_scientific.f90 module_ForInterpolate.f90 |
---|
31 | |
---|
32 | ####### ###### ##### #### ### ## # |
---|
33 | |
---|
34 | MODULES = \ |
---|
35 | module_definitions.o \ |
---|
36 | module_scientific.o \ |
---|
37 | module_generic.o \ |
---|
38 | module_ForDiagnosticsVars.o \ |
---|
39 | module_ForDiagnostics.o \ |
---|
40 | module_DistriCorrection.o |
---|
41 | |
---|
42 | all : \ |
---|
43 | module_ForDiagnostics.o \ |
---|
44 | DistriCorrection.o \ |
---|
45 | interpolate.o \ |
---|
46 | pydistrimods.o \ |
---|
47 | pydiagmods.o \ |
---|
48 | pyintmods.o |
---|
49 | |
---|
50 | diags : \ |
---|
51 | module_ForDiagnostics.o |
---|
52 | |
---|
53 | clean : |
---|
54 | $(RM) *.mod *.o interpolate module_ForDiag.so module_ForInt.so module_ForDistriCorrect.so |
---|
55 | |
---|
56 | ######## ####### |
---|
57 | ## |
---|
58 | ######## |
---|
59 | |
---|
60 | module_definitions.o: |
---|
61 | $(FC) $(FCFLAGS) module_definitions.f90 |
---|
62 | |
---|
63 | module_generic.o: module_definitions.o |
---|
64 | $(FC) $(FCFLAGS) $(LIB_NETCDF) $(LIB_INC) module_generic.f90 |
---|
65 | |
---|
66 | module_scientific.o: module_definitions.o module_generic.o |
---|
67 | $(FC) $(FCFLAGS) module_scientific.f90 |
---|
68 | |
---|
69 | module_ForDiagnosticsVars.o: module_definitions.o module_generic.o |
---|
70 | $(FC) $(FCFLAGS) $(LIB_INC) module_ForDiagnosticsVars.f90 |
---|
71 | |
---|
72 | module_ForDiagnostics.o: module_definitions.o module_generic.o module_ForDiagnosticsVars.o |
---|
73 | $(FC) $(FCFLAGS) $(LIB_INC) module_ForDiagnostics.f90 |
---|
74 | |
---|
75 | module_DistriCorrection.o: module_definitions.o module_generic.o module_scientific.o |
---|
76 | $(FC) $(FCFLAGS) $(LIB_NETCDF) module_DistriCorrection.f90 |
---|
77 | |
---|
78 | FCEXECFLAGS = $(MODULES) $(LIB_NETCDF) $(LIB_INC) |
---|
79 | |
---|
80 | interpolate.o: module_definitions.o module_generic.o module_scientific.o |
---|
81 | $(FC) $(FCEXECFLAGS) interpolate.f90 -o interpolate |
---|
82 | |
---|
83 | DistriCorrection.o: module_definitions.o module_generic.o module_scientific.o module_DistriCorrection.o |
---|
84 | $(FC) $(FCEXECFLAGS) DistriCorrection.f90 -o DistriCorrection |
---|
85 | |
---|
86 | pydistrimods.o: |
---|
87 | f2py -c -m module_ForDistriCorrect $(distrisrcs) |
---|
88 | |
---|
89 | pydiagmods.o: |
---|
90 | f2py -c -m module_ForDiag $(diagsrcs) |
---|
91 | |
---|
92 | pyintmods.o: |
---|
93 | f2py -c -m module_ForInt $(intsrcs) |
---|