Intel® Fortran Compiler Classic and Intel® Fortran Compiler Developer Guide and Reference

ID 767251
Date 6/24/2024
Public

A newer version of this document is available. Customers should click here to go to the newest version.

Visible to Intel only — GUID: GUID-F93AE784-EF45-468F-9F42-46283B47F3B3

Document Table of Contents

Scalar Types

The commonly used types are included in the following table. Named Constants in the ISO_C_BINDING Module contains a full list of named kind constants that correspond to other C types.

The following rules apply:

  • Integer types in Fortran are always signed. In C, integer types may be specified as signed or unsigned, but are signed by default.

  • The values of C_LONG, C_SIZE_T, C_LONG_DOUBLE, and C_LONG_DOUBLE_COMPLEX are different on different platforms.

Named Constant from ISO_C_BINDING

(Kind Type Parameter If Value Is Positive)

C Type

Equivalent Fortran Type

C_SHORT

C_INT

C_LONG

C_LONG_LONG

short int

int

long int

long long int

INTEGER(KIND=2)

INTEGER(KIND=4)

INTEGER (KIND=4 or 8)

INTEGER(KIND=8)

C_SIGNED_CHAR

signed char

unsigned char

INTEGER(KIND=1)

C_SIZE_T

size_t

INTEGER(KIND=4 or 8)

C_INT8_T

C_INT16_T

C_INT32_T

C_INT64_T

int8_t

int16_t

int32_t

int64_t

INTEGER(KIND=1)

INTEGER(KIND=2)

INTEGER(KIND=4)

INTEGER(KIND=8)

C_FLOAT

C_DOUBLE

C_LONG_DOUBLE

float

double

long double

REAL(KIND=4)

REAL(KIND=8)

REAL(KIND=8 or 16)

While there are named constants for all possible C types, every type is not necessarily supported on every processor. Lack of support is indicated by a negative value for the constant in the module.

For a character type to be interoperable, you must either omit the length type parameter or specify it using a constant expression with a value of one.

See Also