Commit d5208d7d authored by Daniel Wortmann's avatar Daniel Wortmann

Refactoring of xc-pot started, does not compile properly yet

parent dfb2193a
......@@ -42,7 +42,7 @@ CONTAINS
IMPLICIT NONE
TYPE(t_results),INTENT(INOUT):: results
TYPE(t_xcpot),INTENT(IN) :: xcpot
CLASS(t_xcpot),INTENT(IN) :: xcpot
TYPE(t_mpi),INTENT(IN) :: mpi
TYPE(t_dimension),INTENT(IN) :: DIMENSION
TYPE(t_oneD),INTENT(IN) :: oneD
......
......@@ -80,7 +80,7 @@ CONTAINS
TYPE(t_banddos) :: banddos_temp
TYPE(t_obsolete) :: obsolete_temp
TYPE(t_enpara) :: enpara_temp
TYPE(t_xcpot) :: xcpot_temp
CLASS(t_xcpot),ALLOCATABLE :: xcpot_temp
TYPE(t_results) :: results_temp
TYPE(t_kpts) :: kpts_temp
TYPE(t_hybrid) :: hybrid_temp
......
......@@ -49,7 +49,7 @@ MODULE m_add_vnonlocal
USE m_io_hybrid
IMPLICIT NONE
TYPE(t_results),INTENT(INOUT) :: results
TYPE(t_xcpot),INTENT(IN) :: xcpot
TYPE(t_xcpot_inbuild),INTENT(IN) :: xcpot
TYPE(t_dimension),INTENT(IN) :: dimension
TYPE(t_hybrid),INTENT(INOUT) :: hybrid
TYPE(t_kpts),INTENT(IN) :: kpts
......
......@@ -49,7 +49,7 @@ CONTAINS
IMPLICIT NONE
TYPE(t_xcpot),INTENT(IN) :: xcpot
TYPE(t_xcpot_inbuild),INTENT(IN) :: xcpot
TYPE(t_mpi),INTENT(IN) :: mpi
TYPE(t_hybrid),INTENT(INOUT) :: hybrid
TYPE(t_sym),INTENT(IN) :: sym
......
......@@ -74,7 +74,7 @@
IMPLICIT NONE
TYPE(t_hybdat),INTENT(IN) :: hybdat
TYPE(t_results),INTENT(IN) :: results
TYPE(t_xcpot),INTENT(IN) :: xcpot
TYPE(t_xcpot_inbuild),INTENT(IN) :: xcpot
TYPE(t_mpi),INTENT(IN) :: mpi
TYPE(t_dimension),INTENT(IN) :: dimension
TYPE(t_hybrid),INTENT(INOUT) :: hybrid
......
......@@ -59,7 +59,7 @@ MODULE m_hsfock
IMPLICIT NONE
TYPE(t_hybdat),INTENT(IN) :: hybdat
TYPE(t_results),INTENT(INOUT) :: results
TYPE(t_xcpot),INTENT(IN) :: xcpot
TYPE(t_xcpot_inbuild),INTENT(IN) :: xcpot
TYPE(t_mpi),INTENT(IN) :: mpi
TYPE(t_dimension),INTENT(IN) :: dimension
TYPE(t_hybrid),INTENT(INOUT) :: hybrid
......
......@@ -11,7 +11,7 @@ CONTAINS
USE m_eig66_io
USE m_io_hybrid
IMPLICIT NONE
TYPE(t_xcpot),INTENT(IN) :: xcpot
TYPE(t_xcpot_inbuild),INTENT(IN) :: xcpot
TYPE(t_mpi),INTENT(IN) :: mpi
TYPE(t_dimension),INTENT(IN) :: DIMENSION
TYPE(t_oneD),INTENT(IN) :: oneD
......
......@@ -44,7 +44,7 @@ CONTAINS
USE m_types
IMPLICIT NONE
TYPE(t_xcpot),INTENT(IN) :: xcpot
TYPE(t_xcpot_inbuild),INTENT(IN) :: xcpot
TYPE(t_mpi),INTENT(IN) :: mpi
TYPE(t_dimension),INTENT(IN) :: DIMENSION
TYPE(t_hybrid),INTENT(INOUT) :: hybrid
......
......@@ -14,7 +14,7 @@ CONTAINS
USE m_abcof3
USE m_types
IMPLICIT NONE
TYPE(t_xcpot),INTENT(IN) :: xcpot
TYPE(t_xcpot_inbuild),INTENT(IN) :: xcpot
TYPE(t_mpi),INTENT(IN) :: mpi
TYPE(t_dimension),INTENT(IN) :: DIMENSION
TYPE(t_oneD),INTENT(IN) :: oneD
......
......@@ -36,7 +36,7 @@ SUBROUTINE initParallelProcesses(atoms,vacuum,input,stars,sliceplot,banddos,&
TYPE(t_cell), INTENT(INOUT) :: cell
TYPE(t_banddos), INTENT(INOUT) :: banddos
TYPE(t_sliceplot),INTENT(INOUT) :: sliceplot
TYPE(t_xcpot), INTENT(INOUT) :: xcpot
CLASS(t_xcpot), INTENT(INOUT) :: xcpot
TYPE(t_noco), INTENT(INOUT) :: noco
TYPE(t_dimension),INTENT(INOUT) :: dimension
TYPE(t_enpara), INTENT(INOUT) :: enpara
......
......@@ -16,7 +16,7 @@
USE m_types
IMPLICIT NONE
TYPE(t_xcpot),INTENT(IN) :: xcpot
CLASS(t_xcpot),INTENT(IN) :: xcpot
TYPE(t_cell),INTENT(IN) :: cell
TYPE(t_sym),INTENT(IN) :: sym
TYPE(t_oneD),INTENT(INOUT):: oneD
......
......@@ -49,7 +49,7 @@
TYPE(t_noco) :: noco
TYPE(t_sliceplot) :: sliceplot
TYPE(t_banddos) :: banddos
TYPE(t_xcpot) :: xcpot
TYPE(t_xcpot_inbuild) :: xcpot
!
!
......
......@@ -38,7 +38,7 @@ CONTAINS
TYPE(t_banddos) ,INTENT(OUT) :: banddos
TYPE(t_obsolete) ,INTENT(OUT) :: obsolete
TYPE(t_enpara) ,INTENT(OUT) :: enpara
TYPE(t_xcpot) ,INTENT(OUT) :: xcpot
TYPE(t_xcpot_inbuild) ,INTENT(OUT) :: xcpot
TYPE(t_kpts) ,INTENT(INOUT):: kpts
TYPE(t_hybrid) ,INTENT(OUT) :: hybrid
TYPE(t_oneD) ,INTENT(OUT) :: oneD
......@@ -180,7 +180,7 @@ CONTAINS
!
namex=xcpot%get_name()
l_krla = xcpot%krla.EQ.1
l_krla = xcpot%data%krla.EQ.1
END IF ! mpi%irank.eq.0
#ifdef CPP_MPI
......
......@@ -44,7 +44,7 @@
TYPE(t_vacuum), INTENT(INOUT) :: vacuum
TYPE(t_input), INTENT(INOUT) :: input
TYPE(t_banddos), INTENT(INOUT) :: banddos
TYPE(t_xcpot), INTENT(INOUT) :: xcpot
TYPE(t_xcpot_inbuild), INTENT(INOUT) :: xcpot
TYPE(t_sym), INTENT(INOUT) :: sym
TYPE(t_cell), INTENT(INOUT) :: cell
TYPE(t_sliceplot), INTENT(INOUT) :: sliceplot
......
......@@ -68,7 +68,7 @@
TYPE(t_noco),INTENT(INOUT) :: noco
TYPE(t_vacuum),INTENT(INOUT) :: vacuum
TYPE(t_cell),INTENT(INOUT) :: cell
TYPE(t_xcpot),INTENT(INOUT) :: xcpot
CLASS(t_xcpot),INTENT(INOUT) :: xcpot
TYPE(t_sliceplot),INTENT(INOUT):: sliceplot
TYPE(t_enpara),INTENT(INOUT) :: enpara
LOGICAL, INTENT (IN) :: l_opti
......
......@@ -57,7 +57,7 @@ SUBROUTINE postprocessInput(mpi,input,field,sym,stars,atoms,vacuum,obsolete,kpts
TYPE(t_cell), INTENT(INOUT) :: cell
TYPE(t_banddos), INTENT(INOUT) :: banddos
TYPE(t_sliceplot),INTENT(INOUT) :: sliceplot
TYPE(t_xcpot), INTENT(INOUT) :: xcpot
CLASS(t_xcpot), INTENT(INOUT) :: xcpot
TYPE(t_noco), INTENT(INOUT) :: noco
TYPE(t_dimension),INTENT(INOUT) :: dimension
TYPE(t_enpara) ,INTENT(INOUT) :: enpara
......@@ -73,9 +73,8 @@ SUBROUTINE postprocessInput(mpi,input,field,sym,stars,atoms,vacuum,obsolete,kpts
REAL :: sumWeight, rmtmax, zp, radius, dr
REAL :: kmax1, dtild1, dvac1
REAL :: bk(3)
LOGICAL :: l_vca, l_test,l_gga, l_krla
CHARACTER(len=4) :: namex
LOGICAL :: l_vca, l_test,l_gga
INTEGER, ALLOCATABLE :: lmx1(:), nq1(:), nlhtp1(:)
INTEGER, ALLOCATABLE :: jri1(:), lmax1(:)
REAL, ALLOCATABLE :: rmt1(:), dx1(:)
......@@ -536,22 +535,13 @@ SUBROUTINE postprocessInput(mpi,input,field,sym,stars,atoms,vacuum,obsolete,kpts
END IF
CALL prp_xcfft(stars,input,cell,xcpot)
namex = xcpot%get_name()
l_krla = xcpot%krla.EQ.1
END IF !(mpi%irank.EQ.0)
call xcpot%broadcast(mpi)
#ifdef CPP_MPI
CALL MPI_BCAST(namex,4,MPI_CHARACTER,0,mpi%mpi_comm,ierr)
CALL MPI_BCAST(l_krla,1,MPI_LOGICAL,0,mpi%mpi_comm,ierr)
CALL MPI_BCAST(sliceplot%iplot,1,MPI_LOGICAL,0,mpi%mpi_comm,ierr)
#endif
IF (mpi%irank.NE.0) THEN
CALL xcpot%init(namex,l_krla)
END IF
IF (.NOT.sliceplot%iplot) THEN
CALL stepf(sym,stars,atoms,oneD,input,cell,vacuum,mpi)
IF (mpi%irank.EQ.0) THEN
......
......@@ -32,7 +32,7 @@
TYPE(t_stars),INTENT(INOUT) :: stars
TYPE(t_input),INTENT(IN) :: input
TYPE(t_cell),INTENT(IN) :: cell
TYPE(t_xcpot),INTENT(INOUT) :: xcpot
CLASS(t_xcpot),INTENT(INOUT) :: xcpot
!
!---> local variables
......
......@@ -28,7 +28,7 @@ CONTAINS
TYPE(t_sphhar),INTENT(IN) :: sphhar
TYPE(t_input),INTENT(IN) :: input
TYPE(t_cell),INTENT(IN) :: cell
TYPE(t_xcpot),INTENT(IN) :: xcpot
CLASS(t_xcpot),INTENT(IN) :: xcpot
! ..
! ..
......@@ -564,7 +564,7 @@ CONTAINS
TYPE(t_sphhar),INTENT(IN) :: sphhar
TYPE(t_input),INTENT(IN) :: input
TYPE(t_cell),INTENT(IN) :: cell
TYPE(t_xcpot),INTENT(IN) :: xcpot
CLASS(t_xcpot),INTENT(IN) :: xcpot
! ..
! .. Local Scalars ..
REAL arltv1,arltv2,arltv3,s
......
......@@ -30,6 +30,7 @@
USE m_juDFT_init
USE m_kpoints
USE m_inv3
USE m_types_xcpot_inbuild
IMPLICIT NONE
TYPE(t_input),INTENT(INOUT) :: input
......@@ -74,7 +75,7 @@
TYPE(t_oneD)::oneD
TYPE(t_stars)::stars
TYPE(t_hybrid)::hybrid
TYPE(t_xcpot)::xcpot
TYPE(t_xcpot_inbuild)::xcpot
TYPE(t_kpts)::kpts
TYPE(t_enpara)::enpara
TYPE(t_forcetheo)::forcetheo
......
......@@ -35,6 +35,8 @@ SUBROUTINE r_inpXML(&
USE m_constants
USE m_inpeig
USE m_sort
USE m_types_xcpot_inbuild
! USE m_types_xcpot_libxc
IMPLICIT NONE
TYPE(t_input),INTENT(INOUT) :: input
......@@ -49,7 +51,7 @@ SUBROUTINE r_inpXML(&
TYPE(t_cell),INTENT(INOUT) :: cell
TYPE(t_banddos),INTENT(INOUT) :: banddos
TYPE(t_sliceplot),INTENT(INOUT):: sliceplot
TYPE(t_xcpot),INTENT(INOUT) :: xcpot
CLASS(t_xcpot),INTENT(INOUT),ALLOCATABLE :: xcpot
TYPE(t_noco),INTENT(INOUT) :: noco
TYPE(t_dimension),INTENT(OUT) :: dimension
TYPE(t_enpara) ,INTENT(OUT) :: enpara
......@@ -225,7 +227,6 @@ SUBROUTINE r_inpXML(&
ALLOCATE(atoms%igrd(atoms%ntype))
ALLOCATE(atoms%krla(atoms%ntype))
ALLOCATE(atoms%relcor(atoms%ntype))
ALLOCATE(xcpot%lda_atom(atoms%ntype))
atoms%namex = ''
atoms%icorr = -99
......@@ -293,12 +294,7 @@ SUBROUTINE r_inpXML(&
input%rkmax = evaluateFirstOnly(xmlGetAttributeValue('/fleurInput/calculationSetup/cutoffs/@Kmax'))
stars%gmax = evaluateFirstOnly(xmlGetAttributeValue('/fleurInput/calculationSetup/cutoffs/@Gmax'))
xPathA = '/fleurInput/calculationSetup/cutoffs/@GmaxXC'
numberNodes = xmlGetNumberOfNodes(xPathA)
xcpot%gmaxxc = stars%gmax
IF(numberNodes.EQ.1) THEN
xcpot%gmaxxc = evaluateFirstOnly(xmlGetAttributeValue(xPathA))
END IF
stars%gmaxInit = stars%gmax
xPathA = '/fleurInput/calculationSetup/cutoffs/@numbands'
......@@ -1109,16 +1105,24 @@ SUBROUTINE r_inpXML(&
! Read in xc functional parameters
namex = TRIM(ADJUSTL(xmlGetAttributeValue(TRIM(ADJUSTL('/fleurInput/xcFunctional/@name')))))
valueString = TRIM(ADJUSTL(xmlGetAttributeValue(TRIM(ADJUSTL('/fleurInput/xcFunctional/@name')))))
l_relcor = evaluateFirstBoolOnly(xmlGetAttributeValue('/fleurInput/xcFunctional/@relativisticCorrections'))
relcor = 'non-relativi'
IF (l_relcor) THEN
relcor = 'relativistic'
END IF
CALL getXCParameters(namex,l_relcor,xcpot,hybrid%l_hybrid)
!now initialize the xcpot variable
CALL setXCParameters(atoms,valueString,l_relcor,xcpot)
xPathA = '/fleurInput/calculationSetup/cutoffs/@GmaxXC'
numberNodes = xmlGetNumberOfNodes(xPathA)
xcpot%gmaxxc = stars%gmax
IF(numberNodes.EQ.1) THEN
xcpot%gmaxxc = evaluateFirstOnly(xmlGetAttributeValue(xPathA))
END IF
hybrid%l_hybrid=xcpot%is_hybrid()
IF (hybrid%l_hybrid) ALLOCATE(hybrid%lcutm1(atoms%ntype),hybrid%lcutwf(atoms%ntype),hybrid%select1(4,atoms%ntype))
obsolete%lwb=.FALSE.
......@@ -1514,7 +1518,10 @@ SUBROUTINE r_inpXML(&
hybrid%select1(:,iType)=SELECT
ENDIF
! Explicit xc functional
xcpot%lda_atom(iType)=ldaSpecies
SELECT TYPE(xcpot)
TYPE IS(t_xcpot_inbuild)
xcpot%lda_atom(iType)=ldaSpecies
END SELECT
noco%socscale(iType)=socscaleSpecies
END IF
END DO
......@@ -2000,24 +2007,34 @@ SUBROUTINE r_inpXML(&
END SUBROUTINE r_inpXML
SUBROUTINE getXCParameters(namex,relcor,xcpot,l_hybrid)
SUBROUTINE setXCParameters(atoms,namex,relcor,xcpot)
USE m_juDFT
USE m_types
USE m_types_xcpot_inbuild
! USE m_types_xcpot_libxc
IMPLICIT NONE
CHARACTER(LEN=4), INTENT(IN) :: namex
TYPE(t_atoms),INTENT(IN) :: atoms
CHARACTER(LEN=*), INTENT(IN) :: namex
LOGICAL, INTENT(IN) :: relcor
TYPE(t_xcpot),INTENT(INOUT) :: xcpot
LOGICAL, INTENT(OUT) :: l_hybrid
CALL xcpot%init(namex,relcor)
l_hybrid=xcpot%is_hybrid()
CLASS(t_xcpot),INTENT(OUT),ALLOCATABLE :: xcpot
IF (namex(1:6)=='libxc:') THEN
! ALLOCATE(t_xcpot_libxc::xcpot)
ELSE
ALLOCATE(t_xcpot_inbuild::xcpot)
ENDIF
SELECT TYPE(xcpot)
TYPE IS(t_xcpot_inbuild)
CALL xcpot%init(namex(1:4),relcor)
ALLOCATE(xcpot%lda_atom(atoms%ntype))
! TYPE IS(t_xcpot_libxc)
! CALL xcpot%init(namex)
END SELECT
END SUBROUTINE getXCParameters
END SUBROUTINE setXCParameters
SUBROUTINE getIntegerSequenceFromString(string, sequence, count)
......
......@@ -37,7 +37,7 @@
TYPE(t_cell),INTENT(INOUT) :: cell
TYPE(t_banddos),INTENT(INOUT) :: banddos
TYPE(t_sliceplot),INTENT(INOUT):: sliceplot
TYPE(t_xcpot),INTENT(INOUT) :: xcpot
TYPE(t_xcpot_inbuild),INTENT(INOUT) :: xcpot
TYPE(t_noco),INTENT(INOUT) :: noco
REAL,INTENT(INOUT) :: a1(3),a2(3),a3(3)
......
......@@ -45,7 +45,7 @@ SUBROUTINE w_inpXML(&
TYPE(t_cell),INTENT(IN) :: cell
TYPE(t_banddos),INTENT(IN) :: banddos
TYPE(t_sliceplot),INTENT(IN):: sliceplot
TYPE(t_xcpot),INTENT(IN) :: xcpot
CLASS(t_xcpot),INTENT(IN) :: xcpot
TYPE(t_noco),INTENT(IN) :: noco
TYPE(t_enpara),INTENT(IN) :: enpara
CLASS(t_forcetheo),INTENT(IN):: forcetheo !nothing is done here so far....
......
......@@ -24,7 +24,7 @@ SUBROUTINE writeOutParameters(mpi,input,sym,stars,atoms,vacuum,obsolete,kpts,&
TYPE(t_cell), INTENT(IN) :: cell
TYPE(t_banddos), INTENT(IN) :: banddos
TYPE(t_sliceplot), INTENT(IN) :: sliceplot
TYPE(t_xcpot), INTENT(IN) :: xcpot
CLASS(t_xcpot), INTENT(IN) :: xcpot
TYPE(t_noco), INTENT(IN) :: noco
TYPE(t_dimension), INTENT(IN) :: dimension
TYPE(t_enpara), INTENT(IN) :: enpara
......
......@@ -88,7 +88,6 @@ CONTAINS
TYPE(t_banddos) :: banddos
TYPE(t_obsolete) :: obsolete
TYPE(t_enpara) :: enpara
TYPE(t_xcpot) :: xcpot
TYPE(t_results) :: results
TYPE(t_kpts) :: kpts
TYPE(t_hybrid) :: hybrid
......@@ -98,6 +97,7 @@ CONTAINS
TYPE(t_wann) :: wann
TYPE(t_potden) :: vTot,vx,vCoul,vTemp
TYPE(t_potden) :: inDen, outDen
CLASS(t_xcpot),ALLOCATABLE :: xcpot
CLASS(t_forcetheo),ALLOCATABLE:: forcetheo
! .. Local Scalars ..
......@@ -207,8 +207,13 @@ CONTAINS
!HF
IF (hybrid%l_hybrid) CALL calc_hybrid(hybrid,kpts,atoms,input,DIMENSION,mpi,noco,&
cell,vacuum,oneD,banddos,results,sym,xcpot,vTot,it)
IF (hybrid%l_hybrid) THEN
SELECT TYPE(xcpot)
TYPE IS(t_xcpot_inbuild)
CALL calc_hybrid(hybrid,kpts,atoms,input,DIMENSION,mpi,noco,&
cell,vacuum,oneD,banddos,results,sym,xcpot,vTot,it)
END SELECT
ENDIF
!#endif
!!$ DO pc = 1, wann%nparampts
......
......@@ -32,6 +32,7 @@
USE m_prpqfftmap
USE m_writeOutHeader
USE m_fleur_init_old
USE m_types_xcpot_inbuild
#ifdef CPP_MPI
USE m_mpi_bc_all, ONLY : mpi_bc_all
USE m_mpi_dist_forcetheorem
......@@ -56,7 +57,7 @@
TYPE(t_banddos) ,INTENT(OUT):: banddos
TYPE(t_obsolete) ,INTENT(OUT):: obsolete
TYPE(t_enpara) ,INTENT(OUT):: enpara
TYPE(t_xcpot) ,INTENT(OUT):: xcpot
CLASS(t_xcpot),ALLOCATABLE,INTENT(OUT):: xcpot
TYPE(t_results) ,INTENT(OUT):: results
TYPE(t_kpts) ,INTENT(OUT):: kpts
TYPE(t_hybrid) ,INTENT(OUT):: hybrid
......@@ -206,10 +207,14 @@
#endif
ELSE ! else branch of "IF (input%l_inpXML) THEN"
CALL fleur_init_old(mpi,&
input,DIMENSION,atoms,sphhar,cell,stars,sym,noco,vacuum,forcetheo,&
sliceplot,banddos,obsolete,enpara,xcpot,kpts,hybrid,&
oneD,coreSpecInput,l_opti)
ALLOCATE(t_xcpot_inbuild::xcpot)
SELECT TYPE(xcpot)
TYPE IS(t_xcpot_inbuild)
CALL fleur_init_old(mpi,&
input,DIMENSION,atoms,sphhar,cell,stars,sym,noco,vacuum,forcetheo,&
sliceplot,banddos,obsolete,enpara,xcpot,kpts,hybrid,&
oneD,coreSpecInput,l_opti)
END SELECT
END IF ! end of else branch of "IF (input%l_inpXML) THEN"
!
......
......@@ -80,7 +80,7 @@ CONTAINS
TYPE(t_noco),INTENT(IN) :: noco
TYPE(t_vacuum),INTENT(IN) :: vacuum
TYPE(t_cell),INTENT(IN) :: cell
TYPE(t_xcpot),INTENT(IN) :: xcpot
CLASS(t_xcpot),INTENT(IN) :: xcpot
TYPE(t_sliceplot),INTENT(IN):: sliceplot
! ..
! .. Local Scalars ..
......
......@@ -51,7 +51,7 @@ CONTAINS
IMPLICIT NONE
TYPE(t_results),INTENT(INOUT) :: results
TYPE(t_xcpot),INTENT(IN) :: xcpot
CLASS(t_xcpot),INTENT(IN) :: xcpot
TYPE(t_oneD),INTENT(IN) :: oneD
TYPE(t_hybrid),INTENT(IN) :: hybrid
TYPE(t_input),INTENT(IN) :: input
......@@ -119,11 +119,11 @@ CONTAINS
! ---> Fock exchange contribution
!
IF (xcpot%is_hybrid()) THEN
IF (xcpot%is_name("exx")) THEN
results%tote = results%tote + 0.5e0*results%te_hfex%valence
ELSE
!IF (xcpot%is_name("exx")) THEN
! results%tote = results%tote + 0.5e0*results%te_hfex%valence
!ELSE
results%tote = results%tote - 0.5e0*results%te_hfex%valence + 0.5e0*results%te_hfex%core
END IF
!END IF
ENDIF
WRITE (6,FMT=8100) 0.5e0*results%te_hfex%valence
WRITE (16,FMT=8100) 0.5e0*results%te_hfex%valence
......
......@@ -29,7 +29,7 @@ CONTAINS
#endif
IMPLICIT NONE
TYPE(t_results),INTENT(INOUT) :: results
TYPE(t_xcpot),INTENT(IN) :: xcpot
CLASS(t_xcpot),INTENT(IN) :: xcpot
TYPE(t_hybrid),INTENT(IN) :: hybrid
TYPE(t_mpi),INTENT(IN) :: mpi
TYPE(t_dimension),INTENT(IN) :: dimension
......
......@@ -15,7 +15,6 @@
USE m_intgr, ONLY : intgr1,intgr0
USE m_constants
USE m_xcall, ONLY : vxcall
USE m_potl0
USE m_stpot1
USE m_setcor
......@@ -26,7 +25,7 @@
! .. Scalar Arguments ..
TYPE(t_dimension),INTENT(IN) :: dimension
TYPE(t_atoms),INTENT(IN) :: atoms
TYPE(t_xcpot),INTENT(IN) :: xcpot
CLASS(t_xcpot),INTENT(IN) :: xcpot
TYPE(t_input),INTENT(IN) :: input
INTEGER,INTENT (IN) :: jrc ,ntyp
REAL, INTENT (IN) :: rnot1 ,qdel
......@@ -224,10 +223,7 @@
xcpot,DIMENSION%msh,DIMENSION%jspd,input%jspins,n,&
atoms%dx(ntyp),rad,rhoss, vxc)
ELSE
CALL vxcall(6,xcpot,input%jspins,&
SIZE(vx,1),jrc,rhoss,&
vx,vxc)
CALL xcpot%get_vxc(input%jspins,rhoss,vxc,vx)
ENDIF
DO ispin = 1, input%jspins
DO i = 1,n
......
......@@ -16,7 +16,6 @@ SUBROUTINE stden(mpi,sphhar,stars,atoms,sym,DIMENSION,vacuum,&
input,cell,xcpot,obsolete,noco,oneD)
USE m_constants
USE m_xcall, ONLY : vxcall
USE m_qsf
USE m_checkdopall
USE m_cdnovlp
......@@ -24,6 +23,7 @@ SUBROUTINE stden(mpi,sphhar,stars,atoms,sym,DIMENSION,vacuum,&
USE m_qfix
USE m_atom2
USE m_types
USE m_types_xcpot_inbuild
USE m_juDFT_init
IMPLICIT NONE
......@@ -40,16 +40,16 @@ SUBROUTINE stden(mpi,sphhar,stars,atoms,sym,DIMENSION,vacuum,&
TYPE(t_input),INTENT(IN) :: input
TYPE(t_vacuum),INTENT(IN) :: vacuum
TYPE(t_cell),INTENT(IN) :: cell
TYPE(t_xcpot),INTENT(IN) :: xcpot
CLASS(t_xcpot),INTENT(IN) :: xcpot
! Local type instances
TYPE(t_potden) :: den
TYPE(t_enpara) :: enpara
TYPE(t_xcpot) :: xcpot_dummy
TYPE(t_xcpot_inbuild) :: xcpot_dummy
! Local Scalars
REAL d,del,fix,h,r,rnot,z,bm,qdel
REAL denz1(1),vacxpot(1),vacpot(1)
REAL denz1(1,1),vacxpot(1,1),vacpot(1,1)
INTEGER i,ivac,iza,j,jr,k,n,n1,ispin
INTEGER nw,ilo,natot,nat
......@@ -308,17 +308,17 @@ SUBROUTINE stden(mpi,sphhar,stars,atoms,sym,DIMENSION,vacuum,&
sigm(i) = (i-1)*vacuum%delz*den%vacz(i,ivac,ispin)
END DO
CALL qsf(vacuum%delz,sigm,vacpar(ivac),vacuum%nmz,0)
denz1(1) = den%vacz(1,ivac,ispin) ! get estimate for potential at vacuum boundary
CALL vxcall(6,xcpot_dummy,1,1,1,denz1,vacxpot,vacpot)
denz1 = den%vacz(1,ivac,ispin) ! get estimate for potential at vacuum boundary
CALL xcpot%get_vxc(1,denz1,vacpot,vacxpot)
! seems to be the best choice for 1D not to substract vacpar
IF (.NOT.oneD%odi%d1) THEN
vacpot(1) = vacpot(1) - fpi_const*vacpar(ivac)
vacpot = vacpot - fpi_const*vacpar(ivac)
END IF
IF (obsolete%lepr.EQ.1) THEN
vacpar(ivac) = -0.2 - vacpot(1)
vacpar(ivac) = -0.2 - vacpot(1,1)
WRITE (6,'(" vacuum",i2," reference energy =",f12.6)') ivac,vacpot
ELSE
vacpar(ivac) = vacpot(1)
vacpar(ivac) = vacpot(1,1)
END IF
END DO
IF (vacuum%nvac.EQ.1) vacpar(2) = vacpar(1)
......
......@@ -4,6 +4,9 @@ set(fleur_F90 ${fleur_F90}
types/types.F90
types/types_mat.F90
types/types_xcpot.F90
types/types_xcpot_inbuild.F90
types/types_xcpot_data.F90
#types/types_xcpot_libxc.F90
types/types_mpi.F90
types/types_lapw.F90
types/types_tlmplm.F90
......@@ -24,6 +27,8 @@ types/types.F90
types/types_mat.F90
types/types_field.F90
types/types_xcpot.F90
types/types_xcpot_data.F90
types/types_xcpot_inbuild.F90
types/types_mpi.F90
types/types_lapw.F90
types/types_tlmplm.F90
......
......@@ -21,4 +21,5 @@ MODULE m_types
USE m_types_forcetheo
USE m_types_cdnval
USE m_types_field
USE m_types_xcpot_inbuild
END MODULE m_types
!--------------------------------------------------------------------------------
! Copyright (c) 2016 Peter Grünberg Institut, Forschungszentrum Jülich, Germany
! This file is part of FLEUR and available as free software under the conditions
! of the MIT license as expressed in the LICENSE file in more detail.
!--------------------------------------------------------------------------------
MODULE m_types_xcpot
IMPLICIT NONE
PRIVATE
CHARACTER(len=4),PARAMETER:: xc_names(20)=[&
'l91 ','x-a ','wign','mjw ','hl ','bh ','vwn ','pz ', &
'pw91','pbe ','rpbe','Rpbe','wc ','PBEs', &
'pbe0','hse ','vhse','lhse','exx ','hf ']
LOGICAL,PARAMETER:: priv_gga(20)=[&
.TRUE.,.FALSE.,.FALSE.,.FALSE.,.FALSE.,.FALSE.,.FALSE.,.FALSE.,&
.TRUE.,.TRUE.,.TRUE.,.TRUE.,.TRUE.,.TRUE.,&
.TRUE.,.TRUE.,.TRUE.,.TRUE.,.FALSE.,.FALSE.]
LOGICAL,PARAMETER:: priv_hybrid(20)=[&
.FALSE.,.FALSE.,.FALSE.,.FALSE.,.FALSE.,.FALSE.,.FALSE.,.FALSE.,&
.FALSE.,.FALSE.,.FALSE.,.FALSE.,.FALSE.,.FALSE.,&
.TRUE.,.TRUE.,.TRUE.,.TRUE.,.TRUE.,.TRUE.]
REAL, PARAMETER :: amix_pbe0 = 0.25
REAL, PARAMETER :: amix_hse = 0.25
REAL, PARAMETER :: amix_hf = 1.00
PUBLIC :: t_xcpot,t_gradients
TYPE t_xcpot
#ifdef CPP_MPI
INTEGER :: icorr=0 !not private to allow bcasting it around
#else
INTEGER,PRIVATE :: icorr=0
#endif
!in the pbe case (exchpbe.F) lots of test are made
!in addition some constants are set
!to speed up this code precalculate things in init
LOGICAL :: is_rpbe !Rpbe
LOGICAL :: is_wc
LOGICAL :: is_hse !hse,lhse,vhse
REAL :: uk,um
LOGICAL,ALLOCATABLE :: lda_atom(:)
REAL :: gmaxxc
INTEGER :: krla !relativistic corrections
TYPE,ABSTRACT :: t_xcpot
REAL :: gmaxxc
CONTAINS
PROCEDURE :: is_gga=>xcpot_is_gga
PROCEDURE :: get_name=>xcpot_get_name