Skip to content

MDN041 out-of-line-attribute ​

warning enabled by default

An attribute given in a separate statement (dimension a(n), intent(in) :: x, parameter (...)).

Why ​

Attribute statements scatter the description of one variable over several lines: the reader must collect them to know what the variable is. Give the attributes in its type declaration.

Reported ​

fortran
real :: a
dimension a(10)
intent(in) :: a

Preferred ​

fortran
real, dimension(10), intent(in) :: a

Suppressing ​

For one occurrence, with the reason on the same line (or alone on the line before the statement):

fortran
! fobis: ignore[MDN041] <why this occurrence is fine>

For the whole project, ignore = MDN041 in the fobos [lint] section.

Equivalent ​

Fortitude rule MOD041 (see Lint Rules).