16 BLOCK DATA SUBPROGRAM

Block data subprograms are used to provide initial values for variables and array elements in named common blocks.

A block data subprogram is a program unit that has a BLOCK DATA statement as its first statement. A block data subprogram is nonexecutable. There may be more than one block data subprogram in an executable program.

16.1 BLOCK DATA Statement

The form of a BLOCK DATA statement is:
BLOCK DATA [sub]
where sub is the symbolic name of the block data subprogram in which the BLOCK DATA statement appears.

The optional name sub is a global name ( 18.1.1) and must not be the same as the name of an external procedure, main program, common block, or other block data subprogram in the same executable program. The name sub must not be the same as any local name in the subprogram.

16.2 Block Data Subprogram Restrictions

The BLOCK DATA statement must appear only as the first statement of a block data subprogram. The only other statements that may appear in a block data subprogram are IMPLICIT, PARAMETER, DIMENSION, COMMON, SAVE, EQUIVALENCE, DATA, END, and type-statements. Note that comment lines are permitted.

If an entity in a named common block is initially defined, all entities having storage units in the common block storage sequence must be specified even if they are not all initially defined. More than one named common block may have entities initially defined in a single block data subprogram.

Only an entity in a named common block may be initially defined in a block data subprogram. Note that entities associated with an entity in a common block are considered to be in that common block.

The same named common block may not be specified in more than one block data subprogram in the same executable program.

There must not be more than one unnamed block data subprogram in an executable program.


[Contents] [Previous] [Next] [Home]

 

NDP77
http://www.ndp77.net
webmaster MFA (main)
webmaster@ndp77.net