I sent a message to support yesterday but I haven't gotten a response so I
figured I would repost here.
I'm attempting to update global attribute values multiple issues were
encountered.
First I tried using NetcdfWriter of netcdf-java 4.6.9 but it was threw errors
about redefine mode not being set but once I set it another error was thrown by
a Native Windows Filesystem call. I tested on Linux and got a similar error.
I suspect the redefine mode logic was attempting rename a file that was
considered open or inexistent.
Eventually I got the files to update after installing the Netcdf C library for
handling netcdf4 but it ended up truncating the attribute value I was trying to
set. After debugging I determined that the netcdf4 logic wasn't being used for
updating netcdf3 files.
I found an article where someone recommended using nco to update files
(?nco.sourceforge.net) but after debugging the functionality I determined it
ultimately was just calling the Native C functions (nc_redef, nc_set_att_text,
etc) so I figured it would be better to just call those commands directly from
java.
However, the Nc4prototypes.java file is missing the nc_redef function. Was
that function accidentally left out or was it intentional.
I'd like to using the NetcdfWriter class for handling updates but it doesn't
seem to provide the same power as the Native C functions.
I've already tested a C application using the Native functions and it updated
the attribute values of netcdf3 files fine without truncating.