#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ # User: Set here the F90 compiler and options # Pedefined compilers: INTEL, PGF, HPUX, LAHEY #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ #COMPILER = G95 #COMPILER = LAHEY # ---------------------------------------------------- # BOXMOX extension - Christoph Knote - 20140610 # gfortran is standard #COMPILER = INTEL # ---------------------------------------------------- #COMPILER = PGF #COMPILER = HPUX # ---------------------------------------------------- # BOXMOX extension - Christoph Knote - 20140610 # gfortran is standard COMPILER = GFORTRAN # ---------------------------------------------------- FC_G95 = g95 FOPT_G95 = -cpp -O -pg -fbounds-check -fimplicit-none -Wall -ftrace=full FC_LAHEY = lf95 # More aggressive for production runs: #FOPT_LAHEY = -Cpp --pca -O # More checking for debugging: FOPT_LAHEY = -Cpp --chk a,e,s,u --pca --ap -O0 -g --trap --trace --chkglobal FC_INTEL = ifort # More aggressive for production runs: #FOPT_INTEL = -cpp -O -fp-model precise -pc80 -prec_div # More checking for debugging: FOPT_INTEL = -cpp -O0 -fp-model strict -implicitnone -ftrapuv \ -debug all -check all -warn all FC_PGF = pgf90 # More aggressive for production runs: FOPT_PGF = -Mpreprocess -O -fast -pc 80 -Kieee # More checking for debugging: #FOPT_PGF = -Mpreprocess -O0 -Mbounds -Mchkfpstk -Mchkptr -Mchkstk \ # -Ktrap=fp -pc 80 -Kieee FC_HPUX = f90 FOPT_HPUX = -O -u +Oall +check=on FC_GFORTRAN = gfortran # ---------------------------------------------------- # BOXMOX extension - Christoph Knote - 20140610 # rate equation code creates pretty long lines # optimization does not help much and breaks MCM # FOPT_GFORTRAN = -cpp -O # double precision: #FOPT_GFORTRAN = -cpp -g -ffree-line-length-none -freal-4-real-16 -freal-8-real-16 # using GCC 4.7 and higher, its better to use: FOPT_GFORTRAN = -cpp -g -ffree-line-length-none -freal-4-real-8 # should work for most setups ###FOPT_GFORTRAN = -cpp -g -ffree-line-length-none -fdefault-real-8 # ---------------------------------------------------- # define FULL_ALGEBRA for non-sparse integration FC = $(FC_$(COMPILER)) FOPT = $(FOPT_$(COMPILER)) # -DFULL_ALGEBRA LIBS = #LIBS = -llapack -lblas # Command to create Matlab mex gateway routines # Note: use $(FC) as the mex Fortran compiler MEX = mex GENSRC = CB06_Precision.f90 \ CB06_Parameters.f90 \ CB06_Global.f90 GENOBJ = CB06_Precision.o \ CB06_Parameters.o \ CB06_Global.o FUNSRC = CB06_Function.f90 FUNOBJ = CB06_Function.o JACSRC = CB06_JacobianSP.f90 CB06_Jacobian.f90 JACOBJ = CB06_JacobianSP.o CB06_Jacobian.o # ---------------------------------------------------- # BOXMOX extension - Christoph Knote - 20160906 # if HESSIAN is off, avoid compilation errors by not # linking to the Hessian objects. ifeq ($(wildcard CB06_HessianSP.f90),) HESSRC = HESOBJ = else HESSRC = CB06_HessianSP.f90 CB06_Hessian.f90 HESOBJ = CB06_HessianSP.o CB06_Hessian.o endif # ---------------------------------------------------- STMSRC = CB06_StoichiomSP.f90 CB06_Stoichiom.f90 STMOBJ = CB06_StoichiomSP.o CB06_Stoichiom.o UTLSRC = CB06_Rates.f90 CB06_Util.f90 CB06_Monitor.f90 UTLOBJ = CB06_Rates.o CB06_Util.o CB06_Monitor.o LASRC = CB06_LinearAlgebra.f90 LAOBJ = CB06_LinearAlgebra.o STOCHSRC = CB06_Stochastic.f90 STOCHOBJ = CB06_Stochastic.o MAINSRC = CB06_Main.f90 CB06_Initialize.f90 CB06_Integrator.f90 CB06_Model.f90 MAINOBJ = CB06_Main.o CB06_Initialize.o CB06_Integrator.o CB06_Model.o #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ # User: modify the line below to include only the # objects needed by your application #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ALLOBJ = $(GENOBJ) $(FUNOBJ) $(JACOBJ) $(HESOBJ) $(STMOBJ) \ $(UTLOBJ) $(LAOBJ) #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ # User: modify the line below to include only the # executables needed by your application #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ all: exe exe: $(ALLOBJ) $(MAINOBJ) $(FC) $(FOPT) $(ALLOBJ) $(MAINOBJ) $(LIBS) -o CB06.exe stochastic:$(ALLOBJ) $(STOCHOBJ) $(MAINOBJ) $(FC) $(FOPT) $(ALLOBJ) $(STOCHOBJ) $(MAINOBJ) $(LIBS) \ -o CB06_stochastic.exe mex: $(ALLOBJ) $(MEX) FC#$(FC) -fortran -O CB06_mex_Fun.f90 $(ALLOBJ) $(MEX) FC#$(FC) -fortran -O CB06_mex_Jac_SP.f90 $(ALLOBJ) $(MEX) FC#$(FC) -fortran -O CB06_mex_Hessian.f90 $(ALLOBJ) clean: rm -f CB06*.o CB06*.mod \ CB06*.dat CB06.exe CB06*.mexglx \ CB06.map distclean: rm -f CB06*.o CB06*.mod \ CB06*.dat CB06.exe CB06.map \ CB06*.f90 CB06_*.mexglx CB06_Precision.o: CB06_Precision.f90 $(FC) $(FOPT) -c $< CB06_Parameters.o: CB06_Parameters.f90 \ CB06_Precision.o $(FC) $(FOPT) -c $< CB06_Monitor.o: CB06_Monitor.f90 \ CB06_Precision.o $(FC) $(FOPT) -c $< CB06_Global.o: CB06_Global.f90 \ CB06_Parameters.o CB06_Precision.o $(FC) $(FOPT) -c $< CB06_Initialize.o: CB06_Initialize.f90 $(GENOBJ) $(FC) $(FOPT) -c $< CB06_Function.o: CB06_Function.f90 $(GENOBJ) $(FC) $(FOPT) -c $< CB06_Stochastic.o: CB06_Stochastic.f90 $(GENOBJ) $(FC) $(FOPT) -c $< CB06_JacobianSP.o: CB06_JacobianSP.f90 $(GENOBJ) $(FC) $(FOPT) -c $< CB06_Jacobian.o: CB06_Jacobian.f90 $(GENOBJ) CB06_JacobianSP.o $(FC) $(FOPT) -c $< CB06_LinearAlgebra.o: CB06_LinearAlgebra.f90 $(GENOBJ) CB06_JacobianSP.o $(FC) $(FOPT) -c $< CB06_Rates.o: CB06_Rates.f90 $(GENOBJ) $(FC) $(FOPT) -c $< CB06_HessianSP.o: CB06_HessianSP.f90 $(GENOBJ) $(FC) $(FOPT) -c $< CB06_Hessian.o: CB06_Hessian.f90 $(GENOBJ) CB06_HessianSP.o $(FC) $(FOPT) -c $< CB06_StoichiomSP.o: CB06_StoichiomSP.f90 $(GENOBJ) $(FC) $(FOPT) -c $< CB06_Stoichiom.o: CB06_Stoichiom.f90 $(GENOBJ) CB06_StoichiomSP.o $(FC) $(FOPT) -c $< CB06_Util.o: CB06_Util.f90 $(GENOBJ) CB06_Monitor.o $(FC) $(FOPT) -c $< CB06_Main.o: CB06_Main.f90 $(ALLOBJ) CB06_Initialize.o CB06_Model.o CB06_Integrator.o $(FC) $(FOPT) -c $< CB06_Model.o: CB06_Model.f90 $(ALLOBJ) CB06_Integrator.o $(FC) $(FOPT) -c $< CB06_Integrator.o: CB06_Integrator.f90 $(ALLOBJ) $(FC) $(FOPT) -c $<