Inserted iuntmp=90 to be used for closing and deleting files at the end of

calculation (previously unit=4 was hardcoded and could possibly conflict
with other parts of code)
LP


git-svn-id: http://qeforge.qe-forge.org/svn/q-e/trunk/espresso@5857 c92efa57-630b-4861-b058-cf58834340f0
This commit is contained in:
paulatto 2009-08-22 10:24:56 +00:00
parent 368eb618e0
commit df81711c1e
2 changed files with 12 additions and 9 deletions

View File

@ -104,6 +104,8 @@ MODULE io_files
INTEGER :: iunbfgs = 30 ! unit for the bfgs restart file
INTEGER :: iunatsicwfc = 31 ! unit for sic wfc
!
INTEGER :: iuntmp = 90 ! temporary unit, when used must be closed ASAP
!
INTEGER :: nwordwfc = 2 ! length of record in wavefunction file
INTEGER :: nwordatwfc = 2 ! length of record in atomic wfc file
INTEGER :: nwordwann = 2 ! length of record in sic wfc file

View File

@ -17,7 +17,8 @@ SUBROUTINE stop_run( flag )
USE mp_global, ONLY : nimage
USE control_flags, ONLY : lpath, twfcollect, lconstrain, &
lcoarsegrained, io_level, llondon
USE io_files, ONLY : iunwfc, iunigk, iunefield, iunefieldm, iunefieldp
USE io_files, ONLY : iunwfc, iunigk, iunefield, iunefieldm,&
iunefieldp, iuntmp
USE buffers, ONLY : close_buffer
USE path_variables, ONLY : path_deallocation
USE path_io_routines, ONLY : io_path_stop
@ -65,22 +66,22 @@ SUBROUTINE stop_run( flag )
END IF
!
IF (flag .and. .not. lpath) THEN
CALL seqopn( 4, 'restart', 'UNFORMATTED', exst )
CLOSE( UNIT = 4, STATUS = 'DELETE' )
CALL seqopn( iuntmp, 'restart', 'UNFORMATTED', exst )
CLOSE( UNIT = iuntmp, STATUS = 'DELETE' )
ENDIF
IF ( flag .AND. ionode ) THEN
!
! ... all other files must be reopened and removed
!
CALL seqopn( 4, 'update', 'FORMATTED', exst )
CLOSE( UNIT = 4, STATUS = 'DELETE' )
CALL seqopn( iuntmp, 'update', 'FORMATTED', exst )
CLOSE( UNIT = iuntmp, STATUS = 'DELETE' )
!
CALL seqopn( 4, 'para', 'FORMATTED', exst )
CLOSE( UNIT = 4, STATUS = 'DELETE' )
CALL seqopn( iuntmp, 'para', 'FORMATTED', exst )
CLOSE( UNIT = iuntmp, STATUS = 'DELETE' )
!
CALL seqopn( 4, 'BLOCK', 'FORMATTED', exst )
CLOSE( UNIT = 4, STATUS = 'DELETE' )
CALL seqopn( iuntmp, 'BLOCK', 'FORMATTED', exst )
CLOSE( UNIT = iuntmp, STATUS = 'DELETE' )
!
END IF
!