removed g_ncid as the ascociated bug was fixed in c library 4.4.1 #131
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.
Fixes #32 #30
Hi, So I have been digging into the global variable issue, it appears it was fixed in the C library in 2016.
specifically It seems like this was fixed in the netcdf-c 4.4.1 library:
Unidata/netcdf-c#240
If my understanding is correct, as it stands anyone using netcdf4 and defining custom types cannot have more than one file open at the same time. It also forces the custom type definition to be in the root group for netcdf4, rather than the parent group as one would expect.
I think the correct solution is to get rid of the global variable g_ncid and replace it with the groupID when calling nc_inq_type, though I am not sure what version compatibility you are targeting between this and netcdf-c.