1 | #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
---|
2 | # User: Set here the F90 compiler and options |
---|
3 | # Pedefined compilers: INTEL, PGF, HPUX, LAHEY |
---|
4 | #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
---|
5 | |
---|
6 | #COMPILER = G95 |
---|
7 | #COMPILER = LAHEY |
---|
8 | COMPILER = INTEL |
---|
9 | #COMPILER = PGF |
---|
10 | #COMPILER = HPUX |
---|
11 | #COMPILER = GFORTRAN |
---|
12 | |
---|
13 | FC_G95 = g95 |
---|
14 | FOPT_G95 = -cpp -O -pg -fbounds-check -fimplicit-none -Wall -ftrace=full |
---|
15 | |
---|
16 | FC_LAHEY = lf95 |
---|
17 | # More aggressive for production runs: |
---|
18 | #FOPT_LAHEY = -Cpp --pca -O |
---|
19 | # More checking for debugging: |
---|
20 | FOPT_LAHEY = -Cpp --chk a,e,s,u --pca --ap -O0 -g --trap --trace --chkglobal |
---|
21 | |
---|
22 | FC_INTEL = ifort |
---|
23 | # More aggressive for production runs: |
---|
24 | #FOPT_INTEL = -cpp -O -fp-model precise -pc80 -prec_div |
---|
25 | # More checking for debugging: |
---|
26 | FOPT_INTEL = -cpp -O0 -fp-model strict -implicitnone -ftrapuv \ |
---|
27 | -debug all -check all -warn all |
---|
28 | |
---|
29 | FC_PGF = pgf90 |
---|
30 | # More aggressive for production runs: |
---|
31 | FOPT_PGF = -Mpreprocess -O -fast -pc 80 -Kieee |
---|
32 | # More checking for debugging: |
---|
33 | #FOPT_PGF = -Mpreprocess -O0 -Mbounds -Mchkfpstk -Mchkptr -Mchkstk \ |
---|
34 | # -Ktrap=fp -pc 80 -Kieee |
---|
35 | |
---|
36 | FC_HPUX = f90 |
---|
37 | FOPT_HPUX = -O -u +Oall +check=on |
---|
38 | |
---|
39 | FC_GFORTRAN = gfortran |
---|
40 | FOPT_GFORTRAN = -cpp -O |
---|
41 | |
---|
42 | # define FULL_ALGEBRA for non-sparse integration |
---|
43 | FC = $(FC_$(COMPILER)) |
---|
44 | FOPT = $(FOPT_$(COMPILER)) # -DFULL_ALGEBRA |
---|
45 | |
---|
46 | LIBS = |
---|
47 | #LIBS = -llapack -lblas |
---|
48 | |
---|
49 | # Command to create Matlab mex gateway routines |
---|
50 | # Note: use $(FC) as the mex Fortran compiler |
---|
51 | MEX = mex |
---|
52 | |
---|
53 | GENSRC = KPP_ROOT_Precision.f90 \ |
---|
54 | KPP_ROOT_Parameters.f90 \ |
---|
55 | KPP_ROOT_Global.f90 |
---|
56 | |
---|
57 | GENOBJ = KPP_ROOT_Precision.o \ |
---|
58 | KPP_ROOT_Parameters.o \ |
---|
59 | KPP_ROOT_Global.o |
---|
60 | |
---|
61 | FUNSRC = KPP_ROOT_Function.f90 |
---|
62 | FUNOBJ = KPP_ROOT_Function.o |
---|
63 | |
---|
64 | JACSRC = KPP_ROOT_JacobianSP.f90 KPP_ROOT_Jacobian.f90 |
---|
65 | JACOBJ = KPP_ROOT_JacobianSP.o KPP_ROOT_Jacobian.o |
---|
66 | |
---|
67 | HESSRC = KPP_ROOT_HessianSP.f90 KPP_ROOT_Hessian.f90 |
---|
68 | HESOBJ = KPP_ROOT_HessianSP.o KPP_ROOT_Hessian.o |
---|
69 | |
---|
70 | STMSRC = KPP_ROOT_StoichiomSP.f90 KPP_ROOT_Stoichiom.f90 |
---|
71 | STMOBJ = KPP_ROOT_StoichiomSP.o KPP_ROOT_Stoichiom.o |
---|
72 | |
---|
73 | UTLSRC = KPP_ROOT_Rates.f90 KPP_ROOT_Util.f90 KPP_ROOT_Monitor.f90 |
---|
74 | UTLOBJ = KPP_ROOT_Rates.o KPP_ROOT_Util.o KPP_ROOT_Monitor.o |
---|
75 | |
---|
76 | LASRC = KPP_ROOT_LinearAlgebra.f90 |
---|
77 | LAOBJ = KPP_ROOT_LinearAlgebra.o |
---|
78 | |
---|
79 | STOCHSRC = KPP_ROOT_Stochastic.f90 |
---|
80 | STOCHOBJ = KPP_ROOT_Stochastic.o |
---|
81 | |
---|
82 | MAINSRC = KPP_ROOT_Main.f90 KPP_ROOT_Initialize.f90 KPP_ROOT_Integrator.f90 KPP_ROOT_Model.f90 |
---|
83 | MAINOBJ = KPP_ROOT_Main.o KPP_ROOT_Initialize.o KPP_ROOT_Integrator.o KPP_ROOT_Model.o |
---|
84 | |
---|
85 | #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
---|
86 | # User: modify the line below to include only the |
---|
87 | # objects needed by your application |
---|
88 | #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
---|
89 | ALLOBJ = $(GENOBJ) $(FUNOBJ) $(JACOBJ) $(HESOBJ) $(STMOBJ) \ |
---|
90 | $(UTLOBJ) $(LAOBJ) |
---|
91 | |
---|
92 | #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
---|
93 | # User: modify the line below to include only the |
---|
94 | # executables needed by your application |
---|
95 | #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
---|
96 | all: exe |
---|
97 | |
---|
98 | exe: $(ALLOBJ) $(MAINOBJ) |
---|
99 | $(FC) $(FOPT) $(ALLOBJ) $(MAINOBJ) $(LIBS) -o KPP_ROOT.exe |
---|
100 | |
---|
101 | stochastic:$(ALLOBJ) $(STOCHOBJ) $(MAINOBJ) |
---|
102 | $(FC) $(FOPT) $(ALLOBJ) $(STOCHOBJ) $(MAINOBJ) $(LIBS) \ |
---|
103 | -o KPP_ROOT_stochastic.exe |
---|
104 | |
---|
105 | mex: $(ALLOBJ) |
---|
106 | $(MEX) FC#$(FC) -fortran -O KPP_ROOT_mex_Fun.f90 $(ALLOBJ) |
---|
107 | $(MEX) FC#$(FC) -fortran -O KPP_ROOT_mex_Jac_SP.f90 $(ALLOBJ) |
---|
108 | $(MEX) FC#$(FC) -fortran -O KPP_ROOT_mex_Hessian.f90 $(ALLOBJ) |
---|
109 | |
---|
110 | clean: |
---|
111 | rm -f KPP_ROOT*.o KPP_ROOT*.mod \ |
---|
112 | KPP_ROOT*.dat KPP_ROOT.exe KPP_ROOT*.mexglx \ |
---|
113 | KPP_ROOT.map |
---|
114 | |
---|
115 | distclean: |
---|
116 | rm -f KPP_ROOT*.o KPP_ROOT*.mod \ |
---|
117 | KPP_ROOT*.dat KPP_ROOT.exe KPP_ROOT.map \ |
---|
118 | KPP_ROOT*.f90 KPP_ROOT_*.mexglx |
---|
119 | |
---|
120 | KPP_ROOT_Precision.o: KPP_ROOT_Precision.f90 |
---|
121 | $(FC) $(FOPT) -c $< |
---|
122 | |
---|
123 | KPP_ROOT_Parameters.o: KPP_ROOT_Parameters.f90 \ |
---|
124 | KPP_ROOT_Precision.o |
---|
125 | $(FC) $(FOPT) -c $< |
---|
126 | |
---|
127 | KPP_ROOT_Monitor.o: KPP_ROOT_Monitor.f90 \ |
---|
128 | KPP_ROOT_Precision.o |
---|
129 | $(FC) $(FOPT) -c $< |
---|
130 | |
---|
131 | KPP_ROOT_Global.o: KPP_ROOT_Global.f90 \ |
---|
132 | KPP_ROOT_Parameters.o KPP_ROOT_Precision.o |
---|
133 | $(FC) $(FOPT) -c $< |
---|
134 | |
---|
135 | KPP_ROOT_Initialize.o: KPP_ROOT_Initialize.f90 $(GENOBJ) |
---|
136 | $(FC) $(FOPT) -c $< |
---|
137 | |
---|
138 | KPP_ROOT_Function.o: KPP_ROOT_Function.f90 $(GENOBJ) |
---|
139 | $(FC) $(FOPT) -c $< |
---|
140 | |
---|
141 | KPP_ROOT_Stochastic.o: KPP_ROOT_Stochastic.f90 $(GENOBJ) |
---|
142 | $(FC) $(FOPT) -c $< |
---|
143 | |
---|
144 | KPP_ROOT_JacobianSP.o: KPP_ROOT_JacobianSP.f90 $(GENOBJ) |
---|
145 | $(FC) $(FOPT) -c $< |
---|
146 | |
---|
147 | KPP_ROOT_Jacobian.o: KPP_ROOT_Jacobian.f90 $(GENOBJ) KPP_ROOT_JacobianSP.o |
---|
148 | $(FC) $(FOPT) -c $< |
---|
149 | |
---|
150 | KPP_ROOT_LinearAlgebra.o: KPP_ROOT_LinearAlgebra.f90 $(GENOBJ) KPP_ROOT_JacobianSP.o |
---|
151 | $(FC) $(FOPT) -c $< |
---|
152 | |
---|
153 | KPP_ROOT_Rates.o: KPP_ROOT_Rates.f90 $(GENOBJ) |
---|
154 | $(FC) $(FOPT) -c $< |
---|
155 | |
---|
156 | KPP_ROOT_HessianSP.o: KPP_ROOT_HessianSP.f90 $(GENOBJ) |
---|
157 | $(FC) $(FOPT) -c $< |
---|
158 | |
---|
159 | KPP_ROOT_Hessian.o: KPP_ROOT_Hessian.f90 $(GENOBJ) KPP_ROOT_HessianSP.o |
---|
160 | $(FC) $(FOPT) -c $< |
---|
161 | |
---|
162 | KPP_ROOT_StoichiomSP.o: KPP_ROOT_StoichiomSP.f90 $(GENOBJ) |
---|
163 | $(FC) $(FOPT) -c $< |
---|
164 | |
---|
165 | KPP_ROOT_Stoichiom.o: KPP_ROOT_Stoichiom.f90 $(GENOBJ) KPP_ROOT_StoichiomSP.o |
---|
166 | $(FC) $(FOPT) -c $< |
---|
167 | |
---|
168 | KPP_ROOT_Util.o: KPP_ROOT_Util.f90 $(GENOBJ) KPP_ROOT_Monitor.o |
---|
169 | $(FC) $(FOPT) -c $< |
---|
170 | |
---|
171 | KPP_ROOT_Main.o: KPP_ROOT_Main.f90 $(ALLOBJ) KPP_ROOT_Initialize.o KPP_ROOT_Model.o KPP_ROOT_Integrator.o |
---|
172 | $(FC) $(FOPT) -c $< |
---|
173 | |
---|
174 | KPP_ROOT_Model.o: KPP_ROOT_Model.f90 $(ALLOBJ) KPP_ROOT_Integrator.o |
---|
175 | $(FC) $(FOPT) -c $< |
---|
176 | |
---|
177 | KPP_ROOT_Integrator.o: KPP_ROOT_Integrator.f90 $(ALLOBJ) |
---|
178 | $(FC) $(FOPT) -c $< |
---|