-
Assumed size = array is purely passed by reference, you decide what size it should be. Whatever the array is like outside of the subroutine does not matter (rank, size, bounds…).
Nice because you can “reshape” arrays if you like only inside a particular subroutine, but also very dangerous (no bounds checking is possible) -
Assumed shape = array size information (only rank, size) is passed along with the data, but not bounds information (all dimensions are assumed to start at 1, unless you specify a different bound manually like
real :: A(0:)
).
Much safer, but careful! you cannot pass unallocatedallocatable
arrays into this interface. -
Allocatable = array size information (rank, size AND bounds) and presence (allocated(array)) is passed along with the data. Safest, but may be slower as far as I’m told. Also: cannot differentiate between allocatable and assumed-shape arguments in generic interfaces.
2 Likes