NOTICE: This version of the NSF Unidata web site (archive.unidata.ucar.edu) is no longer being updated.
Current content can be found at unidata.ucar.edu.
To learn about what's going on, see About the Archive Site.
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
netcdfgroup
archives: