#! /bin/sh
# building a model with "unif2"

hsfile=hsseis.out

# Use the Marmousi model
zcat $CWPROOT/src/demos/Velocity_Profiles/Marmousi/marmhard.dat.gz |
a2b n1=1 | unisam2 nx2=384 dx2=2 fx2=0 n2=768 d2=1 f2=0 nx1=122 dx1=4 fx1=0 n1=488 d1=1 f1=0 method=linear > velocity.1

# build the file of densities
unif2 < model.unif2  nx=768 nz=488 dx=10 \
v00=1.0,2.25,2.25,2.25,2.35,2.35,2.35 dz=20 > density.1

# view the model
ximage < velocity.1 title="velocity profile" legend=1 \
xbox=10 ybox=10 wbox=768 hbox=488 n1=488 n2=768 d1=10 d2=10 &
ximage < density.1 title="density profile" legend=1 \
xbox=750 ybox=10 wbox=768 hbox=488 n1=488 n2=768 d1=10 d2=10 &

# finite difference modeling
sufdmod2 < velocity.1 xs=2000 zs=20 nx=768 nz=488 dx=10 dz=10 \
dfile=density.1 fmax=160 tmax=12.0 nt=3001 hsz=10 hsfile=$hsfile abs=1,1,1,1 \
verbose=2 mt=10 > cube.out

# view movie
suxmovie < cube.out n1=488 n2=768 d1=10 d2=10 loop=1 width=768 height=488 &

exit 0
