Intel® Fortran Compiler
Build applications that can scale for the future with optimized code designed for Intel® Xeon® and compatible processors.

ifort v15.0.2 could not pass fortran_2003_iee_test

Juncheng_L_
Beginner
352 Views

Hi all,

I compiled this file with following commands:

ifort fortran_2003_ieee_test.F

And the error is:

fortran_2003_ieee_test.F(39): error #6503: This keyword is invalid for this intrinsic procedure reference.   [UNIT]
      CALL FLUSH (UNIT=6)
------------------^
compilation aborted for fortran_2003_ieee_test.F (code 1)

Here's the code:

      PROGRAM fortran_2003_test         

      USE , INTRINSIC :: IEEE_EXCEPTIONS

      IMPLICIT NONE

      TYPE bunch_of_stuff
         INTEGER,POINTER,DIMENSION(:) :: i
         REAL   ,POINTER,DIMENSION(:) :: x
         LOGICAL,POINTER,DIMENSION(:) :: l
      END TYPE bunch_of_stuff

      TYPE outer_wrapper
         TYPE(bunch_of_stuff), ALLOCATABLE, DIMENSION(:) :: ddt_things
      END TYPE outer_wrapper

      TYPE(outer_wrapper), DIMENSION(15) :: combo

      REAL :: x , y , z
      INTEGER :: return_code
      CHARACTER (LEN=256) :: my_shell

      x = 1.e+10
      y = 1.e-10
      z = x + y

      ALLOCATE(combo(1)%ddt_things(10))
      ALLOCATE(combo(2)%ddt_things(10))
      ALLOCATE(combo(3)%ddt_things(10))

      CALL IEEE_SET_FLAG ( IEEE_INEXACT , .false. )

      CALL GET_ENVIRONMENT_VARIABLE ( NAME="SHELL" , VALUE=my_shell ,   &
     &                                STATUS=return_code )

      PRINT *,'x,y,z = ',x,y,z
      PRINT *,'SHELL = ',TRIM(my_shell)

      CALL FLUSH (UNIT=6)

      STOP
      END PROGRAM fortran_2003_test         

Any ideas to solve the problem? Thanks!

 

0 Kudos
1 Reply
reinhold-bader
New Contributor II
352 Views

I suspect the error happens because you are trying to use a  non-standard extension. In standard Fortran, FLUSH is not an intrinsic procedure, but a statement:

FLUSH(UNIT=6)

Cheers

Reinhold

 

0 Kudos
Reply