I am implementing the cross product of two vectors using ^, however I am getting an error.Not aware how the problem can be resolved.
Here is the code
Interface Operator (^)
Module Procedure vector_cross_product
End Interface Operator (^)
Contains
Function vector_cross_product (u, v) Result (w)
!!$ Input
Type (Vector), Intent(in) :: u, v
!!$ Output
Type (Vector) :: w
w% x = (u% y * v% z) - (u% z * v% y)
w% y = (u% z * v% x) - (u% x * v% z)
w% z = (u% x * v% y) - (u% y * v% x)
End Function vector_cross_product
This is the corresponding errer I am getting using gfortran
Interface Operator (^)
1
Error: Syntax error in generic specification at (1)
lib/vectors.f:110.18:
Module Procedure vector_cross_product
1
Error: MODULE PROCEDURE at (1) must be in a generic module interface
lib/vectors.f:111.3:
End Interface Operator (^)
1
Error: Expecting END MODULE statement at (1)
Looks like it wants something from that list (presumably the standard operators) rather than "^", although I don't know if "..." is meant literally. Perhaps ".X." would work.
Good luck ... cheers, drl
---------- Post updated at 13:56 ---------- Previous update was at 12:23 ----------