-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathMakefile.fix_ioapi_lib_path_local
416 lines (318 loc) · 13 KB
/
Makefile.fix_ioapi_lib_path_local
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
#
#.........................................................................
# Version "$Id: Makefile.nocpl 146 2020-03-25 18:03:32Z coats $"
# EDSS/Models-3 M3TOOLS
# (C) 1992-2002 MCNC and Carlie J. Coats, Jr.,
# (C) 2003-2004 by Baron Advanced Meteorological Systems,
# (C) 2005-2014, 2017 Carlie J. Coats, Jr., and
# (C) 2014-2016 UNC Institute for the Environment
# Distributed under the GNU GENERAL PUBLIC LICENSE version 2
# See file "GPL.txt" for conditions of use.
#.........................................................................
# Makefile for No-Couple version of M3Tools
# Note that I/O API must also have been built for No-Couple
#.........................................................................
# Environment Variables:
# BIN machine/OS/compiler/mode type. Shows up as suffix
# for "Makeinclude.${BIN}" to determine compilation
# flags, and in ${OBJDIR} and $(INSTALL) to determine
# binary directories
# INSTALL installation-directory root, used for "make install":
# "libioapi.a" and the tool executables will be installed
# in $(INSTALL)/${BIN}
#.........................................................................
# Directories:
# ${BASEDIR} is the root directory for the I/O API library source,
# the M3Tools and M3Test source,the HTML documentation,
# and the (machine/compiler/flag-specific) binary
# object/library/executable directories.
# $(SRCDIR) is the source directory for the M3TOOLS
# $(IODIR) is the source directory for the I/O API library
# ${OBJDIR} is the current machine/compiler/flag-specific
# build-directory
# $(F90DIR) is the current machine/compiler/flag-specific
# build-directory for F90-based programs (SGI & Sun)
#.........................................................................
#
# --------------- Definitions: -------------------------
.SUFFIXES: .m4 .c .F .f .f90 .F90
BASEDIR = ${HOME}/ioapi-3.2
SRCDIR = ${BASEDIR}/m3tools
IODIR = ${BASEDIR}/ioapi
OBJDIR = ${BASEDIR}/${BIN}
INSTDIR = ${INSTALL}/${BIN}
# Architecture dependent stuff
# Assumes FC is an f90
include $(IODIR)/Makeinclude.${BIN}
FFLAGS = -I$(IODIR) ${MODI}$(OBJDIR) $(ARCHFLAGS) $(FOPTFLAGS) $(ARCHFLAGS)
LDFLAGS = -I$(IODIR) $(DEFINEFLAGS) $(ARCHFLAGS)
# Incompatibility between netCDF versions before / after v4.1.1:
# For netCDF v4 and later, you may also need the extra libraries
# given by netCDF commands
#
# nc-config --libs
# nf-config --libs
#
# Cygwin libraries need "-lnetcdff.dll -lnetcdf.dll" below
#
LIBS = -L${OBJDIR} -lioapi -L${HOME}/netcdf/lib -lnetcdff -lnetcdf $(OMPLIBS) $(ARCHLIB) $(ARCHLIBS)
#LIBS = -L${OBJDIR} -lioapi -lnetcdf $(OMPLIBS) $(ARCHLIB) $(ARCHLIBS)
#LIBS = -L${OBJDIR} -lioapi `nf-config --libs` `nc-config --libs` $(OMPLIBS) $(ARCHLIB) $(ARCHLIBS)
VPATH = ${OBJDIR}
fSRC = \
agmask.f agmax.f airnow2m3.f airs2m3.f cdiffstep.f \
diffstep.f kfxtract.f m3agmask.f m3agmax.f m3combo.f \
m3cple.f m3diff.f m3edhdr.f m3hdr.f m3interp.f \
m3merge.f m3pair.f m3stat.f m3xtract.f mtxblend.f \
mtxbuild.f mtxcple.f presterp.f projtool.f selmrg2d.f \
statb.f statbdry.f statc.f statcust.f statg.f \
statgrid.f stati.f statiddat.f statm.f stats.f \
statspars.f statstep.f
f90SRC = \
bcwndw.f90 camxtom3.f90 datshift.f90 factor.f90 fakestep.f90 \
fills.f90 findwndw.f90 greg2jul.f90 gregdate.f90 gridprobe.f90 \
insertgrid.f90 jul2greg.f90 juldate.f90 juldiff.f90 julshift.f90 \
latlon.f90 m3fake.f90 m3mask.f90 m3pair.f90 m3probe.f90 \
m3totxt.f90 m3tproc.f90 m3tshift.f90 m3wndw.f90 mtxcalc.f90 \
pairstep.f90 presz.f90 timediff.f90 timeshift.f90 vertot.f90 \
vertimeproc.f90 vertintegral.f90 wndwdesc.f90 wrfgriddesc.f90 \
wrftom3.f90 mpasdiff.f90 mpasstat.f90 mpastom3.f90 raandomstat.f90
OBJ = $(fSRC:.f=.o) $(f90SRC:.f90=.o)
EXE = \
airs2m3 bcwndw camxtom3 datshift dayagg \
factor findwndw greg2jul gregdate gridprobe \
insertgrid jul2greg juldate juldiff julshift \
kfxtract latlon m3agmax m3agmask m3cple \
m3combo m3diff m3edhdr m3fake m3hdr \
m3interp m3mask m3merge m3pair m3probe \
m3stat m3totxt m3tproc m3tshift m3wndw \
m3xtract mtxblend mtxbuild mtxcalc mtxcple \
mpasdiff mpasstat mpastom3 presterp presz \
projtool selmrg2d timediff timeshift vertot \
vertimeproc vertintegral wndwdesc wrfgriddesc wrftom3 \
randomstat
# ---------------------- TOP-LEVEL TARGETS: ------------------
all: $(EXE)
clean:
cd ${OBJDIR}; rm $(EXE) $(OBJ)
install: $(INSTDIR)
echo "Installing M3TOOLS in ${INSTDIR}"
cd ${OBJDIR}; cp $(EXE) $(INSTDIR)
rmexe:
cd ${OBJDIR}; rm ${EXE}
relink:
make BIN=${BIN} -i rmexe ; make BIN=${BIN} all
bins:
make BIN=Linux2_x86_64
make BIN=Linux2_x86_64sun
make BIN=Linux2_x86_64ifort
make BIN=Linux2_x86_64dbg
make BIN=Linux2_x86_64sundbg
make BIN=Linux2_x86_64ifortdbg
binclean:
make -i BIN=Linux2_x86_64 clean
make -i BIN=Linux2_x86_64sun clean
make -i BIN=Linux2_x86_64ifort clean
make -i BIN=Linux2_x86_64dbg clean
make -i BIN=Linux2_x86_64sundbg clean
make -i BIN=Linux2_x86_64ifortdbg clean
binrelink:
make BIN=Linux2_x86_64 relink
make BIN=Linux2_x86_64sun relink
make BIN=Linux2_x86_64ifort relink
make BIN=Linux2_x86_64dbg relink
make BIN=Linux2_x86_64sundbg relink
make BIN=Linux2_x86_64ifortdbg relink
flags:
echo "BIN=${BIN}"
echo "FFLAGS=$(FFLAGS)"
echo "LDFLAGS=$(LDFLAGS)"
echo "LIBS=$(LIBS)"
echo "ARCHFLAGS=$(ARCHFLAGS)"
echo "ARCHLIB=$(ARCHLIB)"
echo "ARCHLIBS=$(ARCHLIBS)"
echo "OMPFLAGS=$(OMPFLAGS)"
echo "OMPLIBS=$(OMPLIBS)"
echo "FOPTFLAGS=$(FOPTFLAGS)"
echo "COPTFLAGS=$(COPTFLAGS)"
echo "PARFLAGS=$(PARFLAGS)"
echo "PVM_ROOT=$(PVM_ROOT)"
echo "PVMLIBS=$(PVMLIBS)"
# ----------------------- RULES: -------------------------
%.o : %.mod # Disable "gmake"s obnoxious implicit Modula-2 rule !!
%.f : %.F # Hack for some versions of "gmake" + "gfortran"
.F.o:
cd ${OBJDIR}; $(FC) $(FPPFLAGS) $(FFLAGS) -c $(SRCDIR)/$<
.f.o:
cd ${OBJDIR}; $(FC) $(FFLAGS) -c $(SRCDIR)/$<
.f90.o:
cd ${OBJDIR}; $(FC) $(FFLAGS) -c $(SRCDIR)/$<
# --------------------------- Dependencies: --------------------
aggvars.o : m3utilio.mod
agmask.o : m3utilio.mod
agmax.o : m3utilio.mod
airnow2m3.o : m3utilio.mod
airs2m3.o : m3utilio.mod
cdiffstep.o : m3utilio.mod
dayagg.o : m3utilio.mod
diffstep.o : m3utilio.mod
aggvars.o : m3utilio.mod
agmask.o : m3utilio.mod
agmax.o : m3utilio.mod
airnow2m3.o : m3utilio.mod
airs2m3.o : m3utilio.mod
cdiffstep.o : m3utilio.mod
dayagg.o : m3utilio.mod
diffstep.o : m3utilio.mod
gridprobe.o : m3utilio.mod modgctp.mod
insertgrid.o : m3utilio.mod modgctp.mod
latlon.o : m3utilio.mod modgctp.mod
m3agmask.o : m3utilio.mod
m3agmax.o : m3utilio.mod
m3combo.o : m3utilio.mod modatts3.mod
m3cple.o : m3utilio.mod modgctp.mod modatts3.mod
m3diff.o : m3utilio.mod
m3edhdr.o : m3utilio.mod
m3hdr.o : m3utilio.mod modatts3.mod
m3interp.o : m3utilio.mod modgctp.mod modatts3.mod
m3mask.o : m3utilio.mod
m3merge.o : m3utilio.mod modgctp.mod
m3stat.o : m3utilio.mod
m3tproc.o : m3utilio.mod modatts3.mod
m3tshift.o : m3utilio.mod modatts3.mod
m3xtract.o : m3utilio.mod modatts3.mod
m3wndw.o : m3utilio.mod modatts3.mod
mpasdiff.o : m3utilio.mod modmpasfio.mod
mpasstat.o : m3utilio.mod modmpasfio.mod
mpastom3.o : m3utilio.mod modmpasfio.mod
mtxbuild.o : m3utilio.mod modatts3.mod
mtxcalc.o : m3utilio.mod modatts3.mod modgctp.mod
mtxcple.o : m3utilio.mod modatts3.mod
projtool.o : m3utilio.mod modgctp.mod
selmrg2d.o : m3utilio.mod
statbdry.o : m3utilio.mod
statcust.o : m3utilio.mod
statgrid.o : m3utilio.mod
statiddat.o : m3utilio.mod
statspars.o : m3utilio.mod
wndwdesc.o : m3utilio.mod modgctp.mod
wrfgriddesc.o : m3utilio.mod modwrfio.mod
wrftom3.o : m3utilio.mod modwrfio.mod
# --------------------------- $(EXE) Program builds: -----------------
airs2m3: airs2m3.o
cd ${OBJDIR}; $(FC) ${LFLAGS} $^ ${LIBS} -o $@
bcwndw: bcwndw.o
cd ${OBJDIR}; $(FC) ${LFLAGS} $^ ${LIBS} -o $@
camxtom3: camxtom3.o
cd ${OBJDIR}; $(FC) ${LFLAGS} $^ ${LIBS} -o $@
datshift: datshift.o
cd ${OBJDIR}; $(FC) ${LFLAGS} $^ ${LIBS} -o $@
dayagg: dayagg.o
cd ${OBJDIR}; $(FC) ${LFLAGS} $^ ${LIBS} -o $@
factor: factor.o
cd ${OBJDIR}; $(FC) ${LFLAGS} $^ ${LIBS} -o $@
findwndw: findwndw.o
cd ${OBJDIR}; $(FC) ${LFLAGS} $^ ${LIBS} -o $@
greg2jul: greg2jul.o
cd ${OBJDIR}; $(FC) ${LFLAGS} $^ ${LIBS} -o $@
gregdate: gregdate.o
cd ${OBJDIR}; $(FC) ${LFLAGS} $^ ${LIBS} -o $@
gridprobe: gridprobe.o
cd ${OBJDIR}; $(FC) ${LFLAGS} $^ ${LIBS} -o $@
insertgrid: insertgrid.o
cd ${OBJDIR}; ${FC} ${LFLAGS} $^ ${LIBS} -o $@
jul2greg: jul2greg.o
cd ${OBJDIR}; $(FC) ${LFLAGS} $^ ${LIBS} -o $@
juldate: juldate.o
cd ${OBJDIR}; $(FC) ${LFLAGS} $^ ${LIBS} -o $@
juldiff: juldiff.o
cd ${OBJDIR}; $(FC) ${LFLAGS} $^ ${LIBS} -o $@
julshift: julshift.o
cd ${OBJDIR}; $(FC) ${LFLAGS} $^ ${LIBS} -o $@
kfxtract: kfxtract.o
cd ${OBJDIR}; $(FC) ${LFLAGS} $^ ${LIBS} -o $@
latlon: latlon.o
cd ${OBJDIR}; $(FC) ${LFLAGS} $^ ${LIBS} -o $@
m3agmask: m3agmask.o agmask.o
cd ${OBJDIR}; $(FC) ${LFLAGS} $^ ${LIBS} -o $@
m3agmax: m3agmax.o agmax.o
cd ${OBJDIR}; $(FC) ${LFLAGS} $^ ${LIBS} -o $@
m3combo: m3combo.o
cd ${OBJDIR}; $(FC) ${LFLAGS} $^ ${LIBS} -o $@
m3cple: m3cple.o
cd ${OBJDIR}; $(FC) ${LFLAGS} $^ ${LIBS} -o $@
m3diff: m3diff.o diffstep.o cdiffstep.o
cd ${OBJDIR}; $(FC) ${LFLAGS} $^ ${LIBS} -o $@
m3edhdr: m3edhdr.o
cd ${OBJDIR}; $(FC) ${LFLAGS} $^ ${LIBS} -o $@
m3fake: m3fake.o fakestep.o fills.o
cd ${OBJDIR}; $(FC) ${LFLAGS} $^ ${LIBS} -o $@
m3hdr: m3hdr.o
cd ${OBJDIR}; $(FC) ${LFLAGS} $^ ${LIBS} -o $@
m3interp: m3interp.o
cd ${OBJDIR}; $(FC) ${LFLAGS} $^ ${LIBS} -o $@
m3mask: m3mask.o
cd ${OBJDIR}; $(FC) ${LFLAGS} $^ ${LIBS} -o $@
m3merge: m3merge.o
cd ${OBJDIR}; $(FC) ${LFLAGS} $^ ${LIBS} -o $@
m3pair: m3pair.o pairstep.o
cd ${OBJDIR}; $(FC) ${LFLAGS} $^ ${LIBS} -o $@
m3probe: m3probe.o
cd ${OBJDIR}; $(FC) ${LFLAGS} $^ ${LIBS} -o $@
m3stat: m3stat.o statbdry.o statcust.o statgrid.o statiddat.o statspars.o \
statb.o statc.o statg.o stati.o statm.o
cd ${OBJDIR}; $(FC) ${LFLAGS} $^ ${LIBS} -o $@
m3totxt: m3totxt.o
cd ${OBJDIR}; ${FC} ${LFLAGS} $^ ${LIBS} -o $@
m3tproc: m3tproc.o
cd ${OBJDIR}; $(FC) ${LFLAGS} $^ ${LIBS} -o $@
m3tshift: m3tshift.o
cd ${OBJDIR}; $(FC) ${LFLAGS} $^ ${LIBS} -o $@
m3wndw: m3wndw.o
cd ${OBJDIR}; $(FC) ${LFLAGS} $^ ${LIBS} -o $@
m3xtract: m3xtract.o
cd ${OBJDIR}; $(FC) ${LFLAGS} $^ ${LIBS} -o $@
m4cple: m4cple.o
cd ${OBJDIR}; $(FC) ${LFLAGS} $^ ${LIBS} -o $@
mpasdiff: mpasdiff.o
cd ${OBJDIR}; $(FC) ${LFLAGS} $^ ${LIBS} -o $@
mpasstat: mpasstat.o
cd ${OBJDIR}; $(FC) ${LFLAGS} $^ ${LIBS} -o $@
mpastom3: mpastom3.o
cd ${OBJDIR}; $(FC) ${LFLAGS} $^ ${LIBS} -o $@
mtxblend: mtxblend.o
cd ${OBJDIR}; $(FC) ${LFLAGS} $^ ${LIBS} -o $@
mtxbuild: mtxbuild.o
cd ${OBJDIR}; $(FC) ${LFLAGS} $^ ${LIBS} -o $@
mtxcalc: mtxcalc.o
cd ${OBJDIR}; $(FC) ${LFLAGS} $^ ${LIBS} -o $@
mtxcple: mtxcple.o
cd ${OBJDIR}; $(FC) ${LFLAGS} $^ ${LIBS} -o $@
presterp: presterp.o
cd ${OBJDIR}; $(FC) ${LFLAGS} $^ ${LIBS} -o $@
presz: presz.o
cd ${OBJDIR}; $(FC) ${LFLAGS} $^ ${LIBS} -o $@
projtool: projtool.o
cd ${OBJDIR}; $(FC) ${LFLAGS} $^ ${LIBS} -o $@
randomstat: randomstat.o
cd ${OBJDIR}; $(FC) ${LFLAGS} $^ ${LIBS} -o $@
selmrg2d: selmrg2d.o
cd ${OBJDIR}; $(FC) ${LFLAGS} $^ ${LIBS} -o $@
sfcmet: sfcmet.o
cd ${OBJDIR}; $(FC) ${LFLAGS} $^ ${LIBS} -o $@
timediff: timediff.o
cd ${OBJDIR}; $(FC) ${LFLAGS} $^ ${LIBS} -o $@
timeshift: timeshift.o
cd ${OBJDIR}; $(FC) ${LFLAGS} $^ ${LIBS} -o $@
vertimeproc: vertimeproc.o
cd ${OBJDIR}; $(FC) ${LFLAGS} $^ ${LIBS} -o $@
vertintegral: vertintegral.o
cd ${OBJDIR}; $(FC) ${LFLAGS} $^ ${LIBS} -o $@
vertot: vertot.o
cd ${OBJDIR}; $(FC) ${LFLAGS} $^ ${LIBS} -o $@
wndwdesc: wndwdesc.o
cd ${OBJDIR}; $(FC) ${LFLAGS} $^ ${LIBS} -o $@
wrfgriddesc: wrfgriddesc.o
cd ${OBJDIR}; $(FC) ${LFLAGS} $^ ${LIBS} -o $@
wrftom3: wrftom3.o
cd ${OBJDIR}; $(FC) ${LFLAGS} $^ ${LIBS} -o $@