import zarr
import xarray as xr

ds = xr.open_dataset("bar.nc")
# Save as v2
ds.to_zarr("bar_v2.zarr", zarr_format=2, mode='w')
