Unidata - To provide the data services, tools, and cyberinfrastructure leadership that advance Earth system science, enhance educational opportunities, and broaden participation. Unidata
         
  advanced  
 

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         |



 
 
  Contact Us     Site Map     Search     Terms and Conditions     Privacy Policy     Participation Policy
 
National Science Foundation (NSF) UCAR Community Programs   Unidata is a member of the UCAR Community Programs, is managed by the University Corporation for Atmospheric Research, and is sponsored by the National Science Foundation.
P.O. Box 3000     Boulder, CO 80307-3000 USA     Tel: 303-497-8643     Fax: 303-497-8690