netCDF 4.2.1.1
|
There are important constraints on the structure of large netCDF classic files that result from the 32-bit relative offsets that are part of the netCDF classic file format:
The maximum size of a record in the classic format in versions 3.5.1 and earlier is 2^32 - 4 bytes, or about 4 GiB. In versions 3.6.0 and later, there is no such restriction on total record size for the classic format or 64-bit offset format.
If you don't use the unlimited dimension, only one variable can exceed 2 GiB in size, but it can be as large as the underlying file system permits. It must be the last variable in the dataset, and the offset to the beginning of this variable must be less than about 2 GiB.
The limit is really 2^31 - 4. If you were to specify a variable size of 2^31 -3, for example, it would be rounded up to the nearest multiple of 4 bytes, which would be 2^31, which is larger than the largest signed integer, 2^31 - 1.
For example, the structure of the data might be something like:
netcdf bigfile1 { dimensions: x=2000; y=5000; z=10000; variables: double x(x); // coordinate variables double y(y); double z(z); double var(x, y, z); // 800 Gbytes }
If you use the unlimited dimension, record variables may exceed 2 GiB in size, as long as the offset of the start of each record variable within a record is less than 2 GiB - 4. For example, the structure of the data in a 2.4 Tbyte file might be something like:
netcdf bigfile2 { dimensions: x=2000; y=5000; z=10; t=UNLIMITED; // 1000 records, for example variables: double x(x); // coordinate variables double y(y); double z(z); double t(t); // 3 record variables, 2400000000 bytes per record double var1(t, x, y, z); double var2(t, x, y, z); double var3(t, x, y, z); }