Commit d5208d7d authored by Daniel Wortmann's avatar Daniel Wortmann
Browse files

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)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment