change checking for size of dim/attr/header limit #130
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
The maximal header extent for CDF 1 and 2 should be
NC_MAX_INT
, i,e,the maximum value of a signed 4-byte integer,
2^31-1
. Same for thedimension size. This is because NetCDF file format defines them as
non-negative signed integers,
OFFSET
andNON_NEG
respectively.NetCDF file format specification:
begin
is the file extent, i.e. starting file offset of the data section.dim_length
is the dimension size.Note for variable size, the maximal is
2^31-3 for CDF-1
2^32-3 for CDF-2
2^63-3 for CDF-5
Variable size is calculated internally in PnetCDF. Therefore, the
variable size is limited to the space available in bytes.
-3
isdue to the 4-byte upward alignment.
Although
vsize
is defined and stored in the file header, it is marked as a redundant item and is not used in PnetCDF.