1.3.3 Symbolic Names

Symbolic names identify entities within a Fortran program unit. These entities are listed in Table 1-1.

A symbolic name can contain letters, digits, and the special characters: dollar sign ($) and underscore (_). The first character in a symbolic name must be a letter. The symbolic name can contain a maximum of 31 characters. (FORTRAN-77 limits the length of a symbolic name to six characters.)


Note
Use caution when defining symbolic names that contain dollar signs. On OpenVMS systems, naming conventions reserve names containing dollar signs to those created by Compaq; on Tru64 UNIX and NT systems, a dollar sign can be a symbol for command or symbol substitution in various shell and utility commands. User-created names containing dollar signs may conflict with Compaq created names, Tru64 UNIX symbols, or NT symbols and should be avoided except when specified by Compaq documentation.

Examples

The following examples show valid and invalid symbolic names:

Valid   
NUMBER    
FIND_IT    
X    
Invalid  Explanation 
5Q   Begins with a numeral 
B.4   Contains a special character other than _ or $ 
$FREQ   Begins with a $ 

In most cases, a symbolic name can only identify one entity within a program unit. However, symbolic names can be shared among a common block, a structure, a structure field, and any one of the following: a record, an array, or a variable. A PARAMETER constant can share its name with a structure or record field, and a common block.

In the following valid statements, X is the name of a common block, a structure, a structure field, and a variable:

COMMON /X/ I, J
STRUCTURE /X/
INTEGER X
END STRUCTURE
REAL X

In an executable program with two or more program units, the symbolic names of the following entities must be unique within the entire program:

For example, if your program contains a function named BTU, you cannot use BTU as the symbolic name of any other subprogram, entry, or common block in the program, even if the name appears in a different program unit.

Table 1-1 lists those entities that can be given symbolic names and indicates whether the entities can be given data types.

Table 1-1 Entities Identified by Symbolic Names

Entity  Data Type Assignable 
Variables  Yes 
Arrays  Yes 
Structures  No 
Records  No 
Record elements  Yes 
Statement functions  Yes 
Intrinsic functions  Yes 
Function subprograms  Yes 
Subroutine subprograms  No 
Common blocks  No 
Namelist data groups  No 
Main programs  No 
Block data subprograms  No 
Function entry points  Yes 
Subroutine entry points  No 
Parameter constants  Yes 

For More Information:


Previous Page Next Page Table of Contents