#! /bin/sh
# Sufdmod2 --- example script for sufdmod2
# finite-difference modeling: part 1, the movie
# Author: John Stockwell
WIDTH=450
HEIGHT=450
WIDTHOFF1=50
WIDTHOFF2=530
HEIGHTOFF1=50
HEIGHTOFF2=530

n1=500 d1=5 f1=0.0 label1="Depth (km)"
n2=500 d2=5 f2=0.0 label2="Distance (km)"
xs=1250 zs=125 hsz=300 vsx=1000 verbose=2
vsfile="vseis.out" ssfile="sseis.out" hsfile="hseis.out"
tmax=2.0 mt=5 pml=0 pml_thick=4

#makevel nx=$n2 nz=$n1 v000=3000 >vel.out

# build the file of velocities
unif2 < model.unif2  nx=$n2 nz=$n1 dx=5 \
v00=2000,2500,4000,3500,4000,4500,5000 dz=5 > velocity.1

# build a file of variations
cellauto rule=110 ic=2 nc=100 fill=1 f0=300 f1=3000 n1=$n1 > celvel.out

# add the models
farith in=velocity.1 in2=celvel.out op=add > vel.out

ximage < vel.out  \
	title="Cellular Automata: Rule 110" \
	windowtitle="Earth Model" \
	label1="$label1" label2="$label2" \
	n1=$n1 d1=$d1 f1=$f1 n2=$n2 d2=$d2 f2=$f2 \
	wbox=700 hbox=700 &


sufdmod2 <vel.out 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 pml=$pml pml_thick=$pml_thick \
	> snaps.su

suxmovie < snaps.su clip=.5 \
	title="Acoustic Finite-Differencing (Frame %g)" \
	windowtitle="Movie" \
	label1="$label1" label2="$label2" \
	n1=$n1 d1=$d1 f1=$f1 n2=$n2 d2=$d2 f2=$f2 \
	cmap=gray loop=2 interp=0 &

suximage < hseis.out perc=99 \
	title="Shot Record @ z=1000" \
	windowtitle="Shot" \
	label1="Time (sec)" label2="$label2" \
	n1=$n1 d1=$d1 f1=$f1 n2=$n2 d2=$d2 f2=$f2 \
	width=700 height=700 &

suximage < vseis.out  perc=99 \
	title="VSP @ x=1000" \
	windowtitle="Shot" \
	label1="$label2" label2="Time (sec)" \
	n1=$n1 d1=$d1 f1=$f1 n2=$n2 d2=$d2 f2=$f2 \
	width=700 height=700 &

suxwigb < sseis.out perc=99  \
	title="Receiver at source location" \


exit 0

