The following is the code that Iām trying (new to Fortran).
program mmo
implicit none
interface operator (.mul.)
intrinsic procedure matmul
end interface
integer :: i
real, dimension(5,5) :: a, b, c, d
a = 5
b = 6
c = 2
d = a .mul. b .mul. c
do i = 1,5
print *, c(i,:)
end do
end program mmo
But, this results in the error
Unexpected character in variable list at (1)
in the line intrinsic procedure matmul
.
I was just trying to mix and match the tutorials available in these two sites.
- https://www.mathcs.emory.edu/~cheung/Courses/561/Syllabus/6-Fortran/operators.html
- The Fortran Language ā Modern Fortran in Science and Technology 1.0 documentation
What should I do to overload any of the intrinsic procedures?
Also, is it possible to create a new operator for matmul, say ā@ā similar to python (PEP 465 -- A dedicated infix operator for matrix multiplication | Python.org)? When I pass that as operator in line 3, it throws syntax error.