HP Fortran Programmer's Reference (September 2007)

Program units and procedures
Main program
Chapter 7158
Main program
A main program is a program unit. There must be exactly one main program in an executable
program. Execution always begins with the main program.
The main program can determine the overall design and structure of the complete program
and often performs various computations by referencing procedures. A program may consist of
the main program alone, in which case all the program logic is contained within it.
A main program has the form:
[PROGRAM
program-name
]
[
specification-part
]
[
execution-part
]
[
internal-procedure-part
]
END [PROGRAM [
program-name
]]
program-name
i s the name of the program.
program-name
can appear on the END PROGRAM
statement only if it also appears on the PROGRAM statement; the name must
be the same in both places.
specification-part
is zero or more of the statements listed in Table 7-1 as well as any of the
following:
Type declaration statement
Derived-type definition
Interface block
Statement function
Cray-style pointer statement (HP extension)
Structure definition (HP extension)
Record declaration (HP extension)
execution-part
is zero or more of the statements or constructs listed in Table 7-2 as well as
any of the following:
Assignment statement
Pointer assignment statement