! This function is not pure, because it writes to global variables.
Pure Real Function f(x,y)
Real,Intent(In) :: x,y
Real :: z
Common/c/z(2)
Real,External :: sum_of_z
z(1) = x
z(2) = y
f = sum_of_z()
End Function
! This function is pure, as although it reads from global variables,
! it does not change any.
Pure Real Function sum_of_z()
Real z
Common/c/z(2)
sum_of_z = Sum(z)
End Function
! This function is thread-safe, but not pure: although it has no side-effects,
! the dummy arguments have not had their INTENT declared.
Real Function g(x,y)
Real x,y
g = x + y**2
End Function