#define FIGDIR ./Fig
#include <SEP.defs>
#define FIGLIST rays-homo rays-hete elastic-exact
#define MODELISO " &ti_model nl=1, ea=1000,ec=1000,el=800,ef=800,wave='s',ellipt='y',dip=0.,0.,zborder=2700,4000,dist=550 &end"
#define MODELANI  " &ti_model nl=1, ea=9894,ec=9005,el=4949,ef=5655,wave='p',ellipt='n',dip=0.,0.,zborder=2700,4000,dist=550 &end"
#define MODELANI1  " &ti_model nl=1, ea=9894,ec=9005,el=4949,ef=5655,wave='p',ellipt='n',dip=0.,0.,zborder=2700,4000,dist=550, gammafix=-30 &end"
#define MODELHETE  " &ti_model nl=4, ea=9005,9894,12545,9005,ec=9005,9005,10845,9005,el=4949,4949,5968,4949,ef=5655,5655,6805,5655,wave='p',ellipt='n',dip=0,0,-30,-30,0,zborder=2700,2900,3300,3700,4000,dist=550 &end"
#define MODELHETE1  " &ti_model nl=4, ea=9005,9894,12545,9005,ec=9005,9005,10845,9005,el=4949,4949,5968,4949,ef=5655,5655,6805,5655,wave='p',ellipt='n',dip=0,0,-30,-30,0,zborder=2700,2900,3300,3700,4000,dist=550,gammafix=0,0,-30,0 &end"
#define RAYPARMS " &parameters want_capture='n', nmax_iter=30,i_which_shot=1,nrays=100,anglemin=1.,anglemax=179.9 &end"

default& : tube

FIGDIR/rays-homo.v: ./Src/raytracing.x
	echo RAYPARMS >! ray_tracing.parms
	echo MODELISO >! model
	echo "1 2" >! only-sources
	echo "2700 4000 1 1" >> only-sources
	echo "1" >! only-receivers
  	echo "0.0  3350. " >> only-receivers
	./Src/raytracing.x < model 
	Dd < rays.H esize=4 >!   rays_iso_homoC.H
	echo MODELANI >! model
	./Src/raytracing.x < model 
	Dd < rays.H  esize=4 > rays_ani_homoC.H
	echo MODELANI1 >! model
	./Src/raytracing.x < model 
	Dd < rays.H  esize=4 > rays_ani_tilt_homoC.H
	Graph title='(a)' wherexlabel=b  o1=1 n1=2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2 n2=98 esize=8 plotfat=3 yreverse=y label1=' ' wantaxis2=y label2='depth (ft)' labelsz=6 wherexlabel=t wheretitle=b fillcol=1,1,1 labelrot=y plotfat=0 axisfat=1 out=junk.D transp=n titlesz=5 plotcol=2 xll=0. yll=0 yur=5.0 xur=2.1 o1num=0 d1num=550 o2num=2700 d2num=300 wantframe=y min2=2700 max2=4000 min1=0 max1=550 <  rays_iso_homoC.H
	Graph title='(b)' wherexlabel=b  o1=1 n1=2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2 n2=98 esize=8 plotfat=3 yreverse=y label1='distance (ft)' wantaxis2=y label2=' ' labelsz=6 wherexlabel=t wheretitle=b titlesz=5 labelrot=y plotfat=0 axisfat=1 fillcol=1,1,1 out=junk.E transp=n plotcol=2 xll=3.1 yll=0. yur=5.0 xur=5.2 o1num=0 d1num=550 o2num=2700 d2num=300 wantframe=y min2=2700 max2=4000 min1=0 max1=550 <  rays_ani_homoC.H
	Graph title='(c)' wherexlabel=b  o1=1 n1=2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2 n2=98 esize=8 plotfat=3 yreverse=y label1=' ' wantaxis2=y label2=' ' labelsz=6 wherexlabel=t plotcol=2 fillcol=1,1,1 labelrot=y plotfat=0 axisfat=1 wheretitle=b titlesz=5 out=junk.F transp=n  xll=6.2 yll=0.0 yur=5.0 xur=8.3 o1num=0 d1num=550 o2num=2700 d2num=300 wantframe=y min2=2700 max2=4000 min1=0 max1=550 <  rays_ani_tilt_homoC.H
	cat junk.D junk.E junk.F > junk.A
	vppen erase=once align=lb junk.A > FIGDIR/rays-homo.v
	/bin/rm *junk* *parms* *.H model *.out only-sources only-receivers *fort*

FIGDIR/rays-hete.v: ./Src/raytracing.x
	echo RAYPARMS >! ray_tracing.parms
	echo MODELHETE >! model
	echo "1 2" >! only-sources
	echo "2700 4000 1 1" >> only-sources
	echo "1" >! only-receivers
  	echo "0.0  3500. " >> only-receivers
	./Src/raytracing.x < model 
	Dd < rays.H esize=4 >!   rays_hete_XWC.H
	echo MODELHETE1 >! model
	./Src/raytracing.x < model 
	Dd < rays.H esize=4 >!  rays_hete_tilt_XWC.H
	Graph title='(a)' wherexlabel=b  o1=1 n1=4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3 n2=98 esize=8 plotfat=3 yreverse=y label1='distance (ft)' wantaxis2=y label2='depth (ft)' labelsz=6 wherexlabel=t labelrot=y plotfat=0 axisfat=1 out=junk.D transp=n titlesz=5 wheretitle=b xll=0. yll=0. yur=5.0 xur=2.1 o1num=0 d1num=550 02num=2700 d2num=300 wantframe=y min2=2700 max2=4000 min1=0 max1=550 <  rays_hete_XWC.H
	Graph title='(b)' wherexlabel=b  o1=1 n1=4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3 n2=98 esize=8 plotfat=3 yreverse=y label1='distance (ft)' wantaxis2=y label2='depth (ft)' labelsz=6 wherexlabel=t labelrot=y plotfat=0 axisfat=1 titlesz=5 wheretitle=b out=junk.E transp=n xll=4.1 yll=0. yur=5.0 xur=6.2 o1num=0 d1num=550 02num=2700 d2num=300 wantframe=y min2=2700 max2=4000 min1=0 max1=550 <  rays_hete_tilt_XWC.H
	cat junk.D junk.E > junk.F
	vppen erase=once align=lb junk.F > FIGDIR/rays-hete.v
	/bin/rm *junk* *parms* *.H model *.out only-sources only-receivers *fort*

FIGDIR/elastic-exact.v: Data/all_elastic.exact.H
	Dd < Data/all_elastic.exact.H esize=4 > junk1.H
	Graph title=' ' wherexlabel=t  n1=767 n2=4 n3=1 esize=8 plotfat=1   wheretitle=t whereylabel=l yreverse=y label1='depth (ft)' wantaxis2=y label2='velocity (ft/s)' transp=y wantaxis1=y labelsz=6 dash=0   labelrot=y axisfat=1 out=junk.A titlesz=8 plotfat=7,1,4,10 xll=1.0 yll=1.0 yur=6.5 xur=5.0 min1=700. min2=4000. max1=3000 max2=15000 o1num=1000 o2num=4000 wantframe=y <  junk1.H
	vppen erase=once align=lb junk.A > FIGDIR/elastic-exact.v
	/bin/rm *junk* 

clean&: jclean
	! rm -f *.aux *only* *parms* model *13* *out*
	!cd Src; rm -f *.x *.o *.trace

#include <SEP.idoc.rules>
#include <SEP.obj.rules>
#include <SEP.prog.rules>
