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

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

DataScientist
Valued Contributor I
909 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
1 Solution
Steve_Lionel
Black Belt Retired Employee
307 Views

This is fixed in ifort 2021.6 and ifx 2022.1 (oneAPI HPC Toolkit 2022.2 - darned confusing.)

View solution in original post

9 Replies
Steve_Lionel
Black Belt Retired Employee
869 Views

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

DataScientist
Valued Contributor I
858 Views

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

DataScientist
Valued Contributor I
855 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
849 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.

DataScientist
Valued Contributor I
846 Views

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

Steve_Lionel
Black Belt Retired Employee
812 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.

DataScientist
Valued Contributor I
787 Views

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

Steve_Lionel
Black Belt Retired Employee
308 Views

This is fixed in ifort 2021.6 and ifx 2022.1 (oneAPI HPC Toolkit 2022.2 - darned confusing.)

DataScientist
Valued Contributor I
289 Views

fantastic, thank you for the update.

Reply