Commit 548e2d2b authored by Matthias Redies's avatar Matthias Redies

nsp is function of t_atoms now

parent 366d735f
...@@ -161,6 +161,8 @@ MODULE m_types_setup ...@@ -161,6 +161,8 @@ MODULE m_types_setup
TYPE(t_utype), ALLOCATABLE::lda_u(:) TYPE(t_utype), ALLOCATABLE::lda_u(:)
INTEGER, ALLOCATABLE :: relax(:, :) !<(3,ntype) INTEGER, ALLOCATABLE :: relax(:, :) !<(3,ntype)
INTEGER, ALLOCATABLE :: nflip(:) !<flip magnetisation of this atom INTEGER, ALLOCATABLE :: nflip(:) !<flip magnetisation of this atom
CONTAINS
procedure :: nsp => calc_nsp_atom
END TYPE t_atoms END TYPE t_atoms
TYPE t_cell TYPE t_cell
...@@ -664,5 +666,12 @@ MODULE m_types_setup ...@@ -664,5 +666,12 @@ MODULE m_types_setup
!---> gwf !---> gwf
END TYPE t_wann END TYPE t_wann
CONTAINS
function calc_nsp_atom(self) result(nsp)
implicit none
CLASS(t_atoms),INTENT(IN) :: self
INTEGER :: nsp
nsp = (self%lmaxd+1+MOD(self%lmaxd+1,2))*(2*self%lmaxd+1)
end function
END MODULE m_types_setup END MODULE m_types_setup
...@@ -26,9 +26,10 @@ CONTAINS ...@@ -26,9 +26,10 @@ CONTAINS
REAL :: rhotot,rho_up,rho_down,theta,phi REAL :: rhotot,rho_up,rho_down,theta,phi
REAL,ALLOCATABLE :: ch(:,:) REAL,ALLOCATABLE :: ch(:,:)
REAL :: eps=1E-10 REAL :: eps=1E-10
nsp=(atoms%lmaxd+1+MOD(atoms%lmaxd+1,2))*(2*atoms%lmaxd+1)*atoms%jmtd nsp=atoms%nsp()
ALLOCATE(ch(nsp,4),den%theta_mt(nsp,atoms%ntype),den%phi_mt(nsp,atoms%ntype)) ALLOCATE(ch(nsp*atoms%jmtd,4),&
nsp=nsp/atoms%jmtd den%theta_mt(nsp*atoms%jmtd,atoms%ntype),&
den%phi_mt(nsp*atoms%jmtd,atoms%ntype))
CALL xcpot%init("vwn",.FALSE.,1) CALL xcpot%init("vwn",.FALSE.,1)
CALL init_mt_grid(nsp,4,atoms,sphhar,xcpot,sym) CALL init_mt_grid(nsp,4,atoms,sphhar,xcpot,sym)
......
...@@ -79,7 +79,7 @@ CONTAINS ...@@ -79,7 +79,7 @@ CONTAINS
l_libxc=.true. !libxc!! l_libxc=.true. !libxc!!
END SELECT END SELECT
nsp=(atoms%lmaxd+1+MOD(atoms%lmaxd+1,2))*(2*atoms%lmaxd+1) nsp=atoms%nsp()
ALLOCATE(ch(nsp*atoms%jmtd,input%jspins)) ALLOCATE(ch(nsp*atoms%jmtd,input%jspins))
IF (xcpot%is_gga()) CALL xcpot%alloc_gradients(SIZE(ch,1),input%jspins,grad) IF (xcpot%is_gga()) CALL xcpot%alloc_gradients(SIZE(ch,1),input%jspins,grad)
......
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