anchor.diff:          integer :: step, dpos, npos, spos, nexts, nextd, nextn
           integer :: north, south, east, west, top, bottom, n
           real :: u, v
  +        real,allocatable :: u1d(:),v1d(:)
           real :: dweight, nweight, sweight, curspd, curdir, curnsq, wind_first, wind_second
           real :: blocked
   
  
positive.code:             preU_layers(i)=sum(domain%u(:realnx_u,i,:))/(realnx_u * realny)
              preV_layers(i)=sum(domain%v(:,i,:realny_v))/(realnx * realny_v)
          enddo
          do i=1,nz
              bottom = max(1, i-vsmooth)
              top    = min(i+vsmooth, nz)
  
              U_layers(i)=sum(preU_layers(bottom:top))/(top-bottom+1)
              V_layers(i)=sum(preV_layers(bottom:top))/(top-bottom+1)
          enddo
  
          if (.not.data_allocated) then
              if (debug) then
  
negative.code:             end do
          end do
          !$omp end do
          deallocate(u1d, v1d)
          !$omp end parallel
      end subroutine spatial_winds
  
  