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

          Line data    Source code
       1             :       MODULE m_gaussp
       2             : !**************************************************************
       3             : !     generates gaussian points to exactly integrate spherical
       4             : !     harmonics up to lmax, i.e., (lm|l'm') for l,l'<=lmax
       5             : !     number of points = (2*lmax+1)*(lmax+1 + mod(lmax+1,2))
       6             : !**************************************************************
       7             :       CONTAINS 
       8         448 :       SUBROUTINE gaussp(
       9             :      >                  lmax,
      10             :      <                  vgauss,wt)
      11             : 
      12             :       USE m_grule
      13             :       USE m_constants
      14             :       IMPLICIT NONE
      15             : 
      16             :       INTEGER, INTENT (IN)  :: lmax
      17             :       REAL,    INTENT (OUT) :: vgauss(3,*),wt(*) ! points/weights
      18             : 
      19             :       INTEGER :: ngpt,nphi,i,j,k
      20             :       REAL    :: delphi,phi,rxy
      21         896 :       REAL    :: xx(lmax/2+1),w(lmax/2+1)
      22             : 
      23             : !   determine the number of points cos(theta); ngpt always even
      24         448 :       ngpt= lmax+1 + mod(lmax+1,2)
      25             :       CALL grule(            ! outputs ngpt/2 points
      26             :      >           ngpt,
      27         448 :      <           xx,w)
      28             : 
      29             : !  in phi, use nyquist frequency, i.e.,  2*(lmax+1)
      30         448 :       nphi = 2*lmax+1
      31         448 :       delphi = 2.0*pi_const/nphi
      32             : 
      33         448 :       j = 0
      34        2792 :       DO i = 1, ngpt/2
      35        2344 :          rxy=sqrt(1.0-xx(i)*xx(i))
      36       45744 :          DO k=1,nphi
      37       42952 :             phi=k*delphi
      38       42952 :             j=j+1
      39       42952 :             vgauss(1,j) = rxy*cos(phi)
      40       42952 :             vgauss(2,j) = rxy*sin(phi)
      41       42952 :             vgauss(3,j) = xx(i)
      42       42952 :             wt(j) = w(i)*delphi
      43       42952 :             j=j+1
      44       42952 :             vgauss(1,j) = vgauss(1,j-1)
      45       42952 :             vgauss(2,j) = vgauss(2,j-1)
      46       42952 :             vgauss(3,j) = -xx(i)
      47       45296 :             wt(j) = w(i)*delphi
      48             :          ENDDO
      49             :       ENDDO
      50             : 
      51         448 :       RETURN
      52             :       END SUBROUTINE gaussp
      53             :       END MODULE m_gaussp

Generated by: LCOV version 1.13