diff --git a/TurTLE/DNS.py b/TurTLE/DNS.py index 33495f44111b3bbabef4999768f443bbbc3556da..6c3d3409d7479993f14c1e5e639b7db2fe3801d7 100644 --- a/TurTLE/DNS.py +++ b/TurTLE/DNS.py @@ -881,12 +881,13 @@ class DNS(_code): for cp in range(source_current_checkpoint+1)] src_file = None for check_file in source_checkpoints: - f0 = h5py.File(check_file, 'r') - if ('{0}'.format(opt.src_iteration) - in f0[checkpoint_field + '/complex'].keys()): - f0.close() - src_file = check_file - break + if os.path.exists(check_file): + f0 = h5py.File(check_file, 'r') + if ('{0}'.format(opt.src_iteration) + in f0[checkpoint_field + '/complex'].keys()): + f0.close() + src_file = check_file + break self.copy_complex_field( src_file, checkpoint_field + '/complex/{0}'.format(opt.src_iteration),