calculates the Riccati-Bessel function of the first kind and its first derivative. Calls the rctj function from special_functions.f90
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
integer(kind=int32), | intent(in) | :: | l_ |
l - order of the Riccati-Bessel function of the first kind |
||
real(kind=dp), | intent(in) | :: | x_ |
x - argument of the Riccati-Bessel function of the first kind |
||
real(kind=dp), | intent(inout) | :: | j_ |
j_{l} (x) - Riccati-Bessel funciton of the first kind |
||
real(kind=dp), | intent(inout) | :: | jp_ |
j_{l}' (x) - derivative of the Riccati-Bessel funciton of the first kind |
Type | Visibility | Attributes | Name | Initial | |||
---|---|---|---|---|---|---|---|
real(kind=dp), | public, | dimension(l_+1) | :: | dj_ | |||
integer(kind=int32), | public | :: | highest_order_ | ||||
real(kind=dp), | public, | dimension(l_+1) | :: | rj_ |
subroutine riccati_bessel_j(l_,x_,j_,jp_)
!! calculates the Riccati-Bessel function of the first kind and its
!! first derivative. Calls the rctj function from special_functions.f90
!---------------------------------------------------------------------!
integer(int32), intent(in) :: l_
!! l - order of the Riccati-Bessel function of the first kind
real(dp), intent(in) :: x_
!! x - argument of the Riccati-Bessel function of the first kind
real(dp), intent(inout) :: j_
!! j_{l} (x) - Riccati-Bessel funciton of the first kind
real(dp), intent(inout) :: jp_
!! j_{l}' (x) - derivative of the Riccati-Bessel funciton
!! of the first kind
!---------------------------------------------------------------------!
integer(int32) :: highest_order_
real(dp), dimension(l_+1) :: rj_, dj_
!---------------------------------------------------------------------!
if(l_ == 0) then
call rctj(l_+1, x_, highest_order_, rj_, dj_)
else
call rctj(l_, x_, highest_order_, rj_, dj_)
endif
if (highest_order_ < l_) then
!------------------------------------------------------------------!
call write_warning("riccati_bessel_j: maximum order of " // &
"Riccati-Bessel function:" // trim(adjustl(integer_to_character( &
highest_order_))) // "is smaller than requested order l = " // &
trim(adjustl(integer_to_character(l_))) )
!------------------------------------------------------------------!
j_ = rj_(highest_order_)
jp_ = dj_(highest_order_)
else
j_ = rj_(l_+1)
jp_ = dj_(l_+1)
endif
!---------------------------------------------------------------------!
end subroutine riccati_bessel_j