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

ID 767251
Date 9/08/2022
Public

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

Document Table of Contents

Scalar Types

The commonly used types are included in the following table. The following applies:

  • 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)

C_FLOAT_COMPLEX

C_DOUBLE_COMPLEX

C_LONG_DOUBLE_COMPLEX

float _Complex

double _Complex

long double _Complex

COMPLEX(KIND=4)

COMPLEX(KIND=8)

COMPLEX(KIND=8 or 16)

C_BOOL

_Bool

LOGICAL(KIND=1)

C_CHAR

char

CHARACTER(LEN=1)

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.