anchor.diff:         if (uvw(2) > 0) then
             do i = ijk0(2), ijk1(2) - 1
                ijk0(2) = i
  -             print *, ijk0, "OUT_TOP"
  +             if (all(ijk0 >= 0) .and. all(ijk0 <= m % dimension)) print *, ijk0, "OUT_TOP"
             end do
          else
             do i = ijk0(2) - 1, ijk1(2), -1
                ijk0(2) = i
  -             print *, ijk0, "IN_TOP"
  +             if (all(ijk0 >= 0) .and. all(ijk0 <= m % dimension)) print *, ijk0, "IN_TOP"
             end do
          end if
          return
  
positive.code:              ! current in (i-1,j,k)
               ijk0(1) = ijk0(1) - 1
               xyz_cross(1) = xyz_cross(1) - m % width(1)
               print *, ijk0, "IN_RIGHT"
  
            end if
         elseif (distance == d(2)) then
            if (uvw(2) > 0) then
               ! Crossing into front mesh cell -- this is treated as outgoing
               ! current in (i,j,k)
               print *, ijk0, "OUT_FRONT"
               ijk0(2) = ijk0(2) + 1
               xyz_cross(2) = xyz_cross(2) + m % width(2)
            else
  
negative.code:        if (uvw(3) > 0) then
            do i = ijk0(3), ijk1(3) - 1
               ijk0(3) = i
               if (all(ijk0 >= 0) .and. all(ijk0 <= m % dimension)) print *, ijk0, "OUT_TOP"
            end do
         else
            do i = ijk0(3) - 1, ijk1(3), -1
               ijk0(3) = i
               if (all(ijk0 >= 0) .and. all(ijk0 <= m % dimension)) print *, ijk0, "IN_TOP"
            end do
         end if
         return
  