Re: character dimensions, attribute lengths

Thank you, all. I will pass along this information; I'm a little relieved
to know that this practice is not generally accepted. It was not something
I had seen before, but one of my colleagues seemed to think that it was
standard procedure:

I would prefer to keep these dimensions because they fix a size limit
to the character strings. This can be usefull to avoid crashes in
user’s software because of an unexpectedly too long string.

Reaching consensus with a large, diverse group of people all working
with different netcdf systems is quite a challenge, but we may be getting
somewhere. I appreciate the feed back.

Cheers - Nan Galbraith

 ... you should not be using formal Netcdf dimensions to
 store attribute lengths. Netcdf stores the length of each attribute
 separately; this is not to be confused with formal dimensions for
 data arrays. When reading a Netcdf character attribute, you should
 usually read the length first, then the string itself. If you are
 doing dynamic allocation, then allocate the memory for the string
 between the two calls.



--
**************************************************************
* Nan Galbraith            Upper Ocean Processes Group       *
* Woods Hole Oceanographic Institution Woods Hole, MA 02540  *
* http://uop.whoi.edu      (508) 289-2444                    *
**************************************************************

==============================================================================
To unsubscribe netcdfgroup, visit:
http://www.unidata.ucar.edu/mailing-list-delete-form.html
==============================================================================


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