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

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

DataScientist
Valued Contributor I
1,345 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
743 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
1,305 Views

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

DataScientist
Valued Contributor I
1,294 Views

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

0 Kudos
DataScientist
Valued Contributor I
1,291 Views

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

0 Kudos
Steve_Lionel
Black Belt
1,285 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
1,282 Views

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

0 Kudos
Steve_Lionel
Black Belt
1,248 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
1,223 Views

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

0 Kudos
Steve_Lionel
Black Belt
744 Views

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

DataScientist
Valued Contributor I
725 Views

fantastic, thank you for the update.

0 Kudos
Reply