Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

change checking for size of dim/attr/header limit #130

Merged
merged 3 commits into from
Mar 13, 2024
Merged

Commits on Mar 12, 2024

  1. Configuration menu
    Copy the full SHA
    121ff46 View commit details
    Browse the repository at this point in the history
  2. Dimension size limit should be INT_MAX

    According to NetCDF CDF 1 and 2 file format specification, the maximal
    dimension size should be INT_MAX, i.e. 2^31-1, <non-negative INT>.
    
    NetCDF file format specification:
      netcdf_file  = header data
      header       = magic numrecs dim_list gatt_list var_list
      dim_list     = ABSENT | NC_DIMENSION nelems [dim ...]
      dim          = name dim_length
      dim_length   = NON_NEG
      NON_NEG      = <non-negative INT>
      INT          = <32-bit signed integer, Bigendian, two's complement>
    
    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. Therefor, the
    variable size is limited to the space available in bytes. -3 is
    due to the 4-byte upward alignment.
    Also, note vsize defined in the file header format is not used.
    wkliao committed Mar 12, 2024
    Configuration menu
    Copy the full SHA
    830295c View commit details
    Browse the repository at this point in the history

Commits on Mar 13, 2024

  1. test dimension size limits

    wkliao committed Mar 13, 2024
    Configuration menu
    Copy the full SHA
    117d109 View commit details
    Browse the repository at this point in the history