Reputation: 877
I am trying to understand a Fortran code written by someone else. The code is doing what it is supposed to do so I am assuming that it works fine. A subroutine called "fft" is being called from another subroutine called "convol". Inside "convol", an array is declared like this:
real, dimension fri(n+1,n,nh,2,0:1)
call fft(fri)
Inside "fft", the declaration is like this:
subroutine wrft3b(fri)
real, dimension fri(2,n+1,n,nh,0:1)
I don't understand why the array lengths are not consistent and still the code is working. Any clues what might be happening here?
Upvotes: 1
Views: 1387
Reputation: 60008
The important thing is that the length is the same. If the interface is not explicit, this will not throw an error for the contiguous explicit-shape array. Only the elements of the array will have different indexes (determined by the column-major order), that in the calling program.
Upvotes: 1