Commit aa4f501a authored by Gregor Michalicek's avatar Gregor Michalicek

Eliminate disc storage of Coulomb potential

parent be9ae2bb
...@@ -38,9 +38,6 @@ CONTAINS ...@@ -38,9 +38,6 @@ CONTAINS
!USE m_icorrkeys !USE m_icorrkeys
USE m_eig66_io, ONLY : open_eig, write_eig, close_eig,read_eig USE m_eig66_io, ONLY : open_eig, write_eig, close_eig,read_eig
USE m_xmlOutput USE m_xmlOutput
#ifdef CPP_MPI
USE m_mpi_bc_pot
#endif
IMPLICIT NONE IMPLICIT NONE
TYPE(t_results),INTENT(INOUT):: results TYPE(t_results),INTENT(INOUT):: results
...@@ -154,10 +151,6 @@ CONTAINS ...@@ -154,10 +151,6 @@ CONTAINS
! CALL readPotential(stars,vacuum,atoms,sphhar,input,sym,POT_ARCHIVE_TYPE_TOT_const,& ! CALL readPotential(stars,vacuum,atoms,sphhar,input,sym,POT_ARCHIVE_TYPE_TOT_const,&
! v%iter,v%mt,v%pw,v%vacz,v%vacxy) ! v%iter,v%mt,v%pw,v%vacz,v%vacxy)
!END IF !END IF
#ifdef CPP_MPI
CALL mpi_bc_pot(mpi,stars,sphhar,atoms,input,vacuum,&
v%iter,v%mt,v%pw,v%vacz,v%vacxy)
#endif
999 CONTINUE 999 CONTINUE
IF (mpi%irank.EQ.0) CALL openXMLElementFormPoly('iteration',(/'numberForCurrentRun','overallNumber '/),(/it,v%iter/),& IF (mpi%irank.EQ.0) CALL openXMLElementFormPoly('iteration',(/'numberForCurrentRun','overallNumber '/),(/it,v%iter/),&
......
...@@ -102,7 +102,7 @@ CONTAINS ...@@ -102,7 +102,7 @@ CONTAINS
TYPE(t_mpi) :: mpi TYPE(t_mpi) :: mpi
TYPE(t_coreSpecInput) :: coreSpecInput TYPE(t_coreSpecInput) :: coreSpecInput
TYPE(t_wann) :: wann TYPE(t_wann) :: wann
TYPE(t_potden) :: v,vx TYPE(t_potden) :: vTot,vx,vCoul
TYPE(t_potden) :: inDen, outDen, mixDen TYPE(t_potden) :: inDen, outDen, mixDen
! .. Local Scalars .. ! .. Local Scalars ..
...@@ -301,7 +301,7 @@ CONTAINS ...@@ -301,7 +301,7 @@ CONTAINS
!HF !HF
IF (hybrid%l_hybrid) CALL calc_hybrid(hybrid,kpts,atoms,input,DIMENSION,mpi,noco,& IF (hybrid%l_hybrid) CALL calc_hybrid(hybrid,kpts,atoms,input,DIMENSION,mpi,noco,&
cell,vacuum,oneD,banddos,results,sym,xcpot,v,it) cell,vacuum,oneD,banddos,results,sym,xcpot,vTot,it)
!#endif !#endif
DO pc = 1, wann%nparampts DO pc = 1, wann%nparampts
...@@ -320,7 +320,7 @@ CONTAINS ...@@ -320,7 +320,7 @@ CONTAINS
CALL timestart("generation of potential") CALL timestart("generation of potential")
IF (mpi%irank==0) WRITE(*,"(a)",advance="no") " * Potential generation " IF (mpi%irank==0) WRITE(*,"(a)",advance="no") " * Potential generation "
CALL vgen(hybrid,reap,input,xcpot,DIMENSION, atoms,sphhar,stars,vacuum,& CALL vgen(hybrid,reap,input,xcpot,DIMENSION, atoms,sphhar,stars,vacuum,&
sym,obsolete,cell, oneD,sliceplot,mpi ,results,noco,inDen,v,vx) sym,obsolete,cell, oneD,sliceplot,mpi ,results,noco,inDen,vTot,vx,vCoul)
CALL timestop("generation of potential") CALL timestop("generation of potential")
IF (mpi%irank.EQ.0) THEN IF (mpi%irank.EQ.0) THEN
...@@ -395,7 +395,7 @@ CONTAINS ...@@ -395,7 +395,7 @@ CONTAINS
IF (mpi%irank==0) WRITE(*,"(a)",advance="no") "* Eigenvalue problem " IF (mpi%irank==0) WRITE(*,"(a)",advance="no") "* Eigenvalue problem "
CALL eigen(mpi,stars,sphhar,atoms,obsolete,xcpot,& CALL eigen(mpi,stars,sphhar,atoms,obsolete,xcpot,&
sym,kpts,DIMENSION,vacuum,input,cell,enpara,banddos,noco,jij,oneD,hybrid,& sym,kpts,DIMENSION,vacuum,input,cell,enpara,banddos,noco,jij,oneD,hybrid,&
it,eig_id,inDen,results,v,vx) it,eig_id,inDen,results,vTot,vx)
eig_idList(pc) = eig_id eig_idList(pc) = eig_id
CALL timestop("eigen") CALL timestop("eigen")
! !
...@@ -627,7 +627,7 @@ CONTAINS ...@@ -627,7 +627,7 @@ CONTAINS
input%total = .FALSE. input%total = .FALSE.
CALL timestart("generation of potential (total)") CALL timestart("generation of potential (total)")
CALL vgen(hybrid,reap,input,xcpot,DIMENSION, atoms,sphhar,stars,vacuum,sym,& CALL vgen(hybrid,reap,input,xcpot,DIMENSION, atoms,sphhar,stars,vacuum,sym,&
obsolete,cell,oneD,sliceplot,mpi, results,noco,outDen,v,vx) obsolete,cell,oneD,sliceplot,mpi, results,noco,outDen,vTot,vx,vCoul)
CALL timestop("generation of potential (total)") CALL timestop("generation of potential (total)")
CALL potdis(stars,vacuum,atoms,sphhar, input,cell,sym) CALL potdis(stars,vacuum,atoms,sphhar, input,cell,sym)
...@@ -636,7 +636,7 @@ CONTAINS ...@@ -636,7 +636,7 @@ CONTAINS
!----> total energy !----> total energy
CALL timestart('determination of total energy') CALL timestart('determination of total energy')
CALL totale(atoms,sphhar,stars,vacuum,DIMENSION,& CALL totale(atoms,sphhar,stars,vacuum,DIMENSION,&
sym,input,noco,cell,oneD,xcpot,hybrid,it,results) sym,input,noco,cell,oneD,xcpot,hybrid,vTot,vCoul,it,results)
CALL timestop('determination of total energy') CALL timestop('determination of total energy')
......
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
MODULE m_totale MODULE m_totale
CONTAINS CONTAINS
SUBROUTINE totale(atoms,sphhar,stars,vacuum,dimension, & SUBROUTINE totale(atoms,sphhar,stars,vacuum,dimension, &
sym,input,noco,cell,oneD, xcpot,hybrid, it,results) sym,input,noco,cell,oneD, xcpot,hybrid,vTot,vCoul,it,results)
! !
! *************************************************** ! ***************************************************
! subroutine calculates the total energy ! subroutine calculates the total energy
...@@ -64,6 +64,7 @@ CONTAINS ...@@ -64,6 +64,7 @@ CONTAINS
TYPE(t_sphhar),INTENT(IN) :: sphhar TYPE(t_sphhar),INTENT(IN) :: sphhar
TYPE(t_atoms),INTENT(IN) :: atoms TYPE(t_atoms),INTENT(IN) :: atoms
TYPE(t_dimension),INTENT(IN) :: dimension TYPE(t_dimension),INTENT(IN) :: dimension
TYPE(t_potden),INTENT(IN) :: vTot,vCoul
! .. ! ..
! .. Scalar Arguments .. ! .. Scalar Arguments ..
INTEGER,INTENT (IN) :: it INTEGER,INTENT (IN) :: it
...@@ -149,26 +150,15 @@ CONTAINS ...@@ -149,26 +150,15 @@ CONTAINS
CALL readDensity(stars,vacuum,atoms,cell,sphhar,input,sym,oneD,archiveType,& CALL readDensity(stars,vacuum,atoms,cell,sphhar,input,sym,oneD,archiveType,&
CDN_INPUT_DEN_const,0,fermiEnergyTemp,l_qfix,iter,rho,qpw,rht,rhtxy,cdom,cdomvz,cdomvxy) CDN_INPUT_DEN_const,0,fermiEnergyTemp,l_qfix,iter,rho,qpw,rht,rhtxy,cdom,cdomvz,cdomvxy)
!+for
! ---> reload the COULOMB potential
!
CALL readPotential(stars,vacuum,atoms,sphhar,input,sym,POT_ARCHIVE_TYPE_COUL_const,&
iter,vr,vpw,vz,vxy)
!
! CLASSICAL HELLMAN-FEYNMAN FORCE ! CLASSICAL HELLMAN-FEYNMAN FORCE
! CALL force_a3(atoms,sphhar, input, rho,vCoul%mt, results%force)
CALL force_a3(atoms,sphhar, input, rho,vr, results%force)
!
IF (input%l_f) THEN IF (input%l_f) THEN
!
! core contribution to force: needs TOTAL POTENTIAL and core charge ! core contribution to force: needs TOTAL POTENTIAL and core charge
CALL readPotential(stars,vacuum,atoms,sphhar,input,sym,POT_ARCHIVE_TYPE_TOT_const,& CALL force_a4(atoms,sphhar,input,dimension, vTot%mt, results%force)
iter,vr,vpw,vz,vxy)
CALL force_a4(atoms,sphhar,input,dimension, vr, results%force)
!
ENDIF ENDIF
!
!-for !-for
! ---> add spin-up and spin-down charge density for lh=0 ! ---> add spin-up and spin-down charge density for lh=0
......
This diff is collapsed.
...@@ -24,18 +24,21 @@ CONTAINS ...@@ -24,18 +24,21 @@ CONTAINS
TYPE(t_potden),INTENT(INOUT) :: potden TYPE(t_potden),INTENT(INOUT) :: potden
INTEGER :: n, ierr(3) INTEGER :: n, ierr(3)
LOGICAL :: l_nocoAlloc, l_denMatAlloc LOGICAL :: l_nocoAlloc, l_denMatAlloc, l_vaczAlloc
CALL MPI_BCAST(potden%iter,1,MPI_INTEGER,0,mpi%mpi_comm,ierr) CALL MPI_BCAST(potden%iter,1,MPI_INTEGER,0,mpi%mpi_comm,ierr)
l_nocoAlloc = .FALSE. l_nocoAlloc = .FALSE.
l_denMatAlloc = .FALSE. l_denMatAlloc = .FALSE.
l_vaczAlloc = .FALSE.
IF(mpi%irank.EQ.0) THEN IF(mpi%irank.EQ.0) THEN
IF (ALLOCATED(potden%cdom)) l_nocoAlloc = .TRUE. IF (ALLOCATED(potden%cdom)) l_nocoAlloc = .TRUE.
IF (ALLOCATED(potden%mmpMat)) l_denMatAlloc = .TRUE. IF (ALLOCATED(potden%mmpMat)) l_denMatAlloc = .TRUE.
IF (ALLOCATED(potden%vacz)) l_vaczAlloc = .TRUE.
END IF END IF
CALL MPI_BCAST(l_nocoAlloc,1,MPI_LOGICAL,0,mpi%mpi_comm,ierr) CALL MPI_BCAST(l_nocoAlloc,1,MPI_LOGICAL,0,mpi%mpi_comm,ierr)
CALL MPI_BCAST(l_denMatAlloc,1,MPI_LOGICAL,0,mpi%mpi_comm,ierr) CALL MPI_BCAST(l_denMatAlloc,1,MPI_LOGICAL,0,mpi%mpi_comm,ierr)
CALL MPI_BCAST(l_vaczAlloc,1,MPI_LOGICAL,0,mpi%mpi_comm,ierr)
IF((mpi%irank.NE.0).AND.l_nocoAlloc) THEN IF((mpi%irank.NE.0).AND.l_nocoAlloc) THEN
IF (noco%l_noco) THEN IF (noco%l_noco) THEN
IF(.NOT.ALLOCATED(potden%cdom)) ALLOCATE (potden%cdom(stars%ng3)) IF(.NOT.ALLOCATED(potden%cdom)) ALLOCATE (potden%cdom(stars%ng3))
...@@ -65,11 +68,13 @@ CONTAINS ...@@ -65,11 +68,13 @@ CONTAINS
n = atoms%jmtd * (sphhar%nlhd+1) * atoms%ntype * input%jspins n = atoms%jmtd * (sphhar%nlhd+1) * atoms%ntype * input%jspins
CALL MPI_BCAST(potden%mt,n,MPI_DOUBLE,0,mpi%mpi_comm,ierr) CALL MPI_BCAST(potden%mt,n,MPI_DOUBLE,0,mpi%mpi_comm,ierr)
IF (l_vaczAlloc) THEN
n = vacuum%nmzd * 2 * SIZE(potden%vacz,3) n = vacuum%nmzd * 2 * SIZE(potden%vacz,3)
CALL MPI_BCAST(potden%vacz,n,MPI_DOUBLE,0,mpi%mpi_comm,ierr) CALL MPI_BCAST(potden%vacz,n,MPI_DOUBLE,0,mpi%mpi_comm,ierr)
n = vacuum%nmzxyd * (stars%ng2-1) * 2 * input%jspins n = vacuum%nmzxyd * (stars%ng2-1) * 2 * input%jspins
CALL MPI_BCAST(potden%vacxy,n,MPI_DOUBLE_COMPLEX,0,mpi%mpi_comm,ierr) CALL MPI_BCAST(potden%vacxy,n,MPI_DOUBLE_COMPLEX,0,mpi%mpi_comm,ierr)
END IF
IF (l_nocoAlloc) THEN IF (l_nocoAlloc) THEN
n = SIZE(potden%cdom,1) n = SIZE(potden%cdom,1)
......
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