A Fortran program must include one main program. It takes the following form:
An automatic object must not appear in a specification statement. If a SAVE statement is specified, it has no effect.
Rules and Behavior
The PROGRAM statement is optional. Within a program unit, a PROGRAM statement can be preceded only by comment lines or an OPTIONS statement.
The END statement is the only required part of a program. If a name follows the END statement, it must be the same as the name specified in the PROGRAM statement.
The program name is considered global and must be unique. It cannot be the same as any local name in the main program or the name of any other program unit, external procedure, or common block in the executable program.
A main program must not reference itself (either directly or indirectly).
The following is an example of a main program:
PROGRAM TEST INTEGER C, D, E(20,20) ! Specification part CALL SUB_1 ! Executable part ... CONTAINS SUBROUTINE SUB_1 ! Internal subprogram ... END SUBROUTINE SUB_1 END PROGRAM TEST
For More Information:
For details on the default name for a main program, see your user manual or programmer's guide.