Commit 55be5526 authored by Matthias Redies's avatar Matthias Redies

moved l_subvxc, l_calchf, l_addhf from hybinp to hybdat. compiles now

parent 5066aaff
...@@ -159,10 +159,10 @@ CONTAINS ...@@ -159,10 +159,10 @@ CONTAINS
END IF ! hybinp%l_hybrid.OR.input%l_rdmft END IF ! hybinp%l_hybrid.OR.input%l_rdmft
IF(hybinp%l_hybrid) THEN IF(hybinp%l_hybrid) THEN
IF (hybinp%l_addhf) CALL add_Vnonlocal(nk,lapw,atoms,hybinp,hybdat,& IF (hybdat%l_addhf) CALL add_Vnonlocal(nk,lapw,atoms,hybinp,hybdat,&
input,kpts,jsp,results,xcpot,noco,hmat) input,kpts,jsp,results,xcpot,noco,hmat)
IF(hybinp%l_subvxc) THEN IF(hybdat%l_subvxc) THEN
CALL subvxc(lapw,kpts%bk(:,nk),input,jsp,v%mt(:,0,:,:),atoms,ud,& CALL subvxc(lapw,kpts%bk(:,nk),input,jsp,v%mt(:,0,:,:),atoms,ud,&
mpdata,hybinp,hybdat,enpara%el0,enpara%ello0,sym,& mpdata,hybinp,hybdat,enpara%el0,enpara%ello0,sym,&
cell,sphhar,stars,xcpot,mpi,oneD,hmat,vx) cell,sphhar,stars,xcpot,mpi,oneD,hmat,vx)
...@@ -281,11 +281,11 @@ CONTAINS ...@@ -281,11 +281,11 @@ CONTAINS
END DO END DO
END IF END IF
!IF (hybinp%l_hybrid.OR.hybinp%l_calhf) CALL close_eig(eig_id) !IF (hybinp%l_hybrid.OR.hybdat%l_calhf) CALL close_eig(eig_id)
IF( input%jspins .EQ. 1 .AND. hybinp%l_hybrid ) THEN IF( input%jspins .EQ. 1 .AND. hybinp%l_hybrid ) THEN
results%te_hfex%valence = 2*results%te_hfex%valence results%te_hfex%valence = 2*results%te_hfex%valence
IF(hybinp%l_calhf) results%te_hfex%core = 2*results%te_hfex%core IF(hybdat%l_calhf) results%te_hfex%core = 2*results%te_hfex%core
END IF END IF
enpara%epara_min = MINVAL(enpara%el0) enpara%epara_min = MINVAL(enpara%el0)
enpara%epara_min = MIN(MINVAL(enpara%ello0),enpara%epara_min) enpara%epara_min = MIN(MINVAL(enpara%ello0),enpara%epara_min)
......
...@@ -12,9 +12,6 @@ MODULE m_types_hybinp ...@@ -12,9 +12,6 @@ MODULE m_types_hybinp
TYPE, EXTENDS(t_fleurinput_base):: t_hybinp TYPE, EXTENDS(t_fleurinput_base):: t_hybinp
LOGICAL :: l_hybrid = .false. LOGICAL :: l_hybrid = .false.
LOGICAL :: l_subvxc = .false.
LOGICAL :: l_calhf = .false.
LOGICAL :: l_addhf = .false.
INTEGER :: ewaldlambda = -1 INTEGER :: ewaldlambda = -1
INTEGER :: lexp = -1 INTEGER :: lexp = -1
INTEGER :: bands1 = -1 !Only read in INTEGER :: bands1 = -1 !Only read in
...@@ -46,9 +43,6 @@ CONTAINS ...@@ -46,9 +43,6 @@ CONTAINS
rank = 0 rank = 0
END IF END IF
CALL mpi_bc(this%l_hybrid, rank, mpi_comm) CALL mpi_bc(this%l_hybrid, rank, mpi_comm)
CALL mpi_bc(this%l_subvxc, rank, mpi_comm)
CALL mpi_bc(this%l_calhf, rank, mpi_comm)
CALL mpi_bc(this%l_addhf, rank, mpi_comm)
CALL mpi_bc(this%ewaldlambda, rank, mpi_comm) CALL mpi_bc(this%ewaldlambda, rank, mpi_comm)
CALL mpi_bc(this%lexp, rank, mpi_comm) CALL mpi_bc(this%lexp, rank, mpi_comm)
CALL mpi_bc(this%bands1, rank, mpi_comm) CALL mpi_bc(this%bands1, rank, mpi_comm)
......
...@@ -96,7 +96,7 @@ CONTAINS ...@@ -96,7 +96,7 @@ CONTAINS
END DO END DO
END DO END DO
! calculate HF energy ! calculate HF energy
IF (hybinp%l_calhf) THEN IF (hybdat%l_calhf) THEN
WRITE (6, '(A)') new_line('n')//new_line('n')//' ### '//' diagonal HF exchange elements (eV) ###' WRITE (6, '(A)') new_line('n')//new_line('n')//' ### '//' diagonal HF exchange elements (eV) ###'
WRITE (6, '(A)') new_line('n')//' k-point '//'band tail pole total(valence+core)' WRITE (6, '(A)') new_line('n')//' k-point '//'band tail pole total(valence+core)'
...@@ -128,7 +128,7 @@ CONTAINS ...@@ -128,7 +128,7 @@ CONTAINS
IF (iband <= hybdat%nobd(nk,jsp)) THEN IF (iband <= hybdat%nobd(nk,jsp)) THEN
results%te_hfex%valence = results%te_hfex%valence - a_ex*results%w_iks(iband, nk, jsp)*exch(iband, iband) results%te_hfex%valence = results%te_hfex%valence - a_ex*results%w_iks(iband, nk, jsp)*exch(iband, iband)
END IF END IF
IF (hybinp%l_calhf) THEN IF (hybdat%l_calhf) THEN
WRITE (6, '( '' ('',F5.3,'','',F5.3,'','',F5.3,'')'',I4,4X,3F15.5)') & WRITE (6, '( '' ('',F5.3,'','',F5.3,'','',F5.3,'')'',I4,4X,3F15.5)') &
kpts%bkf(:, nk), iband, (REAL(exch(iband, iband)) - hybdat%div_vv(iband, nk, jsp))*(-27.211608), & kpts%bkf(:, nk), iband, (REAL(exch(iband, iband)) - hybdat%div_vv(iband, nk, jsp))*(-27.211608), &
hybdat%div_vv(iband, nk, jsp)*(-27.211608), REAL(exch(iband, iband))*(-27.211608) hybdat%div_vv(iband, nk, jsp)*(-27.211608), REAL(exch(iband, iband))*(-27.211608)
......
...@@ -61,7 +61,7 @@ CONTAINS ...@@ -61,7 +61,7 @@ CONTAINS
skip_kpt = .FALSE. skip_kpt = .FALSE.
IF (hybinp%l_calhf) THEN IF (hybdat%l_calhf) THEN
! Preparations for HF and hybinp functional calculation ! Preparations for HF and hybinp functional calculation
CALL timestart("gen_bz and gen_wavf") CALL timestart("gen_bz and gen_wavf")
...@@ -263,7 +263,7 @@ CONTAINS ...@@ -263,7 +263,7 @@ CONTAINS
deallocate(basprod) deallocate(basprod)
CALL timestop("gen_bz and gen_wavf") CALL timestop("gen_bz and gen_wavf")
ELSE IF (hybinp%l_hybrid) THEN ! hybinp%l_calhf is false ELSE IF (hybinp%l_hybrid) THEN ! hybdat%l_calhf is false
!DO nk = n_start,kpts%nkpt,n_stride !DO nk = n_start,kpts%nkpt,n_stride
DO nk = 1, kpts%nkpt, 1 DO nk = 1, kpts%nkpt, 1
...@@ -274,7 +274,7 @@ CONTAINS ...@@ -274,7 +274,7 @@ CONTAINS
hybdat%maxlmindx = MAXVAL([(SUM([(mpdata%num_radfun_per_l(l, itype)*(2*l + 1), l=0, atoms%lmax(itype))]), itype=1, atoms%ntype)]) hybdat%maxlmindx = MAXVAL([(SUM([(mpdata%num_radfun_per_l(l, itype)*(2*l + 1), l=0, atoms%lmax(itype))]), itype=1, atoms%ntype)])
hybdat%nbands = MIN(hybinp%bands1, input%neig) hybdat%nbands = MIN(hybinp%bands1, input%neig)
ENDIF ! hybinp%l_calhf ENDIF ! hybdat%l_calhf
END SUBROUTINE hf_setup END SUBROUTINE hf_setup
......
...@@ -136,7 +136,7 @@ CONTAINS ...@@ -136,7 +136,7 @@ CONTAINS
END IF END IF
call timestop("read in olap") call timestop("read in olap")
IF (hybinp%l_calhf) THEN IF (hybdat%l_calhf) THEN
ncstd = sum([((hybdat%nindxc(l, itype)*(2*l + 1)*atoms%neq(itype), l=0, hybdat%lmaxc(itype)), itype=1, atoms%ntype)]) ncstd = sum([((hybdat%nindxc(l, itype)*(2*l + 1)*atoms%neq(itype), l=0, hybdat%lmaxc(itype)), itype=1, atoms%ntype)])
IF (nk == 1 .and. mpi%irank == 0) WRITE (*, *) 'calculate new HF matrix' IF (nk == 1 .and. mpi%irank == 0) WRITE (*, *) 'calculate new HF matrix'
IF (nk == 1 .and. jsp == 1 .and. input%imix > 10) CALL system('rm -f broyd*') IF (nk == 1 .and. jsp == 1 .and. input%imix > 10) CALL system('rm -f broyd*')
...@@ -215,7 +215,7 @@ CONTAINS ...@@ -215,7 +215,7 @@ CONTAINS
call timestop("symmetrizeh") call timestop("symmetrizeh")
CALL write_v_x(v_x, kpts%nkpt*(jsp - 1) + nk) CALL write_v_x(v_x, kpts%nkpt*(jsp - 1) + nk)
END IF ! hybinp%l_calhf END IF ! hybdat%l_calhf
CALL timestop("total time hsfock") CALL timestop("total time hsfock")
......
...@@ -4,12 +4,12 @@ ...@@ -4,12 +4,12 @@
! of the MIT license as expressed in the LICENSE file in more detail. ! of the MIT license as expressed in the LICENSE file in more detail.
!-------------------------------------------------------------------------------- !--------------------------------------------------------------------------------
MODULE m_calc_hybinp MODULE m_calc_hybrid
USE m_judft USE m_judft
CONTAINS CONTAINS
SUBROUTINE calc_hybinp(eig_id, mpdata, hybinp, kpts, atoms, input, mpi, noco, cell, oneD, & SUBROUTINE calc_hybrid(eig_id, mpdata, hybinp, hybdat, kpts, atoms, input, mpi, noco, cell, oneD, &
enpara, results, sym, xcpot, v, iterHF) enpara, results, sym, xcpot, v, iterHF)
USE m_types_hybdat USE m_types_hybdat
...@@ -29,6 +29,7 @@ CONTAINS ...@@ -29,6 +29,7 @@ CONTAINS
TYPE(t_oneD), INTENT(IN) :: oneD TYPE(t_oneD), INTENT(IN) :: oneD
type(t_mpdata), intent(inout) :: mpdata type(t_mpdata), intent(inout) :: mpdata
TYPE(t_hybinp), INTENT(IN) :: hybinp TYPE(t_hybinp), INTENT(IN) :: hybinp
TYPE(t_hybdat), INTENT(INOUT) :: hybdat
TYPE(t_input), INTENT(IN) :: input TYPE(t_input), INTENT(IN) :: input
TYPE(t_noco), INTENT(IN) :: noco TYPE(t_noco), INTENT(IN) :: noco
TYPE(t_enpara), INTENT(IN) :: enpara TYPE(t_enpara), INTENT(IN) :: enpara
...@@ -44,7 +45,6 @@ CONTAINS ...@@ -44,7 +45,6 @@ CONTAINS
! local variables ! local variables
INTEGER :: jsp, nk, err INTEGER :: jsp, nk, err
TYPE(t_hybdat) :: hybdat
type(t_lapw) :: lapw type(t_lapw) :: lapw
LOGICAL :: init_vex = .TRUE. !In first call we have to init v_nonlocal LOGICAL :: init_vex = .TRUE. !In first call we have to init v_nonlocal
LOGICAL :: l_zref LOGICAL :: l_zref
...@@ -56,7 +56,7 @@ CONTAINS ...@@ -56,7 +56,7 @@ CONTAINS
! close(7465) ! close(7465)
CALL timestart("hybinp code") CALL timestart("hybinp code")
INQUIRE (file="v_x.mat", exist=hybinp%l_addhf) INQUIRE (file="v_x.mat", exist=hybdat%l_addhf)
CALL open_hybinp_io1( sym%invs) CALL open_hybinp_io1( sym%invs)
IF (kpts%nkptf == 0) THEN IF (kpts%nkptf == 0) THEN
...@@ -65,11 +65,11 @@ CONTAINS ...@@ -65,11 +65,11 @@ CONTAINS
END IF END IF
!Check if new non-local potential shall be generated !Check if new non-local potential shall be generated
hybinp%l_subvxc = hybinp%l_hybrid .AND. (.NOT. xcpot%is_name("exx")) hybdat%l_subvxc = hybinp%l_hybrid .AND. (.NOT. xcpot%is_name("exx"))
!If this is the first iteration loop we can not calculate a new non-local potential !If this is the first iteration loop we can not calculate a new non-local potential
hybinp%l_calhf = (results%last_distance >= 0.0) .AND. (results%last_distance < input%minDistance) hybdat%l_calhf = (results%last_distance >= 0.0) .AND. (results%last_distance < input%minDistance)
IF (.NOT. hybinp%l_calhf) THEN IF (.NOT. hybdat%l_calhf) THEN
hybinp%l_subvxc = hybinp%l_subvxc .AND. hybinp%l_addhf hybdat%l_subvxc = hybdat%l_subvxc .AND. hybdat%l_addhf
CALL timestop("hybinp code") CALL timestop("hybinp code")
RETURN RETURN
ENDIF ENDIF
...@@ -78,7 +78,7 @@ CONTAINS ...@@ -78,7 +78,7 @@ CONTAINS
!Check if we are converged well enough to calculate a new potential !Check if we are converged well enough to calculate a new potential
CALL open_hybinp_io1b( sym%invs) CALL open_hybinp_io1b( sym%invs)
hybinp%l_addhf = .TRUE. hybdat%l_addhf = .TRUE.
!In first iteration allocate some memory !In first iteration allocate some memory
IF (init_vex) THEN IF (init_vex) THEN
...@@ -106,10 +106,10 @@ CONTAINS ...@@ -106,10 +106,10 @@ CONTAINS
init_vex = .FALSE. init_vex = .FALSE.
END IF END IF
hybinp%l_subvxc = (hybinp%l_subvxc .AND. hybinp%l_addhf) hybdat%l_subvxc = (hybdat%l_subvxc .AND. hybdat%l_addhf)
IF (.NOT. ALLOCATED(results%w_iks)) allocate(results%w_iks(input%neig, kpts%nkpt, input%jspins)) IF (.NOT. ALLOCATED(results%w_iks)) allocate(results%w_iks(input%neig, kpts%nkpt, input%jspins))
IF (hybinp%l_calhf) THEN IF (hybdat%l_calhf) THEN
iterHF = iterHF + 1 iterHF = iterHF + 1
!Delete broyd files !Delete broyd files
...@@ -125,12 +125,13 @@ CONTAINS ...@@ -125,12 +125,13 @@ CONTAINS
!construct the mixed-basis !construct the mixed-basis
CALL timestart("generation of mixed basis") CALL timestart("generation of mixed basis")
write (*,*) "iterHF = ", iterHF write (*,*) "iterHF = ", iterHF
CALL mixedbasis(atoms, kpts, input, cell, xcpot, mpdata, hybinp, enpara, mpi, v, iterHF) CALL mixedbasis(atoms, kpts, input, cell, xcpot, mpdata, hybinp, hybdat,&
enpara, mpi, v, iterHF)
CALL timestop("generation of mixed basis") CALL timestop("generation of mixed basis")
CALL open_hybinp_io2(mpdata, hybinp, input, atoms, sym%invs) CALL open_hybinp_io2(mpdata, hybinp, hybdat, input, atoms, sym%invs)
CALL coulombmatrix(mpi, atoms, kpts, cell, sym, mpdata, hybinp, xcpot) CALL coulombmatrix(mpi, atoms, kpts, cell, sym, mpdata, hybinp, hybdat, xcpot)
CALL hf_init(mpdata, hybinp, atoms, input, hybdat) CALL hf_init(mpdata, hybinp, atoms, input, hybdat)
CALL timestop("Preparation for hybinp functionals") CALL timestop("Preparation for hybinp functionals")
...@@ -154,5 +155,5 @@ CONTAINS ...@@ -154,5 +155,5 @@ CONTAINS
ENDIF ENDIF
CALL timestop("hybinp code") CALL timestop("hybinp code")
END SUBROUTINE calc_hybinp END SUBROUTINE calc_hybrid
END MODULE m_calc_hybinp END MODULE m_calc_hybrid
...@@ -28,7 +28,7 @@ SUBROUTINE readLastIterInAndDiffDen(hybinp,vecLen,nextIter,alpha,inDenVec,diffDe ...@@ -28,7 +28,7 @@ SUBROUTINE readLastIterInAndDiffDen(hybinp,vecLen,nextIter,alpha,inDenVec,diffDe
! At the moment broyden IO is mode independent ! At the moment broyden IO is mode independent
IF (hybinp%l_calhf) THEN IF (hybdat%l_calhf) THEN
OPEN (57,file='hf_broyd',form='unformatted',status='unknown') OPEN (57,file='hf_broyd',form='unformatted',status='unknown')
ELSE ELSE
OPEN (57,file='broyd',form='unformatted',status='unknown') OPEN (57,file='broyd',form='unformatted',status='unknown')
...@@ -58,7 +58,7 @@ SUBROUTINE writeLastIterInAndDiffDen(hybinp,vecLen,nextIter,alpha,inDenVec,diffD ...@@ -58,7 +58,7 @@ SUBROUTINE writeLastIterInAndDiffDen(hybinp,vecLen,nextIter,alpha,inDenVec,diffD
! At the moment broyden IO is mode independent ! At the moment broyden IO is mode independent
IF (hybinp%l_calhf) THEN IF (hybdat%l_calhf) THEN
OPEN (57,file='hf_broyd',form='unformatted',status='unknown') OPEN (57,file='hf_broyd',form='unformatted',status='unknown')
ELSE ELSE
OPEN (57,file='broyd',form='unformatted',status='unknown') OPEN (57,file='broyd',form='unformatted',status='unknown')
...@@ -90,7 +90,7 @@ SUBROUTINE readUVec(input,hybinp,vecLen,relIter,currentIter,uVec) ...@@ -90,7 +90,7 @@ SUBROUTINE readUVec(input,hybinp,vecLen,relIter,currentIter,uVec)
recLen=(vecLen+1)*8 recLen=(vecLen+1)*8
IF (hybinp%l_calhf) THEN IF (hybdat%l_calhf) THEN
OPEN (59,file='hf_broyd.'//CHAR(input%imix+48),access='direct',& OPEN (59,file='hf_broyd.'//CHAR(input%imix+48),access='direct',&
recl=recLen,form='unformatted',status='unknown') recl=recLen,form='unformatted',status='unknown')
ELSE ELSE
...@@ -123,7 +123,7 @@ SUBROUTINE writeUVec(input,hybinp,vecLen,currentIter,uVec) ...@@ -123,7 +123,7 @@ SUBROUTINE writeUVec(input,hybinp,vecLen,currentIter,uVec)
recLen=(vecLen+1)*8 recLen=(vecLen+1)*8
IF (hybinp%l_calhf) THEN IF (hybdat%l_calhf) THEN
OPEN (59,file='hf_broyd.'//CHAR(input%imix+48),access='direct',& OPEN (59,file='hf_broyd.'//CHAR(input%imix+48),access='direct',&
recl=recLen,form='unformatted',status='unknown') recl=recLen,form='unformatted',status='unknown')
ELSE ELSE
...@@ -157,7 +157,7 @@ SUBROUTINE readVVec(input,hybinp,vecLen,relIter,currentIter,dfivi,vVec) ...@@ -157,7 +157,7 @@ SUBROUTINE readVVec(input,hybinp,vecLen,relIter,currentIter,dfivi,vVec)
recLen=(vecLen+1)*8 recLen=(vecLen+1)*8
IF (hybinp%l_calhf) THEN IF (hybdat%l_calhf) THEN
OPEN (59,file='hf_broyd.'//CHAR(input%imix+48),access='direct',& OPEN (59,file='hf_broyd.'//CHAR(input%imix+48),access='direct',&
recl=recLen,form='unformatted',status='unknown') recl=recLen,form='unformatted',status='unknown')
ELSE ELSE
...@@ -191,7 +191,7 @@ SUBROUTINE writeVVec(input,hybinp,vecLen,currentIter,dfivi,vVec) ...@@ -191,7 +191,7 @@ SUBROUTINE writeVVec(input,hybinp,vecLen,currentIter,dfivi,vVec)
recLen=(vecLen+1)*8 recLen=(vecLen+1)*8
IF (hybinp%l_calhf) THEN IF (hybdat%l_calhf) THEN
OPEN (59,file='hf_broyd.'//CHAR(input%imix+48),access='direct',& OPEN (59,file='hf_broyd.'//CHAR(input%imix+48),access='direct',&
recl=recLen,form='unformatted',status='unknown') recl=recLen,form='unformatted',status='unknown')
ELSE ELSE
...@@ -232,7 +232,7 @@ SUBROUTINE readDeltaNVec(input,hybinp,vecLen,relIter,currentIter,deltaNVec) ...@@ -232,7 +232,7 @@ SUBROUTINE readDeltaNVec(input,hybinp,vecLen,relIter,currentIter,deltaNVec)
recLen=(vecLen+1)*8 recLen=(vecLen+1)*8
IF (hybinp%l_calhf) THEN IF (hybdat%l_calhf) THEN
OPEN (59,file='hf_broyd_DN',access='direct',& OPEN (59,file='hf_broyd_DN',access='direct',&
recl=recLen,form='unformatted',status='unknown') recl=recLen,form='unformatted',status='unknown')
ELSE ELSE
...@@ -268,7 +268,7 @@ SUBROUTINE writeDeltaNVec(input,hybinp,vecLen,currentIter,deltaNVec) ...@@ -268,7 +268,7 @@ SUBROUTINE writeDeltaNVec(input,hybinp,vecLen,currentIter,deltaNVec)
recLen=(vecLen+1)*8 recLen=(vecLen+1)*8
IF (hybinp%l_calhf) THEN IF (hybdat%l_calhf) THEN
OPEN (59,file='hf_broyd_DN',access='direct',& OPEN (59,file='hf_broyd_DN',access='direct',&
recl=recLen,form='unformatted',status='unknown') recl=recLen,form='unformatted',status='unknown')
ELSE ELSE
...@@ -303,7 +303,7 @@ SUBROUTINE readDeltaFVec(input,hybinp,vecLen,relIter,currentIter,deltaFVec) ...@@ -303,7 +303,7 @@ SUBROUTINE readDeltaFVec(input,hybinp,vecLen,relIter,currentIter,deltaFVec)
recLen=(vecLen+1)*8 recLen=(vecLen+1)*8
IF (hybinp%l_calhf) THEN IF (hybdat%l_calhf) THEN
OPEN (59,file='hf_broyd_DF',access='direct',& OPEN (59,file='hf_broyd_DF',access='direct',&
recl=recLen,form='unformatted',status='unknown') recl=recLen,form='unformatted',status='unknown')
ELSE ELSE
...@@ -339,7 +339,7 @@ SUBROUTINE writeDeltaFVec(input,hybinp,vecLen,currentIter,deltaFVec) ...@@ -339,7 +339,7 @@ SUBROUTINE writeDeltaFVec(input,hybinp,vecLen,currentIter,deltaFVec)
recLen=(vecLen+1)*8 recLen=(vecLen+1)*8
IF (hybinp%l_calhf) THEN IF (hybdat%l_calhf) THEN
OPEN (59,file='hf_broyd_DF',access='direct',& OPEN (59,file='hf_broyd_DF',access='direct',&
recl=recLen,form='unformatted',status='unknown') recl=recLen,form='unformatted',status='unknown')
ELSE ELSE
...@@ -375,7 +375,7 @@ SUBROUTINE writeBroydenOverlapExt(input,hybinp,currentIter,historyLength,& ...@@ -375,7 +375,7 @@ SUBROUTINE writeBroydenOverlapExt(input,hybinp,currentIter,historyLength,&
recLen = 8*4*input%maxIter ! sizeOfReal*numberOfVectors*vectorLength recLen = 8*4*input%maxIter ! sizeOfReal*numberOfVectors*vectorLength
recLen = recLen + 2*8 ! storage for currentIter, historyLength recLen = recLen + 2*8 ! storage for currentIter, historyLength
IF (hybinp%l_calhf) THEN IF (hybdat%l_calhf) THEN
OPEN (59,file='hf_broydOvlp',access='direct',& OPEN (59,file='hf_broydOvlp',access='direct',&
recl=recLen,form='unformatted',status='unknown') recl=recLen,form='unformatted',status='unknown')
ELSE ELSE
...@@ -419,7 +419,7 @@ SUBROUTINE readBroydenOverlaps(input,hybinp,currentIter,historyLength,& ...@@ -419,7 +419,7 @@ SUBROUTINE readBroydenOverlaps(input,hybinp,currentIter,historyLength,&
recLen = 8*4*input%maxIter ! sizeOfReal*numberOfVectors*vectorLength recLen = 8*4*input%maxIter ! sizeOfReal*numberOfVectors*vectorLength
recLen = recLen + 2*8 ! storage for currentIter, historyLength recLen = recLen + 2*8 ! storage for currentIter, historyLength
IF (hybinp%l_calhf) THEN IF (hybdat%l_calhf) THEN
OPEN (59,file='hf_broydOvlp',access='direct',& OPEN (59,file='hf_broydOvlp',access='direct',&
recl=recLen,form='unformatted',status='unknown') recl=recLen,form='unformatted',status='unknown')
ELSE ELSE
...@@ -517,7 +517,7 @@ LOGICAL FUNCTION initBroydenHistory(input,hybinp, vecLen) ...@@ -517,7 +517,7 @@ LOGICAL FUNCTION initBroydenHistory(input,hybinp, vecLen)
recLen=(vecLen+1)*8 recLen=(vecLen+1)*8
IF (hybinp%l_calhf) THEN IF (hybdat%l_calhf) THEN
OPEN (59,file='hf_broyd.'//CHAR(input%imix+48),access='direct',& OPEN (59,file='hf_broyd.'//CHAR(input%imix+48),access='direct',&
recl=recLen,form='unformatted',status='unknown') recl=recLen,form='unformatted',status='unknown')
ELSE ELSE
...@@ -546,7 +546,7 @@ LOGICAL FUNCTION initBroydenHistory2(input,hybinp, vecLen) ...@@ -546,7 +546,7 @@ LOGICAL FUNCTION initBroydenHistory2(input,hybinp, vecLen)
recLen=(vecLen+1)*8 recLen=(vecLen+1)*8
IF (hybinp%l_calhf) THEN IF (hybdat%l_calhf) THEN
OPEN (59,file='hf_broyd_DF',access='direct',& OPEN (59,file='hf_broyd_DF',access='direct',&
recl=recLen,form='unformatted',status='unknown') recl=recLen,form='unformatted',status='unknown')
OPEN (60,file='hf_broyd_DN',access='direct',& OPEN (60,file='hf_broyd_DN',access='direct',&
......
...@@ -56,7 +56,7 @@ CONTAINS ...@@ -56,7 +56,7 @@ CONTAINS
USE m_mix USE m_mix
USE m_xmlOutput USE m_xmlOutput
USE m_juDFT_time USE m_juDFT_time
USE m_calc_hybinp USE m_calc_hybrid
USE m_rdmft USE m_rdmft
USE m_io_hybinp USE m_io_hybinp
USE m_wann_optional USE m_wann_optional
...@@ -100,6 +100,7 @@ CONTAINS ...@@ -100,6 +100,7 @@ CONTAINS
TYPE(t_kpts) :: kpts TYPE(t_kpts) :: kpts
TYPE(t_mpinp) :: mpinp TYPE(t_mpinp) :: mpinp
TYPE(t_hybinp) :: hybinp TYPE(t_hybinp) :: hybinp
TYPE(t_hybdat) :: hybdat
TYPE(t_mpdata) :: mpdata TYPE(t_mpdata) :: mpdata
TYPE(t_oneD) :: oneD TYPE(t_oneD) :: oneD
TYPE(t_mpi) :: mpi TYPE(t_mpi) :: mpi
...@@ -245,10 +246,10 @@ CONTAINS ...@@ -245,10 +246,10 @@ CONTAINS
IF (hybinp%l_hybrid) THEN IF (hybinp%l_hybrid) THEN
SELECT TYPE(xcpot) SELECT TYPE(xcpot)
TYPE IS(t_xcpot_inbuild) TYPE IS(t_xcpot_inbuild)
CALL calc_hybinp(eig_id,mpdata,hybinp,kpts,atoms,input,mpi,noco,& CALL calc_hybrid(eig_id,mpdata,hybinp,hybdat,kpts,atoms,input,mpi,noco,&
cell,oneD,enpara,results,sym,xcpot,vTot,iterHF) cell,oneD,enpara,results,sym,xcpot,vTot,iterHF)
END SELECT END SELECT
IF(hybinp%l_calhf) THEN IF(hybdat%l_calhf) THEN
call mixing_history_reset(mpi) call mixing_history_reset(mpi)
iter = 0 iter = 0
END IF END IF
...@@ -259,7 +260,7 @@ CONTAINS ...@@ -259,7 +260,7 @@ CONTAINS
END IF END IF
!IF(.not.input%eig66(1))THEN !IF(.not.input%eig66(1))THEN
CALL reset_eig(eig_id,noco%l_soc) ! This has to be placed after the calc_hybinp call but before eigen CALL reset_eig(eig_id,noco%l_soc) ! This has to be placed after the calc_hybrid call but before eigen
!END IF !END IF
!#endif !#endif
...@@ -280,7 +281,7 @@ CONTAINS ...@@ -280,7 +281,7 @@ CONTAINS
! ,sym,oneD,cell,noco,input,atoms,inDen) ! ,sym,oneD,cell,noco,input,atoms,inDen)
!END Rot For Testing (HIGHLY EXPERIMENTAL ROUTINE) !END Rot For Testing (HIGHLY EXPERIMENTAL ROUTINE)
CALL timestart("generation of potential") CALL timestart("generation of potential")
CALL vgen(hybinp,field,input,xcpot,atoms,sphhar,stars,vacuum,sym,& CALL vgen(hybdat,field,input,xcpot,atoms,sphhar,stars,vacuum,sym,&
cell,oneD,sliceplot,mpi,results,noco,EnergyDen,inDen,vTot,vx,vCoul) cell,oneD,sliceplot,mpi,results,noco,EnergyDen,inDen,vTot,vx,vCoul)
CALL timestop("generation of potential") CALL timestop("generation of potential")
...@@ -308,7 +309,8 @@ CONTAINS ...@@ -308,7 +309,8 @@ CONTAINS
CALL timestop("Updating energy parameters") CALL timestop("Updating energy parameters")
!IF(.not.input%eig66(1))THEN !IF(.not.input%eig66(1))THEN
CALL eigen(mpi,stars,sphhar,atoms,xcpot,sym,kpts,vacuum,input,& CALL eigen(mpi,stars,sphhar,atoms,xcpot,sym,kpts,vacuum,input,&
cell,enpara,banddos,noco,oneD,mpdata,hybinp,iter,eig_id,results,inDen,vTemp,vx,hub1) cell,enpara,banddos,noco,oneD,mpdata,hybinp,hybdat,&
iter,eig_id,results,inDen,vTemp,vx,hub1)
!ENDIF !ENDIF
vTot%mmpMat = vTemp%mmpMat vTot%mmpMat = vTemp%mmpMat
!!$ eig_idList(pc) = eig_id !!$ eig_idList(pc) = eig_id
...@@ -317,7 +319,7 @@ CONTAINS ...@@ -317,7 +319,7 @@ CONTAINS
! add all contributions to total energy ! add all contributions to total energy
#ifdef CPP_MPI #ifdef CPP_MPI
! send all result of local total energies to the r ! send all result of local total energies to the r
IF (hybinp%l_hybrid.AND.hybinp%l_calhf) THEN IF (hybinp%l_hybrid.AND.hybdat%l_calhf) THEN
IF (mpi%irank==0) THEN IF (mpi%irank==0) THEN
CALL MPI_Reduce(MPI_IN_PLACE,results%te_hfex%core,1,MPI_REAL8,MPI_SUM,0,mpi%mpi_comm,ierr(1)) CALL MPI_Reduce(MPI_IN_PLACE,results%te_hfex%core,1,MPI_REAL8,MPI_SUM,0,mpi%mpi_comm,ierr(1))
ELSE ELSE
...@@ -431,7 +433,8 @@ CONTAINS ...@@ -431,7 +433,8 @@ CONTAINS
SELECT TYPE(xcpot) SELECT TYPE(xcpot)
TYPE IS(t_xcpot_inbuild) TYPE IS(t_xcpot_inbuild)
CALL rdmft(eig_id,mpi,input,kpts,banddos,sliceplot,cell,atoms,enpara,stars,vacuum,& CALL rdmft(eig_id,mpi,input,kpts,banddos,sliceplot,cell,atoms,enpara,stars,vacuum,&
sphhar,sym</