Commit 3b17ac0e authored by Matthias Redies's avatar Matthias Redies

Merge branch 'develop_with_output' into TranBlaha

parents 5ef716dd 7aa13587
......@@ -7,3 +7,6 @@
[submodule "docs/katacoda-tutorials"]
path = docs/katacoda-tutorials
url = gitlab@iffgit.fz-juelich.de:fleur/katacoda-tutorials.git
[submodule "external/wannier90"]
path = external/wannier90
url = https://github.com/wannier-developers/wannier90.git
......@@ -74,6 +74,54 @@ CONTAINS
END DO ! loop over spins
END SUBROUTINE integrate_cdn
SUBROUTINE integrate_realspace(xcpot, atoms, sym, sphhar, input, &
stars, cell, oneD, vacuum, noco, mt, is, hint)
use m_types
use m_mt_tofrom_grid
use m_pw_tofrom_grid
use m_constants
implicit none
CLASS(t_xcpot), INTENT(inout) :: xcpot
TYPE(t_atoms),INTENT(IN) :: atoms
TYPE(t_sym), INTENT(in) :: sym
TYPE(t_sphhar), INTENT(IN) :: sphhar
TYPE(t_input), INTENT(IN) :: input
TYPE(t_stars), INTENT(IN) :: stars
TYPE(t_cell), INTENT(IN) :: cell
TYPE(t_oneD), INTENT(in) :: oneD
TYPE(t_vacuum), INTENT(in) :: vacuum
TYPE(t_noco), INTENT(in) :: noco
real, intent(inout) :: mt(:,:,:), is(:,:)
character(len=*), intent(in), optional :: hint
integer :: n_atm, i
TYPE(t_potden) :: tmp_potden
REAL :: q(input%jspins), qis(input%jspins), &
qmt(atoms%ntype,input%jspins), qvac(2,input%jspins),&
qtot, qistot
call tmp_potden%init(stars, atoms, sphhar, vacuum, noco, input%jspins, POTDEN_TYPE_DEN)
call init_mt_grid(input%jspins, atoms, sphhar, xcpot, sym)
do n_atm =1,atoms%ntype
call mt_from_grid(atoms, sphhar, n_atm, input%jspins, mt(:,:,n_atm), &
tmp_potden%mt(:,0:,n_atm,:))
do i=1,atoms%jri(n_atm)
tmp_potden%mt(i,:,n_atm,:) = tmp_potden%mt(i,:,n_atm,:) * atoms%rmsh(i,n_atm)**2
enddo
enddo
call finish_mt_grid()
call init_pw_grid(xcpot, stars, sym, cell)
call pw_from_grid(xcpot, stars, .False., is, tmp_potden%pw)
call finish_pw_grid()
call integrate_cdn(stars,atoms,sym,vacuum,input,cell,oneD, tmp_potden, &
q, qis, qmt, qvac, qtot, qistot)
call print_cdn_inte(q, qis, qmt, qvac, qtot, qistot, hint)
END SUBROUTINE integrate_realspace
SUBROUTINE cdntot(stars,atoms,sym,vacuum,input,cell,oneD,&
den,l_printData,qtot,qistot)
......@@ -154,4 +202,28 @@ CONTAINS
CALL timestop("cdntot")
END SUBROUTINE cdntot
SUBROUTINE print_cdn_inte(q, qis, qmt, qvac, qtot, qistot, hint)
use ieee_arithmetic
implicit none
REAL, INTENT(in) :: q(:), qis(:), qmt(:,:), qvac(:,:), qtot, qistot
character(len=*), intent(in), optional :: hint
integer :: n_mt
if(present(hint)) write (*,*) "DEN of ", hint
write (*,*) "q = ", q
write (*,*) "qis = ", qis
write (*,*) "qmt"
do n_mt = 1,size(qmt, dim=1)
write (*,*) "mt = ", n_mt, qmt(n_mt,:)
enddo
if(.not. any(ieee_is_nan(qvac))) then
write (*, *) "qvac", qvac
endif
write (*, *) "qtot", qtot
write (*, *) "qis_tot", qistot
END SUBROUTINE print_cdn_inte
END MODULE m_cdntot
......@@ -244,12 +244,11 @@ SUBROUTINE cdnval(eig_id, mpi,kpts,jspin,noco,input,banddos,cell,atoms,enpara,st
IF (l_dosNdir) THEN
IF (PRESENT(slab)) CALL q_mt_sl(ispin,atoms,noccbd,ikpt,noccbd,skip_t,noccbd,eigVecCoeffs,usdus,slab)
INQUIRE (file='orbcomprot',exist=l_orbcomprot)
IF (l_orbcomprot) CALL abcrot2(atoms,noccbd,eigVecCoeffs,ispin) ! rotate ab-coeffs
IF (PRESENT(orbcomp)) CALL orb_comp(ispin,ikpt,noccbd,atoms,noccbd,usdus,eigVecCoeffs,orbcomp)
END IF
IF (banddos%l_orb.AND.ANY((/banddos%alpha,banddos%beta,banddos%gamma/).NE.0.0)) THEN
CALL abcrot2(atoms,banddos,noccbd,eigVecCoeffs,ispin) ! rotate ab-coeffs
IF (PRESENT(orbcomp)) CALL orb_comp(ispin,ikpt,noccbd,atoms,noccbd,usdus,eigVecCoeffs,orbcomp)
END IF
ENDIF
CALL calcDenCoeffs(atoms,sphhar,sym,we,noccbd,eigVecCoeffs,ispin,denCoeffs)
IF (noco%l_soc) CALL orbmom(atoms,noccbd,we,ispin,eigVecCoeffs,orb)
......
......@@ -8,12 +8,13 @@ MODULE m_abcrot2
PRIVATE
PUBLIC :: abcrot2
CONTAINS
SUBROUTINE abcrot2(atoms,neig,eigVecCoeffs,jsp)
SUBROUTINE abcrot2(atoms,banddos,neig,eigVecCoeffs,jsp)
USE m_dwigner
USE m_types
IMPLICIT NONE
TYPE(t_atoms),INTENT(IN) :: atoms
TYPE(t_banddos),INTENT(IN) :: banddos
TYPE(t_eigVecCoeffs),INTENT(INOUT) :: eigVecCoeffs
! ..
! .. Scalar Arguments ..
......@@ -21,17 +22,11 @@ CONTAINS
! ..
! .. Local Scalars ..
INTEGER itype,ineq,iatom,iop,ilo,i,l ,lm,lmp,ifac
REAL beta,alpha,gamma
REAL amx(3,3,1),imx(3,3)
COMPLEX d_wgn(-atoms%lmaxd:atoms%lmaxd,-atoms%lmaxd:atoms%lmaxd,1:atoms%lmaxd,1)
OPEN (333,file='orbcomprot')
READ (333,*) alpha
READ (333,*) beta
READ (333,*) gamma
CLOSE (333)
CALL euler(alpha,beta,gamma, amx)
CALL euler(banddos%alpha,banddos%beta,banddos%gamma, amx)
imx(:,:) = 0. ; imx(1,1) = 1. ; imx(2,2) = 1. ; imx(3,3) = 1.
......
......@@ -10,8 +10,8 @@ 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_Wannier4.cmake")
#include("cmake/tests/test_Wannier5.cmake")
include("cmake/tests/test_GPU.cmake")
include("cmake/tests/test_MAGMA.cmake")
include("cmake/tests/test_LibXC.cmake")
......
......@@ -17,7 +17,7 @@ foreach(ADD_String "-lhdf5_fortran;-lhdf5"
LINK_LIBRARIES ${TEST_LIBRARIES}
)
if (FLEUR_USE_HDF5)
set(FLEUR_LIBRARIES ${TEST_LIBRARIES})
set(FLEUR_HDF5_LIBRARIES ${TEST_LIBRARIES})
endif()
endif()
endforeach()
......@@ -25,7 +25,7 @@ endforeach()
#check if HDF is parallel
if ( FLEUR_USE_HDF5)
try_compile(FLEUR_USE_HDF5MPI ${CMAKE_BINARY_DIR} ${CMAKE_SOURCE_DIR}/cmake/tests/test_HDF5MPI.f90
LINK_LIBRARIES ${FLEUR_LIBRARIES}
LINK_LIBRARIES ${FLEUR_HDF5_LIBRARIES}
)
endif()
......@@ -62,7 +62,7 @@ if (DEFINED CLI_FLEUR_USE_HDF5)
add_subdirectory (external/hdf5-git EXCLUDE_FROM_ALL)
set(FLEUR_USE_HDF5 TRUE)
set(FLEUR_USE_HDF5MPI FLEUR_USE_MPI)
set(FLEUR_COMPILE_HDF true)
set(FLEUR_COMPILE_HDF5 true)
include_directories("${CMAKE_CURRENT_BINARY_DIR}/modules/external")
include_directories("${CMAKE_CURRENT_BINARY_DIR}/modules/external/static")
endif()
......
......@@ -8,7 +8,17 @@ message("Wannier90 1.2 Library found:${FLEUR_USE_WANN}")
if (DEFINED CLI_FLEUR_USE_WANNIER)
if (${CLI_FLEUR_USE_WANNIER})
if (NOT FLEUR_USE_WANN)
message(FATAL_ERROR "You asked for Wannier90 but cmake couldn't find it. Please check your Fortran compiler settings")
message("You asked for Wannier90 but cmake couldn't find it. We will download the gitlab sources and use it during compilation")
set(FLEUR_USE_WANN TRUE)
if(NOT EXISTS "${PROJECT_SOURCE_DIR}/external/wannier90/src" )
find_package(Git REQUIRED)
execute_process(COMMAND ${GIT_EXECUTABLE} submodule init external/wannier90 WORKING_DIRECTORY ${PROJECT_SOURCE_DIR} RESULT_VARIABLE _res_init OUTPUT_QUIET ERROR_QUIET)
execute_process(COMMAND ${GIT_EXECUTABLE} submodule update WORKING_DIRECTORY ${PROJECT_SOURCE_DIR} RESULT_VARIABLE _res_update OUTPUT_QUIET ERROR_QUIET)
if( ${_res_init} GREATER 0 OR ${_res_update} GREATER 0 )
message(FATAL_ERROR "Wannier90 source could not be downloaded.\n"
"We tried: 'git submodule init external/wannier90 && git submodule update' and resulted in error" )
endif()
endif()
endif()
else()
if (FLEUR_USE_WANN)
......
......@@ -8,12 +8,18 @@ if(NOT EXISTS "${PROJECT_SOURCE_DIR}/juDFT/CMakeLists.txt" )
endif()
endif()
set(JUDFT_USE_MPI ${FLEUR_USE_MPI} CACHE BOOL "Compile with MPI, will also work in serial")
set(JUDFT_USE_HDF5 ${FLEUR_USE_HDF5} CACHE BOOL "Compile with HDF5")
if (DEFINED FLEUR_COMPILE_HDF)
set(JUDFT_COMPILE_HDF ON CACHE BOOL "The HDF5 is compiled as submodule")
endif()
if (DEFINED FLEUR_USE_HDF5MPI)
set(JUDFT_USE_HDF5MPI FLEUR_USE_HDF5MPI CACHE BOOL "Is the HDF5 version able to do parallel IO" )
if (DEFINED FLEUR_USE_HDF5)
set(JUDFT_USE_HDF5 ${FLEUR_USE_HDF5} CACHE BOOL "Compile with HDF5")
if (DEFINED FLEUR_COMPILE_HDF5)
set(JUDFT_COMPILE_HDF5 ON CACHE BOOL "The HDF5 is compiled as submodule")
endif()
if (DEFINED FLEUR_USE_HDF5MPI)
set(JUDFT_USE_HDF5MPI FLEUR_USE_HDF5MPI CACHE BOOL "Is the HDF5 version able to do parallel IO" )
endif()
if (DEFINED FLEUR_HDF5_LIBRARIES)
message("SET:${FLEUR_HDF5_LIBRARIES}")
set(JUDFT_LIBRARIES ${FLEUR_HDF5_LIBRARIES} CACHE STRING "Libraries for linking with HDF5")
endif()
endif()
#In addition you might want to set
set(JUDFT_COMPILEOPTS ${FLEUR_PRECISION_OPTION})
......
......@@ -85,6 +85,7 @@ CONTAINS
ALLOCATE(soangl(atoms%lmaxd,-atoms%lmaxd:atoms%lmaxd,2,&
atoms%lmaxd,-atoms%lmaxd:atoms%lmaxd,2,SIZE(theta)))
soangl=0.0
DO nr=1,SIZE(theta)
CALL spnorb_angles(atoms,mpi,theta(nr),phi(nr),soangl(:,:,:,:,:,:,nr))
ENDDO
......@@ -407,7 +408,7 @@ CONTAINS
ELSE
bandf= 1
ENDIF
IF (ABS(AIMAG(matel(bandf,band2,n)))>1.e-8) THEN
IF (ABS(AIMAG(matel(bandf,band2,n)))>1.e-12) THEN
PRINT *,bandf,band2,n,AIMAG(matel(bandf,band2,n))
CALL judft_error('Stop in ssomatel: diagonal matrix element not real')
ENDIF
......
#
# Copyright by The HDF Group.
# All rights reserved.
#
# This file is part of HDF5. The full HDF5 copyright notice, including
# terms governing use, modification, and redistribution, is contained in
# the COPYING file, which can be found at the root of the source code
# distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases.
# If you do not have access to either file, you may request a copy from
# help@hdfgroup.org.
#
#############################################################################################
#### Change default configuration of options in config/cmake/cacheinit.cmake file ###
#### format: set(ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DXXX:YY=ZZZZ") ###
#############################################################################################
### uncomment/comment and change the following lines for other configuration options
#############################################################################################
#### alternate toolsets ####
#set(CMAKE_GENERATOR_TOOLSET "Intel C++ Compiler 17.0")
#############################################################################################
#### Only build static libraries ####
set (ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DBUILD_SHARED_LIBS:BOOL=OFF")
#### Add PICC option on linux/mac ####
#set (ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DCMAKE_ANSI_CFLAGS:STRING=-fPIC")
#############################################################################################
#### fortran enabled ####
#set (ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DHDF5_BUILD_FORTRAN:BOOL=ON")
### enable Fortran 2003 depends on HDF5_BUILD_FORTRAN
#set (ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DHDF5_ENABLE_F2003:BOOL=ON")
#### fortran disabled ####
set (ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DHDF5_BUILD_FORTRAN:BOOL=ON")
### enable Fortran 2003 depends on HDF5_BUILD_FORTRAN
set (ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DHDF5_ENABLE_F2003:BOOL=ON")
#############################################################################################
#### java enabled ####
#set (ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DHDF5_BUILD_JAVA:BOOL=ON")
#### java disabled ####
set (ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DHDF5_BUILD_JAVA:BOOL=OFF")
#############################################################################################
### change install prefix (default use INSTALLDIR value)
set (ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DCMAKE_INSTALL_PREFIX:PATH=${INSTALLDIR}")
#############################################################################################
#### ext libraries ####
### ext libs from tgz
set(ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DHDF5_ALLOW_EXTERNAL_SUPPORT:STRING=TGZ -DTGZPATH:PATH=${CTEST_SCRIPT_DIRECTORY}")
### ext libs from git
#set(ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DHDF5_ALLOW_EXTERNAL_SUPPORT:STRING=GIT")
### ext libs on system
#set(ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DZLIB_LIBRARY:FILEPATH=some_location/lib/zlib.lib -DZLIB_INCLUDE_DIR:PATH=some_location/include")
#set(ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DSZIP_LIBRARY:FILEPATH=some_location/lib/szlib.lib -DSZIP_INCLUDE_DIR:PATH=some_location/include")
### disable ext zlib building
set(ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DHDF5_ENABLE_Z_LIB_SUPPORT:BOOL=OFF")
### disable ext szip building
set(ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DHDF5_ENABLE_SZIP_SUPPORT:BOOL=OFF")
set(ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DHDF5_ENABLE_SZIP_ENCODING:BOOL=OFF")
#############################################################################################
### disable test program builds
set(ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DBUILD_TESTING:BOOL=OFF")
#############################################################################################
### disable packaging
set(ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DHDF5_NO_PACKAGES:BOOL=ON")
### Create install package with external libraries (szip, zlib)
set(ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DHDF5_PACKAGE_EXTLIBS:BOOL=ON")
#############################################################################################
hdf5_version=1.10.3
if [ ! -r CMake-hdf5-${hdf5_version}_${FC} ]
then
#Get the file with the code
curl -LO "https://github.com/MRedies/hdf5-mirror/raw/master/CMake-hdf5-${hdf5_version}.tar.gz"
if [ ! -f CMake-hdf5-${hdf5_version}.tar.gz ]; then
echo "No file found try source"
curl -LO "http://support.hdfgroup.org/ftp/HDF5/releases/hdf5-1.10/hdf5-${hdf5_version}/src/CMake-hdf5-${hdf5_version}.tar.gz"
fi
tar xzf CMake-hdf5-${hdf5_version}.tar.gz
mv CMake-hdf5-${hdf5_version} CMake-hdf5-${hdf5_version}_${FC}
cd CMake-hdf5-${hdf5_version}_${FC}
#copy options.cmake to adjust settings for compilation
cp ../HDF5options.cmake .
#Compile&test (This will take a while)
./build-unix.sh
#Do make install
cd build
make install
cd ..
else
cd CMake-hdf5-${hdf5_version}_${FC}
fi
#Store the installation location
FLEUR_LIBDIR="$PWD/HDF_Group/HDF5/${hdf5_version}/lib $FLEUR_LIBDIR"
FLEUR_INCLUDEDIR="$PWD/HDF_Group/HDF5/${hdf5_version}/include/static $FLEUR_INCLUDEDIR"
libxc_version=4.2.1
if [ ! -d libxc-${libxc_version}_${FC} ]
then
#Get the file with the code
curl --connect-timeout 10 -LO "https://github.com/MRedies/libxc-mirror/raw/master/libxc-${libxc_version}.tar.gz"
if [ ! -f libxc-${libxc_version}.tar.gz ]; then
echo "No file found try source"
curl --connect-timeout 10 -LO "http://www.tddft.org/programs/octopus/download/libxc/${libxc_version}/libxc-${libxc_version}.tar.gz"
fi
tar xzf libxc-${libxc_version}.tar.gz
mv libxc-${libxc_version} libxc-${libxc_version}_${FC}
cd libxc-${libxc_version}_${FC}
#Compile&test (This will take a while)
./configure --prefix=$PWD/INSTALL_DIR
make -j
make install
else
cd libxc-${libxc_version}_${FC}
fi
#Store the installation location
FLEUR_LIBDIR="$PWD/INSTALL_DIR/lib $FLEUR_LIBDIR"
FLEUR_INCLUDEDIR="$PWD/INSTALL_DIR/include $FLEUR_INCLUDEDIR"
if [ $FLEUR_LIBRARIES ]
then
FLEUR_LIBRARIES="$FLEUR_LIBRARIES;-lxcf03;-lxc"
else
FLEUR_LIBRARIES="-lxcf03;-lxc"
fi
Subproject commit 280f38267410f085244732a1577f09433fa1500f
......@@ -84,6 +84,7 @@ CONTAINS
!Now modify the noco-file
noco%qss=this%qvec(:,this%q_done)
noco%l_spav=.true.
!Modify the alpha-angles
DO iType = 1,atoms%ntype
noco%alph(iType) = noco%alphInit(iType) + tpi_const*dot_PRODUCT(noco%qss,atoms%taual(:,SUM(atoms%neq(:itype-1))+1))
......
......@@ -42,7 +42,8 @@
REAL dmat(3,3),dmati(3,3)
IF (ALL(ABS(alpha)<1E-10).AND.ALL(ABS(beta)<1E-10)
+ .AND.ALL(ABS(gamma)<1E-10)) RETURN
DO n = 1, n_u
......
......@@ -203,8 +203,7 @@ SUBROUTINE hsfock(nk,atoms,hybrid,lapw,dimension,kpts,jsp,input,hybdat,eig_irr,s
CALL timestart("time for performing T^-1*mat_ex*T^-1*")
!calculate trafo from wavefunctions to APW basis
IF(dimension%neigd.LT.hybrid%nbands(nk)) STOP 'mhsfock: neigd < nbands(nk) ; '&
'trafo from wavefunctions to APW requires at least nbands(nk) '
IF(dimension%neigd.LT.hybrid%nbands(nk)) STOP " mhsfock: neigd < nbands(nk) ;trafo from wavefunctions to APW requires at least nbands(nk)"
call z%init(olap%l_real,nbasfcn,dimension%neigd)
call read_z(z,kpts%nkpt*(jsp-1)+nk)
......
......@@ -265,7 +265,7 @@ CONTAINS
CALL w_inpXML(&
atoms,obsolete,vacuum,input,stars,sliceplot,forcetheo,banddos,&
cell,sym,xcpot,noco,oneD,hybrid,kpts,kpts%nkpt3,kpts%l_gamma,&
noel,namex,relcor,a1,a2,a3,dtild,input%comment,&
noel,namex,relcor,a1,a2,a3,cell%amat(3,3),input%comment,&
xmlElectronStates,xmlPrintCoreStates,xmlCoreOccs,&
atomTypeSpecies,speciesRepAtomType,.FALSE.,filename,&
.TRUE.,numSpecies,enpara)
......
......@@ -6,7 +6,7 @@
MODULE m_atominput
use m_juDFT
INTEGER, PARAMETER :: l_buffer=512 ! maximum length of e-config string
INTEGER, PARAMETER :: dbgfh=6, errfh=6, warnfh=6
REAL, PARAMETER :: eps=0.00000001
......@@ -52,7 +52,6 @@
CHARACTER(len=xl_buffer) :: buffer
!===> data
INTEGER, PARAMETER :: l_buffer=512 ! maximum length of e-config string
INTEGER, PARAMETER :: nwdd=2 ! maximum number of windows
INTEGER, PARAMETER :: nstd=31 ! maximum number of core states
......@@ -154,7 +153,7 @@
ELSE
!---> read defaults for atom defaults
CALL read_allatoms(
> bfh,l_buffer,
> bfh,
< rmt0_def,dx0_def,jri0_def,lmax0_def,
< lnonsph0_def,ncst0_def,econfig0_def,
< bmu0_def,ios)
......@@ -216,7 +215,7 @@
!---> read namelist
CALL read_atom(
> bfh,l_buffer,lotype,
> bfh,lotype,
< id,zat0,rmt0,jri0,dx0,lmax0,lnonsph0,
< ncst0,econfig0,speciesName0,bmu0,lo0,nlod0,llod,
< ios)
......@@ -750,7 +749,7 @@ c in s and p states equal occupation of up and down states
!----------------------------------------------------------------
!================================================================
SUBROUTINE read_allatoms(
> bfh,l_buffer,
> bfh,
X rmt,dx,jri,lmax,lnonsph,ncst,econfig,
< bmu,ios)
!****************************************************************
......@@ -759,7 +758,7 @@ c in s and p states equal occupation of up and down states
IMPLICIT NONE
INTEGER, INTENT (IN) :: bfh,l_buffer
INTEGER, INTENT (IN) :: bfh
INTEGER, INTENT (INOUT) :: jri ! mt radial mesh points
INTEGER, INTENT (INOUT) :: lmax ! max. l to include for density, overlap etc.
INTEGER, INTENT (INOUT) :: lnonsph ! max. l for nonspherical MT-contributions
......@@ -778,7 +777,7 @@ c in s and p states equal occupation of up and down states
END SUBROUTINE read_allatoms
!================================================================
SUBROUTINE read_atom(
> bfh,l_buffer,lotype,
> bfh,lotype,
X id,z,rmt,jri,dx,lmax,lnonsph,ncst,econfig,
< speciesName,bmu,lo,nlod,llod,ios )
!***********************************************************************
......@@ -789,7 +788,7 @@ c in s and p states equal occupation of up and down states
IMPLICIT NONE
! ... arguments ...
INTEGER, INTENT (IN) :: bfh,l_buffer
INTEGER, INTENT (IN) :: bfh
REAL, INTENT (OUT) :: id,z,rmt,dx,bmu
INTEGER :: lmax,lnonsph,ncst,jri,nlod,llod
CHARACTER(len=l_buffer) :: econfig
......
......@@ -127,6 +127,7 @@ CONTAINS
LOGICAL :: coreConfigPresent, l_enpara, l_orbcomp, tempBool, l_nocoinp
REAL :: magMom, radius, logIncrement, qsc(3), latticeScale, dr
REAL :: aTemp, zp, rmtmax, sumWeight, ldau_u(4), ldau_j(4), tempReal
REAL :: ldau_phi(4),ldau_theta(4)
REAL :: weightScale, eParamUp, eParamDown
LOGICAL :: l_amf(4)
REAL, PARAMETER :: boltzmannConst = 3.1668114e-6 ! value is given in Hartree/Kelvin
......@@ -1366,7 +1367,9 @@ input%preconditioning_param = evaluateFirstOnly(xmlGetAttributeValue('/fleurInpu
ldau_l(i) = evaluateFirstIntOnly(xmlGetAttributeValue(TRIM(ADJUSTL(xPathA))//'/ldaU['//TRIM(ADJUSTL(xPathB))//']/@l'))
ldau_u(i) = evaluateFirstOnly(xmlGetAttributeValue(TRIM(ADJUSTL(xPathA))//'/ldaU['//TRIM(ADJUSTL(xPathB))//']/@U'))
ldau_j(i) = evaluateFirstOnly(xmlGetAttributeValue(TRIM(ADJUSTL(xPathA))//'/ldaU['//TRIM(ADJUSTL(xPathB))//']/@J'))
l_amf(i) = evaluateFirstBoolOnly(xmlGetAttributeValue(TRIM(ADJUSTL(xPathA))//'/ldaU['//TRIM(ADJUSTL(xPathB))//']/@l_amf'))
ldau_phi(i) = evaluateFirstOnly(xmlGetAttributeValue(TRIM(ADJUSTL(xPathA))//'/ldaU['//TRIM(ADJUSTL(xPathB))//']/@phi'))
ldau_theta(i) = evaluateFirstOnly(xmlGetAttributeValue(TRIM(ADJUSTL(xPathA))//'/ldaU['//TRIM(ADJUSTL(xPathB))//']/@theta'))
l_amf(i) = evaluateFirstBoolOnly(xmlGetAttributeValue(TRIM(ADJUSTL(xPathA))//'/ldaU['//TRIM(ADJUSTL(xPathB))//']/@l_amf'))
END DO
speciesNLO(iSpecies) = 0
......@@ -1424,6 +1427,8 @@ input%preconditioning_param = evaluateFirstOnly(xmlGetAttributeValue('/fleurInpu
atoms%lda_u(atoms%n_u)%l = ldau_l(i)
atoms%lda_u(atoms%n_u)%u = ldau_u(i)
atoms%lda_u(atoms%n_u)%j = ldau_j(i)
atoms%lda_u(atoms%n_u)%phi = ldau_phi(i)
atoms%lda_u(atoms%n_u)%theta = ldau_theta(i)
atoms%lda_u(atoms%n_u)%l_amf = l_amf(i)
atoms%lda_u(atoms%n_u)%atomType = iType
END DO
......@@ -1808,6 +1813,8 @@ input%preconditioning_param = evaluateFirstOnly(xmlGetAttributeValue('/fleurInpu
END IF
banddos%l_orb = .TRUE.
banddos%orbCompAtom = na
banddos%alpha=0.0;banddos%beta=0.0;banddos%gamma=0.0
WRITE(*,*) "Orbcomp-Rotation feature not fully implemented. Please create an issue on gitlab if you need it :-)"
END IF
wannAtomList(na) = evaluateFirstBoolOnly(xmlGetAttributeValue(TRIM(ADJUSTL(xPathB))//'/@wannier'))
END DO
......
......@@ -465,6 +465,8 @@
<xsd:attribute name="l" type="xsd:nonNegativeInteger" use="required"/>
<xsd:attribute name="U" type="xsd:string" use="required"/>
<xsd:attribute name="J" type="xsd:string" use="required"/>
<xsd:attribute name="phi" type="xsd:string" use="optional" default="0.0"/>
<xsd:attribute name="theta" type="xsd:string" use="optional" default="0.0"/>
<xsd:attribute name="l_amf" type="FleurBool" use="required"/>
</xsd:complexType>
......
......@@ -7,7 +7,7 @@ option(JUDFT_USE_HDF5 "Compile HDF5 tools" OFF)
option(JUDFT_USE_HDF5MPI "Is the HDF5 version able to do parallel IO" OFF)
option(JUDFT_USE_COLLECT "Collect usage data" ON)
option(JUDFT_USE_DEBUG "Set CPP_DEBUG when compiling code" OFF)
option(JUDFT_COMPILE_HDF "HDF5 is compiled as submodule" OFF)
option(JUDFT_COMPILE_HDF5 "HDF5 is compiled as submodule" OFF)
#In addition you might want to set
#set(JUDFT_LIBRARIES "-lsomething")
#set(JUFDT_COMPILEOPTS "-r8")
......@@ -47,10 +47,9 @@ if (JUDFT_USE_MPI)
endif()
if (JUDFT_USE_HDF5)
target_compile_definitions(juDFT PUBLIC CPP_HDF)
target_link_libraries(juDFT hdf5_fortran hdf5)
if (JUDFT_COMPILE_HDF)
target_link_libraries(juDFT hdf5_fortran-static)
endif()
if (JUDFT_COMPILE_HDF5)
target_link_libraries(juDFT PUBLIC hdf5_fortran-static)
endif()
endif()
if (JUDFT_USE_HDF5MPI)
target_compile_definitions(juDFT PUBLIC CPP_HDFMPI)
......
......@@ -58,7 +58,11 @@ SUBROUTINE gen_bz( kpts,sym)
nsym=sym%nop
if (.not.sym%invs) nsym=2*sym%nop
IF (ANY(kpts%nkpt3==0)) THEN
CALL judft_warn("Generating kpoints in full BZ failed. You have to specify nx,ny,nz in the kpoint-grid section of inp.xml")
RETURN ! you skipped the error, so you get what you deserve...
END IF
ALLOCATE (kpts%bkf(3,nsym*kpts%nkpt))
ALLOCATE (kpts%bkp(nsym*kpts%nkpt))
ALLOCATE (kpts%bksym(nsym*kpts%nkpt))
......@@ -71,7 +75,8 @@ SUBROUTINE gen_bz( kpts,sym)
rrot(:,:,iop) = -rrot(:,:,iop-sym%nop)
END IF
END DO
!Add existing vectors to list of full vectors
id_mat=0
ID_mat(1,1)=1;ID_mat(2,2)=1;ID_mat(3,3)=1
......
......@@ -38,11 +38,10 @@ CONTAINS
REAL, INTENT(IN) :: el(0:,:,:) !(0:atoms%lmaxd,ntype,jspd)
! ... Local Variables ...
INTEGER itype,ispin,j,k,l,jspin,urec,i_u
INTEGER noded,nodeu,ios,lty(atoms%n_u)
INTEGER noded,nodeu,ios
REAL wronk
LOGICAL n_exist
CHARACTER*8 l_type*2,l_form*9
REAL f(atoms%jmtd,2),g(atoms%jmtd,2),theta(atoms%n_u),phi(atoms%n_u),zero(atoms%n_u)
REAL f(atoms%jmtd,2),g(atoms%jmtd,2),zero(atoms%n_u)
REAL f0(atoms%n_u,input%jspins),f2(atoms%n_u,input%jspins),f4(atoms%n_u,input%jspins),f6(atoms%n_u,input%jspins)
REAL, ALLOCATABLE :: u(:,:,:,:,:,:)
COMPLEX, ALLOCATABLE :: n_mmp(:,:,:,:)
......@@ -69,26 +68,9 @@ CONTAINS
END DO
! check for possible rotation of n_mmp
INQUIRE (file='n_mmp_rot',exist=n_exist)
IF (n_exist) THEN
OPEN (68,file='n_mmp_rot',status='old',form='formatted')
DO i_u = 1, atoms%n_u
itype = atoms%lda_u(i_u)%atomType
l = atoms%lda_u(i_u)%l
READ(68,*,iostat=ios) theta(i_u),phi(i_u)
IF (ios == 0) THEN
lty(i_u) = l
ELSE
IF (i_u == 1) CALL juDFT_error("ERROR reading n_mmp_rot",calledby ="u_setup")
theta(i_u) = theta(i_u-1) ; phi(i_u) = phi(i_u-1)
lty(i_u) = lty(i_u-1)
END IF
END DO
CLOSE (68)
zero = 0.0
CALL nmat_rot(phi,theta,zero,3,atoms%n_u,input%jspins,lty,n_mmp)
ENDIF
zero = 0.0
CALL nmat_rot(atoms%lda_u(:)%phi,Atoms%lda_u(:)%theta,zero,3,atoms%n_u,input%jspins,atoms%lda_u%l,n_mmp)
! calculate potential matrix and total energy correction
CALL v_mmp(sym,atoms,input%jspins,n_mmp,u,f0,f2,pot%mmpMat,results)
......
......@@ -103,7 +103,7 @@ CONTAINS
! local scalars
INTEGER :: eig_id,archiveType
INTEGER :: n,iter,iterHF
LOGICAL :: l_opti,l_cont,l_qfix,l_wann_inp,l_real
LOGICAL :: l_opti,l_cont,l_qfix,l_real
REAL :: fix
#ifdef CPP_MPI
INCLUDE 'mpif.h'
......@@ -124,16 +124,11 @@ CONTAINS
IF (l_opti) CALL optional(mpi,atoms,sphhar,vacuum,dimension,&
stars,input,sym,cell,sliceplot,obsolete,xcpot,noco,oneD)
!+Wannier (start)
INQUIRE (file='wann_inp',exist=l_wann_inp)
input%l_wann = input%l_wann.OR.l_wann_inp
IF (input%l_wann.AND.(mpi%irank==0).AND.(.NOT.wann%l_bs_comf)) THEN
IF(mpi%isize.NE.1) CALL juDFT_error('No Wannier+MPI at the moment',calledby = 'fleur')
CALL wann_optional(input,kpts,atoms,sym,cell,oneD,noco,wann)
END IF
IF (wann%l_gwf) input%itmax = 1
!-Wannier (end)
iter = 0
iterHF = 0
l_cont = (iter < input%itmax)
......@@ -335,14 +330,13 @@ CONTAINS
ENDIF
!!$ !+Wannier functions
!!$ IF ((input%l_wann).AND.(.NOT.wann%l_bs_comf)) THEN
!!$ CALL wannier(DIMENSION,mpi,input,kpts,sym,atoms,stars,vacuum,sphhar,oneD,&
!!$ wann,noco,cell,enpara,banddos,sliceplot,vTot,results,&
!!$ eig_idList,(sym%invs).AND.(.NOT.noco%l_soc).AND.(.NOT.noco%l_noco),kpts%nkpt)
!!$ END IF
!!$ IF (wann%l_gwf) CALL juDFT_error("provide wann_inp if l_gwf=T", calledby = "fleur")
!!$ !-Wannier
!+Wannier functions
IF ((input%l_wann).AND.(.NOT.wann%l_bs_comf)) THEN
CALL wannier(DIMENSION,mpi,input,kpts,sym,atoms,stars,vacuum,sphhar,oneD,&
wann,noco,cell,enpara,banddos,sliceplot,vTot,results,&
(/eig_id/),(sym%invs).AND.(.NOT.noco%l_soc).AND.(.NOT.noco%l_noco),kpts%nkpt)
END IF
!-Wannier
! charge density generation
CALL timestart("generation of new charge density (total)")
......
......@@ -271,21 +271,6 @@
DIMENSION%lmplmd = (DIMENSION%lmd* (DIMENSION%lmd+3))/2
!Now check for additional input files
IF (mpi%irank.EQ.0) THEN
IF(.NOT.banddos%l_orb) THEN
INQUIRE(file='orbcomp',exist=banddos%l_orb)
IF (banddos%l_orb) THEN