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.
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
nlong seems not to be a GitHub user. You need a GitHub account to be able to sign the CLA. If you have already a GitHub account, please add the email address used for this commit to your account. You have signed the CLA already but the status is still pending? Let us recheck it.
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: https://github.com/Unidata/netcdf-c/issues/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.