Compute the expansion coefficients for the asymptotic expansion of Bessel functions with large orders
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| integer, | intent(in) | :: | Km |
Maximum k |
||
| real(kind=wp), | intent(out), | dimension(*) | :: | a |
A(L) --- Cj(k) where j and k are related to L by L=j+1+[k*(k+1)]/2; j,k=0,1,...,Km |
subroutine cjk(Km,a) integer,intent(in) :: Km !! Maximum k real(wp),dimension(*),intent(out) :: a !! A(L) --- Cj(k) where j and k are related to L !! by L=j+1+[k*(k+1)]/2; j,k=0,1,...,Km real(wp) :: f , f0 , g , g0 integer :: j , k , l1 , l2 , l3 , l4 a(1) = 1.0_wp f0 = 1.0_wp g0 = 1.0_wp do k = 0 , Km - 1 l1 = (k+1)*(k+2)/2 + 1 l2 = (k+1)*(k+2)/2 + k + 2 f = (0.5_wp*k+0.125_wp/(k+1))*f0 g = -(1.5_wp*k+0.625_wp/(3.0_wp*(k+1.0_wp)))*g0 a(l1) = f a(l2) = g f0 = f g0 = g enddo do k = 1 , Km - 1 do j = 1 , k l3 = k*(k+1)/2 + j + 1 l4 = (k+1)*(k+2)/2 + j + 1 a(l4) = (j+0.5_wp*k+0.125_wp/(2.0_wp*j+k+1.0_wp))*a(l3) & & - (j+0.5_wp*k-1.0_wp+0.625_wp/(2.0_wp*j+k+1.0_wp))*a(l3-1) enddo enddo end subroutine cjk