Including a new arrival time into the location of hypocentre:
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Input:
  POWERN...   Exponent describing the self-affine random medium.
  TTERR1...   Travel-time error at travel time equal to 1 unit.
  T...        Arrival time at the receiver.
  TERR...     Standard deviation of the arrival time.
  TREF...     Optional reference arrival time.  Need not be specified.
  $1...       Gridded travel time from the receiver.
  $2,$3,$4... Temporary files to accumulate intermediate results.
Output:
  $2,$3,$4... Updated temporary files.
Travel-time variances are calculated from POWERN and TTERR1.
Travel-time covariances are not calculated and are deemed zero,
which may result in underestimation of variances of hypocentral
coordinates.
For example refer to
wb2-loc.h.

TDIF=T-TREF
TDIF=TDIF-$1
TTERR=$1**POWERN
TTERR=$1*TTERR
TTERR=TTERR1*TTERR
A=TTERR*TTERR
AA=TERR*TERR
A=A+AA
A=1./A
B=A*TDIF
C=$2*TDIF
C=C-$3
CC=C*C
C=0.000001*A
C=MAX(C,$2)
C=CC/C
$2=$2+A
$3=$3+B
C=C/$2
C=A*C
CC=$4*$4
C=C+CC
$4=SQRT(C)