forall-statement (OB071)
This rule is unstable and in preview. The --preview flag is required for use.
This rule is turned on by default.
What it does
Checks for forall statements.
Why is this bad?
The F2018 standard made forall statements obsolescent in favour of do
concurrent. They were orginally added with the intention of parallelising
loops across multiple processors, however, they turned out to have too many
restrictions for compilers to be able to take full advantage of them.
Instead, the do concurrent statement was introduced, which solved many of
these difficulties (although not without its own issues, see [1]), along
with the use of pointer rank remapping.
Example
Use instead:
References
- [1]:
DO CONCURRENTisn’t necessarily concurrent - Metcalf, M., Reid, J. and Cohen, M., 2018, Modern Fortran Explained: Incorporating Fortran 2018, Oxford University Press, Appendix B 'Obsolescent and Deleted Features'