include ${SEPINC}/SEP.top
LATOPTS = option=web 'style=jfc,makeidx,html,amsmath'
#LATOPTS = 'style=amsmath'
BINDIR = ./Bin/${MTYPE}
OBJDIR = ./Obj/${MTYPE}
SRCDIR = ./Src/main
RESDIR = ./Fig
PARDIR = ./Par
TXTDIR = ./Txt
LIBDIR = ./Lib/${MTYPE}
INCDIR = ./Inc
MYDEV  = ./
PYTDIR = ./Pyth
SIGDIR = /mnt/sepdata/1a/sigsbee_multiple
#COLOR=yes

#RESULTSNR = eigenvalues_const eigenvalues_bill
RESULTSER = compare compare_mig1
RESULTSCR = 
OLEVEL=2
#UF90FLAGS =-mp -check bounds
UF90FLAGS =-parallel -openmp -openmp_report2  -O3 -axW -vec_report3
MAINLIBS=-lsep2df90 -lsep3df90 -lsep3d -lsepf90 -lsep -L${LIBDIR}  -lsepgeef90
UF90LIBS=${MPILIBS} ${MAINLIBS} -lsepparf90 -lseppar_mpi -lsepgeef90 -lsep2df90 -static-libcxa -lguide#-Bstatic 
UF77LIBS = ${BEILIB}



###########################
#       My stuffs         #
###########################
Prog=/net/koko/brad/bin/LINUX/ShotMig

source01.H:${SIGDIR}/nfs-splitspread-shots.H
	< ${SIGDIR}/nfs-splitspread-shots.H Window3d min1=4.88 max1=5.12 f3=5 n3=1 f2=673 n2=1 | \
	Pad end1=1770 > j1.H ; echo o1=-0.112 n4=1 o4=1 d4=1 n5=1 o5=1 d5=1 >> j1.H; \
	<j1.H Transf f_min=2 f_min1=6 f_max1=36 f_max=42 is2d=y shotmig=y | Transp plane=13 > $@

prep_pos.H: ${SIGDIR}/nfs-splitspread-shots.H
	<${SIGDIR}/nfs-splitspread-shots.H Window3d min2=0. | Pad end1=300 beg2=100 end2=100 >j1.H | \
	echo n4=1 o4=1 d4=1 n5=1 o5=1 d5=1 >> j1.H; <j1.H Transf f_min=2 f_min1=6 f_max1=36 f_max=42 is2d=y maxsize=1000 \
	shotmig=y >j2.H; <j2.H Transp plane=24 > $@
	rm -f j1.H j2.H

prep_test.H: ${SIGDIR}/nfs-splitspread-shots.H
	<${SIGDIR}/nfs-splitspread-shots.H Window3d max2=0. n3=25 f3=200 | Pad end1=300 beg2=100 end2=100 >j1.H | \
	echo n4=1 o4=1 d4=1 n5=1 o5=1 d5=1 >> j1.H; <j1.H Transf f_min=2 f_min1=6 f_max1=36 f_max=42 is2d=y \
	shotmig=y >j2.H; <j2.H Transp plane=24 > $@
	rm -f j1.H j2.H


prep_neg.H: ${SIGDIR}/nfs-splitspread-shots.H
	<${SIGDIR}/nfs-splitspread-shots.H Window3d max2=0. | Pad end1=300 beg2=100 end2=100 >j1.H | \
	echo n4=1 o4=1 d4=1 n5=1 o5=1 d5=1 >> j1.H; <j1.H Transf f_min=2 f_min1=6 f_max1=36 f_max=42 is2d=y \
	shotmig=y >j2.H; <j2.H Transp plane=24 > $@
	rm -f j1.H j2.H


vel_pad.H:
	< ${SIGSMULT_DATA}/sigsbee2b_migration_velocity.H Window> j.H
	echo "hff=-1 gff=-1 d1=25 o2=10025 d2=37.5"      >>j.H
	< j.H Window3d n1=1201 j2=2|Pad beg2=2000 n2out=10000 extend=1|Transp> vel_pad.H
	/net/koko/alejandro/plib/pcs2/bin/Wedge.x vel_pad.H axis=2 nn=1 no=0. nd=75. 
	echo  "  label1="x" label2="y" label3="z" " >> vel_pad.H

mig_Sis_Parallel_16000.H:  data_f.H wave.H vel_pad.H ${PARDIR}/go_sis.P 
	@date
	nohup Parallel command=/net/koko/brad/bin/LINUX/ShotMig files="data_f.H,wave.H,vel_pad.H,$@"  \
	tags="D,D_d,V,R" usage="INPUT,INPUT,INPUT,OUTPUT" nblock=60 axis=4,4,5,5 pverb=2  \
	file_type="DISTRIBUTE,COPY,COPY,COPY"  mach_mfile=machinefile_all nx_shots=327 ox_shots=10925. \
	par=${PARDIR}/go_sis.P  taper=y  taper_pcent=2 marine=y watercolumn=6000 #restart=y

mig_Sis_Parallel_pad.H:  data_f.H wave.H vel_pad.H ${PARDIR}/go_sis.P 
	@date
	nohup Parallel command=./ShotMigNew files="data_f_pad.H,wave.H,vel_pad.H,$@"  \
	tags="D,D_d,V,R" usage="INPUT,INPUT,INPUT,OUTPUT" nblock=37 axis=4,4,5,5 pverb=2  \
	file_type="DISTRIBUTE,COPY,COPY,COPY"  mach_mfile=machinefile_half nx_shots=327 ox_shots=10925. \
	par=${PARDIR}/go_sis.P  taper=y  taper_pcent=2 marine=y watercolumn=6000 minx=10925 maxx=60000   #restart=y

mig_ang_97.H: 
	< mig_off64.H OFF2ANG  verb=y eps=1 > $@

Mig_pos_nohup.H:prep_test.H source01.H vel_pad.H
	@date
	nohup Parallel command=${Prog}  files="prep_pos.H,source01.H,vel_pad.H,$@"  \
	tags="D,D_d,S,R" usage="INPUT,INPUT,INPUT,OUTPUT" nblock=20 axis=4,4,5,5 pverb=2  \
	file_type="DISTRIBUTE,COPY,COPY,DISTRIBUTE" mach_mfile=machinefile_200 \
	nref=8 nfk=20 niter_lloyd=100 min_slow_dev=.01 nhx=32 marine=y watercolumn=5400. firstzW=191 minx1=-10 \
	maxx1=10 minx=10000 maxx=12500 taper=y  taper_pcent=2

Mig_pos.H: prep_pos.H source01.H vel_pad.H go_sis.P
	@date
	nohup Parallel command=./ShotMigNew files="prep_pos.H,source01.H,vel_pad.H,$@"  \
	tags="D,D_d,V,R" usage="INPUT,INPUT,INPUT,OUTPUT" nblock=496 axis=4,4,4,6 pverb=2  \
	file_type="DISTRIBUTE,COPY,COPY,COPY" mach_mfile=machinefile_200 \
	par=go_sis.P  taper=y  taper_pcent=2 marine=y watercolumn=5400 minx=12000 maxx=70000   #restart=y


aMig_pos.H:prep_pos.H source01.H vel_pad.H
	@date
	nohup Parallel command=${Prog}  files="prep_pos.H,source01.H,vel_pad.H,$@"  \
	tags="D,D_d,S,R" usage="INPUT,INPUT,INPUT,OUTPUT" nblock=20 axis=4,4,5,5 pverb=2  \
	file_type="DISTRIBUTE,COPY,COPY,DISTRIBUTE" mach_mfile=machinefile_200 \
	nref=8 nfk=20 niter_lloyd=100 min_slow_dev=.01 nhx=32 marine=y watercolumn=5400. firstzW=191 minx1=-10 \
	maxx1=10 minx=10000 maxx=80000 taper=y  taper_pcent=2

Mig_neg.H:prep_neg.H source01.H vel_pad.H
	@date
	Parallel command=${Prog} files="prep_neg.H,source01.H,vel_pad.H,$@"  \
	tags="D,D_d,S,R" usage="INPUT,INPUT,INPUT,OUTPUT" nblock=20 axis=4,4,5,5 pverb=2  \
	file_type="DISTRIBUTE,COPY,COPY,DISTRIBUTE" mach_mfile=machinefile_200 \
	nref=8 nfk=20 niter_lloyd=100 min_slow_dev=.01 nhx=32 marine=y watercolumn=5400. firstzW=191 minx1=-10 \
	maxx1=10 minx=10000 maxx=80000 taper=y  taper_pcent=2

