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.
Ed, > In fact, support for NC_LONG, required from netCDF-4 for backward > compatibility, cost me considerable trouble. The problem is that the > long type may be the same as an int (and this is the usual case), or > it may be the same as a "long long." ... Also, just to be clear, there is no portability issue here. The function nc_get_vara_ulong() would convert the netCDF data of whatever numeric type to the unsigned long type on the platform on which it is built. This is just a matter of copying the numeric type into a variable declared to be of type "unsigned long". It doesn't matter whether it is the same as int or long long, it just needs to be whatever the type "unsigned long" is on the platform on which the library is built. I think if you look at how you already implementted his for long, you'll see the issue of the size of longs does not come up, and that code is unrelated to NC_INT, NC_INT64, or NC_LONG. --Russ Ticket Details =================== Ticket ID: EAM-622298 Department: Support netCDF Priority: Normal Status: Open