2 points · by todsacerdoti · 3y ago · 2 comments
function matvec(a,x) result(b)
real, intent(in) :: a(:,:), x(:)
real :: b(size(a,1))
if (size(a,2) /= size(x)) stop "mismatched inputs"
...
or alternatively function matvec(a,x,n1,n2) result(b)
real, intent(in) :: a(n1,n2), x(n2)
real :: b(n1)
...