Problems with SPREAD and/or scalarization.

Thomas Koenig Thomas.Koenig@online.de
Sun Oct 2 17:52:00 GMT 2005


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



More information about the Fortran mailing list