modification for time periodic output / save mean flow / minor changes