Commit 9ffd69d4 authored by Daniel Wortmann's avatar Daniel Wortmann

Merge branch 'xc-pot-refactor' into 'develop'

Xc pot refactor finished (libxc GGA is missing)

See merge request fleur/fleur!3
parents 917abc43 50469b62
......@@ -14,6 +14,7 @@ include("cmake/tests/test_Wannier4.cmake")
include("cmake/tests/test_Wannier5.cmake")
include("cmake/tests/test_MAGMA.cmake")
include("cmake/tests/test_GPU.cmake")
include("cmake/tests/test_LibXC.cmake")
if (FLEUR_USE_MPI)
include("cmake/tests/test_SCALAPACK.cmake")
include("cmake/tests/test_ELPA.cmake")
......
......@@ -38,7 +38,7 @@ include(wannier/CMakeLists.txt)
include(wannier/uhu/CMakeLists.txt)
include(forcetheorem/CMakeLists.txt)
set(inpgen_F77
set(inpgen_F77 ${inpgen_F77}
inpgen/element.f inpgen/atom_input.f inpgen/crystal.f inpgen/lattice2.f inpgen/setab.f inpgen/super_check.f
inpgen/atom_sym.f inpgen/generator.f inpgen/read_record.f inpgen/soc_or_ssdw.f inpgen/symproperties.f
inpgen/bravais_symm.f inpgen/set_atom_core.f inpgen/spg_gen.f global/triang.f
......
......@@ -19,6 +19,7 @@ message("${Green} XML Library found : ${CReset} ${FLEUR_USE_XML}")
message("${Green} LAPACK Library found : ${CReset} ${FLEUR_USE_LAPACK}")
message("${Red}These Libraries are optional:${CReset}")
message("${Green} FFT from MKL found : ${CReset} ${FLEUR_USE_FFTMKL}")
message("${Green} LibXC Library found : ${CReset} ${FLEUR_USE_LIBXC}")
message("${Green} HDF5 Library found : ${CReset} ${FLEUR_USE_HDF5}")
message("${Green} Wannier90 1.2 Library found : ${CReset} ${FLEUR_USE_WANN}")
message("${Green} Wannier90-4 Library found : ${CReset} ${FLEUR_USE_WANN4}")
......
......@@ -2,6 +2,6 @@
set(CMAKE_Fortran_COMPILER mpif90)
#set(CMAKE_C_COMPILER mpiicc)
#Add include pathes
#set(FLEUR_Fortran_FLAGS "")
set(FLEUR_Fortran_FLAGS "-I/opt/include")
#Add linker stuff
set(FLEUR_LIBRARIES ${FLEUR_LIBRARIES} "-L/usr/lib;-L/usr/lib/x86_64-linux-gnu;-lxml2;-lscalapack-openmpi;-lblacsF77init-openmpi;-lblacs-openmpi;-llapack;-lblas")
set(FLEUR_LIBRARIES ${FLEUR_LIBRARIES} "-L/opt/lib;-lxcf03;-lxc;-lhdf5_fortran;-lhdf5;-ldl;-L/usr/lib;-L/usr/lib/x86_64-linux-gnu;-lxml2;-lscalapack-openmpi;-lblacsF77init-openmpi;-lblacs-openmpi;-llapack;-lblas")
#Check if we can compile with LIBXC
try_compile(FLEUR_USE_LIBXC ${CMAKE_BINARY_DIR} ${CMAKE_SOURCE_DIR}/cmake/tests/test_LibXC.f90
LINK_LIBRARIES ${FLEUR_LIBRARIES}
)
message("Libxc Library found:${FLEUR_USE_LIBXC}")
if (FLEUR_USE_LIBXC)
set(FLEUR_MPI_DEFINITIONS ${FLEUR_MPI_DEFINITIONS} "CPP_LIBXC")
set(FLEUR_DEFINITIONS ${FLEUR_DEFINITIONS} "CPP_LIBXC")
endif()
PROGRAM test
USE xc_f03_lib_m
TYPE(xc_f03_func_t) :: xc_func
CALL xc_f03_func_init(xc_func, 2, XC_UNPOLARIZED)
END PROGRAM test
......@@ -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
CLASS(t_xcpot),INTENT(OUT),ALLOCATABLE :: xcpot
TYPE(t_kpts) ,INTENT(INOUT):: kpts
TYPE(t_hybrid) ,INTENT(OUT) :: hybrid
TYPE(t_oneD) ,INTENT(OUT) :: oneD
......@@ -68,6 +68,10 @@ CONTAINS
#endif
ALLOCATE(t_forcetheo::forcetheo) !default no forcetheorem type
ALLOCATE(t_xcpot_inbuild::xcpot)
SELECT TYPE(xcpot)
TYPE IS (t_xcpot_inbuild)
namex = ' '
relcor = ' '
......@@ -180,18 +184,18 @@ 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
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(atoms%ntype,1,MPI_INTEGER,0,mpi%mpi_comm,ierr)
CALL mpi_dist_forcetheorem(mpi,forcetheo)
#endif
IF (mpi%irank.NE.0) THEN
CALL xcpot%init(namex,l_krla)
CALL xcpot%init(namex,l_krla,atoms%ntype)
END IF
CALL setup(mpi,atoms,kpts,DIMENSION,sphhar,&
......@@ -203,7 +207,6 @@ CONTAINS
banddos%l_orb = .FALSE.
banddos%orbCompAtom = 0
ALLOCATE(xcpot%lda_atom(atoms%ntype))
ALLOCATE(noco%socscale(atoms%ntype))
xcpot%lda_atom(:) = .FALSE.
noco%socscale(:) = 1.0
......@@ -259,5 +262,6 @@ CONTAINS
END IF
END IF ! mpi%irank.eq.0
CALL timestop("preparation:stars,lattice harmonics,+etc")
END SELECT
END SUBROUTINE fleur_init_old
END MODULE m_fleur_init_old
......@@ -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
......@@ -211,7 +211,7 @@
WRITE (6,FMT=8120) namex,relcor
8120 FORMAT (1x,'exchange-correlation: ',a4,2x,a12,1x,'correction')
CALL xcpot%init(namex,relcor.EQ.'relativistic')
CALL xcpot%init(namex,relcor.EQ.'relativistic',atoms%ntype)
!!$ xcpot%icorr = -99
!!$
!!$ ! l91: lsd(igrd=0) with dsprs=1.d-19 in pw91.
......
......@@ -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
......
......@@ -40,7 +40,6 @@ SUBROUTINE postprocessInput(mpi,input,field,sym,stars,atoms,vacuum,obsolete,kpts
USE m_gen_bz
USE m_nocoInputCheck
USE m_kpoints
IMPLICIT NONE
TYPE(t_mpi) ,INTENT (IN) :: mpi
......@@ -57,7 +56,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 +72,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 +534,12 @@ 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)
#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
......@@ -80,7 +82,7 @@ SUBROUTINE r_inpXML(&
! ..
! .. Local Variables
REAL :: scpos ,zc
INTEGER ieq,i,k,na,n,ii
INTEGER ieq,i,k,na,n,ii,id_c,id_x
REAL s3,ah,a,hs2,rest,thetaj
LOGICAL l_hyb,l_sym,ldum
INTEGER :: ierr
......@@ -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,7 +1105,7 @@ 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'
......@@ -1117,8 +1113,26 @@ SUBROUTINE r_inpXML(&
relcor = 'relativistic'
END IF
CALL getXCParameters(namex,l_relcor,xcpot,hybrid%l_hybrid)
!Read in libxc parameters if present
xPathA = '/fleurInput/xcFunctional/libXC'
numberNodes = xmlGetNumberOfNodes(xPathA)
IF (numberNodes==1) THEN
id_x=evaluateFirstOnly(xmlGetAttributeValue('/fleurInput/xcFunctional/libXC/@exchange'))
id_c=evaluateFirstOnly(xmlGetAttributeValue('/fleurInput/xcFunctional/libXC/@correlation'))
ELSE
id_x=0;id_c=0
ENDIF
!now initialize the xcpot variable
CALL setXCParameters(atoms,valueString,l_relcor,input%jspins,id_x,id_c,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 +1528,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 +2017,34 @@ SUBROUTINE r_inpXML(&
END SUBROUTINE r_inpXML
SUBROUTINE getXCParameters(namex,relcor,xcpot,l_hybrid)
SUBROUTINE setXCParameters(atoms,namex,relcor,jspins,id_x,id_c,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()
INTEGER, INTENT(IN) :: jspins,id_c,id_x
CLASS(t_xcpot),INTENT(OUT),ALLOCATABLE :: xcpot
IF (namex(1:5)=='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,atoms%ntype)
TYPE IS(t_xcpot_libxc)
CALL xcpot%init(jspins,id_x,id_c)
END SELECT
END SUBROUTINE getXCParameters
END SUBROUTINE setXCParameters
SUBROUTINE getIntegerSequenceFromString(string, sequence, count)
......
!--------------------------------------------------------------------------------
! 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
......@@ -37,7 +38,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)
......@@ -549,7 +550,7 @@
READ (UNIT=5,FMT=8050,END=99,ERR=99)&
& input%frcor,sliceplot%slice,input%ctail
input%coretail_lmax=99
input%kcrel=.false.
input%kcrel=0
BACKSPACE(5)
READ (UNIT=5,fmt='(A)') line
input%l_bmt= ( line(52:56)=='bmt=T' ).or.( line(52:56)=='bmt=t' )
......
......@@ -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
......
This diff is collapsed.
......@@ -65,7 +65,6 @@ CONTAINS
USE m_dwigner
USE m_ylm
#ifdef CPP_MPI
USE m_mpi_bc_all, ONLY : mpi_bc_all
USE m_mpi_bc_potden
#endif
USE m_eig66_io, ONLY : open_eig, close_eig
......@@ -88,7 +87,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 +96,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 +206,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,9 @@
USE m_prpqfftmap
USE m_writeOutHeader
USE m_fleur_init_old
USE m_types_xcpot_inbuild
USE m_mpi_bc_xcpot
#ifdef CPP_MPI
USE m_mpi_bc_all, ONLY : mpi_bc_all
USE m_mpi_dist_forcetheorem
......@@ -56,7 +59,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
......@@ -176,7 +179,7 @@
xmlPrintCoreStates,xmlCoreOccs,atomTypeSpecies,speciesRepAtomType,&
l_kpts)
END IF
CALL mpi_bc_xcpot(xcpot,mpi)
CALL postprocessInput(mpi,input,field,sym,stars,atoms,vacuum,obsolete,kpts,&
oneD,hybrid,cell,banddos,sliceplot,xcpot,forcetheo,&
noco,dimension,enpara,sphhar,l_opti,noel,l_kpts)
......@@ -278,7 +281,7 @@
& mpi,stars,sphhar,atoms,obsolete,&
& sym,kpts,DIMENSION,input,field,&
& banddos,sliceplot,vacuum,cell,enpara,&
& noco,oneD,xcpot,hybrid)
& noco,oneD,hybrid)
#endif
! Set up pointer for backtransformation from g-vector in positive
......
......@@ -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
......
set(fleur_F90 ${fleur_F90}
mpi/mpi_bc_xcpot.F90
mpi/setupMPI.F90)
if (${FLEUR_USE_MPI})
set(fleur_F90 ${fleur_F90}
mpi/mingeselle.F90
......
......@@ -10,13 +10,12 @@ CONTAINS
mpi,stars,sphhar,atoms,obsolete,sym,&
kpts,DIMENSION,input,field,banddos,sliceplot,&
vacuum,cell,enpara,noco,oneD,&
xcpot,hybrid)
hybrid)
!
!**********************************************************************
USE m_types
IMPLICIT NONE
INCLUDE 'mpif.h'
TYPE(t_xcpot),INTENT(INOUT) :: xcpot
TYPE(t_mpi),INTENT(INOUT) :: mpi