anchor.diff:           call sw_error('sw_misfit_ecs: Output array for dt_ecs is too small')
      endif
   
  -   allocate(phi2(n), dt2(n))
  +   call sw_alloc(phi2,n)
  +   call sw_alloc(dt2,n)
   
      ! Calculate splitting and misfit for each observation
      do i=1,n
  
positive.code: !-------------------------------------------------------------------------------
  
  !===============================================================================
  subroutine sw_error(str)
  !===============================================================================
     implicit none
  
negative.code: 
     ! Add noise
     if (noise_in > 1.0e-5) then
        call sw_alloc(random_noise, 2*(npts-1)+1)
        call random_seed()
  
        call random_number(random_noise)
  