tracmass.swap_fields#

tracmass.swap_fields(lazy_fluxes)[source]#

Swap time levels: present (slot 1) becomes past (slot 0).

Mirrors mod_swap.F90::swap_time(). After calling this function, the caller should provide new present-slot data (e.g. by calling update_flux()).

This is a pure Python reference swap — no Dask compute, no JAX.

Parameters:

lazy_fluxes (LazyFluxFields) – Lazy flux data to swap.

Returns:

LazyFluxFields – New LazyFluxFields where the old present data is now the past slot. The present slot is left pointing at the old present data (stale) and should be overwritten by the caller.

Return type:

LazyFluxFields