I have written some (limited) demonstration code to show how it could work. The code is non-standard and relies on the C interoperability to manipulate the array descriptors in C.
For instance, the element-by-element appending operation
integer, allocatable :: a(:)
allocate( a(0) )
do i = 1, n
k = <whatever>
a = [a, k]
end do
is dramatically faster with
integer, allocatable :: a(:)
do i = 1, n
k = <whatever>
call resize(a,extend=k)
end do
This would be quite easy to implement in the compilers, I thinkā¦