XL Fortran for AIX 8.1

Language Reference



The IMPLICIT statement changes or confirms the default implicit typing or the default storage class for local entities or, with the form IMPLICIT NONE specified, voids the implicit type rules altogether.


             | .-,------------------------------------. |
             | V                                      | |
                 |        (1)     |
                 |           (2)  |
                 |           (3)  |


  1. IBM Extension.

  2. IBM Extension.

  3. IBM Extension.

specifies a data type. See Type Declaration.

is either a single letter or range of letters. A range of letters has the form letter1-letter2, where letter1 is the first letter in the range and letter2, which follows letter1 alphabetically, is the last letter in the range. Dollar sign ($) and underscore (_) are also permitted in a range. The underscore (_) follows the dollar sign ($), which follows the Z. Thus, the range Y - _ is the same as Y, Z, $, _.


Letter ranges cannot overlap; that is, no more than one type can be specified for a given letter.

In a given scoping unit, if a character has not been specified in an IMPLICIT statement, the implicit type for entities in a program unit or interface body is default integer for entities that begin with the characters I-N, and default real otherwise. The default for an internal or module procedure is the same as the implicit type used by the host scoping unit.

For any data entity name that begins with the character specified by range_list, and for which you do not explicitly specify a type, the type specified by the immediately preceding type_spec is provided. Note that implicit typing can be to a derived type that is inaccessible in the local scope if the derived type is accessible to the host scope.

+-------------------------------IBM Extension--------------------------------+

A character or a range of characters that you specify as STATIC or AUTOMATIC can also appear in an IMPLICIT statement for any data type. A letter in a range_list cannot have both type_spec and UNDEFINED specified for it in the scoping unit. Neither can both STATIC and AUTOMATIC be specified for the same letter.

+----------------------------End of IBM Extension----------------------------+

If you specify the form IMPLICIT NONE in a scoping unit, you must use type declaration statements to specify data types for names local to that scoping unit. You cannot refer to a name that does not have an explicitly defined data type; this lets you control all names that are inadvertently referenced. When IMPLICIT NONE is specified, you cannot specify any other IMPLICIT statement in the same scoping unit, except ones that contain STATIC or AUTOMATIC. You can compile your program with the -qundef compiler option to achieve the same effect as an IMPLICIT NONE statement appearing in each scoping unit where an IMPLICIT statement is allowed.

+-------------------------------IBM Extension--------------------------------+

IMPLICIT UNDEFINED turns off the implicit data typing defaults for the character or range of characters specified. When you specify IMPLICIT UNDEFINED, you must declare the data types of all symbolic names in the scoping unit that start with a specified character. The compiler issues a diagnostic message for each symbolic name local to the scoping unit that does not have an explicitly defined data type.

+----------------------------End of IBM Extension----------------------------+

An IMPLICIT statement does not change the data type of an intrinsic function.

+-------------------------------IBM Extension--------------------------------+

Using the -qsave/-qnosave compiler option modifies the predefined conventions for storage class:

-qsave compiler option makes the predefined convention IMPLICIT STATIC( a - _ )
-qnosave compiler option makes the predefined convention IMPLICIT AUTOMATIC( a - _ )

Even if you specified the -qmixed compiler option, the range list items are not case sensitive. For example, with -qmixed specified, IMPLICIT INTEGER(A) affects the implicit typing of data objects that begin with A as well as those that begin with a.

+----------------------------End of IBM Extension----------------------------+


!  This IMPLICIT statement establishes the following
!  implicit typing:
!        A: real
!        B: integer
!        C: real
!        D: complex
!   E to H: real
!     I, J: integer
!  K, L, M: complex
!        N: integer
!   O to Z: real
!        $: real
!        _: real

Related Information

[ Top of Page | Previous Page | Next Page | Table of Contents | Index ]