MAKE_DEPEND=yes
include ${SEPINC}/SEP.top

LATOPTS  = style=html
OLEVEL=2
UF90FLAGS =-openmp -openmp_report2 -check bounds -O3
MAINLIBS=-lsep2df90 -lsep3df90 -lsep3d -lsepf90 -lsep -L${LIBDIR}  -lsepgeef90
UF77LIBS = ${BEILIB}
DIPLIBS = -lvplotf90 -lvplot -lsepdipf90 -lsepfilterf90 -lsepvectorf90  
UF90DEFINES = -DSEP_OMP

#
# 64bit
#
WHEREFFTW = /opt/FFTW/lib/lib
UF90LIBS=${MPILIBS} ${MAINLIBS} ${DIPLIBS} -lsepparf90 -lsepgeef90 -lsep2df90 -static-libcxa -lguide -lseppar  -lsuperset -lsupersetf90 -lsuperset -lsepauxf90 -lsepmathf90 -lsep3df90 -lsep3d -lsepf90 -lsep $(WHEREFFTW)fftw3f.a # -lseppar_mpi

F90=/opt/intel/fce/10.0.023/bin/ifort

BIN=./bin
SRCDIR=./src/

##########################
#
# Progs
#
owmar:OWmig2d_areal.x
	rm -f ${BIN}/OWmig2d_areal.x;rm -f OWmig2d_areal.x;make OWmig2d_areal.x
	mv -f OWmig2d_areal.x ${BIN}/OWmig2d_areal.x
##########################################

crec.obc:
	Spike n2=4001 o2=-20000 d2=10 n1=201 o1=0 d1=0.0040 n3=1 d3=10 o3=0 nsp=1 k1=51|Bandpass flo=4 fhi=32 > z.H
	echo d1=10 >> z.H;< z.H Transp plane=12 reshape=1,3 |Window3d squeeze=n min1=-8500 n1=2101 > image0.H
	Wavelet n1=451 d1=0.004 wavelet=ricker2 phase=0 fund=15 order=0.2 tdelay=.9 domain=time > j2.H;echo o1=-.9 >> j2.H
	<j2.H Transf f_min=0 f_min1=4 f_max1=32 f_max=38 wei=y is2d=y > j1.H; <j1.H Window3d | Cabs |Smooth rect1=7 > j2.H
	Math file1=j2.H exp="file1*0">j1.H;Math file1=j2.H exp="file1*-1">j3.H;Cmplx j3.H j1.H|\
	Transp plane=13 > source.H
	Math file1=image0.H exp="1/(file1*0+4000)" > slowness.H
	./bin/OWmig2d_areal.x sou=source.H vel=slowness.H \
	bkgimg=image0.H rec=crec.obc.H marine=0 bws=bws.obc.H \
	extrapolator=ffd lloyd=1  traces_in_taper=200 padtraces=50 adj=0 \
	nrec=1601 orec=-4000 drec=10 nsht=1 osht=-2000 dsht=80 zmin=0 zmax=700 node=15 > /dev/null





##########################################
regclean_%:
	@-touch $*; Rm $*; touch $*; \rm $*

clean : texclean 
	@-touch j.o j.mod j.x *.fix.f90; \rm *.o *.mod *.x *.fix.f90

include ${SEPINC}/SEP.bottom
