! ----------------------------- ! Example program ! Assumed-shape arrays ! ----------------------------- program test implicit none interface subroutine cube(A) integer,dimension(:,:),intent(inout):: A end subroutine cube end interface integer, parameter:: n=3,m=2 integer :: A(n,m) A(1,1) = 11 A(1,2) = 12 A(2,1) = 21 A(2,2) = 22 A(3,1) = 31 A(3,2) = 32 print*,' A=' write(*,99) A call cube(A) print*,' A**3=' write(*,99) A 99 format(2(3i8,/)) end program test subroutine cube(A) implicit none ! assumed-shape array: integer,intent(inout):: A(:,:) print*,'shape of A is ',shape(A) A = A**3 end subroutine cube