netcdf-c/libsrc
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
..
attr.m4 This completes (for now) the refactoring of libsrc4. 2018-03-16 11:46:18 -06:00
CMakeLists.txt Merge branch 'master' into inmem2.dmh 2018-05-16 14:24:19 -06:00
depend
dim.c This completes (for now) the refactoring of libsrc4. 2018-03-16 11:46:18 -06:00
ffio.c Merged master, DAP4 support into branch. 2017-04-19 09:29:35 -06:00
lookup3.c Follow-up trivial typos 2018-04-26 23:04:01 -04:00
Makefile.am Fix https://github.com/Unidata/netcdf-c/issues/963 2018-05-11 15:30:19 -06:00
memio.c Revert/Improve nc_create + NC_DISKLESS behavior 2018-10-10 13:32:17 -06:00
mmapio.c Revert/Improve nc_create + NC_DISKLESS behavior 2018-10-10 13:32:17 -06:00
nc3dispatch.c a clean commit for #383 2017-12-20 20:53:30 -06:00
nc3internal.c Ignore flags NC_MPIIO and NC_MPIPOSIX. 2018-09-22 20:22:34 -05:00
ncFile.c
ncio.c Revert/Improve nc_create + NC_DISKLESS behavior 2018-10-10 13:32:17 -06:00
ncio.h The original mem branch somehow got 2015-05-28 15:10:10 -06:00
ncstdio.c
ncstdio.h Fix https://github.com/Unidata/netcdf-c/issues/963 2018-05-11 15:30:19 -06:00
ncx_cray.c include config.h the way suggested by autoconf 2017-03-11 13:03:17 -06:00
ncx.h Fix build on pre-C99 compilers 2017-11-26 01:47:54 +05:30
ncx.m4 ncx: use __inline with MSVC 2018-02-19 10:14:29 -05:00
posixio.c Follow-up trivial typos 2018-04-26 23:04:01 -04:00
pstdint.h Fix common typos 2015-08-20 11:42:05 +02:00
putget.m4 Promote NC_var member len from size_t to long long to fix some problems of large-variable tests on 320bit platforms. 2018-06-15 15:08:05 -05:00
t_ncio.c Merged master, DAP4 support into branch. 2017-04-19 09:29:35 -06:00
t_ncio.in
t_ncxx.m4 include config.h the way suggested by autoconf 2017-03-11 13:03:17 -06:00
test_nc.sav
v1hpg.c Promote NC_var member len from size_t to long long to fix some problems of large-variable tests on 320bit platforms. 2018-06-15 15:08:05 -05:00
var.c another typecast missed 2018-06-17 13:16:09 -05:00
winceio.c Merged master, DAP4 support into branch. 2017-04-19 09:29:35 -06:00
XGetopt.c