# 3.1 Intrinsic Data Types

Compaq Fortran provides the following intrinsic data types:

- INTEGER (see Section 3.1.1)

  There are four kind parameters for data of type integer:

  - INTEGER([KIND=]1) or INTEGER*1
  - INTEGER([KIND=]2) or INTEGER*2
  - INTEGER([KIND=]4) or INTEGER*4
  - INTEGER([KIND=]8) or INTEGER*8
- REAL (see Section 3.1.2)

  There are three kind parameters for data of type real:

  - REAL([KIND=]4) or REAL*4
  - REAL([KIND=]8) or REAL*8
  - REAL([KIND=]16) or REAL*16

    This kind is only available on OpenVMS, Tru64 UNIX, and Linux systems.

- DOUBLE PRECISION (see Section 3.1.2)

  No kind parameter is permitted for data declared with type DOUBLE PRECISION. This data type is the same as REAL([KIND=]8).

- COMPLEX (see Section 3.1.3)

  There are three kind parameters for data of type complex:

  - COMPLEX([KIND=]4) or COMPLEX*8
  - COMPLEX([KIND=]8) or COMPLEX*16
  - COMPLEX([KIND=]16) or COMPLEX*32

    This kind is only available on OpenVMS, Tru64 UNIX, and Linux systems.

- DOUBLE COMPLEX (see Section 3.1.3)

  No kind parameter is permitted for data declared with type DOUBLE COMPLEX. This data type is the same as COMPLEX([KIND=]8).

- LOGICAL (see Section 3.1.4)

  There are four kind parameters for data of type logical:

  - LOGICAL([KIND=]1) or LOGICAL*1
  - LOGICAL([KIND=]2) or LOGICAL*2
  - LOGICAL([KIND=]4) or LOGICAL*4
  - LOGICAL([KIND=]8) or LOGICAL*8
- CHARACTER (see Section 3.1.5)

  There is one kind parameter for data of type character: CHARACTER([KIND=]1).

- BYTE

  This is a 1-byte value; the data type is equivalent to INTEGER([KIND=]1).

The intrinsic function KIND can be used to determine the kind type parameter of a representation method.

For more portable programs, you should not use the forms INTEGER([KIND=]n) or REAL([KIND=]n). You should instead define a PARAMETER constant using the SELECTED_INT_KIND or SELECTED_REAL_KIND function, whichever is appropriate. For example, the following statements define a PARAMETER constant for an INTEGER kind that has 9 digits:

    INTEGER, PARAMETER :: MY_INT_KIND = SELECTED_INT_KIND(9)
      ...
    INTEGER(MY_INT_KIND) :: J
      ...

Note that syntax separator :: is used in type declaration statements.

The following sections describe the intrinsic data types and forms for literal constants for each type.

For More Information:

- On declaration statements for intrinsic data types, see Sections 5.1.1 and 5.1.2.
- On operations for intrinsic data types, see Section 4.1.
- On the KIND intrinsic function, see Section 9.3.79.
- On storage requirements for intrinsic data types, see Table 16-2.
- On type declaration statements, see Section 5.1.

Previous Page Next Page Table of Contents