netcdf-c/plugins
Dennis Heimbigner ec5b3f9a4f Regularize the scoping of dimensions
This is a follow-on to pull request
````https://github.com/Unidata/netcdf-c/pull/1959````,
which fixed up type scoping.

The primary changes are to _nc\_inq\_dimid()_ and to ncdump.

The _nc\_inq\_dimid()_ function is supposed to allow the name to be
and FQN, but this apparently never got implemented. So if was modified
to support FQNs.

The ncdump program is supposed to output fully qualified dimension names
in its generated CDL file under certain conditions.

Suppose ncdump has a netcdf-4 file F with variable V, and V's parent group
is G. For each dimension id D referenced by V, ncdump needs to determine
whether to print its name as a simple name or as a fully qualified name (FQN).

The algorithm is as follows:

1. Search up the tree of ancestor groups.
2. If one of those ancestor groups contains the dimid, then call it dimgrp.
3. If one of those ancestor groups contains a dim with the same name as the dimid, but with a different dimid, then record that as duplicate=true.
4. If dimgrp is defined and duplicate == false, then we do not need an fqn.
5. If dimgrp is defined and duplicate == true, then we do need an fqn to avoid incorrectly using the duplicate.
6. If dimgrp is undefined, then do a preorder breadth-first search of all the groups looking for the dimid.
7. If found, then use the fqn of the first found such dimension location.
8. If not found, then fail.

Test case ncdump/test_scope.sh was modified to test the proper
operation of ncdump and _nc\_inq\_dimid()_.

Misc. Other Changes:
* Fix nc_inq_ncid (NC4_inq_ncid actually) to return root group id if the name argument is NULL.
* Modify _ncdump/printfqn_ to print out a dimid FQN; this supports verification that the resulting .nc files were properly created.
2021-05-31 15:51:12 -06:00
..
blocksort.c Update the bzip library in plugins to version 1.0.8 2021-03-30 15:27:24 -06:00
bzlib_private.h Update the bzip library in plugins to version 1.0.8 2021-03-30 15:27:24 -06:00
bzlib.c Update the bzip library in plugins to version 1.0.8 2021-03-30 15:27:24 -06:00
bzlib.h Update the bzip library in plugins to version 1.0.8 2021-03-30 15:27:24 -06:00
CMakeLists.txt Mostly revert the filter code to reduce its complexity of use. 2020-09-27 12:43:46 -06:00
compress.c Update the bzip library in plugins to version 1.0.8 2021-03-30 15:27:24 -06:00
crctable.c Update the bzip library in plugins to version 1.0.8 2021-03-30 15:27:24 -06:00
decompress.c Update the bzip library in plugins to version 1.0.8 2021-03-30 15:27:24 -06:00
h5bzip2.h re: gh issue https://github.com/Unidata/netcdf-c/issues/911 2018-04-21 20:10:47 -06:00
h5misc.h Regularize the scoping of dimensions 2021-05-31 15:51:12 -06:00
h5noop.h Allow redefinition of variable filters 2020-05-11 09:42:31 -06:00
H5Zbzip2.c Minor config.h changes to support filters in Fortran 2019-04-29 16:36:08 -06:00
H5Zmisc.c Regularize the scoping of dimensions 2021-05-31 15:51:12 -06:00
H5Znoop.c Add tests for filter order on read and write cases 2020-12-29 20:12:35 -07:00
H5Ztemplate.c Fix memory problems when using HDF5 version 1.10.x and later. 2018-10-04 11:37:21 -06:00
H5Zutil.c Mostly revert the filter code to reduce its complexity of use. 2020-09-27 12:43:46 -06:00
huffman.c Update the bzip library in plugins to version 1.0.8 2021-03-30 15:27:24 -06:00
Makefile.am Update the bzip library in plugins to version 1.0.8 2021-03-30 15:27:24 -06:00
randtable.c Update the bzip library in plugins to version 1.0.8 2021-03-30 15:27:24 -06:00