The following program produces incorrect error message. IMO the error is not with 'Z', but with 'C'
! [JvO] 2005-09-01 MVbits.f95
subroutine Mult(a, b, c)
integer, intent(IN) :: a, b
integer, intent(OUT) :: c
integer :: k
integer, dimension(0:2) :: x, y, z
integer, parameter :: D = 1023, T = 10, S = 2**T, T2 = 2*T
call mvbits(a, (/0,T,T2/), (/T,T,T+2/), x, 0)
call mvbits(b, (/0,T,T2/), (/T,T,T+2/), y, 0)
z = y(0) * x
z(1:2) = z(1:2) + y(1) * x(0:1)
z(2) = z(2) + y(2) * x(0)
do k = 0, 1
z(k+1) = z(k+1) + ibits(z(k), T, T)
z(k) = iand(z(k), D)
end do
call mvbits(z, 0, (/T,T,T+2/), c, (/0, T, T2/))
! c = z(0) + ishft(z(1), T) + ishft(z(2), T2)
end subroutine Mult
! D:\Fortran\Test\Salford>ftn95 /check mvbits ! [FTN95/Win32 Ver. 4.8.0 Copyright (C) Salford Software Ltd 1993-2005] ! 0019) call mvbits(z, 0, (/T,T,T+2/), c, (/0, T, T2/)) ! *** Array expressions, such as the array 'Z', cannot be on the right hand side ! of scalar assignments ! 1 ERROR [<MULT> FTN95/Win32 v4.8.0] ! *** Compilation failed
[JvO]