BLOCK DATA subprogram

Standard: F77 F90 F95 F2003 F2008 F2018 Example program


BLOCK DATA [ blockdata-name ]
      [ specification-part ]
END [ BLOCK DATA [ blockdata-name ] ]

The blank between BLOCK and DATA is optional. The blanks in END BLOCK DATA are optional.

The BLOCK DATA subprogram is considered obsolescent in Fortran 2018.


A BLOCK DATA subprogram supplies initial values for variables in COMMON blocks. It has no other effect. Only one unnamed BLOCK DATA subprogram is allowed.

We recommend that BLOCK DATA and COMMON be avoided, and that MODULEs be used instead.


COMMON statement