Sorry I just noticed your reply. First, please note the goal and purpose of good tools will be that no one has to be a “grandmaster” to use them; Fortran is ultimately just a tool and a hope and vision for it has to be that at least in the domains for which it is optimized, say scientific and technical computing, it will be simple enough that no one, especially me, will go around staking a “grandmaster” title with it!!
Second, please note the reason I directed you to the book is because there are several details that are pertinent to your inquiry about performance and dummy argument INTENT
s. As such, your inquiry becomes rather broad-based to be fully captured and understood in an online thread. The book by Clerman and Spector makes an attempt to address this specifically, hence my opinion it is a good place to start.
This all starts with the fact there are some differences when it comes to Fortran language and its standard between IN
, INOUT
, and OUT
(and also undeclared INTENT
!) . As pointed out to you, INTENT(OUT)
, for example, leaves a dummy argument undefined until it is defined in the procedure. Depending on the purpose of that argument (e.g., problem data or work area, etc.), this aspect can even lead to undesired or incorrect program behavior or cause crashes, a far deeper issue that precedes any performance considerations.
Also, everything pertaining to the so-called “processors” in Fortran (hardware, compilers, etc.) have advanced so much that when it comes to sequential programming, it would take a lot of attention to detail and effort to meaningfully differentiate between performance differences in cases - usually micro
benchmarks - that really capture what INTENT
attribute can deliver.
As you will know, a lot of the real performance advantages now, but more so in the near future, are going to be with non-sequential aspects of program execution. Such as parallelization, concurrency, vectorization, etc. With these, you will notice the promises or rather declarations or demands by program authors in the form of PURE
, ELEMENTAL
, and soon SIMPLE
procedures will be critical for the compilers to oblige and yield the authors with performance gains.
Here again you will know the language requires you to explicitly state the INTENT
s with pure/elemental and simple procedures. Not just specify INTENTs but follow specific rules with them also.
The book by Clerman and Spector gets into this as well. Also other books e.g., Numerical Computing with Modern Fortran by Hanson and Hopkins. Hence my suggestion.
By the way, it’s my own personal opinion only - it has nothing to do with the admins/moderators of this forum - books are a better place to start when it comes to matters that involve details and various subtleties.