LCOV - code coverage report
Current view: top level - cdn_mt - abclocdn.F90 (source / functions) Hit Total Coverage
Test: combined.info Lines: 21 34 61.8 %
Date: 2019-09-08 04:53:50 Functions: 1 1 100.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_abclocdn
       8             :   USE m_juDFT
       9             :   !*********************************************************************
      10             :   ! Calculates the (upper case) A, B and C coefficients for the local
      11             :   ! orbitals. The difference to abccoflo is, that a summation over the
      12             :   ! Gs ist performed. The A, B and C coeff. are set up for each eigen-
      13             :   ! state.
      14             :   ! Philipp Kurz 99/04
      15             :   !*********************************************************************
      16             :   !*************** ABBREVIATIONS ***************************************
      17             :   ! nkvec   : stores the number of G-vectors that have been found and
      18             :   !           accepted during the construction of the local orbitals.
      19             :   ! kvec    : k-vector used in hssphn to attach the local orbital 'lo'
      20             :   !           of atom 'na' to it.
      21             :   !*********************************************************************
      22             : CONTAINS
      23        6940 :   SUBROUTINE abclocdn(atoms,sym,noco,lapw,cell,ccchi,iintsp,phase,ylm,&
      24        6940 :        ntyp,na,k,nkvec,lo,ne,alo1,blo1,clo1,acof,bcof,ccof,zMat,l_force,fgp,force)
      25             : 
      26             :     USE m_types
      27             :     USE m_constants
      28             : 
      29             :     IMPLICIT NONE
      30             : 
      31             :     TYPE(t_noco),  INTENT(IN) :: noco
      32             :     TYPE(t_sym),   INTENT(IN) :: sym
      33             :     TYPE(t_atoms), INTENT(IN) :: atoms
      34             :     TYPE(t_lapw),  INTENT(IN) :: lapw
      35             :     TYPE(t_cell),  INTENT(IN) :: cell
      36             :     TYPE(t_mat),   INTENT(IN) :: zMat
      37             :     TYPE(t_force), OPTIONAL, INTENT(INOUT) :: force
      38             : 
      39             :     !     .. Scalar Arguments ..
      40             :     INTEGER, INTENT (IN) :: iintsp
      41             :     INTEGER, INTENT (IN) :: k,na,ne,ntyp,nkvec,lo
      42             :     COMPLEX, INTENT (IN) :: phase
      43             :     LOGICAL, INTENT (IN) :: l_force
      44             : 
      45             :     !     .. Array Arguments ..
      46             :     REAL,    INTENT (IN) :: alo1(:),blo1(:),clo1(:)
      47             :     COMPLEX, INTENT (IN) :: ylm( (atoms%lmaxd+1)**2 )
      48             :     COMPLEX, INTENT (IN) :: ccchi(2)
      49             :     COMPLEX, INTENT (INOUT) :: acof(:,0:,:)!(nobd,0:dimension%lmd,atoms%nat)
      50             :     COMPLEX, INTENT (INOUT) :: bcof(:,0:,:)!(nobd,0:dimension%lmd,atoms%nat)
      51             :     COMPLEX, INTENT (INOUT) :: ccof(-atoms%llod:,:,:,:)!(-atoms%llod:atoms%llod,nobd,atoms%nlod,atoms%nat)
      52             :     REAL,    OPTIONAL, INTENT (IN)    :: fgp(3)
      53             : 
      54             :     !     .. Local Scalars ..
      55             :     COMPLEX ctmp,term1
      56             :     INTEGER i,j,l,ll1,lm,nbasf,m,na2,lmp
      57             :     !     ..
      58             :     !     ..
      59        6940 :     term1 = 2 * tpi_const/SQRT(cell%omtil) * ((atoms%rmt(ntyp)**2)/2) * phase
      60             :     !---> the whole program is in hartree units, therefore 1/wronskian is
      61             :     !---> (rmt**2)/2. the factor i**l, which usually appears in the a, b
      62             :     !---> and c coefficients, is included in the t-matrices. thus, it does
      63             :     !---> not show up in the formula above.
      64        6940 :     l = atoms%llo(lo,ntyp)
      65        6940 :     ll1 = l* (l+1)
      66        6940 :     nbasf=lapw%nv(iintsp)+lapw%index_lo(lo,na)+nkvec
      67      251534 :     DO i = 1,ne
      68      867514 :        DO m = -l,l
      69      615980 :           lm = ll1 + m
      70             :           !+gu_con
      71      615980 :           IF (noco%l_noco) THEN
      72       12384 :              IF (noco%l_ss) THEN
      73           0 :                 ctmp = term1*CONJG(ylm(ll1+m+1))*ccchi(iintsp)*zMat%data_c((iintsp-1)*(lapw%nv(1)+atoms%nlotot)+nbasf,i)
      74             :              ELSE
      75       12384 :                 ctmp = term1*CONJG(ylm(ll1+m+1))*( ccchi(1)*zMat%data_c(nbasf,i)+ccchi(2)*zMat%data_c(lapw%nv(1)+atoms%nlotot+nbasf,i) )
      76             :              ENDIF
      77             :           ELSE
      78      603596 :              IF (zMat%l_real) THEN
      79      597510 :                 ctmp = zMat%data_r(nbasf,i)*term1*CONJG(ylm(ll1+m+1))
      80             :              ELSE
      81        6086 :                 ctmp = zMat%data_c(nbasf,i)*term1*CONJG(ylm(ll1+m+1))
      82             :              ENDIF
      83             :           ENDIF
      84      615980 :           acof(i,lm,na) = acof(i,lm,na) + ctmp*alo1(lo)
      85      615980 :           bcof(i,lm,na) = bcof(i,lm,na) + ctmp*blo1(lo)
      86      615980 :           ccof(m,i,lo,na) = ccof(m,i,lo,na) + ctmp*clo1(lo)
      87      615980 :           IF (atoms%invsat(na)==1.AND.noco%l_soc.AND.sym%invs) THEN
      88           0 :              ctmp = zMat%data_c(nbasf,i)*CONJG(term1)*ylm(ll1+m+1)*(-1)**(l-m)
      89           0 :              na2 = sym%invsatnr(na)
      90           0 :              lmp = ll1 - m
      91           0 :              acof(i,lmp,na2) = acof(i,lmp,na2) +ctmp*alo1(lo)
      92           0 :              bcof(i,lmp,na2) = bcof(i,lmp,na2) +ctmp*blo1(lo)
      93           0 :              ccof(-m,i,lo,na2) = ccof(-m,i,lo,na2) +ctmp*clo1(lo)
      94             :           ENDIF
      95      860574 :           IF (l_force) THEN
      96           0 :              force%acoflo(m,i,lo,na) = force%acoflo(m,i,lo,na) + ctmp*alo1(lo)
      97           0 :              force%bcoflo(m,i,lo,na) = force%bcoflo(m,i,lo,na) + ctmp*blo1(lo)
      98           0 :              DO j = 1,3
      99           0 :                 force%aveccof(j,i,lm,na)   = force%aveccof(j,i,lm,na)   + fgp(j)*ctmp*alo1(lo)
     100           0 :                 force%bveccof(j,i,lm,na)   = force%bveccof(j,i,lm,na)   + fgp(j)*ctmp*blo1(lo)
     101           0 :                 force%cveccof(j,m,i,lo,na) = force%cveccof(j,m,i,lo,na) + fgp(j)*ctmp*clo1(lo)
     102             :              END DO
     103             :           END IF
     104             :        END DO
     105             :     END DO 
     106             :   
     107        6940 :   END SUBROUTINE abclocdn
     108             : END MODULE m_abclocdn

Generated by: LCOV version 1.13