[1684] | 1 | # L. Fita, CIMA January 2017 |
---|
[2237] | 2 | # Compilation of all required Fortran modules in `hydra' with gcc compilers |
---|
[1684] | 3 | # A following python 'library' creation is required |
---|
[1824] | 4 | ## Compilation |
---|
| 5 | # make >& run_make.log |
---|
[1684] | 6 | |
---|
| 7 | FC = gfortran |
---|
| 8 | FCF = -c |
---|
| 9 | LIB_INC = |
---|
| 10 | RM = rm -f |
---|
| 11 | F2PY = /usr/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 = /share/tools/bin/netcdf/4.5.0/gcc/lib |
---|
| 14 | NCINCFOLD = /share/tools/bin/netcdf/4.5.0/gcc/include |
---|
[2237] | 15 | NCLIBFFOLD = /share/tools/bin/netcdf/4.5.0/gcc/lib |
---|
| 16 | NCINCFFOLD = /share/tools/bin/netcdf/4.5.0/gcc/include |
---|
| 17 | LIB_NETCDF = -L$(NCLIBFOLD) -L$(NCLIBFFOLD) -lnetcdff -lnetcdf -I$(NCINCFOLD) -I$(NCINCFFOLD) |
---|
[1684] | 18 | |
---|
| 19 | FCFLAGS = $(FCF) $(DBGFLAGS) |
---|
| 20 | |
---|
| 21 | # Sources for f2py |
---|
| 22 | srcs = module_definitions.f90 module_basic.f90 module_generic.f90 module_scientific.f90 |
---|
| 23 | distrisrcs = $(srcs) module_DistriCorrection.f90 |
---|
| 24 | diagsrcs = $(srcs) module_ForDiagnosticsVars.f90 module_ForDiagnostics.f90 |
---|
| 25 | intsrcs = $(srcs) module_ForInterpolate.f90 |
---|
| 26 | scisrcs = $(srcs) |
---|
| 27 | defsrcs = module_definitions.f90 |
---|
| 28 | |
---|
| 29 | ####### ###### ##### #### ### ## # |
---|
| 30 | |
---|
| 31 | MODULES = \ |
---|
| 32 | module_definitions.o \ |
---|
| 33 | module_basic.o \ |
---|
| 34 | module_generic.o \ |
---|
| 35 | module_NCgeneric.o \ |
---|
| 36 | module_scientific.o \ |
---|
[1824] | 37 | module_ForInterpolate.o \ |
---|
[1684] | 38 | module_ForDiagnosticsVars.o \ |
---|
| 39 | module_ForDiagnostics.o \ |
---|
| 40 | module_DistriCorrection.o |
---|
| 41 | |
---|
[1824] | 42 | FINTMODULES = \ |
---|
| 43 | module_definitions.o \ |
---|
| 44 | module_basic.o \ |
---|
| 45 | module_generic.o \ |
---|
| 46 | module_scientific.o \ |
---|
| 47 | module_ForInterpolate.o |
---|
| 48 | |
---|
[1684] | 49 | all : \ |
---|
| 50 | module_ForDiagnostics.o \ |
---|
[1824] | 51 | interpolate.o \ |
---|
[1684] | 52 | DistriCorrection.o \ |
---|
| 53 | pydistrimods.o \ |
---|
| 54 | pydiagmods.o \ |
---|
| 55 | pyintmods.o \ |
---|
| 56 | pyscimods.o \ |
---|
| 57 | pydefmods.o \ |
---|
| 58 | trajectories_overlap.o |
---|
| 59 | |
---|
| 60 | diags : \ |
---|
| 61 | module_ForDiagnostics.o |
---|
| 62 | |
---|
| 63 | clean : |
---|
| 64 | $(RM) *.mod *.o interpolate module_ForDiag.so module_ForInt.so module_ForDistriCorrect.so module_ForSci.so module_ForDef.so |
---|
| 65 | |
---|
| 66 | ######## ####### |
---|
| 67 | ## |
---|
| 68 | ######## |
---|
| 69 | |
---|
| 70 | module_definitions.o: |
---|
| 71 | $(FC) $(FCFLAGS) module_definitions.f90 |
---|
| 72 | |
---|
| 73 | module_basic.o: module_definitions.o |
---|
| 74 | $(FC) $(FCFLAGS) module_basic.f90 |
---|
| 75 | |
---|
| 76 | module_generic.o: module_definitions.o module_basic.o |
---|
| 77 | $(FC) $(FCFLAGS) $(LIB_INC) module_generic.f90 |
---|
| 78 | |
---|
| 79 | module_NCgeneric.o: module_definitions.o module_basic.o module_generic.o |
---|
| 80 | $(FC) $(FCFLAGS) $(LIB_NETCDF) $(LIB_INC) module_NCgeneric.f90 |
---|
| 81 | |
---|
| 82 | module_scientific.o: module_definitions.o module_basic.o module_generic.o |
---|
| 83 | $(FC) $(FCFLAGS) module_scientific.f90 |
---|
| 84 | |
---|
[1824] | 85 | module_ForInterpolate.o: module_definitions.o module_generic.o |
---|
| 86 | $(FC) $(FCFLAGS) $(LIB_INC) module_ForInterpolate.f90 |
---|
| 87 | |
---|
[2237] | 88 | module_ForDiagnosticsVars.o: module_definitions.o module_basic.o module_generic.o module_scientific.o |
---|
[1684] | 89 | $(FC) $(FCFLAGS) $(LIB_INC) module_ForDiagnosticsVars.f90 |
---|
| 90 | |
---|
| 91 | module_ForDiagnostics.o: module_definitions.o module_basic.o module_generic.o module_ForDiagnosticsVars.o |
---|
| 92 | $(FC) $(FCFLAGS) $(LIB_INC) module_ForDiagnostics.f90 |
---|
| 93 | |
---|
| 94 | module_DistriCorrection.o: module_definitions.o module_basic.o module_generic.o module_scientific.o |
---|
| 95 | $(FC) $(FCFLAGS) module_DistriCorrection.f90 |
---|
| 96 | |
---|
[1824] | 97 | FCEXEFINTCFLAGS = $(FINTMODULES) $(LIB_NETCDF) $(LIB_INC) |
---|
[1684] | 98 | FCEXECFLAGS = $(MODULES) $(LIB_NETCDF) $(LIB_INC) |
---|
| 99 | |
---|
[1824] | 100 | interpolate.o: module_definitions.o module_basic.o module_generic.o module_scientific.o module_ForInterpolate.o |
---|
| 101 | $(FC) $(FCEXEFINTCFLAGS) interpolate.f90 -o interpolate |
---|
[1684] | 102 | |
---|
| 103 | DistriCorrection.o: module_definitions.o module_basic.o module_generic.o module_NCgeneric.o module_scientific.o module_DistriCorrection.o |
---|
| 104 | $(FC) $(FCEXECFLAGS) DistriCorrection.f90 -o DistriCorrection |
---|
| 105 | |
---|
| 106 | pydistrimods.o: |
---|
[2237] | 107 | $(F2PY) -c $(F2PYF) -I$(NCINCFOLD) -m module_ForDistriCorrect $(distrisrcs) -L$(NCLIBFOLD) |
---|
[1684] | 108 | |
---|
| 109 | pydiagmods.o: |
---|
[2237] | 110 | $(F2PY) -c $(F2PYF) -I$(NCINCFOLD) -m module_ForDiag $(diagsrcs) -L$(NCLIBFOLD) |
---|
[1684] | 111 | |
---|
| 112 | pyintmods.o: |
---|
[2237] | 113 | $(F2PY) -c $(F2PYF) -I$(NCINCFOLD) -m module_ForInt $(intsrcs) -L$(NCLIBFOLD) |
---|
[1684] | 114 | |
---|
| 115 | pyscimods.o: |
---|
[2237] | 116 | $(F2PY) -c $(F2PYF) -I$(NCINCFOLD) -m module_ForSci $(scisrcs) -L$(NCLIBFOLD) |
---|
[1684] | 117 | |
---|
| 118 | pydefmods.o: |
---|
[2237] | 119 | $(F2PY) -c $(F2PYF) -I$(NCINCFOLD) -m module_ForDef $(defsrcs) -L$(NCLIBFOLD) |
---|
[1684] | 120 | |
---|
| 121 | trajectories_overlap.o: module_definitions.o module_basic.o module_generic.o module_NCgeneric.o module_scientific.o |
---|
| 122 | $(FC) $(FCEXECFLAGS) trajectories_overlap.f90 -o trajectories_overlap |
---|
| 123 | |
---|