Silverfrost Forums

Welcome to our forums

Bug in dot_product when compiled with /64

10 Mar 2017 9:00 #19036

I ran into problems using the function dot_product with 64 bit.

See the following testprogram:

      program test_dot_product
      
      real :: u(3) = (/ 1.0, 1.0, 0.0 /)
      real :: v(3) = (/ 1.0, 0.0, 0.0 /)
      real :: dotp
            
      dotp = u(1)*v(1) + u(2)*v(2) + u(3)*v(3)
      write(*,*)'Dot Product:',dotp
      
      dotp = dot_product(u,v)
      write(*,*)'dot_product:',dotp
      
      stop
      end

Compiled as 32 bit, both calculations of dotp give the correct answer (1.0), but compiled with /64 the function dot_product returns a value of 3.0

10 Mar 2017 10:03 #19038

I have noted this as a bug. A temporary work-around is to use double precision.

10 Mar 2017 10:14 #19040

Or just use sum(u*v) instead.

13 Mar 2017 11:44 #19098

This bug has now been fixed in salflibc64.dll.

The fix is included in a new set of DLLs that is available via the following link. Please make sure that you keep a backup of your original Silverfrost DLLs.

https://www.dropbox.com/s/93ikhswrxul5bjn/newDLLs4.zip?dl=0

Please login to reply.