[1156] | 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 |
---|
[1161] | 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 |
---|
[1169] | 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 |
---|
[1166] | 10 | # Diagnostics compilation _______ |
---|
[1607] | 11 | # f2py -m module_ForDiag -h module_ForDiag.pyf module_generic.f90 module_ForDiagnosticsVars.f90 module_ForDiagnostics.f90 >& run_f2py_ForDiag_wrapper.log |
---|
[1161] | 12 | # make |
---|
[1607] | 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 |
---|
[1166] | 14 | # Interpolation compilation _______ |
---|
[1607] | 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 |
---|
[1166] | 17 | # |
---|
[1156] | 18 | |
---|
[1162] | 19 | FC = /usr/bin/gfortran |
---|
[1611] | 20 | FCF = -c -fPIC |
---|
[1169] | 21 | LIB_INC = |
---|
[1156] | 22 | RM = rm -f |
---|
[1611] | 23 | #DBGFLAGS = -g -Wall -Wextra -Warray-temporaries -Wconversion -fimplicit-none -fbacktrace -ffree-line-length-0 -fcheck=all -ffpe-trap=zero,overflow,underflow -finit-real=nan |
---|
[1156] | 24 | NCFOLD = /usr |
---|
| 25 | LIB_NETCDF = -L$(NCFOLD)/lib -lnetcdff -lnetcdf -I$(NCFOLD)/include |
---|
| 26 | |
---|
[1611] | 27 | FCFLAGS = $(FCF) $(DBGFLAGS) |
---|
| 28 | |
---|
| 29 | # Sources for f2py |
---|
| 30 | distrisrcs = module_definitions.f90 module_generic.f90 module_scientific.f90 module_DistriCorrection.f90 |
---|
| 31 | diagsrcs = module_definitions.f90 module_generic.f90 module_scientific.f90 module_ForDiagnosticsVars.f90 module_ForDiagnostics.f90 |
---|
| 32 | intsrcs = module_definitions.f90 module_generic.f90 module_scientific.f90 module_ForInterpolate.f90 |
---|
| 33 | |
---|
[1156] | 34 | ####### ###### ##### #### ### ## # |
---|
| 35 | |
---|
| 36 | MODULES = \ |
---|
[1611] | 37 | module_definitions.o \ |
---|
| 38 | module_scientific.o \ |
---|
| 39 | module_generic.o \ |
---|
| 40 | module_ForDiagnosticsVars.o \ |
---|
| 41 | module_ForDiagnostics.o \ |
---|
| 42 | module_DistriCorrection.o |
---|
[1156] | 43 | |
---|
| 44 | all : \ |
---|
[1611] | 45 | module_ForDiagnostics.o \ |
---|
| 46 | DistriCorrection.o \ |
---|
[1156] | 47 | interpolate.o \ |
---|
[1611] | 48 | pydistrimods.o \ |
---|
| 49 | pydiagmods.o \ |
---|
| 50 | pyintmods.o |
---|
[1156] | 51 | |
---|
| 52 | diags : \ |
---|
| 53 | module_ForDiagnostics.o |
---|
[1611] | 54 | |
---|
[1156] | 55 | clean : |
---|
[1611] | 56 | $(RM) *.mod *.o interpolate module_ForDiag.so module_ForInt.so module_ForDistriCorrect.so |
---|
[1156] | 57 | |
---|
| 58 | ######## ####### |
---|
| 59 | ## |
---|
| 60 | ######## |
---|
| 61 | |
---|
[1611] | 62 | module_definitions.o: |
---|
| 63 | $(FC) $(FCFLAGS) module_definitions.f90 |
---|
| 64 | |
---|
| 65 | module_generic.o: module_definitions.o |
---|
[1607] | 66 | $(FC) $(FCFLAGS) $(LIB_NETCDF) $(LIB_INC) module_generic.f90 |
---|
[1156] | 67 | |
---|
[1611] | 68 | module_scientific.o: module_definitions.o module_generic.o |
---|
| 69 | $(FC) $(FCFLAGS) module_scientific.f90 |
---|
| 70 | |
---|
| 71 | module_ForDiagnosticsVars.o: module_definitions.o module_generic.o |
---|
[1607] | 72 | $(FC) $(FCFLAGS) $(LIB_INC) module_ForDiagnosticsVars.f90 |
---|
[1156] | 73 | |
---|
[1611] | 74 | module_ForDiagnostics.o: module_definitions.o module_generic.o module_ForDiagnosticsVars.o |
---|
[1607] | 75 | $(FC) $(FCFLAGS) $(LIB_INC) module_ForDiagnostics.f90 |
---|
[1156] | 76 | |
---|
[1611] | 77 | module_DistriCorrection.o: module_definitions.o module_generic.o module_scientific.o |
---|
| 78 | $(FC) $(FCFLAGS) $(LIB_NETCDF) module_DistriCorrection.f90 |
---|
[1156] | 79 | |
---|
[1611] | 80 | FCEXECFLAGS = $(MODULES) $(LIB_NETCDF) $(LIB_INC) |
---|
| 81 | |
---|
| 82 | interpolate.o: module_definitions.o module_generic.o module_scientific.o |
---|
[1607] | 83 | $(FC) $(FCEXECFLAGS) interpolate.f90 -o interpolate |
---|
[1156] | 84 | |
---|
[1611] | 85 | DistriCorrection.o: module_definitions.o module_generic.o module_scientific.o module_DistriCorrection.o |
---|
| 86 | $(FC) $(FCEXECFLAGS) DistriCorrection.f90 -o DistriCorrection |
---|
[1156] | 87 | |
---|
[1611] | 88 | pydistrimods.o: |
---|
| 89 | f2py -c -m module_ForDistriCorrect $(distrisrcs) |
---|
| 90 | |
---|
| 91 | pydiagmods.o: |
---|
| 92 | f2py -c -m module_ForDiag $(diagsrcs) |
---|
| 93 | |
---|
| 94 | pyintmods.o: |
---|
| 95 | f2py -c -m module_ForInt $(intsrcs) |
---|