In a 1-D allocatable array, you can append to it with
integer, allocatable :: arr(:)
allocate(arr(0))
arr = [arr, 9]
Is the same sort of thing possible in a 2-D array?
integer, allocatable :: arr(:,:)
allocate(arr(2,0))
arr = [arr, [9,10]]
In the code above I would want arr
to end up having size [2,1]
, with entries [9,10]
Thanks!