- #1
harish88
- 3
- 0
I have a program I am trying to understand. According to the function definition(vdot), the function acccepts arrays as inputs. But the function is called with a scalar input and it works just fine. Shouldnt it throw an error ?
w and v are arrays of different sizes. ms is a scalar constant.
Calling it as
w and v are arrays of different sizes. ms is a scalar constant.
Code:
real*8 function vdot(x,y,size)
real*8 x(*),y(*)
integer size,j
vdot = 0.d0
do j = 1,size
vdot = vdot + x(j)*y(j)
end do
end
Calling it as
Code:
do k = 1,i
kp = (k-1)*ms+1
h(k,i) = vdot(w,v(kp),ms)
enddo