LCOV - code coverage report
Current view: top level - force - force_b8.f90 (source / functions) Hit Total Coverage
Test: combined.info Lines: 0 26 0.0 %
Date: 2019-09-08 04:53:50 Functions: 0 1 0.0 %

          Line data    Source code
       1             : MODULE m_forceb8
       2             :   !-------------------
       3             :   ! Implements the surface contribution to the force. Madsen Eq.(B8)
       4             :   !
       5             :   ! FZJ 15/3-01 GMadsen
       6             :   !---------------------------------
       7             : CONTAINS
       8           0 :   SUBROUTINE force_b8(atoms,ecwk,stars, sym,cell, jspin, force,f_b8)
       9             : 
      10             :     USE m_constants, ONLY : tpi_const
      11             :     USE m_sphbes
      12             :     USE m_stern
      13             :     USE m_types
      14             :     IMPLICIT NONE
      15             :     TYPE(t_sym),INTENT(IN)       :: sym
      16             :     TYPE(t_stars),INTENT(IN)     :: stars
      17             :     TYPE(t_cell),INTENT(IN)      :: cell
      18             :     TYPE(t_atoms),INTENT(IN)     :: atoms
      19             :     !     ..
      20             :     !     .. Arguments
      21             :     INTEGER, INTENT (IN) :: jspin
      22             :     COMPLEX, INTENT (IN) :: ecwk(stars%ng3)
      23             :     COMPLEX, INTENT (INOUT) :: f_b8(3,atoms%ntype)
      24             :     real,intent(inout)      :: force(:,:,:)
      25             :     !     ..
      26             :     !     .. Local Variables
      27           0 :     INTEGER g(3),nst,stg(3,sym%nop),ia,istr,i,j,jj,jneq
      28           0 :     REAL    fj(0:atoms%lmaxd),rotkzz(3),rstg(3,sym%nop)
      29             :     REAL    frmt,gl,pha,s
      30           0 :     COMPLEX taup(sym%nop),factor,fact,fstar(3),fsur2(3)
      31             :     !
      32             :    
      33           0 :     ia=1
      34           0 :     DO jneq=1,atoms%ntype
      35           0 :        frmt = 2.0*tpi_const*atoms%rmt(jneq)**2
      36           0 :        fsur2(1:3) = cmplx(0.0,0.0)         
      37             : 
      38             :        ! skip G=(0,0,0) no contribution to ekin
      39           0 :        DO istr=2,stars%ng3_fft
      40             : 
      41           0 :           g(:)     = stars%kv3(:,istr)
      42           0 :           fstar(:) = cmplx(0.0,0.0)
      43           0 :           CALL stern(sym,cell,g, nst,stg,taup,gl,rstg)
      44             : 
      45           0 :           CALL sphbes(atoms%lmax(jneq),atoms%rmt(jneq)*gl,fj)
      46           0 :           fact = ecwk(istr) * fj(1) / gl
      47             : 
      48           0 :           DO jj=1,nst
      49             :              pha=(atoms%taual(1,ia)*stg(1,jj)+atoms%taual(2,ia)*stg(2,jj)&
      50           0 :                   +atoms%taual(3,ia)*stg(3,jj))*tpi_const
      51             :              !
      52             :              !cc   swaped sin and cos because there's an i in the equation
      53             :              !
      54           0 :              factor = fact * cmplx(-sin(pha),cos(pha)) * taup(jj)
      55           0 :              DO i=1,3
      56           0 :                 fstar(i) = fstar(i) + factor*rstg(i,jj)
      57             :              ENDDO
      58             :           ENDDO
      59           0 :           DO i=1,3
      60           0 :              fsur2(i)=fsur2(i)+fstar(i)*frmt
      61             :           ENDDO
      62             :        ENDDO
      63           0 :        DO i=1,3
      64           0 :           f_b8(i,jneq) = f_b8(i,jneq) + fsur2(i)
      65           0 :           force(i,jneq,jspin) = force(i,jneq,jspin) + real(fsur2(i))
      66             :        ENDDO
      67           0 :        ia=ia+atoms%neq(jneq)
      68             :     ENDDO
      69             : 
      70           0 :   END SUBROUTINE force_b8
      71             : END MODULE m_forceb8

Generated by: LCOV version 1.13