# CF 1.7 compliance of netCDF data from CDS-beta

**URL:** <https://forum.ecmwf.int/t/cf-1-7-compliance-of-netcdf-data-from-cds-beta/6587>\
**Category:** Datasets and Usage\
**Tags:** era5\
**Created:** [2 October 2024 16:26 UTC](https://forum.ecmwf.int/t/cf-1-7-compliance-of-netcdf-data-from-cds-beta/6587 "2024-10-02T16:26:30Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Graziano\_Giuliani](https://forum.ecmwf.int/user_avatar/forum.ecmwf.int/graziano_giuliani/32/656_2.png) [@Graziano\_Giuliani](https://forum.ecmwf.int/u/Graziano_Giuliani)\
**Post date:** [2 October 2024 16:26 UTC](https://forum.ecmwf.int/t/cf-1-7-compliance-of-netcdf-data-from-cds-beta/6587/1 "2024-10-02T16:26:30Z")

</div>

Hi!  
I have migrated to the new CDS-beta by cdsapi serving data cfgrib converted into netCDF format, and my Fortran program chokes reading the data. Sigh. The problem is that type “string” for character attributes is NOT supported by the netCDF Fortran library. And, worse, it is not CF-1.7 compliant, which is the version document the Conventions global attribute in the file (unreadable from Fortran 🙂 ) claims the data format to comply to. Because A LOT of Fortran code still out here reading netCDF formatted data for science, maybe some mitigation action should be put in place.

[https://github.com/Unidata/netcdf-fortran/issues/181](https://github.com/Unidata/netcdf-fortran/issues/181)

Regardless, the Conventions attribute used in the file should be at least updated to the value “CF-1.8” to start using netCDF4 string type for the data attributes.

---

<div class="post-metadata">

**Author:** ![Graziano\_Giuliani](https://forum.ecmwf.int/user_avatar/forum.ecmwf.int/graziano_giuliani/32/656_2.png) [@Graziano\_Giuliani](https://forum.ecmwf.int/u/Graziano_Giuliani)\
**Post date:** [3 October 2024 12:21 UTC](https://forum.ecmwf.int/t/cf-1-7-compliance-of-netcdf-data-from-cds-beta/6587/2 "2024-10-03T12:21:24Z")

</div>

Just to follow-on on the type chosen for the attributes, some viewers (GrADS, ncview) don’t know what to do with type NC\_INT64. If it is not strictly required by the data, why use 64 bit type for storing constants like 0? Why not use NC\_INT?

---

<div class="post-metadata">

**Author:** ![Graziano\_Giuliani](https://forum.ecmwf.int/user_avatar/forum.ecmwf.int/graziano_giuliani/32/656_2.png) [@Graziano\_Giuliani](https://forum.ecmwf.int/u/Graziano_Giuliani)\
**Post date:** [3 October 2024 13:34 UTC](https://forum.ecmwf.int/t/cf-1-7-compliance-of-netcdf-data-from-cds-beta/6587/3 "2024-10-03T13:34:38Z")

</div>

My bad, actually the first CF convention documents allowing strings for text attributes is the CF-1.9.

> **[CF Conformance Requirements and Recommendations 1.9](https://cfconventions.org/Data/cf-documents/requirements-recommendations/conformance-1.9.html)**

In CF-1.8 and below, you can still read:

### 2.2 Data Types

**Requirements:**

- CF attributes that take string values must be 1D character arrays.
