LCOV - code coverage report
Current view: top level - math - dcylbs.f (source / functions) Hit Total Coverage
Test: FLEUR test coverage Lines: 0 14 0.0 %
Date: 2024-04-16 04:21:52 Functions: 0 1 0.0 %

          Line data    Source code
       1             : !--------------------------------------------------------------------------------
       2             : ! Copyright (c) 2016 Peter Grünberg Institut, Forschungszentrum Jülich, Germany
       3             : ! This file is part of FLEUR and available as free software under the conditions
       4             : ! of the MIT license as expressed in the LICENSE file in more detail.
       5             : !--------------------------------------------------------------------------------
       6             : 
       7             :       MODULE m_dcylbs
       8             : !********************************************************************
       9             : !     calculates the derivative of the cylindrical bessel functions
      10             : !     for the given argument x amd m=-mmax,mmax
      11             : !     for l=0,lmax and argument x
      12             : !     note that the cylindrical bessel functions fj(m), m=-mmax,mmax are
      13             : !     needed (call cylbes to generate those)
      14             : !                                            Y.Mokrousov
      15             : !********************************************************************
      16             :       CONTAINS
      17           0 :       SUBROUTINE dcylbs(
      18           0 :      >                  mmax,x,fJ,
      19           0 :      <                  dfJ)
      20             : 
      21             :       IMPLICIT NONE
      22             : !     ..
      23             : !     .. Arguments ..
      24             :       INTEGER, INTENT  (IN) :: mmax
      25             :       REAL,    INTENT  (IN) :: x
      26             :       REAL,    INTENT  (IN) ::  fJ(-mmax:mmax)
      27             :       REAL,    INTENT (OUT) :: dfJ(-mmax:mmax)
      28             : !
      29             : !     .. Parameters ..
      30             :       REAL,    PARAMETER :: xlim = 1.0e-04, zero = 0.0
      31             : !     ..
      32             : !     .. Local Scalars ..
      33             :       INTEGER m
      34             :       REAL a,b
      35             :      
      36             : 
      37           0 :       dfJ(0) = -fJ(1)
      38             : 
      39           0 :       IF (x .EQ. zero) THEN
      40           0 :          dfJ(1) = 0.5
      41           0 :          dfJ(-1) = -0.5        
      42           0 :          DO m = 2,mmax
      43           0 :            dfJ(m) = zero
      44           0 :            dfJ(-m) = zero
      45             :          END DO
      46             :       ELSE 
      47             : c---> possible calculation of the derivatives of cylindrical Bessel 
      48             : c---> functions using first two terms of series representation of
      49             : c---> them for small x, error is ~xlim**2          (Y.Mokrousov)
      50             : c         IF (x .LT. xlim) THEN
      51             : c           a = 0.5
      52             : c           b = 0.75
      53             : c           dfJ(1) = a - b*((x/2.)**2)
      54             : c           dfJ(-1) = -dfJ(1) 
      55             : c           DO m = 2,mmax
      56             : c              a = (1./(m-1))*a
      57             : c              b = b*(2+m)/((m+1)**2)
      58             : c              dfJ(m) = a*((x/2.)**(m-1)) - b*((x/2.)**(m+1))
      59             : c              dfJ(-m) = ((-1)**m)*dfJ(m)
      60             : c           END DO
      61             : c         ELSE
      62             : c------------------------------------------------------------------
      63             : 
      64           0 :          DO m = 1,mmax
      65           0 :             dfJ(m) = fJ(m-1) - m*fJ(m)/x
      66           0 :             dfJ(-m) = ((-1)**m)*dfJ(m)
      67             :          ENDDO
      68             : 
      69             : c     ENDIF
      70             : 
      71             :       END IF
      72             : 
      73           0 :       RETURN
      74             : 
      75             :       END SUBROUTINE dcylbs
      76             : 
      77             :       END MODULE m_dcylbs
      78             : 
      79             : 
      80             : 
      81             : 

Generated by: LCOV version 1.14