Commit 10452a76 authored by S.Rost's avatar S.Rost

added unfolding output to hdf output file

parent a20c4793
......@@ -27,7 +27,7 @@ MODULE m_banddos_io
CONTAINS
SUBROUTINE openBandDOSFile(fileID, input, atoms, cell, kpts)
SUBROUTINE openBandDOSFile(fileID, input, atoms, cell, kpts, banddos)
USE m_types
USE hdf5
......@@ -37,6 +37,7 @@ MODULE m_banddos_io
TYPE(t_atoms), INTENT(IN) :: atoms
TYPE(t_cell), INTENT(IN) :: cell
TYPE(t_kpts), INTENT(IN) :: kpts
TYPE(t_banddos), INTENT(IN) :: banddos
INTEGER(HID_T), INTENT(OUT) :: fileID
......@@ -67,6 +68,7 @@ MODULE m_banddos_io
INTEGER :: hdfError, dimsInt(7)
INTEGER :: version
INTEGER :: fakeLogical
REAL :: eFermiPrev
LOGICAL :: l_error
......@@ -98,6 +100,9 @@ MODULE m_banddos_io
CALL h5gcreate_f(fileID, '/general', generalGroupID, hdfError)
CALL io_write_attint0(generalGroupID,'spins',input%jspins)
CALL io_write_attreal0(generalGroupID,'lastFermiEnergy',eFermiPrev)
fakeLogical = 0
IF (banddos%unfoldband) fakeLogical = 1
CALL io_write_attint0(generalGroupID,'bandUnfolding',fakeLogical)
CALL h5gclose_f(generalGroupID, hdfError)
CALL h5gcreate_f(fileID, '/cell', cellGroupID, hdfError)
......@@ -236,12 +241,14 @@ MODULE m_banddos_io
INTEGER(HID_T), INTENT(IN) :: fileID
INTEGER(HID_T) :: eigenvaluesGroupID
INTEGER(HID_T) :: bandUnfoldingGroupID
INTEGER(HID_T) :: eigenvaluesSpaceID, eigenvaluesSetID
INTEGER(HID_T) :: numFoundEigsSpaceID, numFoundEigsSetID
INTEGER(HID_T) :: lLikeChargeSpaceID, lLikeChargeSetID
INTEGER(HID_T) :: jsymSpaceID, jsymSetID
INTEGER(HID_T) :: ksymSpaceID, ksymSetID
INTEGER(HID_T) :: bUWeightsSpaceID, bUWeightsSetID
INTEGER :: hdfError, dimsInt(7)
......@@ -296,6 +303,20 @@ MODULE m_banddos_io
CALL h5gclose_f(eigenvaluesGroupID, hdfError)
IF (banddos%unfoldband) THEN
CALL h5gcreate_f(fileID, '/bandUnfolding', bandUnfoldingGroupID, hdfError)
dims(:3)=(/neigd,kpts%nkpt,input%jspins/)
dimsInt = dims
CALL h5screate_simple_f(3,dims(:3),bUWeightsSpaceID,hdfError)
CALL h5dcreate_f(bandUnfoldingGroupID, "weights", H5T_NATIVE_DOUBLE, bUWeightsSpaceID, buWeightsSetID, hdfError)
CALL h5sclose_f(bUWeightsSpaceID,hdfError)
CALL io_write_real3(bUWeightsSetID,(/1,1,1/),dimsInt(:3), REAL(results%unfolding_weights(:neigd,:,:)))
CALL h5dclose_f(bUWeightsSetID, hdfError)
CALL h5gclose_f(bandUnfoldingGroupID, hdfError)
END IF
END SUBROUTINE
SUBROUTINE io_write_string1(datasetID,dims,stringLength,dataArray)
......
......@@ -209,8 +209,10 @@ CONTAINS
LOGICAL :: write_to_file=.false.
CLASS(t_mat), ALLOCATABLE :: zMat_s
CALL build_primitive_cell(banddos,p_cell,cell)
! method_rubel=.true. !this switch is to switch between overlap matrix and rubel method (without overlap matrix)
CALL build_primitive_cell(banddos,p_cell,cell)
IF (.not. method_rubel) THEN
DO j = 1, lapw%nv(jsp)
DO i = 1, j-1
IF(smat_unfold%l_real) THEN
......@@ -220,6 +222,7 @@ CONTAINS
END IF
END DO
END DO
END IF
! write_to_file=.true.
IF (write_to_file) THEN
IF (i_kpt==1) THEN
......@@ -233,7 +236,6 @@ CONTAINS
! write(222,'(234f15.8)') zMat%data_r
! write(223,'(234f15.8)') smat_unfold%data_r
! method_rubel=.true. !this switch is to switch between overlap matrix and rubel method (without overlap matrix)
IF (zmat%l_real) THEN
ALLOCATE(w_n(zMat%matsize2))
......
......@@ -116,7 +116,7 @@ SUBROUTINE cdngen(eig_id,mpi,input,banddos,sliceplot,vacuum,&
CALL write_band_sc(kpts,results,eFermiPrev)
END IF
#ifdef CPP_HDF
CALL openBandDOSFile(banddosFile_id,input,atoms,cell,kpts)
CALL openBandDOSFile(banddosFile_id,input,atoms,cell,kpts,banddos)
CALL writeBandDOSData(banddosFile_id,input,atoms,cell,kpts,results,banddos,dos,vacuum)
CALL closeBandDOSFile(banddosFile_id)
#endif
......
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