The upcoming release of netcdf-c v4.9.1 will introduce the capability to read fixed length strings for attribute and variable values. This is a great addition and thanks for putting it in!
It would be equally great to add the capability to write fixed length strings for both attributes and variables. I work on the JEDI project at JCSDA, and we are using netcdf extensively for storing model and observational data.
An example use case is that we store datetime information as a 64-bit integer offset from a specified "epoch" datetime. The epoch is recorded in a string attribute on the datetime variable in the ISO-8601 format. This was done to take advantage of the ncdump -t feature that writes out datetime information in human readable format. The issue is that ncdump -t wants a fixed length string for the epoch attribute but we cannot write it out as such using the netcdf API (only as a variable length string). So we have to put in a workaround to change that attribute to a fixed length string after writing the file.
I'm happy to provide more information as needed for this issue.
Thanks for your help with this!
The upcoming release of netcdf-c v4.9.1 will introduce the capability to read fixed length strings for attribute and variable values. This is a great addition and thanks for putting it in!
It would be equally great to add the capability to write fixed length strings for both attributes and variables. I work on the JEDI project at JCSDA, and we are using netcdf extensively for storing model and observational data.
An example use case is that we store datetime information as a 64-bit integer offset from a specified "epoch" datetime. The epoch is recorded in a string attribute on the datetime variable in the ISO-8601 format. This was done to take advantage of the
ncdump -tfeature that writes out datetime information in human readable format. The issue is thatncdump -twants a fixed length string for the epoch attribute but we cannot write it out as such using the netcdf API (only as a variable length string). So we have to put in a workaround to change that attribute to a fixed length string after writing the file.I'm happy to provide more information as needed for this issue.
Thanks for your help with this!