# Pluto 1.5 velocity model - tests and plots
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#
# Input files required
# ~~~~~~~~~~~~~~~~~~~~
  chk.pl: ""          "plu-vp.grd"  # original gridded P-wave velocity
# File 'plu-vp.grd' should be extracted from the GZIPped file
# 'plu-vp.gz' located in directory 'bin' using the command
# gzip -d -a -N plu-vp.gz
  chk.pl: "data/plu/" "plu-ple.dat"  # data for picture of Lyap. exp.
  chk.pl: "data/plu/" "plu-lex1.dat" # data for picture of Lyap. exp.
  chk.pl: "data/plu/" "plu-lex2.dat" # data for picture of Lyap. exp.
  chk.pl: "data/plu/" "plu-lex3.dat" # data for picture of Lyap. exp.
  chk.pl: "forms/"    "echo.pl"
  chk.pl: "forms/"    "go.pl"
  chk.pl: "forms/"    "copy.pl"
  chk.pl: "forms/"    "append.pl"
# Output files of 'plu-inv.h' used here as input files
  chk.pl: ""          "plu-mod.out" # inverted model
  chk.pl: ""          "p-d-i1.out"  # data for inversion of interfaces
  chk.pl: ""          "p-d-i2.out"  # data for inversion of interfaces
  chk.pl: ""          "p-d-i3.out"  # data for inversion of interfaces
  chk.pl: ""          "p-d-i4.out"  # data for inversion of interfaces
  chk.pl: ""          "p-d-i5.out"  # data for inversion of interfaces
  chk.pl: ""          "p-d-v.out"   # data for velocity inversion
# Input files required for history file 'plu-ray.h'
  chk.pl: "data/plu/" "plu-ray.h"
  chk.pl: "data/plu/" "plu-srp.dat"
  chk.pl: "data/plu/" "plu-crt.dat"
  chk.pl: "data/plu/" "plu-rpa.dat"
  chk.pl: "crt/"      "codep.dat"
  chk.pl: "crt/"      "writall.dat"
# Input files required for history file 'plu-rayz.h'
  chk.pl: "data/plu/" "plu-rayz.h"
  chk.pl: "data/plu/" "plu-rpaz.dat"

# New updated model and its consistency check
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  MODEL='plu-mod.out'

  N1=1000  N2=10000 LFREE=1  MODLOG='modchk.out'
 #modchk:

# General plotting parameters
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~
  VMIN=0        VMAX=14500
  VSIGN=-1      HOFFSET=6.0
  HSIZE=4.314   VSIZE=25.0

# Plotting the data for the inversion
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# P-wave velocity data grid
# ~~~~~~~~~~~~~~~~~~~~~~~~~
  N1=50   N2=87    D1=600  D2=2000    O1=50   O2=1000
  GRD='p-d-v.out' PS='p-d-v.ps'
  grdps:
#
# Data points at interfaces
# ~~~~~~~~~~~~~~~~~~~~~~~~~
  PICDAT='picdat.tmp' PICTURE='p-d-i.ps'
  echo.pl: "'PROJECTION'                              " "> picdat.tmp"
  echo.pl: "6. 2.35 0.0001438 0. 0. 0.0001438 0. 0. / " ">>picdat.tmp"
  echo.pl: "                                          " ">>picdat.tmp"
  echo.pl: "'ATTRIBUTES'                              " ">>picdat.tmp"
  echo.pl: "'MSZSF' 0.01 / Marker size scale factor.  " ">>picdat.tmp"
  echo.pl: "'ITC'   0    / No texts drawn.            " ">>picdat.tmp"
  echo.pl: "/                                         " ">>picdat.tmp"
  echo.pl: "                                          " ">>picdat.tmp"
  echo.pl: "'POINTS'                                  " ">>picdat.tmp"
  echo.pl: "'p-d-i1.out'                              " ">>picdat.tmp"
  echo.pl: "                                          " ">>picdat.tmp"
  echo.pl: "'POINTS'                                  " ">>picdat.tmp"
  echo.pl: "'p-d-i2.out'                              " ">>picdat.tmp"
  echo.pl: "                                          " ">>picdat.tmp"
  echo.pl: "'POINTS'                                  " ">>picdat.tmp"
  echo.pl: "'p-d-i3.out'                              " ">>picdat.tmp"
  echo.pl: "                                          " ">>picdat.tmp"
  echo.pl: "'POINTS'                                  " ">>picdat.tmp"
  echo.pl: "'p-d-i4.out'                              " ">>picdat.tmp"
  echo.pl: "                                          " ">>picdat.tmp"
  echo.pl: "'POINTS'                                  " ">>picdat.tmp"
  echo.pl: "'p-d-i5.out'                              " ">>picdat.tmp"
  echo.pl: "                                          " ">>picdat.tmp"
  pictures:
#
# Data for velocities and for interfaces together in one figure
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  GRD='p-d-v.out' PS='p-d-vi.ps' SHOWPAGE=0
  grdps:
  append.pl:  "p-d-vi.ps" "p-d-i.ps"


# Calculating and plotting gridded velocity in the inverted model
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  N1=121   N2=501
  D1=250   D2=347.95
  O1=0     O2=0
  VEL='plu-vpm.out' MPAR=1 NEGPAR=1
  grid:
  GRD='plu-vpm.out' PS='plu-vpm.ps'
  grdps:
# Picture of velocity to be displayed together with the rays
  SHOWPAGE=0  PS='plu-v.ps'
  grdps:
  SHOWPAGE=

# Calculating velocity deviations on the original grid 25x25 ft
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  echo.pl: "A=@1-@2" ">  cal.tmp"
  echo.pl: "@4=A"    ">> cal.tmp"
  echo.pl: "@3=A/@2" ">> cal.tmp"
  N1=1201       N2=6960
  D1=25.        D2=25.
  O1=0.         O2=0.
  VEL='p-v2525.out'  ICB=    MPAR=1  NEGPAR=1
  grid:
  N1=1201     N2=1740 N3=1   N4=4
  CAL='cal.tmp' GRD1='plu-vp.grd'   GRD2='p-v2525.out'
  GRD3='p-velrdi.out' GRD4='p-veladi.out'
  grdcal:
  N1=1201     N2=1740 N3=4   N4=1
  N1NEW=1  N2NEW=1  N3NEW=1 GNORM=2
  GRD='p-velrdi.out' GRDNEW='p-vrd.out'      grdnorm:
  GRD='p-veladi.out' GRDNEW='p-vad.out'      grdnorm:

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

# Tests of ray tracing
# ~~~~~~~~~~~~~~~~~~~~
# Ray tracing and plotting for individual point-source positions
  SRP='plu-srp.dat'
  CPAR1=5.
  srp:
  go.pl:     "plu-ray.h"
  copy.pl:   "plu-v.ps"   "plu-r5.ps"
  append.pl: "plu-r5.ps"  "plu-ray.ps"
#
  CPAR1=7.
  srp:
  go.pl:     "plu-ray.h"
  copy.pl:   "plu-v.ps"   "plu-r7.ps"
  append.pl: "plu-r7.ps"  "plu-ray.ps"
#
  CPAR1=9.
  srp:
  go.pl:     "plu-ray.h"
  copy.pl:   "plu-v.ps"   "plu-r9.ps"
  append.pl: "plu-r9.ps"  "plu-ray.ps"
#
  CPAR1=11.
  srp:
  go.pl:     "plu-ray.h"
  copy.pl:   "plu-v.ps"   "plu-r11.ps"
  append.pl: "plu-r11.ps"  "plu-ray.ps"
#
  CPAR1=13.
  srp:
  go.pl:     "plu-ray.h"
  copy.pl:   "plu-v.ps"   "plu-r13.ps"
  append.pl: "plu-r13.ps"  "plu-ray.ps"

# Ray tracing and plotting of zero-offset rays
  go.pl:     "plu-rayz.h"
  copy.pl:   "plu-v.ps"    "plu-rayz.ps"
  append.pl: "plu-rayz.ps"  "plu-ray.ps"

#
# Important output files
# ~~~~~~~~~~~~~~~~~~~~~~
# Plots of the data for the inversion
# 'p-d-v.ps' ...   Plot of the gridded velocity.
# 'p-d-i.ps' ...   Plot of the points at interfaces.
# 'p-d-vi.ps' ...  Velocity together with the points at interfaces.
#
# Plots of the inverted model
# 'modchk.out'...  Log file about the model consistency check.
# 'plu-vpm.ps'...  Plot of the gridded velocity in the inverted model.
# 'p-veladi.out'...Gridded velocity deviation.
# 'p-velrdi.out'...Gridded relative velocity deviation.
# 'p-vad.out' ...  Standard velocity deviation over the grid.
# 'p-vrd.out' ...  Standard relative velocity deviation over the grid.
#                  (corresponds to relative standard deviation
#                  of small travel times)
# 'plu-lem.out'... Average Lyapunov exponent for the model.
# 'plu-le.ps' ...  Plot of average and directional Lyapunov exponents.
# 'plu-r5.ps', 'plu-r7.ps', 'plu-r9.ps', 'plu-r11.ps',
# 'plu-r13.ps' ... Plots of the gridded velocity in the inverted model
#                  together with the rays computed for individual
#                  point sources.
# 'plu-rayz.ps'... Plot of the gridded velocity in the inverted model
#                  together with the zero-offset rays.
