NetCDF version 3 includes a complete rewrite of the netCDF library. It is about twice as fast as the previous version. The netCDF file format is unchanged, so files written with version 3 can be read with version 2 code and vice versa.
The core library is now written in ANSI C. For example, prototypes are used throughout as well as const qualifiers where appropriate. You must have an ANSI C compiler to compile this version.
Rewriting the library offered an opportunity to implement improved C and FORTRAN interfaces that provide some significant benefits:
type safety, by eliminating the need to use generic void* pointers;
automatic type conversions, by eliminating the undesirable coupling between the language-independent external netCDF types (NF_BYTE, ..., NF_DOUBLE) and language-dependent internal data types (char, ..., double);
support for future enhancements, by eliminating obstacles to the clean addition of support for packed data and multithreading;
more standard error behavior, by uniformly communicating an error status back to the calling program in the return value of each function.
It is not necessary to rewrite programs that use the version 2 C interface, because the netCDF-3 library includes a backward compatibility interface that supports all the old functions, globals, and behavior. We are hoping that the benefits of the new interface will be an incentive to use it in new netCDF applications. It is possible to convert old applications to the new interface incrementally, replacing netCDF-2 calls with the corresponding netCDF-3 calls one at a time. If you want to check that only netCDF-3 calls are used in an application, a preprocessor macro (NO_NETCDF_2) is available for that purpose.
Other changes in the implementation of netCDF result in improved portability, maintainability, and performance on most platforms. A clean separation between I/O and type layers facilitates platform-specific optimizations. The new library no longer uses a vendor-provided XDR library, which simplifies linking programs that use netCDF and speeds up data access significantly in most cases.