I have detected a problem in calculation of complex values, which give wrong results.
This is my simple example:
PROGRAM COMPLEX
!
IMPLICIT NONE
!
REAL8 XIK
COMPLEX16 VZ(4)
!-----------------------------------------------------------------------
XIK=3.997186510534627D-003
VZ(1)=+CMPLX(.0d0,1.d0/XIK)
VZ(2)=+DCMPLX(.0d0,1.d0/XIK)
VZ(3)=-CMPLX(.0d0,1.d0/XIK)
VZ(4)=-DCMPLX(.0d0,1.d0/XIK)
!
OPEN(20,FILE='RESULT')
WRITE(20,)'XIK=',XIK
WRITE(20,)'VZ(1)=',VZ(1)
WRITE(20,)'VZ(2)=',VZ(2)
WRITE(20,)'VZ(3)=',VZ(3),' ←--'
WRITE(20,*)'VZ(4)=',VZ(4)
CLOSE(20)
!
END
and these are the results of the four calculations:
XIK= 3.997186510535E-03 VZ(1)= (0.0000000000,250.175966862) VZ(2)= (0.0000000000,250.175966862) VZ(3)= (0.0000000000,-250.175964355) ←-- VZ(4)= (0.0000000000,-250.175966862)
As you can see the 3rd calculation gives a wrong result.
Any ideas?
Detlef Pannhorst