The Elk Code
initoep.f90
Go to the documentation of this file.
1 
2 ! Copyright (C) 2018 J. K. Dewhurst, S. Sharma and E. K. U. Gross.
3 ! This file is distributed under the terms of the GNU General Public License.
4 ! See the file COPYING for license details.
5 
6 subroutine initoep
7 use modmain
8 implicit none
9 ! local variables
10 integer is,ist,nc
11 ! find maximum core states over all species
12 ncrmax=0
13 do is=1,nspecies
14  nc=0
15  do ist=1,nstsp(is)
16  if (spcore(ist,is)) nc=nc+2*ksp(ist,is)
17  end do
18  ncrmax=max(ncrmax,nc)
19 end do
20 ! allocate the exchange potential and magnetic field
21 if (allocated(vxmt)) deallocate(vxmt)
22 allocate(vxmt(npcmtmax,natmtot))
23 if (allocated(vxir)) deallocate(vxir)
24 allocate(vxir(ngtot))
25 if (spinpol) then
26  if (allocated(bxmt)) deallocate(bxmt)
27  allocate(bxmt(npcmtmax,natmtot,ndmag))
28  if (allocated(bxir)) deallocate(bxir)
29  allocate(bxir(ngtot,ndmag))
30 end if
31 ! allocate the OEP residual functions
32 allocate(dvxmt(npcmtmax,natmtot),dvxir(ngtot))
33 if (spinpol) then
35 end if
36 ! set initial step size for iterative method
38 end subroutine
39 
integer ncrmax
Definition: modmain.f90:1140
integer, dimension(maxstsp, maxspecies) ksp
Definition: modmain.f90:125
integer npcmtmax
Definition: modmain.f90:216
integer ngtot
Definition: modmain.f90:390
logical spinpol
Definition: modmain.f90:228
integer ndmag
Definition: modmain.f90:238
real(8) tauoep
Definition: modmain.f90:1144
real(8), dimension(:,:,:), allocatable bxmt
Definition: modmain.f90:1146
real(8), dimension(:), allocatable vxir
Definition: modmain.f90:1146
real(8), dimension(:), allocatable dvxir
Definition: modmain.f90:1148
real(8), dimension(:,:), allocatable bxir
Definition: modmain.f90:1146
logical, dimension(maxstsp, maxspecies) spcore
Definition: modmain.f90:127
subroutine initoep
Definition: initoep.f90:7
real(8), dimension(:,:), allocatable dvxmt
Definition: modmain.f90:1148
real(8), dimension(:,:,:), allocatable dbxmt
Definition: modmain.f90:1148
real(8), dimension(:,:), allocatable dbxir
Definition: modmain.f90:1148
real(8) tau0oep
Definition: modmain.f90:1144
integer nspecies
Definition: modmain.f90:34
integer, dimension(maxspecies) nstsp
Definition: modmain.f90:113
integer natmtot
Definition: modmain.f90:40
real(8), dimension(:,:), allocatable vxmt
Definition: modmain.f90:1146