improved array2d copy

If two 2d arrays have same orientation, the first overload of function
"copy_array2d" is suitable and more economical.