anchor.diff:                     station_file, &
                      isStationFileDefined, &
                      auto_depth, &
  +                   auto_az, &
                      auto_n, &
  -                   autoStations, &
  +                   auto_mode, &
                      target_file, &
                      isTargetFileDefined, &
                      halfspace_file, &
  
positive.code:     open(unit=82,file=displacement_file,status='old')
  endif
  
  ! Read the displacements
  do i = 1,2002
      read(82,*) (disp(i,j),j=1,6)
  enddo
  
  
  xmin = disp(1,1)
  xmax = disp(1001,1)
  ymin = disp(1002,2)
  ymax = disp(2002,2)
  
  ! Find xmin
  do i = 1,501
      if (sqrt(disp(i,4)**2+disp(i,5)**2+disp(i,6)**2).ge.0.001d0) then
          xmin = disp(i,1)
          exit
      endif
  enddo
  
  ! Find xmax
  do i = 1001,501,-1
      if (sqrt(disp(i,4)**2+disp(i,5)**2+disp(i,6)**2).ge.0.001d0) then
          xmax = disp(i,1)
          exit
      endif
  enddo
  
  ! Find ymin
  do i = 1002,1502
      if (sqrt(disp(i,4)**2+disp(i,5)**2+disp(i,6)**2).ge.0.001d0) then
          ymin = disp(i,2)
          exit
      endif
  enddo
  
  ! Find ymax
  do i = 2002,1502,-1
      if (sqrt(disp(i,4)**2+disp(i,5)**2+disp(i,6)**2).ge.0.001d0) then
          ymax = disp(i,2)
          exit
      endif
  enddo
  
negative.code: 
  station_file = ''
  isStationFileDefined = .false.
  auto_mode = ''
  auto_depth = 0.0d0
  auto_az = 0.0d0
  auto_n = 10
  target_file = ''
  isTargetFileDefined = .false.
  