[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 |
---|
[2376] | 6 | # NOTE: One will not be able to compile all the set of programs within an anaconda environment |
---|
| 7 | # due to problems with anaconda. Installation of netcdf4 colides with installed libnetcdff |
---|
| 8 | # - netcdf4 |
---|
| 9 | # The following packages will be downloaded: |
---|
| 10 | # |
---|
| 11 | # package | build |
---|
| 12 | # ---------------------------|----------------- |
---|
| 13 | # libnetcdf-4.6.1 | h10edf3e_2 1.3 MB |
---|
| 14 | # |
---|
| 15 | # The following NEW packages will be INSTALLED: |
---|
| 16 | # |
---|
| 17 | # netcdf4: 1.4.2-py27h4b4f87f_0 |
---|
| 18 | # |
---|
| 19 | # The following packages will be REMOVED: |
---|
| 20 | # |
---|
| 21 | # libnetcdff: 4.4.4-0 matthewharrison |
---|
| 22 | # |
---|
| 23 | # The following packages will be UPDATED: |
---|
| 24 | # |
---|
| 25 | # libnetcdf: 4.4.0-hf6ef953_0 matthewharrison --> 4.6.1-h10edf3e_2 |
---|
| 26 | ##### |
---|
| 27 | # Because of that, Makefile is splitted in two compilation sub-sets |
---|
| 28 | ## |
---|
| 29 | # $ make pymods: compilation of Fortran modules used in the python scripts |
---|
| 30 | # $ make NCfortran: compiation of Fortran modules and main programs which require |
---|
| 31 | # netCDF-fortran interface: (for: DistriCorrection and trajectories_overlap) |
---|
| 32 | # $ make: compiles all components |
---|
| 33 | ## |
---|
[1684] | 34 | |
---|
| 35 | FC = gfortran |
---|
| 36 | FCF = -c |
---|
| 37 | LIB_INC = |
---|
| 38 | RM = rm -f |
---|
| 39 | F2PY = /usr/bin/f2py |
---|
| 40 | #DBGFLAGS = g -Wall -Wextra -Warray-temporaries -Wconversion -fimplicit-none -fbacktrace -ffree-line-length-0 -fcheck=all -ffpe-trap=zero,overflow,underflow -finit-real=nan |
---|
| 41 | NCLIBFOLD = /share/tools/bin/netcdf/4.5.0/gcc/lib |
---|
| 42 | NCINCFOLD = /share/tools/bin/netcdf/4.5.0/gcc/include |
---|
[2237] | 43 | NCLIBFFOLD = /share/tools/bin/netcdf/4.5.0/gcc/lib |
---|
| 44 | NCINCFFOLD = /share/tools/bin/netcdf/4.5.0/gcc/include |
---|
| 45 | LIB_NETCDF = -L$(NCLIBFOLD) -L$(NCLIBFFOLD) -lnetcdff -lnetcdf -I$(NCINCFOLD) -I$(NCINCFFOLD) |
---|
[1684] | 46 | |
---|
| 47 | FCFLAGS = $(FCF) $(DBGFLAGS) |
---|
| 48 | |
---|
| 49 | # Sources for f2py |
---|
| 50 | srcs = module_definitions.f90 module_basic.f90 module_generic.f90 module_scientific.f90 |
---|
| 51 | distrisrcs = $(srcs) module_DistriCorrection.f90 |
---|
| 52 | diagsrcs = $(srcs) module_ForDiagnosticsVars.f90 module_ForDiagnostics.f90 |
---|
| 53 | intsrcs = $(srcs) module_ForInterpolate.f90 |
---|
| 54 | scisrcs = $(srcs) |
---|
[2376] | 55 | gensrcs = module_definitions.f90 module_basic.f90 module_generic.f90 |
---|
[1684] | 56 | defsrcs = module_definitions.f90 |
---|
| 57 | |
---|
| 58 | ####### ###### ##### #### ### ## # |
---|
| 59 | |
---|
| 60 | MODULES = \ |
---|
| 61 | module_definitions.o \ |
---|
| 62 | module_basic.o \ |
---|
| 63 | module_generic.o \ |
---|
| 64 | module_NCgeneric.o \ |
---|
| 65 | module_scientific.o \ |
---|
[1824] | 66 | module_ForInterpolate.o \ |
---|
[1684] | 67 | module_ForDiagnosticsVars.o \ |
---|
[2376] | 68 | module_ForDiagnostics.o |
---|
[1684] | 69 | |
---|
[1824] | 70 | FINTMODULES = \ |
---|
| 71 | module_definitions.o \ |
---|
| 72 | module_basic.o \ |
---|
| 73 | module_generic.o \ |
---|
| 74 | module_scientific.o \ |
---|
| 75 | module_ForInterpolate.o |
---|
| 76 | |
---|
[2376] | 77 | FEXECMODULES = \ |
---|
| 78 | module_definitions.o \ |
---|
| 79 | module_basic.o \ |
---|
| 80 | module_generic.o \ |
---|
| 81 | module_scientific.o \ |
---|
| 82 | module_NCgeneric.o \ |
---|
| 83 | module_ForInterpolate.o \ |
---|
| 84 | module_DistriCorrection.o |
---|
| 85 | |
---|
[1684] | 86 | all : \ |
---|
| 87 | module_ForDiagnostics.o \ |
---|
[1824] | 88 | interpolate.o \ |
---|
[1684] | 89 | DistriCorrection.o \ |
---|
| 90 | pydistrimods.o \ |
---|
| 91 | pydiagmods.o \ |
---|
| 92 | pyintmods.o \ |
---|
| 93 | pyscimods.o \ |
---|
[2376] | 94 | pygenmods.o \ |
---|
[1684] | 95 | pydefmods.o \ |
---|
| 96 | trajectories_overlap.o |
---|
| 97 | |
---|
[2376] | 98 | pymods : \ |
---|
| 99 | module_ForDiagnostics.o \ |
---|
| 100 | pydistrimods.o \ |
---|
| 101 | pydiagmods.o \ |
---|
| 102 | pyintmods.o \ |
---|
| 103 | pyscimods.o \ |
---|
| 104 | pygenmods.o \ |
---|
| 105 | pydefmods.o |
---|
| 106 | |
---|
| 107 | NCfortran : \ |
---|
| 108 | module_definitions.o \ |
---|
| 109 | module_basic.o \ |
---|
| 110 | module_generic.o \ |
---|
| 111 | module_NCgeneric.o \ |
---|
| 112 | module_ForInterpolate.o \ |
---|
| 113 | DistriCorrection.o \ |
---|
| 114 | trajectories_overlap.o |
---|
| 115 | |
---|
[1684] | 116 | diags : \ |
---|
| 117 | module_ForDiagnostics.o |
---|
| 118 | |
---|
| 119 | clean : |
---|
[2376] | 120 | $(RM) *.mod *.o interpolate module_ForDiag.so module_ForInt.so module_ForDistriCorrect.so module_ForSci.so module_ForGen.so module_ForDef.so |
---|
[1684] | 121 | |
---|
| 122 | ######## ####### |
---|
| 123 | ## |
---|
| 124 | ######## |
---|
| 125 | |
---|
| 126 | module_definitions.o: |
---|
| 127 | $(FC) $(FCFLAGS) module_definitions.f90 |
---|
| 128 | |
---|
| 129 | module_basic.o: module_definitions.o |
---|
| 130 | $(FC) $(FCFLAGS) module_basic.f90 |
---|
| 131 | |
---|
| 132 | module_generic.o: module_definitions.o module_basic.o |
---|
| 133 | $(FC) $(FCFLAGS) $(LIB_INC) module_generic.f90 |
---|
| 134 | |
---|
| 135 | module_NCgeneric.o: module_definitions.o module_basic.o module_generic.o |
---|
| 136 | $(FC) $(FCFLAGS) $(LIB_NETCDF) $(LIB_INC) module_NCgeneric.f90 |
---|
| 137 | |
---|
| 138 | module_scientific.o: module_definitions.o module_basic.o module_generic.o |
---|
| 139 | $(FC) $(FCFLAGS) module_scientific.f90 |
---|
| 140 | |
---|
[1824] | 141 | module_ForInterpolate.o: module_definitions.o module_generic.o |
---|
| 142 | $(FC) $(FCFLAGS) $(LIB_INC) module_ForInterpolate.f90 |
---|
| 143 | |
---|
[2237] | 144 | module_ForDiagnosticsVars.o: module_definitions.o module_basic.o module_generic.o module_scientific.o |
---|
[1684] | 145 | $(FC) $(FCFLAGS) $(LIB_INC) module_ForDiagnosticsVars.f90 |
---|
| 146 | |
---|
| 147 | module_ForDiagnostics.o: module_definitions.o module_basic.o module_generic.o module_ForDiagnosticsVars.o |
---|
| 148 | $(FC) $(FCFLAGS) $(LIB_INC) module_ForDiagnostics.f90 |
---|
| 149 | |
---|
| 150 | module_DistriCorrection.o: module_definitions.o module_basic.o module_generic.o module_scientific.o |
---|
| 151 | $(FC) $(FCFLAGS) module_DistriCorrection.f90 |
---|
| 152 | |
---|
[1824] | 153 | FCEXEFINTCFLAGS = $(FINTMODULES) $(LIB_NETCDF) $(LIB_INC) |
---|
[2376] | 154 | FCEXECFLAGS = $(FEXECMODULES) $(LIB_NETCDF) $(LIB_INC) |
---|
[1684] | 155 | |
---|
[1824] | 156 | interpolate.o: module_definitions.o module_basic.o module_generic.o module_scientific.o module_ForInterpolate.o |
---|
| 157 | $(FC) $(FCEXEFINTCFLAGS) interpolate.f90 -o interpolate |
---|
[1684] | 158 | |
---|
| 159 | DistriCorrection.o: module_definitions.o module_basic.o module_generic.o module_NCgeneric.o module_scientific.o module_DistriCorrection.o |
---|
| 160 | $(FC) $(FCEXECFLAGS) DistriCorrection.f90 -o DistriCorrection |
---|
| 161 | |
---|
| 162 | pydistrimods.o: |
---|
[2237] | 163 | $(F2PY) -c $(F2PYF) -I$(NCINCFOLD) -m module_ForDistriCorrect $(distrisrcs) -L$(NCLIBFOLD) |
---|
[1684] | 164 | |
---|
| 165 | pydiagmods.o: |
---|
[2237] | 166 | $(F2PY) -c $(F2PYF) -I$(NCINCFOLD) -m module_ForDiag $(diagsrcs) -L$(NCLIBFOLD) |
---|
[1684] | 167 | |
---|
| 168 | pyintmods.o: |
---|
[2237] | 169 | $(F2PY) -c $(F2PYF) -I$(NCINCFOLD) -m module_ForInt $(intsrcs) -L$(NCLIBFOLD) |
---|
[1684] | 170 | |
---|
| 171 | pyscimods.o: |
---|
[2237] | 172 | $(F2PY) -c $(F2PYF) -I$(NCINCFOLD) -m module_ForSci $(scisrcs) -L$(NCLIBFOLD) |
---|
[1684] | 173 | |
---|
[2376] | 174 | pygenmods.o: |
---|
| 175 | $(F2PY) -c $(F2PYF) -I$(NCINCFOLD) -m module_ForGen $(gensrcs) -L$(NCLIBFOLD) |
---|
| 176 | |
---|
[1684] | 177 | pydefmods.o: |
---|
[2237] | 178 | $(F2PY) -c $(F2PYF) -I$(NCINCFOLD) -m module_ForDef $(defsrcs) -L$(NCLIBFOLD) |
---|
[1684] | 179 | |
---|
| 180 | trajectories_overlap.o: module_definitions.o module_basic.o module_generic.o module_NCgeneric.o module_scientific.o |
---|
| 181 | $(FC) $(FCEXECFLAGS) trajectories_overlap.f90 -o trajectories_overlap |
---|
| 182 | |
---|