Topic: Problem declaring function which outputs vector
Hi there,
I have following issue with declaring a very simple function (CrossProduct) which outputs a vector as a result (which is cross product of input vectors a and b), this error is reported for the declaration line: "EXTERNAL attribute conflicts with DIMENSION attribute."
So, it tells me I can't do declaration (see the code below):
REAL(kind=8), DIMENSION(3), EXTERNAL :: CrossProduct
Here is the excerpt from the code:
SUBROUTINE Rut1(m,n, v)
IMPLICIT NONE
REAL(kind=8), DIMENSION(3), EXTERNAL :: CrossProduct
...
...
END SUBROUTINE Rut1
!--------------------------------------
FUNCTION CrossProduct(a,b)
IMPLICIT NONE
REAL(kind=8) :: a(1:3), b(1:3)
CrossProduct(1) = a(2) * b(3) - a(3) * b(2)
CrossProduct(2) = a(3) * b(1) - a(1) * b(3)
CrossProduct(3) = a(1) * b(2) - a(2) * b(1)
END FUNCTION CrossProduct
THANK YOU VERY MUCH IN ADVANCE.