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.
Hi Ansley, > Using the source from this URL, > > ftp://ftp.unidata.ucar.edu/pub/netcdf/netcdf-test.tar.gz > > I'm seeing a problem with NF_CREATE. The call is this, with > cdftype=NF_CLASSIC_MODEL and with clobber_mode set to either > NF_NOCLOBBER or NF_CLOBBER. The call is made by program ferret_c, and > its result is below: > > cdfstat = NF_CREATE(cdfname, OR(clobber_mode,cdftype), cdfid) > > ferret_c: nc4file.c:395: NC4_create: Assertion `0' failed. > Abort > > > Setting cdftype to NF_NETCDF4 and making the same call lets me > successfully create and write to the file. I can't reproduce this problem using gfortran. What happens when you use the function IOR() instead of OR() ?, as in: cdfstat = NF_CREATE(cdfname, IOR(clobber_mode,cdftype), cdfid) That's the intended way to pass the bitwise combination of flags to the library. Both OR and IOR work for me in gfortran, but using the OR() function is deprecated, as it's a non-standard GNU extension rather than a standard intrinsic function that you probably intended. It looks like we need a better way to handle this potential problem with user input to NF_CREATE(). Thanks for reporting the problem! --Russ Russ Rew UCAR Unidata Program address@hidden http://www.unidata.ucar.edu Ticket Details =================== Ticket ID: CKA-677320 Department: Support netCDF Priority: Normal Status: Closed