I'd like to find the position of the smallest element in a vector, and I tried this:
winapp
program test
implicit none
include <windows.ins>
integer*4 i
real*8 r(4)
r(1) = 0.D0
r(2) = 7.2D0
r(3) = -.8D0
r(4) = 0.D0
i = minloc(r)
print*,i,r(i) ! should give 3, -.8D0
end
It failes with the message 'Result has insufficient elements'. Can anyone please help?
Thanks & regards Wilfried