Commit fbfc1ac9 authored by Miriam Hinzen's avatar Miriam Hinzen

Fix mix and broadcast parameter

parent ed1b48ad
...@@ -112,7 +112,7 @@ CONTAINS ...@@ -112,7 +112,7 @@ CONTAINS
#endif #endif
mpi%mpi_comm = mpi_comm mpi%mpi_comm = mpi_comm
CALL timestart("Initialization") CALL timestart("Initialization")
CALL fleur_init(mpi,input,field,DIMENSION,atoms,sphhar,cell,stars,sym,noco,vacuum,forcetheo,& CALL fleur_init(mpi,input,field,DIMENSION,atoms,sphhar,cell,stars,sym,noco,vacuum,forcetheo,&
sliceplot,banddos,obsolete,enpara,xcpot,results,kpts,hybrid,& sliceplot,banddos,obsolete,enpara,xcpot,results,kpts,hybrid,&
...@@ -241,7 +241,6 @@ CONTAINS ...@@ -241,7 +241,6 @@ CONTAINS
#ifdef CPP_MPI #ifdef CPP_MPI
CALL MPI_BARRIER(mpi%mpi_comm,ierr) CALL MPI_BARRIER(mpi%mpi_comm,ierr)
#endif #endif
...@@ -250,7 +249,6 @@ CONTAINS ...@@ -250,7 +249,6 @@ CONTAINS
forcetheoloop:DO WHILE(forcetheo%next_job(it==input%itmax,noco)) forcetheoloop:DO WHILE(forcetheo%next_job(it==input%itmax,noco))
CALL timestart("generation of hamiltonian and diagonalization (total)") CALL timestart("generation of hamiltonian and diagonalization (total)")
CALL timestart("eigen") CALL timestart("eigen")
vTemp = vTot vTemp = vTot
...@@ -299,6 +297,7 @@ CONTAINS ...@@ -299,6 +297,7 @@ CONTAINS
IF ( (mpi%irank.EQ.0)) THEN IF ( (mpi%irank.EQ.0)) THEN
CALL timestart("determination of fermi energy") CALL timestart("determination of fermi energy")
write(657,*) 'before fermie'
IF ( noco%l_soc .AND. (.NOT. noco%l_noco) ) THEN IF ( noco%l_soc .AND. (.NOT. noco%l_noco) ) THEN
input%zelec = input%zelec*2 input%zelec = input%zelec*2
CALL fermie(eig_id,mpi,kpts,obsolete,& CALL fermie(eig_id,mpi,kpts,obsolete,&
...@@ -311,6 +310,7 @@ CONTAINS ...@@ -311,6 +310,7 @@ CONTAINS
input,noco,enpara%epara_min,cell,results) input,noco,enpara%epara_min,cell,results)
ENDIF ENDIF
CALL timestop("determination of fermi energy") CALL timestop("determination of fermi energy")
write(657,*) 'after fermie'
!!$ !!$
!!$ !+Wannier !!$ !+Wannier
!!$ IF(wann%l_bs_comf)THEN !!$ IF(wann%l_bs_comf)THEN
...@@ -365,9 +365,11 @@ CONTAINS ...@@ -365,9 +365,11 @@ CONTAINS
enpara,cell,noco,vTot,results,oneD,coreSpecInput,& enpara,cell,noco,vTot,results,oneD,coreSpecInput,&
archiveType,outDen) archiveType,outDen)
write(657,*) 'before rdmft'
IF (.FALSE.) CALL rdmft(eig_id,mpi,input,kpts,banddos,cell,atoms,enpara,stars,vacuum,dimension,& IF (.FALSE.) CALL rdmft(eig_id,mpi,input,kpts,banddos,cell,atoms,enpara,stars,vacuum,dimension,&
sphhar,sym,field,vTot,oneD,noco,results) sphhar,sym,field,vTot,oneD,noco,results)
write(657,*) 'after rdmft'
IF ( noco%l_soc .AND. (.NOT. noco%l_noco) ) DIMENSION%neigd=DIMENSION%neigd/2 IF ( noco%l_soc .AND. (.NOT. noco%l_noco) ) DIMENSION%neigd=DIMENSION%neigd/2
!+t3e !+t3e
#ifdef CPP_MPI #ifdef CPP_MPI
...@@ -419,6 +421,7 @@ CONTAINS ...@@ -419,6 +421,7 @@ CONTAINS
CALL enpara%mix(mpi,atoms,vacuum,input,vTot%mt(:,0,:,:),vtot%vacz) CALL enpara%mix(mpi,atoms,vacuum,input,vTot%mt(:,0,:,:),vtot%vacz)
field2 = field field2 = field
! ----> mix input and output densities ! ----> mix input and output densities
write(657,*) 'before mix'
CALL timestart("mixing") CALL timestart("mixing")
CALL mix( field2, xcpot, dimension, obsolete, sliceplot, mpi, & CALL mix( field2, xcpot, dimension, obsolete, sliceplot, mpi, &
stars, atoms, sphhar, vacuum, input, sym, cell, noco, & stars, atoms, sphhar, vacuum, input, sym, cell, noco, &
......
...@@ -250,6 +250,7 @@ ...@@ -250,6 +250,7 @@
CALL MPI_BCAST(input%jspins,1,MPI_INTEGER,0,mpi%mpi_comm,ierr) CALL MPI_BCAST(input%jspins,1,MPI_INTEGER,0,mpi%mpi_comm,ierr)
CALL MPI_BCAST(atoms%n_u,1,MPI_INTEGER,0,mpi%mpi_comm,ierr) CALL MPI_BCAST(atoms%n_u,1,MPI_INTEGER,0,mpi%mpi_comm,ierr)
CALL MPI_BCAST(atoms%lmaxd,1,MPI_INTEGER,0,mpi%mpi_comm,ierr) CALL MPI_BCAST(atoms%lmaxd,1,MPI_INTEGER,0,mpi%mpi_comm,ierr)
call MPI_BCAST( input%preconditioning_param, 1, MPI_DOUBLE, 0, mpi%mpi_comm, ierr )
#endif #endif
CALL ylmnorm_init(atoms%lmaxd) CALL ylmnorm_init(atoms%lmaxd)
! !
......
...@@ -36,6 +36,9 @@ contains ...@@ -36,6 +36,9 @@ contains
use m_xmlOutput use m_xmlOutput
use m_umix use m_umix
use m_vgen_coulomb use m_vgen_coulomb
#ifdef CPP_MPI
use m_mpi_bc_potden
#endif
implicit none implicit none
type(t_oneD), intent(in) :: oneD type(t_oneD), intent(in) :: oneD
...@@ -172,24 +175,27 @@ contains ...@@ -172,24 +175,27 @@ contains
if( input%preconditioning_param /= 0 ) then if( input%preconditioning_param /= 0 ) then
call resDen%init( stars, atoms, sphhar, vacuum, input%jspins, noco%l_noco, 1001 ) call resDen%init( stars, atoms, sphhar, vacuum, input%jspins, noco%l_noco, 1001 )
call vYukawa%init( stars, atoms, sphhar, vacuum, input%jspins, noco%l_noco, 4 ) call vYukawa%init( stars, atoms, sphhar, vacuum, input%jspins, noco%l_noco, 4 )
if( mpi%irank == 0 ) then MPI0_b: if( mpi%irank == 0 ) then
call resDen%Residual( outDen, inDen ) call resDen%Residual( outDen, inDen )
if( input%jspins == 2 ) call resDen%SpinsToChargeAndMagnetisation() if( input%jspins == 2 ) call resDen%SpinsToChargeAndMagnetisation()
end if end if MPI0_b
#ifdef CPP_MPI
call mpi_bc_potden( mpi, stars, sphhar, atoms, input, vacuum, oneD, noco, resDen )
#endif
call vgen_coulomb( 1, mpi, dimension, oneD, input, field, vacuum, sym, stars, cell, & call vgen_coulomb( 1, mpi, dimension, oneD, input, field, vacuum, sym, stars, cell, &
sphhar, atoms, resDen, vYukawa ) sphhar, atoms, resDen, vYukawa )
resDen%pw(1:stars%ng3,1) = resDen%pw(1:stars%ng3,1) - input%preconditioning_param ** 2 / fpi_const * vYukawa%pw(1:stars%ng3,1)
do n = 1, atoms%ntype
do lh = 0, sphhar%nlhd
resDen%mt(1:atoms%jri(n),lh,n,1) = resDen%mt(1:atoms%jri(n),lh,n,1) &
- input%preconditioning_param ** 2 / fpi_const &
* vYukawa%mt(1:atoms%jri(n),lh,n,1) * atoms%rmsh(1:atoms%jri(n),n) ** 2
end do
end do
if( input%jspins == 2 ) call resDen%ChargeAndMagnetisationToSpins()
end if end if
MPI0_b: if( mpi%irank == 0 ) then MPI0_c: if( mpi%irank == 0 ) then
if( input%preconditioning_param /= 0 ) then if( input%preconditioning_param /= 0 ) then
resDen%pw(1:stars%ng3,1) = resDen%pw(1:stars%ng3,1) - input%preconditioning_param ** 2 / fpi_const * vYukawa%pw(1:stars%ng3,1)
do n = 1, atoms%ntype
do lh = 0, sphhar%nlhd
resDen%mt(1:atoms%jri(n),lh,n,1) = resDen%mt(1:atoms%jri(n),lh,n,1) &
- input%preconditioning_param ** 2 / fpi_const &
* vYukawa%mt(1:atoms%jri(n),lh,n,1) * atoms%rmsh(1:atoms%jri(n),n) ** 2
end do
end do
if( input%jspins == 2 ) call resDen%ChargeAndMagnetisationToSpins()
call brysh1( input, stars, atoms, sphhar, noco, vacuum, sym, oneD, & call brysh1( input, stars, atoms, sphhar, noco, vacuum, sym, oneD, &
intfac, vacfac, resDen, nmap, nmaph, mapmt, mapvac, mapvac2, fsm ) intfac, vacfac, resDen, nmap, nmaph, mapmt, mapvac, mapvac2, fsm )
end if end if
...@@ -320,7 +326,7 @@ contains ...@@ -320,7 +326,7 @@ contains
8020 FORMAT (4d25.14) 8020 FORMAT (4d25.14)
8030 FORMAT (10i10) 8030 FORMAT (10i10)
end if MPI0_b end if MPI0_c
end subroutine mix end subroutine mix
......
...@@ -59,7 +59,6 @@ CONTAINS ...@@ -59,7 +59,6 @@ CONTAINS
if (mpi%irank==0) WRITE (6,FMT=8000) if (mpi%irank==0) WRITE (6,FMT=8000)
8000 FORMAT (/,/,t10,' p o t e n t i a l g e n e r a t o r',/) 8000 FORMAT (/,/,t10,' p o t e n t i a l g e n e r a t o r',/)
CALL vTot%resetPotDen() CALL vTot%resetPotDen()
CALL vCoul%resetPotDen() CALL vCoul%resetPotDen()
CALL vx%resetPotDen() CALL vx%resetPotDen()
...@@ -70,7 +69,7 @@ CONTAINS ...@@ -70,7 +69,7 @@ CONTAINS
!sum up both spins in den into workden !sum up both spins in den into workden
CALL den%sum_both_spin( workden ) CALL den%sum_both_spin( workden )
CALL vgen_coulomb( 1, mpi, DIMENSION, oneD, input, field, vacuum, sym, stars, cell, & CALL vgen_coulomb( 1, mpi, DIMENSION, oneD, input, field, vacuum, sym, stars, cell, &
sphhar, atoms, workden, vCoul, results ) sphhar, atoms, workden, vCoul, results )
......
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