Next: , Up: Intrinsic Procedures


8.1 Introduction to intrinsic procedures

Gfortran provides a rich set of intrinsic procedures that includes all the intrinsic procedures required by the Fortran 95 standard, a set of intrinsic procedures for backwards compatibility with Gnu Fortran 77 (i.e., g77), and a small selection of intrinsic procedures from the Fortran 2003 standard. Any description here, which conflicts with a description in either the Fortran 95 standard or the Fortran 2003 standard, is unintentional and the standard(s) should be considered authoritative.

The enumeration of the KIND type parameter is processor defined in the Fortran 95 standard. Gfortran defines the default integer type and default real type by INTEGER(KIND=4) and REAL(KIND=4), respectively. The standard mandates that both data types shall have another kind, which have more precision. On typical target architectures supported by gfortran, this kind type parameter is KIND=8. Hence, REAL(KIND=8) and DOUBLE PRECISION are equivalent. In the description of generic intrinsic procedures, the kind type parameter will be specified by KIND=*, and in the description of specific names for an intrinsic procedure the kind type parameter will be explicitly given (e.g., REAL(KIND=4) or REAL(KIND=8)). Finally, for brevity the optional KIND= syntax will be omitted.

Many of the intrinsics procedures take one or more optional arguments. This document follows the convention used in the Fortran 95 standard, and denotes such arguments by square brackets.

Gfortran offers the -std=f95 and -std=gnu options, which can be used to restrict the set of intrinsic procedures to a given standard. By default, gfortran sets the -std=gnu option, and so all intrinsic procedures described here are accepted. There is one caveat. For a select group of intrinsic procedures, g77 implemented both a function and a subroutine. Both classes have been implemented in gfortran for backwards compatibility with g77. It is noted here that these functions and subroutines cannot be intermixed in a given subprogram. In the descriptions that follow, the applicable option(s) is noted.