diff --git a/src/dump.cpp b/src/dump.cpp index a354be4f04..22750ed05c 100644 --- a/src/dump.cpp +++ b/src/dump.cpp @@ -332,6 +332,7 @@ void Dump::write() // if file per timestep, open new file if (multifile) openfile(); + if (fp) clearerr(fp); // simulation box bounds @@ -519,6 +520,8 @@ void Dump::write() if (filewriter && fp != nullptr) write_footer(); + if (fp && ferror(fp)) error->one(FLERR,"Error writing dump {}: {}", id, utils::getsyserror()); + // if file per timestep, close file if I am filewriter if (multifile) {