The Elk Code
readtimes.f90
Go to the documentation of this file.
1 
2 ! Copyright (C) 2015 K. Krieger, 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 readtimes
7 use modmain
8 use modtddft
9 implicit none
10 ! local variables
11 integer ios
12 real(8) times_,t1
13 open(50,file='TIMESTEP.OUT',form='FORMATTED',status='OLD',iostat=ios)
14 if (ios /= 0) then
15  write(*,*)
16  write(*,'("Error(readtimes): error opening TIMESTEP.OUT")')
17  write(*,*)
18  stop
19 end if
20 read(50,*,iostat=ios) itimes0,times_
21 if (ios /= 0) then
22  write(*,*)
23  write(*,'("Error(readtimes): error reading time step from TIMESTEP.OUT")')
24  write(*,*)
25  stop
26 end if
27 if ((itimes0 < 1).or.(itimes0 > ntimes)) then
28  write(*,*)
29  write(*,'("Error(readtimes): invalid itimes : ",I8)') itimes0
30  write(*,*)
31  stop
32 end if
33 t1=abs(times(itimes0)-times_)
34 if (t1 > 1.d-8) then
35  write(*,*)
36  write(*,'("Error(readtimes): differing time step")')
37  write(*,'(" current : ",G18.10)') times(itimes0)
38  write(*,'(" TIMESTEP.OUT : ",G18.10)') times_
39  write(*,*)
40  stop
41 end if
42 close(50)
43 end subroutine
44 
integer ntimes
Definition: modtddft.f90:42
subroutine readtimes
Definition: readtimes.f90:7
real(8), dimension(:), allocatable times
Definition: modtddft.f90:48
integer itimes0
Definition: modtddft.f90:44