# L. Fita, LMD. October 2016 # Compilation of all required Fortran modules in `curie' with intel compilers # A following python 'library' creation is required # FOLLOWING: http://stackoverflow.com/questions/17156125/f2py-exposing-parameters-from-used-modules # FOLLOWING: http://osdir.com/ml/python.f2py.user/2006-08/msg00019.html # module load intel/14.0.3.174 # module load python/2.7.3 # module load netcdf/4.2_hdf5 # 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 --fcompiler=intelem 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 --fcompiler=intelem module_ForInt.pyf module_generic.f90 module_ForInterpolate.f90 >& run_f2py_ForInt_compile.log # FC = /opt/intel/14.0.3.174/bin/intel64/ifort FCFLAGS = -c -fPIC LIB_INC = RM = rm -f #DBGFLAGS = -g -check all -fpe0 -warn -traceback -debug extended NCFOLD = /ccc/products/netcdf-4.2_hdf5/default/ LIB_NETCDF = -L$(NCFOLD)/lib -lnetcdff -lnetcdf -I$(NCFOLD)/include FCFLAGS = $(FCF) $(DBGFLAGS) # Sources for f2py distrisrcs = module_definitions.f90 module_generic.f90 module_scientific.f90 module_DistriCorrection.f90 diagsrcs = module_definitions.f90 module_generic.f90 module_scientific.f90 module_ForDiagnosticsVars.f90 module_ForDiagnostics.f90 intsrcs = module_definitions.f90 module_generic.f90 module_scientific.f90 module_ForInterpolate.f90 ####### ###### ##### #### ### ## # MODULES = \ module_definitions.o \ module_scientific.o \ module_generic.o \ module_ForDiagnosticsVars.o \ module_ForDiagnostics.o \ module_DistriCorrection.o all : \ module_ForDiagnostics.o \ DistriCorrection.o \ interpolate.o \ pydistrimods.o \ pydiagmods.o \ pyintmods.o diags : \ module_ForDiagnostics.o clean : $(RM) *.mod *.o interpolate module_ForDiag.so module_ForInt.so module_ForDistriCorrect.so ######## ####### ## ######## module_definitions.o: $(FC) $(FCFLAGS) module_definitions.f90 module_generic.o: module_definitions.o $(FC) $(FCFLAGS) $(LIB_NETCDF) $(LIB_INC) module_generic.f90 module_scientific.o: module_definitions.o module_generic.o $(FC) $(FCFLAGS) module_scientific.f90 module_ForDiagnosticsVars.o: module_definitions.o module_generic.o $(FC) $(FCFLAGS) $(LIB_INC) module_ForDiagnosticsVars.f90 module_ForDiagnostics.o: module_definitions.o module_generic.o module_ForDiagnosticsVars.o $(FC) $(FCFLAGS) $(LIB_INC) module_ForDiagnostics.f90 module_DistriCorrection.o: module_definitions.o module_generic.o module_scientific.o $(FC) $(FCFLAGS) $(LIB_NETCDF) module_DistriCorrection.f90 FCEXECFLAGS = $(MODULES) $(LIB_NETCDF) $(LIB_INC) interpolate.o: module_definitions.o module_generic.o module_scientific.o $(FC) $(FCEXECFLAGS) interpolate.f90 -o interpolate DistriCorrection.o: module_definitions.o module_generic.o module_scientific.o module_DistriCorrection.o $(FC) $(FCEXECFLAGS) DistriCorrection.f90 -o DistriCorrection pydistrimods.o: f2py -c -m module_ForDistriCorrect $(distrisrcs) pydiagmods.o: f2py -c -m module_ForDiag $(diagsrcs) pyintmods.o: f2py -c -m module_ForInt $(intsrcs)