The following program is conforming:
write (*,*) 0
end
The expectation is that on exit zero will
appear on standard output. However, am I right
that the standard does not (cannot?) require
what, if anything, should appear at standard output?
Annex C.6.4, para 3 has "The OPEN statement
describes properties of the connection to the file
and might or might not cause physical activities to
take place. It is for an implementation to define
properties of a file beyond those required in
standard Fortran."
Consequently, if no output appears, what
can be said about the program? compiler? OS?
What if one compiler delivers an
output and another does not on the same OS?
Is it correct to say that one compiler has a bug?
A more complex example:
integer :: i[*], j, img
img = this_image()
i = img
if ( img .eq. 1 ) stop "img 1 cannot continue"
do j = 1 , 100000000
i = int( atan( real( j ) ) )
end do
write (*,*) "img=", img, "i=", i
end
Image 1 initiates normal termination at STOP.
All other images should continue until they reach END
and also initiate normal termination.
At this point all images should synchronise and the
program should exit to OS. The expectation is that
WRITE output from all images but 1 should appear
at standard output.
The output with one compiler on 5 images is:
img 1 cannot continue
img= 4 i= 1
img= 5 i= 1
img= 2 i= 1
img= 3 i= 1
And with another compiler, still on 5 images:
STOP img 1 cannot continue
Are both behaviours allowed?
Thanks
Anton
|