Makefile 4.83 KB
Newer Older
Tilman Steinweg's avatar
Tilman Steinweg committed
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
# Makefile for SOFI2D

#--------------------------------------------------------
# edit here:

# source code for model generation
# model file for viscoelastic modeling L>0
MODEL_V = hh_visco.c
# model file for elastic modeling L=0
MODEL_E = hh_elastic.c
# model file for viscoelastic modeling (overnight built)
MODEL_BV = benchmod.c
# model file for elastic modeling L=0 (overnight built)
MODEL_BE = benchmod_el.c
EXEC= ../bin

EXEC= ../bin


# Compiler (LAM: CC=hcc, CRAY T3E: CC=cc)

# ON Linux cluster running LAM
#CC=hcc
#LFLAGS=-lm -lmpi 
#CFLAGS=-Wall -O4

# ON Linux cluster running OpenMPI and ON MAC
CC=mpicc
LFLAGS=-lm -lmpi 
CFLAGS=-Wall -O3 

# On CRAY T3E
# CC=cc

# On SCHARnet system
#CC=mpicc
#LFLAGS=-lm  

# On HLRN system
#CC=mpcc
#LFLAGS=-lm  

# ALTIX
#CC=icc
#CFLAGS=-mp -O3 -ip0
#LFLAGS=-lmpi -lm 

# after this line, no further editing should be necessary
# --------------------------------------------------------

.c.o:
	$(CC) $(CFLAGS) -c $<

SNAPMERGE_SCR = \
	snapmerge.c \
	holbergcoeff.c\
	json_parser.c\
	merge.c \
	read_par_json.c \
	readdsk.c \
	writedsk.c \
	util.c 


SOFI2D_SRC= \
	$(MODEL_V) \
	$(MODEL_E) \
	abs_update.c \
	absorb.c \
	av_mue.c\
	av_rho.c\
	av_tau.c\
	catseis.c\
	check_fs.c\
	checkfd.c \
	comm_ini.c\
	cpml_update.c \
	exchange_par.c \
	exchange_s_rsg.c \
	exchange_s.c \
	exchange_v.c \
	sofi2D.c \
	holbergcoeff.c\
	info.c \
	initproc.c \
	json_parser.c\
	matcopy.c \
	matcopy_elastic.c \
	merge.c \
	mergemod.c \
	note.c \
	outseis.c \
	outseis_glob.c \
	operators_s.c \
	operators_v.c \
	PML_pro.c \
	prepare_update_s.c \
98
	prepare_update_s_4.c \
Tilman Steinweg's avatar
Tilman Steinweg committed
99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118
	psource.c \
	rd_sour.c \
	read_checkpoint.c\
	read_par_json.c \
	readdsk.c \
	readmod_visco.c \
	readmod_elastic.c \
   	receiver.c \
	save_checkpoint.c\
	saveseis.c \
	saveseis_glob.c \
	seismo_ssg.c \
	snap_ssg.c \
	sources.c \
	splitrec.c \
	splitsrc.c \
	subgrid_bounds.c \
	surface.c \
	surface_elastic.c \
	update_s_elastic_abs.c \
119
    update_s_elastic_abs_4.c \
Tilman Steinweg's avatar
Tilman Steinweg committed
120
	update_s_elastic_interior.c \
121
    update_s_elastic_interior_4.c \
Tilman Steinweg's avatar
Tilman Steinweg committed
122
	update_s_elastic_PML.c \
123
    update_s_elastic_PML_4.c \
Tilman Steinweg's avatar
Tilman Steinweg committed
124 125 126
	update_s_visc_abs.c \
	update_s_visc_interior.c \
	update_s_visc_PML.c \
127 128 129
    update_s_visc_abs_4.c \
    update_s_visc_interior_4.c \
    update_s_visc_PML_4.c \
Tilman Steinweg's avatar
Tilman Steinweg committed
130
	update_v_abs.c \
131
    update_v_abs_4.c \
Tilman Steinweg's avatar
Tilman Steinweg committed
132
	update_v_interior.c \
133
    update_v_interior_4.c \
Tilman Steinweg's avatar
Tilman Steinweg committed
134
	update_v_PML.c \
135
	update_v_PML_4.c \
Tilman Steinweg's avatar
Tilman Steinweg committed
136 137
	util.c \
	wavefield_update_s_el.c \
138
    wavefield_update_s_el_4.c \
Tilman Steinweg's avatar
Tilman Steinweg committed
139
	wavefield_update_s_visc.c \
140
	wavefield_update_s_visc_4.c \
Tilman Steinweg's avatar
Tilman Steinweg committed
141
	wavefield_update_v.c \
142
	wavefield_update_v_4.c \
Tilman Steinweg's avatar
Tilman Steinweg committed
143 144 145 146 147
	wavelet.c \
	write_par.c \
	writedsk.c \
	writemod.c \
	zero_elastic.c \
148 149
    zero_elastic_4.c \
    zero_visco_4.c \
Tilman Steinweg's avatar
Tilman Steinweg committed
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
	zero_visc.c \
	zero_PML_elastic.c \
	zero_PML_visc.c 
	

SOFI2D_BENCH_SRC= \
	$(MODEL_BV) \
	$(MODEL_BE) \
	abs_update.c \
	absorb.c \
	av_mue.c\
	av_rho.c\
	av_tau.c\
	catseis.c\
	check_fs.c\
	checkfd.c \
	comm_ini.c\
	cpml_update.c \
	exchange_par.c \
	exchange_s_rsg.c \
	exchange_s.c \
	exchange_v.c \
	sofi2D.c \
	holbergcoeff.c\
	info.c \
	initproc.c \
	json_parser.c\
	matcopy.c \
	matcopy_elastic.c \
	merge.c \
	mergemod.c \
	note.c \
	outseis.c \
	outseis_glob.c \
	operators_s.c \
	operators_v.c \
	PML_pro.c \
	prepare_update_s.c \
188
	prepare_update_s_4.c \
Tilman Steinweg's avatar
Tilman Steinweg committed
189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208
	psource.c \
	rd_sour.c \
	read_checkpoint.c\
	read_par_json.c \
	readdsk.c \
	readmod_visco.c \
	readmod_elastic.c \
   	receiver.c \
	save_checkpoint.c\
	saveseis.c \
	saveseis_glob.c \
	seismo_ssg.c \
	snap_ssg.c \
	sources.c \
	splitrec.c \
	splitsrc.c \
	subgrid_bounds.c \
	surface.c \
	surface_elastic.c \
	update_s_elastic_abs.c \
209
    update_s_elastic_abs_4.c \
Tilman Steinweg's avatar
Tilman Steinweg committed
210
	update_s_elastic_interior.c \
211
    update_s_elastic_interior_4.c \
Tilman Steinweg's avatar
Tilman Steinweg committed
212 213 214 215
	update_s_elastic_PML.c \
	update_s_visc_abs.c \
	update_s_visc_interior.c \
	update_s_visc_PML.c \
216 217 218 219
    update_s_elastic_PML_4.c \
    update_s_visc_abs_4.c \
    update_s_visc_interior_4.c \
    update_s_visc_PML_4.c \
Tilman Steinweg's avatar
Tilman Steinweg committed
220
	update_v_abs.c \
221
    update_v_abs_4.c \
Tilman Steinweg's avatar
Tilman Steinweg committed
222
	update_v_interior.c \
223
	update_v_interior_4.c \
Tilman Steinweg's avatar
Tilman Steinweg committed
224
	update_v_PML.c \
225
    update_v_PML_4.c \
Tilman Steinweg's avatar
Tilman Steinweg committed
226 227
	util.c \
	wavefield_update_s_el.c \
228
    wavefield_update_s_el_4.c \
Tilman Steinweg's avatar
Tilman Steinweg committed
229
	wavefield_update_s_visc.c \
230
	wavefield_update_s_visc_4.c \
Tilman Steinweg's avatar
Tilman Steinweg committed
231
	wavefield_update_v.c \
232
    wavefield_update_v_4.c \
Tilman Steinweg's avatar
Tilman Steinweg committed
233 234 235 236 237
	wavelet.c \
	write_par.c \
	writedsk.c \
	writemod.c \
	zero_elastic.c \
238 239
    zero_elastic_4.c \
    zero_visco_4.c \
Tilman Steinweg's avatar
Tilman Steinweg committed
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
	zero_visc.c \
	zero_PML_elastic.c \
        zero_PML_visc.c \
        
	
SNAPMERGE_OBJ = $(SNAPMERGE_SCR:%.c=%.o)

SOFI2D_OBJ = $(SOFI2D_SRC:%.c=%.o)
SOFI2D_BENCH_OBJ = $(SOFI2D_BENCH_SRC:%.c=%.o)

snapmerge:	$(SNAPMERGE_OBJ)
	$(CC) $(LFLAGS) $(SNAPMERGE_OBJ) -o ../bin/snapmerge

sofi2D:		$(SOFI2D_OBJ)
	$(CC) $(LFLAGS) $(SOFI2D_OBJ) -o $(EXEC)/sofi2D
	
sofi2D_bench:		$(SOFI2D_BENCH_OBJ)
	$(CC) $(LFLAGS) $(SOFI2D_BENCH_OBJ) -o $(EXEC)/sofi2D_bench


clean:
	find . -name "*.o" -exec rm {} \; 
	find . -name "*.c%" -exec rm {} \;
	find . -name "*.bck" -exec rm {} \;

all: clean sofi2D snapmerge