Re: Aligning NC_SHORT, unlimited dimension

On Fri, 6 Apr 2001, Alexey Goldin wrote:
>
> I realize that every record should be aligned at 4-byte boundary, but it
> looks like every member of record structure is aligned at 4-byte
> boundary as well.

Hi Alexey,

Your analysis of the problem is correct, and documented in the file format
specification in the netCDF User's Guide.  My suggestion would be to try
rearranging your data.  If you rearrange the data in the file you sent as a
sample as follows then the word alignment restriction doesn't result in any
overhead:

netcdf t2 {
dimensions:
         d2 = 2 ;
         time = UNLIMITED ; // (100 currently)
variables:
         short array1(time,d2) ;
data:

  array1 = 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2,
           1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2,
           1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2,
           1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2,
           1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2,
           1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2,
           1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2,
           1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2,
           1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2,
           1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2,
           1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2,
           1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2,
           1, 2, 1, 2, 1, 2, 1 ;
}

Brian


Brian Eaton                               | email: eaton@xxxxxxxx
Climate Modeling Section                  |
National Center for Atmospheric Research  |
P.O. Box 3000, Boulder, CO  80307         |



  • 2001 messages navigation, sorted by:
    1. Thread
    2. Subject
    3. Author
    4. Date
    5. ↑ Table Of Contents
  • Search the netcdfgroup archives: