pseudopotential files are copied using f_copy, interface to C copy. In this

way the file copied into the save directory is identical to the original
one, with the same MD5 hash


git-svn-id: http://qeforge.qe-forge.org/svn/q-e/trunk/espresso@10913 c92efa57-630b-4861-b058-cf58834340f0
This commit is contained in:
giannozz 2014-04-28 15:26:55 +00:00
parent 6b6e6e29b9
commit 24b0ff1f88
1 changed files with 13 additions and 12 deletions

View File

@ -874,6 +874,8 @@ CONTAINS
if_pos, dirname, pos_unit )
!------------------------------------------------------------------------
!
USE wrappers, ONLY: f_copy
!
INTEGER, INTENT(in) :: nsp, nat
INTEGER, INTENT(in) :: ityp(:)
CHARACTER(len=*), INTENT(in) :: atm(:)
@ -910,14 +912,18 @@ CONTAINS
!
CALL iotk_write_dat( ounit, "ATOM_TYPE", atm(i) )
!
CALL iotk_write_dat( ounit, "MASS", amass(i) )
!
CALL iotk_write_dat( ounit, "PSEUDO", trim( psfile(i) ) )
!
CALL iotk_write_end( ounit, "SPECIE"//trim(iotk_index(i)) )
!
! copy pseudopotential file into data directory
!
IF ( pseudo_dir(flen:flen) /= '/' ) THEN
!
file_pseudo_in = pseudo_dir(1:flen) // '/' // TRIM(psfile(i))
!
ELSE
!
file_pseudo_in = pseudo_dir(1:flen) // TRIM(psfile(i))
!
ENDIF
!
IF ( dirname(flen2:flen2) /= '/' ) THEN
@ -927,22 +933,17 @@ CONTAINS
END IF
!
IF ( file_pseudo_in .ne. file_pseudo_out ) THEN
!
INQUIRE ( FILE=file_pseudo_in, EXIST = pseudo_exists )
IF ( pseudo_exists ) THEN
CALL qexml_copy_file( TRIM( file_pseudo_in ), TRIM( file_pseudo_out ), ierrl )
ierrl = f_copy( file_pseudo_in, file_pseudo_out )
ELSE
CALL infomsg( 'write_ions', &
'file ' // TRIM( file_pseudo_in) // ' not present' )
END IF
!
END IF
!
CALL iotk_write_dat( ounit, "MASS", amass(i) )
!
CALL iotk_write_dat( ounit, "PSEUDO", trim( psfile(i) ) )
!
!
CALL iotk_write_end( ounit, "SPECIE"//trim(iotk_index(i)) )
!
ENDDO
!
!