# Controlled initial-value ray tracing in model HESS
# followed by interpolation of travel times
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# This history file calculates the gridded travel times corresponding to
# the point source specified in file 'hes-src.tmp' and plots numbers
# of travel times overlayed by rays (output file 'hes-num.ps').
# This history file is designed to be run from another history file
# (see e.g. 'hes-test.h'), which runs 'srp.for' to generate source
# coordinates 'hes-src.tmp' and then executes this history file
# for the source.

# Input files required
  chk.pl: ""           "hes-mod.out"
  chk.pl: ""           "hes-src.tmp"
  chk.pl: "data/hes/"  "hess.dat"
  chk.pl: "data/hes/"  "hes-crt.dat"
  chk.pl: "data/hes/"  "hes-rpa.dat"
  chk.pl: "data/hes/"  "hes-srp.dat"
  chk.pl: "crt/"       "codep.dat"
  chk.pl: "crt/"       "writall.dat"
  chk.pl: "forms/"     "echo.pl"

# Model
 #MODEL='hess.dat'
  MODEL='hes-mod.out'

# Source
  SRC='hes-src.tmp'

# Data filenames for CRT (for details see 'crt.for')
  DCRT='hes-crt.dat'
  RPAR='hes-rpa.dat'
  CODE='codep.dat'       # just refracted P wave
  WRIT='writall.dat'     # all rays stored for interpolation
  CRTLOG='hes-log.out'

# Kind of ray parameters (for details see 'init.for')
  INIPAR=2  # geographic-like spherical coordinates

# Grid dimensions
  N1=402   N2=210
  O1=100.  O2=100.
  D1=100.  D2=100.

# Output files of program 'mtt.for'
  NUM='hes-num.out'
  MTT='hes-tt.out'
  MHIST='hes-his.out'

# Ray tracing of refracted wave
  crt:   'hes-mtt.h' /

# Interpolation of travel times within ray cells
  mtt:   'hes-mtt.h' /

# ----------------------------------------------------------------------

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

# Plotting rays
# ~~~~~~~~~~~~~
  RAYS='hes-ray.out' KALL=1
  crtray: 'hes-mtt.h' /
  LIN='hes-bnd.out'
  bndlin: 'hes-mtt.h' /
  PICDAT='picdat.tmp' PICTURE='hes-ray.ps'
  echo.pl: "'PROJECTION'                            " "> picdat.tmp"
  echo.pl: "2.5  2.5  0 0.000625  0.000625 0  0 0 / " ">>picdat.tmp"
  echo.pl: "                                        " ">>picdat.tmp"
  echo.pl: "'ATTRIBUTES'                            " ">>picdat.tmp"
  echo.pl: "'LWIDTH' 0.1   / Linewidth scale factor." ">>picdat.tmp"
  echo.pl: "/                                       " ">>picdat.tmp"
  echo.pl: "                                        " ">>picdat.tmp"
  echo.pl: "'LINES'                                 " ">>picdat.tmp"
  echo.pl: "'hes-bnd.out'                           " ">>picdat.tmp"
  echo.pl: "                                        " ">>picdat.tmp"
  echo.pl: "'LINES'                                 " ">>picdat.tmp"
  echo.pl: "'hes-ray.out'                           " ">>picdat.tmp"
  pictures: 'hes-mtt.h' /

# Plotting numbers of arrivals at the gridpoints
# together with the rays
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  VCIRC=7  CREF=0.166667 #VPLUS=2
  GRD='hes-num.out' PS='hes-num.ps'  SHOWPAGE=0
  grdps: 'hes-mtt.h' /
  SHOWPAGE=
  append.pl: "hes-num.ps"   "hes-ray.ps"

## Plotting travel times at the gridpoints,
## sorted according to their value
#  VCIRC=1  VREF=0  CREF=0.166667
#  MGRD='hes-tt.out' GRD='hes-t00.out' PS='hes-t01.ps'
#  mgrd>mgrd.out:  'hes-mtt.h' /
#  grdps: 'hes-mtt.h' /
#
## Plotting grid travel times sorted according to the histories
#  HIST='hes-his.out' GRD='hes-t20.out' PS='hes-t21.ps'
#  mttgrd>mttgrd.out: 'hes-mtt.h' /
#  grdps: 'hes-mtt.h' /

# Important output files
# ~~~~~~~~~~~~~~~~~~~~~~
# 'hes-ray.out'... Computed rays.
# 'hes-ray.ps' ... Picture of the rays.
# 'hes-num.out'... Numbers of arrivals at gridpoints.
# 'hes-num.ps' ... Picture of the numbers of arrivals
#                  together with the rays.
