anchor.diff:  
      ! Add noise
      if (noise_in > 1.0e-5) then
  -      call sw_alloc(random_noise, 2*(npts-1)+1)
  +      allocate(random_noise(2*(npts-1)+1))
         call random_seed()
   
         call random_number(random_noise)
  
positive.code:          real(dt2(i),r4), real(spol(i),r4), freq=real(freq_in,r4), &
           delta=real(delta_in,r4), noise=real(noise_in,r4), wavetype=wavetype_in)
     enddo
  
  end subroutine sw_misfit_ecs
  !-------------------------------------------------------------------------------
  
negative.code: !-------------------------------------------------------------------------------
  
  !===============================================================================
  subroutine sw_error(str)
  !===============================================================================
     implicit none
  