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

Pure procedure inout argument gives error on assignment when using associate construct

Andrew_Smith
Valued Contributor I
673 Views

This is an extract of the code:

[fortran] pure subroutine calculateAdvancedContactStressContact(aContactPair)

   type(ContactPairType), intent(inout) :: aContactPair

   integer j

   real(8) deltaVec(3)

   deltaVec(1) = 1.0D0

   deltaVec(2:3) = 0.0D0

   associate(aRegion => aContactPair%sides(1)%region)

      do j = 1, size(aRegion%contactRegions)

         associate(def => aRegion%contactRegions(j)%deflection)

            def%vector(1:3)%v = def%vector(1:3)%v - deltaVec

         end associate

      end do

   end associate

end subroutine [/fortran]

<!--break-->

The error message is:

1>Compiling with Intel(R) Visual Fortran Compiler XE 13.0.1.119 [Intel(R) 64]...

1>ContactPair.f90

1>D:\dev\r14.5.1\Components\Source\Romax\StaticAnalysisServer\ContactPair.f90(103): error #7617: This host associated object appears in a 'defining' context in a PURE procedure or in an internal procedure contained in a PURE procedure.   [DEF]

0 Kudos
2 Replies
Steven_L_Intel1
Employee
673 Views

Thanks - I have escalated this as issue DPD200241067. [Edit to correct issue number.]

0 Kudos
Steven_L_Intel1
Employee
673 Views

I expect the fix for this to appear in update 3.

0 Kudos
Reply