This archive contains answers to questions sent to Unidata support through mid-2025. Note that the archive is no longer being updated. We provide the archive for reference; many of the answers presented here remain technically correct, even if somewhat outdated. For the most up-to-date information on the use of NSF Unidata software and data services, please consult the Software Documentation first.
> As you know, the API for nc_def_var_chunking() changed > in about 200906. NCO must build on both new and old APIs. > So we define, manually, a token > > HAVE_NEW_CHUNKING_API > > which describes which API to expect. It would be great > if the netCDF header file netcdf.h included version > number manipulable by the C pre-processor so code could > easily check what to expect based on the version. > Or netcdf.h could itself supply the token HAVE_NEW_CHUNKING_API. > Almost anything is preferable to requesting users to > know what to set such tokens to. > > Here, e.g., is what NCO does for stubs: > > # ifdef HAVE_NEW_CHUNKING_API > /* Newer, post-200906 netCDF4 API has chk_sz as const */ > int nc_def_var_chunking(const int nc_id,const int var_id,const int > srg_typ,const size_t * const cnk_sz){return 1;} > # else /* !HAVE_NEW_CHUNKING_API */ > /* Older, pre-200906 netCDF4 API has chk_sz as non-const */ > int nc_def_var_chunking(const int nc_id,const int var_id,const int > srg_typ,size_t * const cnk_sz){return 1;} > # endif /* !HAVE_NEW_CHUNKING_API */ > > I hope you consider adding some backward compatibility > mechanism to make adapting to the new API easier. > > Thanks, > Chalrie > -- Howdy Charlie! I have added this, but called it NC_HAVE_NEW_CHUNKING_API. It will be in tonight's snapshot. Thanks for the suggestion. Ed Ticket Details =================== Ticket ID: NGW-449875 Department: Support netCDF Priority: Critical Status: Closed