Commit Graph

608 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
Ward Fisher
5259b4b1e8
Merge branch 'master' into ejh_hdf5_sep_next_2 2018-09-17 14:53:55 -06:00
Dennis Heimbigner
108dc0f01d Fix szip filter handling code and correspondingtests
re: https://github.com/Unidata/netcdf-c/issues/972

The current szip plugin code in the HDF5 library has some
unexpected behaviors that require some changes to how
nc_inq_var_szip is implemented and to the corresponding tests:
nc_test4/{test_szip,tst_vars3}.

Specifically, the following can happen:

1. The number of parameters provided by the user will be two,
   but the number of parameters returned by nc_inq_var_filter
   will be four because the HDF5 code (H5Zszip) will add two
   extra parameters for internal use. It turns out that the two
   parameters provided when calling nc_def_var_filter correspond
   to the first two parameters of the four parameters returned
   by nc_inq_var_filter.

2. The nc_inq_var_szip values corresponding to the ones provided
   by the caller may be different than those provided by
   nc_def_var_filter.  The value of the options_mask argument is
   known to add additional flag bits, and the pixels_per_block
   parameter may be modified.
2018-09-15 15:21:51 -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
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
Ed Hartnett
85f3579195 fixed docs 2018-08-24 14:15:59 -06:00
Ed Hartnett
cf890be803 fixed docs 2018-08-24 14:14:15 -06:00
Ward Fisher
373d0365a1
Merge branch 'master' into default_format 2018-08-24 11:27:07 -06:00
Ed Hartnett
62103d761c fixed spaceing in nc.c 2018-08-21 06:53:27 -06:00
Ed Hartnett
c02f976d84 more tests 2018-08-20 17:05:29 -06:00
Ed Hartnett
ab1216da10 fix memory issue 2018-08-14 10:38:28 -06:00
Ed Hartnett
9953e53573 converting NULL checking of put functions 2018-08-14 09:21:45 -06:00
Ed Hartnett
829d9d28ae converting NULL checking of put functions 2018-08-14 09:09:08 -06:00
Ed Hartnett
5f9b7af467 converting NULL checking of put functions 2018-08-14 09:04:16 -06:00
Ed Hartnett
d6c0cbe234 removing unneeded file lookups 2018-08-14 08:56:58 -06:00
Ed Hartnett
5800fdd617 removing unneeded file lookups 2018-08-14 08:49:23 -06:00
Ed Hartnett
24f0c9d74c removing unneeded file lookups 2018-08-14 08:39:17 -06:00
Ed Hartnett
bc3c63bf03 removing unneeded file lookups 2018-08-14 08:32:45 -06:00
Ed Hartnett
1e3fe2b8cc removing unneeded file lookups 2018-08-14 08:29:02 -06:00
Ed Hartnett
d1ed803b31 removing unneeded file lookups 2018-08-14 08:18:05 -06:00
Ed Hartnett
3046dabda0 more NULL parameter changes 2018-08-14 08:06:01 -06:00
Ed Hartnett
baa76219d3 more NULL parameter changes 2018-08-14 08:01:54 -06:00
Ed Hartnett
69b37d994e fixed HDF4 test 2018-08-14 06:44:11 -06:00
Ed Hartnett
acc22e0c54 checking NULLs in function 2018-08-14 06:28:28 -06:00
Ed Hartnett
a0bea92919 fixed problem of not calling NC_ versions of vars and varm functions for extra error checking 2018-08-14 05:04:09 -06:00
Ed Hartnett
0b13f52766 documentation 2018-08-14 04:44:26 -06:00
Ed Hartnett
5c39fa115a return error for NULL start for varm functions 2018-08-14 04:35:38 -06:00
Ed Hartnett
a271ebb5f2 testing NULL starts 2018-08-14 04:17:34 -06:00
Ed Hartnett
97c2541a37 put_vars checking for NULL start for non-scalar vars and test 2018-08-13 13:05:32 -06:00
Ed Hartnett
8b26c83379 undid unneeded nc_test changes 2018-08-13 09:15:50 -06:00
Ed Hartnett
b29cc1b94f removed unneeded netcdf-4 checks in dvarget.c 2018-08-13 09:06:51 -06:00
Ed Hartnett
ec3d3a3d06 return error for put_vara calls with NULL start 2018-08-13 09:03:49 -06:00
Ed Hartnett
a63f3449c3 return error for put_vara calls with NULL start 2018-08-13 08:54:38 -06:00
Ed Hartnett
19222632b4 return error for put_vars calls with NULL start 2018-08-13 08:48:20 -06:00
Ed Hartnett
df371b2b99 reject NULL start for put_vars 2018-08-13 08:25:54 -06:00
Dennis Heimbigner
f46b65c602 Clear up coverity complaints
with respect to this coverity report.

https://u2389337.ct.sendgrid.net/wf/click?upn=08onrYu34A-2BWcWUl-2F-2BfV0V05UPxvVjWch-2Bd2MGckcRZApv53Ry-2FReUME-2Fmei1et81WqdBwm5AxSAYBM9iFSmbw-3D-3D_YxTn3nq1kZ9CfXcyYFaB2DtJSVHTn8U-2BK0LV-2FDyLYKcFvnwYJ7pm2zFB5UovsEUh5miIfeCfQzYxpN9HYcdqs9sKVjtklOkfPIjEpg0Tj8G9wiptznJeX-2FO4PrqJA1ViQYtQfpjugq01XGMQ3-2Bll42dUMxrmbdYSqi8T7bCcANC5evyZs4MKvmAWXt1bnPaHcOYJDN-2FUt-2FJTlhwu91HyR7h-2FnkvMY9paYUNB1gxiyUA-3D
2018-08-04 13:22:29 -06:00
Ward Fisher
59e98ef087
Merge branch 'master' into default_format 2018-08-03 10:59:41 -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
Ward Fisher
a741bec8d9 Merge branch 'doc-cdf5' of https://github.com/wkliao/netcdf-c into pr-aggregation.wif 2018-07-18 14:08:20 -06:00
Ward Fisher
d6ed28291a
Merge branch 'master' into doc-cdf5 2018-07-17 15:53:56 -06:00