4.9 IMPLICIT Statement

The IMPLICIT statement overrides implied (default) data typing of symbolic names. (The default data type is integer for symbolic names beginning with the letters I through N, and real for symbolic names beginning with any other letter.)

The IMPLICIT statement takes one of the following forms:

IMPLICIT typ (a[,a] ... )[, typ (a[,a] ... )]  . . .
IMPLICIT NONE
typ
Is one of the data type specifiers. (All of the data type specifiers listed in Table 2-1, except for CHARACTER*(*), are allowed in an IMPLICIT statement.)

When typ is equal to CHARACTER*len, len specifies the length for character data type. The len is an unsigned integer constant or an integer constant expression enclosed in parentheses. (See Table 2-1 for the range of len.)

a
Is a single alphabetic character or a range of letters in alphabetical order. The general form c1-c2 specifies a range of letters, from c1 through c2, where c1 precedes c2 in alphabetic order.

Rules and Behavior

The IMPLICIT statement assigns the specified data type to all symbolic names that have no explicit data type and begins with the specified letter or range of letters. It has no effect on the default types of intrinsic procedures.

The IMPLICIT NONE statement disables all implicit defaults. When IMPLICIT NONE appears, all symbolic names in a program unit must be explicitly declared. No other IMPLICIT statements can appear in a program unit containing an IMPLICIT NONE statement.


Note
To receive diagnostic messages when variables are used but not declared, you can specify the compiler option WARN_DECLARATIONS instead of using IMPLICIT NONE.

Examples

The following IMPLICIT statements represent the default in the absence of any explicit data type specifications:

IMPLICIT INTEGER (I,J,K,L,M,N)
IMPLICIT REAL (A-H, O-Z)

As above, the following IMPLICIT statements assign the specified data type in the absence of any explicit data type specification:

IMPLICIT DOUBLE PRECISION (D)
IMPLICIT COMPLEX (S,Y), LOGICAL*1 (L,A-C)
IMPLICIT CHARACTER*32 (T-V)
IMPLICIT CHARACTER*2 (W)

For More Information:

For details on names of compiler options used in this manual, see Section E.4.


Previous Page Next Page Table of Contents