# L. Fita, CIMA January 2017 # Compilation of all required Fortran modules in `hydra' with ifort compilers # A following python 'library' creation is required # Diagnostics compilation _______ # f2py -m module_ForDiag -h module_ForDiag.pyf module_generic.f90 module_ForDiagnosticsVars.f90 module_ForDiagnostics.f90 >& run_f2py_ForDiag_wrapper.log # make # f2py -m module_ForDiag -c --f90exec=/usr/bin/gfortran-6 module_ForDiag.pyf module_generic.f90 module_ForDiagnosticsVars.f90 module_ForDiagnostics.f90 >& run_f2py_ForDiag_compile.log # Interpolation compilation _______ # f2py -m module_ForInt -h module_ForInt.pyf module_generic.f90 module_ForInterpolate.f90 >& run_f2py_ForInt_wrapper.log # f2py -m module_ForInt -c --f90exec=/usr/bin/gfortran-6 module_ForInt.pyf module_generic.f90 module_ForInterpolate.f90 >& run_f2py_ForInt_compile.log FC = /opt/intel/composerxe-2011.3.174/bin/intel64/ifort FCF = -c LIB_INC = RM = rm -f F2PY = /home/lluis.fita/bin/anaconda2/bin/f2py #F2PY = /share/anaconda2/bin/f2py #DBGFLAGS = g -Wall -Wextra -Warray-temporaries -Wconversion -fimplicit-none -fbacktrace -ffree-line-length-0 -fcheck=all -ffpe-trap=zero,overflow,underflow -finit-real=nan NCLIBFOLD = /home/lluis.fita/bin/anaconda2/lib NCINCFOLD = /home/lluis.fita/bin/anaconda2/include #NCLIBFOLD = /share/anaconda2/lib #NCINCFOLD = /share/anaconda2/include LIB_NETCDF = -L$(NCLIBFOLD) -lnetcdff -lnetcdf -I$(NCINCFOLD) FCFLAGS = $(FCF) $(DBGFLAGS) LD_LIBRARY_PATH := :/home/lluis.fita/bin/anaconda2/lib #LD_LIBRARY_PATH := :/share/anaconda2/lib # Sources for f2py srcs = module_definitions.f90 module_basic.f90 module_generic.f90 module_scientific.f90 distrisrcs = $(srcs) module_DistriCorrection.f90 diagsrcs = $(srcs) module_ForDiagnosticsVars.f90 module_ForDiagnostics.f90 intsrcs = $(srcs) module_ForInterpolate.f90 scisrcs = $(srcs) defsrcs = module_definitions.f90 ####### ###### ##### #### ### ## # MODULES = \ module_definitions.o \ module_basic.o \ module_generic.o \ module_NCgeneric.o \ module_scientific.o \ module_ForDiagnosticsVars.o \ module_ForDiagnostics.o \ module_DistriCorrection.o all : \ module_ForDiagnostics.o \ DistriCorrection.o \ interpolate.o \ pydistrimods.o \ pydiagmods.o \ pyintmods.o \ pyscimods.o \ pydefmods.o \ trajectories_overlap.o diags : \ module_ForDiagnostics.o clean : $(RM) *.mod *.o interpolate module_ForDiag.so module_ForInt.so module_ForDistriCorrect.so module_ForSci.so module_ForDef.so ######## ####### ## ######## module_definitions.o: $(FC) $(FCFLAGS) module_definitions.f90 module_basic.o: module_definitions.o $(FC) $(FCFLAGS) module_basic.f90 module_generic.o: module_definitions.o module_basic.o $(FC) $(FCFLAGS) $(LIB_INC) module_generic.f90 module_NCgeneric.o: module_definitions.o module_basic.o module_generic.o $(FC) $(FCFLAGS) $(LIB_NETCDF) $(LIB_INC) module_NCgeneric.f90 module_scientific.o: module_definitions.o module_basic.o module_generic.o $(FC) $(FCFLAGS) module_scientific.f90 module_ForDiagnosticsVars.o: module_definitions.o module_basic.o module_generic.o $(FC) $(FCFLAGS) $(LIB_INC) module_ForDiagnosticsVars.f90 module_ForDiagnostics.o: module_definitions.o module_basic.o module_generic.o module_ForDiagnosticsVars.o $(FC) $(FCFLAGS) $(LIB_INC) module_ForDiagnostics.f90 module_DistriCorrection.o: module_definitions.o module_basic.o module_generic.o module_scientific.o $(FC) $(FCFLAGS) module_DistriCorrection.f90 FCEXECFLAGS = $(MODULES) $(LIB_NETCDF) $(LIB_INC) interpolate.o: module_definitions.o module_basic.o module_generic.o module_scientific.o $(FC) $(FCEXECFLAGS) interpolate.f90 -o interpolate DistriCorrection.o: module_definitions.o module_basic.o module_generic.o module_NCgeneric.o module_scientific.o module_DistriCorrection.o $(FC) $(FCEXECFLAGS) DistriCorrection.f90 -o DistriCorrection pydistrimods.o: $(F2PY) -c -I$(NCINCFOLD) -m module_ForDistriCorrect $(distrisrcs) -L$(NCLIBFOLD) pydiagmods.o: $(F2PY) -c -I$(NCINCFOLD) -m module_ForDiag $(diagsrcs) -L$(NCLIBFOLD) pyintmods.o: $(F2PY) -c -I$(NCINCFOLD) -m module_ForInt $(intsrcs) -L$(NCLIBFOLD) pyscimods.o: $(F2PY) -c -I$(NCINCFOLD) -m module_ForSci $(scisrcs) -L$(NCLIBFOLD) pydefmods.o: $(F2PY) -c -I$(NCINCFOLD) -m module_ForDef $(defsrcs) -L$(NCLIBFOLD) trajectories_overlap.o: module_definitions.o module_basic.o module_generic.o module_NCgeneric.o module_scientific.o $(FC) $(FCEXECFLAGS) trajectories_overlap.f90 -o trajectories_overlap