Hi there
I have a tricky problem with exodus II. When I build a native C program with exodus II and linking with the shared netcdf library everything works fine. After this experiment I built a shared library using exodus II (again linking against the shared netcdf library).

Afterwards I tried to import functions from this shared library to Python using ctypes. Unfortunatley, I get error messages that some NETCDF IDs are invalid when I try to run the C functions from Python (the error messages appear when I set the error handling of exodus II to debug).
The error messages look like this:

ncdimid: ncid 3: NetCDF: Not a valid ID
ncdimid: ncid 3: NetCDF: Not a valid ID
ncdimid: ncid 3: NetCDF: Not a valid ID
ncdimid: ncid 3: NetCDF: Not a valid ID
[ex_inquire] Error: failed to locate database dimensionality in file id 3
exerrval = -33
ncattget: ncid 3: NetCDF: Not a valid ID
[ex_inquire] Error: failed to get database title for file id 3
exerrval = -33
number of nodes after opening 0
ncdimid: ncid 3: NetCDF: Not a valid ID
[ex_get_var_param] Error: failed to locate global variable names in file id 3
exerrval = -33
ncdimid: ncid 3: NetCDF: Not a valid ID
[ex_get_var_param] Error: failed to locate nodal variable names in file id 3
exerrval = -33
ncdimid: ncid 3: NetCDF: Not a valid ID
[ex_get_var_param] Error: failed to locate element block variable names in file id 3
exerrval = -33
ncdimid: ncid 3: NetCDF: Not a valid ID

The code that handles EXODUS II files never gets into contact with variables passed from Python to the C code. Therefore, the problem cannot be incompatible types between ctypes and Exodus II. I suspect, that the problem is somehow related to linking netcdf.
Does anyone have an idea whats going on here?

regards
Eugen