The Elk Code
writeftm.f90
Go to the documentation of this file.
1 
2 ! Copyright (C) 2014 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 writeftm
7 use modmain
8 use moddftu
9 implicit none
10 ! local variables
11 integer is,ia,ias,i
12 integer l,k,p,r,t
13 real(8) t0
14 ! automatic arrays
15 real(8) wkpr(-lmmaxdm:lmmaxdm)
16 ! open FTM.OUT
17 open(50,file='FTM.OUT',form='FORMATTED',action='WRITE')
18 do i=1,ntmfix
19  is=itmfix(1,i)
20  ia=itmfix(2,i)
21  ias=idxas(ia,is)
22  l=itmfix(3,i)
23  k=itmfix(4,i)
24  p=itmfix(5,i)
25  r=itmfix(6,i)
26  t=itmfix(7,i)
27  write(50,*)
28  write(50,'("Species : ",I4," (",A,"), atom : ",I4)') is,trim(spsymb(is)),ia
29  write(50,'(" l = ",I2)') l
30 ! scale factor for conventional normalisation
31  t0=sqrt(dble((2*l+1)*nspinor))
32  write(50,'(" k = ",I2,", p = ",I2,", r = ",I2,", t = ",I2)') k,p,r,t
33 ! decompose density matrix in 3-index tensor moment components
34  call dmtotm3(l,k,p,r,lmmaxdm,dmatmt(:,:,:,:,ias),wkpr)
35  write(50,'(" tensor moment")')
36  write(50,'(" current : ",G18.10)') t0*wkpr(t)
37  write(50,'(" target : ",G18.10)') wkprfix(i)
38 end do
39 close(50)
40 end subroutine
41 
integer, dimension(:,:), allocatable itmfix
Definition: moddftu.f90:76
integer, dimension(maxatoms, maxspecies) idxas
Definition: modmain.f90:42
real(8), dimension(:), allocatable wkprfix
Definition: moddftu.f90:78
subroutine writeftm
Definition: writeftm.f90:7
complex(8), dimension(:,:,:,:,:), allocatable dmatmt
Definition: moddftu.f90:16
integer nspinor
Definition: modmain.f90:267
subroutine dmtotm3(l, k, p, r, ld, dm, wkpr)
Definition: dmtotm3.f90:10
character(64), dimension(maxspecies) spsymb
Definition: modmain.f90:78
integer ntmfix
Definition: moddftu.f90:72