The Intel® Parallel Studio XE 2016 Composer Editions for Fortran Windows* and Linux* have a feature enhancement supporting the Fortran 2008 standard IMPURE keyword.
This keyword removes some constraints on an elemental procedure. An IMPURE elemental procedure has the restrictions that apply to elemental procedures, but it does not have any of the restrictions of PURE elemental procedures.
- An impure elemental procedure can have side effects and it can contain the following:
- Any external I/O statement (including a READ or WRITE statement whose I/O unit is an external file unit number or *)
- A PAUSE statement
- A STOP statement or an ERROR STOP statement
- An image control statement
For example:
program main
implicit none
integer :: arr(10)
integer :: i
do i = 1,10
arr(i) = i
end do
call subA(arr)
contains
impure elemental subroutine subA(iVal)
integer, intent(in) :: iVal
write(*,*) iVal ! external I/O statement is allowed in impure elemental procedure
end subroutine
end
This feature enhancement is available in the Fortran Intel® 16.0 or later compiler.
Refer to the Intel® Parallel Studio XE 2019 for Fortran product documentation for additional details.
Have questions?
See our Get Help page for your support options.