I have a question about code speed due to different strategy in passing array to subroutines.
Recently, I have rewritten an old code where only small arrays are passed to subroutines. In my new version, I usually pass all the array with modules.
Unfortunately, I have noticed that my new version of the code is very very much slower than the initial version. I am wondering if this is due to the new way in passing the arrays to subroutine or if the problem is related to something else.
Something else, probably. Obviously you changed more than just how arrays were passed in. You've now made them global module variables and taken them out of the argument list? In that case there is no "passing" at all.
The usual advice is to do performance analysis using a tool such as Intel Vtune Amplifier XE and see where the program is spending most of its time. In most cases it's not where you think.