anchor.diff:        flttyp = 1
         call autohalfspace(vp,vs,dens)
         stdp = 0.0d0
  -      do 103 dir = 1,4
  +      do 903 dir = 1,4
             lo = hylo
             la = hyla
   C         Take first step (by increment of dl(1))
  
positive.code: 
  C----------------------------------------------------------------------C
  
        SUBROUTINE readsrc(ffmfile,fltfile,magfile,evlo,evla,evdp,str,dip,
       1                   rak,dx,dy,slip,hylo,hyla,nflt)
        IMPLICIT none
        CHARACTER*40 ffmfile,fltfile,magfile
        INTEGER nflt,FMAX
        PARAMETER (FMAX=1500)
  
negative.code: C----------------------------------------------------------------------C
  
        SUBROUTINE autodispgrid(stafile,evlo,evla,evdp,str,dip,rak,dx,dy,
       1                        slip,hylo,hyla,nflt,incr,dspfile)
  C----
  C Automatically determine receiver grid for displacement computation,
  C write grid to STAFILE.
  C----
        IMPLICIT NONE
        CHARACTER*40 stafile,dspfile
        INTEGER nflt,FMAX
        PARAMETER (FMAX=1500)
        REAL*8 evlo(FMAX),evla(FMAX),evdp(FMAX),str(FMAX),dip(FMAX),
       1       rak(FMAX),dx(FMAX),dy(FMAX),slip(FMAX)
        REAL*8 W,E,S,N,WMAX,EMAX,SMAX,NMAX,hylo,hyla,dmax,incr
        write(*,'(A)') 'Creating receiver grid in file: '//stafile
        dmax = 750.0d0 ! km
        call getmaxlims(WMAX,EMAX,SMAX,NMAX,hylo,hyla,dmax)
        call getautodisplims(W,E,S,N,WMAX,EMAX,SMAX,NMAX,hylo,hyla,
       1                 evlo,evla,evdp,str,dip,rak,dx,dy,slip,nflt)
        call writestafile(stafile,W,E,S,N,incr)
        write(*,'(A)') 'Displacements written to file: '//dspfile
        RETURN
        END
  
  C----------------------------------------------------------------------C
  
        SUBROUTINE getmaxlims(WMAX,EMAX,SMAX,NMAX,hylo,hyla,dmax)
        IMPLICIT NONE
        REAL*8 pi,r2d,d2r
        PARAMETER (pi=4.0d0*atan(1.0d0),r2d=180.0d0/pi,d2r=pi/180.0d0)
        REAL*8 az,dmax,WMAX,EMAX,SMAX,NMAX,hylo,hyla,junk
  C----
  C Determine maximum geographic limits of receiver grid to W,E,S,N.
  C----
        WMAX = hylo-dmax*3.6d2/(2.0d0*pi*6.371d3*dcos(hyla*d2r))
        EMAX = hylo+dmax*3.6d2/(2.0d0*pi*6.371d3*dcos(hyla*d2r))
  