2.1.2 Names

Names identify entities within a Fortran program unit (such as variables, function results, common blocks, named constants, procedures, program units, namelist groups, and dummy arguments). In FORTRAN 77, names were called "symbolic names".

A name can contain letters, digits, underscores ( _ ), and the dollar sign ($) special character. The first character must be a letter or a dollar sign..

In Fortran 95/90, a name can contain up to 31 characters. Compaq Fortran allows names up to 63 characters.

The length of a module name (in MODULE and USE statements) may be restricted by your file system.

Note: Be careful when defining names that contain dollar signs.

On OpenVMS systems, naming conventions reserve names containing dollar signs to those created by Compaq. On Tru64 UNIX, Linux, and Windows systems, a dollar sign can be a symbol for command or symbol substitution in various shell and utility commands.

In an executable program, the names of the following entities are global and must be unique in the entire program:


The following examples demonstrate valid and invalid names:

Invalid  Explanation 
5Q   Begins with a numeral. 
B.4   Contains a special character other than _ or $
_WRONG  Begins with an underscore. 


For details on the scope of names, see Section 16.1.

Previous Page Next Page Table of Contents