netcdf-c/libdispatch
Dennis Heimbigner 4636584d5b Revert/Improve nc_create + NC_DISKLESS behavior
re: https://github.com/Unidata/netcdf-c/issues/1154

Inadvertently, the behavior of NC_DISKLESS with nc_create() was
changed in release 4.6.1. Previously, the NC_WRITE flag needed
to be explicitly used with NC_DISKLESS in order to cause the
created file to be persisted to disk.

Additional analyis indicated that the current NC_DISKLESS
implementation was seriously flawed.

This PR attempts to clean up and regularize the situation with
respect to NC_DISKLESS control. One important aspect of diskless
operation is that there are two different notions of write.

1. The file is read-write vs read-only when using the netcdf API.
2. The file is persisted or not to disk at nc_close().

Previously, these two were conflated. The rules now are
as follows.

1. NC_DISKLESS + NC_WRITE means that the file is read/write using the netcdf API
2. NC_DISKLESS + NC_PERSIST means that the file is persisted to a disk file at nc_close.
3. NC_DISKLESS + NC_PERSIST + NC_WRITE means both 1 and 2.

The NC_PERSIST flag is new and takes over the obsolete NC_MPIPOSIX flag.
NC_MPIPOSIX is still defined, but is now an alias for the NC_MPIIO flag.

It is also now the case that for netcdf-4, NC_DISKLESS is independent
of NC_INMEMORY and in fact it is an error to specify both flags
simultaneously.

Finally, the MMAP code was fixed to use NC_PERSIST as well.
Also marked MMAP as deprecated.

Also added a test case to test various combinations of NC_DISKLESS,
NC_PERSIST, and NC_WRITE.

This PR affects a number of files and especially test cases
that used NC_DISKLESS.

Misc. Unrelated fixes
1. fixed some warnings in ncdump/dumplib.c
2018-10-10 13:32:17 -06:00
..
u Resolves Github issue https://github.com/Unidata/netcdf-c/issues/349. 2017-02-16 14:27:54 -07:00
CMakeLists.txt added merged HDF4 changes 2018-04-04 14:11:44 -06:00
crc32.c The file libdispatch/crc32.c was apparently causing 2018-04-02 13:19:58 -06:00
crc32.h This completes (for now) the refactoring of libsrc4. 2018-03-16 11:46:18 -06:00
datt.c added return code documentation for dtype.c and datt.c 2017-11-15 04:08:58 -07:00
dattget.c Follow-up trivial typos 2018-04-26 23:04:01 -04:00
dattinq.c fixed doxygen warnings in dattinq.c 2017-11-14 11:22:48 -07:00
dattput.c fixed docs 2018-08-24 14:15:59 -06:00
dauth.c Fix the NC_INMEMORY code to work in all cases with HDF5 1.10. 2018-09-04 11:27:47 -06:00
dcompound.c Fixed netcdf-c issue #30 (on github) related to cmake-generated nc-config script. 2014-03-11 13:07:04 -06:00
dcopy.c more docs 2017-12-04 13:11:54 -07:00
ddim.c This is the initial step in moving to the new higher performance 2018-02-08 19:53:40 -07:00
ddispatch.c Code duplicated; merge failure? 2018-05-18 20:28:51 -06:00
defcheck.c Modified a number of tests 2014-10-04 15:59:16 -06:00
denum.c doxygen work on netcdf4 functions 2011-07-14 12:21:03 +00:00
derror.c introduce error code NC_EPNETCDF for errors at PnetCDF level 2018-07-29 15:33:08 -05:00
dfile.c Revert/Improve nc_create + NC_DISKLESS behavior 2018-10-10 13:32:17 -06:00
dfilter.c re: GH Issue https://github.com/Unidata/netcdf-c/issues/806 2018-01-25 13:51:42 -07:00
dgroup.c Filled in short description for group-related functions in support of https://github.com/Unidata/netcdf-c/issues/277 full documentation still pending. 2016-07-11 16:55:30 -06:00
dinternal.c Add szip support via libaec 2017-08-27 13:35:20 -06:00
dnotnc3.c added merged HDF4 changes 2018-04-04 14:11:44 -06:00
dnotnc4.c added merged HDF4 changes 2018-04-04 14:11:44 -06:00
doffsets.c Re github issue https://github.com/Unidata/netcdf-c/issues/1131 2018-09-03 13:30:11 -06:00
dopaque.c doxygen work on netcdf4 functions 2011-07-14 12:21:03 +00:00
dparallel.c revise comments about collective I/O mode 2018-10-02 01:19:44 -05:00
drc.c Modify DAP2 and DAP4 to optionally allow Fillvalue/Variable mismatch 2018-10-01 15:51:43 -06:00
dreadonly.c Ignore flags NC_MPIIO and NC_MPIPOSIX. 2018-09-22 20:22:34 -05:00
dstring.c Begin changing over to use strlcat instead of strncat because 2017-11-23 10:55:24 -07:00
dtype.c further test development, added documentation for uncommitted user-defined types, fixed check of return value 2018-01-18 06:47:50 -07:00
dutf8.c More potential memory leaks squashed. 2018-06-07 15:58:47 -06:00
dutil.c Revert/Improve nc_create + NC_DISKLESS behavior 2018-10-10 13:32:17 -06:00
dv2i.c Replace quotes when including system includes, in support of https://github.com/Unidata/netcdf-c/issues/928 2018-04-18 10:51:03 -06:00
dvar.c Merge branch 'master' into ejh_loop_cleanup_2 2018-09-05 11:22:55 -06:00
dvarget.c converting NULL checking of put functions 2018-08-14 09:21:45 -06:00
dvarinq.c Fix szip filter handling code and correspondingtests 2018-09-15 15:21:51 -06:00
dvarput.c converting NULL checking of put functions 2018-08-14 09:21:45 -06:00
dvlen.c Follow-up trivial typos 2018-04-26 23:04:01 -04:00
dwinpath.c Modify DAP2 and DAP4 to optionally allow Fillvalue/Variable mismatch 2018-10-01 15:51:43 -06:00
heap Primary change: add dap4 support 2017-03-08 17:01:10 -07:00
json.c Primary change: add dap4 support 2017-03-08 17:01:10 -07:00
Make0 Fix pull request https://github.com/Unidata/netcdf-c/pull/374 (dap4.dmh) 2017-04-03 21:39:44 -06:00
Makefile.am added merged HDF4 changes 2018-04-04 14:11:44 -06:00
nc.c return NC_ENOTBUILT when CDF5 is not enabled but NC_64BIT_DATA is used 2018-09-17 17:18:48 -05:00
ncaux.c Coverity: 711838 2014-07-31 16:32:50 -06:00
ncbytes.c This is the initial step in moving to the new higher performance 2018-02-08 19:53:40 -07:00
nchashmap.c Clear up coverity complaints 2018-08-04 13:22:29 -06:00
nclist.c This is the initial step in moving to the new higher performance 2018-02-08 19:53:40 -07:00
nclistmgr.c fix issue 791: validate ncid for classic files 2018-01-25 00:03:19 -06:00
nclog.c Modify DAP2 and DAP4 to optionally allow Fillvalue/Variable mismatch 2018-10-01 15:51:43 -06:00
ncsettings.hdr Add ability to programmatically 2014-08-29 14:51:14 -06:00
nctime.c Solve issue https://github.com/Unidata/netcdf-c/issues/359 2017-07-24 18:59:16 -06:00
ncuri.c fixed clang warning in ncuri.c 2018-07-06 06:52:02 -06:00
netcdf.m4 In preparation for adding dap4 support, I have cleaned up 2014-03-24 14:02:52 -06:00
stubdef.c rebuilt dap constraints 2011-04-16 20:56:36 +00:00
test_ncuri.c Error in ncuri in handling user:pwd@ in url 2017-07-05 14:39:23 -06:00
test_pathcvt.c found a few more easy warnings 2017-11-09 06:39:43 -07:00
u8.c Resolves Github issue https://github.com/Unidata/netcdf-c/issues/349. 2017-02-16 14:27:54 -07:00
u8.h Resolves Github issue https://github.com/Unidata/netcdf-c/issues/349. 2017-02-16 14:27:54 -07:00
utf8proc_data.c Refactored additional constants. 2017-02-28 11:15:51 -07:00
utf8proc.c Fix build on pre-C99 compilers 2017-11-26 01:47:54 +05:30
utf8proc.h Use refactored variable names introduced by 773fe807 2017-11-26 01:47:46 +05:30