anchor.diff:  C             Calculate displacement and compare to current threshold
                 call calcdisp(uN,uE,uZ,lo,la,stdp,nflt,evlo,evla,evdp,
        1                      str,dip,rak,dx,dy,slip,vp,vs,dens,
  -     2                      flttyp)
  +     2                      flttyp,xy)
                 uN = dabs(uN)
                 uE = dabs(uE)
                 uZ = dabs(uZ)
  
positive.code:       write(96,9005) j
        write(*,*) 'This information is saved in autogrid.dat'
   8001 format(3F10.2)
   9001 format('Grid limits (WESN):',4F8.2)
   9002 format('Grid spacing: ',F10.2)
   9003 format('Number of points: ',I10)
   9004 format('nlon: ',I10)
   9005 format('nlat: ',I10)
        close(95)
        close(96)
        RETURN
  
negative.code:       REAL*8 pi,d2r
        PARAMETER (pi=4.0d0*datan(1.0d0),d2r=pi/1.8d2)
        REAL*8 strain(3,3),stntmp(3,3)
        REAL*8 stlo,stla,stdp,dist,az,x,y,delx,dely
        INTEGER f,nflt,FMAX
        PARAMETER (FMAX=1500)
        REAL*8 evlo(FMAX),evla(FMAX),evdp(FMAX),str(FMAX),dip(FMAX),
       1       rak(FMAX),slip(FMAX),dx(FMAX),dy(FMAX),area
        INTEGER flttyp,xy
        REAL*8 vp,vs,dens
        INTEGER i,j
        do 222 i = 1,3
  