Commit 011699ab authored by Daniel Wortmann's avatar Daniel Wortmann

Merge branch 'develop' into setup_types

parents f9a669af 926ac62a
......@@ -15,6 +15,7 @@ include("cmake/tests/test_Wannier5.cmake")
include("cmake/tests/test_MAGMA.cmake")
include("cmake/tests/test_GPU.cmake")
include("cmake/tests/test_LibXC.cmake")
include("cmake/tests/test_ELPA_onenode.cmake")
if (FLEUR_USE_MPI)
include("cmake/tests/test_SCALAPACK.cmake")
include("cmake/tests/test_ELPA.cmake")
......
......@@ -15,29 +15,30 @@ message("${Green}Compiler ID: ${CReset} ${CMAKE_Fortran_COMPILER_ID}")
message("${Green}Flags : ${CReset} ${CMAKE_Fortran_FLAGS}")
message("${Green}Libraries : ${CReset} ${FLEUR_LIBRARIES}")
message("\n${Red}These Libraries are required:${CReset}")
message("${Green} XML Library found : ${CReset} ${FLEUR_USE_XML}")
message("${Green} LAPACK Library found : ${CReset} ${FLEUR_USE_LAPACK}")
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}")
message("${Green} Wannier90-5 Library found : ${CReset} ${FLEUR_USE_WANN5}")
message("${Green} MAGMA Library found : ${CReset} ${FLEUR_USE_MAGMA}")
message("${Green} MPI Library found : ${CReset} ${FLEUR_USE_MPI}")
message("${Green} ELPA (one node) Library found : ${CReset} ${FLEUR_USE_ELPA_ONENODE}")
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}")
message("${Green} Wannier90-5 Library found : ${CReset} ${FLEUR_USE_WANN5}")
message("${Green} MAGMA Library found : ${CReset} ${FLEUR_USE_MAGMA}")
message("${Green} MPI Library found : ${CReset} ${FLEUR_USE_MPI}")
if (FLEUR_USE_MPI)
message("${Green} SCALAPACK Library found : ${CReset} ${FLEUR_USE_SCALAPACK}")
message("${Green} ELPA Library found : ${CReset} ${FLEUR_USE_ELPA}")
message("${Green} ChASE Library found : ${CReset} ${FLEUR_USE_CHASE}")
message("${Green} SCALAPACK Library found : ${CReset} ${FLEUR_USE_SCALAPACK}")
message("${Green} ELPA Library found : ${CReset} ${FLEUR_USE_ELPA}")
message("${Green} ChASE Library found : ${CReset} ${FLEUR_USE_CHASE}")
else()
message("${Green} SCALAPACK Library found : ${CReset} ---")
message("${Green} ELPA Library found : ${CReset} ---")
message("${Green} ChASE Library found : ${CReset} ---")
message("${Green} SCALAPACK Library found : ${CReset} ---")
message("${Green} ELPA Library found : ${CReset} ---")
message("${Green} ChASE Library found : ${CReset} ---")
endif()
message("${Green} Compile GPU version : ${CReset} ${FLEUR_USE_GPU}")
message("${Green} Compile GPU version : ${CReset} ${FLEUR_USE_GPU}")
if (FLEUR_USE_GPU)
message("${Green} CuSolver Library found : ${CReset} ${FLEUR_USE_CUSOLVER}")
message("${Green} CuSolver Library found : ${CReset} ${FLEUR_USE_CUSOLVER}")
endif()
message("\n")
message("${Green}Compile serial version : ${CReset} ${FLEUR_USE_SERIAL}")
......
#First check if we can compile with ELPA
try_compile(FLEUR_USE_ELPA_ONENODE ${CMAKE_BINARY_DIR} ${CMAKE_SOURCE_DIR}/cmake/tests/test_ELPA.f90
LINK_LIBRARIES ${FLEUR_LIBRARIES})
if (NOT FLEUR_USE_ELPA_ONENODE)
if (DEFINED CLI_ELPA_OPENMP)
set(TEST_LIBRARIES "-lelpa_onenode_openmp;${FLEUR_LIBRARIES}")
#else()
# set(TEST_LIBRARIES "-lelpa;${FLEUR_LIBRARIES}")
endif()
try_compile(FLEUR_USE_ELPA_ONENODE ${CMAKE_BINARY_DIR} ${CMAKE_SOURCE_DIR}/cmake/tests/test_ELPA.f90
LINK_LIBRARIES ${TEST_LIBRARIES})
if (FLEUR_USE_ELPA_ONENODE)
set(FLEUR_LIBRARIES "${TEST_LIBRARIES}")
endif()
endif()
message("ELPA (one node) Library found:${FLEUR_USE_ELPA_ONENODE}")
#Now check for version of elpa
if (FLEUR_USE_ELPA_ONENODE)
set(FLEUR_USE_ELPA_ONENODE false)
try_compile(FLEUR_USE_ELPA_ONENODE_20180525 ${CMAKE_BINARY_DIR} ${CMAKE_SOURCE_DIR}/cmake/tests/test_ELPA_20180525.f90
LINK_LIBRARIES ${FLEUR_LIBRARIES})
message("Version check for ELPA:")
message("20180525 ELPA: ${FLEUR_USE_ELPA_ONENODE_20180525}")
if (FLEUR_USE_ELPA_ONENODE_20180525)
set(FLEUR_USE_ELPA_ONENODE TRUE)
set(FLEUR_DEFINITIONS ${FLEUR_DEFINITIONS} "CPP_ELPA_ONENODE")
endif()
endif()
......@@ -6,13 +6,14 @@ LINK_LIBRARIES ${FLEUR_LIBRARIES}
if (NOT FLEUR_USE_XML)
find_package(LibXml2)
set(CMAKE_C_FLAGS "-I${LIBXML2_INCLUDE_DIR}")
set(TEST_LIBRARIES ${FLEUR_LIBRARIES} ${LIBXML2_LIBRARIES})
if (${LIBXML2_LIBRARIES})
set(TEST_LIBRARIES ${FLEUR_LIBRARIES} ${LIBXML2_LIBRARIES})
endif()
try_compile(FLEUR_USE_XML ${CMAKE_BINARY_DIR} ${CMAKE_SOURCE_DIR}/cmake/tests/test_XML.f90
LINK_LIBRARIES ${TEST_LIBRARIES}
)
if (FLEUR_USE_XML)
set(FLEUR_LIBRARIES ${LIBXML2_LIBRARIES} ${FLEUR_LIBRARIES})
set(FLEUR_LIBRARIES ${TEST_LIBRARIES} )
set(FLEUR_MPI_LIBRARIES ${LIBXML2_LIBRARIES} ${FLEUR_MPI_LIBRARIES})
endif()
endif()
......@@ -40,7 +41,7 @@ if (FLEUR_USE_XML)
find_package(LibXml2)
set(CMAKE_C_FLAGS "-I${LIBXML2_INCLUDE_DIR}")
try_compile(FLEUR_USE_XML ${CMAKE_BINARY_DIR} ${CMAKE_SOURCE_DIR}/cmake/tests/test_XML.c
LINK_LIBRARIES ${LIBXML2_LIBRARIES})
)
endif()
endif()
......
......@@ -8,8 +8,8 @@ diagonalization/scalapack.F90
diagonalization/chase_diag.F90
diagonalization/symmetrize_matrix.f90
diagonalization/cusolver_diag.F90
diagonalization/elemental.F90)
diagonalization/elemental.F90
diagonalization/elpa_20180525_onenode.F90)
if (FLEUR_USE_ELPA_20180525)
set(fleur_F90 ${fleur_F90}
diagonalization/elpa_20180525.F90
......
......@@ -41,6 +41,11 @@ MODULE m_eigen_diag
#endif
INTEGER,PARAMETER:: diag_lapack=4
#ifdef CPP_ELPA_ONENODE
INTEGER,PARAMETER:: diag_elpa_1node=14
#else
INTEGER,PARAMETER:: diag_elpa_1node=-14
#endif
INTEGER,PARAMETER:: diag_debugout=99
PUBLIC eigen_diag,parallel_solver_available
CONTAINS
......@@ -53,6 +58,7 @@ CONTAINS
USE m_lapack_diag
USE m_magma
USE m_elpa
USE m_elpa_onenode
USE m_scalapack
USE m_elemental
USE m_chase_diag
......@@ -105,6 +111,8 @@ CONTAINS
SELECT CASE (priv_select_solver(parallel))
CASE (diag_elpa)
CALL elpa_diag(hmat,smat,ne,eig,ev)
CASE (diag_elpa_1node)
CALL elpa_diag_onenode(hmat,smat,ne,eig,ev)
CASE (diag_elemental)
!CALL ELEMENTAL(hmat,smat,ne,eig,ev)
CASE (diag_scalapack)
......@@ -229,20 +237,22 @@ CONTAINS
ENDIF
!check if a special solver was requested
IF (TRIM(juDFT_string_for_argument("-diag"))=="elpa") diag_solver=diag_elpa
IF (trim(juDFT_string_for_argument("-diag"))=="scalapack") diag_solver=diag_scalapack
IF (trim(juDFT_string_for_argument("-diag"))=="elemental") diag_solver=diag_elemental
IF (trim(juDFT_string_for_argument("-diag"))=="lapack") diag_solver=diag_lapack
IF (trim(juDFT_string_for_argument("-diag"))=="magma") diag_solver=diag_magma
IF (trim(juDFT_string_for_argument("-diag"))=="chase") diag_solver=diag_chase
IF (trim(juDFT_string_for_argument("-diag"))=="cusolver") diag_solver=diag_cusolver
IF (trim(juDFT_string_for_argument("-diag"))=="debugout") diag_solver=diag_debugout
IF (TRIM(juDFT_string_for_argument("-diag"))=="elpa") diag_solver=diag_elpa
IF (TRIM(juDFT_string_for_argument("-diag"))=="elpa_1node") diag_solver=diag_elpa_1node
IF (trim(juDFT_string_for_argument("-diag"))=="scalapack") diag_solver=diag_scalapack
IF (trim(juDFT_string_for_argument("-diag"))=="elemental") diag_solver=diag_elemental
IF (trim(juDFT_string_for_argument("-diag"))=="lapack") diag_solver=diag_lapack
IF (trim(juDFT_string_for_argument("-diag"))=="magma") diag_solver=diag_magma
IF (trim(juDFT_string_for_argument("-diag"))=="chase") diag_solver=diag_chase
IF (trim(juDFT_string_for_argument("-diag"))=="cusolver") diag_solver=diag_cusolver
IF (trim(juDFT_string_for_argument("-diag"))=="debugout") diag_solver=diag_debugout
!Check if solver is possible
IF (diag_solver<0) CALL juDFT_error("You selected a solver for the eigenvalue problem that is not available",hint="You most probably did not provide the appropriate libraries for compilation/linking")
IF (ANY((/diag_lapack,diag_magma,diag_cusolver/)==diag_solver).AND.parallel) CALL judft_error("You selected an eigensolver that does not support distributed memory parallism",hint="Try scalapack,elpa or another supported solver for parallel matrices")
IF (ANY((/diag_elpa,diag_elemental,diag_scalapack/)==diag_solver).AND..NOT.parallel) CALL judft_error("You selected an eigensolver for matrices that are memory distributed",hint="Try lapack, cusolver or another supported solver for non-distributed matrices")
END FUNCTION priv_select_solver
......
!-------------------------------------------------------------------------------
! 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_elpa_onenode
CONTAINS
SUBROUTINE elpa_diag_onenode(hmat,smat,ne,eig,ev)
!
!----------------------------------------------------
! Sigensystem solver
! Uses the ELPA (1 node version)
!
!
! hmat ..... Hamiltonian matrix
! smat ..... overlap matrix
! ne ....... number of ev's searched (and found) on this node
! On input, overall number of ev's searched,
! On output, local number of ev's found
! eig ...... eigenvalues, output
! ev ....... eigenvectors, output
!
! U.Alekseeva Nov. 2018
!----------------------------------------------------
USE m_juDFT
USE m_types_mat
USE m_types
#ifdef CPP_ELPA_ONENODE
USE elpa
#endif
IMPLICIT NONE
CLASS(t_mat),INTENT(INOUT) :: hmat,smat
CLASS(t_mat),ALLOCATABLE,INTENT(OUT)::ev
REAL,INTENT(OUT) :: eig(:)
INTEGER,INTENT(INOUT) :: ne
#ifdef CPP_ELPA_ONENODE
!... Local variables
!
INTEGER :: err
REAL,ALLOCATABLE :: eig2(:)
TYPE(t_mat) :: ev_dist
INTEGER :: kernel
CLASS(elpa_t),pointer :: elpa_obj
err = elpa_init(20180525)
elpa_obj => elpa_allocate()
ALLOCATE ( eig2(hmat%matsize1), stat=err ) ! The eigenvalue array
IF (err.NE.0) CALL juDFT_error('Failed to allocated "eig2"', calledby ='elpa')
CALL ev_dist%init(hmat)! Eigenvectors
IF (err.NE.0) CALL juDFT_error('Failed to allocated "ev_dist"',calledby ='elpa')
CALL elpa_obj%set("na", hmat%matsize1, err)
CALL elpa_obj%set("nev", ne, err)
CALL elpa_obj%set("local_nrows", hmat%matsize1, err)
CALL elpa_obj%set("local_ncols", hmat%matsize2, err)
CALL elpa_obj%set("nblk",hmat%matsize1, err)
CALL elpa_obj%set("blacs_context", -1, err)
err = elpa_obj%setup()
CALL hmat%add_transpose(hmat)
CALL smat%add_transpose(smat)
IF (hmat%l_real) THEN
CALL elpa_obj%generalized_eigenvectors(hmat%data_r,smat%data_r,eig2, ev_dist%data_r, .FALSE.,err)
ELSE
CALL elpa_obj%generalized_eigenvectors(hmat%data_c,smat%data_c,eig2, ev_dist%data_c, .FALSE., err)
ENDIF
CALL elpa_deallocate(elpa_obj)
CALL elpa_uninit()
! END of ELPA stuff
eig(1:ne) = eig2(1:ne)
DEALLOCATE(eig2)
ALLOCATE(t_mat::ev)
CALL ev%alloc(hmat%l_real,hmat%matsize1,ne)
CALL ev%copy(ev_dist,1,1)
#endif
END SUBROUTINE elpa_diag_onenode
END MODULE m_elpa_onenode
......@@ -150,6 +150,9 @@ CONTAINS
WRITE(1233,'(2i7,2f15.8)') i, j, hmat%data_r(i,j), hmat%data_r(j,i)
END IF
ELSE
IF ((i.LE.5).AND.(j.LE.5)) THEN
WRITE(1233,'(2i7,4f15.8)') i, j, hmat%data_c(i,j), hmat%data_c(j,i)
END IF
ENDIF
END DO
END DO
......@@ -170,6 +173,8 @@ CONTAINS
l_wu=.FALSE.
ne_all=DIMENSION%neigd
IF(ne_all < 0) ne_all = lapw%nmat
IF(ne_all > lapw%nmat) ne_all = lapw%nmat
!Try to symmetrize matrix
CALL symmetrize_matrix(mpi,noco,kpts,nk,hmat,smat)
......
This diff is collapsed.
......@@ -198,8 +198,8 @@ CONTAINS
REAL,ALLOCATABLE :: gkrot(:,:)
LOGICAL :: l_apw
ALLOCATE(c_ph(lapw%nv(1),MERGE(2,1,noco%l_ss)))
ALLOCATE(gkrot(3,lapw%nv(1)))
ALLOCATE(c_ph(maxval(lapw%nv),MERGE(2,1,noco%l_ss)))
ALLOCATE(gkrot(3,maxval(lapw%nv)))
lmax=MERGE(atoms%lnonsph(n),atoms%lmax(n),l_nonsph)
......
This diff is collapsed.
......@@ -34,7 +34,7 @@ CONTAINS
! ..
! .. Scalar Arguments ..
INTEGER, INTENT (IN) :: na,ntyp
INTEGER, INTENT (IN) :: iintsp,jintsp
INTEGER, INTENT (IN) :: jintsp,iintsp
COMPLEX, INTENT (IN) :: chi
INTEGER, INTENT(IN) :: isp
! ..
......@@ -54,7 +54,7 @@ CONTAINS
COMPLEX, ALLOCATABLE :: cph(:,:)
ALLOCATE(cph(MAXVAL(lapw%nv),2))
DO i=MIN(iintsp,jintsp),MAX(iintsp,jintsp)
DO i=MIN(jintsp,iintsp),MAX(jintsp,iintsp)
CALL lapw%phase_factors(i,atoms%taual(:,na),noco%qss,cph(:,i))
ENDDO
......@@ -81,26 +81,26 @@ CONTAINS
clo1(lo)* clo1(lo) )
DO nkvec = 1,invsfct* (2*l+1) !Each LO can have several functions
!+t3e
locol = lapw%nv(iintsp)+lapw%index_lo(lo,na)+nkvec !this is the column of the matrix
locol = lapw%nv(jintsp)+lapw%index_lo(lo,na)+nkvec !this is the column of the matrix
IF (MOD(locol-1,mpi%n_size).EQ.mpi%n_rank) THEN
locol=(locol-1)/mpi%n_size+1 !this is the column in local storage
!-t3e
k = lapw%kvec(nkvec,lo,na)
!---> calculate the overlap matrix elements with the regular
!---> flapw basis-functions
DO kp = 1,lapw%nv(jintsp)
DO kp = 1,lapw%nv(iintsp)
fact2 = con * fl2p1 * (&
fj(kp,l,jintsp)* ( alo1(lo) + &
fj(kp,l,iintsp)* ( alo1(lo) + &
clo1(lo)*ud%uulon(lo,ntyp,isp))+&
gj(kp,l,jintsp)* ( blo1(lo) * ud%ddn(l,ntyp,isp)+&
gj(kp,l,iintsp)* ( blo1(lo) * ud%ddn(l,ntyp,isp)+&
clo1(lo)*ud%dulon(lo,ntyp,isp)))
dotp = dot_PRODUCT(lapw%gk(:,k,iintsp),lapw%gk(:,kp,jintsp))
dotp = dot_PRODUCT(lapw%gk(:,k,jintsp),lapw%gk(:,kp,iintsp))
IF (smat%l_real) THEN
smat%data_r(kp,locol) = smat%data_r(kp,locol) + chi*invsfct*fact2 * legpol(l,dotp) *&
cph(k,iintsp)*CONJG(cph(kp,jintsp))
cph(k,jintsp)*CONJG(cph(kp,iintsp))
ELSE
smat%data_c(kp,locol) = smat%data_c(kp,locol) + chi*invsfct*fact2 * legpol(l,dotp) *&
cph(k,iintsp)*CONJG(cph(kp,jintsp))
cph(k,jintsp)*CONJG(cph(kp,iintsp))
ENDIF
END DO
!---> calculate the overlap matrix elements with other local
......@@ -118,14 +118,14 @@ CONTAINS
clo1(lo)*ud%uloulopn(lop,lo,ntyp,isp)))
DO nkvecp = 1,invsfct* (2*lp+1)
kp = lapw%kvec(nkvecp,lop,na)
lorow=lapw%nv(jintsp)+lapw%index_lo(lop,na)+nkvecp
dotp = dot_PRODUCT(lapw%gk(:,k,iintsp),lapw%gk(:,kp,jintsp))
lorow=lapw%nv(iintsp)+lapw%index_lo(lop,na)+nkvecp
dotp = dot_PRODUCT(lapw%gk(:,k,jintsp),lapw%gk(:,kp,iintsp))
IF (smat%l_real) THEN
smat%data_r(lorow,locol) =smat%data_r(lorow,locol)+chi*invsfct*fact3*legpol(l,dotp)* &
cph(k,iintsp)*conjg(cph(kp,jintsp))
cph(k,jintsp)*conjg(cph(kp,iintsp))
ELSE
smat%data_c(lorow,locol) =smat%data_c(lorow,locol)+chi*invsfct*fact3*legpol(l,dotp)*&
cph(k,iintsp)*CONJG(cph(kp,jintsp))
cph(k,jintsp)*CONJG(cph(kp,iintsp))
ENDIF
END DO
ELSE
......@@ -135,14 +135,14 @@ CONTAINS
!---> orbital with itself
DO nkvecp = 1,nkvec
kp = lapw%kvec(nkvecp,lo,na)
lorow=lapw%nv(jintsp)+lapw%index_lo(lo,na)+nkvecp
dotp = dot_PRODUCT(lapw%gk(:,k,iintsp),lapw%gk(:,kp,jintsp))
lorow=lapw%nv(iintsp)+lapw%index_lo(lo,na)+nkvecp
dotp = dot_PRODUCT(lapw%gk(:,k,jintsp),lapw%gk(:,kp,iintsp))
IF (smat%l_real) THEN
smat%data_r(lorow,locol) = smat%data_r(lorow,locol) + chi*invsfct*fact1*legpol(l,dotp) *&
cph(k,iintsp)*CONJG(cph(kp,jintsp))
cph(k,jintsp)*CONJG(cph(kp,iintsp))
ELSE
smat%data_c(lorow,locol) = smat%data_c(lorow,locol) + chi*invsfct*fact1*legpol(l,dotp)*&
cph(k,iintsp)*CONJG(cph(kp,jintsp))
cph(k,jintsp)*CONJG(cph(kp,iintsp))
ENDIF
END DO
ENDIF ! mod(locol-1,n_size) = nrank
......
libxml2_version=2.7.2
if [ ! -r libxml2-${libxml2_version} ]
then
#Get the file with the code
curl -LO "ftp://xmlsoft.org/libxml2/libxml2-${libxml2_version}.tar.gz"
tar xzf libxml2-${libxml2_version}.tar.gz
cd libxml2-${libxml2_version}
#Compile&test (This will take a while)
./configure --disable-shared
make
else
cd libxml2-${libxml2_version}
fi
#Store the installation location
FLEUR_LIBDIR="$PWD/.libs $FLEUR_LIBDIR"
FLEUR_INCLUDEDIR="$PWD/include $FLEUR_INCLUDEDIR"
......@@ -52,11 +52,13 @@ CONTAINS
this%evsum=0
END SUBROUTINE dmi_init
SUBROUTINE dmi_start(this)
SUBROUTINE dmi_start(this,potden)
USE m_types_potden
IMPLICIT NONE
CLASS(t_forcetheo_dmi),INTENT(INOUT):: this
TYPE(t_potden) ,INTENT(INOUT) :: potden
this%q_done=0
CALL this%t_forcetheo%start() !call routine of basis type
CALL this%t_forcetheo%start(potden) !call routine of basis type
END SUBROUTINE dmi_start
LOGICAL FUNCTION dmi_next_job(this,lastiter,noco)
......
......@@ -93,11 +93,13 @@ CONTAINS
SUBROUTINE jij_start(this)
SUBROUTINE jij_start(this,potden)
USE m_types_potden
IMPLICIT NONE
CLASS(t_forcetheo_jij),INTENT(INOUT):: this
TYPE(t_potden) ,INTENT(INOUT) :: potden
this%loopindex=0
CALL this%t_forcetheo%start() !call routine of basis type
CALL this%t_forcetheo%start(potden) !call routine of basis type
END SUBROUTINE jij_start
LOGICAL FUNCTION jij_next_job(this,lastiter,noco)
......
......@@ -39,11 +39,13 @@ CONTAINS
END SUBROUTINE mae_init
SUBROUTINE mae_start(this)
SUBROUTINE mae_start(this,potden)
USE m_types_potden
IMPLICIT NONE
CLASS(t_forcetheo_mae),INTENT(INOUT):: this
TYPE(t_potden) ,INTENT(INOUT) :: potden
this%directions_done=0
CALL this%t_forcetheo%start() !call routine of basis type
CALL this%t_forcetheo%start(potden) !call routine of basis type
END SUBROUTINE mae_start
......
......@@ -38,11 +38,25 @@ CONTAINS
this%evsum=0
END SUBROUTINE ssdisp_init
SUBROUTINE ssdisp_start(this)
SUBROUTINE ssdisp_start(this,potden)
USE m_types_potden
IMPLICIT NONE
CLASS(t_forcetheo_ssdisp),INTENT(INOUT):: this
TYPE(t_potden) ,INTENT(INOUT) :: potden
this%q_done=0
CALL this%t_forcetheo%start() !call routine of basis type
CALL this%t_forcetheo%start(potden) !call routine of basis type
IF (SIZE(potden%pw,2)<2) RETURN
!Average out magnetic part of potential/charge in INT+Vacuum
potden%pw(:,1)=(potden%pw(:,1)+potden%pw(:,2))/2.0
potden%pw(:,2)=potden%pw(:,1)
IF (SIZE(potden%pw,2)==3) potden%pw(:,3)=0.0
potden%vacz(:,:,1)=(potden%vacz(:,:,1)+potden%vacz(:,:,2))/2.0
potden%vacxy(:,:,:,1)=(potden%vacxy(:,:,:,1)+potden%vacxy(:,:,:,2))/2.0
potden%vacz(:,:,2)=potden%vacz(:,:,1)
potden%vacxy(:,:,:,2)=potden%vacxy(:,:,:,1)
END SUBROUTINE ssdisp_start
LOGICAL FUNCTION ssdisp_next_job(this,lastiter,noco)
......
......@@ -68,7 +68,6 @@ MODULE m_banddos_io
INTEGER :: hdfError, dimsInt(7)
INTEGER :: version
INTEGER :: fakeLogical
REAL :: eFermiPrev
LOGICAL :: l_error
......@@ -100,9 +99,7 @@ MODULE m_banddos_io
CALL h5gcreate_f(fileID, '/general', generalGroupID, hdfError)
CALL io_write_attint0(generalGroupID,'spins',input%jspins)
CALL io_write_attreal0(generalGroupID,'lastFermiEnergy',eFermiPrev)
fakeLogical = 0
IF (banddos%unfoldband) fakeLogical = 1
CALL io_write_attint0(generalGroupID,'bandUnfolding',fakeLogical)
CALL io_write_attlog0(generalGroupID,'bandUnfolding',banddos%unfoldband)
CALL h5gclose_f(generalGroupID, hdfError)
CALL h5gcreate_f(fileID, '/cell', cellGroupID, hdfError)
......@@ -249,6 +246,7 @@ MODULE m_banddos_io
INTEGER(HID_T) :: jsymSpaceID, jsymSetID
INTEGER(HID_T) :: ksymSpaceID, ksymSetID
INTEGER(HID_T) :: bUWeightsSpaceID, bUWeightsSetID
INTEGER(HID_T) :: supercellSpaceID, supercellSetID
INTEGER :: hdfError, dimsInt(7)
......@@ -306,6 +304,14 @@ MODULE m_banddos_io
IF (banddos%unfoldband) THEN
CALL h5gcreate_f(fileID, '/bandUnfolding', bandUnfoldingGroupID, hdfError)
dims(:1)=(/3/)
dimsInt = dims
CALL h5screate_simple_f(1,dims(:1),supercellSpaceID,hdfError)
CALL h5dcreate_f(bandUnfoldingGroupID, "supercell", H5T_NATIVE_INTEGER, supercellSpaceID, supercellSetID, hdfError)
CALL h5sclose_f(supercellSpaceID,hdfError)
CALL io_write_integer1(supercellSetID,(/1/),dimsInt(:1),(/banddos%s_cell_x,banddos%s_cell_y,banddos%s_cell_z/))
CALL h5dclose_f(supercellSetID, hdfError)
dims(:3)=(/neigd,kpts%nkpt,input%jspins/)
dimsInt = dims
CALL h5screate_simple_f(3,dims(:3),bUWeightsSpaceID,hdfError)
......
This diff is collapsed.
......@@ -523,6 +523,7 @@
<xsd:element name="kPointList" type="KPointListType"/>
<xsd:element name="kPointDensity" type="KPointDensityType"/>
</xsd:choice>
<xsd:element maxOccurs="unbounded" minOccurs="0" name="altKPointSet" type="AltKPointSetType"/>
</xsd:sequence>
<xsd:attribute name="valenceElectrons" type="xsd:string" use="optional"/>
<xsd:attribute default="hist" name="mode" type="BZIntegrationModeEnum" use="optional"/>
......@@ -598,7 +599,20 @@
<xsd:attribute name="maxEnergy" type="xsd:string" use="required"/>
<xsd:attribute name="sigma" type="xsd:string" use="required"/>
</xsd:complexType>
<xsd:complexType name="AltKPointSetType">
<xsd:sequence>
<xsd:choice>
<xsd:element name="kPointMesh" type="KPointMeshType"/>
<xsd:element name="kPointCount" type="KPointCountType"/>
<xsd:element name="kPointList" type="KPointListType"/>
<xsd:element name="kPointDensity" type="KPointDensityType"/>
<xsd:element name="kPointListFile" type="KPointListFileType"/>
</xsd:choice>
</xsd:sequence>
<xsd:attribute name="purpose" type="KPointSetPurposeEnum" use="required"/>
</xsd:complexType>
<xsd:complexType name="KPointMeshType">
<xsd:attribute name="nx" type="xsd:positiveInteger" use="required"/>
<xsd:attribute name="ny" type="xsd:positiveInteger" use="required"/>
......@@ -630,6 +644,10 @@
<xsd:attribute name="gamma" type="FleurBool" use="required"/>
</xsd:complexType>
<xsd:complexType name="KPointListFileType">
<xsd:attribute name="filename" type="xsd:string" use="required"/>
</xsd:complexType>
<xsd:complexType name="SpecialPointType">
<xsd:simpleContent>
<xsd:extension base="String3DVecType">
......@@ -901,6 +919,13 @@
</xsd:restriction>
</xsd:simpleType>
<xsd:simpleType name="KPointSetPurposeEnum">
<xsd:restriction base="xsd:string">
<xsd:enumeration value="bands"/>
<xsd:enumeration value="GW"/>
</xsd:restriction>
</xsd:simpleType>
<xsd:simpleType name="NobleGasConfigEnum">
<xsd:restriction base="xsd:string">
<xsd:enumeration value="[He]"/>
......
This source diff could not be displayed because it is too large. You can view the blob instead.
......@@ -35,20 +35,20 @@ contains
END IF
END IF
IF (.NOT.l_kpts) THEN
IF (.NOT.l_kpts) THEN
IF (.NOT.oneD%odd%d1) THEN
IF (input%l_wann) THEN
sym_hlp=sym
sym_hlp%nop=1
sym_hlp%nop2=1
CALL kptgen_hybrid(kpts,sym_hlp%invs,noco%l_soc,sym_hlp%nop,sym_hlp%mrot,sym_hlp%tau)
CALL kptgen_hybrid(input,cell,sym_hlp,kpts,noco%l_soc)
ELSE IF (.FALSE.) THEN !this was used to generate q-points in jij case
sym_hlp=sym
sym_hlp%nop=1
sym_hlp%nop2=1
CALL julia(sym_hlp,cell,input,noco,banddos,kpts,.FALSE.,.TRUE.)
ELSE IF (kpts%l_gamma.and.(banddos%ndir.eq.0)) THEN
CALL kptgen_hybrid(kpts,sym%invs,noco%l_soc,sym%nop,sym%mrot,sym%tau)
CALL kptgen_hybrid(input,cell,sym,kpts,noco%l_soc)
ELSE
IF (banddos%unfoldband) THEN
CALL unfold_band_kpts(banddos,p_cell,cell,p_kpts,kpts)
......@@ -64,19 +64,19 @@ contains
CALL od_kptsgen (kpts%nkpt)
END IF
!Rescale weights and kpoints
IF (.not.banddos%unfoldband) THEN
kpts%wtkpt(:) = kpts%wtkpt(:) / sum(kpts%wtkpt)
!Rescale weights and kpoints
IF (.not.banddos%unfoldband) THEN
kpts%wtkpt(:) = kpts%wtkpt(:) / sum(kpts%wtkpt)
END IF
kpts%bk(:,:) = kpts%bk(:,:) / kpts%posScale
kpts%posScale = 1.0
IF (kpts%nkpt3(3).EQ.0) kpts%nkpt3(3) = 1
ELSE
IF (banddos%unfoldband) THEN
CALL unfold_band_kpts(banddos,p_cell,cell,p_kpts,kpts)
CALL find_supercell_kpts(banddos,p_cell,cell,p_kpts,kpts)
END IF
END IF
kpts%bk(:,:) = kpts%bk(:,:) / kpts%posScale
kpts%posScale = 1.0
IF (kpts%nkpt3(3).EQ.0) kpts%nkpt3(3) = 1
ELSE
IF (banddos%unfoldband) THEN
CALL unfold_band_kpts(banddos,p_cell,cell,p_kpts,kpts)
CALL find_supercell_kpts(banddos,p_cell,cell,p_kpts,kpts)
END IF
END IF
end subroutine kpoints
end module m_kpoints
......@@ -16,18 +16,19 @@
!Modified for types D.W.
SUBROUTINE kptgen_hybrid(kpts,invs,l_soc,nop,mrot,tau)
SUBROUTINE kptgen_hybrid(input,cell,sym,kpts,l_soc)
USE m_types
USE m_divi
IMPLICIT NONE
TYPE(t_kpts),INTENT(INOUT)::kpts
TYPE(t_input), INTENT(IN) :: input
TYPE(t_cell), INTENT(IN) :: cell
TYPE(t_sym), INTENT(IN) :: sym
TYPE(t_kpts), INTENT(INOUT) :: kpts
! - scalars -
INTEGER, INTENT(IN) :: nop
LOGICAL, INTENT(IN) :: invs
LOGICAL, INTENT(IN) :: l_soc
! - local arrays -
INTEGER, INTENT(IN) :: mrot(3,3,nop)
REAL , INTENT(IN) :: tau(3,nop)
! - local scalars -
INTEGER :: i,j,k,nkpt
INTEGER :: ikpt,ikpt0,nkpti
......@@ -43,6 +44,11 @@
REAL,ALLOCATABLE :: rarr(:)
LOGICAL :: ldum
IF (sum(kpts%nkpt3).EQ.0) THEN
CALL divi(kpts%nkpt,cell%bmat,input%film,sym%nop,
& sym%nop2,kpts%nkpt3)
END IF