I'm trying to understand a bug that I encountered in my code. When trying to allocate an array using the transpose of an array, I use an allocate statement with source=transpose(original_array) in my code. However, I don't get the expected result using this method. It seems that the indexing is off by one and the first row of the source array is skipped.
Example:
program testalloc
real*8, allocatable :: a(:, :)
real*8, allocatable :: b(:, :)
allocate(b(2, 3))
b(1, :) …Run Code Online (Sandbox Code Playgroud)