From 25d2e054442cc31d54c578ce62a56d7d595fb164 Mon Sep 17 00:00:00 2001 From: Dennis Heimbigner Date: Tue, 13 Oct 2020 19:12:15 -0600 Subject: [PATCH 1/4] Prepare for the path management code Rename some files in prep for eventual implementation of more comprehensive cross-platform file path management. --- dap4_test/dump.c | 2 +- debug/cf | 10 ++-- debug/cf.cmake | 64 +++++++++++++------------- include/Makefile.am | 2 +- include/{ncwinpath.h => ncpathmgr.h} | 0 libdap4/d4read.c | 2 +- libdispatch/CMakeLists.txt | 2 +- libdispatch/Makefile.am | 2 +- libdispatch/dauth.c | 2 +- libdispatch/dfile.c | 2 +- libdispatch/dinfermodel.c | 2 +- libdispatch/{dwinpath.c => dpathmgr.c} | 2 +- libdispatch/drc.c | 2 +- libdispatch/durlmodel.c | 2 +- libdispatch/dutil.c | 2 +- libnczarr/zmap.c | 2 +- libnczarr/zmap_nz4.c | 2 +- libnczarr/zmap_nzf.c | 2 +- libsrc/memio.c | 2 +- libsrc/mmapio.c | 2 +- nc_test/tst_open_mem.c | 2 +- ncdump/nccopy.c | 2 +- ncdump/ncdump.c | 2 +- ncgen/main.c | 2 +- ncgen3/main.c | 2 +- nczarr_test/ut_test.c | 2 +- nczarr_test/zmapio.c | 2 +- nczarr_test/zs3parse.c | 2 +- oc2/oc.c | 2 +- oc2/ocinternal.c | 2 +- oc2/ocread.c | 2 +- unit_test/test_pathcvt.c | 2 +- 32 files changed, 66 insertions(+), 66 deletions(-) rename include/{ncwinpath.h => ncpathmgr.h} (100%) rename libdispatch/{dwinpath.c => dpathmgr.c} (99%) diff --git a/dap4_test/dump.c b/dap4_test/dump.c index 03f03a296c..837edbb152 100644 --- a/dap4_test/dump.c +++ b/dap4_test/dump.c @@ -22,7 +22,7 @@ #include "netcdf.h" #include "ncbytes.h" -#include "ncwinpath.h" +#include "ncpathmgr.h" extern void NCD4_dumpbytes(size_t size, const void* data0, int swap); extern void NCD4_tagdump(size_t size, const void* data0, int swap, const char* tag); diff --git a/debug/cf b/debug/cf index 41b61fea5b..9c7492295f 100644 --- a/debug/cf +++ b/debug/cf @@ -11,12 +11,12 @@ FAST=1 #PROF=1 #BENCH=1 -#NCZARR=1 -#HDF5=1 +NCZARR=1 +HDF5=1 DAP=1 #S3=1 #S3TEST=1 -#SZIP=1 +SZIP=1 #HDF4=1 #PNETCDF=1 #PAR4=1 @@ -129,7 +129,7 @@ else FLAGS="$FLAGS --disable-s3-sdk" fi if test "x$S3TEST" != x ; then -FLAGS="$FLAGS --enable-s3-tests" +FLAGS="$FLAGS --enable-nczarr-s3-tests" export AWSSDK_DIR="${AWSSDK_DIR}" LDFLAGS="$LDFLAGS $AWSSDK_DIR/bin/aws-cpp-sdk-s3.dll" CPPFLAGS="$CPPFLAGS -I${AWSSDK_DIR}/include" @@ -144,6 +144,8 @@ if test "x${BENCH}" = x1 ; then FLAGS="$FLAGS --enable-benchmarks" fi +FLAGS="$FLAGS --enable-byterange" + export PATH export CC export CPPFLAGS diff --git a/debug/cf.cmake b/debug/cf.cmake index c2e1ef9dc8..6390b62e7d 100644 --- a/debug/cf.cmake +++ b/debug/cf.cmake @@ -1,12 +1,14 @@ # Visual Studio -NCC="c:/tools/hdf5" +NCC="c:/tools/hdf5-1.10.6" +HDF5_DIR="$NCC/cmake/hdf5" +AWSSDK_DIR="c:/tools/aws-cpp-sdk-all" # Is netcdf-4 and/or DAP enabled? NCZARR=1 HDF5=1 DAP=1 -S3=1 +#S3=1 #S3TEST=1 #CDF5=1 #HDF4=1 @@ -25,26 +27,9 @@ notest|nt) NOTEST=1 ;; esac done -if test "x$VS" = x1 ; then - if test "x$2" = xsetup ; then - VSSETUP=1 - else - unset VSSETUP - fi -fi - -#TESTSERVERS="localhost:8080,remotetest.unidata.ucar.edu" - #export NCPATHDEBUG=1 -if test "x$VSSETUP" = x1 ; then -CFG="Debug" -else -CFG="Release" -fi - FLAGS= - FLAGS="$FLAGS -DNC_FIND_SHARED_LIBS=ON" if test "x$VS" != x -a "x$INSTALL" != x ; then @@ -55,10 +40,13 @@ mkdir -p /tmp/netcdf if test "x$NCZARR" != x ; then FLAGS="$FLAGS -DENABLE_NCZARR=true" +else +FLAGS="$FLAGS -DENABLE_NCZARR=false" fi if test "x$DAP" = x ; then FLAGS="$FLAGS -DENABLE_DAP=false" +#FLAGS="$FLAGS -DENABLE_DAP_REMOTE_TESTS=true" fi if test "x$HDF5" = x ; then @@ -68,7 +56,7 @@ ignore=1 #FLAGS="$FLAGS -DDEFAULT_API_VERSION:STRING=v110" #FLAGS="$FLAGS -DHDF5_ROOT=c:/tools/hdf5" #FLAGS="$FLAGS -DHDF5_ROOT_DIR_HINT=c:/tools/hdf5/cmake/hdf5/hdf5-config.cmake" -FLAGS="$FLAGS -DHDF5_DIR=c:/tools/hdf5/cmake/hdf5" +FLAGS="$FLAGS -DHDF5_DIR=$HDF5_DIR" #hdf5-config.cmake #FLAGS="-DHDF5_LIBRARIES=${NCC}/lib/hdf5 -DHDF5_HL_LIBRARY=${NCC}/lib/hdf5_hl -DHDF5_INCLUDE_DIR=${NCC}/include" fi @@ -89,23 +77,21 @@ else FLAGS="$FLAGS -DENABLE_S3_SDK=false" fi if test "x$S3TEST" != x ; then -FLAGS="$FLAGS -DENABLE_S3_TESTS=true" +FLAGS="$FLAGS -DENABLE_NCZARR_S3_TESTS=true" +FLAGS="$FLAGS -DAWSSDK_DIR=${AWSSDK_DIR}" fi # Enables -FLAGS="$FLAGS -DENABLE_DAP_REMOTE_TESTS=true" FLAGS="$FLAGS -DENABLE_LOGGING=true" +FLAGS="$FLAGS -DENABLE_BYTERANGE=true" #FLAGS="$FLAGS -DENABLE_DOXYGEN=true -DENABLE_INTERNAL_DOCS=true" #FLAGS="$FLAGS -DENABLE_LARGE_FILE_TESTS=true" -#FLAGS="$FLAGS -DENABLE_FILTER_TESTING=true" - -# Disables +FLAGS="$FLAGS -DENABLE_FILTER_TESTING=true" FLAGS="$FLAGS -DENABLE_EXAMPLES=false" -FLAGS="$FLAGS -DENABLE_CONVERSION_WARNINGS=false" +#FLAGS="$FLAGS -DENABLE_CONVERSION_WARNINGS=false" #FLAGS="$FLAGS -DENABLE_TESTS=false" #FLAGS="$FLAGS -DENABLE_DISKLESS=false" -FLAGS="$FLAGS -DBUILD_UTILITIES=true" -FLAGS="$FLAGS -DENABLE_FILTER_TESTING=false" +#FLAGS="$FLAGS -DBUILD_UTILITIES=false" FLAGS="$FLAGS -DCURL_NO_CURL_CMAKE=TRUE" @@ -116,19 +102,31 @@ rm -fr build mkdir build cd build -NCLIB=`pwd` +NCWD=`pwd` if test "x$VS" != x ; then +NCLIB=`cygpath -w ${NCWD}/liblib |tr -d ''` +NCCYGLIB=`cygpath -u ${NCLIB} |tr -d ''` +NCCBIN=`cygpath -u "${NCC}/bin" |tr -d ''` +AWSSDKBIN="/cygdrive/c/tools/aws-cpp-sdk-all/bin" + # Visual Studio +PATH="${NCCBIN}:$PATH:$NCCYGLIB" +if test "x$S3" != x ; then +PATH="$PATH:${AWSSDKBIN}" +fi +export PATH + +export LD_LIBRARY_PATH="${NCCBIN}:$LD_LIBRARY_PATH:${AWSSDKBIN}:${NCCYGLIB}" + CFG="Release" -NCLIB="${NCLIB}/liblib" -export PATH="${NCLIB}:${PATH}" + #G= #TR=--trace cmake ${TR} "$G" -DCMAKE_BUILD_TYPE=${CFG} $FLAGS .. if test "x$NOBUILD" = x ; then -cmake ${TR} --build . --config ${CFG} +cmake ${TR} --build . -v --config ${CFG} #cmake ${TR} --build . --config ${CFG} --target ZERO_CHECK #cmake ${TR} --build . --config ${CFG} --target ALL_BUILD if test "x$NOTEST" = x ; then @@ -137,7 +135,7 @@ fi fi else # GCC -NCLIB="${NCLIB}/build/liblib" +NCLIB="${NCWD}/build/liblib" #G="-GUnix Makefiles" #T="--trace-expand" cmake "${G}" $FLAGS .. diff --git a/include/Makefile.am b/include/Makefile.am index 6b27338f35..ab884a6e6f 100644 --- a/include/Makefile.am +++ b/include/Makefile.am @@ -18,7 +18,7 @@ ncuri.h ncutf8.h ncdispatch.h ncdimscale.h netcdf_f.h err_macros.h \ ncbytes.h nchashmap.h ceconstraints.h rnd.h nclog.h ncconfigure.h \ nc4internal.h nctime.h nc3internal.h onstack.h ncrc.h ncauth.h \ ncoffsets.h nctestserver.h nc4dispatch.h nc3dispatch.h ncexternl.h \ -ncwinpath.h ncindex.h hdf4dispatch.h hdf5internal.h nc_provenance.h \ +ncpathmgr.h ncindex.h hdf4dispatch.h hdf5internal.h nc_provenance.h \ hdf5dispatch.h ncmodel.h isnan.h if USE_DAP diff --git a/include/ncwinpath.h b/include/ncpathmgr.h similarity index 100% rename from include/ncwinpath.h rename to include/ncpathmgr.h diff --git a/libdap4/d4read.c b/libdap4/d4read.c index f8e7b673ee..66ce9931e8 100644 --- a/libdap4/d4read.c +++ b/libdap4/d4read.c @@ -14,7 +14,7 @@ See \ref copyright file for more info. #ifdef HAVE_FCNTL_H #include #endif -#include "ncwinpath.h" +#include "ncpathmgr.h" /* Do conversion if this code was compiled via Vis. Studio or Mingw */ diff --git a/libdispatch/CMakeLists.txt b/libdispatch/CMakeLists.txt index 99cea1f79b..3a19e94e40 100644 --- a/libdispatch/CMakeLists.txt +++ b/libdispatch/CMakeLists.txt @@ -4,7 +4,7 @@ # University Corporation for Atmospheric Research/Unidata. # See netcdf-c/COPYRIGHT file for more info. -SET(libdispatch_SOURCES dparallel.c dcopy.c dfile.c ddim.c datt.c dattinq.c dattput.c dattget.c derror.c dvar.c dvarget.c dvarput.c dvarinq.c ddispatch.c nclog.c dstring.c dutf8.c dinternal.c doffsets.c ncuri.c nclist.c ncbytes.c nchashmap.c nctime.c nc.c nclistmgr.c utf8proc.h utf8proc.c dwinpath.c dutil.c drc.c dauth.c dreadonly.c dnotnc4.c dnotnc3.c crc32.c daux.c dinfermodel.c) +SET(libdispatch_SOURCES dparallel.c dcopy.c dfile.c ddim.c datt.c dattinq.c dattput.c dattget.c derror.c dvar.c dvarget.c dvarput.c dvarinq.c ddispatch.c nclog.c dstring.c dutf8.c dinternal.c doffsets.c ncuri.c nclist.c ncbytes.c nchashmap.c nctime.c nc.c nclistmgr.c utf8proc.h utf8proc.c dpathmgr.c dutil.c drc.c dauth.c dreadonly.c dnotnc4.c dnotnc3.c crc32.c daux.c dinfermodel.c) # Netcdf-4 only functions. Must be defined even if not used SET(libdispatch_SOURCES ${libdispatch_SOURCES} dgroup.c dvlen.c dcompound.c dtype.c denum.c dopaque.c dfilter.c) diff --git a/libdispatch/Makefile.am b/libdispatch/Makefile.am index fa2c11a551..11734149a5 100644 --- a/libdispatch/Makefile.am +++ b/libdispatch/Makefile.am @@ -19,7 +19,7 @@ libdispatch_la_SOURCES = dparallel.c dcopy.c dfile.c ddim.c datt.c \ dattinq.c dattput.c dattget.c derror.c dvar.c dvarget.c dvarput.c \ dvarinq.c dinternal.c ddispatch.c dutf8.c nclog.c dstring.c ncuri.c \ nclist.c ncbytes.c nchashmap.c nctime.c nc.c nclistmgr.c dauth.c \ -doffsets.c dwinpath.c dutil.c dreadonly.c dnotnc4.c dnotnc3.c crc32.c \ +doffsets.c dpathmgr.c dutil.c dreadonly.c dnotnc4.c dnotnc3.c crc32.c \ crc32.h daux.c dinfermodel.c # Add the utf8 codebase diff --git a/libdispatch/dauth.c b/libdispatch/dauth.c index 08aa53b1ac..d936d9003a 100644 --- a/libdispatch/dauth.c +++ b/libdispatch/dauth.c @@ -19,7 +19,7 @@ See COPYRIGHT for license information. #include "ncuri.h" #include "ncauth.h" #include "nclog.h" -#include "ncwinpath.h" +#include "ncpathmgr.h" #ifdef _MSC_VER #include diff --git a/libdispatch/dfile.c b/libdispatch/dfile.c index 385a0f997a..77f492ab57 100644 --- a/libdispatch/dfile.c +++ b/libdispatch/dfile.c @@ -35,7 +35,7 @@ #include "ncdispatch.h" #include "netcdf_mem.h" -#include "ncwinpath.h" +#include "ncpathmgr.h" #include "fbits.h" #undef DEBUG diff --git a/libdispatch/dinfermodel.c b/libdispatch/dinfermodel.c index 878896c0b2..7779164702 100644 --- a/libdispatch/dinfermodel.c +++ b/libdispatch/dinfermodel.c @@ -18,7 +18,7 @@ #endif #include "ncdispatch.h" -#include "ncwinpath.h" +#include "ncpathmgr.h" #include "netcdf_mem.h" #include "fbits.h" #include "ncbytes.h" diff --git a/libdispatch/dwinpath.c b/libdispatch/dpathmgr.c similarity index 99% rename from libdispatch/dwinpath.c rename to libdispatch/dpathmgr.c index eeb756b921..a7f05745f2 100644 --- a/libdispatch/dwinpath.c +++ b/libdispatch/dpathmgr.c @@ -23,7 +23,7 @@ #endif #include "ncexternl.h" -#include "ncwinpath.h" +#include "ncpathmgr.h" extern char *realpath(const char *path, char *resolved_path); diff --git a/libdispatch/drc.c b/libdispatch/drc.c index 26fa462009..4e7646edeb 100644 --- a/libdispatch/drc.c +++ b/libdispatch/drc.c @@ -18,7 +18,7 @@ See COPYRIGHT for license information. #include "ncuri.h" #include "ncrc.h" #include "nclog.h" -#include "ncwinpath.h" +#include "ncpathmgr.h" #define RCFILEENV "DAPRCFILE" diff --git a/libdispatch/durlmodel.c b/libdispatch/durlmodel.c index 56133fcac3..658fc564e5 100644 --- a/libdispatch/durlmodel.c +++ b/libdispatch/durlmodel.c @@ -17,7 +17,7 @@ #endif #include "ncdispatch.h" -#include "ncwinpath.h" +#include "ncpathmgr.h" #include "ncurlmodel.h" /* diff --git a/libdispatch/dutil.c b/libdispatch/dutil.c index 3e61262019..26cd386870 100644 --- a/libdispatch/dutil.c +++ b/libdispatch/dutil.c @@ -24,7 +24,7 @@ #include "ncbytes.h" #include "nclist.h" #include "nclog.h" -#include "ncwinpath.h" +#include "ncpathmgr.h" extern int mkstemp(char *template); diff --git a/libnczarr/zmap.c b/libnczarr/zmap.c index 44a6a236f6..041614c50b 100644 --- a/libnczarr/zmap.c +++ b/libnczarr/zmap.c @@ -4,7 +4,7 @@ */ #include "zincludes.h" -#include "ncwinpath.h" +#include "ncpathmgr.h" /**************************************************/ /* Import the current implementations */ diff --git a/libnczarr/zmap_nz4.c b/libnczarr/zmap_nz4.c index a9d9eb1cf7..61c403f430 100644 --- a/libnczarr/zmap_nz4.c +++ b/libnczarr/zmap_nz4.c @@ -6,7 +6,7 @@ #include "zincludes.h" #include "fbits.h" -#include "ncwinpath.h" +#include "ncpathmgr.h" /* Do a simple mapping of our simplified map model diff --git a/libnczarr/zmap_nzf.c b/libnczarr/zmap_nzf.c index 602a5b78db..227076dc88 100755 --- a/libnczarr/zmap_nzf.c +++ b/libnczarr/zmap_nzf.c @@ -42,7 +42,7 @@ #endif #include "fbits.h" -#include "ncwinpath.h" +#include "ncpathmgr.h" #define VERIFY diff --git a/libsrc/memio.c b/libsrc/memio.c index 57f97e6811..3695682be0 100644 --- a/libsrc/memio.c +++ b/libsrc/memio.c @@ -27,7 +27,7 @@ #include "ncdispatch.h" #include "nc3internal.h" #include "netcdf_mem.h" -#include "ncwinpath.h" +#include "ncpathmgr.h" #undef DEBUG diff --git a/libsrc/mmapio.c b/libsrc/mmapio.c index e667b28266..13bea6c029 100644 --- a/libsrc/mmapio.c +++ b/libsrc/mmapio.c @@ -21,7 +21,7 @@ #include #endif #include "nc3internal.h" -#include "ncwinpath.h" +#include "ncpathmgr.h" #undef DEBUG diff --git a/nc_test/tst_open_mem.c b/nc_test/tst_open_mem.c index 73e3e4bb36..6364cbcdc5 100644 --- a/nc_test/tst_open_mem.c +++ b/nc_test/tst_open_mem.c @@ -19,7 +19,7 @@ See \ref copyright file for more info. #include "netcdf.h" #include "netcdf_mem.h" #include "ncbytes.h" -#include "ncwinpath.h" +#include "ncpathmgr.h" #include "nc_tests.h" #ifdef USE_HDF5 diff --git a/ncdump/nccopy.c b/ncdump/nccopy.c index 7db2f28719..59528885c5 100644 --- a/ncdump/nccopy.c +++ b/ncdump/nccopy.c @@ -31,7 +31,7 @@ #include "dimmap.h" #include "nccomps.h" #include "list.h" -#include "ncwinpath.h" +#include "ncpathmgr.h" #undef DEBUGFILTER diff --git a/ncdump/ncdump.c b/ncdump/ncdump.c index 50767a3dc0..f5bd2e57b4 100644 --- a/ncdump/ncdump.c +++ b/ncdump/ncdump.c @@ -43,7 +43,7 @@ Research/Unidata. See \ref copyright file for more info. */ #include "isnan.h" #include "cdl.h" #include "nclog.h" -#include "ncwinpath.h" +#include "ncpathmgr.h" #include "nclist.h" #include "ncuri.h" #include "nc_provenance.h" diff --git a/ncgen/main.c b/ncgen/main.c index 8854f72ebe..01ed14e0df 100644 --- a/ncgen/main.c +++ b/ncgen/main.c @@ -7,7 +7,7 @@ #include "includes.h" #include "ncoffsets.h" -#include "ncwinpath.h" +#include "ncpathmgr.h" #ifdef HAVE_GETOPT_H #include #endif diff --git a/ncgen3/main.c b/ncgen3/main.c index e75be17160..4bf5cd9f05 100644 --- a/ncgen3/main.c +++ b/ncgen3/main.c @@ -25,7 +25,7 @@ #endif #include "netcdf.h" -#include "ncwinpath.h" +#include "ncpathmgr.h" #include "generic.h" #include "ncgen.h" diff --git a/nczarr_test/ut_test.c b/nczarr_test/ut_test.c index 72a9aa27c0..00f29e2b66 100755 --- a/nczarr_test/ut_test.c +++ b/nczarr_test/ut_test.c @@ -4,7 +4,7 @@ */ #include "ut_includes.h" -#include "ncwinpath.h" +#include "ncpathmgr.h" #ifdef HAVE_GETOPT_H #include diff --git a/nczarr_test/zmapio.c b/nczarr_test/zmapio.c index bb8a5bf942..5846852ce6 100644 --- a/nczarr_test/zmapio.c +++ b/nczarr_test/zmapio.c @@ -16,7 +16,7 @@ #endif #include "zincludes.h" -#include "ncwinpath.h" +#include "ncpathmgr.h" #define DEBUG diff --git a/nczarr_test/zs3parse.c b/nczarr_test/zs3parse.c index 6817735270..3a797d348d 100644 --- a/nczarr_test/zs3parse.c +++ b/nczarr_test/zs3parse.c @@ -16,7 +16,7 @@ #endif #include "zincludes.h" -#include "ncwinpath.h" +#include "ncpathmgr.h" #define DEBUG diff --git a/oc2/oc.c b/oc2/oc.c index fe8ef6eab3..ed992732df 100644 --- a/oc2/oc.c +++ b/oc2/oc.c @@ -17,7 +17,7 @@ #include "ncrc.h" #include "occurlfunctions.h" #include "ochttp.h" -#include "ncwinpath.h" +#include "ncpathmgr.h" #undef TRACK diff --git a/oc2/ocinternal.c b/oc2/ocinternal.c index 3202bb6f50..22bf53cf0d 100644 --- a/oc2/ocinternal.c +++ b/oc2/ocinternal.c @@ -32,7 +32,7 @@ #include "ochttp.h" #include "ocread.h" #include "dapparselex.h" -#include "ncwinpath.h" +#include "ncpathmgr.h" #define DATADDSFILE "datadds" diff --git a/oc2/ocread.c b/oc2/ocread.c index e5bc5b7d15..3f3b2dca2a 100644 --- a/oc2/ocread.c +++ b/oc2/ocread.c @@ -26,7 +26,7 @@ #include "ochttp.h" #include "ocread.h" #include "occurlfunctions.h" -#include "ncwinpath.h" +#include "ncpathmgr.h" /*Forward*/ static int readpacket(OCstate* state, NCURI*, NCbytes*, OCdxd, long*); diff --git a/unit_test/test_pathcvt.c b/unit_test/test_pathcvt.c index 7901b3975c..66e1155248 100644 --- a/unit_test/test_pathcvt.c +++ b/unit_test/test_pathcvt.c @@ -10,7 +10,7 @@ Test the NCpathcvt #include #include #include -#include "ncwinpath.h" +#include "ncpathmgr.h" #undef VERBOSE From 4300d57de780780087944b2df254c2c25c24df5e Mon Sep 17 00:00:00 2001 From: Dave-Allured Date: Wed, 14 Oct 2020 15:30:49 -0600 Subject: [PATCH 2/4] Fix time zone parser bug, github #1417 --- libdispatch/nctime.c | 26 ++++++++++++-------------- 1 file changed, 12 insertions(+), 14 deletions(-) diff --git a/libdispatch/nctime.c b/libdispatch/nctime.c index fcae8a639d..857581b67a 100644 --- a/libdispatch/nctime.c +++ b/libdispatch/nctime.c @@ -317,25 +317,23 @@ cdParseRelunits(cdCalenType timetype, char* relunits, cdUnitTime* unit, cdCompTi char basetime_1[CD_MAX_CHARTIME]; char basetime_2[CD_MAX_CHARTIME]; char basetime[2 * CD_MAX_CHARTIME + 1]; - int nconv1, nconv2, nconv; + int nconv; - /* Parse the relunits */ - /* Allow ISO-8601 "T" date-time separator as well as blank separator */ - nconv1 = sscanf(relunits,"%s since %[^T]T%s",charunits,basetime_1,basetime_2); - if(nconv1==EOF || nconv1==0){ - cdError("Error on relative units conversion, string = %s\n",relunits); - return 1; + /* Parse the relunits. First parse assuming white space only. */ + nconv = sscanf(relunits,"%s since %s %s",charunits,basetime_1,basetime_2); + + /* Handle ISO-8601 "T" date-time separator in place of blank separator. */ + if (nconv!=EOF && nconv>=2) { + if (strchr (basetime_1, 'T') != NULL) { + nconv = sscanf(relunits,"%s since %[^T]T%s",charunits,basetime_1,basetime_2); + } } - nconv2 = sscanf(relunits,"%s since %s %s",charunits,basetime_1,basetime_2); - if(nconv2==EOF || nconv2==0){ + + if(nconv==EOF || nconv==0){ cdError("Error on relative units conversion, string = %s\n",relunits); return 1; } - if(nconv1 < nconv2) { - nconv = nconv2; - } else { - nconv = sscanf(relunits,"%s since %[^T]T%s",charunits,basetime_1,basetime_2); - } + /* Get the units */ cdTrim(charunits,CD_MAX_RELUNITS); if(!strncasecmp(charunits,"sec",3) || !strcasecmp(charunits,"s")){ From c247e646f44b743fef0cdb3828384d8d369a11f6 Mon Sep 17 00:00:00 2001 From: Greg Sjaardema Date: Thu, 15 Oct 2020 09:40:31 -0600 Subject: [PATCH 3/4] Fix setting of use_szlib The `USE_SZLIB` symbol only appeared one time in this file in the entire project. I think that `USE_SZIP` is the intended symbol. --- nc-config.cmake.in | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/nc-config.cmake.in b/nc-config.cmake.in index bb6708f352..adc62c1a3b 100644 --- a/nc-config.cmake.in +++ b/nc-config.cmake.in @@ -73,7 +73,7 @@ else has_hdf5="yes" fi -has_szlib="@USE_SZLIB@" +has_szlib="@USE_SZIP@" if [ -z "$has_szlib" -o "$has_szlib" = "OFF" ]; then has_szlib="no" else From 1865b76969828f1597cb7e4d2df9d3b3c3996fa3 Mon Sep 17 00:00:00 2001 From: Ward Fisher Date: Fri, 16 Oct 2020 10:03:48 -0600 Subject: [PATCH 4/4] Updated release notes to refer to https://github.com/Unidata/netcdf-c/pull/1866 --- RELEASE_NOTES.md | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) diff --git a/RELEASE_NOTES.md b/RELEASE_NOTES.md index df0f1358b2..8098ad7b1c 100644 --- a/RELEASE_NOTES.md +++ b/RELEASE_NOTES.md @@ -7,17 +7,11 @@ This file contains a high-level description of this package's evolution. Release ## 4.8.0 - TBD + +* [Bug Fix] Fix time zone parser bug. See more information at [Github #1866](https://github.com/Unidata/netcdf-c/pull/1866) for more information. * [Documentation] Migrated the documents in the NUG/ directory to the dedicated NUG repository found at https://github.com/Unidata/netcdf -* [Bug Fix] Revert the internal filter code to simplify it. From -the user's point of view, the only visible change should be that -(1) the functions that convert text to filter specs have had -their signature reverted and renamed and have been moved to -netcdf_aux.h, and (2) Some filter API functions now return -NC_ENOFILTER when inquiry is made about some filter. Internally, -the dispatch table has been modified to get rid of the complex -structures. -* [Bug Fix] If the HDF5 byte-range Virtual File Driver is available )HDf5 1.10.6 or later) then use -it because it has better performance than the one currently built into the netcdf library. +* [Bug Fix] Revert the internal filter code to simplify it. From the user's point of view, the only visible change should be that (1) the functions that convert text to filter specs have had their signature reverted and renamed and have been moved to netcdf_aux.h, and (2) Some filter API functions now return NC_ENOFILTER when inquiry is made about some filter. Internally, the dispatch table has been modified to get rid of the complex structures. +* [Bug Fix] If the HDF5 byte-range Virtual File Driver is available )HDf5 1.10.6 or later) then use it because it has better performance than the one currently built into the netcdf library. * [Bug Fix] Fixed byte-range support with cURL > 7.69. See [https://github.com/Unidata/netcdf-c/pull/1798]. * [Enhancement] Added new test for using compression with parallel I/O: nc_test4/tst_h_par_compress.c. See [https://github.com/Unidata/netcdf-c/pull/1784]. * [Bug Fix] Don't return error for extra calls to nc_redef() for netCDF/HDF5 files, unless classic model is in use. See [https://github.com/Unidata/netcdf-c/issues/1779].