forked from jwookey/sheba
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
173 lines (146 loc) · 5.46 KB
/
Copy pathMakefile
File metadata and controls
173 lines (146 loc) · 5.46 KB
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
#===============================================================================
#-------------------------------------------------------------------------------
#
# MAKEFILE FOR SHEBA
#
#-------------------------------------------------------------------------------
#===============================================================================
#
# (C) James Wookey, December 2003 - February 2011
# Department of Earth Sciences, University of Bristol
# Wills Memorial Building, Queen's Road, Bristol, BR8 1RJ, UK
# j.wookey@bristol.ac.uk
#
#-------------------------------------------------------------------------------
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
#
#-------------------------------------------------------------------------------
#
# SHEBA requires a FORTRAN 90 compiler. Compilers known to work are:
# Linux : ifc/ifort, g95, gfortran
# Mac (PowerPC) : g95, gfortran, XLF
# Mac (i386) : gfortran, ifort (maybe)
# Sun (sparc) : Solaris f90
#
#===============================================================================
# Path options
#===============================================================================
# Delivery path
MACRODIR=/Users/ja17375/Ext_programs/macros
EXECDIR=/Users/ja17375/Ext_programs/bin
#===============================================================================
# Compiler and options:
#===============================================================================
## -- flags which work for gfortran on Mac (and probably Linux)
FC = gfortran
# Production
FFLAGS = -O2
# Debug
# FFLAGS = -fcheck=bounds -C -g
# additional flags for .f/.F files
F77FLAGS = -w
# additional flags for .f90/.F90 files
F90FLAGS =
#===============================================================================
# SAC compatibility options
#===============================================================================
## Uncomment for sac/sac2000 (binaries sac files are native endian)
#F90SAC_FLAGS =
## Uncomment for MacSAC (binary sac files are always big-endian)
F90SAC_FLAGS = -DFORCE_BIGENDIAN_SACFILES
#===============================================================================
# GMT Compatibility options
#===============================================================================
## gmt prefix (required by some gmt installations)
#GMT_PREFIX = gmt
## For traditional gmt installations
GMT_PREFIX =
#===============================================================================
#===============================================================================
# No editing *should* be required below here ...
#===============================================================================
#===============================================================================
#
# Code Objects
#
MODULES = sheba_config.o array_sizes.o event_info.o
SUBROUTINES = sheba_core.o misc.o input.o desplit.o output.o teanby.o \
rumpker.o cluster.o split.o\
traceops.o particle.o ndf.o\
calcsnr.o reorient.o crosscorr.o split_intensity.o
F90SAC = f90sac_distrib.o
#
# Executable info
#
#
#
all:$(EXECDIR)/sheba_exec \
$(EXECDIR)/sheba_plot_errclu.gmt \
$(EXECDIR)/sheba_plot_stackerr.gmt \
$(EXECDIR)/sheba_combine_plots.csh \
$(EXECDIR)/cleansheba \
$(MACRODIR)/split_sheba\
$(MACRODIR)/sheba\
$(EXECDIR)/sheba_stack\
$(EXECDIR)/stack_wgtcalc
#
# SHEBA EXECUTABLE
#
$(EXECDIR)/sheba_exec:${F90SAC} ${MODULES} sheba_main.o ${SUBROUTINES}
$(FC) $(FFLAGS) -o $(EXECDIR)/sheba_exec ${F90SAC} ${MODULES} sheba_main.o ${SUBROUTINES}
#
$(EXECDIR)/sheba_stack:${F90SAC} ${MODULES} sheba_stack.o ${SUBROUTINES}
$(FC) $(FFLAGS) -o $(EXECDIR)/sheba_stack ${F90SAC} ${MODULES} sheba_stack.o ${SUBROUTINES}
$(EXECDIR)/stack_wgtcalc:stack_wgtcalc.o
$(FC) $(FFLAGS) -o $(EXECDIR)/stack_wgtcalc stack_wgtcalc.o
# F90SAC requires special options to compile ...
f90sac_distrib.o: f90sac_distrib.F90
$(FC) $(FFLAGS) $(F90FLAGS) $(F90SAC_FLAGS) -c $*.F90
#
# GMT PLOTTING SCRIPTS + OTHER SHELL SCRIPTS
#
$(EXECDIR)/sheba_plot_stackerr.gmt:sheba_plot_stackerr.gmt
cat sheba_plot_stackerr.gmt | sed 's/X1X/$(GMT_PREFIX)/g' > $(EXECDIR)/sheba_plot_stackerr.gmt; chmod +x $(EXECDIR)/sheba_plot_stackerr.gmt;
$(EXECDIR)/sheba_plot_errclu.gmt:sheba_plot_errclu.gmt
cat sheba_plot_errclu.gmt | sed 's/X1X/$(GMT_PREFIX)/g' > $(EXECDIR)/sheba_plot_errclu.gmt; chmod +x $(EXECDIR)/sheba_plot_errclu.gmt
$(EXECDIR)/sheba_combine_plots.csh:sheba_combine_plots.csh
chmod +x sheba_combine_plots.csh; \cp sheba_combine_plots.csh $(EXECDIR)
$(EXECDIR)/cleansheba:cleansheba
chmod +x cleansheba; \cp cleansheba $(EXECDIR)
#
# SAC Macro
#
$(MACRODIR)/split_sheba:sheba
cp -f sheba $(MACRODIR)/split_sheba; cp -f sheba $(MACRODIR)
$(MACRODIR)/sheba:sheba
cp -f sheba $(MACRODIR)
distrib:
rm -rf ../SHEBA_distrib
mkdir ../SHEBA_distrib
cp -f *.f90 ../SHEBA_distrib
cp -f *.F90 ../SHEBA_distrib
cp -f *.f ../SHEBA_distrib
cp -f *.gmt ../SHEBA_distrib
cp -f *.csh ../SHEBA_distrib
cp -f sheba ../SHEBA_distrib
cp -f Makefile ../SHEBA_distrib
cp -f INSTALL ../SHEBA_distrib
cp -f cleansheba ../SHEBA_distrib
clean:
rm -f *.o *.mod
#
# Compile Instuctions
#
%.o: %.F90
$(FC) $(FFLAGS) $(F90FLAGS) -c $*.F90
%.o: %.f90
$(FC) $(FFLAGS) $(F90FLAGS) -c $*.f90
%.o: %.f
$(FC) $(FFLAGS) $(F77FLAGS) -c $*.f
#
# Dependencies
#
$(SUBROUTINES) : $(MODULES)