Commit Graph

498 Commits

Author SHA1 Message Date
Dennis Heimbigner
8072d1f6bb Modify DAP2 and DAP4 to optionally allow Fillvalue/Variable mismatch
re: issue https://github.com/Unidata/netcdf-c/issues/1151

Modify DAP2 and DAP4 code to handle case when _FillValue type is not
same as the parent variable type.

Specifically:
1. Define a parameter [fillmismatch] to allow this mismatch;
   default is to disallow.
2. If allowed, forcibly change the type of the _FillValue to match
   the parent variable.
3. If allowed Convert the values to match new type
4. Generate a log message
5. if not allowed, then fail

Implementing this required some changes to ncdap_test/dapcvt.c
Also added test cases.

Minor Unrelated Changes:
1. There were a number of warnings about e.g.
   assigning a const char* to a char*. Fix these
2. In nccopy.1, replace .NP with .IP "n"
   (re PR https://github.com/Unidata/netcdf-c/pull/1144)
3. fix minor error in ncdump/ocprint
2018-10-01 15:51:43 -06:00
Ed Hartnett
08a2dce904 merged master 2018-09-07 12:40:44 -06:00
Ward Fisher
784d777bff Merge branch 'master' into provenance.dmh 2018-09-06 15:13:09 -06:00
Ed Hartnett
86e002d794 merged master 2018-09-06 14:01:59 -06:00
Ward Fisher
fbe0a18b1c
Merge branch 'master' into ejh_loop_cleanup_2 2018-09-05 11:22:55 -06:00
Ward Fisher
d0bb5ddde8 Merge remote-tracking branch 'origin/inmemory10.dmh' into combined-pr.wif 2018-09-04 13:39:34 -06:00
Ward Fisher
3c3119bed2 Merge remote-tracking branch 'origin/dapcurlopt.dmh' into combined-pr.wif 2018-09-04 12:50:55 -06:00
Ed Hartnett
a23318929f
Merge branch 'master' into ejh_loop_cleanup_2 2018-09-04 12:44:46 -06:00
Dennis Heimbigner
d62a9e623c Fix the NC_INMEMORY code to work in all cases with HDF5 1.10.
re: github issue https://github.com/Unidata/netcdf-c/issues/1111

One of the less common use cases for the in-memory feature is
apparently failing with HDF5-1.10.x.  The fix is complicated and
requires significant changes to libhdf5/nc4memcb.c. The current
setup is detailed in the file docs/inmeminternal.dox.

Additionally, it was discovered that the program
nc_test/tst_inmemory.c, which is invoked by
nc_test/run_inmemory.sh, actually was failing because of the
above problem. But the failure is not detected since the script
does not return non-zero value.

Other Changes:
1. Fix nc_test_tst_inmemory to return errors correctly.
2. Make ncdap_tests/findtestserver.c and dap4_tests/findtestserver4.c
   be generated from ncdap_test/findtestserver.c.in.
3. Make LOG() print output to stderr instead of stdout to
   avoid contaminating e.g. ncdump output.
4. Modify the handling of NC_INMEMORY and NC_DISKLESS flags
   to properly handle that NC_DISKLESS => NC_INMEMORY. This
   affects a number of code pieces, especially memio.c.
2018-09-04 11:27:47 -06:00
Ward Fisher
ed38e582dc
Merge branch 'master' into provenance.dmh 2018-09-04 11:24:49 -06:00
Ward Fisher
ede7c5da60
Merge branch 'master' into provenance.dmh 2018-09-04 11:22:36 -06:00
Dennis Heimbigner
4a1e84b721 Re github issue https://github.com/Unidata/netcdf-c/issues/1131
The identifier typename is apparently a reserved word in C++.
It is used as a fieldname in the ALignment struct in
include/ncoffsets.h.

Change the field name to type_name in ncoffsets.h
and also in libdispatch/doffsets.c, which uses that field.
2018-09-03 13:30:11 -06:00
Ed Hartnett
ad592448df merged master 2018-08-29 06:32:28 -06:00
Ed Hartnett
27281dfe4b
Merge branch 'master' into ejh_loop_cleanup_2 2018-08-28 17:32:40 -06:00
Ward Fisher
5e33522f52
Merge branch 'master' into default_format 2018-08-28 15:02:17 -06:00
Dennis Heimbigner
79e38de840 Add the ability to set some additional curlopt values
Add the ability to set some additional curlopt values via .daprc (aka .dodsrc).
This effects both DAP2 and DAP4 protocols.

Related issues:
[1] re: esupport: KOZ-821332
[2] re: github issue https://github.com/Unidata/netcdf4-python/issues/836
[3] re: github issue https://github.com/Unidata/netcdf-c/issues/1074

1. CURLOPT_BUFFERSIZE: Relevant to [1]. Allow user to set the read/write
buffersizes used by curl.
This is done by adding the following to .daprc (aka .dodsrc):
	HTTP.READ.BUFFERSIZE=n
where n is the buffersize in bytes. There is a built-in (to curl)
limit of 512k for this value.

2. CURLOPT_TCP_KEEPALIVE (and CURLOPT_TCP_KEEPIDLE and CURLOPT_TCP_KEEPINTVL):
Relevant (maybe) to [2] and [3]. Allow the user to turn on KEEPALIVE
This is done by adding the following to .daprc (aka .dodsrc):
	HTTP.KEEPALIVE=on|n/m
If the value is "on", then simply enable default KEEPALIVE. If the value
is n/m, then enable KEEPALIVE and set KEEPIDLE to n and KEEPINTVL to m.
2018-08-26 17:04:46 -06:00
Dennis Heimbigner
2ea1cf5f1b There was a request to extend the provenance information
stored in the _NCProperties attribute to allow two things:
1. capture of additional library dependencies (over and above
   hdf5)
2. Recognition of non-netcdf libraries that create netcdf-4 format
   files.

To this end, the _NCProperties format has been extended to be
and arbitrary set of key=value pairs separated by commas.
This new format has version = 2, and uses commas as the pair separator.
Thus the general form is:
    _NCProperties = "version=2,key1=value,key2=value2..." ;

This new version is accompanied by a new ./configure option of the form
    --with-ncproperties="key1=value1,key2=value2..."
that specifies pairs to add to the _NCProperties attribute for all
files created with that netcdf library.

At this point, what is missing is some programmatic way to
specify either all the pairs or additional pairs
to the _NCProperties attribute. Not sure of the best way
to do this.

Builders using non-netcdf libraries can specify
whatever they want in the key value pairs (as long
as the version=2 is specified first).

By convention, the primary library is expected to be the
the first pair after the leading version=2 pair, but this
is convention only and is neither required nor enforced.

Related changes:
1. Fixed the tests that check _NCProperties to properly operate with version=2.
2. When reading a version 1 _NCProperties attribute, convert it to look
   like a version 2 attribute.
2. Added some version 2 tests to ncdump/tst_fileinfo.c and
   ncdump/tst_fileinfo.sh

Misc Changes:
1. Fix minor problem in ncdap_test/testurl.sh where a parameter to
   buildurl needed to be quoted.
2. Minor fix to ncgen to swap switches -H and -h to be consistent
   with other utilities.
3. Document the -M flag in nccopy usage() and the nccopy man page.
4. Modify a test case to use the nccopy -M flag.
2018-08-25 21:44:41 -06:00
Ward Fisher
373d0365a1
Merge branch 'master' into default_format 2018-08-24 11:27:07 -06:00
Ed Hartnett
1310066494 getting parallel benchmarks to work, cleanup of benchmark scripts 2018-08-24 08:59:58 -06:00
Ed Hartnett
933d91a556 fixed many benchmark warnings 2018-08-23 08:21:55 -06:00
Ed Hartnett
00a8bbad8d cleanup 2018-08-22 07:03:37 -06:00
Ed Hartnett
8885c75ade removing unneeded lookups 2018-08-22 06:08:19 -06:00
Ed Hartnett
d8c1a6209a removed unneeded lookup function 2018-08-21 11:54:06 -06:00
Ed Hartnett
990a75d5d7 clean up of find_grp functions 2018-08-21 11:23:12 -06:00
Ed Hartnett
ece953458d cleanup of group find functions 2018-08-21 10:50:32 -06:00
Ed Hartnett
06db182eff cleaned up error handling in nc4_close_netcdf4_file 2018-08-21 08:32:39 -06:00
Ed Hartnett
5b2f6ecebc changed literal in netcdf.h 2018-08-18 05:22:07 -06:00
Ed Hartnett
d6c0cbe234 removing unneeded file lookups 2018-08-14 08:56:58 -06:00
Ed Hartnett
b5999278cc added nc4_find_grp_h5_var 2018-08-09 06:47:45 -06:00
Ed Hartnett
5e9ffcaab3 renamed get_fill_value 2018-08-09 06:41:54 -06:00
Ed Hartnett
5a452c5815 bring in changes from lazy vars branch 2018-08-06 10:49:31 -06:00
Ed Hartnett
9dc99c8a04 cleaned up some functions in preparation for lazy vars 2018-08-06 10:16:49 -06:00
Ed Hartnett
354b89c363 merged upstream/master 2018-08-06 08:36:44 -06:00
Ward Fisher
59e98ef087
Merge branch 'master' into default_format 2018-08-03 10:59:41 -06:00
Ward Fisher
81c91eb519 Made some changes to export symbols on Windows builds. 2018-08-02 14:58:47 -06:00
Ed Hartnett
b9afdee6cd merged master 2018-07-31 19:44:28 -06:00
Ward Fisher
5582466724
Merge branch 'master' into ejh_hdf5_sep 2018-07-31 14:04:55 -06:00
Ward Fisher
90d664b9ec Merge branch 'has_parallel4' of https://github.com/wkliao/netcdf-c into pr-aggregation.wif 2018-07-31 11:32:54 -06:00
Ward Fisher
334a936732
Merge branch 'master' into relax_coord_bound 2018-07-31 11:26:51 -06:00
Ward Fisher
00f66133af
Merge branch 'master' into has_parallel4 2018-07-30 14:17:41 -06:00
Ed Hartnett
fce57d4498
Merge branch 'master' into ejh_hdf5_sep 2018-07-30 12:13:45 -06:00
Wei-keng Liao
025c7d1bb2 introduce error code NC_EPNETCDF for errors at PnetCDF level 2018-07-29 15:33:08 -05:00
Wei-keng Liao
0ee68a3263 This commit fixes the logical problem of using the default file formats.
The fix includes the following changes.
1. Checking and using the default file format at file create time is now
   done only when the create mode (argument cmode) does not include any
   format related flags, i.e. NC_64BIT_OFFSET, NC_64BIT_DATA,
   NC_CLASSIC_MODEL, and NC_NETCDF4.
2. Adjustment of cmode based on the default format is now done in
   NC_create() only. The idea is to adjust cmode before entering the
   dispatcher's file create subroutine.
3. Any adjustment of cmode is removed from all I/O dispatchers, i.e.
   NC4_create(), NC3_create(), and NCP_create().
4. Checking for illegal cmode has been done in check_create_mode() called
   in NC_create(). This commit removes the redundant checking from
   NCP_create().
5. Remove PnetCDF tests in nc_test/tst_names.c, so it can focus on testing
   all classic formats and netCDF4 formats.

Two new test programs are added. They can be used to test netCDF with and
without this commit.
1. nc_test/tst_default_format.c
2. nc_test/tst_default_format_pnetcdf.c (use when PnetCDF is enabled).
2018-07-28 11:18:28 -05:00
Wei-keng Liao
e154ad609f
Merge branch 'master' into has_parallel4 2018-07-26 01:40:15 -05:00
Wei-keng Liao
5a06155f88
Merge branch 'master' into relax_coord_bound 2018-07-26 01:39:59 -05:00
Ed Hartnett
5631fa512a merged master 2018-07-24 01:51:51 -06:00
Ed Hartnett
25021aa847
Merge branch 'master' into ejh_hdf5_sep 2018-07-23 18:52:07 -06:00
Ed Hartnett
a1437c5ca0
Merge branch 'master' into ejh_split_hdf5file 2018-07-23 18:51:29 -06:00
Ward Fisher
1783e81bfc
Merge branch 'master' into patch-23 2018-07-23 15:34:27 -06:00
Ed Hartnett
12b76d2dc5 merged master 2018-07-23 13:18:21 -06:00