Developer Guide and Reference

ID 767251
Date 10/31/2024
Public
Document Table of Contents

real-size

Specifies the default KIND for real and complex declarations, constants, functions, and intrinsics.

Syntax

Linux:

-real-size size

Windows:

/real-size:size

Arguments

size

Is the size for real and complex declarations, constants, functions, and intrinsics. Possible values are: 32, 64, or 128.

Default

real-size 32

Default real and complex declarations, constants, functions, and intrinsics are 4 bytes long (REAL(KIND=4) and COMPLEX(KIND=4)).

Description

This option specifies the default size (in bits) for real and complex declarations, constants, functions, and intrinsics.

Option

Description

real-size 32

Makes default real and complex declarations, constants, functions, and intrinsics 4 bytes long. REAL declarations are treated as single precision REAL (REAL(KIND=4)) and COMPLEX declarations are treated as COMPLEX (COMPLEX(KIND=4)). Real and complex constants of unspecified KIND are evaluated in single precision (KIND=4).

real-size 64

Makes default real and complex declarations, constants, functions, and intrinsics 8 bytes long. REAL declarations are treated as DOUBLE PRECISION (REAL(KIND=8)) and COMPLEX declarations are treated as DOUBLE COMPLEX (COMPLEX(KIND=8)). Real and complex constants of unspecified KIND are evaluated in double precision (KIND=8).

real-size 128

Makes default real and complex declarations, constants, functions, and intrinsics 16 bytes long. REAL declarations are treated as extended precision REAL (REAL(KIND=16)); COMPLEX and DOUBLE COMPLEX declarations are treated as extended precision COMPLEX (COMPLEX(KIND=16)). Real and complex constants of unspecified KIND are evaluated in extended precision (KIND=16).

These compiler options can affect the result type of intrinsic procedures, such as CMPLX, FLOAT, REAL, SNGL, and AIMAG, which normally produce single-precision REAL or COMPLEX results. To prevent this effect, you must explicitly declare the kind type for arguments of such intrinsic procedures.

For example, if real-size 64 is specified, the CMPLX intrinsic will produce a result of type DOUBLE COMPLEX (COMPLEX(KIND=8)). To prevent this, you must explicitly declare any real argument to be REAL(KIND=4), and any complex argument to be COMPLEX(KIND=4).

IDE Equivalent

Visual Studio: Data > Default Real KIND

Alternate Options

real-size 32

Linux: -r4

Windows: /4R4

real-size 64

Linux: -r8, -autodouble

Windows: /4R8, /Qautodouble

real-size 128

Linux: -r16

Windows: /4R16