I'm beginning to dislike Chapter 14 of F95 (or Chapter 16 of F2003).
14.7.6 Events that cause variables to become undefined
Variables become undefined as follows:
(1) When a variable of a given type becomes defined, all
associated variables of different type become undefined. ...
subroutine t(y)
real x
integer i
save x,i
equivalence(x,i)
interface
subroutine foo(i, x, y)
integer, intent(in) :: i
real, intent(in) :: x
real, intent(inout) :: y
end subroutine foo
end interface
interface
subroutine bar(i, x, y)
integer, intent(in) :: i
real, intent(in) :: x
real, intent(inout) :: y
end subroutine bar
end interface
if (y < 0.) then
i = 0
!
! x is undefined?
!
call foo(i,x,y)
else
x = 1.
!
! i is undefined?
!
call bar(i,x,y)
end if
end
Is this conforming? That is, can an undefined variable
be used as an INTENT(IN) function argument. If it is
conforming, does it make sense?