-
Notifications
You must be signed in to change notification settings - Fork 23
/
PhotoMake
446 lines (374 loc) · 12.9 KB
/
PhotoMake
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
#-*-makefile-*-
# Makefile for TOTC
#TODO
#put the flags into standard makefile syntax, so that we can run:
#make debug, make optomized, make clean, etc.
#include the include files and dependencies
#make the compiler and flag a variable (via hostname?)
###############################
# Set variables
###############################
PLATFORM = mac
# Pick your compiler here by commenting out the "wrong" compiler and uncommenting the compiler you want to use.
# The options are ifort or gfortran. You must also select the flags (FCFLAG) for the compiler you choose.
# Please see next section for implications for FCFLAG variable.
# NOTE: We use gfortran in the group leading this version of the code. If you're having
# trouble with ifort, try gfortran to see if its the compiler. If it is, get in touch and we'll help
# de-bug things. We're going to try to test with ifort more going forward.
#FC = ifort
FC = gfortran
# Pick your compiler flags here. The default is to use the "optimized" gfortran flags, which should lead to
# faster run-times. If you are having issues and know how to debug fortran, flip the debug flags on by
# uncommenting them and commenting the optimized flag. If you are using ifort, you have to choose the flags
# for that compiler the same way (uncomment those, comment others).
#
# gfortratn: optimized use (default)
FCFLAG = -O3 -fno-automatic -ftree-vectorize -fdefault-integer-8 -fdefault-real-8 -I.
# gfortran: main debugging version
#FCFLAG = -g -fno-automatic -Wuninitialized -ffpe-trap=invalid -O -ftrapv -Wall -I. -fdefault-integer-8 -fdefault-real-8
# gfortran: other debugging options
#FCFLAG = -g -fbounds-check -Wall -fbacktrace -finit-real=nan
#FCFLAG = -g -fno-automatic -ftrapv -fbounds-check -O
#FCFLAG = -g -fno-automatic -Wuninitialized -fbounds-check -O -ftrapv
# ifort: optimized use (default)
#FCFLAG = -i8 -r8 -align all -Bstatic -check all
# ifort: main debugging options - NOTE: These were ported from clima and we don't currently have an ifort licene and have been unable to test these
#FCFLAG = -i8 -r8 -debug -fp-stack-check -check-bounds -g -traceback -heap-arrays -gen-interfaces -warn interfaces -check arg_temp_created -align all -Bstatic
#FCFLAG = -r8 -i8 -debug -g -diag-enable sv-include
# Main files
MAIN =PhotoMain
EXECUTABLE = Photo.run
#CDOTOC = SUBROUTINES.o
OBJ = PHOTOCHEM/OBJECTFILES
#MATRIX = LINPACK.o
LINPACK = PHOTOCHEM/OBJECTFILES
QUADPACK = PHOTOCHEM/OBJECTFILES
INC = PHOTOCHEM/INPUTFILES
BLOK = PHOTOCHEM/DATA/INCLUDE
# Subdirectories (CAPS) and subroutines (lower case)
SUBPATH = PHOTOCHEM/SUBROUTINES
LINPATH = PHOTOCHEM/LINPACK
QUADPATH = PHOTOCHEM/QUADPACK
GRID = Photgrid
RATES = Rates
RATESHJS = RatesHJs
RAIN = Rainout
AQUO = Aqueous
PHOT = Photo
INIT = Initphoto
DENS = Densty
DIFCO = Difco
SED = Sedmnt
SAT = PhotSatrat
AERT = Aertab
OUT = Output
AERC= Aercon
DOCHEM = Dochem
CHEMPL = Chempl
LTNG = Ltning
XSEC = Xsections
NXS = newXS
YSN = Youngsun
MIE = Initmie
LNUM = Lnum
RESET = ireset
TWOSTR= Twostr
SAXPY = saxpy
SGBFA = sgbfa
SGEFA = sgefa
SGBSL = sgbsl
SGESL = sgesl
SSCAL = sscal
ISMAX = isamax
SGBCO = sgbco
SGTSL = sgtsl
SDOT = sdot
SASUM = sasum
DAXPY = daxpy
DGBFA = dgbfa
DGBCO = dgbco
DGBSL = dgbsl
DSCAL = dscal
DSUM = dasum
DDOT = ddot
IDMAX = idamax
DQK15 = dqk15
D1MACH = d1mach
#INTLIB = intlib
RAYLEI = Rayleigh
SPLINE = Spline
OBPATH = $(OBJ)/$(MAIN).o \
$(OBJ)/$(GRID).o \
$(OBJ)/$(RATES).o \
$(OBJ)/$(RATESHJS).o \
$(OBJ)/$(RAIN).o \
$(OBJ)/$(AQUO).o \
$(OBJ)/$(PHOT).o \
$(OBJ)/$(DENS).o \
$(OBJ)/$(DIFCO).o \
$(OBJ)/$(SED).o \
$(OBJ)/$(SAT).o \
$(OBJ)/$(AERT).o \
$(OBJ)/$(OUT).o \
$(OBJ)/$(AERC).o \
$(OBJ)/$(DOCHEM).o \
$(OBJ)/$(CHEMPL).o \
$(OBJ)/$(LTNG).o \
$(OBJ)/$(INIT).o \
$(OBJ)/$(XSEC).o \
$(OBJ)/$(NXS).o \
$(OBJ)/$(YSN).o \
$(OBJ)/$(MIE).o \
$(OBJ)/$(LNUM).o \
$(OBJ)/$(RESET).o \
$(OBJ)/$(TWOSTR).o \
$(OBJ)/$(RAYLEI).o \
$(OBJ)/$(SPLINE).o \
$(LINPACK)/$(SAXPY).o \
$(LINPACK)/$(DAXPY).o \
$(LINPACK)/$(SGBFA).o \
$(LINPACK)/$(DGBFA).o \
$(LINPACK)/$(SGEFA).o \
$(LINPACK)/$(SGBCO).o \
$(LINPACK)/$(SDOT).o \
$(LINPACK)/$(DGBCO).o \
$(LINPACK)/$(SGBSL).o \
$(LINPACK)/$(DGBSL).o \
$(LINPACK)/$(SGESL).o \
$(LINPACK)/$(SSCAL).o \
$(LINPACK)/$(DSCAL).o \
$(LINPACK)/$(SASUM).o \
$(LINPACK)/$(DSUM).o \
$(LINPACK)/$(DDOT).o \
$(LINPACK)/$(ISMAX).o \
$(LINPACK)/$(IDMAX).o \
$(LINPACK)/$(SGTSL).o
# $(QUADPACK)/$(INTLIB).o
INCALL = $(BLOK)/ABLOK.inc \
$(BLOK)/BBLOK.inc \
$(BLOK)/CBLOK.inc \
$(BLOK)/DBLOK.inc \
$(BLOK)/EBLOK.inc \
$(BLOK)/FBLOK.inc \
$(BLOK)/GBLOK.inc \
$(BLOK)/JBLOK.inc \
$(BLOK)/NBLOK.inc \
$(BLOK)/MBLOK.inc \
$(BLOK)/RBLOK.inc \
$(BLOK)/SBLOK.inc \
$(BLOK)/ZBLOK.inc \
$(BLOK)/LTBLOK.inc \
$(BLOK)/AERBLK.inc \
$(BLOK)/SULBLK.inc \
$(BLOK)/PBLOK.inc \
$(BLOK)/QBLOK.inc \
$(BLOK)/RRATS.inc \
$(BLOK)/SATBLK.inc \
$(BLOK)/WBLOK.inc \
$(INC)/parameters.inc
###############################
# Load line
###############################
$(EXECUTABLE) : $(OBPATH) $(INCALL)
$(FC) $(FCFLAG) -o $(EXECUTABLE) $(OBPATH)
###############################
# Object compile lines
###############################
$(OBJ)/$(MAIN).o : $(MAIN).f $(INCALL)
$(FC) $(FCFLAG) -c $(MAIN).f
mv $(MAIN).o $(OBJ)
$(OBJ)/$(GRID).o : $(SUBPATH)/$(GRID).f $(INC)/parameters.inc \
$(BLOK)/PHOTABLOK.inc $(BLOK)/QBLOK.inc
$(FC) $(FCFLAG) -c $(SUBPATH)/$(GRID).f
mv $(GRID).o $(OBJ)
$(OBJ)/$(RATES).o : $(SUBPATH)/$(RATES).f $(INC)/parameters.inc \
$(BLOK)/PHOTABLOK.inc $(BLOK)/RBLOK.inc
$(FC) $(FCFLAG) -c $(SUBPATH)/$(RATES).f
mv $(RATES).o $(OBJ)
$(OBJ)/$(RATESHJS).o : $(SUBPATH)/$(RATESHJS).f $(INC)/parameters.inc \
$(BLOK)/PHOTABLOK.inc $(BLOK)/RBLOK.inc
$(FC) $(FCFLAG) -c $(SUBPATH)/$(RATESHJS).f
mv $(RATESHJS).o $(OBJ)
$(OBJ)/$(RAIN).o : $(SUBPATH)/$(RAIN).f $(INC)/parameters.inc \
$(BLOK)/PHOTABLOK.inc $(BLOK)/BBLOK.inc \
$(BLOK)/DBLOK.inc $(BLOK)/GBLOK.inc \
$(BLOK)/NBLOK.inc $(BLOK)/WBLOK.inc
$(FC) $(FCFLAG) -c $(SUBPATH)/$(RAIN).f
mv $(RAIN).o $(OBJ)
$(OBJ)/$(AQUO).o : $(SUBPATH)/$(AQUO).f $(INC)/parameters.inc \
$(BLOK)/WBLOK.inc
$(FC) $(FCFLAG) -c $(SUBPATH)/$(AQUO).f
mv $(AQUO).o $(OBJ)
$(OBJ)/$(PHOT).o : $(SUBPATH)/$(PHOT).f $(INC)/parameters.inc \
$(BLOK)/PHOTABLOK.inc $(BLOK)/CBLOK.inc \
$(BLOK)/JBLOK.inc $(BLOK)/QBLOK.inc \
$(BLOK)/RBLOK.inc $(BLOK)/SBLOK.inc \
$(BLOK)/DBLOK.inc $(BLOK)/MBLOK.inc
$(FC) $(FCFLAG) -c $(SUBPATH)/$(PHOT).f
mv $(PHOT).o $(OBJ)
$(OBJ)/$(DENS).o : $(SUBPATH)/$(DENS).f $(INC)/parameters.inc \
$(BLOK)/PHOTABLOK.inc
$(FC) $(FCFLAG) -c $(SUBPATH)/$(DENS).f
mv $(DENS).o $(OBJ)
$(OBJ)/$(DIFCO).o : $(SUBPATH)/$(DIFCO).f $(INC)/parameters.inc \
$(BLOK)/PHOTABLOK.inc $(BLOK)/AERBLK.inc \
$(BLOK)/CBLOK.inc
$(FC) $(FCFLAG) -c $(SUBPATH)/$(DIFCO).f
mv $(DIFCO).o $(OBJ)
$(OBJ)/$(SED).o : $(SUBPATH)/$(SED).f $(INC)/parameters.inc \
$(BLOK)/PHOTABLOK.inc $(BLOK)/GBLOK.inc \
$(BLOK)/NBLOK.inc $(BLOK)/AERBLK.inc \
$(BLOK)/CBLOK.inc
$(FC) $(FCFLAG) -c $(SUBPATH)/$(SED).f
mv $(SED).o $(OBJ)
$(OBJ)/$(SAT).o : $(SUBPATH)/$(SAT).f $(INC)/parameters.inc \
$(BLOK)/PHOTABLOK.inc $(BLOK)/SATBLK.inc
$(FC) $(FCFLAG) -c $(SUBPATH)/$(SAT).f
mv $(SAT).o $(OBJ)
$(OBJ)/$(AERT).o : $(SUBPATH)/$(AERT).f $(INC)/parameters.inc \
$(BLOK)/PHOTABLOK.inc $(BLOK)/SULBLK.inc \
$(BLOK)/AERBLK.inc
$(FC) $(FCFLAG) -c $(SUBPATH)/$(AERT).f
mv $(AERT).o $(OBJ)
$(OBJ)/$(OUT).o : $(SUBPATH)/$(OUT).f $(INC)/parameters.inc \
$(BLOK)/PHOTABLOK.inc $(BLOK)/BBLOK.inc \
$(BLOK)/CBLOK.inc $(BLOK)/DBLOK.inc \
$(BLOK)/FBLOK.inc $(BLOK)/GBLOK.inc \
$(BLOK)/JBLOK.inc $(BLOK)/NBLOK.inc \
$(BLOK)/RBLOK.inc $(BLOK)/SBLOK.inc \
$(BLOK)/WBLOK.inc $(BLOK)/ZBLOK.inc \
$(BLOK)/SATBLK.inc $(BLOK)/SULBLK.inc \
$(BLOK)/AERBLK.inc $(BLOK)/RRATS.inc \
$(BLOK)/QBLOK.inc $(BLOK)/MBLOK.inc
$(FC) $(FCFLAG) -c $(SUBPATH)/$(OUT).f
mv $(OUT).o $(OBJ)
$(OBJ)/$(AERC).o : $(SUBPATH)/$(AERC).f $(INC)/parameters.inc \
$(BLOK)/PHOTABLOK.inc $(BLOK)/SATBLK.inc \
$(BLOK)/SULBLK.inc
$(FC) $(FCFLAG) -c $(SUBPATH)/$(AERC).f
mv $(AERC).o $(OBJ)
$(OBJ)/$(DOCHEM).o : $(SUBPATH)/$(DOCHEM).f $(INC)/parameters.inc \
$(BLOK)/PHOTABLOK.inc $(BLOK)/BBLOK.inc \
$(BLOK)/CBLOK.inc $(BLOK)/DBLOK.inc \
$(BLOK)/GBLOK.inc $(BLOK)/NBLOK.inc \
$(BLOK)/RBLOK.inc $(BLOK)/ZBLOK.inc \
$(BLOK)/LTBLOK.inc $(BLOK)/SATBLK.inc \
$(BLOK)/SULBLK.inc $(BLOK)/RRATS.inc
$(FC) $(FCFLAG) -c $(SUBPATH)/$(DOCHEM).f
mv $(DOCHEM).o $(OBJ)
$(OBJ)/$(CHEMPL).o : $(SUBPATH)/$(CHEMPL).f $(INC)/parameters.inc \
$(BLOK)/RBLOK.inc
$(FC) $(FCFLAG) -c $(SUBPATH)/$(CHEMPL).f
mv $(CHEMPL).o $(OBJ)
$(OBJ)/$(LTNG).o : $(SUBPATH)/$(LTNG).f $(INC)/parameters.inc \
$(BLOK)/BBLOK.inc $(BLOK)/LTBLOK.inc \
$(BLOK)/NBLOK.inc $(BLOK)/PHOTABLOK.inc
$(FC) $(FCFLAG) -c $(SUBPATH)/$(LTNG).f
mv $(LTNG).o $(OBJ)
$(OBJ)/$(INIT).o : $(SUBPATH)/$(INIT).f $(INC)/parameters.inc \
$(BLOK)/PHOTABLOK.inc $(BLOK)/QBLOK.inc \
$(BLOK)/JBLOK.inc $(BLOK)/DBLOK.inc \
$(BLOK)/MBLOK.inc
$(FC) $(FCFLAG) -c $(SUBPATH)/$(INIT).f
mv $(INIT).o $(OBJ)
$(OBJ)/$(XSEC).o : $(SUBPATH)/$(XSEC).f $(INC)/parameters.inc \
$(BLOK)/QBLOK.inc $(BLOK)/PBLOK.inc
$(FC) $(FCFLAG) -c $(SUBPATH)/$(XSEC).f
mv $(XSEC).o $(OBJ)
$(OBJ)/$(NXS).o : $(SUBPATH)/$(NXS).f $(INC)/parameters.inc \
$(BLOK)/QBLOK.inc $(BLOK)/PBLOK.inc
$(FC) $(FCFLAG) -c $(SUBPATH)/$(NXS).f
mv $(NXS).o $(OBJ)
$(OBJ)/$(YSN).o : $(SUBPATH)/$(YSN).f $(INC)/parameters.inc
$(FC) $(FCFLAG) -c $(SUBPATH)/$(YSN).f
mv $(YSN).o $(OBJ)
$(OBJ)/$(MIE).o : $(SUBPATH)/$(MIE).f $(INC)/parameters.inc \
$(BLOK)/MBLOK.inc
$(FC) $(FCFLAG) -c $(SUBPATH)/$(MIE).f
mv $(MIE).o $(OBJ)
$(OBJ)/$(LNUM).o : $(SUBPATH)/$(LNUM).f $(INC)/parameters.inc \
$(BLOK)/NBLOK.inc
$(FC) $(FCFLAG) -c $(SUBPATH)/$(LNUM).f
mv $(LNUM).o $(OBJ)
$(OBJ)/$(RESET).o : $(SUBPATH)/$(RESET).f
$(FC) $(FCFLAG) -c $(SUBPATH)/$(RESET).f
mv $(RESET).o $(OBJ)
$(OBJ)/$(TWOSTR).o : $(SUBPATH)/$(TWOSTR).f $(INC)/parameters.inc \
$(BLOK)/PHOTABLOK.inc $(BLOK)/CBLOK.inc \
$(BLOK)/AERBLK.inc $(BLOK)/MBLOK.inc
$(FC) $(FCFLAG) -c $(SUBPATH)/$(TWOSTR).f
mv $(TWOSTR).o $(OBJ)
$(OBJ)/$(RAYLEI).o : $(SUBPATH)/$(RAYLEI).f $(INC)/parameters.inc
$(FC) $(FCFLAG) -c $(SUBPATH)/$(RAYLEI).f
mv $(RAYLEI).o $(OBJ)
$(OBJ)/$(SPLINE).o : $(SUBPATH)/$(SPLINE).f
$(FC) $(FCFLAG) -c $(SUBPATH)/$(SPLINE).f
mv $(SPLINE).o $(OBJ)
$(LINPACK)/$(SAXPY).o : $(LINPATH)/$(SAXPY).f
$(FC) $(FCFLAG) -c $(LINPATH)/$(SAXPY).f
mv $(SAXPY).o $(LINPACK)
$(LINPACK)/$(DAXPY).o : $(LINPATH)/$(DAXPY).f
$(FC) $(FCFLAG) -c $(LINPATH)/$(DAXPY).f
mv $(DAXPY).o $(LINPACK)
$(LINPACK)/$(SGBFA).o : $(LINPATH)/$(SGBFA).f
$(FC) $(FCFLAG) -c $(LINPATH)/$(SGBFA).f
mv $(SGBFA).o $(LINPACK)
$(LINPACK)/$(DGBFA).o : $(LINPATH)/$(DGBFA).f
$(FC) $(FCFLAG) -c $(LINPATH)/$(DGBFA).f
mv $(DGBFA).o $(LINPACK)
$(LINPACK)/$(SGEFA).o : $(LINPATH)/$(SGEFA).f
$(FC) $(FCFLAG) -c $(LINPATH)/$(SGEFA).f
mv $(SGEFA).o $(LINPACK)
$(LINPACK)/$(SGBCO).o : $(LINPATH)/$(SGBCO).f
$(FC) $(FCFLAG) -c $(LINPATH)/$(SGBCO).f
mv $(SGBCO).o $(LINPACK)
$(LINPACK)/$(DGBCO).o : $(LINPATH)/$(DGBCO).f
$(FC) $(FCFLAG) -c $(LINPATH)/$(DGBCO).f
mv $(DGBCO).o $(LINPACK)
$(LINPACK)/$(SGBSL).o : $(LINPATH)/$(SGBSL).f
$(FC) $(FCFLAG) -c $(LINPATH)/$(SGBSL).f
mv $(SGBSL).o $(LINPACK)
$(LINPACK)/$(DGBSL).o : $(LINPATH)/$(DGBSL).f
$(FC) $(FCFLAG) -c $(LINPATH)/$(DGBSL).f
mv $(DGBSL).o $(LINPACK)
$(LINPACK)/$(SGESL).o : $(LINPATH)/$(SGESL).f
$(FC) $(FCFLAG) -c $(LINPATH)/$(SGESL).f
mv $(SGESL).o $(LINPACK)
$(LINPACK)/$(SSCAL).o : $(LINPATH)/$(SSCAL).f
$(FC) $(FCFLAG) -c $(LINPATH)/$(SSCAL).f
mv $(SSCAL).o $(LINPACK)
$(LINPACK)/$(DSCAL).o : $(LINPATH)/$(DSCAL).f
$(FC) $(FCFLAG) -c $(LINPATH)/$(DSCAL).f
mv $(DSCAL).o $(LINPACK)
$(LINPACK)/$(SDOT).o : $(LINPATH)/$(SDOT).f
$(FC) $(FCFLAG) -c $(LINPATH)/$(SDOT).f
mv $(SDOT).o $(LINPACK)
$(LINPACK)/$(SASUM).o : $(LINPATH)/$(SASUM).f
$(FC) $(FCFLAG) -c $(LINPATH)/$(SASUM).f
mv $(SASUM).o $(LINPACK)
$(LINPACK)/$(DSUM).o : $(LINPATH)/$(DSUM).f
$(FC) $(FCFLAG) -c $(LINPATH)/$(DSUM).f
mv $(DSUM).o $(LINPACK)
$(LINPACK)/$(DDOT).o : $(LINPATH)/$(DDOT).f
$(FC) $(FCFLAG) -c $(LINPATH)/$(DDOT).f
mv $(DDOT).o $(LINPACK)
$(LINPACK)/$(ISMAX).o : $(LINPATH)/$(ISMAX).f
$(FC) $(FCFLAG) -c $(LINPATH)/$(ISMAX).f
mv $(ISMAX).o $(LINPACK)
$(LINPACK)/$(IDMAX).o : $(LINPATH)/$(IDMAX).f
$(FC) $(FCFLAG) -c $(LINPATH)/$(IDMAX).f
mv $(IDMAX).o $(LINPACK)
$(LINPACK)/$(SGTSL).o : $(LINPATH)/$(SGTSL).f
$(FC) $(FCFLAG) -c $(LINPATH)/$(SGTSL).f
mv $(SGTSL).o $(LINPACK)
#$(QUADPACK)/$(INTLIB).o : $(QUADPATH)/$(INTLIB).f90
# $(FC) $(FCFLAG) -c $(QUADPATH)/$(INTLIB).f90
# mv $(INTLIB).o $(QUADPACK)
clean :
rm $(OBJ)/*.o
rm $(EXECUTABLE)
conclude :
@echo
@echo '================='
@echo ' Makefile done'
@echo '================='