scorpio
scorpio copied to clipboard
Do we need nc_initialize()/nc_finalize() in PIO?
This issue is to investigate whether nc_initialize() and nc_finalize() should be added to PIO. These APIs are used to initialize/finalize low-level libraries (DAP/HDF5/... etc) used by NetCDF.
AFAICT, nc_initialize() is called inside the NetCDF library. nc_initialize() is called via nc_create() or nc_open() - if nc_initialize() is not already called by the user. So it looks like the user does not need to explicitly call nc_initialize().
However the library never calls nc_finalize() . This could be problematic if the low-level libraries (used by NetCDF) performs some cleanup in the library-specific finalize calls (that is only called by NetCDF in nc_finalize() ).
This is a peculiar behaviour of the NetCDF library since the library should have invoked nc_finalize() without explicit calls from the user (since the library implicitly calls nc_initialize()).