The Elk Code
writetdforces.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 writetdforces
7 use modmain
8 use modtddft
9 implicit none
10 ! local variables
11 integer is,ia,ias
12 ! write the total force on each atom
13 open(50,file='FORCETOT_TD.OUT',form='FORMATTED',position='APPEND')
14 write(50,'(I8,G18.10)') itimes,times(itimes)
15 do is=1,nspecies
16  do ia=1,natoms(is)
17  ias=idxas(ia,is)
18  write(50,'(2I4,3G18.10)') is,ia,forcetot(1:3,ias)
19  end do
20 end do
21 close(50)
22 ! write the maximum force magnitude over all atoms
23 open(50,file='FORCEMAX_TD.OUT',form='FORMATTED',position='APPEND')
24 write(50,'(2G18.10)') times(itimes),forcemax
25 close(50)
26 end subroutine
27 
subroutine writetdforces
integer, dimension(maxatoms, maxspecies) idxas
Definition: modmain.f90:42
real(8) forcemax
Definition: modmain.f90:997
real(8), dimension(:,:), allocatable forcetot
Definition: modmain.f90:993
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