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

ID 767251
Date 3/22/2024
Public
Document Table of Contents

REAL Directive

General Compiler Directive: Specifies the default real kind.

!DIR$ REAL:{ 4 | 8 | 16 }

The REAL directive selects a size of 4 (KIND=4), 8 (KIND=8), or 16 (KIND=16) bytes for default real numbers. When the directive is in effect, all default real and complex variables are of the kind specified in the directive. Only numbers specified or implied as REAL without KIND are affected.

The REAL directive can appear only at the top of a program unit. A program unit is a main program, an external subroutine or function, a module, or a block data program unit. REAL cannot appear at the beginning of internal subprograms. It does not affect modules invoked with the USE statement in the program unit that contains it.

Example

 REAL r              ! a 4-byte REAL
 WRITE(*,*) KIND(r)
 CALL REAL8( )
 WRITE(*,*) KIND(r)  ! still a 4-byte REAL
                     !   not affected by setting in subroutine
 END
 SUBROUTINE REAL8( )
   !DIR$ REAL:8
   REAL s ! an 8-byte REAL
   WRITE(*,*) KIND(s)
 END SUBROUTINE