Always write time dependent diagnostics at the end of the simulation

Issue #204 resolved
David Dickinson created an issue

Currently we don’t write the time dependent outputs to netcdf at the end of the simulation unless it happens to coincide with a multiple of nwrite.

For an extreme example consider a simulation with nstep < nwrite – we will only get the values at t=0 and not at the end of the simulation.

It should be simple to write a test to demonstrate this (e.g. the above case).

A fix is likely to add a force argument to loop_diagnostics and new equivalent, which, if true, overrides the mod(istep, nwrite) check which currently leads to an early exit. We can then simply call this routine after we leave the main time advance loop.

Comments (2)

  1. David Dickinson reporter

    With the proposed fix we would need to watch out for the case where we had already written the final time step to avoid duplication.

  2. Log in to comment