This is the mail archive of the
fortran@gcc.gnu.org
mailing list for the GNU Fortran project.
Problems with SPREAD and/or scalarization.
- From: Thomas Koenig <Thomas dot Koenig at online dot de>
- To: fortran at gcc dot gnu dot org
- Date: Sun, 2 Oct 2005 19:52:00 +0200
- Subject: Problems with SPREAD and/or scalarization.
- Reply-to: 20051002003643 dot GA35738 at troutmask dot apl dot washington dot edu
Hi Steve,
> program bug
> implicit none
> integer, parameter :: nx=4,ny=4
> real, dimension(nx,ny) :: f, g
> real, dimension(nx) :: x
> integer :: i
> x = cshift((/ (i, i = 1, nx) /), nx/2) * 2
> g = spread(x, 2, ny)
> !
> ! x and g above (which compiles) are equivalent to f below (which doesn't).
> !
> f = spread(cshift((/ (i, i = 1, nx) /), nx/2) * 2, 2, ny)
> end program bug
>
> kargl[236] gfc41 -o z -static f.f90
> In file f.f90:9
>
> f = spread(cshift((/ (i, i = 1, nx) /), nx/2) * 2, 2, ny)
> 1
> Error: Incompatible ranks 2 and 1 in assignment at (1)
No, I didn't see this before. Will you open a PR?
Thomas