Re: [netcdf-java] Redefine Mode working?

Can you post at least a fragment of code showing how you tried to do the update
using netcdf-java?
=Dennis Heimbigner
 Unidata

On 3/6/2018 11:55 AM, Carlow, Christian R wrote:

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.



_______________________________________________
NOTE: All exchanges posted to Unidata maintained email lists are
recorded in the Unidata inquiry tracking system and made publicly
available through the web.  Users who post to any of the lists we
maintain are reminded to remove any personal information that they
do not want to be made public.


netcdf-java mailing list
netcdf-java@xxxxxxxxxxxxxxxx
For list information or to unsubscribe, visit: 
http://www.unidata.ucar.edu/mailing_lists/



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