Here's another recent related test for your compilers.
----------------------------
subroutine sub1(a)
real, intent(out) :: a
real :: b
b = a
call subx(a) ! or call subx(b)
end subroutine sub1
----------------------------
Cray f90 correctly diagnoses (warning) that:
"Variable "A" is used before it is defined."
NEC f90 does not, but if the call to subx is subx(b) then both warn.
Now change it to
----------------------------
subroutine sub2(a)
real, intent(out) :: a
real :: b
b=5.0
call subx(b)
end subroutine sub2
----------------------------
NEC correctly warns that
Dummy argument "a" is not used.
Dummy argument "a" with INTENT(OUT) attribute is not defined.
Cray does not. First time I've seen Cray f90 miss something. ;-)
Cheers,
Len Makin
On Friday, 30 March 2001, at 18:52,
Ron Sverdlove x2517 <[log in to unmask]> wrote:
> The copy of the F95 standard that I have (not the final version) says
> in Section 14.7.6 "Events that cause variables to become undefined",
> paragraph (13a), that an "actual argument associated with a dummy
> argument with INTENT(OUT) becomes undefined" when the procedure is
> invoked.
|