I have cube where cube.cell_methods == (None,). When I try to save it to NetCDF, Iris crashes with the following exception:
-> 1728 for name in cm.coord_names:
1729 coord = cube.coords(name)
1730
AttributeError: 'NoneType' object has no attribute 'coord_names'
The error occurs within the NetCDF Saver._create_cf_cell_methods() function.
I think this is a bug. Unfortunately I don't know enough about NetCDF to suggest a fix.
The following code reproduces the error using the NAME_No_time_averaging.txt file.
import iris
cubes = iris.load('NAME_No_time_averaging.txt')
iris.save(cubes, 'test.nc')