Skip to content

COR031 procedure-not-in-module ​

warning enabled by default

A subroutine or function is defined outside a module (an external procedure).

Why ​

External procedures have implicit interfaces at every call site that does not repeat an interface block, so argument mismatches go undetected. Module procedures get explicit interfaces for free.

Reported ​

fortran
subroutine helper(x)
  ...
end subroutine helper

Preferred ​

fortran
module helpers
contains
  subroutine helper(x)
    ...
  end subroutine helper
end module helpers

Suppressing ​

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

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

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

Equivalent ​

Fortitude rule C092 (see Lint Rules).