Commit 387cb7b9 authored by Gregor Michalicek's avatar Gregor Michalicek

Remove w_iks storage

Note: The MPI_BARRIER below the write_eig call in fermi/fermie.F90
was also removed. I hope that is save.
parent 510c823c
...@@ -268,19 +268,7 @@ CONTAINS ...@@ -268,19 +268,7 @@ CONTAINS
WRITE(attributes(1),'(f20.10)') results%ef WRITE(attributes(1),'(f20.10)') results%ef
WRITE(attributes(2),'(a)') 'Htr' WRITE(attributes(2),'(a)') 'Htr'
IF (fmpi%irank.EQ.0) CALL writeXMLElement('FermiEnergy',(/'value','units'/),attributes(1:2)) IF (fmpi%irank.EQ.0) CALL writeXMLElement('FermiEnergy',(/'value','units'/),attributes(1:2))
ENDIF ENDIF
!IF(.not.input%eig66(1))THEN
!Put w_iks into eig-file
DO jsp = 1,nspins
DO k = 1,kpts%nkpt
IF (fmpi%irank == 0) CALL write_eig(eig_id,k,jsp,w_iks=results%w_iks(:,k,jsp))
#ifdef CPP_MPI
CALL MPI_BARRIER(fmpi%mpi_comm,ierr)
#endif
ENDDO
ENDDO
!ENDIF
RETURN RETURN
8020 FORMAT (/,'FERMIE:',/,& 8020 FORMAT (/,'FERMIE:',/,&
......
...@@ -117,11 +117,11 @@ CONTAINS ...@@ -117,11 +117,11 @@ CONTAINS
d%fname = "eig" d%fname = "eig"
CALL eig66_remove_data(id) CALL eig66_remove_data(id)
END SUBROUTINE close_eig END SUBROUTINE close_eig
SUBROUTINE read_eig(id, nk, jspin, neig, eig, w_iks, list, zmat, smat) SUBROUTINE read_eig(id, nk, jspin, neig, eig, list, zmat, smat)
IMPLICIT NONE IMPLICIT NONE
INTEGER, INTENT(IN) :: id, nk, jspin INTEGER, INTENT(IN) :: id, nk, jspin
INTEGER, INTENT(OUT), OPTIONAL :: neig INTEGER, INTENT(OUT), OPTIONAL :: neig
REAL, INTENT(OUT), OPTIONAL :: eig(:), w_iks(:) REAL, INTENT(OUT), OPTIONAL :: eig(:)
INTEGER, INTENT(IN), OPTIONAL :: list(:) INTEGER, INTENT(IN), OPTIONAL :: list(:)
TYPE(t_mat), OPTIONAL :: zmat, smat TYPE(t_mat), OPTIONAL :: zmat, smat
...@@ -142,11 +142,6 @@ CONTAINS ...@@ -142,11 +142,6 @@ CONTAINS
nrec = nk + (jspin - 1)*d%nkpts nrec = nk + (jspin - 1)*d%nkpts
IF (PRESENT(w_iks)) THEN
print *, "R:w_iks:", nrec
read (d%file_io_id_wiks, REC=nrec) w_iks
ENDIF
IF (.NOT. (PRESENT(eig) .OR. PRESENT(neig) .OR. PRESENT(zmat))) RETURN IF (.NOT. (PRESENT(eig) .OR. PRESENT(neig) .OR. PRESENT(zmat))) RETURN
READ (d%file_io_id_vec, REC=nrec) neig_s READ (d%file_io_id_vec, REC=nrec) neig_s
IF (PRESENT(neig)) THEN IF (PRESENT(neig)) THEN
...@@ -177,11 +172,11 @@ CONTAINS ...@@ -177,11 +172,11 @@ CONTAINS
END SUBROUTINE read_eig END SUBROUTINE read_eig
SUBROUTINE write_eig(id, nk, jspin, neig, neig_total, eig, w_iks, n_size, n_rank, zmat, smat) SUBROUTINE write_eig(id, nk, jspin, neig, neig_total, eig, n_size, n_rank, zmat, smat)
INTEGER, INTENT(IN) :: id, nk, jspin INTEGER, INTENT(IN) :: id, nk, jspin
INTEGER, INTENT(IN), OPTIONAL :: n_size, n_rank INTEGER, INTENT(IN), OPTIONAL :: n_size, n_rank
INTEGER, INTENT(IN), OPTIONAL :: neig, neig_total INTEGER, INTENT(IN), OPTIONAL :: neig, neig_total
REAL, INTENT(IN), OPTIONAL :: eig(:), w_iks(:) REAL, INTENT(IN), OPTIONAL :: eig(:)
TYPE(t_mat), INTENT(IN), OPTIONAL :: zmat, smat TYPE(t_mat), INTENT(IN), OPTIONAL :: zmat, smat
INTEGER:: nrec, r_len INTEGER:: nrec, r_len
...@@ -209,9 +204,6 @@ CONTAINS ...@@ -209,9 +204,6 @@ CONTAINS
CALL juDFT_error("Neig and neig_total have to be equal in DA mode", calledby="eig66_da") CALL juDFT_error("Neig and neig_total have to be equal in DA mode", calledby="eig66_da")
ENDIF ENDIF
ENDIF ENDIF
IF (PRESENT(w_iks)) THEN
write (d%file_io_id_wiks, REC=nrec) w_iks
ENDIF
IF (.NOT. PRESENT(eig) .OR. .NOT. PRESENT(neig)) RETURN IF (.NOT. PRESENT(eig) .OR. .NOT. PRESENT(neig)) RETURN
!Now the IO of the eigenvalues/vectors !Now the IO of the eigenvalues/vectors
......
...@@ -26,13 +26,13 @@ module m_eig66_data ...@@ -26,13 +26,13 @@ module m_eig66_data
TYPE, extends(t_data):: t_data_MPI TYPE, extends(t_data):: t_data_MPI
INTEGER :: n_size = 1 INTEGER :: n_size = 1
INTEGER :: size_k, size_eig INTEGER :: size_k, size_eig
INTEGER :: eig_handle, zr_handle, zc_handle, neig_handle, w_iks_handle, olap_r_handle, olap_c_handle INTEGER :: eig_handle, zr_handle, zc_handle, neig_handle, olap_r_handle, olap_c_handle
INTEGER, ALLOCATABLE :: pe_basis(:, :), slot_basis(:, :) INTEGER, ALLOCATABLE :: pe_basis(:, :), slot_basis(:, :)
INTEGER, ALLOCATABLE :: pe_ev(:, :, :), slot_ev(:, :, :) INTEGER, ALLOCATABLE :: pe_ev(:, :, :), slot_ev(:, :, :)
integer, allocatable :: pe_olap(:,:,:), slot_olap(:,:,:) integer, allocatable :: pe_olap(:,:,:), slot_olap(:,:,:)
INTEGER :: irank INTEGER :: irank
INTEGER, POINTER :: neig_data(:) INTEGER, POINTER :: neig_data(:)
REAL, POINTER :: eig_data(:), zr_data(:), w_iks_data(:), olap_r_data(:) REAL, POINTER :: eig_data(:), zr_data(:), olap_r_data(:)
COMPLEX, POINTER :: zc_data(:), olap_c_data(:) COMPLEX, POINTER :: zc_data(:), olap_c_data(:)
END TYPE END TYPE
TYPE, EXTENDS(t_data):: t_data_hdf TYPE, EXTENDS(t_data):: t_data_hdf
...@@ -46,7 +46,7 @@ module m_eig66_data ...@@ -46,7 +46,7 @@ module m_eig66_data
TYPE, EXTENDS(t_data):: t_data_mem TYPE, EXTENDS(t_data):: t_data_mem
INTEGER, ALLOCATABLE :: eig_int(:) INTEGER, ALLOCATABLE :: eig_int(:)
REAL, ALLOCATABLE :: eig_eig(:, :, :) REAL, ALLOCATABLE :: eig_eig(:, :)
REAL, ALLOCATABLE :: eig_vecr(:, :) REAL, ALLOCATABLE :: eig_vecr(:, :)
COMPLEX, ALLOCATABLE :: eig_vecc(:, :) COMPLEX, ALLOCATABLE :: eig_vecc(:, :)
REAL, ALLOCATABLE :: olap_r(:, :) REAL, ALLOCATABLE :: olap_r(:, :)
......
...@@ -123,11 +123,6 @@ CONTAINS ...@@ -123,11 +123,6 @@ CONTAINS
CALL h5screate_simple_f(3, dims(:3), spaceid, hdferr) CALL h5screate_simple_f(3, dims(:3), spaceid, hdferr)
CALL h5dcreate_f(d%fid, "energy", H5T_NATIVE_DOUBLE, spaceid, d%energysetid, hdferr) CALL h5dcreate_f(d%fid, "energy", H5T_NATIVE_DOUBLE, spaceid, d%energysetid, hdferr)
CALL h5sclose_f(spaceid, hdferr) CALL h5sclose_f(spaceid, hdferr)
! w_iks
dims(:3) = (/neig, nkpts, jspins/)
CALL h5screate_simple_f(3, dims(:3), spaceid, hdferr)
CALL h5dcreate_f(d%fid, "w_iks", H5T_NATIVE_DOUBLE, spaceid, d%wikssetid, hdferr)
CALL h5sclose_f(spaceid, hdferr)
! ev ! ev
if (l_real .and. .not. l_soc) THEN if (l_real .and. .not. l_soc) THEN
dims(:5) = (/one, nmat, neig, nkpts, jspins/) dims(:5) = (/one, nmat, neig, nkpts, jspins/)
...@@ -141,7 +136,6 @@ CONTAINS ...@@ -141,7 +136,6 @@ CONTAINS
CALL h5fopen_f(TRIM(d%fname)//'.hdf', access_Mode, d%fid, hdferr, access_prp) CALL h5fopen_f(TRIM(d%fname)//'.hdf', access_Mode, d%fid, hdferr, access_prp)
!get dataset-ids !get dataset-ids
CALL h5dopen_f(d%fid, 'energy', d%energysetid, hdferr) CALL h5dopen_f(d%fid, 'energy', d%energysetid, hdferr)
CALL h5dopen_f(d%fid, 'w_iks', d%wikssetid, hdferr)
CALL h5dopen_f(d%fid, 'neig', d%neigsetid, hdferr) CALL h5dopen_f(d%fid, 'neig', d%neigsetid, hdferr)
CALL h5dopen_f(d%fid, 'ev', d%evsetid, hdferr) CALL h5dopen_f(d%fid, 'ev', d%evsetid, hdferr)
endif endif
...@@ -215,7 +209,7 @@ CONTAINS ...@@ -215,7 +209,7 @@ CONTAINS
#endif #endif
SUBROUTINE write_eig(id, nk, jspin, neig, neig_total, eig, w_iks, n_size, n_rank, zmat, smat) SUBROUTINE write_eig(id, nk, jspin, neig, neig_total, eig, n_size, n_rank, zmat, smat)
!***************************************************************** !*****************************************************************
! writes all eignevecs for the nk-th kpoint ! writes all eignevecs for the nk-th kpoint
...@@ -225,7 +219,7 @@ CONTAINS ...@@ -225,7 +219,7 @@ CONTAINS
INTEGER, INTENT(IN) :: id, nk, jspin INTEGER, INTENT(IN) :: id, nk, jspin
INTEGER, INTENT(IN), OPTIONAL :: n_size, n_rank INTEGER, INTENT(IN), OPTIONAL :: n_size, n_rank
INTEGER, INTENT(IN), OPTIONAL :: neig, neig_total INTEGER, INTENT(IN), OPTIONAL :: neig, neig_total
REAL, INTENT(IN), OPTIONAL :: eig(:), w_iks(:) REAL, INTENT(IN), OPTIONAL :: eig(:)
TYPE(t_mat), INTENT(IN), OPTIONAL :: zmat, smat TYPE(t_mat), INTENT(IN), OPTIONAL :: zmat, smat
INTEGER i, j, k, nv_local, n1, n2, ne INTEGER i, j, k, nv_local, n1, n2, ne
...@@ -242,9 +236,6 @@ CONTAINS ...@@ -242,9 +236,6 @@ CONTAINS
! !
!write eigenvalues !write eigenvalues
! !
IF (PRESENT(w_iks)) THEN
CALL io_write_real1s(d%wikssetid, (/1, nk, jspin/), (/size(w_iks), 1, 1/), w_iks, (/1, 1, 1/))
ENDIF
IF (PRESENT(neig_total)) THEN IF (PRESENT(neig_total)) THEN
CALL io_write_integer0(d%neigsetid, (/nk, jspin/), (/1, 1/), neig_total) CALL io_write_integer0(d%neigsetid, (/nk, jspin/), (/1, 1/), neig_total)
...@@ -329,11 +320,11 @@ CONTAINS ...@@ -329,11 +320,11 @@ CONTAINS
#endif #endif
SUBROUTINE read_eig(id, nk, jspin, neig, eig, w_iks, list, zMat, smat) SUBROUTINE read_eig(id, nk, jspin, neig, eig, list, zMat, smat)
IMPLICIT NONE IMPLICIT NONE
INTEGER, INTENT(IN) :: id, nk, jspin INTEGER, INTENT(IN) :: id, nk, jspin
INTEGER, INTENT(OUT), OPTIONAL :: neig INTEGER, INTENT(OUT), OPTIONAL :: neig
REAL, INTENT(OUT), OPTIONAL :: eig(:), w_iks(:) REAL, INTENT(OUT), OPTIONAL :: eig(:)
INTEGER, INTENT(IN), OPTIONAL :: list(:) INTEGER, INTENT(IN), OPTIONAL :: list(:)
TYPE(t_mat), OPTIONAL :: zmat, smat TYPE(t_mat), OPTIONAL :: zmat, smat
...@@ -354,9 +345,6 @@ CONTAINS ...@@ -354,9 +345,6 @@ CONTAINS
CALL io_read_real1(d%energysetid, (/1, nk, jspin/), (/neig, 1, 1/),& CALL io_read_real1(d%energysetid, (/1, nk, jspin/), (/neig, 1, 1/),&
& eig(:neig)) & eig(:neig))
ENDIF ENDIF
IF (PRESENT(w_iks)) THEN
CALL io_read_real1(d%wikssetid, (/1, nk, jspin/), (/size(w_iks), 1, 1/), w_iks)
ENDIF
ENDIF ENDIF
IF (PRESENT(zMat)) THEN IF (PRESENT(zMat)) THEN
......
...@@ -114,7 +114,7 @@ CONTAINS ...@@ -114,7 +114,7 @@ CONTAINS
END SUBROUTINE close_eig END SUBROUTINE close_eig
SUBROUTINE read_eig(id, nk, jspin, neig, eig, w_iks, list, zmat, smat) SUBROUTINE read_eig(id, nk, jspin, neig, eig, list, zmat, smat)
USE m_eig66_hdf, ONLY: read_eig_hdf => read_eig USE m_eig66_hdf, ONLY: read_eig_hdf => read_eig
USE m_eig66_DA, ONLY: read_eig_DA => read_eig USE m_eig66_DA, ONLY: read_eig_DA => read_eig
USE m_eig66_mem, ONLY: read_eig_mem => read_eig USE m_eig66_mem, ONLY: read_eig_mem => read_eig
...@@ -122,27 +122,27 @@ CONTAINS ...@@ -122,27 +122,27 @@ CONTAINS
IMPLICIT NONE IMPLICIT NONE
INTEGER, INTENT(IN) :: id, nk, jspin INTEGER, INTENT(IN) :: id, nk, jspin
INTEGER, INTENT(OUT), OPTIONAL :: neig INTEGER, INTENT(OUT), OPTIONAL :: neig
REAL, INTENT(OUT), OPTIONAL :: eig(:), w_iks(:) REAL, INTENT(OUT), OPTIONAL :: eig(:)
INTEGER, INTENT(IN), OPTIONAL :: list(:) INTEGER, INTENT(IN), OPTIONAL :: list(:)
TYPE(t_mat), INTENT(INOUT), OPTIONAL :: zmat, smat TYPE(t_mat), INTENT(INOUT), OPTIONAL :: zmat, smat
INTEGER::n INTEGER::n
CALL timestart("IO (read)") CALL timestart("IO (read)")
SELECT CASE (eig66_data_mode(id)) SELECT CASE (eig66_data_mode(id))
CASE (DA_mode) CASE (DA_mode)
CALL read_eig_DA(id, nk, jspin, neig, eig, w_iks, list, zmat, smat) CALL read_eig_DA(id, nk, jspin, neig, eig, list, zmat, smat)
CASE (hdf_mode) CASE (hdf_mode)
CALL read_eig_hdf(id, nk, jspin, neig, eig, w_iks, list, zmat, smat) CALL read_eig_hdf(id, nk, jspin, neig, eig, list, zmat, smat)
CASE (mem_mode) CASE (mem_mode)
CALL read_eig_mem(id, nk, jspin, neig, eig, w_iks, list, zmat, smat) CALL read_eig_mem(id, nk, jspin, neig, eig, list, zmat, smat)
CASE (mpi_mode) CASE (mpi_mode)
CALL read_eig_mpi(id, nk, jspin, neig, eig, w_iks, list, zmat, smat) CALL read_eig_mpi(id, nk, jspin, neig, eig, list, zmat, smat)
CASE (-1) CASE (-1)
CALL juDFT_error("Could not read eig-file before opening", calledby="eig66_io") CALL juDFT_error("Could not read eig-file before opening", calledby="eig66_io")
END SELECT END SELECT
CALL timestop("IO (read)") CALL timestop("IO (read)")
END SUBROUTINE read_eig END SUBROUTINE read_eig
SUBROUTINE write_eig(id, nk, jspin, neig, neig_total, eig, w_iks, n_start, n_end, zmat, smat) SUBROUTINE write_eig(id, nk, jspin, neig, neig_total, eig, n_start, n_end, zmat, smat)
USE m_eig66_hdf, ONLY: write_eig_hdf => write_eig USE m_eig66_hdf, ONLY: write_eig_hdf => write_eig
USE m_eig66_DA, ONLY: write_eig_DA => write_eig USE m_eig66_DA, ONLY: write_eig_DA => write_eig
USE m_eig66_mem, ONLY: write_eig_MEM => write_eig USE m_eig66_mem, ONLY: write_eig_MEM => write_eig
...@@ -150,18 +150,18 @@ CONTAINS ...@@ -150,18 +150,18 @@ CONTAINS
IMPLICIT NONE IMPLICIT NONE
INTEGER, INTENT(IN) :: id, nk, jspin INTEGER, INTENT(IN) :: id, nk, jspin
INTEGER, INTENT(IN), OPTIONAL :: neig, neig_total, n_start, n_end INTEGER, INTENT(IN), OPTIONAL :: neig, neig_total, n_start, n_end
REAL, INTENT(IN), OPTIONAL :: eig(:), w_iks(:) REAL, INTENT(IN), OPTIONAL :: eig(:)
TYPE(t_Mat), INTENT(IN), OPTIONAL :: zmat, smat TYPE(t_Mat), INTENT(IN), OPTIONAL :: zmat, smat
CALL timestart("IO (write)") CALL timestart("IO (write)")
SELECT CASE (eig66_data_mode(id)) SELECT CASE (eig66_data_mode(id))
CASE (da_mode) CASE (da_mode)
CALL write_eig_DA(id, nk, jspin, neig, neig_total, eig, w_iks, n_start, n_end, zmat, smat) CALL write_eig_DA(id, nk, jspin, neig, neig_total, eig, n_start, n_end, zmat, smat)
CASE (hdf_mode) CASE (hdf_mode)
CALL write_eig_HDF(id, nk, jspin, neig, neig_total, eig, w_iks, n_start, n_end, zmat, smat) CALL write_eig_HDF(id, nk, jspin, neig, neig_total, eig, n_start, n_end, zmat, smat)
CASE (mem_mode) CASE (mem_mode)
CALL write_eig_Mem(id, nk, jspin, neig, neig_total, eig, w_iks, n_start, n_end, zmat, smat) CALL write_eig_Mem(id, nk, jspin, neig, neig_total, eig, n_start, n_end, zmat, smat)
CASE (MPI_mode) CASE (MPI_mode)
CALL write_eig_MPI(id, nk, jspin, neig, neig_total, eig, w_iks, n_start, n_end, zmat, smat) CALL write_eig_MPI(id, nk, jspin, neig, neig_total, eig, n_start, n_end, zmat, smat)
CASE (-1) CASE (-1)
CALL juDFT_error("Could not write eig-file before opening", calledby="eig66_io") CALL juDFT_error("Could not write eig-file before opening", calledby="eig66_io")
END SELECT END SELECT
......
...@@ -51,7 +51,7 @@ CONTAINS ...@@ -51,7 +51,7 @@ CONTAINS
!d%eig_eig !d%eig_eig
length = jspins length = jspins
IF (l_noco) length = 1 IF (l_noco) length = 1
ALLOCATE (d%eig_eig(neig, 2, jspins*nkpts)) !additional dimension for w_iks ALLOCATE (d%eig_eig(neig, jspins*nkpts))
!d%eig_vec !d%eig_vec
if (l_real .and. .not. l_soc) THEN if (l_real .and. .not. l_soc) THEN
ALLOCATE (d%eig_vecr(nmat*neig, length*nkpts)) ALLOCATE (d%eig_vecr(nmat*neig, length*nkpts))
...@@ -74,7 +74,7 @@ CONTAINS ...@@ -74,7 +74,7 @@ CONTAINS
USE m_eig66_da, ONLY: open_eig_IO => open_eig, read_eig_IO => read_eig, close_eig_IO => close_eig USE m_eig66_da, ONLY: open_eig_IO => open_eig, read_eig_IO => read_eig, close_eig_IO => close_eig
INTEGER:: jspin, nk, i, ii, iii, nv, tmp_id INTEGER:: jspin, nk, i, ii, iii, nv, tmp_id
REAL :: wk, bk3(3), evac(2) REAL :: wk, bk3(3), evac(2)
REAL :: eig(neig), w_iks(neig) REAL :: eig(neig)
TYPE(t_mat):: zmat TYPE(t_mat):: zmat
zmat%l_real = l_real zmat%l_real = l_real
...@@ -86,8 +86,8 @@ CONTAINS ...@@ -86,8 +86,8 @@ CONTAINS
CALL open_eig_IO(tmp_id, nmat, neig, nkpts, jspins, .FALSE., l_real, l_soc, .false., filename) CALL open_eig_IO(tmp_id, nmat, neig, nkpts, jspins, .FALSE., l_real, l_soc, .false., filename)
DO jspin = 1, jspins DO jspin = 1, jspins
DO nk = 1, nkpts DO nk = 1, nkpts
CALL read_eig_IO(tmp_id, nk, jspin, i, eig, w_iks, zmat=zmat) CALL read_eig_IO(tmp_id, nk, jspin, i, eig, zmat=zmat)
!CALL write_eig(id,nk,jspin,i,i,eig,w_iks,zmat=zmat) !CALL write_eig(id,nk,jspin,i,i,eig,zmat=zmat)
ENDDO ENDDO
ENDDO ENDDO
CALL close_eig_IO(tmp_id) CALL close_eig_IO(tmp_id)
...@@ -121,7 +121,7 @@ CONTAINS ...@@ -121,7 +121,7 @@ CONTAINS
INTEGER:: nk, jspin, nv, i, ii, tmp_id INTEGER:: nk, jspin, nv, i, ii, tmp_id
REAL :: wk, bk3(3), evac(2) REAL :: wk, bk3(3), evac(2)
REAL :: eig(SIZE(d%eig_eig, 1)), w_iks(SIZE(d%eig_eig, 1)) REAL :: eig(SIZE(d%eig_eig, 1))
TYPE(t_mat)::zmat TYPE(t_mat)::zmat
zmat%l_real = d%l_real zmat%l_real = d%l_real
zmat%matsize1 = d%nmat zmat%matsize1 = d%nmat
...@@ -133,8 +133,8 @@ CONTAINS ...@@ -133,8 +133,8 @@ CONTAINS
DO nk = 1, d%nkpts DO nk = 1, d%nkpts
!TODO this code is no longer working !TODO this code is no longer working
STOP "BUG" STOP "BUG"
!CALL read_eig(id,nk,jspin,nv,i,bk3,wk,ii,eig,w_iks,el,ello,evac,zmat=zmat) !CALL read_eig(id,nk,jspin,nv,i,bk3,wk,ii,eig,el,ello,evac,zmat=zmat)
!CALL write_eig_DA(tmp_id,nk,jspin,ii,ii,nv,i,bk3,wk,eig,w_iks,el,ello,evac,nlotot,zmat=zmat) !CALL write_eig_DA(tmp_id,nk,jspin,ii,ii,nv,i,bk3,wk,eig,el,ello,evac,nlotot,zmat=zmat)
ENDDO ENDDO
ENDDO ENDDO
CALL close_eig_DA(tmp_id) CALL close_eig_DA(tmp_id)
...@@ -142,11 +142,11 @@ CONTAINS ...@@ -142,11 +142,11 @@ CONTAINS
END SUBROUTINE priv_writetofile END SUBROUTINE priv_writetofile
END SUBROUTINE close_eig END SUBROUTINE close_eig
SUBROUTINE read_eig(id, nk, jspin, neig, eig, w_iks, list, zmat, smat) SUBROUTINE read_eig(id, nk, jspin, neig, eig, list, zmat, smat)
IMPLICIT NONE IMPLICIT NONE
INTEGER, INTENT(IN) :: id, nk, jspin INTEGER, INTENT(IN) :: id, nk, jspin
INTEGER, INTENT(OUT), OPTIONAL :: neig INTEGER, INTENT(OUT), OPTIONAL :: neig
REAL, INTENT(OUT), OPTIONAL :: eig(:), w_iks(:) REAL, INTENT(OUT), OPTIONAL :: eig(:)
INTEGER, INTENT(IN), OPTIONAL :: list(:) INTEGER, INTENT(IN), OPTIONAL :: list(:)
TYPE(t_mat), OPTIONAL :: zmat, smat TYPE(t_mat), OPTIONAL :: zmat, smat
...@@ -164,11 +164,7 @@ CONTAINS ...@@ -164,11 +164,7 @@ CONTAINS
!data from d%eig_eig !data from d%eig_eig
IF (PRESENT(eig)) THEN IF (PRESENT(eig)) THEN
eig = 0.0 eig = 0.0
eig = d%eig_eig(:SIZE(eig), 1, nrec) eig = d%eig_eig(:SIZE(eig), nrec)
ENDIF
IF (PRESENT(w_iks)) THEN
w_iks = 0.0
w_iks = d%eig_eig(:SIZE(w_iks), 2, nrec)
ENDIF ENDIF
!data from d%eig_vec !data from d%eig_vec
...@@ -240,11 +236,11 @@ CONTAINS ...@@ -240,11 +236,11 @@ CONTAINS
ENDIF ENDIF
END SUBROUTINE read_eig END SUBROUTINE read_eig
SUBROUTINE write_eig(id, nk, jspin, neig, neig_total, eig, w_iks, n_size, n_rank, zmat, smat) SUBROUTINE write_eig(id, nk, jspin, neig, neig_total, eig, n_size, n_rank, zmat, smat)
INTEGER, INTENT(IN) :: id, nk, jspin INTEGER, INTENT(IN) :: id, nk, jspin
INTEGER, INTENT(IN), OPTIONAL :: n_size, n_rank INTEGER, INTENT(IN), OPTIONAL :: n_size, n_rank
INTEGER, INTENT(IN), OPTIONAL :: neig, neig_total INTEGER, INTENT(IN), OPTIONAL :: neig, neig_total
REAL, INTENT(IN), OPTIONAL :: eig(:), w_iks(:) REAL, INTENT(IN), OPTIONAL :: eig(:)
TYPE(t_mat), INTENT(IN), OPTIONAL :: zmat, smat TYPE(t_mat), INTENT(IN), OPTIONAL :: zmat, smat
INTEGER::nrec INTEGER::nrec
TYPE(t_data_mem), POINTER:: d TYPE(t_data_mem), POINTER:: d
...@@ -263,10 +259,7 @@ CONTAINS ...@@ -263,10 +259,7 @@ CONTAINS
!data from d%eig_eig !data from d%eig_eig
IF (PRESENT(eig)) THEN IF (PRESENT(eig)) THEN
d%eig_eig(:SIZE(eig), 1, nrec) = eig d%eig_eig(:SIZE(eig), nrec) = eig
ENDIF
IF (PRESENT(w_iks)) THEN
d%eig_eig(:SIZE(w_iks), 2, nrec) = w_iks
ENDIF ENDIF
!data from d%eig_vec !data from d%eig_vec
IF (PRESENT(zmat)) THEN IF (PRESENT(zmat)) THEN
......
...@@ -64,9 +64,6 @@ CONTAINS ...@@ -64,9 +64,6 @@ CONTAINS
d%size_eig = neig d%size_eig = neig
CALL priv_create_memory(d%size_eig, local_slots, d%eig_handle, real_data_ptr=d%eig_data) CALL priv_create_memory(d%size_eig, local_slots, d%eig_handle, real_data_ptr=d%eig_data)
d%eig_data = 1E99 d%eig_data = 1E99
!The w_iks
CALL priv_create_memory(d%size_eig, local_slots, d%w_iks_handle, real_data_ptr=d%w_iks_data)
d%w_iks_data = 1E99
!The eigenvectors !The eigenvectors
local_slots = COUNT(d%pe_ev == d%irank) local_slots = COUNT(d%pe_ev == d%irank)
...@@ -165,11 +162,11 @@ CONTAINS ...@@ -165,11 +162,11 @@ CONTAINS
IF (PRESENT(filename)) CALL judft_error("Storing of data not implemented for MPI case", calledby="eig66_mpi.F") IF (PRESENT(filename)) CALL judft_error("Storing of data not implemented for MPI case", calledby="eig66_mpi.F")
END SUBROUTINE close_eig END SUBROUTINE close_eig
SUBROUTINE read_eig(id, nk, jspin, neig, eig, w_iks, list, zmat, smat) SUBROUTINE read_eig(id, nk, jspin, neig, eig, list, zmat, smat)
IMPLICIT NONE IMPLICIT NONE
INTEGER, INTENT(IN) :: id, nk, jspin INTEGER, INTENT(IN) :: id, nk, jspin
INTEGER, INTENT(OUT), OPTIONAL :: neig INTEGER, INTENT(OUT), OPTIONAL :: neig
REAL, INTENT(OUT), OPTIONAL :: eig(:), w_iks(:) REAL, INTENT(OUT), OPTIONAL :: eig(:)
INTEGER, INTENT(IN), OPTIONAL :: list(:) INTEGER, INTENT(IN), OPTIONAL :: list(:)
TYPE(t_mat), OPTIONAL :: zmat, smat TYPE(t_mat), OPTIONAL :: zmat, smat
...@@ -190,7 +187,7 @@ CONTAINS ...@@ -190,7 +187,7 @@ CONTAINS
CALL MPI_GET(neig, 1, MPI_INTEGER, pe, slot, 1, MPI_INTEGER, d%neig_handle, e) CALL MPI_GET(neig, 1, MPI_INTEGER, pe, slot, 1, MPI_INTEGER, d%neig_handle, e)
CALL MPI_WIN_UNLOCK(pe, d%neig_handle, e) CALL MPI_WIN_UNLOCK(pe, d%neig_handle, e)
ENDIF ENDIF
IF (PRESENT(eig) .OR. PRESENT(w_iks)) THEN IF (PRESENT(eig)) THEN
ALLOCATE (tmp_real(MIN(SIZE(eig), d%size_eig))) ALLOCATE (tmp_real(MIN(SIZE(eig), d%size_eig)))
IF (PRESENT(eig)) THEN IF (PRESENT(eig)) THEN
CALL MPI_WIN_LOCK(MPI_LOCK_SHARED, pe, 0, d%eig_handle, e) CALL MPI_WIN_LOCK(MPI_LOCK_SHARED, pe, 0, d%eig_handle, e)
...@@ -198,12 +195,6 @@ CONTAINS ...@@ -198,12 +195,6 @@ CONTAINS
CALL MPI_WIN_UNLOCK(pe, d%eig_handle, e) CALL MPI_WIN_UNLOCK(pe, d%eig_handle, e)
eig(:SIZE(tmp_real)) = tmp_real eig(:SIZE(tmp_real)) = tmp_real
END IF END IF
IF (PRESENT(w_iks)) THEN
CALL MPI_WIN_LOCK(MPI_LOCK_SHARED, pe, 0, d%w_iks_handle, e)
CALL MPI_GET(tmp_real, SIZE(tmp_real), MPI_DOUBLE_PRECISION, pe, slot, SIZE(tmp_real), MPI_DOUBLE_PRECISION, d%w_iks_handle, e)
CALL MPI_WIN_UNLOCK(pe, d%w_iks_handle, e)
w_iks(:SIZE(tmp_real)) = tmp_real
END IF
DEALLOCATE (tmp_real) DEALLOCATE (tmp_real)
ENDIF ENDIF
...@@ -289,11 +280,11 @@ CONTAINS ...@@ -289,11 +280,11 @@ CONTAINS
#endif #endif
END SUBROUTINE read_eig END SUBROUTINE read_eig
SUBROUTINE write_eig(id, nk, jspin, neig, neig_total, eig, w_iks, n_size, n_rank, zmat, smat) SUBROUTINE write_eig(id, nk, jspin, neig, neig_total, eig, n_size, n_rank, zmat, smat)
INTEGER, INTENT(IN) :: id, nk, jspin INTEGER, INTENT(IN) :: id, nk, jspin
INTEGER, INTENT(IN), OPTIONAL :: n_size, n_rank INTEGER, INTENT(IN), OPTIONAL :: n_size, n_rank
INTEGER, INTENT(IN), OPTIONAL :: neig, neig_total INTEGER, INTENT(IN), OPTIONAL :: neig, neig_total
REAL, INTENT(IN), OPTIONAL :: eig(:), w_iks(:) REAL, INTENT(IN), OPTIONAL :: eig(:)
TYPE(t_mat), INTENT(IN), OPTIONAL :: zmat, smat TYPE(t_mat), INTENT(IN), OPTIONAL :: zmat, smat
#ifdef CPP_MPI #ifdef CPP_MPI
...@@ -327,7 +318,7 @@ CONTAINS ...@@ -327,7 +318,7 @@ CONTAINS
!write the eigenvalues !write the eigenvalues
!only one process needs to do it !only one process needs to do it
IF (PRESENT(eig) .OR. PRESENT(w_iks)) THEN IF (PRESENT(eig)) THEN
ALLOCATE (tmp_real(d%size_eig)) ALLOCATE (tmp_real(d%size_eig))
tmp_real = 1E99 tmp_real = 1E99
IF (PRESENT(EIG)) THEN IF (PRESENT(EIG)) THEN
...@@ -336,12 +327,6 @@ CONTAINS ...@@ -336,12 +327,6 @@ CONTAINS
CALL MPI_PUT(tmp_real, d%size_eig, MPI_DOUBLE_PRECISION, pe, slot, d%size_eig, MPI_DOUBLE_PRECISION, d%eig_handle, e) CALL MPI_PUT(tmp_real, d%size_eig, MPI_DOUBLE_PRECISION, pe, slot, d%size_eig, MPI_DOUBLE_PRECISION, d%eig_handle, e)
CALL MPI_WIN_UNLOCK(pe, d%eig_handle, e)