Commit 2a9dee4e authored by Gregor Michalicek's avatar Gregor Michalicek

First steps towards the Fleur info mode

...this is very incomplete at the moment.
parent 4d496458
...@@ -25,6 +25,7 @@ MODULE m_cdn_io ...@@ -25,6 +25,7 @@ MODULE m_cdn_io
IMPLICIT NONE IMPLICIT NONE
PRIVATE PRIVATE
PUBLIC printDensityFileInfo
PUBLIC readDensity, writeDensity PUBLIC readDensity, writeDensity
PUBLIC isDensityFilePresent, isCoreDensityPresent PUBLIC isDensityFilePresent, isCoreDensityPresent
PUBLIC readCoreDensity, writeCoreDensity PUBLIC readCoreDensity, writeCoreDensity
...@@ -48,6 +49,69 @@ MODULE m_cdn_io ...@@ -48,6 +49,69 @@ MODULE m_cdn_io
CONTAINS CONTAINS
SUBROUTINE printDensityFileInfo()
INTEGER :: mode, i
LOGICAL :: l_exist
#ifdef CPP_HDF
INTEGER(HID_T) :: fileID
#endif
INTEGER :: currentStarsIndex,currentLatharmsIndex
INTEGER :: currentStructureIndex,currentStepfunctionIndex
INTEGER :: readDensityIndex, lastDensityIndex
CHARACTER(LEN=30) :: archiveName
INTEGER :: iterTemp, starsIndexTemp, latharmsIndexTemp
INTEGER :: structureIndexTemp,stepfunctionIndexTemp
INTEGER :: previousDensityIndex, jspinsTemp
REAL :: fermiEnergyTemp
LOGICAL :: l_qfixTemp
CALL getMode(mode)
WRITE(*,'(a)') 'Available densities info'
WRITE(*,*)
IF(mode.EQ.CDN_HDF5_MODE) THEN
#ifdef CPP_HDF
INQUIRE(FILE='cdn.hdf',EXIST=l_exist)
IF (l_exist) THEN
CALL openCDN_HDF(fileID,currentStarsIndex,currentLatharmsIndex,currentStructureIndex,&
currentStepfunctionIndex,readDensityIndex,lastDensityIndex)
WRITE(*,'(a)') 'densityIndex prevDensity iteration'
DO i = 1, lastDensityIndex
archiveName = ''
WRITE(archiveName,'(a,i0)') '/cdn-', i
l_exist = isDensityEntryPresentHDF(fileID,archiveName,DENSITY_TYPE_UNDEFINED_const)
IF(.NOT.l_exist) THEN
CYCLE
END IF
CALL peekDensityEntryHDF(fileID, archiveName, DENSITY_TYPE_UNDEFINED_const,&
iterTemp, starsIndexTemp, latharmsIndexTemp, structureIndexTemp,&
stepfunctionIndexTemp,previousDensityIndex, jspinsTemp,&
fermiEnergyTemp, l_qfixTemp)
WRITE(*,'(3i10)') i, previousDensityIndex, iterTemp
END DO
CALL closeCDNPOT_HDF(fileID)
ELSE
WRITE(*,'(a)') "No cdn.hdf file found. Density file info is not available."
END IF
#else
WRITE(*,'(a)') "Fleur is not compiled with HDF5 support. Density file info is not available."
#endif
ELSE
WRITE(*,'(a)') "Density file info is only available if '-hdf_cdn' switch is used."
END IF
END SUBROUTINE printDensityFileInfo
SUBROUTINE readDensity(stars,vacuum,atoms,sphhar,input,sym,oneD,archiveType,inOrOutCDN,& SUBROUTINE readDensity(stars,vacuum,atoms,sphhar,input,sym,oneD,archiveType,inOrOutCDN,&
relCdnIndex,fermiEnergy,l_qfix,iter,fr,fpw,fz,fzxy,cdom,cdomvz,cdomvxy) relCdnIndex,fermiEnergy,l_qfix,iter,fr,fpw,fz,fzxy,cdom,cdomvz,cdomvxy)
......
...@@ -6,6 +6,7 @@ main/fleur.F90 ...@@ -6,6 +6,7 @@ main/fleur.F90
main/fleur_init.F90 main/fleur_init.F90
main/fleur_job.F90 main/fleur_job.F90
main/fleur_help.f90 main/fleur_help.f90
main/fleur_info.f90
main/mix.F90 main/mix.F90
main/optional.f90 main/optional.f90
main/totale.f90 main/totale.f90
......
!--------------------------------------------------------------------------------
! Copyright (c) 2017 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.
!--------------------------------------------------------------------------------
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!!!
!!! This module realizes the Fleur info mode: It prints out some information
!!! about the charge density file and then ends the program.
!!!
!!! GM'17
!!!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
MODULE m_fleur_info
IMPLICIT NONE
CONTAINS
SUBROUTINE fleur_info()
USE m_juDFT
USE m_cdn_io
IMPLICIT NONE
LOGICAL :: l_exist
IF (.NOT.juDFT_was_argument("-info")) RETURN
WRITE(*,*) 'Fleur info mode'
WRITE(*,*) '================================================='
WRITE(*,*) ''
CALL printDensityFileInfo()
WRITE(*,*) '================================================='
CALL juDFT_error("Fleur info output completed")
END SUBROUTINE fleur_info
END MODULE m_fleur_info
...@@ -27,6 +27,7 @@ ...@@ -27,6 +27,7 @@
USE m_winpXML USE m_winpXML
USE m_setupMPI USE m_setupMPI
USE m_cdn_io USE m_cdn_io
USE m_fleur_info
USE m_checks USE m_checks
#ifdef CPP_MPI #ifdef CPP_MPI
USE m_mpi_bc_all, ONLY : mpi_bc_all USE m_mpi_bc_all, ONLY : mpi_bc_all
...@@ -489,6 +490,10 @@ ...@@ -489,6 +490,10 @@
hybrid%l_calhf = .FALSE. hybrid%l_calhf = .FALSE.
END IF END IF
IF (mpi%irank.EQ.0) THEN
CALL fleur_info()
END IF
!Finalize the MPI setup !Finalize the MPI setup
CALL setupMPI(kpts%nkpt,mpi) CALL setupMPI(kpts%nkpt,mpi)
......
...@@ -140,7 +140,9 @@ CONTAINS ...@@ -140,7 +140,9 @@ CONTAINS
!$ juDFT_error("MPI not usable with OpenMP") !$ juDFT_error("MPI not usable with OpenMP")
!Select the io-mode from the command-line !Select the io-mode from the command-line
#endif #endif
if (irank==0) call fleur_help() IF (irank==0) THEN
CALL fleur_help()
END IF
END SUBROUTINE END SUBROUTINE
SUBROUTINE fleur_job_execute(jobs) SUBROUTINE fleur_job_execute(jobs)
......
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