LCOV - code coverage report
Current view: top level - global - convn.f90 (source / functions) Hit Total Coverage
Test: combined.info Lines: 24 26 92.3 %
Date: 2019-09-08 04:53:50 Functions: 1 1 100.0 %

          Line data    Source code
       1             :       MODULE m_convn
       2             :       use m_juDFT
       3             :       CONTAINS
       4          36 :       SUBROUTINE convn(&
       5             :      &                 dimension,atoms,stars)
       6             : !
       7             : !     ***********************************************************
       8             : !     determines the optimum values for the convergence parameter
       9             : !     for each atom type using the criterion discussed in
      10             : !     m. weinert, j. math. phys. 22, 2433 (1981).  each sphere
      11             : !     and l component may have different values.  (psqpw changed
      12             : !     to allow this option).
      13             : !          m. weinert july 1982
      14             : !     ***********************************************************
      15             :       USE m_types
      16             :       IMPLICIT NONE
      17             : !     ..
      18             :       TYPE(t_dimension),INTENT(IN) :: dimension
      19             :       TYPE(t_atoms),INTENT(INOUT)  :: atoms
      20             :       TYPE(t_stars),INTENT(IN)     :: stars
      21             : !     .. Local Scalars ..
      22             :       REAL sck,z0
      23             :       INTEGER i,l,n,n1,nc
      24             : !     ..
      25             : !     .. Local Arrays ..
      26             :       REAL z(17)
      27             : !     ..
      28             : !     .. Intrinsic Functions ..
      29             :       INTRINSIC min0
      30             : !     ..
      31             : !     .. Data statements ..
      32             :       DATA z/6.9e0,8.1e0,9.3e0,10.5e0,11.6e0,12.7e0,13.9e0,15.0e0,&
      33             :      &     16.1e0,17.2e0,18.3e0,19.4e0,20.5e0,21.6e0,22.7e0,23.7e0,&
      34             :      &     24.8e0/,z0/5.7e0/
      35             : !     ..
      36             : !--->    read in values of ncv (if ncv(1).le.0, calculate best values)
      37             : !      read(5,1000) (ncv(n),n=1,ntype)
      38             : !      if(ncv(1).le.0) go to 2
      39             : !      n1=ncv(1)
      40             : !      do 1 n=2,ntype
      41             : !    1 if(ncv(n).le.0) ncv(n)=n1
      42             : !      go to 5
      43             : !--->    calculate values
      44             : !    2 continue
      45             : !
      46         117 :       DO 20 n = 1,atoms%ntype
      47          81 :          sck = stars%gmax*atoms%rmt(n)
      48          81 :          IF (sck.LT.z0) GO TO 60
      49        2579 :          DO 10 i = 1,17
      50        1302 :             IF (sck.GT.z(i)) GO TO 10
      51          53 :             atoms%ncv(n) = i
      52          53 :             GO TO 20
      53          28 :    10    CONTINUE
      54          28 :          n1 = 0.9e0* (sck-z(17))
      55          28 :          atoms%ncv(n) = 18 + n1
      56          36 :    20 CONTINUE
      57             : !--->    output and make sure ncv(n).le.ncvd
      58             :    30 CONTINUE
      59          36 :       WRITE (6,FMT=8010)
      60         117 :       DO 40 n = 1,atoms%ntype
      61          81 :          nc = atoms%ncv(n)
      62          81 :          l = nc - 1
      63          81 :          WRITE (6,FMT=8020) n,nc,l
      64          36 :    40 CONTINUE
      65          36 :       l = dimension%ncvd - 1
      66          36 :       WRITE (6,FMT=8030) dimension%ncvd,l
      67         117 :       DO 50 n = 1,atoms%ntype
      68          81 :          atoms%ncv(n) = min0(atoms%ncv(n),dimension%ncvd)
      69          36 :    50 CONTINUE
      70          36 :       RETURN
      71           0 :    60 WRITE (6,FMT=8040) n,sck
      72           0 :        CALL juDFT_error("ncv",calledby="convn")
      73             :  8000 FORMAT (10i5)
      74             :  8010 FORMAT (/,/,10x,'convergence parameters for the pseudocharge',&
      75             :      &       ' density expansion',/,10x,'atom',5x,'parameter',5x,&
      76             :      &       'max. l to include',/)
      77             :  8020 FORMAT (10x,i3,9x,i3,13x,i3)
      78             :  8030 FORMAT (10x,'max values allowed: ncvd=',i3,', l=',i3,/)
      79             :  8040 FORMAT (/,/,10x,'atom type',i3,' has rkmax=',f6.4,/,10x,&
      80             :      &       '$$$ stop ncv error')
      81             :       END SUBROUTINE convn
      82             :       END MODULE m_convn

Generated by: LCOV version 1.13