Open jypeter opened 3 years ago
@jypeter Thanks for reporting this.
I've reproduced the issue on our latest release and will look into it.
@jypeter After looking at the code it looks like dimensions
became a reserved attribute and due to the design this prevents it from being written to a file. This behavior will change in the next major version. For the time being your workaround is the solution. I will correct the error message to indicate the real issue.
Where is it specified that dimensions
is a reserved attribute? Though I agree that it could make sense
I have checked all the occurrences of dimensions
in the latest official version of the CF convention (1.8) and I did not find anything about dimensions as an attribute.
The Appendix A: Attributes of CF 1.8 mentions the coordinates
attribute, and other similar attributes, but nothing about dimensions
You are correct dimensions
is not a reserved attribute by CF conventions, it's an application specific one. I cannot comment on why this choice was made, as i'm not the implementing developer. The dimensions
attribute seems better suited as a function and will be changed in the next major version.
OK, it's something internal to cdms2! Well, it's OK as long as there is a clear error message
You may want to mention the possible workarounds:
del(v_out.dimensions)
in the scriptncatted
from nco to rename/remove the attribute in the original file
[Go this error with cdms 3.0.0 of CDAT 8.1]
cdms2 fails with weird error messages, when it tries to write a variable that has a
dimensions
attribute! This could probably be detected (and see if there are other attribute names that could cause problems. I got this error yesterday and solved it by removing the attribute withDon't why this attribute was there (it was in one of the files I got)
I reproduced the error by downloading a fx CMIP6 var (
orog_fx_CESM2_piControl_r1i1p1f1_gn.nc
), and using cdo to add the attributeCreating the test file
Reproducing the bug