Add tests for reading NF90_STRING & NF90_CHAR attributes.#469
Merged
WardF merged 3 commits intoUnidata:mainfrom Sep 9, 2025
Merged
Add tests for reading NF90_STRING & NF90_CHAR attributes.#469WardF merged 3 commits intoUnidata:mainfrom
WardF merged 3 commits intoUnidata:mainfrom
Conversation
…gle string attributes from a netCDF4 CF-1.9 compliant using string type for attributes. It overloads the nf90_get_att_text function returning single string (note nlen == 1) as if they are character attributes. What is not implemented are multidimensional strings, and the capability to write string attributes, because of the lack of string type in Fortran standard. This patch would allow reading netCDF files like the one created from the Copernicus cds-beta site for ECMWF ERA5 model. See reference to this in issue Unidata#181 "string attributes are not supported yet?"
…to feature/cda/add_f90tst_att
Contributor
Author
@WardF Thank you for giving me the opportunity to contribute to the src for the netcdf-fortran! |
Member
|
You're quite welcome, thank you! |
Contributor
Author
Good morning @WardF , may I ask how do I contribute to the continuous development of the NetCDF-fortran in the future? For example, how do I know what development can I contribute for the next release version of the NetCDF-fortran? Thank you very much for your guidance! |
Member
|
Well, the best way, if you have something you're interested in contributing, would be to open a conversation or an issue. We certainly would love to have your contributions! I'm currently working on the netCDF-C 4.10.0 release, which will have a Fortran release at the same time! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Add tests
nf03_test4/f90tst_attto check if NF90_STRING & NF90_CHAR attributes can be read in correctly by the new implementation (#453).The test reads the
NF90_STRING&NF90_CHARattributes at 3 levels: 1) global attributes, 2) var attributes under root, and 3) var attributes under group.A reference input data
ref_att.nc(size8.0KB) is included as testing input data. The cdlref_att.cdlto generate this reference input data is also included.The reason why not adopting the approach to generate the reference data by netcdf-fortran first then reading it in is because the current version (
mainbranch) does not support writingNF90_STRINGattributes directly into the NC file.This test is added to both 1)
CMake& 2)autotools, so both installation approaches cover this test.