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

hsfile=hsseis.pml.out

pml=1
pml_thick=20

n1=500
n2=2000
d2=25
d1=25


# build the file of velocities
unif2 < model.unif2 ninf=2 nx=$n2 nz=$n1 dz=$d1 dx=$d2 \
v00=5000,4700,5000  > velocity.1

# build the file of densities
unif2 < model.unif2  ninf=6 nx=100 nz=500 dx=25 \
v00=1.0,2.25,2.25,2.25,2.35,2.35,2.35 dz=10 > density.1

# view the model
ximage < velocity.1 title="velocity profile" legend=1 \
xbox=10 ybox=10 n1=500 n2=100 d1=10 d2=25 &
ximage < density.1 title="density profile" legend=1 \
xbox=750 ybox=10 n1=500 n2=100 d1=10 d2=25 &

# finite difference modeling
sufdmod2_pml < velocity.1 xs=1200 zs=200 nx=100 nz=500 dx=25 dz=10 pml=$pml \
pml_thick=$pml_thick \
dfile=density.1 fmax=80 tmax=12.0 nt=3001 hsz=10 hsfile=$hsfile abs=0,1,1,1 \
verbose=2 mt=10 > cube.pml.out

# view movie
suxmovie < cube.pml.out n1=500 n2=100 d1=10 d2=25 loop=1 &

exit 0
