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 | FCFLAGS = -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 | NCFOLD = /usr |
---|
22 | LIB_NETCDF = -L$(NCFOLD)/lib -lnetcdff -lnetcdf -I$(NCFOLD)/include |
---|
23 | |
---|
24 | ####### ###### ##### #### ### ## # |
---|
25 | |
---|
26 | MODULES = \ |
---|
27 | module_generic.o |
---|
28 | |
---|
29 | all : \ |
---|
30 | interpolate.o \ |
---|
31 | module_ForDiagnostics.o |
---|
32 | |
---|
33 | diags : \ |
---|
34 | module_ForDiagnostics.o |
---|
35 | clean : |
---|
36 | $(RM) *.mod *.o interpolate |
---|
37 | |
---|
38 | ######## ####### |
---|
39 | ## |
---|
40 | ######## |
---|
41 | |
---|
42 | module_generic.o: |
---|
43 | $(FC) $(FCFLAGS) $(LIB_NETCDF) $(LIB_INC) module_generic.F90 |
---|
44 | |
---|
45 | module_ForDiagnosticsVars.o: module_generic.o |
---|
46 | $(FC) $(FCFLAGS) $(LIB_INC) module_ForDiagnosticsVars.F90 |
---|
47 | |
---|
48 | module_ForDiagnostics.o: module_generic.o module_ForDiagnosticsVars.o |
---|
49 | $(FC) $(FCFLAGS) $(LIB_INC) module_ForDiagnostics.F90 |
---|
50 | |
---|
51 | FCEXECFLAGS = $(MODULES) $(LIB_NETCDF) $(LIB_INC) |
---|
52 | |
---|
53 | interpolate.o: module_generic.o |
---|
54 | $(FC) $(FCEXECFLAGS) interpolate.F90 -o interpolate |
---|
55 | |
---|
56 | |
---|