All references to arrays in this post are multi-dimensional.
I came to know that when an array is passed a subroutine, it can be declared with different dimensions/s
Multi-dimensional arrays in Fortran are stored in column-major order. In memory, they the elements are linear order and the memory offset is calculated from the multi-dimensional indices. The equation is given at http://en.wikipedia.org/wiki/Row-major_order. The Fortran compiler will use that equation and calculate an position in memory based on the dimensions that you provide. To figure out the correspondence between elements when you declare a multi-dimensional array with different dimensions, apply the equation twice using the different dimensions. The compiler doesn't move values in memory. It calculates position in memory from the index values, based on the dimensions.
There are cases where the code generated by the Fortran compiler will copy values, creating a temporary array. e.g., if the actual array argument in the call involves a stride, the compiler might need to create a contiguous temporary array to be compatible with the argument of the subroutine.
From the Fortran 2008 standard (12.5.2.11.4):
An actual argument that represents an element sequence and corresponds to a dummy argument that is an array is sequence associated with the dummy argument if the dummy argument is an explicit-shape or assumed-size array. The rank and shape of the actual argument need not agree with the rank and shape of the dummy argument, but the number of elements in the dummy argument shall not exceed the number of elements in the element sequence of the actual argument. If the dummy argument is assumed-size, the number of elements in the dummy argument is exactly the number of elements in the element sequence.
It is completely legal to use a different shape and rank of the array in the subroutine, just do not reference more elements in the subroutine than the array actually has. Array temporary may be necessary, but often it is not.