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