LCOV - code coverage report
Current view: top level - math - dsphbs.f (source / functions) Hit Total Coverage
Test: combined.info Lines: 13 13 100.0 %
Date: 2019-09-08 04:53:50 Functions: 1 1 100.0 %

          Line data    Source code
       1             :       MODULE m_dsphbs
       2             : !********************************************************************
       3             : !     calculates the derivative of the spherical bessel functions
       4             : !     dfj(l) = d jl(x)/dx
       5             : !     for l=0,lmax and argument x
       6             : !     note that the spherical bessel functions fj(l), l=0,lmax are
       7             : !     needed (call sphbes to generate these)
       8             : !                                            m. weinert
       9             : !********************************************************************
      10             :       CONTAINS
      11     2140530 :       SUBROUTINE dsphbs(
      12     2140530 :      >                  lmax,x,fj,
      13     2140530 :      <                  dfj)
      14             : 
      15             :       IMPLICIT NONE
      16             : !     ..
      17             : !     .. Arguments ..
      18             :       INTEGER, INTENT  (IN) :: lmax
      19             :       REAL,    INTENT  (IN) :: x
      20             :       REAL,    INTENT  (IN) ::  fj(0:lmax)
      21             :       REAL,    INTENT (OUT) :: dfj(0:lmax)
      22             : !
      23             : !     .. Parameters ..
      24             :       REAL,    PARAMETER :: xlim = 1.0e-04
      25             : !     ..
      26             : !     .. Local Scalars ..
      27             :       REAL fac,x2
      28             :       INTEGER l
      29             : 
      30     2140530 :       dfj(0) = -fj(1)
      31             : !--->    small x limit
      32     2140530 :       IF (x.LT.xlim) THEN
      33         148 :          x2 = 0.5*x*x
      34         148 :          fac = 1./3.
      35        1428 :          DO l = 1,lmax
      36        1280 :             dfj(l) = fac* (l-x2* (l+2)/ (2*l+3))
      37        1428 :             fac = x*fac/ (2*l+3)
      38             :          ENDDO
      39             :       ELSE
      40             : !--->    obtain dfj using recurrence relationship
      41    36874726 :          DO l = 1,lmax
      42     2140382 :             dfj(l) = fj(l-1) - (l+1)*fj(l)/x
      43             :          ENDDO
      44             :       END IF
      45             : 
      46     2140530 :       RETURN
      47             :       END SUBROUTINE dsphbs
      48             :       END MODULE m_dsphbs

Generated by: LCOV version 1.13