Commit 45906f46 authored by Gregor Michalicek's avatar Gregor Michalicek

Even more cleanup in eig66 routines

This time: Removal of unused variables for obsolete energy parameter storage.
parent febc6cfd
......@@ -60,8 +60,8 @@ IMPLICIT NONE
IF (juDFT_was_argument("-diag:chase")) THEN
nevd = min(dimension%neigd,dimension%nvd+atoms%nlotot)
nexd = min(max(nevd/4, 45),dimension%nvd+atoms%nlotot-nevd) !dimensioning for workspace
chase_eig_id=open_eig(mpi%mpi_comm,DIMENSION%nbasfcn,nevd+nexd,kpts%nkpt,DIMENSION%jspd,atoms%lmaxd,&
atoms%nlod,atoms%ntype,atoms%nlotot,noco%l_noco,.TRUE.,l_real,noco%l_soc,.FALSE.,mpi%n_size)
chase_eig_id=open_eig(mpi%mpi_comm,DIMENSION%nbasfcn,nevd+nexd,kpts%nkpt,DIMENSION%jspd,&
noco%l_noco,.TRUE.,l_real,noco%l_soc,.FALSE.,mpi%n_size)
END IF
END SUBROUTINE init_chase
......
......@@ -115,8 +115,8 @@ CONTAINS
!IF (mpi%irank.EQ.0) CALL openXMLElementFormPoly('iteration',(/'numberForCurrentRun','overallNumber '/),(/iter,v%iter/),&
! RESHAPE((/19,13,5,5/),(/2,2/)))
eig_id=open_eig(mpi%mpi_comm,DIMENSION%nbasfcn,DIMENSION%neigd,kpts%nkpt,DIMENSION%jspd,atoms%lmaxd,&
atoms%nlod,atoms%ntype,atoms%nlotot,noco%l_noco,.TRUE.,l_real,noco%l_soc,.FALSE.,mpi%n_size)
eig_id=open_eig(mpi%mpi_comm,DIMENSION%nbasfcn,DIMENSION%neigd,kpts%nkpt,DIMENSION%jspd,&
noco%l_noco,.TRUE.,l_real,noco%l_soc,.FALSE.,mpi%n_size)
!---> set up and solve the eigenvalue problem
!---> loop over spins
......
......@@ -98,8 +98,8 @@ CONTAINS
CALL timestart("Preparation for Hybrid functionals")
CALL juDFT_WARN ("Hybrid functionals not working in this version")
eig_id=open_eig(mpi%mpi_comm,dimension%nbasfcn,dimension%neigd,kpts%nkpt,dimension%jspd,atoms%lmaxd,atoms%nlod,&
atoms%ntype,atoms%nlotot,noco%l_noco,.FALSE.,sym%invs.AND..NOT.noco%l_noco,noco%l_soc,.FALSE.,mpi%n_size)
eig_id=open_eig(mpi%mpi_comm,dimension%nbasfcn,dimension%neigd,kpts%nkpt,dimension%jspd,&
noco%l_noco,.FALSE.,sym%invs.AND..NOT.noco%l_noco,noco%l_soc,.FALSE.,mpi%n_size)
!construct the mixed-basis
CALL timestart("generation of mixed basis")
......
......@@ -34,8 +34,8 @@ CONTAINS
END SELECT
END SUBROUTINE priv_find_data
SUBROUTINE open_eig(id,nmat,neig,nkpts,jspins,lmax,nlo,ntype,nlotot,create,l_real,l_soc,filename)
INTEGER, INTENT(IN) :: id,nmat,neig,nkpts,jspins,nlo,ntype,lmax,nlotot
SUBROUTINE open_eig(id,nmat,neig,nkpts,jspins,create,l_real,l_soc,filename)
INTEGER, INTENT(IN) :: id,nmat,neig,nkpts,jspins
LOGICAL, INTENT(IN) :: create,l_real,l_soc
CHARACTER(LEN=*),INTENT(IN),OPTIONAL :: filename
!locals
......@@ -48,7 +48,7 @@ CONTAINS
CALL priv_find_data(id,d)
IF (PRESENT(filename)) d%fname=filename
CALL eig66_data_storedefault(d,jspins,nkpts,nmat,neig,lmax,nlotot,nlo,ntype,l_real,l_soc)
CALL eig66_data_storedefault(d,jspins,nkpts,nmat,neig,l_real,l_soc)
!Calculate the record length
......
......@@ -13,7 +13,7 @@ module m_eig66_data
TYPE :: t_data
INTEGER:: io_mode
INTEGER:: jspins,nkpts,nmat,neig,lmax,nlotot,nlo,ntype
INTEGER:: jspins,nkpts,nmat,neig,nlo,ntype
LOGICAL:: l_real,l_soc
END TYPE
......@@ -25,7 +25,7 @@ module m_eig66_data
TYPE,extends(t_data):: t_data_MPI
INTEGER :: n_size=1
INTEGER :: size_k,size_el,size_ello,size_eig
INTEGER :: size_k,size_eig
INTEGER :: eig_handle,zr_handle,zc_handle,neig_handle,w_iks_handle
INTEGER,ALLOCATABLE :: pe_basis(:,:),slot_basis(:,:)
INTEGER,ALLOCATABLE :: pe_ev(:,:,:),slot_ev(:,:,:)
......@@ -64,18 +64,14 @@ module m_eig66_data
contains
subroutine eig66_data_storedefault(d,jspins,nkpts,nmat,neig,lmax,nlotot,nlo,ntype,l_real,l_soc)
subroutine eig66_data_storedefault(d,jspins,nkpts,nmat,neig,l_real,l_soc)
CLASS(t_data)::d
INTEGER,INTENT(IN)::jspins,nkpts,nmat,neig,lmax,nlotot,nlo,ntype
INTEGER,INTENT(IN)::jspins,nkpts,nmat,neig
LOGICAL,INTENT(IN):: l_real,l_soc
d%jspins=jspins
d%nkpts=nkpts
d%nmat=nmat
d%neig=neig
d%lmax=lmax
d%nlotot=nlotot
d%nlo=nlo
d%ntype=ntype
d%l_real=l_real
d%l_soc=l_soc
END SUBROUTINE
......
......@@ -57,7 +57,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,nlotot,readonly,filename)
SUBROUTINE open_eig(id,mpi_comm,nmat,neig,nkpts,jspins,create,l_real,l_soc,readonly,filename)
!*****************************************************************
! opens hdf-file for eigenvectors+values
......@@ -65,7 +65,7 @@ CONTAINS
IMPLICIT NONE
INTEGER, INTENT(IN) :: id,mpi_comm
INTEGER, INTENT(IN) :: nmat,neig,nkpts,jspins,nlo,ntype,lmax,nlotot
INTEGER, INTENT(IN) :: nmat,neig,nkpts,jspins
LOGICAL, INTENT(IN) :: create,readonly,l_real,l_soc
CHARACTER(LEN=*),OPTIONAL :: filename
......@@ -95,7 +95,7 @@ CONTAINS
#endif
CALL priv_find_data(id,d)
IF (PRESENT(filename)) d%fname=filename
CALL eig66_data_storedefault(d,jspins,nkpts,nmat,neig,lmax,nlotot,nlo,ntype,l_real,l_soc)
CALL eig66_data_storedefault(d,jspins,nkpts,nmat,neig,l_real,l_soc)
!set access_flags according
IF (readonly) THEN
access_mode=H5F_ACC_RDONLY_F
......
......@@ -15,7 +15,7 @@ MODULE m_eig66_io
PUBLIC read_eig, write_eig
CONTAINS
FUNCTION open_eig(mpi_comm,nmat,neig,nkpts,jspins,lmax,nlo,ntype,nlotot,&
FUNCTION open_eig(mpi_comm,nmat,neig,nkpts,jspins,&
l_noco,l_create,l_real,l_soc,l_readonly,n_size,mode_in,filename)&
RESULT(id)
USE m_eig66_hdf,ONLY:open_eig_hdf=>open_eig
......@@ -23,7 +23,7 @@ CONTAINS
USE m_eig66_mem,ONLY:open_eig_mem=>open_eig
USE m_eig66_MPI,ONLY:open_eig_mpi=>open_eig
IMPLICIT NONE
INTEGER,INTENT(IN) :: nmat,neig,nkpts,jspins,lmax,nlo,ntype,nlotot,mpi_comm
INTEGER,INTENT(IN) :: nmat,neig,nkpts,jspins,mpi_comm
LOGICAL,INTENT(IN) :: l_noco,l_readonly,l_create,l_real,l_soc
INTEGER,INTENT(IN),OPTIONAL :: n_size,mode_in
CHARACTER(LEN=*),INTENT(IN),OPTIONAL :: filename
......@@ -70,13 +70,13 @@ CONTAINS
CALL timestart("Open file/memory for IO of eig66")
SELECT CASE (eig66_data_mode(id))
CASE (DA_mode)
CALL open_eig_DA(id,nmat,neig_local,nkpts,jspins,lmax,nlo,ntype,nlotot,l_create,l_real,l_soc,filename)
CALL open_eig_DA(id,nmat,neig_local,nkpts,jspins,l_create,l_real,l_soc,filename)
CASE (hdf_mode)
CALL open_eig_HDF(id,mpi_comm,nmat,neig_local,nkpts,jspins,lmax,nlo,ntype,l_create,l_real,l_soc,nlotot,l_readonly,filename)
CALL open_eig_HDF(id,mpi_comm,nmat,neig_local,nkpts,jspins,l_create,l_real,l_soc,l_readonly,filename)
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,filename)
CALL open_eig_MEM(id,nmat,neig_local,nkpts,jspins,l_create,l_real,l_soc,l_noco,filename)
CASE (mpi_mode)
CALL open_eig_MPI(id,mpi_comm,nmat,neig_local,nkpts,jspins,lmax,nlo,ntype,l_create,l_real,l_soc,nlotot,l_noco,n_size,filename)
CALL open_eig_MPI(id,mpi_comm,nmat,neig_local,nkpts,jspins,l_create,l_real,l_soc,l_noco,n_size,filename)
CASE DEFAULT
CALL juDFT_error("Invalid IO-mode in eig66_io")
END SELECT
......
......@@ -25,8 +25,8 @@ CONTAINS
END SELECT
END SUBROUTINE priv_find_data
SUBROUTINE open_eig(id,nmat,neig,nkpts,jspins,lmax,nlo,ntype,l_create,l_real,l_soc,nlotot,l_noco,filename)
INTEGER, INTENT(IN) :: id,nmat,neig,nkpts,jspins,nlo,ntype,lmax,nlotot
SUBROUTINE open_eig(id,nmat,neig,nkpts,jspins,l_create,l_real,l_soc,l_noco,filename)
INTEGER, INTENT(IN) :: id,nmat,neig,nkpts,jspins
LOGICAL, INTENT(IN) :: l_noco,l_create,l_real,l_soc
CHARACTER(LEN=*),INTENT(IN),OPTIONAL :: filename
!locals
......@@ -43,7 +43,7 @@ CONTAINS
ENDIF
CALL eig66_data_storedefault(d,jspins,nkpts,nmat,neig,lmax,nlotot,nlo,ntype,l_real,l_soc)
CALL eig66_data_storedefault(d,jspins,nkpts,nmat,neig,l_real,l_soc)
!d%eig_int
ALLOCATE(d%eig_int(jspins*nkpts))
......@@ -65,7 +65,7 @@ CONTAINS
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
REAL :: wk,bk3(3),evac(2)
REAL :: eig(neig),w_iks(neig),ello(d%nlo,d%ntype),el(d%lmax,d%ntype)
REAL :: eig(neig),w_iks(neig)
TYPE(t_mat):: zmat
zmat%l_real=l_real
......@@ -74,7 +74,7 @@ CONTAINS
ALLOCATE(zmat%data_r(nmat,neig),zmat%data_c(nmat,neig))
tmp_id=eig66_data_newid(DA_mode)
CALL open_eig_IO(tmp_id,nmat,neig,nkpts,jspins,d%lmax,d%nlo,d%ntype,nlotot,.FALSE.,l_real,l_soc,filename)
CALL open_eig_IO(tmp_id,nmat,neig,nkpts,jspins,.FALSE.,l_real,l_soc,filename)
DO jspin=1,jspins
DO nk=1,nkpts
CALL read_eig_IO(tmp_id,nk,jspin,i,eig,w_iks,zmat=zmat)
......@@ -108,16 +108,16 @@ CONTAINS
USE m_eig66_DA,ONLY:open_eig_DA=>open_eig,write_eig_DA=>write_eig,close_eig_DA=>close_eig
IMPLICIT NONE
INTEGER:: nlotot,nk,jspin,nv,i,ii,tmp_id
INTEGER:: nk,jspin,nv,i,ii,tmp_id
REAL :: wk,bk3(3),evac(2)
REAL :: eig(SIZE(d%eig_eig,1)),w_iks(SIZE(d%eig_eig,1)),ello(d%nlo,d%ntype),el(d%lmax,d%ntype)
REAL :: eig(SIZE(d%eig_eig,1)),w_iks(SIZE(d%eig_eig,1))
TYPE(t_mat)::zmat
zmat%l_real=d%l_real
zmat%matsize1=d%nmat
zmat%matsize2=SIZE(d%eig_eig,1)
ALLOCATE(zmat%data_r(d%nmat,SIZE(d%eig_eig,1)),zmat%data_c(d%nmat,SIZE(d%eig_eig,1)))
tmp_id=eig66_data_newid(DA_mode)
CALL open_eig_DA(tmp_id,d%nmat,d%neig,d%nkpts,d%jspins,d%lmax,d%nlo,d%ntype,d%nlotot,.FALSE.,d%l_real,d%l_soc,filename)
CALL open_eig_DA(tmp_id,d%nmat,d%neig,d%nkpts,d%jspins,.FALSE.,d%l_real,d%l_soc,filename)
DO jspin=1,d%jspins
DO nk=1,d%nkpts
!TODO this code is no longer working
......
......@@ -25,10 +25,10 @@ CONTAINS
END SUBROUTINE priv_find_data
SUBROUTINE open_eig(id,mpi_comm,nmat,neig,nkpts,jspins,lmax,nlo,ntype,create,l_real,l_soc,nlotot,l_noco,n_size_opt,filename)
SUBROUTINE open_eig(id,mpi_comm,nmat,neig,nkpts,jspins,create,l_real,l_soc,l_noco,n_size_opt,filename)
USE,INTRINSIC::iso_c_binding
IMPLICIT NONE
INTEGER, INTENT(IN) :: id,mpi_comm,nmat,neig,nkpts,jspins,nlo,ntype,lmax,nlotot
INTEGER, INTENT(IN) :: id,mpi_comm,nmat,neig,nkpts,jspins
LOGICAL, INTENT(IN) :: l_noco,create,l_real,l_soc
INTEGER,INTENT(IN),OPTIONAL:: n_size_opt
CHARACTER(LEN=*),INTENT(IN),OPTIONAL :: filename
......@@ -38,7 +38,7 @@ CONTAINS
TYPE(t_data_MPI),POINTER :: d
CALL priv_find_data(id,d)
CALL eig66_data_storedefault(d,jspins,nkpts,nmat,neig,lmax,nlotot,nlo,ntype,l_real.and..not.l_soc,l_soc)
CALL eig66_data_storedefault(d,jspins,nkpts,nmat,neig,l_real.and..not.l_soc,l_soc)
IF (PRESENT(n_size_opt)) d%n_size=n_size_opt
IF (ALLOCATED(d%pe_ev)) THEN
......@@ -142,7 +142,7 @@ CONTAINS
USE m_eig66_DA,ONLY:open_eig_DA=>open_eig,read_eig_DA=>read_eig,close_eig_da=>close_eig
INTEGER:: jspin,nk,i,ii,iii,nv,tmp_id
REAL :: wk,bk3(3),evac(2)
REAL :: eig(neig),w_iks(neig),ello(nlo,ntype),el(lmax,ntype)
REAL :: eig(neig),w_iks(neig)
TYPE(t_zmat)::zmat
zmat%l_real=d%l_real
zmat%nbasfcn=nmat
......@@ -151,7 +151,7 @@ CONTAINS
!only do this with PE=0
IF (d%irank==0) THEN
tmp_id=eig66_data_newid(DA_mode)
CALL open_eig_DA(tmp_id,nmat,neig,nkpts,jspins,lmax,nlo,ntype,nlotot,.FALSE.,d%l_real,l_soc,filename)
CALL open_eig_DA(tmp_id,nmat,neig,nkpts,jspins,.FALSE.,d%l_real,l_soc,filename)
DO jspin=1,jspins
DO nk=1,nkpts
!CALL read_eig_DA(tmp_id,nk,jspin,nv,i,bk3,wk,ii,eig,w_iks,el,ello,evac,zmat=zmat)
......@@ -180,19 +180,18 @@ CONTAINS
USE m_eig66_DA,ONLY:open_eig_DA=>open_eig,write_eig_DA=>write_eig,close_eig_DA=>close_eig
IMPLICIT NONE
INTEGER:: nlotot,nk,jspin,nv,i,ii,tmp_id
INTEGER:: nk,jspin,nv,i,ii,tmp_id
REAL :: wk,bk3(3),evac(2)
REAL :: eig(d%neig),w_iks(d%neig),ello(d%nlo,d%ntype),el(d%lmax,d%ntype)
REAL :: eig(d%neig),w_iks(d%neig)
TYPE(t_zmat)::zmat
zmat%l_real=d%l_real
zmat%nbasfcn=d%nmat
zmat%nbands=d%neig
allocate(zmat%z_r(d%nmat,d%neig),zmat%z_c(d%nmat,d%neig))
nlotot=d%nlotot
IF (d%irank==0) THEN
tmp_id=eig66_data_newid(DA_mode)
CALL open_eig_DA(tmp_id,d%nmat,d%neig,d%nkpts,d%jspins,d%lmax,d%nlo,d%ntype,d%nlotot,.FALSE.,d%l_real,d%l_soc,filename)
CALL open_eig_DA(tmp_id,d%nmat,d%neig,d%nkpts,d%jspins,.FALSE.,d%l_real,d%l_soc,filename)
DO jspin=1,d%jspins
DO nk=1,d%nkpts
!CALL read_eig(id,nk,jspin,nv,i,bk3,wk,ii,eig,w_iks,el,ello,evac,zmat=zmat)
......
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