This archive contains answers to questions sent to Unidata support through mid-2025. Note that the archive is no longer being updated. We provide the archive for reference; many of the answers presented here remain technically correct, even if somewhat outdated. For the most up-to-date information on the use of NSF Unidata software and data services, please consult the Software Documentation first.
Florian- nc_put_varm (and nc_get_varm) are inherently slow in their general form because of the nature of the algorithm required. Bottom line is that nc_put_varm has a loop that writes a single value at a time. Thus the total time is roughly |nc_put_var1| * N where |nc_put_var1| is the time to write one element of the array and N is the total number of writes, which in your program is 640*412. The nc_put_vara is significantly faster because its operation is optimized into the netcdf library. These optimizations cannot be used when the imapp argument to nc_put_varm is used or the stride is something other than all ones. If the imapp argument is NULL, and the stride is NULL or all ones, then nc_put_varm is equivalent to and is converted to a call to nc_put_vara. =Dennis Heimbigner Unidata Ticket Details =================== Ticket ID: CBQ-986702 Department: Support netCDF Priority: Normal Status: Closed