1 | # L. Fita, LMD. October 2016 |
---|
2 | # Compilation of all required Fortran modules in `camelot' 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 gnu/4.4.7 |
---|
8 | # module load python/2.7-anaconda |
---|
9 | # export LD_LIBRARY_PATH=/opt/anaconda/lib/:$LD_LIBRARY_PATH |
---|
10 | # Diagnostics compilation _______ |
---|
11 | # f2py -m module_ForDiag -h module_ForDiag.pyf module_generic.F90 module_ForDiagnosticsVars.F90 module_ForDiagnostics.F90 >& run_f2py_ForDiag_wrapper.log |
---|
12 | # make |
---|
13 | # f2py -L/opt/anaconda/lib/ -m module_ForDiag -c --fcompiler=gnu95 module_ForDiag.pyf module_generic.F90 module_ForDiagnosticsVars.F90 module_ForDiagnostics.F90 >& run_f2py_ForDiag_compile.log |
---|
14 | # Interpolation compilation _______ |
---|
15 | # f2py -m module_ForInt -h module_ForInt.pyf module_generic.F90 module_ForInterpolate.F90 >& run_f2py_ForInt_wrapper.log |
---|
16 | # f2py -L/opt/anaconda/lib/ -m module_ForInt -c --fcompiler=gnu95 module_ForInt.pyf module_generic.F90 module_ForInterpolate.F90 >& run_f2py_ForInt_compile.log |
---|
17 | # |
---|
18 | |
---|
19 | FC = /usr/bin/gfortran |
---|
20 | FCFLAGS = -c -fPIC |
---|
21 | LIB_INC = |
---|
22 | RM = rm -f |
---|
23 | NCFOLD = /usr |
---|
24 | LIB_NETCDF = -L$(NCFOLD)/lib -lnetcdff -lnetcdf -I$(NCFOLD)/include |
---|
25 | |
---|
26 | ####### ###### ##### #### ### ## # |
---|
27 | |
---|
28 | MODULES = \ |
---|
29 | module_generic.o |
---|
30 | |
---|
31 | all : \ |
---|
32 | interpolate.o \ |
---|
33 | module_ForDiagnostics.o |
---|
34 | |
---|
35 | diags : \ |
---|
36 | module_ForDiagnostics.o |
---|
37 | clean : |
---|
38 | $(RM) *.mod *.o interpolate |
---|
39 | |
---|
40 | ######## ####### |
---|
41 | ## |
---|
42 | ######## |
---|
43 | |
---|
44 | module_generic.o: |
---|
45 | $(FC) $(FCFLAGS) $(LIB_NETCDF) $(LIB_INC) module_generic.F90 |
---|
46 | |
---|
47 | module_ForDiagnosticsVars.o: module_generic.o |
---|
48 | $(FC) $(FCFLAGS) $(LIB_INC) module_ForDiagnosticsVars.F90 |
---|
49 | |
---|
50 | module_ForDiagnostics.o: module_generic.o module_ForDiagnosticsVars.o |
---|
51 | $(FC) $(FCFLAGS) $(LIB_INC) module_ForDiagnostics.F90 |
---|
52 | |
---|
53 | FCEXECFLAGS = $(MODULES) $(LIB_NETCDF) $(LIB_INC) |
---|
54 | |
---|
55 | interpolate.o: module_generic.o |
---|
56 | $(FC) $(FCEXECFLAGS) interpolate.F90 -o interpolate |
---|
57 | |
---|
58 | |
---|