diff --git a/src/outputs/parthenon_opmd.cpp b/src/outputs/parthenon_opmd.cpp index c0ee2aa434b2..f4c892e4145e 100644 --- a/src/outputs/parthenon_opmd.cpp +++ b/src/outputs/parthenon_opmd.cpp @@ -663,9 +663,15 @@ void OpenPMDOutput::WriteOutputFile(Mesh *pm, ParameterInput *pin, SimTime *tm, // advance output parameters if this is not a triggered (now or final) output if (signal == SignalHandler::OutputSignal::none) { output_params.file_number++; - output_params.next_time += output_params.dt; pin->SetInteger(output_params.block_name, "file_number", output_params.file_number); - pin->SetReal(output_params.block_name, "next_time", output_params.next_time); + if (output_params.dt > 0.0) { + output_params.next_time += output_params.dt; + pin->SetReal(output_params.block_name, "next_time", output_params.next_time); + } + if (output_params.dn > 0) { + output_params.next_n += output_params.dn; + pin->SetInteger(output_params.block_name, "next_n", output_params.next_n); + } } }