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.

Document Table of Contents

STRICT and NOSTRICT

General Compiler Directive: STRICT disables language features not found in the language standard specified on the command line (Fortran 2018, Fortran 2008, Fortran 2003, Fortran 95, or Fortran 90). NOSTRICT (the default) enables these features.

!DIR$ STRICT

!DIR$ NOSTRICT

If STRICT is specified and no language standard is specified on the command line, the default is to disable features not found in Fortran 2018.

The STRICT and NOSTRICT directives can appear only appear 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. STRICT and NOSTRICT cannot appear between program units, or at the beginning of internal subprograms. They do not affect any modules invoked with the USE statement in the program unit that contains them.

Example

 ! NOSTRICT by default
 TYPE stuff
   INTEGER(4) k
   INTEGER(4) m
   CHARACTER(4) name
 END TYPE stuff
 TYPE (stuff) examp
 DOUBLE COMPLEX cd  ! non-standard data type, no error
 cd =(3.0D0, 4.0D0)
 examp.k = 4        ! non-standard component designation,
                    ! no error
 END
 SUBROUTINE STRICTDEMO( )
   !DIR$ STRICT
    TYPE stuff
     INTEGER(4) k
     INTEGER(4) m
     CHARACTER(4) name
    END TYPE stuff
    TYPE (stuff) samp
    DOUBLE COMPLEX cd   ! ERROR
    cd =(3.0D0, 4.0D0)
    samp.k = 4          ! ERROR
 END SUBROUTINE