The Elk Code
 
Loading...
Searching...
No Matches
tdbackup.f90
Go to the documentation of this file.
1
2! Copyright (C) 2018 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
6subroutine tdbackup
7use modmain
8use modtddft
9use modmpi
10use modramdisk
11implicit none
12! local variables
13integer ik
14! allocatable arrays
15complex(8), allocatable :: evecsvt(:,:)
16if (ntsbackup < 1) return
17if (mod(itimes-1,ntsbackup) /= 0) return
18! ensure eigenvectors are written to disk
20wrtdsk=.true.
21allocate(evecsvt(nstsv,nstsv))
22do ik=1,nkpt
23! distribute among MPI processes
24 if (mod(ik-1,np_mpi) /= lp_mpi) cycle
25! read in time-dependent Kohn-Sham eigenvectors
26 call getevecsv(filext,ik,vkl(:,ik),evecsvt)
27! write eigenvectors to backup file
28 call putevecsv('_TD_BACKUP.OUT',ik,evecsvt)
29end do
30deallocate(evecsvt)
31! write the time step backup file
32if (mp_mpi) then
33 open(50,file='TIMESTEP_BACKUP.OUT',form='FORMATTED')
34 write(50,'(I8,G18.10)') itimes,times(itimes)
35 close(50)
36end if
38! synchronise MPI processes
39call mpi_barrier(mpicom,ierror)
40end subroutine
41
subroutine getevecsv(fext, ikp, vpl, evecsv)
Definition getevecsv.f90:7
character(256) filext
Definition modmain.f90:1300
integer nkpt
Definition modmain.f90:461
integer nstsv
Definition modmain.f90:886
real(8), dimension(:,:), allocatable vkl
Definition modmain.f90:471
integer lp_mpi
Definition modmpi.f90:15
integer ierror
Definition modmpi.f90:19
integer mpicom
Definition modmpi.f90:11
integer np_mpi
Definition modmpi.f90:13
logical mp_mpi
Definition modmpi.f90:17
type(file_t), dimension(:), allocatable, private file
logical wrtdsk0
logical wrtdsk
real(8), dimension(:), allocatable times
Definition modtddft.f90:48
integer ntsbackup
Definition modtddft.f90:54
integer itimes
Definition modtddft.f90:46
subroutine putevecsv(fext, ik, evecsv)
Definition putevecsv.f90:7
subroutine tdbackup
Definition tdbackup.f90:7