Blame view
fvn_fnlib/zatan2.f
649 Bytes
0c3098aed ChW 02/2010 for t... |
1 |
complex(kind(1.d0)) function zatan2 (csn, ccs) |
38581db0c git-svn-id: https... |
2 3 |
implicit none c april 1977 version. w. fullerton, c3, los alamos scientific lab. |
0c3098aed ChW 02/2010 for t... |
4 5 |
complex(kind(1.d0)) csn, ccs, zatan real(kind(1.d0)) pi |
38581db0c git-svn-id: https... |
6 7 8 9 10 11 12 13 14 15 16 17 18 |
external zatan data pi / 3.1415926535 8979323846d0 / c if (abs(ccs).eq.0.) go to 10 c zatan2 = zatan (csn/ccs) if (real(ccs).lt.0.) zatan2 = zatan2 + pi if (real(zatan2).gt.pi) zatan2 = zatan2 - 2.0*pi return c 10 if (abs(csn).eq.0.) call seteru ( 1 34hzatan2 called with both args zero, 34, 1, 2) c |
0c3098aed ChW 02/2010 for t... |
19 |
zatan2 = cmplx (sign(0.5*pi,real(csn)), 0.0, kind(1.d0)) |
38581db0c git-svn-id: https... |
20 21 22 |
c return end |