c dot(A1,B1) double precision function dot(A1,B1) double precision A1(3),B1(3),dot dot=0.0 do i=1,3 dot=dot+A1(i)*B1(i) enddo return end