Due to the current gap in continued funding from the U.S. National Science Foundation (NSF), the NSF Unidata Program Center has temporarily paused most operations. See NSF Unidata Pause in Most Operations for details.
I have recently added some new Attributes that are integer arrays. About 10 attributes, and the array size can be anywhere from a few, to a few hundred. It seems we now take much much longer to write our files. Originally, I isolated a 10 second delay in the call to nc_close. After looking at the code, I realized that I was returning to define mode to add these arrays after having added the data, and speculated that nc_close had to reorder memory so that all the attributes were written before the data. I fixed my code to do the data last, and now the call to nc_close is quick, but the call to nc_enddef is very slow (again about 10 seconds). In the sample file that I used for testing, I have a single variable, and the array size is around 200. I'm running under Windows with NetCDF 3.x. Is there any explanation why this takes so long, or any ideas on how to optimize my code to make it faster? Thanks, Jim
netcdfgroup
archives: