Commit 8da13b7b authored by Daniel Wortmann's avatar Daniel Wortmann

Fixed HDF5 IO in eig66_hdf.

parent cdae93dc
......@@ -66,30 +66,20 @@ For the compilation of FLEUR you will need:
(without you can only exploit k-point parallelism)
* HDF5 for parallel IO (if you have lots of memory, you might not need to do IO :-)
You should probably create a directory structure like this:
FLEUR now comes with a configuration script. This skript will
create a build sub-directory in the main FLEUR directory (where this file resides) and
then use cmake to generate a makefile. You should use it like
somewhere/src -this is where the source code lives, i.e. the location of this README
somewhere/build -here you can build the code
./configure.sh CONFIGURATION
change to the build directory and type:
where CONFIGURATION refers to a predefined maschine setup. Call ./configure.sh without any
argument for more information.
cmake ../src
After the configure.sh script finishes, you should do
cd build
make
This might generate the FLEUR executables. It most probable will only work on systems we know as
only for those there will be specific configurations in the cmake directory.
If you get errors, you have to configure your build system yourself.
There are two options to do that.
- Either set the environment variable FC to either ifort,pgfortran or gfortran.
Then the configuration in the cmake directory will be used from cmake.[ifort|gfortran|pgfortran].config will be used that can again work for your system or can be adjusted.
- Or you run cmake with the option -DFleur_custom_toolchain and you adjust cmake.config to your needs.
You might find inspiration in the cmake.???.config files provided for several systems.
If your build environment is recognized correctly you can obtain the following executables:
inpgen - the input generator of FLEUR
fleur - general version of FLEUR
fleur_INVS - version of FLEUR suitable for systems with inversion symmetry leading to real matrices
fleur_SOC - version of FLEUR with spin-orbit coupling
All codes might also have a _MPI attached to indicate parallel versions.
\ No newline at end of file
only for those there will be specific configurations available.
......@@ -47,7 +47,7 @@ try_compile(FLEUR_USE_HDF5 ${CMAKE_BINARY_DIR} ${CMAKE_SOURCE_DIR}/cmake/tests/t
endif()
message("HDF5 Library found:${FLEUR_USE_HDF5}")
if (FLEUR_USE_HDF)
if (FLEUR_USE_HDF5)
set(FLEUR_DEFINITIONS ${FLEUR_DEFINITIONS} "CPP_HDF")
set(FLEUR_MPI_DEFINITIONS ${FLEUR_MPI_DEFINITIONS} "CPP_HDF")
endif()
\ No newline at end of file
endif()
......@@ -51,7 +51,7 @@ module m_eig66_data
INTEGER(HID_T) :: energysetid,evsetid
INTEGER(HID_T) :: qalsetid,qvacsetid,qissetid,qvlaysetid
INTEGER(HID_T) :: qstarssetid,ksymsetid,jsymsetid,mcdsetid
INTEGER(HID_T) :: qintslsetid,qmtslsetid,qmtpstid,orbcompsetid
INTEGER(HID_T) :: qintslsetid,qmtslsetid,qmtpsetid,orbcompsetid
CHARACTER(LEN=20) :: fname="eig"
#endif
END TYPE
......
......@@ -38,7 +38,7 @@ MODULE m_eig66_hdf
#endif
PUBLIC open_eig,close_eig
PUBLIC read_eig
PUBLIC read_eig,read_dos,write_dos
PUBLIC write_eig!,writesingleeig,writeeigc,writebas
CONTAINS
......@@ -56,7 +56,7 @@ CONTAINS
END SELECT
END SUBROUTINE priv_find_data
!----------------------------------------------------------------------
SUBROUTINE open_eig(id,mpi_comm,nmat,neig,nkpts,jspins,lmax,nlo,ntype,create,l_real,l_soc,readonly,l_dos,l_mcd,l_orb,filename,layers,nstars,ncored,nsld,nat)
SUBROUTINE open_eig(id,mpi_comm,nmat,neig,nkpts,jspins,lmax,nlo,ntype,create,l_real,l_soc,nlotot,readonly,l_dos,l_mcd,l_orb,filename,layers,nstars,ncored,nsld,nat)
!*****************************************************************
! opens hdf-file for eigenvectors+values
......@@ -64,7 +64,7 @@ CONTAINS
IMPLICIT NONE
INTEGER, INTENT(IN) :: id,mpi_comm
INTEGER, INTENT(IN) :: nmat,neig,nkpts,jspins,nlo,ntype,lmax
INTEGER, INTENT(IN) :: nmat,neig,nkpts,jspins,nlo,ntype,lmax,nlotot
LOGICAL, INTENT(IN) :: create,readonly,l_real,l_soc
LOGICAL, INTENT(IN),OPTIONAL ::l_dos,l_mcd,l_orb
CHARACTER(LEN=*),OPTIONAL :: filename
......@@ -75,7 +75,7 @@ CONTAINS
INTEGER :: hdferr,access_mode
INTEGER(HID_T) :: creation_prp,access_prp,spaceid
LOGICAL :: l_exist
INTEGER(HSIZE_T):: dims(5)
INTEGER(HSIZE_T):: dims(7)
TYPE(t_data_HDF),POINTER::d
!Set creation and access properties
#ifdef CPP_MPI
......@@ -186,13 +186,13 @@ CONTAINS
CALL h5screate_simple_f(3,dims(:3),spaceid,hdferr)
CALL h5dcreate_f(d%fid, "jsym", H5T_NATIVE_DOUBLE, spaceid, d%jsymsetid, hdferr)
CALL h5sclose_f(spaceid,hdferr)
IF (l_mcd) THEN
IF (d%l_mcd) THEN
dims(:5)=(/3*ntype,ncored,neig,nkpts,jspins/)
CALL h5screate_simple_f(5,dims(:5),spaceid,hdferr)
CALL h5dcreate_f(d%fid, "mcd", H5T_NATIVE_DOUBLE, spaceid, d%mcdsetid, hdferr)
CALL h5sclose_f(spaceid,hdferr)
ENDIF
IF (l_orb) THEN
IF (d%l_orb) THEN
dims(:4)=(/nsld,neig,nkpts,jspins/)
CALL h5screate_simple_f(4,dims(:4),spaceid,hdferr)
CALL h5dcreate_f(d%fid, "qintsl", H5T_NATIVE_DOUBLE, spaceid, d%qintslsetid, hdferr)
......@@ -201,11 +201,11 @@ CONTAINS
CALL h5screate_simple_f(4,dims(:4),spaceid,hdferr)
CALL h5dcreate_f(d%fid, "qmtsl", H5T_NATIVE_DOUBLE, spaceid, d%qmtslsetid, hdferr)
CALL h5sclose_f(spaceid,hdferr)
dims(:4)=(/neig,natd,nkpts,jspins/)
dims(:4)=(/neig,nat,nkpts,jspins/)
CALL h5screate_simple_f(4,dims(:4),spaceid,hdferr)
CALL h5dcreate_f(d%fid, "qmtp", H5T_NATIVE_DOUBLE, spaceid, d%qmtpsetid, hdferr)
CALL h5sclose_f(spaceid,hdferr)
dims(:5)=(/neig,23,natd,nkpts,jspins/)
dims(:5)=(/neig,23,nat,nkpts,jspins/)
CALL h5screate_simple_f(5,dims(:5),spaceid,hdferr)
CALL h5dcreate_f(d%fid, "orbcomp", H5T_NATIVE_DOUBLE, spaceid, d%orbcompsetid, hdferr)
CALL h5sclose_f(spaceid,hdferr)
......@@ -233,24 +233,25 @@ CONTAINS
CALL h5dopen_f(d%fid, 'qstars', d%qstarssetid, hdferr)
CALL h5dopen_f(d%fid, 'ksym', d%ksymsetid, hdferr)
CALL h5dopen_f(d%fid, 'jsym', d%jsymsetid, hdferr)
IF (l_mcd) THEN
IF (d%l_mcd) THEN
CALL h5dopen_f(d%fid, 'mcd', d%mcdsetid, hdferr)
ENDIF
IF (l_orb) THEN
IF (d%l_orb) THEN
CALL h5dopen_f(d%fid, 'qintsl', d%qintslsetid, hdferr)
CALL h5dopen_f(d%fid, 'qmtsl', d%qmtslsetid, hdferr)
CALL h5dopen_f(d%fid, 'qmtp', d%qmtpsetid, hdferr)
CALL h5dopen_f(d%fid, 'orbcomp', d%orbcompsetid, hdferr)
ENDIF
ENDIF
IF (.NOT.access_prp==H5P_DEFAULT_f) CALL H5Pclose_f(access_prp&
endif
IF (.NOT.access_prp==H5P_DEFAULT_f) CALL H5Pclose_f(access_prp&
& ,hdferr)
#else
CALL juDFT_error("Could not use HDF5 for IO, please recompile")
CALL juDFT_error("Could not use HDF5 for IO, please recompile")
#endif
END SUBROUTINE open_eig
END SUBROUTINE open_eig
!----------------------------------------------------------------------
SUBROUTINE close_eig(id,filename)
SUBROUTINE close_eig(id,filename)
!*****************************************************************
! closes hdf-file for eigenvectors+values
!*****************************************************************
......@@ -284,10 +285,10 @@ CONTAINS
CALL h5dclose_f(d%qstarssetid, hdferr)
CALL h5dclose_f(d%ksymsetid, hdferr)
CALL h5dclose_f(d%jsymsetid, hdferr)
IF (l_mcd) THEN
IF (d%l_mcd) THEN
CALL h5dclose_f(d%mcdsetid, hdferr)
ENDIF
IF (l_orb) THEN
IF (d%l_orb) THEN
CALL h5dclose_f(d%qintslsetid, hdferr)
CALL h5dclose_f(d%qmtslsetid, hdferr)
CALL h5dclose_f(d%qmtpsetid, hdferr)
......@@ -368,7 +369,7 @@ CONTAINS
CALL io_read_real2(d%qintslsetid,(/1,1,nk,jspin/),(/SIZE(qintsl,1),SIZE(qintsl,2),1,1/),qintsl)
CALL io_read_real2(d%qmtslsetid,(/1,1,nk,jspin/),(/SIZE(qmtsl,1),SIZE(qmtsl,2),1,1/),qmtsl)
CALL io_read_real2(d%qmtpsetid,(/1,1,nk,jspin/),(/SIZE(qmtp,1),SIZE(qmtp,2),1,1/),qmtp)
CALL io_read_real2(d%orbcompsetid,(/1,1,1,nk,jspin/),(/SIZE(orbcomp,1),23,SIZE(orbcomp,3),1,1/),orbcomp)
CALL io_read_real3(d%orbcompsetid,(/1,1,1,nk,jspin/),(/SIZE(orbcomp,1),23,SIZE(orbcomp,3),1,1/),orbcomp)
ENDIF
#endif
END SUBROUTINE read_dos
......@@ -389,8 +390,8 @@ CONTAINS
CALL io_write_real2(d%qvacsetid,(/1,1,nk,jspin/),(/SIZE(qvac,1),SIZE(qvac,2),1,1/),qvac)
CALL io_write_real1(d%qissetid,(/1,nk,jspin/),(/SIZE(qis,1),1,1/),qis)
CALL io_write_real3(d%qvlaysetid,(/1,1,1,nk,jspin/),(/SIZE(qvlay,1),SIZE(qvlay,2),SIZE(qvlay,3),1,1/),qvlay)
CALL io_write_real5(d%qstarssetid,(/1,1,1,1,1,nk,jspin/),(/1,SIZE(qstars,1),SIZE(qstars,2),SIZE(qstars,3),SIZE(qstars,4),1,1/),REAL(qstars))
CALL io_write_real5(d%qstarssetid,(/2,1,1,1,1,nk,jspin/),(/1,SIZE(qstars,1),SIZE(qstars,2),SIZE(qstars,3),SIZE(qstars,4),1,1/),AIMAG(qstars))
CALL io_write_real4(d%qstarssetid,(/1,1,1,1,1,nk,jspin/),(/1,SIZE(qstars,1),SIZE(qstars,2),SIZE(qstars,3),SIZE(qstars,4),1,1/),REAL(qstars))
CALL io_write_real4(d%qstarssetid,(/2,1,1,1,1,nk,jspin/),(/1,SIZE(qstars,1),SIZE(qstars,2),SIZE(qstars,3),SIZE(qstars,4),1,1/),AIMAG(qstars))
CALL io_write_integer1(d%ksymsetid,(/1,nk,jspin/),(/SIZE(ksym,1),1,1/),ksym)
CALL io_write_integer1(d%jsymsetid,(/1,nk,jspin/),(/SIZE(jsym,1),1,1/),jsym)
......@@ -401,7 +402,7 @@ CONTAINS
CALL io_write_real2(d%qintslsetid,(/1,1,nk,jspin/),(/SIZE(qintsl,1),SIZE(qintsl,2),1,1/),qintsl)
CALL io_write_real2(d%qmtslsetid,(/1,1,nk,jspin/),(/SIZE(qmtsl,1),SIZE(qmtsl,2),1,1/),qmtsl)
CALL io_write_real2(d%qmtpsetid,(/1,1,nk,jspin/),(/SIZE(qmtp,1),SIZE(qmtp,2),1,1/),qmtp)
CALL io_write_real2(d%orbcompsetid,(/1,1,1,nk,jspin/),(/SIZE(orbcomp,1),23,SIZE(orbcomp,3),1,1/),orbcomp)
CALL io_write_real3(d%orbcompsetid,(/1,1,1,nk,jspin/),(/SIZE(orbcomp,1),23,SIZE(orbcomp,3),1,1/),orbcomp)
ENDIF
#endif
END SUBROUTINE write_dos
......
......@@ -72,7 +72,7 @@ CONTAINS
CASE (DA_mode)
CALL open_eig_DA(id,nmat,neig_local,nkpts,jspins,lmax,nlo,ntype,nlotot,l_create,l_real,l_soc,l_dos,l_mcd,l_orb,filename,layers,nstars,ncored,nsld,nat)
CASE (hdf_mode)
CALL open_eig_HDF(id,mpi_comm,nmat,neig_local,nkpts,jspins,lmax,nlo,ntype,l_create,l_real,l_soc,l_readonly,l_dos,l_mcd,l_orb,filename,layers,nstars,ncored,nsld,nat)
CALL open_eig_HDF(id,mpi_comm,nmat,neig_local,nkpts,jspins,lmax,nlo,ntype,l_create,l_real,l_soc,nlotot,l_readonly,l_dos,l_mcd,l_orb,filename,layers,nstars,ncored,nsld,nat)
CASE (mem_mode)
CALL open_eig_MEM(id,nmat,neig_local,nkpts,jspins,lmax,nlo,ntype,l_create,l_real,l_soc,nlotot,l_noco,l_dos,l_mcd,l_orb,filename,layers,nstars,ncored,nsld,nat)
CASE (mpi_mode)
......
set(fleur_F77 ${fleur_F77}
)
if (${Fleur_uses_HDF5})
if (${FLEUR_USE_HDF5})
set(fleur_F90 ${fleur_F90}
juDFT/hdf_accessprp.F90
juDFT/hdf_tools.F90
......
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