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.
Sidd, > > Nobody around here could answer me definitively so I am asking directly > > to you. > > Is it legal to set one of the dimension of 'count' argument be to 0 in > > nf90_put_var ? > > This could possibly the case in case of parallel write when some tasks > > do not have anything to write at a particular instance. > > I just added a test for this to the test program nf_test/f90tst_fill2, and > it worked fine, not writing anything and returning with no error. But that > wasn't a parallel program, so the situation may be different (though I don't > think it should be different) when invoking a parallel write. > > However, I'm having trouble building and running a parallel test that does > the same thing, so I can't answer the question yet, unfortunately ... I just got the test working, and it completed successfully, so having a zero component in count with a parallel write using nc_put_var_int() seems to work OK. This was with in the test code in nc_test4/tst_parallel.c, in which I inserted the following call in a loop after line 136: /* See if count dimension == 0 returns error */ count_save = count[0]; count[0] = 0; if (nc_put_vara_int(ncid, v1id, start, count, slab_data)) ERR; count[0] = count_save ; I used netCDF-4 parallel I/O rather than netCDF-3 parallel-netCDF, in case that makes any difference ... --Russ Russ Rew UCAR Unidata Program address@hidden http://www.unidata.ucar.edu Ticket Details =================== Ticket ID: PXF-543549 Department: Support netCDF Priority: Normal Status: Closed