Commit b0a2ce51 authored by Uliana Alekseeva's avatar Uliana Alekseeva

The mpi variable added in the cdntot subroutine

parent e9f9a1ea
...@@ -4,7 +4,7 @@ MODULE m_cdntot ...@@ -4,7 +4,7 @@ MODULE m_cdntot
! vacuum, and mt regions c.l.fu ! vacuum, and mt regions c.l.fu
! ******************************************************** ! ********************************************************
CONTAINS CONTAINS
SUBROUTINE cdntot(stars,atoms,sym,vacuum,input,cell,oneD,& SUBROUTINE cdntot(mpi,stars,atoms,sym,vacuum,input,cell,oneD,&
den,l_printData,qtot,qistot) den,l_printData,qtot,qistot)
USE m_intgr, ONLY : intgr3 USE m_intgr, ONLY : intgr3
...@@ -18,6 +18,7 @@ CONTAINS ...@@ -18,6 +18,7 @@ CONTAINS
IMPLICIT NONE IMPLICIT NONE
! .. Scalar Arguments .. ! .. Scalar Arguments ..
TYPE(t_mpi),INTENT(IN) :: mpi
TYPE(t_stars),INTENT(IN) :: stars TYPE(t_stars),INTENT(IN) :: stars
TYPE(t_atoms),INTENT(IN) :: atoms TYPE(t_atoms),INTENT(IN) :: atoms
TYPE(t_sym),INTENT(IN) :: sym TYPE(t_sym),INTENT(IN) :: sym
......
...@@ -11,7 +11,7 @@ MODULE m_qfix ...@@ -11,7 +11,7 @@ MODULE m_qfix
! qfix file no longer supported! ! qfix file no longer supported!
CONTAINS CONTAINS
SUBROUTINE qfix(stars,atoms,sym,vacuum,sphhar,input,cell,oneD,& SUBROUTINE qfix(mpi,stars,atoms,sym,vacuum,sphhar,input,cell,oneD,&
den,l_noco,l_printData,force_fix,fix) den,l_noco,l_printData,force_fix,fix)
USE m_types USE m_types
...@@ -20,6 +20,7 @@ CONTAINS ...@@ -20,6 +20,7 @@ CONTAINS
IMPLICIT NONE IMPLICIT NONE
! .. Scalar Arguments .. ! .. Scalar Arguments ..
TYPE(t_mpi),INTENT(IN) :: mpi
TYPE(t_stars),INTENT(IN) :: stars TYPE(t_stars),INTENT(IN) :: stars
TYPE(t_atoms),INTENT(IN) :: atoms TYPE(t_atoms),INTENT(IN) :: atoms
TYPE(t_sym),INTENT(IN) :: sym TYPE(t_sym),INTENT(IN) :: sym
...@@ -51,7 +52,7 @@ CONTAINS ...@@ -51,7 +52,7 @@ CONTAINS
! qfix==0 means no qfix was given in inp.xml. ! qfix==0 means no qfix was given in inp.xml.
! In this case do nothing except when forced to fix! ! In this case do nothing except when forced to fix!
CALL cdntot(stars,atoms,sym,vacuum,input,cell,oneD,den,.TRUE.,qtot,qis) CALL cdntot(mpi,stars,atoms,sym,vacuum,input,cell,oneD,den,.TRUE.,qtot,qis)
!The total nucleii charge !The total nucleii charge
zc=SUM(atoms%neq(:)*atoms%zatom(:)) zc=SUM(atoms%neq(:)*atoms%zatom(:))
...@@ -92,7 +93,7 @@ CONTAINS ...@@ -92,7 +93,7 @@ CONTAINS
IF (ABS(fix-1.0)<1.E-6) RETURN !no second calculation of cdntot as nothing was fixed IF (ABS(fix-1.0)<1.E-6) RETURN !no second calculation of cdntot as nothing was fixed
CALL openXMLElementNoAttributes('fixedCharges') CALL openXMLElementNoAttributes('fixedCharges')
CALL cdntot(stars,atoms,sym,vacuum,input,cell,oneD,den,l_printData,qtot,qis) CALL cdntot(mpi,stars,atoms,sym,vacuum,input,cell,oneD,den,l_printData,qtot,qis)
CALL closeXMLElement('fixedCharges') CALL closeXMLElement('fixedCharges')
IF (fix>1.1) CALL juDFT_WARN("You lost too much charge") IF (fix>1.1) CALL juDFT_WARN("You lost too much charge")
......
...@@ -137,7 +137,7 @@ SUBROUTINE cdngen(eig_id,mpi,input,banddos,sliceplot,vacuum,& ...@@ -137,7 +137,7 @@ SUBROUTINE cdngen(eig_id,mpi,input,banddos,sliceplot,vacuum,&
IF (vacuum%nstm.EQ.3) CALL juDFT_end("VACWAVE OK",mpi%irank) IF (vacuum%nstm.EQ.3) CALL juDFT_end("VACWAVE OK",mpi%irank)
IF (mpi%irank.EQ.0) THEN IF (mpi%irank.EQ.0) THEN
CALL cdntot(stars,atoms,sym,vacuum,input,cell,oneD,outDen,.TRUE.,qtot,dummy) CALL cdntot(mpi,stars,atoms,sym,vacuum,input,cell,oneD,outDen,.TRUE.,qtot,dummy)
CALL closeXMLElement('valenceDensity') CALL closeXMLElement('valenceDensity')
END IF ! mpi%irank = 0 END IF ! mpi%irank = 0
...@@ -158,7 +158,7 @@ SUBROUTINE cdngen(eig_id,mpi,input,banddos,sliceplot,vacuum,& ...@@ -158,7 +158,7 @@ SUBROUTINE cdngen(eig_id,mpi,input,banddos,sliceplot,vacuum,&
IF (mpi%irank.EQ.0) THEN IF (mpi%irank.EQ.0) THEN
CALL openXMLElementNoAttributes('allElectronCharges') CALL openXMLElementNoAttributes('allElectronCharges')
CALL qfix(stars,atoms,sym,vacuum,sphhar,input,cell,oneD,outDen,noco%l_noco,.TRUE.,.true.,fix) CALL qfix(mpi,stars,atoms,sym,vacuum,sphhar,input,cell,oneD,outDen,noco%l_noco,.TRUE.,.true.,fix)
CALL closeXMLElement('allElectronCharges') CALL closeXMLElement('allElectronCharges')
IF (input%jspins.EQ.2) THEN IF (input%jspins.EQ.2) THEN
......
...@@ -148,7 +148,7 @@ CONTAINS ...@@ -148,7 +148,7 @@ CONTAINS
CALL readDensity(stars,vacuum,atoms,cell,sphhar,input,sym,oneD,archiveType,CDN_INPUT_DEN_const,& CALL readDensity(stars,vacuum,atoms,cell,sphhar,input,sym,oneD,archiveType,CDN_INPUT_DEN_const,&
0,results%ef,l_qfix,inDen) 0,results%ef,l_qfix,inDen)
CALL timestart("Qfix") CALL timestart("Qfix")
CALL qfix(stars,atoms,sym,vacuum, sphhar,input,cell,oneD,inDen,noco%l_noco,.FALSE.,.false.,fix) CALL qfix(mpi,stars,atoms,sym,vacuum, sphhar,input,cell,oneD,inDen,noco%l_noco,.FALSE.,.false.,fix)
CALL timestop("Qfix") CALL timestop("Qfix")
CALL writeDensity(stars,vacuum,atoms,cell,sphhar,input,sym,oneD,archiveType,CDN_INPUT_DEN_const,& CALL writeDensity(stars,vacuum,atoms,cell,sphhar,input,sym,oneD,archiveType,CDN_INPUT_DEN_const,&
0,-1.0,results%ef,.FALSE.,inDen) 0,-1.0,results%ef,.FALSE.,inDen)
......
...@@ -265,7 +265,7 @@ contains ...@@ -265,7 +265,7 @@ contains
if( input%jspins == 2 ) call resDen%ChargeAndMagnetisationToSpins() if( input%jspins == 2 ) call resDen%ChargeAndMagnetisationToSpins()
! fix the preconditioned density ! fix the preconditioned density
call outDen%addPotDen( resDen, inDen ) call outDen%addPotDen( resDen, inDen )
call qfix( stars, atoms, sym, vacuum, sphhar, input, cell, oneD, outDen, noco%l_noco, .false., .true., fix ) call qfix(mpi,stars, atoms, sym, vacuum, sphhar, input, cell, oneD, outDen, noco%l_noco, .false., .true., fix )
call resDen%subPotDen( outDen, inDen ) call resDen%subPotDen( outDen, inDen )
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 )
...@@ -297,7 +297,7 @@ contains ...@@ -297,7 +297,7 @@ contains
DEALLOCATE (sm,fsm) DEALLOCATE (sm,fsm)
!fix charge of the new density !fix charge of the new density
CALL qfix(stars,atoms,sym,vacuum, sphhar,input,cell,oneD,inDen,noco%l_noco,.FALSE.,.false., fix) CALL qfix(mpi,stars,atoms,sym,vacuum, sphhar,input,cell,oneD,inDen,noco%l_noco,.FALSE.,.false., fix)
IF(atoms%n_u.NE.n_u_keep) THEN IF(atoms%n_u.NE.n_u_keep) THEN
inDen%mmpMat = n_mmpTemp inDen%mmpMat = n_mmpTemp
......
...@@ -96,7 +96,7 @@ CONTAINS ...@@ -96,7 +96,7 @@ CONTAINS
IF (sliceplot%iplot .AND. (mpi%irank==0) ) THEN IF (sliceplot%iplot .AND. (mpi%irank==0) ) THEN
IF (noco%l_noco) THEN IF (noco%l_noco) THEN
CALL pldngen(sym,stars,atoms,sphhar,vacuum,& CALL pldngen(mpi,sym,stars,atoms,sphhar,vacuum,&
cell,input,noco,oneD,sliceplot) cell,input,noco,oneD,sliceplot)
ENDIF ENDIF
ENDIF ENDIF
......
...@@ -24,7 +24,7 @@ MODULE m_pldngen ...@@ -24,7 +24,7 @@ MODULE m_pldngen
CONTAINS CONTAINS
SUBROUTINE pldngen(sym,stars,atoms,sphhar,vacuum,& SUBROUTINE pldngen(mpi,sym,stars,atoms,sphhar,vacuum,&
cell,input,noco,oneD,sliceplot) cell,input,noco,oneD,sliceplot)
!******** ABBREVIATIONS *********************************************** !******** ABBREVIATIONS ***********************************************
...@@ -52,6 +52,7 @@ SUBROUTINE pldngen(sym,stars,atoms,sphhar,vacuum,& ...@@ -52,6 +52,7 @@ SUBROUTINE pldngen(sym,stars,atoms,sphhar,vacuum,&
IMPLICIT NONE IMPLICIT NONE
TYPE(t_mpi),INTENT(IN) :: mpi
TYPE(t_sym),INTENT(IN) :: sym TYPE(t_sym),INTENT(IN) :: sym
TYPE(t_stars),INTENT(IN) :: stars TYPE(t_stars),INTENT(IN) :: stars
TYPE(t_vacuum),INTENT(IN) :: vacuum TYPE(t_vacuum),INTENT(IN) :: vacuum
...@@ -153,7 +154,7 @@ SUBROUTINE pldngen(sym,stars,atoms,sphhar,vacuum,& ...@@ -153,7 +154,7 @@ SUBROUTINE pldngen(sym,stars,atoms,sphhar,vacuum,&
den%vacz(:,:,4) = AIMAG(cdomvz(:,:)) den%vacz(:,:,4) = AIMAG(cdomvz(:,:))
den%vacxy(:,:,:,3) = cdomvxy den%vacxy(:,:,:,3) = cdomvxy
END IF END IF
CALL qfix(stars,atoms,sym,vacuum,sphhar,input,cell,oneD,den,noco%l_noco,.FALSE.,.true.,fix) CALL qfix(mpi,stars,atoms,sym,vacuum,sphhar,input,cell,oneD,den,noco%l_noco,.FALSE.,.true.,fix)
rho(:,0:,1:,:input%jspins) = den%mt(:,0:,1:,:input%jspins) rho(:,0:,1:,:input%jspins) = den%mt(:,0:,1:,:input%jspins)
qpw(1:,:input%jspins) = den%pw(1:,:input%jspins) qpw(1:,:input%jspins) = den%pw(1:,:input%jspins)
rht(1:,1:,:input%jspins) = den%vacz(1:,1:,:input%jspins) rht(1:,1:,:input%jspins) = den%vacz(1:,1:,:input%jspins)
......
...@@ -198,7 +198,7 @@ SUBROUTINE stden(mpi,sphhar,stars,atoms,sym,DIMENSION,vacuum,& ...@@ -198,7 +198,7 @@ SUBROUTINE stden(mpi,sphhar,stars,atoms,sym,DIMENSION,vacuum,&
IF (mpi%irank == 0) THEN IF (mpi%irank == 0) THEN
! Check the normalization of total density ! Check the normalization of total density
CALL qfix(stars,atoms,sym,vacuum,sphhar,input,cell,oneD,den,.FALSE.,.FALSE.,.true.,fix) CALL qfix(mpi,stars,atoms,sym,vacuum,sphhar,input,cell,oneD,den,.FALSE.,.FALSE.,.true.,fix)
z=SUM(atoms%neq(:)*atoms%zatom(:)) z=SUM(atoms%neq(:)*atoms%zatom(:))
IF (ABS(fix*z-z)>0.5) THEN IF (ABS(fix*z-z)>0.5) THEN
CALL judft_warn("Starting density not charge neutral",hint= & CALL judft_warn("Starting density not charge neutral",hint= &
......
...@@ -156,7 +156,7 @@ SUBROUTINE rdmft(eig_id,mpi,input,kpts,banddos,cell,atoms,enpara,stars,vacuum,di ...@@ -156,7 +156,7 @@ SUBROUTINE rdmft(eig_id,mpi,input,kpts,banddos,cell,atoms,enpara,stars,vacuum,di
CALL cdncore(mpi,dimension,oneD,input,vacuum,noco,sym,& CALL cdncore(mpi,dimension,oneD,input,vacuum,noco,sym,&
stars,cell,sphhar,atoms,vTot,overallDen,moments,results) stars,cell,sphhar,atoms,vTot,overallDen,moments,results)
IF (mpi%irank.EQ.0) THEN IF (mpi%irank.EQ.0) THEN
CALL qfix(stars,atoms,sym,vacuum,sphhar,input,cell,oneD,overallDen,noco%l_noco,.TRUE.,.true.,fix) CALL qfix(mpi,stars,atoms,sym,vacuum,sphhar,input,cell,oneD,overallDen,noco%l_noco,.TRUE.,.true.,fix)
END IF END IF
#ifdef CPP_MPI #ifdef CPP_MPI
CALL mpi_bc_potden(mpi,stars,sphhar,atoms,input,vacuum,oneD,noco,overallDen) CALL mpi_bc_potden(mpi,stars,sphhar,atoms,input,vacuum,oneD,noco,overallDen)
......
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