program array_test implicit none real, allocatable, target :: array(:,:) real, pointer :: subarray(:,:) real, pointer :: column(:) integer :: n integer :: allocate_status ! n = 10 allocate( array(n, n), stat = allocate_status ) if (allocate_status /= 0) stop "Could not allocate array" ! subarray => array(3:7,3:7) column => array(:,8) ! nullify(subarray) nullify(column) deallocate(array) end program array_test