00001 ! computes the spherical bessel functions j_l(x), y_l(x), 00002 ! with y_l = n_l the spherical Neumann function 00003 ! The routine uses the Numerical Recipes routine bessjy 00004 ! input: x, l 00005 ! output: sj = j_l(x), sy=y_l(x) 00006 ! ----------------------------------------------------------- 00007 subroutine sphbess(x,l,sj,sy) 00008 implicit none 00009 real(8) :: x, sj, sy 00010 integer :: l 00011 real(8) :: rtpi2 = 1.253314154753822d0 00012 real(8) :: xnu, xrj, xry, xrjp, xryp 00013 ! 00014 xnu = dble(l) + 0.5d0 00015 call bessjy(x,xnu,xrj,xry,xrjp,xryp) 00016 sj = xrj*rtpi2/sqrt(x) 00017 sy = xry*rtpi2/sqrt(x) 00018 end subroutine sphbess