# 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.

Published: 08/27/2009

Last Updated: 02/05/2016

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.