/
Makefile
138 lines (126 loc) · 3.93 KB
/
Makefile
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
###############################################################################
#
# make all
# Compile example programs and tests in their directories.
#
# make run-fortran-tests
# Run the Fortran examples and test suite
#
# make run-fortran-tests-no-timing
# Run the Fortran examples and test suite
#
# make clean
# Delete the compile executibles.
#
#
# NOTES
#
# This Makefile is intended to be invoked by the main Makefile in the SHTOOLS
# repository. To use this Makefile independently, it is necessary to provide
# the following arguments:
#
# F95 - name of the Fortran 95 compiler
# F95FLAGS - flags to use with the Fortran 95 compiler
# LIBNAME - name of the SHTOOLS library (without lib and .a)
# LIBPATH - path to the SHTOOLS library
# MODFLAG - flag used to identify the path of the compiled modules
# FFTW - all flags necessary to find and link to the FFTW library
# LAPACK - all flags necessary to find and link to the LAPACK library
# BLAS - all flags necessary to find and link to the BLAS library
#
###############################################################################
SHELL = /bin/sh
.PHONY: all clean run-fortran-tests
EXAMPLES = \
MarsCrustalThickness/MarsCrustalThickness \
SHCilmPlus/TestCilmPlus \
SHExpandDH/TestExpandDH \
SHExpandLSQ/TestSHExpandLSQ \
SHLocalizedAdmitCorr/LocalizedAdmitCorr \
SHMag/SHMag \
SHRotate/TestSHRotate \
TimingAccuracy/TimingAccuracyDH \
TimingAccuracy/TimingAccuracyDHC \
TimingAccuracy/TimingAccuracyGLQ \
TimingAccuracy/TimingAccuracyGLQC
all: $(EXAMPLES)
%: %.f95 $(LIBPATH)/lib$(LIBNAME).a
$(F95) $(F95FLAGS) $< $(MODFLAG) -L$(LIBPATH) -l$(LIBNAME) $(FFTW) $(LAPACK) $(BLAS) -o $@
run-fortran-tests: $(EXAMPLES)
@echo MARS-CRUSTAL-THICKNESS
cd MarsCrustalThickness ; ./MarsCrustalThickness < input.txt
@echo
@echo TEST-CILMPLUS
cd SHCilmPlus ; ./TestCilmPlus
@echo
@echo TEST-EXPANDDH
cd SHExpandDH ; ./TestExpandDH
@echo
@echo TEST-SHEXPANDLSQ
cd SHExpandLSQ ; ./TestSHExpandLSQ < input.txt
@echo
@echo LOCALIZED-ADMIT-CORR
cd SHLocalizedAdmitCorr ; ./LocalizedAdmitCorr < input.txt
@echo
@echo SHMAG
cd SHMag ; ./SHMag
@echo
@echo TEST-SHROTATE
cd SHRotate ; ./TestSHRotate < input.txt
@echo
@echo "*** The following 8 timing and accuracy tests will take about an hour to complete ***"
@echo "*** If you are impatient, press Control-C to exit ***"
@echo
@echo TIMING-ACCURACY-GLQ
cd TimingAccuracy ; ./TimingAccuracyGLQ < input1 > output1
@echo
@echo TIMING-ACCURACY-GLQ
cd TimingAccuracy ; ./TimingAccuracyGLQ < input2 > output2
@echo
@echo TIMING-ACCURACY-DH
cd TimingAccuracy ; ./TimingAccuracyDH < input3 > output3
@echo
@echo TIMING-ACCURACY-DH
cd TimingAccuracy ; ./TimingAccuracyDH < input4 > output4
@echo
@echo TIMING-ACCURACY-DHC
cd TimingAccuracy ; ./TimingAccuracyDHC < input5 > output5
@echo
@echo TIMING-ACCURACY-DHC
cd TimingAccuracy ; ./TimingAccuracyDHC < input6 > output6
@echo
@echo TIMING-ACCURACY-GLQC
cd TimingAccuracy ; ./TimingAccuracyGLQC < input7 > output7
@echo
@echo TIMING-ACCURACY-GLQC
cd TimingAccuracy ; ./TimingAccuracyGLQC < input8 > output8
run-fortran-tests-no-timing: $(EXAMPLES)
@echo MARS-CRUSTAL-THICKNESS
cd MarsCrustalThickness ; ./MarsCrustalThickness < input.txt
@echo
@echo TEST-CILMPLUS
cd SHCilmPlus ; ./TestCilmPlus
@echo
@echo TEST-EXPANDDH
cd SHExpandDH ; ./TestExpandDH
@echo
@echo TEST-SHEXPANDLSQ
cd SHExpandLSQ ; ./TestSHExpandLSQ < input.txt
@echo
@echo LOCALIZED-ADMIT-CORR
cd SHLocalizedAdmitCorr ; ./LocalizedAdmitCorr < input.txt
@echo
@echo SHMAG
cd SHMag ; ./SHMag
@echo
@echo TEST-SHROTATE
cd SHRotate ; ./TestSHRotate < input.txt
clean:
@-rm -f $(EXAMPLES)
@-rm -f $(addsuffix *.sh, $(dir $(EXAMPLES)))
@-rm -f $(addsuffix *.dat, $(dir $(EXAMPLES)))
@-rm -f TimingAccuracy/output*
@-rm -f TimingAccuracy/*.maxerror
@-rm -f TimingAccuracy/*.rmserror
@-rm -f TimingAccuracy/*.timef
@-rm -f TimingAccuracy/*.timei