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.
>To: address@hidden >From: address@hidden (Chris Webster) >Subject: netCDF Q >Organization: . >Keywords: 199703311747.KAA01343 Hi Chris, > I have a real-time netCDF question. > > I have a process that is writing a netCDF record (ncrecput) once a second > followed by a ncsync(). I then have a second process sitting in a while loop > performing a ncdiminq(ncid, recDim, NULL, &nRecords). Problem is, nRecords > never changes. I can Ctrl-C the read program and restart it, and get's a > new value for nRecords but never updates beyond the first read. Any > insight? Your second process also needs to call ncsync() in order to see the new value of nRecords; otherwise it is just using a cached in-memory value that never gets changed by the writing process. The ncsync() section in the User's Guide mentions this: ... A process that is reading a netCDF file that another process is writing can also call ncsync ... to get updated with the changes made by the writing process (e.g. the number of records written), without having to close and reopen the file. --Russ