next up previous contents
Next: Parametrised Integers Up: Parametrised Intrinsic Types Previous: Parametrised Intrinsic Types   Contents

Rationale

Fortran 77 programs had some portability problems steming from the fact that the precision of data types is different on different processors. For example, a REAL variable is represented on 4 bytes on a UltraSparc processor, but is represented on 8 bytes on a Cray processor. Therefore, an F77 program that works all right on Cray may fail on UltraSparc, due to insuficient accuracy.

F90 addresses this portability problem using parametrised intrinsic types. The idea is that a processor can support different INTEGER, REAL COMPLEX, CHARACTER and LOGICAL representations; they are usually described in the compiler's manual. F90 allows to explicitly select a specific representation of a data type using a numerical parameter, called data types's kind.

Since several kinds of, say, REALs are allowed, we may ask how do we operate with them in a mixed expression, and how do we use them as procedure arguments. In mixed expressions lower accuracy kind terms are promoted to higher accuracy kinds; actual and dummy procedure arguments must match in both type and kind.


next up previous contents
Next: Parametrised Integers Up: Parametrised Intrinsic Types Previous: Parametrised Intrinsic Types   Contents
Adrian Sandu 2001-08-26