Hello,
I wrote this programm which tries to use the Function MatrixVektor.
PROGRAM MAIN
REAL, DIMENSION(3) :: v
REAL, DIMENSION(3) :: w
REAL, DIMENSION(3,3) :: A
... filling v and A
w = MatrixVektor(A, v, w)
END PROGRAMM
FUNCTION MatrixVektor(A, v)
REAL, DIMENSION(3) :: MatrixVektor
REAL, DIMENSION(3,3) :: A
REAL, DIMENSION(3) :: v
do i=1,3
MatrixVektor(i) = SUM(A(i,1:3)*v)
enddo
END FUNCTION
But there follows an error: Attempt to call a subroutine as if it were an integer(kind=3) function. In the Line where the Function is called in the main programm. Why? What do I have to change.
Thanks for every help.
Regards,
Martin
I wrote this programm which tries to use the Function MatrixVektor.
PROGRAM MAIN
REAL, DIMENSION(3) :: v
REAL, DIMENSION(3) :: w
REAL, DIMENSION(3,3) :: A
... filling v and A
w = MatrixVektor(A, v, w)
END PROGRAMM
FUNCTION MatrixVektor(A, v)
REAL, DIMENSION(3) :: MatrixVektor
REAL, DIMENSION(3,3) :: A
REAL, DIMENSION(3) :: v
do i=1,3
MatrixVektor(i) = SUM(A(i,1:3)*v)
enddo
END FUNCTION
But there follows an error: Attempt to call a subroutine as if it were an integer(kind=3) function. In the Line where the Function is called in the main programm. Why? What do I have to change.
Thanks for every help.
Regards,
Martin