diff --git a/Source/Diagnostics/FlushFormats/FlushFormatOpenPMD.cpp b/Source/Diagnostics/FlushFormats/FlushFormatOpenPMD.cpp index e15a7065f3a..ef897f8d3a0 100644 --- a/Source/Diagnostics/FlushFormats/FlushFormatOpenPMD.cpp +++ b/Source/Diagnostics/FlushFormats/FlushFormatOpenPMD.cpp @@ -154,9 +154,11 @@ FlushFormatOpenPMD::WriteToFile ( // Set step and output directory name. m_OpenPMDPlotWriter->SetStep(output_iteration, prefix, file_min_digits, isBTD); - // fields: only dumped for coarse level - m_OpenPMDPlotWriter->WriteOpenPMDFieldsAll( - varnames, mf, geom, output_levels, output_iteration, static_cast(time), isBTD, full_BTD_snapshot); + if (!mf.empty()) { + // fields: only dumped for coarse level + m_OpenPMDPlotWriter->WriteOpenPMDFieldsAll( + varnames, mf, geom, output_levels, output_iteration, static_cast(time), isBTD, full_BTD_snapshot); + } // particles: all (reside only on locally finest level) m_OpenPMDPlotWriter->WriteOpenPMDParticles( diff --git a/Source/Diagnostics/RecordingPlaneDiagnostics.cpp b/Source/Diagnostics/RecordingPlaneDiagnostics.cpp index f388f051a80..b25acacdb74 100644 --- a/Source/Diagnostics/RecordingPlaneDiagnostics.cpp +++ b/Source/Diagnostics/RecordingPlaneDiagnostics.cpp @@ -393,7 +393,7 @@ RecordingPlaneDiagnostics::Flush (int i_buffer, bool /* force_flush */) bool const plot_raw_fields_guards = false; if (nparticles > 0) { - m_flush_format->WriteToFile(m_varnames, m_mf_output[i_buffer], m_geom_output[i_buffer], + m_flush_format->WriteToFile(m_varnames, {}, m_geom_output[i_buffer], warpx.getistep(), warpx.gett_new(0), m_output_species[i_buffer], nlev_output, m_file_prefix, m_file_min_digits, plot_raw_fields, plot_raw_fields_guards, use_pinned_pc, isBTD, i_buffer, m_flush_counter, maxBTDBuffers, geom,