anchor.diff:        implicit none
         character(len=*), intent(in) :: str
         if (debug) then
  -         call f90sac_writetrace(trim(str)//'.BHE', E)
  -         call f90sac_writetrace(trim(str)//'.BHN', N)
  -         call f90sac_writetrace(trim(str)//'.BHZ', Z)
  +         call f90sac_writetrace(trim(str)//'.BHE', E_misfit)
  +         call f90sac_writetrace(trim(str)//'.BHN', N_misfit)
  +         call f90sac_writetrace(trim(str)//'.BHZ', Z_misfit)
         endif
      end subroutine debug_writetrace
   end function sw_misfit
  
positive.code: !     spol:     Source polarisation measured from N.
  !  E,N,Z if not already allocated
  
     use f90sac
  
     implicit none
  
     type(SACtrace), intent(out)   :: E, N, Z
     real, intent(in), optional :: freq, delta, noise, spol
     character(len=*), intent(in), optional :: wavetype
     real(r4), allocatable :: trace(:), random_noise(:)
  
negative.code:    integer, parameter, private :: lu_stdin = 5, &
                                    lu_stdout = 6, &
                                    lu_stderr = 0
  
     ! Saved module variables which are private, but kept to prevent continuous
     ! allocation and deallocation (module variables are saved by default)
     type(SACtrace), private :: E_misfit, N_misfit, Z_misfit
  
     ! Hide internal routines
     private :: gaussian1, &
  