IO: Restore metadata from files corresponding to process number.

Signed-off-by: Grzegorz Kowal <grzegorz@amuncode.org>
This commit is contained in:
Grzegorz Kowal 2018-02-09 17:25:04 -02:00
parent cdd9b8e204
commit 14b7cbd9ff

View File

@ -796,13 +796,17 @@ module io
!! 1. RESTORE PARAMETERS AND META BLOCKS FROM THE FIRST FILE
!!
! prepare the filename
! prepare the filename using the current process number; in case the file does
! not exist decrease it until the file corresponding to lower process number
! is found;
!
write (fl, "(a,'r',i6.6,'_',i5.5,'.h5')") trim(respath), nrest, 0
! check if the HDF5 file exists
!
inquire(file = fl, exist = info)
info = .false.
lfile = nproc + 1
do while (.not. info .and. lfile > 0)
lfile = lfile - 1
write (fl, "(a,'r',i6.6,'_',i5.5,'.h5')") trim(respath), nrest, lfile
inquire(file = fl, exist = info)
end do
! quit, if file does not exist
!