Commit 76522343 authored by Alexander Neukirchen's avatar Alexander Neukirchen

made phi available for div-calculations

parent 36d50fa8
......@@ -8,7 +8,7 @@ CONTAINS
SUBROUTINE lhglptg(&
& sphhar,atoms,&
& rx,nsp,xcpot,sym,&
& ylh,thet,ylht1,ylht2,ylhf1,ylhf2,ylhtf)
& ylh,thet,phi,ylht1,ylht2,ylhf1,ylhf2,ylhtf)
!
USE m_polangle
USE m_ylm
......@@ -27,6 +27,7 @@ CONTAINS
! .. Array Arguments ..
REAL, INTENT (IN) :: rx(:,:)!(3,dimension%nspd)
REAL, INTENT (OUT):: thet(:) !nspd
REAL, INTENT (OUT):: phi(:) !nspd
REAL, INTENT (OUT):: ylh(:,0:,:)!(dimension%nspd,0:sphhar%nlhd,sphhar%ntypsd),thet(nspd)
REAL, INTENT (OUT):: ylht1(:,0:,:)!(dimension%nspd,0:sphhar%nlhd,sphhar%ntypsd)
REAL, INTENT (OUT):: ylht2(:,0:,:)!(dimension%nspd,0:sphhar%nlhd,sphhar%ntypsd)
......@@ -35,7 +36,7 @@ CONTAINS
REAL, INTENT (OUT):: ylhf2(:,0:,:)!(dimension%nspd,0:sphhar%nlhd,sphhar%ntypsd)
! ..
! .. Local Scalars ..
REAL s,st1,st2,sf1,sf2,stf,phi
REAL s,st1,st2,sf1,sf2,stf
INTEGER k,lh,mem,nd,lm,ll1
! ..
! .. Local Arrays ..
......@@ -56,7 +57,7 @@ CONTAINS
& ylm)
CALL pol_angle(&
& rx(1,k),rx(2,k),rx(3,k),&
& thet(k),phi)
& thet(k),phi(k))
IF (xcpot%needs_grad()) THEN
CALL dylm3(&
......
......@@ -10,7 +10,7 @@ MODULE m_mt_grad_on_grid
INTEGER, PARAMETER :: ndvgrd = 6
REAL, ALLOCATABLE :: ylh(:, :, :), ylht(:, :, :), ylhtt(:, :, :)
REAL, ALLOCATABLE :: ylhf(:, :, :), ylhff(:, :, :), ylhtf(:, :, :)
REAL, ALLOCATABLE :: wt(:), rx(:, :), thet(:)
REAL, ALLOCATABLE :: wt(:), rx(:, :), thet(:), phi(:)
PUBLIC :: mt_do_grad!, mt_do_div
CONTAINS
SUBROUTINE mt_do_grad(jspins, n, atoms, sphhar, sym, den_mt, grad, ch)
......@@ -47,7 +47,7 @@ CONTAINS
!Generate nspd points on a sherical shell with radius 1.0:
!The angular mesh is equidistant in phi,
!theta are the zeros of the legendre polynomials
ALLOCATE (wt(atoms%nsp()), rx(3, atoms%nsp()), thet(atoms%nsp()))
ALLOCATE (wt(atoms%nsp()), rx(3, atoms%nsp()), thet(atoms%nsp()), phi(atoms%nsp()))
CALL gaussp(atoms%lmaxd, rx, wt)
!Generate the lattice harmonics on the angular mesh:
ALLOCATE (ylh(atoms%nsp(), 0:sphhar%nlhd, sphhar%ntypsd))
......@@ -61,7 +61,7 @@ CONTAINS
!Calculate the required lattice harmonics and their derivatives:
CALL lhglptg(sphhar, atoms, rx, atoms%nsp(), xcpot, sym, &
ylh, thet, ylht, ylhtt, ylhf, ylhff, ylhtf)
ylh, thet, phi, ylht, ylhtt, ylhf, ylhff, ylhtf)
nd = atoms%ntypsy(SUM(atoms%neq(:n - 1)) + 1)
nsp = atoms%nsp()
......@@ -146,7 +146,11 @@ CONTAINS
END SUBROUTINE mt_do_grad
! SUBROUTINE mt_do_div()
!
! Bvec goes in and out as potden
! mt_do_grad is calles for each component
! the resulting gradients are combined appropriately into a divergence potden
! the divergence goes out
!
! END SUBROUTINE mt_do_div
END MODULE m_mt_grad_on_grid
......@@ -10,7 +10,7 @@ MODULE m_mt_tofrom_grid
INTEGER, PARAMETER :: ndvgrd = 6 ! this should be consistent across GGA derivative routines
REAL, ALLOCATABLE :: ylh(:, :, :), ylht(:, :, :), ylhtt(:, :, :)
REAL, ALLOCATABLE :: ylhf(:, :, :), ylhff(:, :, :), ylhtf(:, :, :)
REAL, ALLOCATABLE :: wt(:), rx(:, :), thet(:)
REAL, ALLOCATABLE :: wt(:), rx(:, :), thet(:), phi(:)
PUBLIC :: init_mt_grid, mt_to_grid, mt_from_grid, finish_mt_grid
CONTAINS
SUBROUTINE init_mt_grid(jspins, atoms, sphhar, xcpot, sym)
......@@ -27,7 +27,7 @@ CONTAINS
! generate nspd points on a sherical shell with radius 1.0
! angular mesh equidistant in phi,
! theta are zeros of the legendre polynomials
ALLOCATE (wt(atoms%nsp()), rx(3, atoms%nsp()), thet(atoms%nsp()))
ALLOCATE (wt(atoms%nsp()), rx(3, atoms%nsp()), thet(atoms%nsp()), phi(atoms%nsp()))
CALL gaussp(atoms%lmaxd, rx, wt)
! generate the lattice harmonics on the angular mesh
ALLOCATE (ylh(atoms%nsp(), 0:sphhar%nlhd, sphhar%ntypsd))
......@@ -39,7 +39,7 @@ CONTAINS
ALLOCATE (ylhtf, MOLD=ylh)
CALL lhglptg(sphhar, atoms, rx, atoms%nsp(), xcpot, sym, &
ylh, thet, ylht, ylhtt, ylhf, ylhff, ylhtf)
ylh, thet, phi, ylht, ylhtt, ylhf, ylhff, ylhtf)
ELSE
CALL lhglpts(sphhar, atoms, rx, atoms%nsp(), sym, ylh)
END IF
......@@ -185,7 +185,7 @@ CONTAINS
END SUBROUTINE mt_from_grid
SUBROUTINE finish_mt_grid()
DEALLOCATE (ylh, wt, rx, thet)
DEALLOCATE (ylh, wt, rx, thet, phi)
IF (ALLOCATED(ylht)) DEALLOCATE (ylht, ylhtt, ylhf, ylhff, ylhtf)
END SUBROUTINE finish_mt_grid
......
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