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

Compiler bug: random_number() does not accept pointer, intent(in) argument

BalintAradi
New Contributor I
338 Views

Based on the discussion on Fortran-discourse, I think, the following code is standard conforming, but the Intel compiler (ifort (IFORT) 2021.1 Beta 20201112) refuses to compile it.

module m
contains
   subroutine s1(a)
      real, pointer, intent(in) :: a
      call s2(a)            !<-- Ok with Intel
      call random_number(a) !<-- but not this
   end subroutine 
   subroutine s2(x)
      real, intent(out) :: x
      call random_number(x)
   end subroutine 
end module
ifort -c ~/bug3.f90 
/home/aradi/bug3.f90(6): error #7912: An explicit INTENT(OUT) declaration is expected for this dummy argument.   [RANDOM_NUMBER]
      call random_number(a) !<-- but not this
-------------------------^
compilation aborted for /home/aradi/bug3.f90 (code 1)
0 Replies
Reply