#! /bin/sh
# PSDemo3 --- example script for sufdmod2
# finite-difference modeling: display model and movie
# Author: John Stockwell
# modified from XDemo3 by Chris Liner 2/11/02
# (also added 2x2 smoothing to velocity model,
#  and uses ps2pdf to generate pdf output)

n1=100 d1=5 f1=0.0 label1="Depth (km)"
n2=100 d2=5 f2=0.0 label2="Distance (km)"
xs=250 zs=50 hsz=50 vsx=250 verbose=2
vsfile="vseis.out" ssfile="sseis.out" hsfile="hseis.out"
tmax=.4 mt=5 fpeak=35 fmax=40

#makevel nx=$n2 nz=$n1 v000=3000 >vel.out
unif2 tfile=model.out
unif2 < model.out n1=$n1 n2=$n2 method=spline \
  | smooth2 n1=$n1 n2=$n2 r1=2 r2=2 \
  > vel.out

psimage < vel.out \
  title="Wavespeed Profile" \
  n1=$n1 n2=$n2 legend=1 lnice=1 units="m/s"\
  label1="$label1" label2="$label2" \
  > vel.ps
ps2pdf vel.ps

sufdmod2 <vel.out nz=$n1 dz=$d1 nx=$n2 dx=$d2 verbose=1 \
  fpeak=$fpeak fmax=$fmax \
  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 \
  | supsmovie clip=1 \
  title="Acoustic Finite-Differencing" \
  title2="Frame" \
  label1="$label1" label2="$label2" \
  n1=$n1 d1=$d1 f1=$f1 n2=$n2 d2=$d2 f2=$f2 \
  > movie.ps
ps2pdf movie.ps

exit 0


