The Elk Code
rmtavrg.f90
Go to the documentation of this file.
1 
2 ! Copyright (C) 2023 J. K. Dewhurst and S. Sharma.
3 ! This file is distributed under the terms of the GNU General Public License.
4 ! See the file COPYING for license details.
5 
6 !BOP
7 ! !ROUTINE: rmtavrg
8 ! !INTERFACE:
9 subroutine rmtavrg
10 ! !USES:
11 use modmain
12 ! !DESCRIPTION:
13 ! Performs a simple averaging procedure on all the muffin-tin radii. First
14 ! the average muffin-tin radius $\overline{R_{\rm MT}}$ is found and then
15 ! every radius is averaged with this and itself:
16 ! $R_{\rm MT}^{\alpha}\rightarrow(R_{\rm MT}^{\alpha}
17 ! +\overline{R_{\rm MT}})/2$. This is repeated {\tt mrmtav} times.
18 !
19 ! !REVISION HISTORY:
20 ! Created May 2023 (JKD)
21 !EOP
22 !BOC
23 implicit none
24 ! local variables
25 integer i
26 real(8) ra
27 if (nspecies <= 1) return
28 do i=1,mrmtav
29 ! average muffin-tin radius
30  ra=sum(rmt(1:nspecies))/nspecies
31 ! replace each muffin-tin radius with half itself plus the average
32  rmt(1:nspecies)=0.5d0*(rmt(1:nspecies)+ra)
33 end do
34 end subroutine
35 !EOC
36 
subroutine rmtavrg
Definition: rmtavrg.f90:10
real(8), dimension(maxspecies) rmt
Definition: modmain.f90:162
integer nspecies
Definition: modmain.f90:34
integer mrmtav
Definition: modmain.f90:156