Problem updating attribute values

I'm confused by a situation I ran into in a recent netCDF
application.  I failed to discern an explanation for the behavior
that I encountered in the user's manual.  The application
basically appends data to the end of an existing netCDF file that
was opened with the NC_RDWR flag.  The strange behavior came when
updating the values of two attributes.  The ncattput call did not
indicate error, and a subsequent ncattget returned the new values.
However, when the application was done, ncdump showed that the
attributes still had the old values.  The data was appended, and an
attribute (history) for which I used define mode while updating
(because I expanded the attribute's size) was changed as expected
as well.

I tried moving the updating of the history attribute to the end,
rather than the beginning of the program, but that didn't change
the results.  The thing that did work to cause the behavior that I
desired was to put in ncsync calls after the ncattput calls.  I've
written several similar netCDF applications without ever needing to
call ncsync before.  Can anyone tell me where my error is?  Thanks
very much for any insight.

--
Don Hooper,   hoop@xxxxxxxxxxxx


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