The Elk Code
readjtot.f90
Go to the documentation of this file.
1 
2 ! Copyright (C) 2017 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 readjtot(jt)
7 use modmain
8 use modtddft
9 implicit none
10 ! arguments
11 real(8), intent(out) :: jt(3,ntimes)
12 ! local variables
13 integer its,ios
14 real(8) times_,t1
15 open(50,file='JTOT_TD.OUT',form='FORMATTED',action='READ',status='OLD', &
16  iostat=ios)
17 if (ios /= 0) then
18  write(*,*)
19  write(*,'("Error(readjtot): error opening JTOT_TD.OUT")')
20  write(*,*)
21  stop
22 end if
23 do its=1,ntimes-1
24  read(50,*) times_,jt(:,its)
25  t1=abs(times(its)-times_)
26  if (t1 > 1.d-10) then
27  write(*,*)
28  write(*,'("Error(readjtot): time step mismatch for step number ",I8)') its
29  write(*,'(" internal : ",G18.10)') times(its)
30  write(*,'(" JTOT_TD.OUT : ",G18.10)') times_
31  write(*,*)
32  stop
33  end if
34 end do
35 close(50)
36 ! set current at last time step
37 jt(:,ntimes)=jt(:,ntimes-1)
38 end subroutine
39 
subroutine readjtot(jt)
Definition: readjtot.f90:7
real(8), dimension(:), allocatable times
Definition: modtddft.f90:48