Skip to content

OBS003 block-data ​

warning enabled by default

A block data program unit.

Why ​

block data exists only to initialise common blocks and is obsolescent since Fortran 2018. Initialise module variables in their module instead.

Reported ​

fortran
block data init

Preferred ​

fortran
module state
  real :: t = 0.0
end module state

Suppressing ​

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

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

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

Equivalent ​

Fortitude rule OB013 (see Lint Rules).