Moved auto-gereration logic to netcdf save to avoid issues with
metadata.