The elements of a nonempty sequence are referred to as the first element, second element, etc. The nth element, where n is the number of elements in the sequence, is called the last element. An empty sequence has no first or last element.
The form of a constant is described in Section 4.
A symbolic name takes the form of a sequence of one to six letters or digits, the first of which must be a letter. Classification of symbolic names and restrictions on their use are described in Section 18.
A statement label takes the form of a sequence of one to five digits, one of which must be nonzero, and is used to identify a statement (3.4).
A keyword takes the form of a specified sequence of letters. The keywords that are significant in the FORTRAN language are described in Sections 7 through 16. In many instances, a keyword or a portion of a keyword also meets the requirements for a symbolic name. Whether a particular sequence of characters identifies a keyword or a symbolic name is implied by context. There is no sequence of characters that is reserved in all contexts in FORTRAN.
The set of special characters is described in 3.1.4. A special character may be an operator or part of a constant or have some other special meaning. The interpretation is implied by context.
A statement is written in one or more lines, the first of which is called an initial line (3.2.2); succeeding lines, if any, are called continuation lines (3.2.3).
There is also a line called a comment line (3.2.1), which is not part of any statement and is intended to provide documentation.
A main program is a program unit that does not have a FUNCTION, SUBROUTINE, or BLOCK DATA statement as its first statement; it may have a PROGRAM statement as its first statement.
A subprogram is a program unit that has a FUNCTION, SUBROUTINE, or BLOCK DATA statement as its first statement. A subprogram whose first statement is a FUNCTION statement is called a function subprogram. A subprogram whose first statement is a SUBROUTINE statement is called a subroutine subprogram. Function subprograms and subroutine subprograms are called procedure subprograms. A subprogram whose first statement is a BLOCK DATA statement is called a block data subprogram.
The type of a variable is optionally specified by the appearance of the variable name in a type-statement (8.4). If it is not so specified, the type of a variable is implied by the first letter of the variable name to be integer or real (4.1.2), unless the initial letter type implication is changed by the use of an IMPLICIT statement (8.5).
At any given time during the execution of an executable program, a variable is either defined or undefined (2.11).
An array element has a type. The type of all array elements within an array is the same, and is optionally specified by the appearance of the array name in a type-statement (8.4). If it is not so specified, the type of an array element is implied by the first letter of the array name to be integer or real (4.1.2), unless the initial letter type implication is changed by the use of an IMPLICIT statement (8.5).
At any given time during the execution of an executable program, an array element is either defined or undefined (2.11).
At any given time during the execution of an executable program, a substring is either defined or undefined (2.11).
Each dummy argument name that is classified as a variable, array, or dummy procedure may appear wherever an actual name of the same class (Section 18) and type may appear, except where explicitly prohibited.
The name of the main program and the names of block data subprograms, external functions, subroutines, and common blocks have a scope of an executable program.
The names of variables, arrays, constants, statement functions, intrinsic functions, and dummy procedures have a scope of a program unit.
The names of variables that appear as dummy arguments in a statement function statement have a scope of that statement.
The names of variables that appear as the DO-variable of an implied-DO in a DATA statement have a scope of the implied-DO list.
Statement labels have a scope of a program unit.
A defined entity has a value. The value of a defined entity does not change until the entity becomes undefined or is redefined with a different value.
If a variable, array element, or substring is undefined, it does not have a predictable value.
A previously defined variable or array element may become undefined. Subsequent definition of a defined variable or array element is permitted, except where it is explicitly prohibited.
A character variable, character array element, or character substring is defined if every substring of length one of the entity is defined. Note that if a string is defined, every substring of the string is defined, and if any substring of the string is undefined, the string is undefined. Defining any substring does not cause any other string or substring to become undefined.
An entity is initially defined if it is assigned a value in a DATA statement (Section 9). Initially defined entities are in the defined state at the beginning of execution of an executable program. All variables and array elements not initially defined, or associated (2.14) with an initially defined entity, are undefined at the beginning of execution of an executable program.
An entity must be defined at the time a reference to it is executed.
A procedure reference is the appearance of a procedure name in a statement in a context that requires the actions specified by the procedure to be executed during the execution of the executable program. When a procedure reference is executed, the procedure must be available.
An integer, real, or logical datum has one numeric storage unit in a storage sequence. A double precision or complex datum has two numeric storage units in a storage sequence. A character datum has one character storage unit in a storage sequence for each character in the datum. This standard does not specify a relationship between a numeric storage unit and a character storage unit.
If a datum requires more than one storage unit in a storage sequence, those storage units are consecutive.
The concept of a storage sequence is used to describe relationships that exist among variables, array elements, arrays, substrings, and common blocks. This standard does not specify a relationship between the storage sequence concept and the physical properties or implementation of storage.
Entities may become associated by the following: