diff --git a/Modules/read_pseudo.f90 b/Modules/read_pseudo.f90 index ac4e91bfc..286bf603f 100644 --- a/Modules/read_pseudo.f90 +++ b/Modules/read_pseudo.f90 @@ -189,7 +189,7 @@ SUBROUTINE readpp ( input_dft, printout, ecutwfc_pp, ecutrho_pp ) ! ELSE ! - OPEN ( UNIT = iunps, FILE = TRIM(file_pseudo), STATUS = 'old', FORM = 'formatted' ) + OPEN ( UNIT = iunps, FILE = file_pseudo, STATUS = 'old', FORM = 'formatted' ) ! ! The type of the pseudopotential is determined by the file name: ! *.xml or *.XML UPF format with schema pp_format=0 diff --git a/upflib/read_upf_new.f90 b/upflib/read_upf_new.f90 index 43d8d6da6..9bc500bbe 100644 --- a/upflib/read_upf_new.f90 +++ b/upflib/read_upf_new.f90 @@ -55,6 +55,7 @@ CONTAINS end if end if if ( ierr /= 0 .and. ierr /= -2 ) then + call xml_closefile( ) ierr = -81 return end if