# L. Fita, LMD. October 2016 # Compilation of all required Fortran modules in `ciclad' with gcc 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 python/2.7.6-canopy-1.3 # 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 -L/opt/canopy-1.3.0/Canopy_64bit/System/lib/ -L/usr/lib64/ -L/opt/canopy-1.3.0/Canopy_64bit/System/lib/ -m module_ForDiag -c --fcompiler=gnu95 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 -L/opt/canopy-1.3.0/Canopy_64bit/System/lib/ -L/usr/lib64/ -L/opt/canopy-1.3.0/Canopy_64bit/System/lib/ -m module_ForInt -c --fcompiler=gnu95 module_ForInt.pyf module_generic.f90 module_ForInterpolate.f90 >& run_f2py_ForInt_compile.log # FC = gfortran FCFLAGS = -c -fPIC LIB_INC = -L/opt/canopy-1.3.0/Canopy_64bit/System/lib/ -L/usr/lib64/ -L/opt/canopy-1.3.0/Canopy_64bit/System/lib/ RM = rm -f NCFOLD = /usr LIB_NETCDF = -L$(NCFOLD)/lib -lnetcdff -lnetcdf -I$(NCFOLD)/include ####### ###### ##### #### ### ## # MODULES = \ module_generic.o all : \ interpolate.o \ module_ForDiagnostics.o diags : \ module_ForDiagnostics.o clean : $(RM) *.mod *.o interpolate ######## ####### ## ######## module_generic.o: $(FC) $(FCFLAGS) $(LIB_NETCDF) $(LIB_INC) module_generic.f90 module_ForDiagnosticsVars.o: module_generic.o $(FC) $(FCFLAGS) $(LIB_INC) module_ForDiagnosticsVars.f90 module_ForDiagnostics.o: module_generic.o module_ForDiagnosticsVars.o $(FC) $(FCFLAGS) $(LIB_INC) module_ForDiagnostics.f90 FCEXECFLAGS = $(MODULES) $(LIB_NETCDF) $(LIB_INC) interpolate.o: module_generic.o $(FC) $(FCEXECFLAGS) interpolate.f90 -o interpolate