Intel® Fortran Compiler
Build applications that can scale for the future with optimized code designed for Intel® Xeon® and compatible processors.
Announcements
Welcome to the Intel Community. If you get an answer you like, please mark it as an Accepted Solution to help others. Thank you!
26730 Discussions

COMPILER BUG: Passing components of complex arrays to Fortran intrinsic procedures

A__King
New Contributor III
461 Views

What is wrong with this Fortran program?

 

complex :: z(5)
call random_number(z%re)
write(*,*) z
end

 

Intel ifort classic 2021 throws the following error message:

 

error #6672: This intrinsic procedure or system subprogram must not have an expression or constant as an argument. [RANDOM_NUMBER]

 

For comparison, gfortran compiles and runs flawlessly. Is this an ifort compiler bug? Generally speaking, what is the easiest way of assigning real/imaginary components of complex numbers separately?

 

0 Kudos
7 Replies
Steve_Lionel
Black Belt Retired Employee
421 Views

Yes, that's an ifort bug. There have been others related to %re and %im in the past. 

A__King
New Contributor III
410 Views

Is there a changelog for the newer compiler releases to see if this bug has been fixed in ifort 2022? Thanks.

A__King
New Contributor III
407 Views

Would be also great if Intel provided a direct link to the bug report page in the main page of this forum.

Steve_Lionel
Black Belt Retired Employee
401 Views

There haven't been bugfix change logs for years. Only people with paid support can file an official report. But the Intel support engineers often pick up issues from this forum.

A__King
New Contributor III
398 Views

That's unfortunate. I changed the title to make it more visible.

Steve_Lionel
Black Belt Retired Employee
364 Views

I filed bug report 05244368 on your behalf. I reported a similar issue with %re and %im in a I/O list about a year and a half ago.

To answer your other question, the complex-part-designator (%re or %im) is the easiest way of doing this - that's what it's for.

A__King
New Contributor III
339 Views

I know this is not your responsibility anymore. So thank you very much for taking the time to report it.

Reply