9 pure subroutine sphcrd(v,r,tp)
25 real(8),
intent(in) :: v(3)
26 real(8),
intent(out) :: r,tp(2)
28 real(8),
parameter :: eps=1.d-14
30 r=sqrt(v(1)**2+v(2)**2+v(3)**2)
35 else if (t1 <= -1.d0)
then 36 tp(1)=3.1415926535897932385d0
40 if ((abs(v(1)) > eps).or.(abs(v(2)) > eps))
then 41 tp(2)=atan2(v(2),v(1))
pure subroutine sphcrd(v, r, tp)