2003-01-20 05:58:50 +08:00
|
|
|
!
|
|
|
|
! Copyright (C) 2001 PWSCF group
|
|
|
|
! This file is distributed under the terms of the
|
|
|
|
! GNU General Public License. See the file `License'
|
|
|
|
! in the root directory of the present distribution,
|
|
|
|
! or http://www.gnu.org/copyleft/gpl.txt .
|
|
|
|
!
|
|
|
|
!-----------------------------------------------------------------------
|
2003-02-08 00:04:36 +08:00
|
|
|
subroutine save_in_cbands (iter, ik_, dr2)
|
2003-01-20 05:58:50 +08:00
|
|
|
!-----------------------------------------------------------------------
|
2004-01-23 23:08:03 +08:00
|
|
|
USE kinds, ONLY: DP
|
2004-01-15 23:50:19 +08:00
|
|
|
USE io_files, ONLY: iunres
|
|
|
|
USE klist, ONLY: nks
|
2004-01-23 23:08:03 +08:00
|
|
|
USE control_flags, ONLY: reduce_io, tr2, ethr
|
2004-01-15 23:50:19 +08:00
|
|
|
USE wvfct, ONLY: nbnd, et
|
|
|
|
implicit none
|
2003-02-08 00:04:36 +08:00
|
|
|
character :: where * 20
|
2003-01-20 05:58:50 +08:00
|
|
|
! are we in the right place?
|
2003-02-08 00:04:36 +08:00
|
|
|
integer :: ik, ibnd, ik_, iter
|
2003-01-20 05:58:50 +08:00
|
|
|
! counters
|
|
|
|
! last completed kpoint
|
|
|
|
! last completed iteration
|
2003-02-08 00:04:36 +08:00
|
|
|
logical :: exst
|
2003-01-20 05:58:50 +08:00
|
|
|
|
2003-02-08 00:04:36 +08:00
|
|
|
real(kind=DP) :: dr2
|
|
|
|
if (reduce_io) return
|
2003-01-20 05:58:50 +08:00
|
|
|
!
|
|
|
|
! open recover file
|
|
|
|
!
|
2003-02-08 00:04:36 +08:00
|
|
|
call seqopn (iunres, 'restart', 'unformatted', exst)
|
2003-01-20 05:58:50 +08:00
|
|
|
!
|
|
|
|
! save restart information
|
|
|
|
!
|
2003-02-08 00:04:36 +08:00
|
|
|
where = 'ELECTRONS'
|
|
|
|
write (iunres) where
|
|
|
|
write (iunres) ( (et (ibnd, ik), ibnd = 1, nbnd), ik = 1, nks)
|
2003-01-20 05:58:50 +08:00
|
|
|
|
2003-02-08 00:04:36 +08:00
|
|
|
write (iunres) iter, ik_, dr2, tr2, ethr
|
2003-01-20 05:58:50 +08:00
|
|
|
|
2003-02-08 00:04:36 +08:00
|
|
|
close (unit = iunres, status = 'keep')
|
2003-01-20 05:58:50 +08:00
|
|
|
!
|
2003-02-08 00:04:36 +08:00
|
|
|
return
|
2003-01-20 05:58:50 +08:00
|
|
|
end subroutine save_in_cbands
|