- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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!
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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

- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page