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

Error with internal subprogram in impure elemental routine

Wolf_W_
New Contributor I
256 Views

Greetings,

i got an error with the impure feature. It states: error #7949: All internal subprograms in a pure subprogram shall be pure.
It does not matter, wether the routines are functions or subroutines.

module test_mod

contains

  impure elemental subroutine foo()

    contains

    function bar()
      integer :: bar
      bar = 1
    end function

  end subroutine

end module

I wanted to pack some output statements in an internal subroutine to avoid code duplication.
Would this approach be valid?

 

Wolf

0 Kudos
3 Replies
Steven_L_Intel1
Employee
256 Views

This is a compiler bug. I will report it to the developers - thanks. Issue ID DPD200408689.

0 Kudos
Steven_L_Intel1
Employee
256 Views

This has been fixed for a future release. (At the moment, not planned for 17.0 but I have asked that the fix be put there.)

0 Kudos
Steven_L_Intel1
Employee
256 Views

The fix should appear in Update 1 to 17.0 (Parallel Studio XE 2017), probably October or so.

0 Kudos
Reply