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

structure member as id in inquire causes error

Grady_Schofield
Beginner
831 Views

I think that the following is a bug. It seems that if your "ID" is a member of a structure, then compiler doesn't think that it is an integer.

module

the_module

type

transfer_descriptor

integer :: file_unit

integer :: transfer_id

end

type

end module

---------------------------------------

program id_bug

use the_module

implicit none

integer :: tmp_id

logical :: pending_flag

type( transfer_descriptor ) :: tx

inquire(UNIT=tx%file_unit, ID=tx%transfer_id, PENDING=pending_flag) !*** error here

tmp_id = tx%transfer_id

inquire(UNIT=tx%file_unit, ID=tmp_id, PENDING=pending_flag) !*** no error here

end program id_bug

Here is the error:

Error1 Error: This variable must be of type INTEGER. [ID]S:srcdisk_io_testid_bugid_bug.f9026

0 Kudos
1 Reply
Steven_L_Intel1
Employee
831 Views
Amusing. Thanks for bringing this to our attention.
0 Kudos
Reply