# HESS velocity model - tests and plots
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#
# Input files required
# ~~~~~~~~~~~~~~~~~~~~
  chk.pl: "data/hes/"  "hes-ple.dat"  #data for picture of Lyap. exp.
  chk.pl: "data/plu/"  "plu-lex1.dat"
  chk.pl: "data/plu/"  "plu-lex2.dat"
  chk.pl: "data/plu/"  "plu-lex3.dat"
  chk.pl: "data/hes/"  "hess.dat"     #original model
  chk.pl: "forms/"     "eq.cal"
  chk.pl: "forms/"     "sub.cal"
  chk.pl: "forms/"     "mul.cal"
  chk.pl: "forms/"     "div.cal"
  chk.pl: "forms/"     "norm2.cal"
  chk.pl: "forms/"     "copy.pl"
  chk.pl: "forms/"     "append.pl"
# Output files of 'hes-inv.h' used here as input files
  chk.pl: ""           "hes-mod.out" #updated model
  chk.pl: ""           "hess-vp.out" #gridded original velocity
  chk.pl: ""           "hes-ib.out"
  chk.pl: ""           "hes-s1.out"
  chk.pl: ""           "hes-s2.out"
# Input files required for history file 'hes-mtt.h'
  chk.pl: "data/hes/"  "hes-mtt.h"
  chk.pl: "data/hes/"  "hes-srp.dat"
  chk.pl: "data/hes/"  "hes-crt.dat"
  chk.pl: "data/hes/"  "hes-rpa.dat"
  chk.pl: "crt/"       "codep.dat"
  chk.pl: "crt/"       "writall.dat"
  chk.pl: "forms/"     "echo.pl"

# Original model or new updated model
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 #MODEL='hess.dat'
  MODEL='hes-mod.out'

# General plotting parameters
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~
  YSIGN=-1  ROTATE=90. HSIZE=25.125

# Calculating gridded velocity, its standard deviation, and Sobolev norm
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  N1=202   N2=106
  D1=200   D2=200
  O1=0     O2=0
  VCIRC=-6000  VREF=5000  CREF=0.666667  VMIN=       VMAX=14800
  GRD='hess-vp.out' PS='hess-vp.ps'
  grdps:
  VEL='vel.out'  VEL1='vel1.out'  VEL2='vel2.out'  VEL11='vel11.out'
  VEL12='vel12.out'  VEL22='vel22.out'  MPAR=1  ICB='hes-im.out'
  grid:
  copy.pl: "vel.out" "hes-vm.out"
  GRD='hes-vm.out' PS='hes-vm.ps'
  grdps:
  CAL='eq.cal' GRD1='hes-im.out' GRD2='hes-ib.out' GRD3='hes-id.out'
  grdcal:
  CAL='sub.cal' GRD1='hes-vm.out' GRD2='hess-vp.out' GRD3='hes-vd.tmp'
  grdcal:
  CAL='mul.cal' GRD1='hes-vd.tmp' GRD2='hes-id.out' GRD3='hes-vd.out'
  grdcal:
  VCIRC=400    VREF=0     CREF=0.166667  VMIN=-5000  VMAX=5000
  GRD='hes-vd.out' PS='hes-vd.ps'
  grdps:
  CAL='div.cal' GRD1='hes-vd.out' GRD2='hess-vp.out' GRD3='hes-vr.out'
  grdcal:
  VCIRC=0.06   VREF=0     CREF=0.166667  VMIN=-.4    VMAX=0.4
  GRD='hes-vr.out' PS='hes-vr.ps'
  grdps:
  N1NEW=1  N2NEW=1  GNORM=2
  GRD='hes-vd.out' GRDNEW='hes-vd2.out'
  grdnorm:
  GRD='hes-vr.out' GRDNEW='hes-vr2.out'
  grdnorm:

# Spectrum of velocity differences
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  N1=202   N2=106  D1=200   D2=200  O1=0     O2=0
  FFTINR='hes-vd.out'  FFTOUTR='hes-fr.out'  FFTOUTI='hes-fi.out'
  FFTFIL=0.
  grdfft:
  N1=256  N2=128  #HSIZE=25.6
  VCIRC=.30E+10   VREF=0     CREF=0.166667  VMIN=       VMAX=
  CAL='norm2.cal' GRD1='hes-fr.out' GRD2='hes-fi.out' GRD3='hes-f0.out'
  grdcal:
  GRD='hes-f0.out' PS='hes-f0.ps'
  grdps:

# Calculating gridded surfaces, standard deviation
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  N1=64    N2=1
  D1=200   D2=1
  O1=9800  O2=0
  VEL='hes-s1m.out'  ISRF=1  MPAR=0  ICB=' '
  grid:
  VEL='hes-s2m.out'  ISRF=2  MPAR=0  ICB=' '
  grid:
  CAL='sub.cal' GRD1='hes-s1m.out' GRD2='hes-s1.out' GRD3='hes-s1d.out'
  grdcal:
                GRD1='hes-s2m.out' GRD2='hes-s2.out' GRD3='hes-s2d.out'
  grdcal:
  CAL='div.cal' GRD1='hes-s1d.out' GRD2='hes-s1.out' GRD3='hes-s1r.out'
  grdcal:
                GRD1='hes-s2d.out' GRD2='hes-s2.out' GRD3='hes-s2r.out'
  grdcal:
  N1NEW=1  N2NEW=1  GNORM=2
  copy.pl: "hes-s1d.out" "hes-sd.out"
  append.pl: "hes-sd.out" "hes-s2d.out"
  copy.pl: "hes-s1r.out" "hes-sr.out"
  append.pl: "hes-sr.out" "hes-s2r.out"
  N1=128
  GRD='hes-sd.out' GRDNEW='hes-sd2.out'
  grdnorm:
  GRD='hes-sr.out' GRDNEW='hes-sr2.out'
  grdnorm:

# Estimation of the Lyapunov exponent for the model
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  KOOR1=1  KOOR2=2  NA= 180  DA=  OA=  NX=  NS= 240  LEMAX=1.
  MODLED='hes-led.out'  MODLEM='hes-lem.out'  MODLEF='hes-lef.out'
  modle2d:
  PICDAT='hes-ple.dat'  PICTURE='hes-le.ps'
  pictures:

# Tests of ray tracing
# ~~~~~~~~~~~~~~~~~~~~
# Ray tracing and plotting for individual source positions
  SRP='hes-srp.dat'
  CPAR1=0.
  srp:
  go.pl: "hes-mtt.h"
  copy.pl: "hes-num.ps" "hes-num1.ps"
#
  CPAR1=1.
  srp:
  go.pl: "hes-mtt.h"
  copy.pl: "hes-num.ps" "hes-num2.ps"
#
  CPAR1=2.
  srp:
  go.pl: "hes-mtt.h"
  copy.pl: "hes-num.ps" "hes-num3.ps"
#
# Important output files
# ~~~~~~~~~~~~~~~~~~~~~~
# 'hess-vp.out'... Gridded original velocity.
# 'hess-vp.ps'...  Plot of the gridded original velocity.
# 'hes-vm.out'...  Gridded velocity in the model.
# 'hes-vm.ps'...   Plot of the gridded velocity in the model.
# 'hes-vd.out'...  Gridded velocity deviation.
# 'hes-vd.ps' ...  Plot of the gridded velocity deviation.
# 'hes-vr.out'...  Gridded relative velocity deviation.
# 'hes-vr.ps' ...  Plot of the gridded relative velocity deviation.
# 'hes-f0.ps' ...  Plot of spectrum of velocity deviation.
# 'hes-sd.out'...  Gridded deviation of model surfaces.
# 'hes-sr.out'...  Gridded relative deviation of model surfaces.
# 'hes-vd2.out'... Standard velocity deviation over the grid.
# 'hes-vr2.out'... Standard relative velocity deviation over the grid.
#                  (corresponds to relative standard deviation
#                  of small travel times)
# 'hes-sd2.out'... Standard deviation of the surfaces over the grid.
# 'hes-sr2.out'... Standard relative deviation of the surfaces
#                  over the grid.
# 'hes-lem.out'... Average Lyapunov exponent for the model.
# 'hes-le.ps'...   Plot of average and directional Lyapunov exponents.

# 'hes-num1.ps'... Plot of the rays and numbers of arrivals
#                  for the first source.
# 'hes-num2.ps'... Plot of rays and arrivals for the second source.
# 'hes-num3.ps'... Plot of rays and arrivals for the third source.
