# L. Fita, LMD. October 2016 # Compilation of all required Fortran modules in `camelot' with gcc compilers # A following python 'library' creation is required ## Compilation # Prior to compilation, a copy of the file __test_Fmods.f90__ has to be done # $ cp __test_Fmods.f90__ test_Fmods.f90 # make >& run_make.log # NOTE: One will not be able to compile all the set of programs within an anaconda environment # due to problems with anaconda. Installation of netcdf4 colides with installed libnetcdff # - netcdf4 # The following packages will be downloaded: # ## module load python/2.7.6-canopy-1.3 # using netcdf4.3.3.1gfortran ## module load netcdf4/4.3.3.1-gfortran FC = /usr/bin/gfortran FCF = -c -fPIC LIB_INC = RM = rm -f F2PY = /opt/canopy-1.3.0/Canopy_64bit/User/bin/f2py -L/opt/anaconda/lib/ --fcompiler=gnu95 F2PYF = #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 = /opt/netcdf43/gfortran/bin/ NCINCFOLD = /opt/netcdf43/gfortran/include/ NCLIBFFOLD = /opt/netcdf43/gfortran/bin/ NCINCFFOLD = /opt/netcdf43/gfortran/include/ LIB_NETCDF = -L$(NCLIBFOLD) -L$(NCLIBFFOLD) -lnetcdff -lnetcdf -I$(NCINCFOLD) -I$(NCINCFFOLD) -static-libgfortran FCFLAGS = $(FCF) $(DBGFLAGS) # 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) gensrcs = module_definitions.f90 module_basic.f90 module_generic.f90 defsrcs = module_definitions.f90 ####### ###### ##### #### ### ## # MODULES = \ module_definitions.o \ module_basic.o \ module_generic.o \ module_NCgeneric.o \ module_scientific.o \ module_ForInterpolate.o \ module_ForDiagnosticsVars.o \ module_ForDiagnostics.o FINTMODULES = \ module_definitions.o \ module_basic.o \ module_generic.o \ module_scientific.o \ module_ForInterpolate.o FEXECMODULES = \ module_definitions.o \ module_basic.o \ module_generic.o \ module_scientific.o \ module_NCgeneric.o \ module_ForInterpolate.o \ module_DistriCorrection.o FTESTMODULES = \ module_definitions.o \ module_basic.o \ module_generic.o \ module_NCgeneric.o \ module_scientific.o \ module_ForDiagnosticsVars.o \ module_ForDiagnostics.o all : \ module_ForDiagnostics.o \ interpolate.o \ DistriCorrection.o \ pydistrimods.o \ pydiagmods.o \ pyintmods.o \ pyscimods.o \ pygenmods.o \ pydefmods.o \ trajectories_overlap.o \ test_Fmods.o pymods : \ module_ForDiagnostics.o \ pydistrimods.o \ pydiagmods.o \ pyintmods.o \ pyscimods.o \ pygenmods.o \ pydefmods.o NCfortran : \ module_definitions.o \ module_basic.o \ module_generic.o \ module_NCgeneric.o \ module_ForInterpolate.o \ DistriCorrection.o \ trajectories_overlap.o diags : \ module_ForDiagnostics.o clean : $(RM) *.mod *.o interpolate test_Fmods module_ForDiag.so module_ForInt.so module_ForDistriCorrect.so module_ForSci.so module_ForGen.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_ForInterpolate.o: module_definitions.o module_generic.o $(FC) $(FCFLAGS) $(LIB_INC) module_ForInterpolate.f90 module_ForDiagnosticsVars.o: module_definitions.o module_basic.o module_generic.o module_scientific.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 FCEXEFINTCFLAGS = $(FINTMODULES) $(LIB_NETCDF) $(LIB_INC) FCEXECFLAGS = $(FEXECMODULES) $(LIB_NETCDF) $(LIB_INC) FCEXECTESTFLAGS = $(FTESTMODULES) $(LIB_NETCDF) $(LIB_INC) interpolate.o: module_definitions.o module_basic.o module_generic.o module_scientific.o module_ForInterpolate.o $(FC) $(FCEXEFINTCFLAGS) 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 test_Fmods.o: module_definitions.o module_basic.o module_generic.o module_scientific.o module_ForDiagnostics.o module_ForDiagnosticsVars.o $(FC) $(FCEXECTESTFLAGS) test_Fmods.f90 -o test_Fmods pydistrimods.o: $(F2PY) -c $(F2PYF) -I$(NCINCFOLD) -m module_ForDistriCorrect $(distrisrcs) -L$(NCLIBFOLD) pydiagmods.o: $(F2PY) -c $(F2PYF) -I$(NCINCFOLD) -m module_ForDiag $(diagsrcs) -L$(NCLIBFOLD) pyintmods.o: $(F2PY) -c $(F2PYF) -I$(NCINCFOLD) -m module_ForInt $(intsrcs) -L$(NCLIBFOLD) pyscimods.o: $(F2PY) -c $(F2PYF) -I$(NCINCFOLD) -m module_ForSci $(scisrcs) -L$(NCLIBFOLD) pygenmods.o: $(F2PY) -c $(F2PYF) -I$(NCINCFOLD) -m module_ForGen $(gensrcs) -L$(NCLIBFOLD) pydefmods.o: $(F2PY) -c $(F2PYF) -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