(The following information augments or overrides the information in Chapter 4 of ANSI X3.9-1978 FORTRAN 77 in specifying the GNU Fortran language. Chapter 4 of that document otherwise serves as the basis for the relevant aspects of GNU Fortran.)
To more concisely express the appropriate types for
entities, this document uses the more concise
Fortran 90 nomenclature such as
instead of the more traditional, but less portably concise,
byte-size-based nomenclature such as
When referring to generic types—in contexts where the
specific precision and range of a type are not important—this
document uses the generic type names
In some cases, the context requires specification of a particular type. This document uses the `KIND=' notation to accomplish this throughout, sometimes supplying the more traditional notation for clarification, though the traditional notation might not work the same way on all GNU Fortran implementations.
Use of `KIND=' makes this document more concise because g77 is able to define values for `KIND=' that have the same meanings on all systems, due to the way the Fortran 90 standard specifies these values are to be used.
(In particular, that standard permits an implementation to
arbitrarily assign nonnegative values.
There are four distinct sets of assignments: one to the
type; one to the
INTEGER type; one to the
and the fourth to both the
Implementations are free to assign these values in any order,
leave gaps in the ordering of assignments, and assign more than
one value to a representation.)
This makes `KIND=' values superior to the values used in non-standard statements such as `INTEGER*4', because the meanings of the values in those statements vary from machine to machine, compiler to compiler, even operating system to operating system.
However, use of `KIND=' is not generally recommended when writing portable code (unless, for example, the code is going to be compiled only via g77, which is a widely ported compiler). GNU Fortran does not yet have adequate language constructs to permit use of `KIND=' in a fashion that would make the code portable to Fortran 90 implementations; and, this construct is known to not be accepted by many popular FORTRAN 77 implementations, so it cannot be used in code that is to be ported to those.
The distinction here is that this document is able to use specific values for `KIND=' to concisely document the types of various operations and operands.
A Fortran program should use the FORTRAN 77 designations for the
appropriate GNU Fortran types—such as
DOUBLE COMPLEX for
where no such designations exist, make use of appropriate
techniques (preprocessor macros, parameters, and so on)
to specify the types in a fashion that may be easily adjusted
to suit each particular implementation to which the program
(These types generally won't need to be adjusted for ports of
Further details regarding GNU Fortran data types and constants are provided below.