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_ions
|
2003-01-20 05:58:50 +08:00
|
|
|
!-----------------------------------------------------------------------
|
2004-01-23 23:08:03 +08:00
|
|
|
USE kinds, ONLY: DP
|
2005-06-17 21:27:38 +08:00
|
|
|
USE io_files, ONLY: iunres, prefix
|
2004-01-15 23:50:19 +08:00
|
|
|
USE klist, ONLY: nks
|
2007-02-22 19:22:57 +08:00
|
|
|
USE control_flags, ONLY: io_level, lscf, tr2, ethr
|
2004-01-15 23:50:19 +08:00
|
|
|
USE wvfct, ONLY: nbnd, et
|
2003-01-20 05:58:50 +08:00
|
|
|
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
|
2005-08-28 22:09:42 +08:00
|
|
|
real(DP) :: dr2
|
2007-02-22 19:22:57 +08:00
|
|
|
!
|
|
|
|
if ( io_level < 2 .or. .not.lscf ) 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'
|
|
|
|
iter = 0
|
|
|
|
ik_ = 0
|
2003-01-20 05:58:50 +08:00
|
|
|
|
2003-02-08 00:04:36 +08:00
|
|
|
dr2 = 0.0d0
|
|
|
|
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_ions
|