I initialised a 2 by 3 matrix with a = reshape([1, 2, 3, 4, 5, 6], [2, 3]), expecting the first row to be 1 2 3. Printing row by row gives 1 3 5 and 2 4 6 instead. The same data passed to a C routine also arrives transposed.
Why does Fortran order the elements this way, how do I write the initial values in the row order I see on paper, and does the order of nested do loops over a large array make a measurable difference?




