A DATA statement is used to provide initial values for variables, arrays, array elements, and substrings. A DATA statement is nonexecutable and may appear in a program unit anywhere after the specification statements, if any.

All initially defined entities are defined when an executable program begins execution. All entities not initially defined, or associated with an initially defined entity, are undefined at the beginning of execution of an executable program.

Names of dummy arguments, functions, and entities in blank common (including entities associated with an entity in blank common) must not appear in the list nlist. Names of entities in a named common block may appear in the list nlist only within a block data subprogram.

There must be the same number of items specified by each list nlist and its corresponding list clist. There is a one-to-one correspondence between the items specified by nlist and the constants specified by clist such that the first item of nlist corresponds to the first constant of clist, etc. By this correspondence, the initial value is established and the entity is initially defined. If an array name without a subscript is in the list, there must be one constant for each element of that array. The ordering of array elements is determined by the array element subscript value (5.2.4).

The type of the nlist entity and the type of the corresponding clist constant must agree when either is of type character or logical. When the nlist entity is of type integer, real, double precision, or complex, the corresponding clist constant must also be of type integer, real, double precision, or complex; if necessary, the clist constant is converted to the type of the nlist entity according to the rules for arithmetic conversion (Table 4). Note that if an nlist entity is of type double precision and the clist constant is of type real, the processor may supply more precision derived from the constant than can be contained in a real datum.

Any variable, array element, or substring may be initially defined except for:

an entity that is a dummy argument,

an entity in blank common, which includes an entity associated with an entity in blank common, or

a variable in a function subprogram whose name is also the name of the function subprogram or an entry in the function subprogram.

A variable, array element, or substring must not be initially defined more than once in an executable program. If two entities are associated, only one may be initially defined in a DATA statement in the same executable program.

Each subscript expression in the list nlist must be an integer constant expression except for implied-DO-variables as noted in 9.3. Each substring expression in the list nlist must be an integer constant expression.

m1m2m3 are each an integer constant expression, except that the expression may contain implied-DO-variables of other implied-DO lists that have this implied-DO list within their ranges

The range of an implied-DO list is the list dlist. An iteration count and the values of the implied-DO-variable are established from m1, m2, and m3
exactly as for a DO-loop (11.10), except that the iteration count must be positive. When an implied-DO list appears in a DATA statement, the list items in dlist are specified once for each iteration of the implied-DO list with the appropriate substitution of values for any occurrence of the implied-DO-variable i. The appearance of an implied-DO-variable name in a DATA statement does not affect the definition status of a variable of the same name in the same program unit.

Each subscript expression in the list dlist must be an integer constant expression, except that the expression may contain implied-DO-variables of implied-DO lists that have the subscript expression within their ranges.

The following is an example of a DATA statement that contains implied-DO lists:

An entity in the list nlist that corresponds to a character constant must be of type character.

If the length of the character entity in the list nlist is greater than the length of its corresponding character constant, the additional rightmost characters in the entity are initially defined with blank characters.

If the length of the character entity in the list nlist is less than the length of its corresponding character constant, the additional rightmost characters in the constant are ignored.

Note that initial definition of a character entity causes definition of all of the characters in the entity, and that each character constant initially defines exactly one variable, array element, or substring.