The Elk Code
writemomtd.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 subroutine writemomtd
7 use modmain
8 use modtddft
9 implicit none
10 ! local variables
11 integer is,ia,ias
12 ! write the total spin moment
13 open(50,file='MOMENT_TD.OUT',form='FORMATTED',position='APPEND')
14 write(50,'(4G18.10)') times(itimes),momtot(1:ndmag)
15 close(50)
16 ! write the total spin moment magnitude
17 open(50,file='MOMENTM_TD.OUT',form='FORMATTED',position='APPEND')
18 write(50,'(2G18.10)') times(itimes),momtotm
19 close(50)
20 ! write muffin-tin moments
21 open(50,file='MOMENTMT_TD.OUT',form='FORMATTED',position='APPEND')
22 write(50,'(G18.10)') times(itimes)
23 do is=1,nspecies
24  do ia=1,natoms(is)
25  ias=idxas(ia,is)
26  write(50,'(2I4,3G18.10)') is,ia,mommt(1:ndmag,ias)
27  end do
28 end do
29 write(50,*)
30 close(50)
31 ! write interstitial moment
32 open(50,file='MOMENTIR_TD.OUT',form='FORMATTED',position='APPEND')
33 write(50,'(4G18.10)') times(itimes),momir(1:ndmag)
34 close(50)
35 end subroutine
36 
real(8), dimension(:,:), allocatable mommt
Definition: modmain.f90:744
real(8), dimension(3) momtot
Definition: modmain.f90:738
integer, dimension(maxatoms, maxspecies) idxas
Definition: modmain.f90:42
integer ndmag
Definition: modmain.f90:238
real(8) momtotm
Definition: modmain.f90:740
subroutine writemomtd
Definition: writemomtd.f90:7
real(8), dimension(3) momir
Definition: modmain.f90:742
integer, dimension(maxspecies) natoms
Definition: modmain.f90:36
real(8), dimension(:), allocatable times
Definition: modtddft.f90:48
integer itimes
Definition: modtddft.f90:46
integer nspecies
Definition: modmain.f90:34