LCOV - code coverage report
Current view: top level - init - fleurinput_postprocess.f90 (source / functions) Hit Total Coverage
Test: FLEUR test coverage Lines: 22 31 71.0 %
Date: 2024-04-28 04:28:00 Functions: 1 1 100.0 %

          Line data    Source code
       1             : MODULE m_fleurinput_postprocess
       2             :   USE m_types_fleurinput
       3             : CONTAINS
       4          80 :   SUBROUTINE fleurinput_postprocess(Cell,Sym,Atoms,Input,Noco,Vacuum,&
       5             :     Banddos,hybinp ,Xcpot,Kpts,gfinp)
       6             :     USE m_juDFT
       7             :     USE m_types_fleurinput
       8             :     use m_make_sym
       9             :     USE m_chkmt
      10             :     !use m_make_xcpot
      11             :     use m_lapwdim
      12             :     use m_checks
      13             :     USE m_relaxio
      14             :     USE m_types_nococonv
      15             :     USE m_constants
      16             : 
      17             :     TYPE(t_cell),INTENT(INOUT)  ::cell
      18             :     TYPE(t_sym),INTENT(INOUT)   ::sym
      19             :     TYPE(t_atoms),INTENT(INOUT) ::atoms
      20             :     TYPE(t_input),INTENT(INOUT) ::input
      21             :     TYPE(t_noco),INTENT(INOUT)     ::noco
      22             :     TYPE(t_vacuum),INTENT(INOUT)::vacuum
      23             :     TYPE(t_banddos),INTENT(IN)  ::banddos
      24             :     TYPE(t_hybinp),INTENT(IN)   :: hybinp 
      25             : 
      26             :     CLASS(t_xcpot),ALLOCATABLE,INTENT(INOUT)::xcpot
      27             :     TYPE(t_kpts),INTENT(INOUT)     ::kpts
      28             :     TYPE(t_gfinp),INTENT(IN)    ::gfinp
      29             :     REAL    :: unfold(3,3)  !just for the unfolding
      30             :     REAL    :: tempPos(3), tempPosIntern(3), distance ! just for LDA+V
      31             :     INTEGER :: i, j
      32         217 :     call cell%init(DOT_PRODUCT(atoms%volmts(:),atoms%neq(:)))
      33          80 :     call atoms%init(cell)
      34          80 :     CALL sym%init(cell,input%film)
      35          80 :     call vacuum%init(sym)
      36             : 
      37          80 :     CALL make_sym(sym,cell,atoms,noco ,input,gfinp)
      38             :     !call make_xcpot(xcpot,atoms,input)
      39          80 :     CALL noco%init(atoms,input%ldauSpinoffd)
      40             : 
      41          80 :     call check_input_switches(banddos,vacuum,noco,atoms,input,sym,kpts,hybinp)
      42             :     ! Check muffin tin radii, only checking, dont use new parameters
      43          80 :     CALL chkmt(atoms,input,vacuum,cell ,.TRUE.)
      44             :     !adjust positions by displacements
      45          80 :     CALL apply_displacements(cell,input,vacuum ,sym,noco,atoms,gfinp)
      46             : !---------------band unfolding ---------------------
      47          80 :     IF (banddos%unfoldband) THEN
      48           1 :       write (*,*) 'input switch unfolding read'
      49           1 :       write (*,*) 'before', kpts%specialPoints(:,2)
      50             :       !unfold=banddos%unfoldTransMat
      51             :       !unfold(1,1)=banddos%unfoldTransMat(1,1)*banddos%s_cell_x
      52             :       !unfold(2,2)=banddos%unfoldTransMat(2,2)*banddos%s_cell_y
      53             :       !unfold(3,3)=banddos%unfoldTransMat(3,3)*banddos%s_cell_z
      54             :       !Do i= 1,kpts%nkpt
      55             :       !  kpts%bk(:,i)=matmul(unfold,kpts%bk(:,i))
      56             :       !END DO
      57             :       !Do i=1,size(kpts%specialPoints,2)
      58             :       !  write (*,*) 'before', kpts%specialPoints(:,i)
      59             :       !  kpts%specialPoints(:,i)=matmul(unfold,kpts%specialPoints(:,i))
      60             :       !  write (*,*) 'after', kpts%specialPoints(:,i)
      61             :       !END DO
      62          13 :       kpts%bk(1,:)=kpts%bk(1,:)*banddos%s_cell_x
      63          13 :       kpts%bk(2,:)=kpts%bk(2,:)*banddos%s_cell_y
      64          13 :       kpts%bk(3,:)=kpts%bk(3,:)*banddos%s_cell_z
      65           3 :       kpts%specialPoints(1,:)=kpts%specialPoints(1,:)*banddos%s_cell_x
      66           3 :       kpts%specialPoints(2,:)=kpts%specialPoints(2,:)*banddos%s_cell_y
      67           3 :       kpts%specialPoints(3,:)=kpts%specialPoints(3,:)*banddos%s_cell_z
      68           1 :       write (*,*) 'after', kpts%specialPoints(:,2)
      69             :     END IF
      70             : !--------------------------------------------------    
      71             : 
      72             : ! Temporary output for LDA+V (may be put into an own routine or be deleted)
      73          80 :    IF (atoms%n_v.GT.0) THEN
      74           0 :       WRITE(oUnit,'(a)') 'LDA+V region parameter + distance output:'
      75           0 :       DO i = 1, atoms%n_v
      76           0 :          WRITE(oUnit,'(a,i5,a,i2,a,i2,a,f15.8)') 'refAtom= ', atoms%lda_v(i)%atomIndex, ' refAtomL= ', atoms%lda_v(i)%thisAtomL, ' otherAtomL= ', atoms%lda_v(i)%otherAtomL, ' V= ', atoms%lda_v(i)%V
      77           0 :          DO j = 1, SIZE(atoms%lda_v(i)%otheratomIndices)
      78           0 :             tempPosIntern(:) = atoms%taual(:,atoms%lda_v(i)%otherAtomIndices(j)) + atoms%lda_v(i)%atomShifts(:,j)
      79           0 :             tempPos(:) = MATMUL(cell%amat,tempPosIntern(:))
      80           0 :             tempPos(:) = tempPos(:) - atoms%pos(:,atoms%lda_v(i)%atomIndex)
      81           0 :             distance = norm2(tempPos)
      82           0 :             WRITE(oUnit,'(a,i5,a,3i3,a,f15.8)') 'otherAtom= ', atoms%lda_v(i)%otherAtomIndices(j), ' shift= ', atoms%lda_v(i)%atomShifts(:,j), ' distance= ', distance
      83             :          END DO
      84             :       END DO
      85             :    END IF
      86             : !--------------------------------------------------------------------------
      87             : 
      88          80 :   END SUBROUTINE fleurinput_postprocess
      89             : END MODULE m_fleurinput_postprocess

Generated by: LCOV version 1.14