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/sizes as the caller.
As a specific example, BMAIN is declared with DIMENSION(6,5) in the main program. BMAIN is passed to a subroutine as BSUB, which is declared as:
INTEGER, INTENT(IN) :: BSUB(3,2,0:4)
Questions:
Are the entries in BSUB simply filled one by one from SBMAIN until it is filled (in the order explained here Linear Indexing of Multi-Dimension Arrays in Fortran)?
Are there any dimension matching performed by the compiler? For instance, had BSUB been declared as BSUB(0:4,3,2), would it still hold the correct entries in the correct places?