Commit 33530c6b authored by Daniel Wortmann's avatar Daniel Wortmann

Merge branch 'develop' into hybrid

Conflicts:
	cdn/cdnval.F90
	cdn_mt/cdnmt.f90
	cmake/Files_and_Targets.txt
	eels/corespec_eval.f90
	eels/corespec_io.f90
	eigen/hsmt_extra.F90
	force/geo.f90
	global/constants.f
	global/types.F90
	init/bandstr1.F
	init/postprocessInput.F90
	inpgen/atom_input.f
	io/r_inpXML.F90
	io/w_inpXML.f90
	main/fleur.F90
	main/fleur_init.F90
	mpi/mpi_bc_all.F90
	tests/CMakeLists.txt
	wannier/CMakeLists.txt
	wannier/abcof_small.F
	wannier/uhu/CMakeLists.txt
	wannier/uhu/d2fdz2.F
	wannier/uhu/d2fdz2cmplx.F
	wannier/uhu/dujdr.F
	wannier/uhu/wann_uHu.F
	wannier/uhu/wann_uHu_dmi.F
	wannier/uhu/wann_uHu_int.F
	wannier/uhu/wann_uHu_od_vac.F
	wannier/uhu/wann_uHu_radintsra.F
	wannier/uhu/wann_uHu_radintsra2.F
	wannier/uhu/wann_uHu_soc.F
	wannier/uhu/wann_uHu_vac.F
	wannier/wann_1dvacabcof.F
	wannier/wann_2dvacabcof.F
	wannier/wann_gwf_commat2.f
	wannier/wann_maxbnd.F
	wannier/wann_mmk0_od_vac.F
	wannier/wann_mmkb_int.F
	wannier/wann_mmkb_od_vac.F
	wannier/wann_optional.f
	wannier/wann_orbmag.F
	wannier/wann_plot.F
	wannier/wann_plot_um_dat.F
	wannier/wann_postproc.F
	wannier/wann_postproc_setup5.F
	wannier/wann_real.F
	wannier/wann_rw_eig.F
	wannier/wann_updown.F
	wannier/wann_wan90prep.f
	wannier/wannier.F
	wannier/wannier_to_lapw.F
parents ffadc8e9 389a3bae
......@@ -329,6 +329,7 @@ CONTAINS
! calculation of core spectra (EELS) initializations -start-
CALL corespec_init(atoms)
IF(l_cs.AND.(mpi%isize.NE.1)) CALL juDFT_error('EELS + MPI not implemented', calledby = 'cdnval')
IF(l_cs.AND.jspin.EQ.1) CALL corespec_gaunt()
! calculation of core spectra (EELS) initializations -end-
......
......@@ -7,7 +7,6 @@ MODULE m_qal21
CONTAINS
SUBROUTINE qal_21(atoms, input,noccbd,we,ccof, noco,acof,bcof,mt21,lo21,uloulopn21, qal,qmat)
USE m_types, ONLY : t_mt21, t_lo21
USE m_rotdenmat
USE m_types
IMPLICIT NONE
......
......@@ -99,11 +99,12 @@ CONTAINS
ENDIF
!$OMP PARALLEL DEFAULT(none) &
!$OMP SHARED(usdus,rho,chmom,clmom,qa21,rho21) &
!$OMP SHARED(usdus,rho,chmom,clmom,qa21,rho21,qmtl) &
!$OMP SHARED(atoms,jsp_start,jsp_end,epar,vr,uu,dd,du,sphhar,uloulopn,ello,aclo,bclo,cclo) &
!$OMP SHARED(acnmt,bcnmt,ccnmt,orb,orbl,orblo,ddnmt,udnmt,dunmt,uunmt,mt21,lo21,uloulop21)&
!$OMP SHARED(uloulopn21,noco,l_fmpl,uunmt21,ddnmt21,dunmt21,udnmt21,jspd)&
!$OMP PRIVATE(itype,na,ispin,l,f,g,nodeu,noded,wronk,i,j,s,qmtllo,qmtt,qmtl,nd,lh,lp,llp,cs)
!$OMP PRIVATE(itype,na,ispin,l,f,g,nodeu,noded,wronk,i,j,s,qmtllo,qmtt,nd,lh,lp,llp,cs)
IF (noco%l_mperp) THEN
ALLOCATE ( f(atoms%jmtd,2,0:atoms%lmaxd,jspd),g(atoms%jmtd,2,0:atoms%lmaxd,jspd) )
ELSE
......
......@@ -9,7 +9,6 @@ MODULE m_rhomt21
CONTAINS
SUBROUTINE rhomt21(atoms, we,ne,acof,bcof, ccof,mt21,lo21,uloulop21)
USE m_types, ONLY : t_mt21,t_lo21
USE m_types
IMPLICIT NONE
TYPE(t_atoms),INTENT(IN) :: atoms
......
......@@ -9,6 +9,9 @@ include("cmake/tests/test_LAPACK.cmake")
include("cmake/tests/test_MPI.cmake")
include("cmake/tests/test_FFTMKL.cmake")
include("cmake/tests/test_HDF5.cmake")
include("cmake/tests/test_Wannier90.cmake")
include("cmake/tests/test_Wannier4.cmake")
include("cmake/tests/test_Wannier5.cmake")
include("cmake/tests/test_MAGMA.cmake")
include("cmake/tests/test_GPU.cmake")
if (FLEUR_USE_MPI)
......
......@@ -10,30 +10,34 @@ endif()
message("${BRed}\n\n************************Summary***************************${CReset}")
message("${Green}Compiler : ${CReset}${CMAKE_Fortran_COMPILER}")
message("${Green}Compiler ID: ${CReset}${CMAKE_Fortran_COMPILER_ID}")
message("${Green}Flags : ${CReset}${CMAKE_Fortran_FLAGS}")
message("${Green}Libraries : ${CReset}${FLEUR_LIBRARIES}")
message("${Green}Compiler : ${CReset} ${CMAKE_Fortran_COMPILER}")
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} HDF5 Library found :${CReset} ${FLEUR_USE_HDF5}")
message("${Green} MAGMA Library found:${CReset} ${FLEUR_USE_MAGMA}")
message("${Green} MPI Library found :${CReset} ${FLEUR_USE_MPI}")
message("${Green} FFT from MKL found : ${CReset} ${FLEUR_USE_FFTMKL}")
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} SCALAPACK Library found : ${CReset} ${FLEUR_USE_SCALAPACK}")
message("${Green} ELPA Library found : ${CReset} ${FLEUR_USE_ELPA}")
else()
message("${Green} SCALAPACK Library found:${CReset} ---")
message("${Green} ELPA Library found :${CReset} ---")
message("${Green} SCALAPACK Library found : ${CReset} ---")
message("${Green} ELPA Library found : ${CReset} ---")
endif()
message("${Green} Compile GPU version: ${CReset} ${FLEUR_USE_GPU}")
message("\n${Green}Compile serial version : ${CReset}${FLEUR_USE_SERIAL}")
message("${Green}Compile parallel version: ${CReset}${FLEUR_USE_MPI}")
message("\n${Green}Git describe : ${CReset}${git_describe}")
message("${Green} Compile GPU version : ${CReset} ${FLEUR_USE_GPU}")
message("\n")
message("${Green}Compile serial version : ${CReset} ${FLEUR_USE_SERIAL}")
message("${Green}Compile parallel version : ${CReset} ${FLEUR_USE_MPI}")
message("\n")
message("${Green}Git describe : ${CReset}${git_describe}")
message("${Green}Git hash : ${CReset}${git_hash}")
message("${Green}Doxygen found : ${CReset}${FLEUR_USE_DOXYGEN}")
message("${BRed}************************-------***************************${CReset}")
......
#first try if Wannier90 modification 4 already works
try_compile(FLEUR_USE_WANN4 ${CMAKE_BINARY_DIR} ${CMAKE_SOURCE_DIR}/cmake/tests/test_Wannier4.f90
LINK_LIBRARIES ${FLEUR_LIBRARIES}
)
message("Wannier90-4 1.2 Library found:${FLEUR_USE_WANN4}")
if (FLEUR_USE_WANN4)
set(FLEUR_DEFINITIONS ${FLEUR_DEFINITIONS} "CPP_WANN4")
set(FLEUR_MPI_DEFINITIONS ${FLEUR_MPI_DEFINITIONS} "CPP_WANN4")
endif()
PROGRAM test
IMPLICIT NONE
integer :: nkpts
real :: kpoints(4,1)
real :: amat(4,4)
real :: bmat(4,4)
integer :: num(4)
integer :: num_bands
integer :: ntype
character(len=50) :: seedname
integer :: num_atoms
character(len=2) :: atom_symbols(1)
logical :: gamma_only
logical :: spinors
integer :: nntot
integer :: nnlist(1,1)
integer :: nncell(4,1,1)
integer :: num_bands2
integer :: num_wann2
real :: proj_site(3,1)
integer :: proj_l(1)
integer :: proj_m(1)
integer :: proj_radial(1)
real :: proj_z(3,1)
real :: proj_x(3,1)
real :: proj_zona(1)
integer :: exclude_bands(1)
real :: pos(4,1)
! Taken from wannier90-1.2/src/wannier_lib.F90
interface
subroutine wannier_setup4(seed__name, mp_grid_loc, num_kpts_loc,&
real_lattice_loc, recip_lattice_loc, kpt_latt_loc,&
num_bands_tot, num_atoms_loc, atom_symbols_loc,&
atoms_cart_loc, gamma_only_loc, spinors_loc, nntot_loc,&
nnlist_loc, nncell_loc, num_bands_loc, num_wann_loc,&
proj_site_loc, proj_l_loc, proj_m_loc, proj_radial_loc,&
proj_z_loc, proj_x_loc, proj_zona_loc, exclude_bands_loc)
implicit none
integer, parameter :: dp = selected_real_kind(15,300)
integer, parameter :: num_nnmax=14
character(len=*), intent(in) :: seed__name
integer, dimension(4), intent(in) :: mp_grid_loc
integer, intent(in) :: num_kpts_loc
real(kind=dp), dimension(4,4), intent(in) :: real_lattice_loc
real(kind=dp), dimension(4,4), intent(in) :: recip_lattice_loc
real(kind=dp), dimension(4,num_kpts_loc), intent(in) :: kpt_latt_loc
integer, intent(in) :: num_bands_tot
integer, intent(in) :: num_atoms_loc
character(len=*), dimension(num_atoms_loc), intent(in) :: atom_symbols_loc
real(kind=dp), dimension(4,num_atoms_loc), intent(in) :: atoms_cart_loc
logical, intent(in) :: gamma_only_loc
logical, intent(in) :: spinors_loc
integer, intent(out) :: nntot_loc
integer, dimension(num_kpts_loc,num_nnmax), intent(out) :: nnlist_loc
integer,dimension(4,num_kpts_loc,num_nnmax), intent(out) :: nncell_loc
integer, intent(out) :: num_bands_loc
integer, intent(out) :: num_wann_loc
real(kind=dp), dimension(3,num_bands_tot), intent(out) :: proj_site_loc
integer, dimension(num_bands_tot), intent(out) :: proj_l_loc
integer, dimension(num_bands_tot), intent(out) :: proj_m_loc
integer, dimension(num_bands_tot), intent(out) :: proj_radial_loc
real(kind=dp), dimension(3,num_bands_tot), intent(out) :: proj_z_loc
real(kind=dp), dimension(3,num_bands_tot), intent(out) :: proj_x_loc
real(kind=dp), dimension(num_bands_tot), intent(out) :: proj_zona_loc
integer, dimension(num_bands_tot), intent(out) :: exclude_bands_loc
end subroutine wannier_setup4
end interface
seedname='blahblahblah'
num = 0
nkpts = 1
amat = 0.0
bmat = 0.0
kpoints = 0.0
num_bands = 0
num_atoms = 0
atom_symbols = ':)'
pos = 0.0
gamma_only = .FALSE.
spinors = .FALSE.
nntot = 0
nnlist = 0
nncell = 0
num_bands2 = 0
num_wann2 = 0
proj_site = 0.0
proj_l = 0
proj_m = 0
proj_radial = 0
proj_z = 0.0
proj_x = 0.0
proj_zona = 0.0
exclude_bands = 0
CALL wannier_setup4(seedname,num,&
nkpts,&
transpose(amat),bmat,&
kpoints,num_bands,&
num_atoms,atom_symbols,pos,&
gamma_only,spinors,&
nntot,nnlist,nncell,num_bands2,&
num_wann2,&
proj_site,proj_l,proj_m,&
proj_radial,proj_z,&
proj_x,proj_zona,exclude_bands)
END
#first try if Wannier90 modification 5 already works
try_compile(FLEUR_USE_WANN5 ${CMAKE_BINARY_DIR} ${CMAKE_SOURCE_DIR}/cmake/tests/test_Wannier5.f90
LINK_LIBRARIES ${FLEUR_LIBRARIES}
)
message("Wannier90-5 1.2 Library found:${FLEUR_USE_WANN5}")
if (FLEUR_USE_WANN5)
set(FLEUR_DEFINITIONS ${FLEUR_DEFINITIONS} "CPP_WANN5")
set(FLEUR_MPI_DEFINITIONS ${FLEUR_MPI_DEFINITIONS} "CPP_WANN5")
endif()
PROGRAM test
IMPLICIT NONE
integer :: nkpts
real :: kpoints(5,1)
real :: amat(5,5)
real :: bmat(5,5)
integer :: num(5)
integer :: num_bands
integer :: ntype
character(len=50) :: seedname
integer :: num_atoms
character(len=2) :: atom_symbols(1)
logical :: gamma_only
logical :: spinors
integer :: nntot
integer :: nnlist(1,1)
integer :: nncell(5,1,1)
integer :: num_bands2
integer :: num_wann2
real :: proj_site(3,1)
integer :: proj_l(1)
integer :: proj_m(1)
integer :: proj_radial(1)
real :: proj_z(3,1)
real :: proj_x(3,1)
real :: proj_zona(1)
integer :: exclude_bands(1)
real :: pos(5,1)
! Taken from wannier90-1.2/src/wannier_lib.F90
interface
subroutine wannier_setup5(seed__name, mp_grid_loc, num_kpts_loc,&
real_lattice_loc, recip_lattice_loc, kpt_latt_loc,&
num_bands_tot, num_atoms_loc, atom_symbols_loc,&
atoms_cart_loc, gamma_only_loc, spinors_loc, nntot_loc,&
nnlist_loc, nncell_loc, num_bands_loc, num_wann_loc,&
proj_site_loc, proj_l_loc, proj_m_loc, proj_radial_loc,&
proj_z_loc, proj_x_loc, proj_zona_loc, exclude_bands_loc)
implicit none
integer, parameter :: dp = selected_real_kind(15,300)
integer, parameter :: num_nnmax=14
character(len=*), intent(in) :: seed__name
integer, dimension(5), intent(in) :: mp_grid_loc
integer, intent(in) :: num_kpts_loc
real(kind=dp), dimension(5,5), intent(in) :: real_lattice_loc
real(kind=dp), dimension(5,5), intent(in) :: recip_lattice_loc
real(kind=dp), dimension(5,num_kpts_loc), intent(in) :: kpt_latt_loc
integer, intent(in) :: num_bands_tot
integer, intent(in) :: num_atoms_loc
character(len=*), dimension(num_atoms_loc), intent(in) :: atom_symbols_loc
real(kind=dp), dimension(5,num_atoms_loc), intent(in) :: atoms_cart_loc
logical, intent(in) :: gamma_only_loc
logical, intent(in) :: spinors_loc
integer, intent(out) :: nntot_loc
integer, dimension(num_kpts_loc,num_nnmax), intent(out) :: nnlist_loc
integer,dimension(5,num_kpts_loc,num_nnmax), intent(out) :: nncell_loc
integer, intent(out) :: num_bands_loc
integer, intent(out) :: num_wann_loc
real(kind=dp), dimension(3,num_bands_tot), intent(out) :: proj_site_loc
integer, dimension(num_bands_tot), intent(out) :: proj_l_loc
integer, dimension(num_bands_tot), intent(out) :: proj_m_loc
integer, dimension(num_bands_tot), intent(out) :: proj_radial_loc
real(kind=dp), dimension(3,num_bands_tot), intent(out) :: proj_z_loc
real(kind=dp), dimension(3,num_bands_tot), intent(out) :: proj_x_loc
real(kind=dp), dimension(num_bands_tot), intent(out) :: proj_zona_loc
integer, dimension(num_bands_tot), intent(out) :: exclude_bands_loc
end subroutine wannier_setup5
end interface
seedname='blahblahblah'
num = 0
nkpts = 1
amat = 0.0
bmat = 0.0
kpoints = 0.0
num_bands = 0
num_atoms = 0
atom_symbols = ':)'
pos = 0.0
gamma_only = .FALSE.
spinors = .FALSE.
nntot = 0
nnlist = 0
nncell = 0
num_bands2 = 0
num_wann2 = 0
proj_site = 0.0
proj_l = 0
proj_m = 0
proj_radial = 0
proj_z = 0.0
proj_x = 0.0
proj_zona = 0.0
exclude_bands = 0
CALL wannier_setup5(seedname,num,&
nkpts,&
transpose(amat),bmat,&
kpoints,num_bands,&
num_atoms,atom_symbols,pos,&
gamma_only,spinors,&
nntot,nnlist,nncell,num_bands2,&
num_wann2,&
proj_site,proj_l,proj_m,&
proj_radial,proj_z,&
proj_x,proj_zona,exclude_bands)
END
#first try if Wannier90 already works
try_compile(FLEUR_USE_WANN ${CMAKE_BINARY_DIR} ${CMAKE_SOURCE_DIR}/cmake/tests/test_Wannier90.f90
LINK_LIBRARIES ${FLEUR_LIBRARIES}
)
message("Wannier90 1.2 Library found:${FLEUR_USE_WANN}")
if (FLEUR_USE_WANN)
set(FLEUR_DEFINITIONS ${FLEUR_DEFINITIONS} "CPP_WANN")
set(FLEUR_MPI_DEFINITIONS ${FLEUR_MPI_DEFINITIONS} "CPP_WANN")
endif()
PROGRAM test
IMPLICIT NONE
integer :: nkpts
real :: kpoints(3,1)
real :: amat(3,3)
real :: bmat(3,3)
integer :: num(3)
integer :: num_bands
integer :: ntype
character(len=50) :: seedname
integer :: num_atoms
character(len=2) :: atom_symbols(1)
logical :: gamma_only
logical :: spinors
integer :: nntot
integer :: nnlist(1,1)
integer :: nncell(3,1,1)
integer :: num_bands2
integer :: num_wann2
real :: proj_site(3,1)
integer :: proj_l(1)
integer :: proj_m(1)
integer :: proj_radial(1)
real :: proj_z(3,1)
real :: proj_x(3,1)
real :: proj_zona(1)
integer :: exclude_bands(1)
real :: pos(3,1)
! Taken from wannier90-1.2/src/wannier_lib.F90
interface
subroutine wannier_setup(seed__name, mp_grid_loc, num_kpts_loc,&
real_lattice_loc, recip_lattice_loc, kpt_latt_loc,&
num_bands_tot, num_atoms_loc, atom_symbols_loc,&
atoms_cart_loc, gamma_only_loc, spinors_loc, nntot_loc,&
nnlist_loc, nncell_loc, num_bands_loc, num_wann_loc,&
proj_site_loc, proj_l_loc, proj_m_loc, proj_radial_loc,&
proj_z_loc, proj_x_loc, proj_zona_loc, exclude_bands_loc)
implicit none
integer, parameter :: dp = selected_real_kind(15,300)
integer, parameter :: num_nnmax=12
character(len=*), intent(in) :: seed__name
integer, dimension(3), intent(in) :: mp_grid_loc
integer, intent(in) :: num_kpts_loc
real(kind=dp), dimension(3,3), intent(in) :: real_lattice_loc
real(kind=dp), dimension(3,3), intent(in) :: recip_lattice_loc
real(kind=dp), dimension(3,num_kpts_loc), intent(in) :: kpt_latt_loc
integer, intent(in) :: num_bands_tot
integer, intent(in) :: num_atoms_loc
character(len=*), dimension(num_atoms_loc), intent(in) :: atom_symbols_loc
real(kind=dp), dimension(3,num_atoms_loc), intent(in) :: atoms_cart_loc
logical, intent(in) :: gamma_only_loc
logical, intent(in) :: spinors_loc
integer, intent(out) :: nntot_loc
integer, dimension(num_kpts_loc,num_nnmax), intent(out) :: nnlist_loc
integer,dimension(3,num_kpts_loc,num_nnmax), intent(out) :: nncell_loc
integer, intent(out) :: num_bands_loc
integer, intent(out) :: num_wann_loc
real(kind=dp), dimension(3,num_bands_tot), intent(out) :: proj_site_loc
integer, dimension(num_bands_tot), intent(out) :: proj_l_loc
integer, dimension(num_bands_tot), intent(out) :: proj_m_loc
integer, dimension(num_bands_tot), intent(out) :: proj_radial_loc
real(kind=dp), dimension(3,num_bands_tot), intent(out) :: proj_z_loc
real(kind=dp), dimension(3,num_bands_tot), intent(out) :: proj_x_loc
real(kind=dp), dimension(num_bands_tot), intent(out) :: proj_zona_loc
integer, dimension(num_bands_tot), intent(out) :: exclude_bands_loc
end subroutine wannier_setup
end interface
seedname='blahblahblah'
num = 0
nkpts = 1
amat = 0.0
bmat = 0.0
kpoints = 0.0
num_bands = 0
num_atoms = 0
atom_symbols = ':)'
pos = 0.0
gamma_only = .FALSE.
spinors = .FALSE.
nntot = 0
nnlist = 0
nncell = 0
num_bands2 = 0
num_wann2 = 0
proj_site = 0.0
proj_l = 0
proj_m = 0
proj_radial = 0
proj_z = 0.0
proj_x = 0.0
proj_zona = 0.0
exclude_bands = 0
CALL wannier_setup(seedname,num,&
nkpts,&
transpose(amat),bmat,&
kpoints,num_bands,&
num_atoms,atom_symbols,pos,&
gamma_only,spinors,&
nntot,nnlist,nncell,num_bands2,&
num_wann2,&
proj_site,proj_l,proj_m,&
proj_radial,proj_z,&
proj_x,proj_zona,exclude_bands)
END
......@@ -578,24 +578,24 @@ MODULE m_corespec_eval
do id1 = 1,2 ;
do id2 = 1,2
prd(ip1,ip2) = prd(ip1,ip2)+ &
csv%rmeA(id1,l1,la1,iljc,ic,iqv,ie)*csv%rmeA(id1,l1,la1,iljc,ic,iqv,ie)*csv%dose(id1,id2,lm1,lm2,ie)
prd(ip1,ip2) = prd(ip1,ip2)+ &
csv%rmeA(id1,l1,la1,iljc,ic,iqv,ie)*csv%rmeB(id1,l1,la1,iljc,ic,iqv,ie)*csv%dose(id1,id2,lm1,lm2,ie)
prd(ip1,ip2) = prd(ip1,ip2)+ &
csv%rmeA(id1,l1,la1,iljc,ic,iqv,ie)*csv%rmeC(id1,l1,la1,iljc,ic,iqv,ie)*csv%dose(id1,id2,lm1,lm2,ie)
prd(ip1,ip2) = prd(ip1,ip2)+ &
csv%rmeB(id1,l1,la1,iljc,ic,iqv,ie)*csv%rmeA(id1,l1,la1,iljc,ic,iqv,ie)*csv%dose(id1,id2,lm1,lm2,ie)
prd(ip1,ip2) = prd(ip1,ip2)+ &
csv%rmeB(id1,l1,la1,iljc,ic,iqv,ie)*csv%rmeB(id1,l1,la1,iljc,ic,iqv,ie)*csv%dose(id1,id2,lm1,lm2,ie)
prd(ip1,ip2) = prd(ip1,ip2)+ &
csv%rmeB(id1,l1,la1,iljc,ic,iqv,ie)*csv%rmeC(id1,l1,la1,iljc,ic,iqv,ie)*csv%dose(id1,id2,lm1,lm2,ie)
prd(ip1,ip2) = prd(ip1,ip2)+ &
csv%rmeC(id1,l1,la1,iljc,ic,iqv,ie)*csv%rmeA(id1,l1,la1,iljc,ic,iqv,ie)*csv%dose(id1,id2,lm1,lm2,ie)
prd(ip1,ip2) = prd(ip1,ip2)+ &
csv%rmeC(id1,l1,la1,iljc,ic,iqv,ie)*csv%rmeB(id1,l1,la1,iljc,ic,iqv,ie)*csv%dose(id1,id2,lm1,lm2,ie)
prd(ip1,ip2) = prd(ip1,ip2)+ &
csv%rmeC(id1,l1,la1,iljc,ic,iqv,ie)*csv%rmeC(id1,l1,la1,iljc,ic,iqv,ie)*csv%dose(id1,id2,lm1,lm2,ie)
prd(0,0) = prd(0,0)+ &
csv%rmeA(id1,l1,la1,iljc,ic,iqv,ie)*csv%rmeA(id2,l2,la2,iljc,ic,iqv,ie)*csv%dose(id1,id2,lm1,lm2,ie)
prd(0,1) = prd(0,1)+ &
csv%rmeA(id1,l1,la1,iljc,ic,iqv,ie)*csv%rmeB(id2,l2,la2,iljc,ic,iqv,ie)*csv%dose(id1,id2,lm1,lm2,ie)
prd(0,2) = prd(0,2)+ &
csv%rmeA(id1,l1,la1,iljc,ic,iqv,ie)*csv%rmeC(id2,l2,la2,iljc,ic,iqv,ie)*csv%dose(id1,id2,lm1,lm2,ie)
prd(1,0) = prd(1,0)+ &
csv%rmeB(id1,l1,la1,iljc,ic,iqv,ie)*csv%rmeA(id2,l2,la2,iljc,ic,iqv,ie)*csv%dose(id1,id2,lm1,lm2,ie)
prd(1,1) = prd(1,1)+ &
csv%rmeB(id1,l1,la1,iljc,ic,iqv,ie)*csv%rmeB(id2,l2,la2,iljc,ic,iqv,ie)*csv%dose(id1,id2,lm1,lm2,ie)
prd(1,2) = prd(1,2)+ &
csv%rmeB(id1,l1,la1,iljc,ic,iqv,ie)*csv%rmeC(id2,l2,la2,iljc,ic,iqv,ie)*csv%dose(id1,id2,lm1,lm2,ie)
prd(2,0) = prd(2,0)+ &
csv%rmeC(id1,l1,la1,iljc,ic,iqv,ie)*csv%rmeA(id2,l2,la2,iljc,ic,iqv,ie)*csv%dose(id1,id2,lm1,lm2,ie)
prd(2,1) = prd(2,1)+ &
csv%rmeC(id1,l1,la1,iljc,ic,iqv,ie)*csv%rmeB(id2,l2,la2,iljc,ic,iqv,ie)*csv%dose(id1,id2,lm1,lm2,ie)
prd(2,2) = prd(2,2)+ &
csv%rmeC(id1,l1,la1,iljc,ic,iqv,ie)*csv%rmeC(id2,l2,la2,iljc,ic,iqv,ie)*csv%dose(id1,id2,lm1,lm2,ie)
enddo
enddo
......
......@@ -61,7 +61,12 @@ MODULE m_corespec_io
write(*,'(/,a)') trim(smeno)//ssep
IF(ANY(atoms%nlo(:).NE.0)) CALL juDFT_error("EELS + LOs not available at the moment!" ,calledby ="corespec_io")
IF(ANY(atoms%nlo(:).NE.0)) THEN
WRITE(*,*) 'PLEASE NOTE:'
WRITE(*,*) 'EELS + LOs is only for experienced users.'
WRITE(*,*) 'I hope you know what you are doing.'
! CALL juDFT_error("EELS + LOs not available at the moment!" ,calledby ="corespec_io")
END IF
! sanity check of the input parameters; if they are not correct, program stops
! unit conversion if necessary
......
......@@ -204,7 +204,7 @@ CONTAINS
ENDIF
ENDIF
IF (matsize<2) CALL judft_error("Wrong size of matrix",calledby="eigen",hint="Your basis might be too large or the parallelization fail or ??")
ne = MAX(5,DIMENSION%neigd)
ne = DIMENSION%neigd
eig_id=open_eig(&
mpi%mpi_comm,DIMENSION%nbasfcn,DIMENSION%neigd,kpts%nkpt,DIMENSION%jspd,atoms%lmaxd,&
......
......@@ -37,8 +37,10 @@ C .. Array Arguments ..
REAL, INTENT (INOUT) :: we(:) !(nkptd*neigd*jspd)
C ..
C .. Local Scalars ..
REAL dff,expo,sdff,sff
REAL dff,expo,sdff,sff,efmin,efmax
INTEGER icnt,idim,rec_level
LOGICAL efminok,efmaxok
C ..
C .. Local Arrays ..
REAL ff(size(e))
......@@ -77,20 +79,25 @@ c***********************************************************************
ENDIF
c
c ---> NEWTON CYCLE
c
c
efminok= .false.
efmaxok= .false.
DO icnt = 1,50
sff = 0.0
sdff = 0.0
DO idim = inkem + 1,nocst
c
c ---> COMPUTE FERMI-FUNCTION
c
expo = exp((e(index(idim))-ef)/tkb)
ff(idim) = 1.0/ (expo+1.0)
c
c ---> COMPUTE THE DERIVATIVE
c
dff = ff(idim)*ff(idim)*expo/tkb
c ---> COMPUTE FERMI-FUNCTION ff AND THE DERIVATIVE dff
c
expo= -ABS(e(index(idim))-ef)/tkb
expo= EXP(expo)
IF (e(index(idim))<ef) THEN
ff(idim) = 1./ (expo+1.)
ELSE
ff(idim)= expo/ (expo+1.)
ENDIF
dff= (1.+expo)**2
dff= expo/(dff*tkb)
c
c ---> MULTIPLY WITH THE WEIGHT
c
......@@ -134,8 +141,20 @@ c
X w_near_ef,ef,we,rec_level)
RETURN
ENDIF
IF (sff > 0.) THEN
efmax= ef
efmaxok= .true.
ELSE
efmin= ef
efminok= .true.
ENDIF
ef = ef - sff/sdff
! if the Newton method is not stable, nested intervals are used
IF ( efminok .and. efmaxok ) THEN
IF ( (ef<efmin) .or. (ef>efmax) ) THEN
ef= (efmin+efmax)/2.
ENDIF
ENDIF
END DO
c
c--- > NOT CONVERGED AFTER 50 ITERATIONS
......
......@@ -85,6 +85,7 @@ CONTAINS