Commit e7322d58 authored by Daniel Wortmann's avatar Daniel Wortmann

Moved generation of ratated density into vgen, vmatgen into vgen_finalize, Bugfixes in MPI

parent 600aa2ad
......@@ -98,7 +98,7 @@ CONTAINS
TYPE(t_coreSpecInput) :: coreSpecInput
TYPE(t_wann) :: wann
TYPE(t_potden) :: vTot,vx,vCoul,vTemp
TYPE(t_potden) :: inDen, outDen, inDenRot
TYPE(t_potden) :: inDen, outDen
CLASS(t_forcetheo),ALLOCATABLE:: forcetheo
! .. Local Scalars ..
......@@ -147,8 +147,7 @@ CONTAINS
! Initialize and load inDen density (start)
CALL inDen%init(stars,atoms,sphhar,vacuum,input%jspins,noco%l_noco,POTDEN_TYPE_DEN)
CALL inDenRot%init(stars,atoms,sphhar,vacuum,input%jspins,noco%l_noco,POTDEN_TYPE_DEN)
archiveType = CDN_ARCHIVE_TYPE_CDN1_const
IF (noco%l_noco) archiveType = CDN_ARCHIVE_TYPE_NOCO_const
......@@ -175,7 +174,6 @@ CONTAINS
it = it + 1
IF (mpi%irank.EQ.0) CALL openXMLElementFormPoly('iteration',(/'numberForCurrentRun','overallNumber '/)&
,(/it,inden%iter/), RESHAPE((/19,13,5,5/),(/2,2/)))
inDenRot = inDen
!!$ !+t3e
!!$ IF (input%alpha.LT.10.0) THEN
......@@ -195,19 +193,6 @@ CONTAINS
! ----> potential generator
!
!---> pk non-collinear
!---> reload the density matrix from file rhomat_in
!---> calculate spin-up and -down density for USE in the
!---> potential generator and store the direction of
!---> magnetization on file dirofmag
IF (noco%l_noco) THEN
CALL timestart("gen. spin-up and -down density")
CALL rhodirgen(DIMENSION,sym,stars,atoms,sphhar,&
vacuum,cell,input,noco,oneD,inDenRot)
CALL timestop("gen. spin-up and -down density")
ENDIF
!---> pk non-collinear
reap=.NOT.obsolete%disp
input%total = .TRUE.
ENDIF !mpi%irank.eq.0
......@@ -217,7 +202,6 @@ CONTAINS
#ifdef CPP_MPI
CALL mpi_bc_potden(mpi,stars,sphhar,atoms,input,vacuum,oneD,noco,inDen)
CALL mpi_bc_potden(mpi,stars,sphhar,atoms,input,vacuum,oneD,noco,inDenRot)
#endif
......@@ -246,20 +230,9 @@ CONTAINS
CALL timestart("generation of potential")
CALL vgen(hybrid,field,input,xcpot,DIMENSION, atoms,sphhar,stars,vacuum,&
sym,obsolete,cell, oneD,sliceplot,mpi ,results,noco,inDen,inDenRot,vTot,vx,vCoul)
sym,obsolete,cell, oneD,sliceplot,mpi ,results,noco,inDen,vTot,vx,vCoul)
CALL timestop("generation of potential")
IF (mpi%irank.EQ.0) THEN
!---> pk non-collinear
!---> generate the four component matrix potential from spin up
!---> and down potentials and direction of the magnetic field
IF (noco%l_noco) THEN
CALL timestart("generation of potential-matrix")
CALL vmatgen(stars, atoms,sphhar,vacuum,sym,input,oneD,inDenRot,vTot)
CALL timestop("generation of potential-matrix")
ENDIF
!
ENDIF ! mpi%irank.eq.0
......@@ -278,7 +251,7 @@ CONTAINS
CALL enpara%update(mpi,atoms,vacuum,input,vToT)
CALL eigen(mpi,stars,sphhar,atoms,obsolete,xcpot,&
sym,kpts,DIMENSION,vacuum,input,cell,enpara,banddos,noco,oneD,hybrid,&
it,eig_id,results,inDenRot,vTemp,vx)
it,eig_id,results,inDen,vTemp,vx)
vTot%mmpMat = vTemp%mmpMat
!!$ eig_idList(pc) = eig_id
CALL timestop("eigen")
......
......@@ -7,7 +7,7 @@ MODULE m_vgen
USE m_juDFT
CONTAINS
SUBROUTINE vgen(hybrid,field,input,xcpot,DIMENSION, atoms,sphhar,stars,&
vacuum,sym,obsolete,cell,oneD,sliceplot,mpi, results,noco,den,denRot,vTot,vx,vCoul)
vacuum,sym,obsolete,cell,oneD,sliceplot,mpi, results,noco,den,vTot,vx,vCoul)
! ***********************************************************
! FLAPW potential generator *
! ***********************************************************
......@@ -17,6 +17,7 @@ CONTAINS
! TE_VEFF: charge density-effective potential integral
! TE_EXC : charge density-ex-corr.energy density integral
! ***********************************************************
USE m_rotate_int_den_to_local
USE m_bfield
USE m_vgen_coulomb
USE m_vgen_xcpot
......@@ -43,11 +44,11 @@ CONTAINS
TYPE(t_cell),INTENT(IN) :: cell
TYPE(t_sphhar),INTENT(IN) :: sphhar
TYPE(t_atoms),INTENT(IN) :: atoms
TYPE(t_potden), INTENT(INOUT) :: den, denRot
TYPE(t_potden), INTENT(INOUT) :: den
TYPE(t_potden),INTENT(INOUT) :: vTot,vx,vCoul
! ..
TYPE(t_potden) :: workden
TYPE(t_potden) :: workden,denRot
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',/)
......@@ -67,12 +68,19 @@ CONTAINS
CALL vgen_coulomb(1,mpi,DIMENSION,oneD,input,field,vacuum,sym,stars,cell,sphhar,atoms,workden,vCoul,results)
CALL vCoul%copy_both_spin(vTot)
IF (noco%l_noco) THEN
CALL denRot%init(stars,atoms,sphhar,vacuum,input%jspins,noco%l_noco,0)
denRot=den
CALL rotate_int_den_to_local(DIMENSION,sym,stars,atoms,sphhar,vacuum,cell,input,&
noco,oneD,denRot)
ENDIF
call vgen_xcpot(hybrid,input,xcpot,DIMENSION, atoms,sphhar,stars,&
vacuum,sym, obsolete,cell,oneD,sliceplot,mpi,noco,den,denRot,vTot,vx,results)
!ToDo, check if this is needed for more potentials as well...
CALL vgen_finalize(atoms,stars,vacuum,sym,noco,vTot)
CALL vgen_finalize(atoms,stars,vacuum,sym,noco,input,vTot,denRot)
DEALLOCATE(vcoul%pw_w,vx%pw_w)
......
......@@ -30,7 +30,7 @@ vgen/vgen_xcpot.F90
vgen/vgen_finalize.F90
vgen/prp_xcfft_map.f90
vgen/psqpw.F90
vgen/rhodirgen.f90
vgen/rotate_int_den_to_local.F90
vgen/vintcz.f90
vgen/visxc.f90
vgen/visxcg.f90
......
This diff is collapsed.
......@@ -6,13 +6,16 @@
MODULE m_vgen_finalize
USE m_juDFT
CONTAINS
SUBROUTINE vgen_finalize(atoms,stars,vacuum,sym,noco,vTot)
SUBROUTINE vgen_finalize(atoms,stars,vacuum,sym,noco,input,vTot,denRot)
! ***********************************************************
! FLAPW potential generator *
! ***********************************************************
! some rescaling is done here
! ***********************************************************
! in noco case vmatgen is called to generate 2x2 int-potential
! **********************************************************
USE m_constants
USE m_vmatgen
USE m_types
IMPLICIT NONE
TYPE(t_vacuum),INTENT(IN) :: vacuum
......@@ -20,7 +23,8 @@ CONTAINS
TYPE(t_sym),INTENT(IN) :: sym
TYPE(t_stars),INTENT(IN) :: stars
TYPE(t_atoms),INTENT(IN) :: atoms
TYPE(t_potden),INTENT(INOUT) :: vTot
TYPE(t_input),INTENT(IN) :: input
TYPE(t_potden),INTENT(INOUT) :: vTot,denRot
! ..
! .. Local Scalars ..
INTEGER i,js,n
......@@ -42,6 +46,8 @@ CONTAINS
ENDDO
ENDDO
DEALLOCATE(vtot%pw_w)
ELSEIF(noco%l_noco) THEN
CALL vmatgen(stars, atoms,vacuum,sym,input, denRot,vtot)
ENDIF
!Copy first vacuum into second vacuum if this was not calculated before
......
......@@ -167,7 +167,6 @@ CONTAINS
CALL timestart ("Vxc in MT")
END IF
#ifdef CPP_MPI
CALL MPI_BCAST(input%efield%vslope,1,MPI_DOUBLE_COMPLEX,0,mpi%mpi_comm,ierr)
CALL MPI_BCAST(den%mt,atoms%jmtd*(1+sphhar%nlhd)*atoms%ntype*dimension%jspd,MPI_DOUBLE_PRECISION,0,mpi%mpi_comm,ierr)
#endif
IF (xcpot%is_gga()) THEN
......
......@@ -23,7 +23,7 @@ MODULE m_vmatgen
! Philipp Kurz 99/11/01
!**********************************************************************
CONTAINS
SUBROUTINE vmatgen(stars, atoms,sphhar,vacuum, sym,input,oneD, den,v)
SUBROUTINE vmatgen(stars, atoms,vacuum, sym,input, den,v)
!******** ABBREVIATIONS ***********************************************
! ifft3 : size of the 3d real space mesh
......@@ -41,12 +41,11 @@ CONTAINS
USE m_fft3d
USE m_types
IMPLICIT NONE
TYPE(t_oneD),INTENT(IN) :: oneD
! TYPE(t_oneD),INTENT(IN) :: oneD
TYPE(t_input),INTENT(IN) :: input
TYPE(t_vacuum),INTENT(IN) :: vacuum
TYPE(t_sym),INTENT(IN) :: sym
TYPE(t_stars),INTENT(IN) :: stars
TYPE(t_sphhar),INTENT(IN) :: sphhar
TYPE(t_atoms),INTENT(IN) :: atoms
TYPE(t_potden),INTENT(IN) :: den
TYPE(t_potden),INTENT(INOUT):: v
......@@ -121,8 +120,8 @@ CONTAINS
DO ivac = 1,vacuum%nvac
DO imz = 1,vacuum%nmzxyd
vziw = 0.0
IF (oneD%odi%d1) THEN
!IF (oneD%odi%d1) THEN
IF (.FALSE.) THEN
CALL judft_error("oneD not implemented",calledby="vmatgen")
! CALL fft2d(&
! & oneD%k3,odi%M,odi%n2d,&
......@@ -174,8 +173,8 @@ CONTAINS
DO ivac = 1,vacuum%nvac
DO imz = 1,vacuum%nmzxyd
fftwork=0.0
IF (oneD%odi%d1) THEN
!IF (oneD%odi%d1) THEN
IF (.FALSE.) THEN
CALL judft_error("oneD not implemented",calledby="vmatgen")
! CALL fft2d(&
! & oneD%k3,odi%M,odi%n2d,&
......@@ -194,8 +193,9 @@ CONTAINS
DO ivac = 1,vacuum%nvac
DO imz = 1,vacuum%nmzxyd
fftwork=0.0
IF (oneD%odi%d1) THEN
CALL judft_error("oneD not implemented",calledby="vmatgen")
!IF (oneD%odi%d1) THEN
IF (.FALSE.) THEN
CALL judft_error("oneD not implemented",calledby="vmatgen")
! CALL fft2d(&
! & oneD%k3,odi%M,odi%n2d,&
! & vvacxy(0,imz,ivac,3),vvacxy(0,imz,ivac,4),&
......
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