Diagnostic 7617: This host associated object appears in a 'defining' context in a PURE procedure or in an internal procedure contained in a PURE procedure.

ID 662812
Updated 2/5/2016
Version Latest
Public

author-image

By

Diagnostic 7617: This host associated object appears in a 'defining' context in a PURE procedure or in an internal procedure contained in a PURE procedure.

In Fortran, A PURE procedure has restrictions on side-effects that allow parallelization and better optimization. PURE procedures are not allowed to define or change the definition status of variables that are host or use associated, or in COMMON. In the following example, hostvar is host associated inside PURE subroutine puresub. When this source is compiled, the assignment to hostvar causes error 7617 to be reported.

program F7617
implicit none

integer hostvar

call puresub

contains

pure subroutine puresub
hostvar = 1
end subroutine puresub
end program F7617

Note that ELEMENTAL procedures are also PURE, unless they are also given the IMPURE prefix (a Fortran 2008 feature supported by Intel Fortran Compiler 16.0 and above.)

To resolve this error, do not use host associated variables in a definition context within a PURE procedure.

If you have further questions about this diagnostic, please ask in the Intel Fortran User Forums.