LCOV - code coverage report
Current view: top level - init/old_inp - inpeig_dim.f90 (source / functions) Hit Total Coverage
Test: combined.info Lines: 30 44 68.2 %
Date: 2019-09-08 04:53:50 Functions: 1 1 100.0 %

          Line data    Source code
       1             :       MODULE m_inpeigdim
       2             : !*********************************************************************
       3             : !     inputs the necessary quantities for the eigenvalue part (energy
       4             : !     parameters, k-points, wavefunction cutoffs, etc.).
       5             : !                  m. weinert   jan. 1987
       6             : !*********************************************************************
       7             :       CONTAINS
       8          14 :       SUBROUTINE inpeig_dim(input,obsolete,cell,noco, oneD,kpts,dimension,stars)
       9             : 
      10             :       USE m_constants, ONLY : pi_const,tpi_const
      11             :       USE m_types
      12             :       use m_apwsdim
      13             :       IMPLICIT NONE
      14             :       TYPE(t_input),INTENT(INOUT)     :: input
      15             :       TYPE(t_obsolete),INTENT(INOUT)  :: obsolete
      16             :       TYPE(t_cell),INTENT(INOUT)      :: cell
      17             :       TYPE(t_noco),INTENT(INOUT)      :: noco
      18             :       TYPE(t_stars),INTENT(INOUT)     :: stars
      19             :       TYPE(t_dimension),INTENT(INOUT) :: dimension
      20             :       TYPE(t_kpts),INTENT(INOUT)      :: kpts
      21             :       TYPE(t_oneD),INTENT(INOUT)      :: oneD
      22             :       INTEGER nk,i,nv,nv2,j,kq1,kq2,kq3
      23             :       REAL  s1,s2,scale,bk(3)
      24             :       LOGICAL xyu
      25             :    !     ..
      26          14 :       kpts%nkpt = 0 ; dimension%nvd = 0 ; dimension%nv2d = 0
      27          14 :       stars%kq1_fft = 0 ; stars%kq2_fft = 0 ; stars%kq3_fft = 0
      28             :       !cell%aamat=matmul(transpose(cell%amat),cell%amat)
      29          14 :       cell%bbmat=matmul(cell%bmat,transpose(cell%bmat))
      30             : !
      31          14 :       OPEN (41,file='kpts',form='formatted',status='old')
      32             : 
      33             : !--->    k-mesh: given in units of the reciprocal lattice basis vectors
      34             : !--->    scale is a factor to make input easier (default=1.0). k-pt
      35             : !--->    weights can be relative weights since they are renormalized.
      36             : !--->    input: for bulk - k1,k2,k3,wtkpt
      37             : !--->           for film - k1,k2,wtkpt
      38             : !--->    read k-points from file 41='kpts'
      39          14 :          IF (input%film) THEN
      40           1 :             READ (41,fmt=8050) kpts%nkpt,scale,xyu
      41             :          ELSE
      42          13 :             READ (41,*) kpts%nkpt,scale
      43             :          END IF
      44             :  8030    FORMAT (4f10.5)
      45             :  8040    FORMAT (i5,f20.10)
      46             :  8050    FORMAT (i5,f20.10,3x,l1)
      47             : 
      48          14 :          kpts%nkpt = max(kpts%nkpt,kpts%nkpt)
      49             :  8060    FORMAT (i5,f20.10)
      50          14 :          IF (scale.EQ.0.0) scale = 1.0
      51             :       
      52         222 :            DO nk = 1,kpts%nkpt
      53         104 :              IF(input%film.and..not.oneD%odd%d1) THEN
      54          16 :                 READ (41,fmt=8080) (bk(i),i=1,2)
      55             :  8080        FORMAT (3f10.5)
      56             :              ELSE
      57         500 :                 READ (41,fmt=8030) (bk(i),i=1,3)
      58             :              ENDIF
      59         104 :              IF (oneD%odd%d1) THEN
      60           0 :                bk(1) = 0.
      61           0 :                bk(2) = 0.
      62         104 :              ELSEIF (input%film .AND. .NOT.oneD%odd%d1) THEN
      63           4 :                bk(3) = 0.0
      64           4 :                IF (xyu) THEN
      65             : !            transform to cartesian coordinates
      66           0 :                   IF (cell%latnam.EQ.'hex') THEN
      67           0 :                      bk(1) = bk(1)*tpi_const/cell%amat(2,2)
      68           0 :                      bk(2) = bk(2)*pi_const/cell%amat(1,1)
      69             :                   ELSE
      70           0 :                      bk(1) = bk(1)*pi_const/cell%amat(1,1)
      71           0 :                      bk(2) = bk(2)*pi_const/cell%amat(2,2)
      72             :                   END IF
      73             : !            transform to internal coordinates
      74           0 :                   s1 = 0.0
      75           0 :                   s2 = 0.0
      76           0 :                   DO j = 1,2
      77           0 :                      s1 = s1 + cell%amat(j,1)*bk(j)/tpi_const
      78           0 :                      s2 = s2 + cell%amat(j,2)*bk(j)/tpi_const
      79             :                   ENDDO
      80           0 :                   bk(1) = s1
      81           0 :                   bk(2) = s2
      82             :                END IF
      83             :              END IF
      84         728 :              DO i = 1,3
      85         416 :                bk(i) = bk(i)/scale
      86             :              ENDDO
      87             :              CALL apws_dim(&
      88             :      &                     bk(:),cell,input,noco,oneD,&
      89         104 :      &                     nv,nv2,kq1,kq2,kq3)
      90         104 :              stars%kq1_fft = max(kq1,stars%kq1_fft)
      91         104 :              stars%kq2_fft = max(kq2,stars%kq2_fft)
      92         104 :              stars%kq3_fft = max(kq3,stars%kq3_fft)
      93             :              
      94         104 :              dimension%nvd = max(dimension%nvd,nv)
      95         118 :              dimension%nv2d = max(dimension%nv2d,nv2)
      96             : 
      97             :            ENDDO ! k=pts
      98          14 :            REWIND(41)
      99          14 :            READ (41,*)
     100             :   
     101          14 :       CLOSE (41)
     102             : 
     103          14 :       END SUBROUTINE inpeig_dim
     104             :       END MODULE m_inpeigdim

Generated by: LCOV version 1.13