IMPLICIT Statement (Nonexecutable) [ HP FORTRAN 77/iX Reference ] MPE/iX 5.0 Documentation
HP FORTRAN 77/iX Reference
IMPLICIT Statement (Nonexecutable)
The IMPLICIT statement overrides or confirms the default type associated
with the first letter of a variable name.
Semantics
For more information on types, refer to the discussions of each type,
elsewhere in this chapter.
An IMPLICIT statement specifies a default type for all variables, arrays,
named constants, function subprograms, ENTRY names in function
subprograms, and statement functions that begin with any letter that
appears in an IMPLICIT statement and are not explicitly given a type. It
does not change the type of any intrinsic functions.
The IMPLICIT statement itself can be overridden for specific names when
these names appear in a type statement. For example,
IMPLICIT INTEGER (A)
specifies that items whose names start with the letter A default to type
INTEGER. However, a subsequent type statement, such as
REAL ABLE
overrides the IMPLICIT defaults and sets the variable ABLE to type REAL.
Uppercase and lowercase letters are equivalent in arguments to the
IMPLICIT statement. Therefore, both the following
IMPLICIT INTEGER (Q)
IMPLICIT INTEGER (q)
are the same.
An explicit type specification in a FUNCTION statement overrides an
IMPLICIT statement for the function name. Note that the length is also
overridden when a particular name appears in a CHARACTER or CHARACTER
FUNCTION statement.
NOTE A variable in parentheses cannot be used as a length specifier for
a character data type in an IMPLICIT statement.
The IMPLICIT NONE form is a MIL-STD-1753 extension to the ANSI 77
standard. If IMPLICIT NONE is specified, implicit data typing is
disabled and all variables, arrays, named constants, function
subprograms, entry names in function subprograms, and statement functions
(but not intrinsic functions) must be explicitly typed. If IMPLICIT NONE
is specified, it must be the only IMPLICIT statement in the program unit.
The types of intrinsic functions are not affected. The IMPLICIT NONE
statement is recommended for general use as an excellent structured
programming construct, because it forces the declaration of all
user-defined names.
Within the specification statements of a program unit, IMPLICIT
statements must precede all other specification statements, except
PARAMETER statements. A letter must not be specified more than once,
whether singly or in a range of letters, in all the IMPLICIT statements
in a program unit.
Specifying a range of letters (for example, A-E) has the same effect as
writing a list of single letters (for example, A,B,C,D,E).
Examples Notes
---------------------------------------------------------------------------------------
IMPLICIT COMPLEX*16(i,j,k),INTEGER*2(a-c) All user-defined symbolic names beginning
with i, j, or k default to type COMPLEX*16.
Those beginning with a, b, or c default to
type INTEGER*2.
IMPLICIT NONE All names must be declared. An error
INTEGER i,j,k occurs in the fourth line because a was not
REAL x,y,z declared.
a = x+y
STOP
END
MPE/iX 5.0 Documentation