This is the mail archive of the
fortran@gcc.gnu.org
mailing list for the GNU Fortran project.
Re: f95 standard question
On Mon, May 30, 2005 at 09:48:25AM -0700, Steve Kargl wrote:
> On Mon, May 30, 2005 at 09:23:16AM -0700, Jerry DeLisle wrote:
> > (Third attempt, the message appears to be getting blocked)
>
> Yeah, gnu.org's mailserver seemed to be stuffed.
>
> >
> > I get the same result with ifort as gfc, however, the draft f95 standard
> > that I have to look at states that the case of DIM=1 should be:
> >
> > [2, 0, 1] and not [1, 1, 1]
> >
>
> NAG's F95 compiler agrees with ifort and gfc.
>
Your RESHAPE() commands aren't doing what you think.
program test_count
integer, dimension(2,3) :: a, b
a(1,:) = (/ 1, 3, 5 /)
a(2,:) = (/ 2, 4, 6 /)
b(1,:) = (/ 0, 3, 5 /)
b(2,:) = (/ 7, 4, 8 /)
print '(3I3)', a(1,:)
print '(3I3)', a(2,:)
print *
print '(3I3)', b(1,:)
print '(3I3)', b(2,:)
print *
print '(3I3)', count(a.ne.b, DIM=1)
print *
print '(2I3)', count(a.ne.b, DIM=2)
end program test_count
kargl[206] ./z
1 3 5
2 4 6
0 3 5
7 4 8
2 0 1
1 2
--
Steve