title: Array section with vector subscript as procedure argument
body: <p>Here is an example of my problem (in my real program, <code>A</code> would be much larger and random) :</p>
  <pre><code>    MODULE MOD_TST
          contains
          subroutine function_tst(A,B)
              real,intent(in) :: A(:)
              real,intent(out) :: B(:)
              integer :: i, n
              n = size(A)
              do i=1,n; B(i) = A(i); end do
          end subroutine function_tst
      end module MOD_TST
      
      PROGRAM PROG_TST
        USE MOD_TST
  
        IMPLICIT NONE
        integer,allocatable :: A(:),B1(:),B2(:),subA(:),subB(:)
        integer :: i, n = 10, p = 3
        integer,allocatable :: list(:)
  
        allocate(A(n),B1(n),B2(n))
        A = (/ 9, 5, 4, 7, 8, 1, 6, 0, 3, 2/)
      
        list = pack ( [( i, i=1,n )] , modulo(A,p) .eq. 0)
        allocate(subA(size(list)),subB(size(list)))
        subA=A(list); subB=B1(list);
  
        call function_tst(subA,subB)
        B1(list) = subB
  
        call function_tst(A(list),B2(list))
  
        write(*,*)'A ',A
        write(*,*)'B1',B1
        write(*,*)'B2',B2
      END PROGRAM PROG_TST
  </code></pre>
  <p>The output I get is :</p>
  <blockquote>
  <p>A  9  5  4  7  8  1  6  0  3  2</p>
  <p>B1 9  0  0  0  0  0  6  0  3  0</p>
  <p>B2 0  0  0  0  0  0  0  0  0  0</p>
  </blockquote>
  <p>Is there a way to make it work without having to create an intermediate variable for the procedure?</p>