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 ...@@ -42,7 +42,7 @@ CONTAINS
IMPLICIT NONE IMPLICIT NONE
TYPE(t_results),INTENT(INOUT):: results 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_mpi),INTENT(IN) :: mpi
TYPE(t_dimension),INTENT(IN) :: DIMENSION TYPE(t_dimension),INTENT(IN) :: DIMENSION
TYPE(t_oneD),INTENT(IN) :: oneD TYPE(t_oneD),INTENT(IN) :: oneD
......
...@@ -80,7 +80,7 @@ CONTAINS ...@@ -80,7 +80,7 @@ CONTAINS
TYPE(t_banddos) :: banddos_temp TYPE(t_banddos) :: banddos_temp
TYPE(t_obsolete) :: obsolete_temp TYPE(t_obsolete) :: obsolete_temp
TYPE(t_enpara) :: enpara_temp TYPE(t_enpara) :: enpara_temp
TYPE(t_xcpot) :: xcpot_temp CLASS(t_xcpot),ALLOCATABLE :: xcpot_temp
TYPE(t_results) :: results_temp TYPE(t_results) :: results_temp
TYPE(t_kpts) :: kpts_temp TYPE(t_kpts) :: kpts_temp
TYPE(t_hybrid) :: hybrid_temp TYPE(t_hybrid) :: hybrid_temp
......
...@@ -49,7 +49,7 @@ MODULE m_add_vnonlocal ...@@ -49,7 +49,7 @@ MODULE m_add_vnonlocal
USE m_io_hybrid USE m_io_hybrid
IMPLICIT NONE IMPLICIT NONE
TYPE(t_results),INTENT(INOUT) :: results 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_dimension),INTENT(IN) :: dimension
TYPE(t_hybrid),INTENT(INOUT) :: hybrid TYPE(t_hybrid),INTENT(INOUT) :: hybrid
TYPE(t_kpts),INTENT(IN) :: kpts TYPE(t_kpts),INTENT(IN) :: kpts
......
...@@ -49,7 +49,7 @@ CONTAINS ...@@ -49,7 +49,7 @@ CONTAINS
IMPLICIT NONE IMPLICIT NONE
TYPE(t_xcpot),INTENT(IN) :: xcpot TYPE(t_xcpot_inbuild),INTENT(IN) :: xcpot
TYPE(t_mpi),INTENT(IN) :: mpi TYPE(t_mpi),INTENT(IN) :: mpi
TYPE(t_hybrid),INTENT(INOUT) :: hybrid TYPE(t_hybrid),INTENT(INOUT) :: hybrid
TYPE(t_sym),INTENT(IN) :: sym TYPE(t_sym),INTENT(IN) :: sym
......
...@@ -74,7 +74,7 @@ ...@@ -74,7 +74,7 @@
IMPLICIT NONE IMPLICIT NONE
TYPE(t_hybdat),INTENT(IN) :: hybdat TYPE(t_hybdat),INTENT(IN) :: hybdat
TYPE(t_results),INTENT(IN) :: results 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_mpi),INTENT(IN) :: mpi
TYPE(t_dimension),INTENT(IN) :: dimension TYPE(t_dimension),INTENT(IN) :: dimension
TYPE(t_hybrid),INTENT(INOUT) :: hybrid TYPE(t_hybrid),INTENT(INOUT) :: hybrid
......
...@@ -59,7 +59,7 @@ MODULE m_hsfock ...@@ -59,7 +59,7 @@ MODULE m_hsfock
IMPLICIT NONE IMPLICIT NONE
TYPE(t_hybdat),INTENT(IN) :: hybdat TYPE(t_hybdat),INTENT(IN) :: hybdat
TYPE(t_results),INTENT(INOUT) :: results 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_mpi),INTENT(IN) :: mpi
TYPE(t_dimension),INTENT(IN) :: dimension TYPE(t_dimension),INTENT(IN) :: dimension
TYPE(t_hybrid),INTENT(INOUT) :: hybrid TYPE(t_hybrid),INTENT(INOUT) :: hybrid
......
...@@ -11,7 +11,7 @@ CONTAINS ...@@ -11,7 +11,7 @@ CONTAINS
USE m_eig66_io USE m_eig66_io
USE m_io_hybrid USE m_io_hybrid
IMPLICIT NONE IMPLICIT NONE
TYPE(t_xcpot),INTENT(IN) :: xcpot TYPE(t_xcpot_inbuild),INTENT(IN) :: xcpot
TYPE(t_mpi),INTENT(IN) :: mpi TYPE(t_mpi),INTENT(IN) :: mpi
TYPE(t_dimension),INTENT(IN) :: DIMENSION TYPE(t_dimension),INTENT(IN) :: DIMENSION
TYPE(t_oneD),INTENT(IN) :: oneD TYPE(t_oneD),INTENT(IN) :: oneD
......
...@@ -44,7 +44,7 @@ CONTAINS ...@@ -44,7 +44,7 @@ CONTAINS
USE m_types USE m_types
IMPLICIT NONE IMPLICIT NONE
TYPE(t_xcpot),INTENT(IN) :: xcpot TYPE(t_xcpot_inbuild),INTENT(IN) :: xcpot
TYPE(t_mpi),INTENT(IN) :: mpi TYPE(t_mpi),INTENT(IN) :: mpi
TYPE(t_dimension),INTENT(IN) :: DIMENSION TYPE(t_dimension),INTENT(IN) :: DIMENSION
TYPE(t_hybrid),INTENT(INOUT) :: hybrid TYPE(t_hybrid),INTENT(INOUT) :: hybrid
......
...@@ -14,7 +14,7 @@ CONTAINS ...@@ -14,7 +14,7 @@ CONTAINS
USE m_abcof3 USE m_abcof3
USE m_types USE m_types
IMPLICIT NONE IMPLICIT NONE
TYPE(t_xcpot),INTENT(IN) :: xcpot TYPE(t_xcpot_inbuild),INTENT(IN) :: xcpot
TYPE(t_mpi),INTENT(IN) :: mpi TYPE(t_mpi),INTENT(IN) :: mpi
TYPE(t_dimension),INTENT(IN) :: DIMENSION TYPE(t_dimension),INTENT(IN) :: DIMENSION
TYPE(t_oneD),INTENT(IN) :: oneD TYPE(t_oneD),INTENT(IN) :: oneD
......
...@@ -36,7 +36,7 @@ SUBROUTINE initParallelProcesses(atoms,vacuum,input,stars,sliceplot,banddos,& ...@@ -36,7 +36,7 @@ SUBROUTINE initParallelProcesses(atoms,vacuum,input,stars,sliceplot,banddos,&
TYPE(t_cell), INTENT(INOUT) :: cell TYPE(t_cell), INTENT(INOUT) :: cell
TYPE(t_banddos), INTENT(INOUT) :: banddos TYPE(t_banddos), INTENT(INOUT) :: banddos
TYPE(t_sliceplot),INTENT(INOUT) :: sliceplot 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_noco), INTENT(INOUT) :: noco
TYPE(t_dimension),INTENT(INOUT) :: dimension TYPE(t_dimension),INTENT(INOUT) :: dimension
TYPE(t_enpara), INTENT(INOUT) :: enpara TYPE(t_enpara), INTENT(INOUT) :: enpara
......
...@@ -16,7 +16,7 @@ ...@@ -16,7 +16,7 @@
USE m_types USE m_types
IMPLICIT NONE IMPLICIT NONE
TYPE(t_xcpot),INTENT(IN) :: xcpot CLASS(t_xcpot),INTENT(IN) :: xcpot
TYPE(t_cell),INTENT(IN) :: cell TYPE(t_cell),INTENT(IN) :: cell
TYPE(t_sym),INTENT(IN) :: sym TYPE(t_sym),INTENT(IN) :: sym
TYPE(t_oneD),INTENT(INOUT):: oneD TYPE(t_oneD),INTENT(INOUT):: oneD
......
...@@ -49,7 +49,7 @@ ...@@ -49,7 +49,7 @@
TYPE(t_noco) :: noco TYPE(t_noco) :: noco
TYPE(t_sliceplot) :: sliceplot TYPE(t_sliceplot) :: sliceplot
TYPE(t_banddos) :: banddos TYPE(t_banddos) :: banddos
TYPE(t_xcpot) :: xcpot TYPE(t_xcpot_inbuild) :: xcpot
! !
! !
......
...@@ -38,7 +38,7 @@ CONTAINS ...@@ -38,7 +38,7 @@ CONTAINS
TYPE(t_banddos) ,INTENT(OUT) :: banddos TYPE(t_banddos) ,INTENT(OUT) :: banddos
TYPE(t_obsolete) ,INTENT(OUT) :: obsolete TYPE(t_obsolete) ,INTENT(OUT) :: obsolete
TYPE(t_enpara) ,INTENT(OUT) :: enpara 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_kpts) ,INTENT(INOUT):: kpts
TYPE(t_hybrid) ,INTENT(OUT) :: hybrid TYPE(t_hybrid) ,INTENT(OUT) :: hybrid
TYPE(t_oneD) ,INTENT(OUT) :: oneD TYPE(t_oneD) ,INTENT(OUT) :: oneD
...@@ -180,7 +180,7 @@ CONTAINS ...@@ -180,7 +180,7 @@ CONTAINS
! !
namex=xcpot%get_name() namex=xcpot%get_name()
l_krla = xcpot%krla.EQ.1 l_krla = xcpot%data%krla.EQ.1
END IF ! mpi%irank.eq.0 END IF ! mpi%irank.eq.0
#ifdef CPP_MPI #ifdef CPP_MPI
......
...@@ -44,7 +44,7 @@ ...@@ -44,7 +44,7 @@
TYPE(t_vacuum), INTENT(INOUT) :: vacuum TYPE(t_vacuum), INTENT(INOUT) :: vacuum
TYPE(t_input), INTENT(INOUT) :: input TYPE(t_input), INTENT(INOUT) :: input
TYPE(t_banddos), INTENT(INOUT) :: banddos 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_sym), INTENT(INOUT) :: sym
TYPE(t_cell), INTENT(INOUT) :: cell TYPE(t_cell), INTENT(INOUT) :: cell
TYPE(t_sliceplot), INTENT(INOUT) :: sliceplot TYPE(t_sliceplot), INTENT(INOUT) :: sliceplot
......
...@@ -68,7 +68,7 @@ ...@@ -68,7 +68,7 @@
TYPE(t_noco),INTENT(INOUT) :: noco TYPE(t_noco),INTENT(INOUT) :: noco
TYPE(t_vacuum),INTENT(INOUT) :: vacuum TYPE(t_vacuum),INTENT(INOUT) :: vacuum
TYPE(t_cell),INTENT(INOUT) :: cell 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_sliceplot),INTENT(INOUT):: sliceplot
TYPE(t_enpara),INTENT(INOUT) :: enpara TYPE(t_enpara),INTENT(INOUT) :: enpara
LOGICAL, INTENT (IN) :: l_opti LOGICAL, INTENT (IN) :: l_opti
......
...@@ -57,7 +57,7 @@ SUBROUTINE postprocessInput(mpi,input,field,sym,stars,atoms,vacuum,obsolete,kpts ...@@ -57,7 +57,7 @@ SUBROUTINE postprocessInput(mpi,input,field,sym,stars,atoms,vacuum,obsolete,kpts
TYPE(t_cell), INTENT(INOUT) :: cell TYPE(t_cell), INTENT(INOUT) :: cell
TYPE(t_banddos), INTENT(INOUT) :: banddos TYPE(t_banddos), INTENT(INOUT) :: banddos
TYPE(t_sliceplot),INTENT(INOUT) :: sliceplot 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_noco), INTENT(INOUT) :: noco
TYPE(t_dimension),INTENT(INOUT) :: dimension TYPE(t_dimension),INTENT(INOUT) :: dimension
TYPE(t_enpara) ,INTENT(INOUT) :: enpara TYPE(t_enpara) ,INTENT(INOUT) :: enpara
...@@ -73,9 +73,8 @@ SUBROUTINE postprocessInput(mpi,input,field,sym,stars,atoms,vacuum,obsolete,kpts ...@@ -73,9 +73,8 @@ SUBROUTINE postprocessInput(mpi,input,field,sym,stars,atoms,vacuum,obsolete,kpts
REAL :: sumWeight, rmtmax, zp, radius, dr REAL :: sumWeight, rmtmax, zp, radius, dr
REAL :: kmax1, dtild1, dvac1 REAL :: kmax1, dtild1, dvac1
REAL :: bk(3) REAL :: bk(3)
LOGICAL :: l_vca, l_test,l_gga, l_krla LOGICAL :: l_vca, l_test,l_gga
CHARACTER(len=4) :: namex
INTEGER, ALLOCATABLE :: lmx1(:), nq1(:), nlhtp1(:) INTEGER, ALLOCATABLE :: lmx1(:), nq1(:), nlhtp1(:)
INTEGER, ALLOCATABLE :: jri1(:), lmax1(:) INTEGER, ALLOCATABLE :: jri1(:), lmax1(:)
REAL, ALLOCATABLE :: rmt1(:), dx1(:) REAL, ALLOCATABLE :: rmt1(:), dx1(:)
...@@ -536,22 +535,13 @@ SUBROUTINE postprocessInput(mpi,input,field,sym,stars,atoms,vacuum,obsolete,kpts ...@@ -536,22 +535,13 @@ SUBROUTINE postprocessInput(mpi,input,field,sym,stars,atoms,vacuum,obsolete,kpts
END IF END IF
CALL prp_xcfft(stars,input,cell,xcpot) CALL prp_xcfft(stars,input,cell,xcpot)
namex = xcpot%get_name()
l_krla = xcpot%krla.EQ.1
END IF !(mpi%irank.EQ.0) END IF !(mpi%irank.EQ.0)
call xcpot%broadcast(mpi)
#ifdef CPP_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) CALL MPI_BCAST(sliceplot%iplot,1,MPI_LOGICAL,0,mpi%mpi_comm,ierr)
#endif #endif
IF (mpi%irank.NE.0) THEN
CALL xcpot%init(namex,l_krla)
END IF
IF (.NOT.sliceplot%iplot) THEN IF (.NOT.sliceplot%iplot) THEN
CALL stepf(sym,stars,atoms,oneD,input,cell,vacuum,mpi) CALL stepf(sym,stars,atoms,oneD,input,cell,vacuum,mpi)
IF (mpi%irank.EQ.0) THEN IF (mpi%irank.EQ.0) THEN
......
...@@ -32,7 +32,7 @@ ...@@ -32,7 +32,7 @@
TYPE(t_stars),INTENT(INOUT) :: stars TYPE(t_stars),INTENT(INOUT) :: stars
TYPE(t_input),INTENT(IN) :: input TYPE(t_input),INTENT(IN) :: input
TYPE(t_cell),INTENT(IN) :: cell TYPE(t_cell),INTENT(IN) :: cell
TYPE(t_xcpot),INTENT(INOUT) :: xcpot CLASS(t_xcpot),INTENT(INOUT) :: xcpot
! !
!---> local variables !---> local variables
......
...@@ -28,7 +28,7 @@ CONTAINS ...@@ -28,7 +28,7 @@ CONTAINS
TYPE(t_sphhar),INTENT(IN) :: sphhar TYPE(t_sphhar),INTENT(IN) :: sphhar
TYPE(t_input),INTENT(IN) :: input TYPE(t_input),INTENT(IN) :: input
TYPE(t_cell),INTENT(IN) :: cell TYPE(t_cell),INTENT(IN) :: cell
TYPE(t_xcpot),INTENT(IN) :: xcpot CLASS(t_xcpot),INTENT(IN) :: xcpot
! .. ! ..
! .. ! ..
...@@ -564,7 +564,7 @@ CONTAINS ...@@ -564,7 +564,7 @@ CONTAINS
TYPE(t_sphhar),INTENT(IN) :: sphhar TYPE(t_sphhar),INTENT(IN) :: sphhar
TYPE(t_input),INTENT(IN) :: input TYPE(t_input),INTENT(IN) :: input
TYPE(t_cell),INTENT(IN) :: cell TYPE(t_cell),INTENT(IN) :: cell
TYPE(t_xcpot),INTENT(IN) :: xcpot CLASS(t_xcpot),INTENT(IN) :: xcpot
! .. ! ..
! .. Local Scalars .. ! .. Local Scalars ..
REAL arltv1,arltv2,arltv3,s REAL arltv1,arltv2,arltv3,s
......
...@@ -30,6 +30,7 @@ ...@@ -30,6 +30,7 @@
USE m_juDFT_init USE m_juDFT_init
USE m_kpoints USE m_kpoints
USE m_inv3 USE m_inv3
USE m_types_xcpot_inbuild
IMPLICIT NONE IMPLICIT NONE
TYPE(t_input),INTENT(INOUT) :: input TYPE(t_input),INTENT(INOUT) :: input
...@@ -74,7 +75,7 @@ ...@@ -74,7 +75,7 @@
TYPE(t_oneD)::oneD TYPE(t_oneD)::oneD
TYPE(t_stars)::stars TYPE(t_stars)::stars
TYPE(t_hybrid)::hybrid TYPE(t_hybrid)::hybrid
TYPE(t_xcpot)::xcpot TYPE(t_xcpot_inbuild)::xcpot
TYPE(t_kpts)::kpts TYPE(t_kpts)::kpts
TYPE(t_enpara)::enpara TYPE(t_enpara)::enpara
TYPE(t_forcetheo)::forcetheo TYPE(t_forcetheo)::forcetheo
......
...@@ -35,6 +35,8 @@ SUBROUTINE r_inpXML(& ...@@ -35,6 +35,8 @@ SUBROUTINE r_inpXML(&
USE m_constants USE m_constants
USE m_inpeig USE m_inpeig
USE m_sort USE m_sort
USE m_types_xcpot_inbuild
! USE m_types_xcpot_libxc
IMPLICIT NONE IMPLICIT NONE
TYPE(t_input),INTENT(INOUT) :: input TYPE(t_input),INTENT(INOUT) :: input
...@@ -49,7 +51,7 @@ SUBROUTINE r_inpXML(& ...@@ -49,7 +51,7 @@ SUBROUTINE r_inpXML(&
TYPE(t_cell),INTENT(INOUT) :: cell TYPE(t_cell),INTENT(INOUT) :: cell
TYPE(t_banddos),INTENT(INOUT) :: banddos TYPE(t_banddos),INTENT(INOUT) :: banddos
TYPE(t_sliceplot),INTENT(INOUT):: sliceplot 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_noco),INTENT(INOUT) :: noco
TYPE(t_dimension),INTENT(OUT) :: dimension TYPE(t_dimension),INTENT(OUT) :: dimension
TYPE(t_enpara) ,INTENT(OUT) :: enpara TYPE(t_enpara) ,INTENT(OUT) :: enpara
...@@ -225,7 +227,6 @@ SUBROUTINE r_inpXML(& ...@@ -225,7 +227,6 @@ SUBROUTINE r_inpXML(&
ALLOCATE(atoms%igrd(atoms%ntype)) ALLOCATE(atoms%igrd(atoms%ntype))
ALLOCATE(atoms%krla(atoms%ntype)) ALLOCATE(atoms%krla(atoms%ntype))
ALLOCATE(atoms%relcor(atoms%ntype)) ALLOCATE(atoms%relcor(atoms%ntype))
ALLOCATE(xcpot%lda_atom(atoms%ntype))
atoms%namex = '' atoms%namex = ''
atoms%icorr = -99 atoms%icorr = -99
...@@ -293,12 +294,7 @@ SUBROUTINE r_inpXML(& ...@@ -293,12 +294,7 @@ SUBROUTINE r_inpXML(&
input%rkmax = evaluateFirstOnly(xmlGetAttributeValue('/fleurInput/calculationSetup/cutoffs/@Kmax')) input%rkmax = evaluateFirstOnly(xmlGetAttributeValue('/fleurInput/calculationSetup/cutoffs/@Kmax'))
stars%gmax = evaluateFirstOnly(xmlGetAttributeValue('/fleurInput/calculationSetup/cutoffs/@Gmax')) 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 stars%gmaxInit = stars%gmax
xPathA = '/fleurInput/calculationSetup/cutoffs/@numbands' xPathA = '/fleurInput/calculationSetup/cutoffs/@numbands'
...@@ -1109,16 +1105,24 @@ SUBROUTINE r_inpXML(& ...@@ -1109,16 +1105,24 @@ SUBROUTINE r_inpXML(&
! Read in xc functional parameters ! 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')) l_relcor = evaluateFirstBoolOnly(xmlGetAttributeValue('/fleurInput/xcFunctional/@relativisticCorrections'))
relcor = 'non-relativi' relcor = 'non-relativi'
IF (l_relcor) THEN IF (l_relcor) THEN
relcor = 'relativistic' relcor = 'relativistic'
END IF END IF
!now initialize the xcpot variable
CALL getXCParameters(namex,l_relcor,xcpot,hybrid%l_hybrid) 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)) IF (hybrid%l_hybrid) ALLOCATE(hybrid%lcutm1(atoms%ntype),hybrid%lcutwf(atoms%ntype),hybrid%select1(4,atoms%ntype))
obsolete%lwb=.FALSE. obsolete%lwb=.FALSE.
...@@ -1514,7 +1518,10 @@ SUBROUTINE r_inpXML(& ...@@ -1514,7 +1518,10 @@ SUBROUTINE r_inpXML(&
hybrid%select1(:,iType)=SELECT hybrid%select1(:,iType)=SELECT
ENDIF ENDIF
! Explicit xc functional ! 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 noco%socscale(iType)=socscaleSpecies
END IF END IF
END DO END DO
...@@ -2000,24 +2007,34 @@ SUBROUTINE r_inpXML(& ...@@ -2000,24 +2007,34 @@ SUBROUTINE r_inpXML(&
END 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_juDFT
USE m_types USE m_types
USE m_types_xcpot_inbuild
! USE m_types_xcpot_libxc
IMPLICIT NONE IMPLICIT NONE
TYPE(t_atoms),INTENT(IN) :: atoms
CHARACTER(LEN=4), INTENT(IN) :: namex CHARACTER(LEN=*), INTENT(IN) :: namex
LOGICAL, INTENT(IN) :: relcor LOGICAL, INTENT(IN) :: relcor
TYPE(t_xcpot),INTENT(INOUT) :: xcpot CLASS(t_xcpot),INTENT(OUT),ALLOCATABLE :: xcpot
LOGICAL, INTENT(OUT) :: l_hybrid
IF (namex(1:6)=='libxc:') THEN
CALL xcpot%init(namex,relcor) ! ALLOCATE(t_xcpot_libxc::xcpot)
l_hybrid=xcpot%is_hybrid() 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) SUBROUTINE getIntegerSequenceFromString(string, sequence, count)
......
...@@ -37,7 +37,7 @@ ...@@ -37,7 +37,7 @@
TYPE(t_cell),INTENT(INOUT) :: cell TYPE(t_cell),INTENT(INOUT) :: cell
TYPE(t_banddos),INTENT(INOUT) :: banddos TYPE(t_banddos),INTENT(INOUT) :: banddos
TYPE(t_sliceplot),INTENT(INOUT):: sliceplot 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 TYPE(t_noco),INTENT(INOUT) :: noco
REAL,INTENT(INOUT) :: a1(3),a2(3),a3(3) REAL,INTENT(INOUT) :: a1(3),a2(3),a3(3)
......
...@@ -45,7 +45,7 @@ SUBROUTINE w_inpXML(& ...@@ -45,7 +45,7 @@ SUBROUTINE w_inpXML(&
TYPE(t_cell),INTENT(IN) :: cell TYPE(t_cell),INTENT(IN) :: cell
TYPE(t_banddos),INTENT(IN) :: banddos TYPE(t_banddos),INTENT(IN) :: banddos
TYPE(t_sliceplot),INTENT(IN):: sliceplot 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_noco),INTENT(IN) :: noco
TYPE(t_enpara),INTENT(IN) :: enpara TYPE(t_enpara),INTENT(IN) :: enpara
CLASS(t_forcetheo),INTENT(IN):: forcetheo !nothing is done here so far.... 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,& ...@@ -24,7 +24,7 @@ SUBROUTINE writeOutParameters(mpi,input,sym,stars,atoms,vacuum,obsolete,kpts,&
TYPE(t_cell), INTENT(IN) :: cell TYPE(t_cell), INTENT(IN) :: cell
TYPE(t_banddos), INTENT(IN) :: banddos TYPE(t_banddos), INTENT(IN) :: banddos
TYPE(t_sliceplot), INTENT(IN) :: sliceplot 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_noco), INTENT(IN) :: noco
TYPE(t_dimension), INTENT(IN) :: dimension TYPE(t_dimension), INTENT(IN) :: dimension
TYPE(t_enpara), INTENT(IN) :: enpara TYPE(t_enpara), INTENT(IN) :: enpara
......
...@@ -88,7 +88,6 @@ CONTAINS ...@@ -88,7 +88,6 @@ CONTAINS
TYPE(t_banddos) :: banddos TYPE(t_banddos) :: banddos
TYPE(t_obsolete) :: obsolete TYPE(t_obsolete) :: obsolete
TYPE(t_enpara) :: enpara TYPE(t_enpara) :: enpara
TYPE(t_xcpot) :: xcpot
TYPE(t_results) :: results TYPE(t_results) :: results
TYPE(t_kpts) :: kpts TYPE(t_kpts) :: kpts
TYPE(t_hybrid) :: hybrid TYPE(t_hybrid) :: hybrid
...@@ -98,6 +97,7 @@ CONTAINS ...@@ -98,6 +97,7 @@ CONTAINS
TYPE(t_wann) :: wann TYPE(t_wann) :: wann
TYPE(t_potden) :: vTot,vx,vCoul,vTemp TYPE(t_potden) :: vTot,vx,vCoul,vTemp
TYPE(t_potden) :: inDen, outDen TYPE(t_potden) :: inDen, outDen
CLASS(t_xcpot),ALLOCATABLE :: xcpot
CLASS(t_forcetheo),ALLOCATABLE:: forcetheo CLASS(t_forcetheo),ALLOCATABLE:: forcetheo
! .. Local Scalars .. ! .. Local Scalars ..
...@@ -207,8 +207,13 @@ CONTAINS ...@@ -207,8 +207,13 @@ CONTAINS
!HF !HF
IF (hybrid%l_hybrid) CALL calc_hybrid(hybrid,kpts,atoms,input,DIMENSION,mpi,noco,& IF (hybrid%l_hybrid) THEN
cell,vacuum,oneD,banddos,results,sym,xcpot,vTot,it) 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 !#endif
!!$ DO pc = 1, wann%nparampts !!$ DO pc = 1, wann%nparampts
......
...@@ -32,6 +32,7 @@ ...@@ -32,6 +32,7 @@
USE m_prpqfftmap USE m_prpqfftmap
USE m_writeOutHeader USE m_writeOutHeader
USE m_fleur_init_old USE m_fleur_init_old
USE m_types_xcpot_inbuild
#ifdef CPP_MPI #ifdef CPP_MPI
USE m_mpi_bc_all, ONLY : mpi_bc_all USE m_mpi_bc_all, ONLY : mpi_bc_all
USE m_mpi_dist_forcetheorem USE m_mpi_dist_forcetheorem
...@@ -56,7 +57,7 @@ ...@@ -56,7 +57,7 @@
TYPE(t_banddos) ,INTENT(OUT):: banddos TYPE(t_banddos) ,INTENT(OUT):: banddos
TYPE(t_obsolete) ,INTENT(OUT):: obsolete TYPE(t_obsolete) ,INTENT(OUT):: obsolete
TYPE(t_enpara) ,INTENT(OUT):: enpara 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_results) ,INTENT(OUT):: results
TYPE(t_kpts) ,INTENT(OUT):: kpts TYPE(t_kpts) ,INTENT(OUT):: kpts
TYPE(t_hybrid) ,INTENT(OUT):: hybrid TYPE(t_hybrid) ,INTENT(OUT):: hybrid
...@@ -206,10 +207,14 @@ ...@@ -206,10 +207,14 @@
#endif #endif
ELSE ! else branch of "IF (input%l_inpXML) THEN" ELSE ! else branch of "IF (input%l_inpXML) THEN"
CALL fleur_init_old(mpi,& ALLOCATE(t_xcpot_inbuild::xcpot)
input,DIMENSION,atoms,sphhar,cell,stars,sym,noco,vacuum,forcetheo,& SELECT TYPE(xcpot)
sliceplot,banddos,obsolete,enpara,xcpot,kpts,hybrid,& TYPE IS(t_xcpot_inbuild)
oneD,coreSpecInput,l_opti) CALL fleur_init_old(mpi,&