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.
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:
Valid | |
NUMBER | |
FIND_IT | |
X | |
Invalid | Explanation |
5Q | Begins with a numeral. |
B.4
| Contains a special character other than _ or $. |
_WRONG | Begins with an underscore. |
Examples
For details on the scope of names, see Section 16.1.