HP Fortran Programmer's Reference (September 2007)

Language elements
Source format of program file
Chapter 2 49
Statement labels
Statement labels are not required to be in columns 1-5, but must be separated from the
statement by at least one space.
Spaces
Spaces are significant:
They may not appear within a lexical token, such as a name or an operator.
In general, one or more spaces are required to separate adjacent statement keywords,
names, constants, or labels. Within the keyword pairs listed in Table 2-4, however, the
space is optional. The keyword following END can be: BLOCK DATA, DO, FILE, FUNCTION, IF,
INTERFACE, MAP, MODULE, PROGRAM, SELECT, SUBROUTINE, STRUCTURE, TYPE, UNION, or
WHERE.
Spaces are not required between a name and an operator because the latter begins and
ends with special symbols that cannot be part of a name. Multiple spaces, unless in a
character context, are equivalent to a single space.
Consider the spaces (designated by
b
) in the following statement:
IF
bb
(TEXT.EQ.'
bbb
YES') ... ! Valid
The two spaces after IF are valid and are equivalent to one space. No spaces are required
before or after .EQ., because there is no ambiguity. However, the three spaces in the character
constant are significant.
In the next example
IF(M
b
ARY.
b
GE.MIKE) ... ! Faulty in free source form
the spaces are invalid in free source form but valid in fixed source form.
Table 2-4 Keywords allowing optional spacing
BLOCK DATA GO TO
DOUBLE PRECISION IN OUT
ELSE IF SELECT CASE
END
keyword