Commit ae6332d5 authored by Matthias Redies's avatar Matthias Redies

Merge branch 'develop' of iffgit.fz-juelich.de:fleur/fleur into develop

parents dc235187 ec4a4585
......@@ -75,13 +75,14 @@ set_source_files_properties(${inpgen_F77} PROPERTIES Fortran_FORMAT FIXED)
string(REPLACE ";" " " CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} ${FLEUR_PRECISION_OPTION}")
message("Flags: ${CMAKE_Fortran_FLAGS}")
set(FLEUR_LINK_LIBRARIES "${FLEUR_LINK_LIBRARIES};juDFT")
if (${FLEUR_USE_SERIAL})
#Serial executables
add_executable(fleur ${fleur_SRC} ${c_filesFleur})
target_compile_definitions(fleur PUBLIC ${FLEUR_DEFINITIONS})
target_link_libraries(fleur ${FLEUR_LIBRARIES})
target_link_libraries(fleur juDFT)
target_link_libraries(fleur ${FLEUR_LINK_LIBRARIES})
set_target_properties(fleur PROPERTIES Fortran_MODULE_DIRECTORY modules/fleur COMPILE_OPTIONS -Imodules/fleur)
endif()
#parallel executables
......@@ -90,7 +91,7 @@ if(${FLEUR_USE_MPI})
add_executable(fleur_MPI ${juDFT_HDF} ${juDFT_SRC_F90} ${fleur_SRC} ${c_filesFleur} ${fleur_SRC_MPI})
target_compile_definitions(fleur_MPI PUBLIC ${FLEUR_MPI_DEFINITIONS})
target_link_libraries(fleur_MPI ${FLEUR_LIBRARIES})
target_link_libraries(fleur_MPI juDFT)
target_link_libraries(fleur_MPI ${FLEUR_LINK_LIBRARIES})
set_target_properties(fleur_MPI PROPERTIES Fortran_MODULE_DIRECTORY modules/fleur_MPI COMPILE_OPTIONS -Imodules/fleur_MPI)
endif ()
......
......@@ -58,12 +58,13 @@ if (DEFINED CLI_FLEUR_USE_HDF5)
else()
set(HDF5_ENABLE_PARALLEL OFF CACHE BOOL "Enable parallel build (requires MPI)")
endif()
set(CMAKE_Fortran_MODULE_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/modules/hdf5")
set(CMAKE_Fortran_MODULE_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/modules/external")
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)
include_directories("${CMAKE_CURRENT_BINARY_DIR}/modules/hdf5/static")
include_directories("${CMAKE_CURRENT_BINARY_DIR}/modules/external")
include_directories("${CMAKE_CURRENT_BINARY_DIR}/modules/external/static")
endif()
else()
if (FLEUR_USE_HDF5)
......
......@@ -24,9 +24,11 @@ if (DEFINED CLI_FLEUR_USE_LIBXC)
set(ENABLE_FORTRAN ON CACHE BOOL "Build Fortran 90 interface")
set(ENABLE_FORTRAN03 ON CACHE BOOL "Build Fortran 2003 interface")
set(CMAKE_Fortran_MODULE_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/modules/external")
add_subdirectory (external/libxc-git EXCLUDE_FROM_ALL)
include_directories("${CMAKE_CURRENT_BINARY_DIR}/modules/external")
set(FLEUR_USE_LIBXC TRUE)
set(FLEUR_LIBRARIES "${FLEUR_LIBRARIES};xcf90;xcf03")
set(FLEUR_LINK_LIBRARIES "${FLEUR_LINK_LIBRARIES};xcf90;xcf03")
set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -I${CMAKE_CURRENT_BINARY_DIR}/external/libxc-git")
endif()
else()
......
......@@ -5,7 +5,9 @@ LINK_LIBRARIES ${FLEUR_LIBRARIES}
#Try typical mkl string
if (NOT FLEUR_USE_SCALAPACK)
message("Test for SCALAPCK with mkl flags")
set(TEST_LIBRARIES "${FLEUR_LIBRARIES};-lmkl_scalapack_lp64;-lmkl_blacs_intelmpi_lp64")
message("Testlibraries:${TEST_LIBRARIES}")
try_compile(FLEUR_USE_SCALAPACK ${CMAKE_BINARY_DIR} ${CMAKE_SOURCE_DIR}/cmake/tests/test_SCALAPACK.f90
LINK_LIBRARIES ${TEST_LIBRARIES}
)
......
......@@ -10,7 +10,7 @@ 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 CHACHE BOOL "The HDF5 is compiled as submodule")
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" )
......
Subproject commit ca6f7114b9fffe0964ca9e8d24e09ef15b300316
Subproject commit 3cb2231abf1d47fbd8b3e21c8478e9f26a73ce5f
......@@ -87,9 +87,11 @@ SUBROUTINE rdmft(eig_id,mpi,input,kpts,banddos,sliceplot,cell,atoms,enpara,stars
REAL :: fix, potDenInt, fermiEnergyTemp, spinDegenFac
REAL :: rdmftFunctionalValue, occStateI, gradSum
REAL :: exchangeTerm, lagrangeMultiplier, equalityCriterion
REAL :: mixParam, convCrit, rdmftEnergy
REAL :: mixParam, rdmftEnergy
REAL :: sumOcc, tempOcc, addCharge, subCharge, addChargeWeight, subChargeWeight
REAL, PARAMETER :: degenEps = 0.00001
REAL, PARAMETER :: convCrit = 1.0e-6
REAL, PARAMETER :: minOcc = 1.0e-8
LOGICAL :: converged, l_qfix, l_restart, l_zref
CHARACTER(LEN=20) :: filename
......@@ -134,7 +136,6 @@ SUBROUTINE rdmft(eig_id,mpi,input,kpts,banddos,sliceplot,cell,atoms,enpara,stars
! General initializations
mixParam = 0.0001
convCrit = 1.0e-6
lagrangeMultiplier = 0.1 !results%ef
spinDegenFac = 2.0 / input%jspins ! This factor is used to compensate the missing second spin in non-spinpolarized calculations
......@@ -574,7 +575,7 @@ SUBROUTINE rdmft(eig_id,mpi,input,kpts,banddos,sliceplot,cell,atoms,enpara,stars
DO ikpt = 1, kpts%nkpt
DO iBand = 1, highestState(ikpt,isp)
occStateI = results%w_iks(iBand,ikpt,isp) / (kpts%wtkpt(ikpt))!*kpts%nkptf)
occStateI = MAX(occStateI,1.0e-9)
occStateI = MAX(occStateI,minOcc)
! IF(occStateI.LT.1.0e-7) occStateI = 5.0e-4 ! This is preliminary. I have to discuss what do do here.
! occStateI = cdnvalJob%weights(iBand,ikpt)
rdmftFunctionalValue = 0.5*0.5*SQRT(1.0/occStateI) ! for Müller functional derivative
......@@ -624,6 +625,7 @@ SUBROUTINE rdmft(eig_id,mpi,input,kpts,banddos,sliceplot,cell,atoms,enpara,stars
DO iBand = lowestState(ikpt,isp), highestState(ikpt,isp)
iState = iState + 1
occStateI = results%w_iks(iBand,ikpt,isp) / kpts%wtkpt(ikpt)
occStateI = MAX(occStateI,minOcc)
equalityLinCombi(iState) = kpts%wtkpt(ikpt)
gradient(iState) = dEdOcc(iBand,ikpt,isp) + lagrangeMultiplier
gradient(numStates+1) = gradient(numStates+1) + occStateI * kpts%wtkpt(ikpt)
......@@ -648,7 +650,7 @@ SUBROUTINE rdmft(eig_id,mpi,input,kpts,banddos,sliceplot,cell,atoms,enpara,stars
DO ikpt = 1, kpts%nkpt
DO iBand = lowestState(ikpt,isp), highestState(ikpt,isp)
iState = iState + 1
results%w_iks(iBand,ikpt,isp) = parameters(iState) * kpts%wtkpt(ikpt)
results%w_iks(iBand,ikpt,isp) = MERGE(parameters(iState) * kpts%wtkpt(ikpt),0.0,parameters(iState).GT.minOcc)
END DO
END DO
END DO
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment