Silverfrost Forums

Welcome to our forums

dot_product crashes, bug in FTN95?

3 Oct 2007 7:01 #2296

Hello, there seems to be a problem with the intrinsic dot_product. The following program crashes in the line dp2=dot_product(vector1,sum(matrix,2)), which I think is a legal Fortran statement. Any thoughts?

program dot_product_crash implicit none integer, parameter :: wp=selected_real_kind(15) real(wp) :: matrix(2,2), vector1(2), vector2(2), dp1, dp2

matrix(1,1) = 1.0_wp matrix(1,2) = 2.0_wp matrix(2,1) = 3.0_wp matrix(2,2) = 4.0_wp vector1(1) = 1.0_wp vector1(2) = 1.0_wp

! I want to compute the dot product of vector1 and vector2 := sum(matrix,2)

! Method 1: Compute vector2 first vector2 = sum(matrix,2) dp1 = dot_product(vector1,vector2) write(,) 'dp1 =', dp1

! Method 2: Compute everything at once dp2 = dot_product(vector1,sum(matrix,2)) write(,) 'dp2 =', dp2

end program dot_product_crash

4 Oct 2007 6:16 #2298

Yes I think you have found an FTN95 bug here. We will take a look at it.

22 Dec 2007 3:13 #2545

This bug has now been fixed for the next release of FTN95.

Please login to reply.