#! /bin/sh
# Shell script to build velocity profiles with unif2

# input parameters
modelfile=syncline.unif2
velfile=syncline.bin
n1=200
n2=400
d1=10
d2=10

# use unif2 to build the velocity profile
unif2 <$modelfile method=$i ninf=2 nx=$n2 nz=$n1 v00=2000,3000 \
ninf=1 method=spline  > $velfile

# view the velocity profile on the screen
ximage < $velfile  wbox=400 hbox=200 n1=$n1 n2=$n2 d1=$d1 d2=$d2 \
 wbox=800 hbox=400  legend=1 title="Syncline model" label1="depth m" \
label2="distance m " units="m/s" &

# provide input for sufdmod2
xs=1000 zs=20 hsz=20 vsx=1000 verbose=2
vsfile="vseis.su" ssfile="sseis.su" hsfile="hseis.su"
tmax=2.0 mt=10 
label1="Depth m"
label2="Distance m"

# perform finite difference acoustic modeling to generate data
# for a single shot in the 
sufdmod2 < $velfile nz=$n1 dz=$d1 nx=$n2 dx=$d2 verbose=1 \
	xs=$xs zs=$zs hsz=$hsz vsx=$vsx hsfile=$hsfile \
	vsfile=$vsfile ssfile=$ssfile verbose=$verbose \
	tmax=$tmax abs=1,1,1,1 mt=$mt |
suxmovie  clip=1 \
	title="Acoustic Finite-Differencing" \
	windowtitle="Movie" \
	label1=$label1 label2=$label2 \
	n1=$n1 d1=$d1 f1=$f1 n2=$n2 d2=$d2 f2=$f2 \
	loop=1 sleep=20000  -geometry 800x400 &

exit 0
