! -------------------------------------------------- ! Example program ! using lbound,ubound and size ! with assumed-shape arrays ! ! Warning: The result changes depending on ! presense of the interface! ! Use of ubound and size may be "illegal" ! -------------------------------------------------- program test implicit none !!$ interface !!$ subroutine bounds(vector,matrix) !!$ real(kind(1.d0)):: vector(:),matrix(:,:) !!$ end subroutine bounds !!$ end interface real(kind(1.d0)):: vector(-2:10),matrix(0:5,8) call bounds(vector,matrix) end program test subroutine bounds(vector,matrix) implicit none real(kind(1.d0)):: vector(:),matrix(:,:) print*,'lbound(vector)',lbound(vector) print*,'ubound(vector)',ubound(vector) print*,'size(vector)',size(vector) print*,'lbound(matrix)',lbound(matrix) print*,'ubound(matrix)',ubound(matrix) print*,'size(matrix)',size(matrix) end subroutine bounds