module test_mod
  implicit none


contains


  subroutine test(array, m, n)
    integer :: m, n
    real, dimension(:),pointer :: array
    real, dimension(:,:),pointer :: sub
    integer :: i, j
    do i=1, n
       j = (i-1)*m
       sub(:,i) = array(j+1:j+m)
    end do
    write(0,*)"array:", minval(array), maxval(array)
    write(0,*)"sub", minval(sub), maxval(sub)

  end subroutine

end module
