diff --git a/gusto/io.py b/gusto/io.py index 0a9eb2b8d..7dd841300 100644 --- a/gusto/io.py +++ b/gusto/io.py @@ -688,6 +688,10 @@ def dump(self, state_fields, t, step, initial_steps=None): completed by a multi-level time scheme. Defaults to None. """ output = self.output + if self.ensemble is not None: + write_file = self.ensemble.ensemble_comm.rank == 0 + else: + write_file = True # Diagnostics: # Compute diagnostic fields @@ -726,7 +730,7 @@ def dump(self, state_fields, t, step, initial_steps=None): # dump fields self.write_nc_dump(t) - if output.dump_vtus and self.ensemble.ensemble_comm.rank == 0: + if output.dump_vtus and write_file: # dump fields self.pvd_dumpfile.write(*self.to_dump)