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
END IF ! hybinp%l_hybrid.OR.input%l_rdmft
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)
IF(hybinp%l_subvxc) THEN
IF(hybdat%l_subvxc) THEN
CALL subvxc(lapw,kpts%bk(:,nk),input,jsp,v%mt(:,0,:,:),atoms,ud,&
mpdata,hybinp,hybdat,enpara%el0,enpara%ello0,sym,&
cell,sphhar,stars,xcpot,mpi,oneD,hmat,vx)
......@@ -281,11 +281,11 @@ CONTAINS
END DO
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
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
enpara%epara_min = MINVAL(enpara%el0)
enpara%epara_min = MIN(MINVAL(enpara%ello0),enpara%epara_min)
......
......@@ -12,9 +12,6 @@ MODULE m_types_hybinp
TYPE, EXTENDS(t_fleurinput_base):: t_hybinp
LOGICAL :: l_hybrid = .false.
LOGICAL :: l_subvxc = .false.
LOGICAL :: l_calhf = .false.
LOGICAL :: l_addhf = .false.
INTEGER :: ewaldlambda = -1
INTEGER :: lexp = -1
INTEGER :: bands1 = -1 !Only read in
......@@ -46,9 +43,6 @@ CONTAINS
rank = 0
END IF
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%lexp, rank, mpi_comm)
CALL mpi_bc(this%bands1, rank, mpi_comm)
......
......@@ -96,7 +96,7 @@ CONTAINS
END DO
END DO
! 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')//' k-point '//'band tail pole total(valence+core)'
......@@ -128,7 +128,7 @@ CONTAINS
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)
END IF
IF (hybinp%l_calhf) THEN
IF (hybdat%l_calhf) THEN
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), &
hybdat%div_vv(iband, nk, jsp)*(-27.211608), REAL(exch(iband, iband))*(-27.211608)
......
......@@ -61,7 +61,7 @@ CONTAINS
skip_kpt = .FALSE.
IF (hybinp%l_calhf) THEN
IF (hybdat%l_calhf) THEN
! Preparations for HF and hybinp functional calculation
CALL timestart("gen_bz and gen_wavf")
......@@ -263,7 +263,7 @@ CONTAINS
deallocate(basprod)
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 = 1, kpts%nkpt, 1
......@@ -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%nbands = MIN(hybinp%bands1, input%neig)
ENDIF ! hybinp%l_calhf
ENDIF ! hybdat%l_calhf
END SUBROUTINE hf_setup
......
......@@ -136,7 +136,7 @@ CONTAINS
END IF
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)])
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*')
......@@ -215,7 +215,7 @@ CONTAINS
call timestop("symmetrizeh")
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")
......
......@@ -4,12 +4,12 @@
! of the MIT license as expressed in the LICENSE file in more detail.
!--------------------------------------------------------------------------------
MODULE m_calc_hybinp
MODULE m_calc_hybrid
USE m_judft
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)
USE m_types_hybdat
......@@ -29,6 +29,7 @@ CONTAINS
TYPE(t_oneD), INTENT(IN) :: oneD
type(t_mpdata), intent(inout) :: mpdata
TYPE(t_hybinp), INTENT(IN) :: hybinp
TYPE(t_hybdat), INTENT(INOUT) :: hybdat
TYPE(t_input), INTENT(IN) :: input
TYPE(t_noco), INTENT(IN) :: noco
TYPE(t_enpara), INTENT(IN) :: enpara
......@@ -44,7 +45,6 @@ CONTAINS
! local variables
INTEGER :: jsp, nk, err
TYPE(t_hybdat) :: hybdat
type(t_lapw) :: lapw
LOGICAL :: init_vex = .TRUE. !In first call we have to init v_nonlocal
LOGICAL :: l_zref
......@@ -56,7 +56,7 @@ CONTAINS
! close(7465)
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)
IF (kpts%nkptf == 0) THEN
......@@ -65,11 +65,11 @@ CONTAINS
END IF
!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
hybinp%l_calhf = (results%last_distance >= 0.0) .AND. (results%last_distance < input%minDistance)
IF (.NOT. hybinp%l_calhf) THEN
hybinp%l_subvxc = hybinp%l_subvxc .AND. hybinp%l_addhf
hybdat%l_calhf = (results%last_distance >= 0.0) .AND. (results%last_distance < input%minDistance)
IF (.NOT. hybdat%l_calhf) THEN
hybdat%l_subvxc = hybdat%l_subvxc .AND. hybdat%l_addhf
CALL timestop("hybinp code")
RETURN
ENDIF
......@@ -78,7 +78,7 @@ CONTAINS
!Check if we are converged well enough to calculate a new potential
CALL open_hybinp_io1b( sym%invs)
hybinp%l_addhf = .TRUE.
hybdat%l_addhf = .TRUE.
!In first iteration allocate some memory
IF (init_vex) THEN
......@@ -106,10 +106,10 @@ CONTAINS
init_vex = .FALSE.
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 (hybinp%l_calhf) THEN
IF (hybdat%l_calhf) THEN
iterHF = iterHF + 1
!Delete broyd files
......@@ -125,12 +125,13 @@ CONTAINS
!construct the mixed-basis
CALL timestart("generation of mixed basis")
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 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 timestop("Preparation for hybinp functionals")
......@@ -154,5 +155,5 @@ CONTAINS
ENDIF
CALL timestop("hybinp code")
END SUBROUTINE calc_hybinp
END MODULE m_calc_hybinp
END SUBROUTINE calc_hybrid
END MODULE m_calc_hybrid
......@@ -28,7 +28,7 @@ SUBROUTINE readLastIterInAndDiffDen(hybinp,vecLen,nextIter,alpha,inDenVec,diffDe
! 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')
ELSE
OPEN (57,file='broyd',form='unformatted',status='unknown')
......@@ -58,7 +58,7 @@ SUBROUTINE writeLastIterInAndDiffDen(hybinp,vecLen,nextIter,alpha,inDenVec,diffD
! 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')
ELSE
OPEN (57,file='broyd',form='unformatted',status='unknown')
......@@ -90,7 +90,7 @@ SUBROUTINE readUVec(input,hybinp,vecLen,relIter,currentIter,uVec)
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',&
recl=recLen,form='unformatted',status='unknown')
ELSE
......@@ -123,7 +123,7 @@ SUBROUTINE writeUVec(input,hybinp,vecLen,currentIter,uVec)
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',&
recl=recLen,form='unformatted',status='unknown')
ELSE
......@@ -157,7 +157,7 @@ SUBROUTINE readVVec(input,hybinp,vecLen,relIter,currentIter,dfivi,vVec)
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',&
recl=recLen,form='unformatted',status='unknown')
ELSE
......@@ -191,7 +191,7 @@ SUBROUTINE writeVVec(input,hybinp,vecLen,currentIter,dfivi,vVec)
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',&
recl=recLen,form='unformatted',status='unknown')
ELSE
......@@ -232,7 +232,7 @@ SUBROUTINE readDeltaNVec(input,hybinp,vecLen,relIter,currentIter,deltaNVec)
recLen=(vecLen+1)*8
IF (hybinp%l_calhf) THEN
IF (hybdat%l_calhf) THEN
OPEN (59,file='hf_broyd_DN',access='direct',&
recl=recLen,form='unformatted',status='unknown')
ELSE
......@@ -268,7 +268,7 @@ SUBROUTINE writeDeltaNVec(input,hybinp,vecLen,currentIter,deltaNVec)
recLen=(vecLen+1)*8
IF (hybinp%l_calhf) THEN
IF (hybdat%l_calhf) THEN
OPEN (59,file='hf_broyd_DN',access='direct',&
recl=recLen,form='unformatted',status='unknown')
ELSE
......@@ -303,7 +303,7 @@ SUBROUTINE readDeltaFVec(input,hybinp,vecLen,relIter,currentIter,deltaFVec)
recLen=(vecLen+1)*8
IF (hybinp%l_calhf) THEN
IF (hybdat%l_calhf) THEN
OPEN (59,file='hf_broyd_DF',access='direct',&
recl=recLen,form='unformatted',status='unknown')
ELSE
......@@ -339,7 +339,7 @@ SUBROUTINE writeDeltaFVec(input,hybinp,vecLen,currentIter,deltaFVec)
recLen=(vecLen+1)*8
IF (hybinp%l_calhf) THEN
IF (hybdat%l_calhf) THEN
OPEN (59,file='hf_broyd_DF',access='direct',&
recl=recLen,form='unformatted',status='unknown')
ELSE
......@@ -375,7 +375,7 @@ SUBROUTINE writeBroydenOverlapExt(input,hybinp,currentIter,historyLength,&
recLen = 8*4*input%maxIter ! sizeOfReal*numberOfVectors*vectorLength
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',&
recl=recLen,form='unformatted',status='unknown')
ELSE
......@@ -419,7 +419,7 @@ SUBROUTINE readBroydenOverlaps(input,hybinp,currentIter,historyLength,&
recLen = 8*4*input%maxIter ! sizeOfReal*numberOfVectors*vectorLength
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',&
recl=recLen,form='unformatted',status='unknown')
ELSE
......@@ -517,7 +517,7 @@ LOGICAL FUNCTION initBroydenHistory(input,hybinp, vecLen)
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',&
recl=recLen,form='unformatted',status='unknown')
ELSE
......@@ -546,7 +546,7 @@ LOGICAL FUNCTION initBroydenHistory2(input,hybinp, vecLen)
recLen=(vecLen+1)*8
IF (hybinp%l_calhf) THEN
IF (hybdat%l_calhf) THEN
OPEN (59,file='hf_broyd_DF',access='direct',&
recl=recLen,form='unformatted',status='unknown')
OPEN (60,file='hf_broyd_DN',access='direct',&
......
......@@ -56,7 +56,7 @@ CONTAINS
USE m_mix
USE m_xmlOutput
USE m_juDFT_time
USE m_calc_hybinp
USE m_calc_hybrid
USE m_rdmft
USE m_io_hybinp
USE m_wann_optional
......@@ -100,6 +100,7 @@ CONTAINS
TYPE(t_kpts) :: kpts
TYPE(t_mpinp) :: mpinp
TYPE(t_hybinp) :: hybinp
TYPE(t_hybdat) :: hybdat
TYPE(t_mpdata) :: mpdata
TYPE(t_oneD) :: oneD
TYPE(t_mpi) :: mpi
......@@ -245,10 +246,10 @@ CONTAINS
IF (hybinp%l_hybrid) THEN
SELECT TYPE(xcpot)
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)
END SELECT
IF(hybinp%l_calhf) THEN
IF(hybdat%l_calhf) THEN
call mixing_history_reset(mpi)
iter = 0
END IF
......@@ -259,7 +260,7 @@ CONTAINS
END IF
!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
!#endif
......@@ -280,7 +281,7 @@ CONTAINS
! ,sym,oneD,cell,noco,input,atoms,inDen)
!END Rot For Testing (HIGHLY EXPERIMENTAL ROUTINE)
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)
CALL timestop("generation of potential")
......@@ -308,7 +309,8 @@ CONTAINS
CALL timestop("Updating energy parameters")
!IF(.not.input%eig66(1))THEN
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
vTot%mmpMat = vTemp%mmpMat
!!$ eig_idList(pc) = eig_id
......@@ -317,7 +319,7 @@ CONTAINS
! add all contributions to total energy
#ifdef CPP_MPI
! 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
CALL MPI_Reduce(MPI_IN_PLACE,results%te_hfex%core,1,MPI_REAL8,MPI_SUM,0,mpi%mpi_comm,ierr(1))
ELSE
......@@ -431,7 +433,8 @@ CONTAINS
SELECT TYPE(xcpot)
TYPE IS(t_xcpot_inbuild)
CALL rdmft(eig_id,mpi,input,kpts,banddos,sliceplot,cell,atoms,enpara,stars,vacuum,&
sphhar,sym,field,vTot,vCoul,oneD,noco,xcpot,mpdata,hybinp,results,coreSpecInput,archiveType,outDen)
sphhar,sym,field,vTot,vCoul,oneD,noco,xcpot,mpdata,hybinp,hybdat,&
results,coreSpecInput,archiveType,outDen)
END SELECT
END IF
......@@ -474,7 +477,7 @@ CONTAINS
! total energy
CALL timestart('determination of total energy')
CALL totale(mpi,atoms,sphhar,stars,vacuum,sym,input,noco,cell,oneD,&
xcpot,hybinp,vTot,vCoul,iter,inDen,results)
xcpot,hybdat,vTot,vCoul,iter,inDen,results)
CALL timestop('determination of total energy')
IF (hybinp%l_hybrid) CALL close_eig(eig_id)
......@@ -524,14 +527,14 @@ CONTAINS
l_cont = .TRUE.
IF (hybinp%l_hybrid) THEN
IF(hybinp%l_calhf) THEN
IF(hybdat%l_calhf) THEN
l_cont = l_cont.AND.(iterHF < input%itmax)
l_cont = l_cont.AND.(input%mindistance<=results%last_distance)
CALL check_time_for_next_iteration(iterHF,l_cont)
ELSE
l_cont = l_cont.AND.(iter < 50) ! Security stop for non-converging nested PBE calculations
END IF
IF (hybinp%l_subvxc) THEN
IF (hybdat%l_subvxc) THEN
results%te_hfex%valence = 0
END IF
ELSE
......
......@@ -6,16 +6,16 @@
MODULE m_totale
CONTAINS
SUBROUTINE totale(mpi,atoms,sphhar,stars,vacuum, &
sym,input,noco,cell,oneD, xcpot,hybinp,vTot,vCoul,it,den,results)
sym,input,noco,cell,oneD, xcpot,hybdat,vTot,vCoul,it,den,results)
!
! ***************************************************
! subroutine calculates the total energy
! subroutine calculates the total energy
! ***************************************************
! single particle energies
! SEIGC sum of the eigenvalues of the core states
! calculated in cdngen.f
! SEIGSCV sum of the eigenvalues of the semicore and valence states
! calculated in fermie.f
! calculated in fermie.f
! TS : entropy contribution to the free energy
! SEIGC,SEIGSCV, TS are calculated in fermie.f
! ***************************************************
......@@ -40,7 +40,7 @@ CONTAINS
! E0 = TOTE - TS/2
! ***************************************************
!
USE m_intgr , ONLY : intgr3
USE m_intgr , ONLY : intgr3
USE m_constants
USE m_force_a4
USE m_force_a3
......@@ -53,7 +53,7 @@ CONTAINS
TYPE(t_results),INTENT(INOUT) :: results
CLASS(t_xcpot),INTENT(IN) :: xcpot
TYPE(t_oneD),INTENT(IN) :: oneD
TYPE(t_hybinp),INTENT(IN) :: hybinp
TYPE(t_hybdat),INTENT(IN) :: hybdat
TYPE(t_input),INTENT(IN) :: input
TYPE(t_vacuum),INTENT(IN) :: vacuum
TYPE(t_noco),INTENT(IN) :: noco
......@@ -62,12 +62,12 @@ CONTAINS
TYPE(t_cell),INTENT(IN) :: cell
TYPE(t_sphhar),INTENT(IN) :: sphhar
TYPE(t_atoms),INTENT(IN) :: atoms
TYPE(t_potden),INTENT(IN) :: vTot,vCoul
TYPE(t_potden),INTENT(IN) :: den
! ..
! .. Scalar Arguments ..
INTEGER,INTENT (IN) :: it
INTEGER,INTENT (IN) :: it
! Local type instances
......@@ -111,7 +111,7 @@ CONTAINS
WRITE (6,FMT=8040) results%te_exc
8040 FORMAT (/,10x,'charge density-ex.-corr.energy density integral=', t40,f20.10)
!
! ---> Fock exchange contribution
! ---> Fock exchange contribution
!
IF (xcpot%is_hybrid()) THEN
!IF (xcpot%is_name("exx")) THEN
......@@ -180,7 +180,7 @@ CONTAINS
results%tote = results%tote - results%e_ldau ! gu test
ENDIF
! print 'HF' before total energy to make it grepable
IF ( .NOT. hybinp%l_calhf ) THEN
IF ( .NOT. hybdat%l_calhf ) THEN
WRITE ( 6,FMT=8060) results%tote
ELSE
WRITE ( 6,FMT=8061) results%tote
......@@ -190,7 +190,7 @@ CONTAINS
! extrapolated for T->0
!
! print 'HF' before all energies to make them grepable
IF ( .NOT. hybinp%l_calhf ) THEN
IF ( .NOT. hybdat%l_calhf ) THEN
WRITE ( 6,FMT=8065) results%ts
WRITE ( 6,FMT=8070) results%tote-results%ts
WRITE ( 6,FMT=8080) results%tote-0.5e0*results%ts
......@@ -203,7 +203,7 @@ CONTAINS
WRITE(attributes(1),'(f20.10)') results%tote
WRITE(attributes(2),'(a)') 'Htr'
WRITE(attributes(3),'(a)') 'HF'
IF (hybinp%l_calhf) THEN
IF (hybdat%l_calhf) THEN
CALL openXMLElementForm('totalEnergy',(/'value ','units ','comment'/),attributes,reshape((/40,20/),(/1,2/)))
ELSE
CALL openXMLElementForm('totalEnergy',(/'value','units'/),attributes(1:2),reshape((/40,20/),(/1,2/)))
......
......@@ -19,7 +19,7 @@ CONTAINS
!! TE_VEFF: charge density-effective potential integral
!! TE_EXC : charge density-ex-corr.energy density integral
SUBROUTINE vgen(hybinp,field,input,xcpot,atoms,sphhar,stars,vacuum,sym,&
SUBROUTINE vgen(hybdat,field,input,xcpot,atoms,sphhar,stars,vacuum,sym,&
cell,oneD,sliceplot,mpi,results,noco,EnergyDen,den,vTot,vx,vCoul)
USE m_types
......@@ -36,7 +36,7 @@ CONTAINS
TYPE(t_results), INTENT(INOUT) :: results
CLASS(t_xcpot), INTENT(INOUT) :: xcpot
TYPE(t_hybinp), INTENT(IN) :: hybinp
TYPE(t_hybdat), INTENT(IN) :: hybdat
TYPE(t_mpi), INTENT(IN) :: mpi
TYPE(t_oneD), INTENT(IN) :: oneD
......@@ -101,7 +101,7 @@ CONTAINS
IF (noco%l_mtnocoPot) CALL rotate_mt_den_to_local(atoms,sphhar,sym,noco,denrot)
ENDIF
CALL vgen_xcpot(hybinp,input,xcpot,atoms,sphhar,stars,vacuum,sym,&
CALL vgen_xcpot(hybdat,input,xcpot,atoms,sphhar,stars,vacuum,sym,&
cell,oneD,sliceplot,mpi,noco,den,denRot,EnergyDen,vTot,vx,results)
!ToDo, check if this is needed for more potentials as well...
......
......@@ -9,7 +9,8 @@ MODULE m_rdmft
CONTAINS
SUBROUTINE rdmft(eig_id,mpi,input,kpts,banddos,sliceplot,cell,atoms,enpara,stars,vacuum,&
sphhar,sym,field,vTot,vCoul,oneD,noco,xcpot,mpdata,hybinp,results,coreSpecInput,archiveType,outDen)
sphhar,sym,field,vTot,vCoul,oneD,noco,xcpot,mpdata,hybinp, hybdat,&
results,coreSpecInput,archiveType,outDen)
USE m_types
USE m_juDFT
......@@ -62,8 +63,9 @@ SUBROUTINE rdmft(eig_id,mpi,input,kpts,banddos,sliceplot,cell,atoms,enpara,stars
TYPE(t_oneD), INTENT(IN) :: oneD
TYPE(t_noco), INTENT(INOUT) :: noco
TYPE(t_xcpot_inbuild), INTENT(INOUT) :: xcpot
TYPE(t_mpdata), intent(inout) :: mpdata
TYPE(t_hybinp), INTENT(IN) :: hybinp
TYPE(t_mpdata), intent(inout) :: mpdata
TYPE(t_hybinp), INTENT(IN) :: hybinp
TYPE(t_hybdat), INTENT(INOUT) :: hybdat
TYPE(t_results), INTENT(INOUT) :: results
TYPE(t_coreSpecInput), INTENT(IN) :: coreSpecInput
TYPE(t_potden), INTENT(INOUT) :: outDen
......@@ -80,7 +82,6 @@ SUBROUTINE rdmft(eig_id,mpi,input,kpts,banddos,sliceplot,cell,atoms,enpara,stars
TYPE(t_moments) :: moments
TYPE(t_mat) :: exMat, zMat, olap, trafo, invtrafo, tmpMat, exMatLAPW
TYPE(t_lapw) :: lapw
TYPE(t_hybdat) :: hybdat
INTEGER :: ikpt, ikpt_i, iBand, jkpt, jBand, iAtom, i, na, itype, lh, j
INTEGER :: jspin, jspmax, jsp, isp, ispin, nbasfcn, nbands
INTEGER :: nsymop, nkpt_EIBZ, ikptf, iterHF, mnobd
......@@ -379,15 +380,15 @@ SUBROUTINE rdmft(eig_id,mpi,input,kpts,banddos,sliceplot,cell,atoms,enpara,stars
l_zref = (sym%zrfs.AND.(SUM(ABS(kpts%bk(3,:kpts%nkpt))).LT.1e-9).AND..NOT.noco%l_noco)
iterHF = 0
hybinp%l_calhf = .TRUE.
hybdat%l_calhf = .TRUE.
! CALL open_hybinp_io1(sym%invs)
CALL mixedbasis(atoms,kpts,input,cell,xcpot,mpdata,hybinp,enpara,mpi,vTot, iterHF)
CALL mixedbasis(atoms,kpts,input,cell,xcpot,mpdata,hybinp, hybdat,enpara,mpi,vTot, iterHF)
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)
......@@ -755,7 +756,7 @@ SUBROUTINE rdmft(eig_id,mpi,input,kpts,banddos,sliceplot,cell,atoms,enpara,stars
WRITE(*,*) 'RDMFT: convergence loop end'
hybinp%l_calhf = .FALSE.
hybdat%l_calhf = .FALSE.
! Calculate final overall density
......
......@@ -3,6 +3,9 @@ MODULE m_types_hybdat
TYPE t_hybdat
LOGICAL :: l_subvxc = .false.
LOGICAL :: l_calhf = .false.
LOGICAL :: l_addhf = .false.
INTEGER :: lmaxcd, maxindxc
INTEGER :: maxfac
REAL, ALLOCATABLE :: gridf(:,:)
......
......@@ -9,7 +9,7 @@ MODULE m_vgen_xcpot
CONTAINS
SUBROUTINE vgen_xcpot(hybinp, input, xcpot, atoms, sphhar, stars, vacuum, sym, &
SUBROUTINE vgen_xcpot(hybdat, input, xcpot, atoms, sphhar, stars, vacuum, sym, &
cell, oneD, sliceplot, mpi, noco, den, denRot, EnergyDen, vTot, vx, results)
! ***********************************************************
...