IO: Restart job from the last available restart snapshot.
If parameter 'restart_number' was not set or is negative, it is determined from the last available restart snapshot. The restart snapshots should be all in the same restart path in the complete sequence, i.e., from first one to the last one. Signed-off-by: Grzegorz Kowal <grzegorz@amuncode.org>
This commit is contained in:
parent
f8dae064b9
commit
3115ecdabb
@ -251,6 +251,7 @@ module io
|
||||
use hdf5 , only : h5pset_deflate_f, h5pset_filter_f
|
||||
#endif /* HDF5 */
|
||||
use iso_fortran_env, only : error_unit
|
||||
use mpitools , only : nproc
|
||||
use parameters , only : get_parameter
|
||||
|
||||
! local variables are not implicit by default
|
||||
@ -264,6 +265,8 @@ module io
|
||||
|
||||
! local variables
|
||||
!
|
||||
logical :: test
|
||||
character(len=255) :: dname
|
||||
character(len=255) :: sformat = "xml"
|
||||
character(len=255) :: precise = "off"
|
||||
character(len=255) :: ghosts = "on"
|
||||
@ -275,6 +278,7 @@ module io
|
||||
integer, dimension(1) :: cd_values = 3
|
||||
#endif /* HDF5 */
|
||||
|
||||
|
||||
#ifdef HDF5
|
||||
! local parameters
|
||||
!
|
||||
@ -341,6 +345,38 @@ module io
|
||||
restart_format = snapshot_xml
|
||||
end select
|
||||
|
||||
! check the last available restart snapshot
|
||||
!
|
||||
if (nrest < 0) then
|
||||
|
||||
test = .true.
|
||||
nrest = 0
|
||||
|
||||
select case(restart_format)
|
||||
#ifdef HDF5
|
||||
case(snapshot_hdf5)
|
||||
do while (test)
|
||||
nrest = nrest + 1
|
||||
write(dname, "(a,'r',i6.6,'_',i5.5,'.h5')") &
|
||||
trim(respath), nrest, nproc
|
||||
inquire(file = dname, exist = test)
|
||||
end do
|
||||
#endif /* HDF5 */
|
||||
case default
|
||||
do while (test)
|
||||
nrest = nrest + 1
|
||||
write(dname, "(a,'restart-',i5.5)") trim(respath), nrest
|
||||
#ifdef __INTEL_COMPILER
|
||||
inquire(directory = dname, exist = test)
|
||||
#else /* __INTEL_COMPILER */
|
||||
inquire(file = dname, exist = test)
|
||||
#endif /* __INTEL_COMPILER */
|
||||
end do
|
||||
end select
|
||||
|
||||
nrest = nrest - 1
|
||||
end if
|
||||
|
||||
! get compression format and level for XML+binary files
|
||||
!
|
||||
call get_parameter("compression_format", cformat)
|
||||
|
Loading…
x
Reference in New Issue
Block a user