[NCF-284]/ ZQX-155900

Some servers do not properly
implement the current DAP2 spec.
It turns out that this server is one of those:
    http://nomads.ncep.noaa.gov:9090/
When a reference such as this is made:
    http://nomads.ncep.noaa.gov:9090/dods/gens/gens20140123/gep_all_12z?prmslmsl[0][0][0][0:359]
tt is returning this:
Dataset {
    float prmslmsl[ens=1][time=1][lat=1][lon=360];
} gens%2fgens20140123%2fgep_all_12z;

when it should be returning this:
Dataset {
  Structure {
    float prmslmsl[ens=1][time=1][lat=1][lon=360];
  } prmslmsl;
} gens%2fgens20140123%2fgep_all_12z;

The reason is that when picking fields out of a grid,
one must maintain the fully qualified name, so the grid
is converted to an enclosing structure.

It turns out that the problem was that
when I create the new structure node, I was
improperly linking it into the existing graph.
This caused a null pointer failure.
Fix is to make sure the relevant field (node->root)
is set.
This commit is contained in:
dmh 2014-01-24 13:35:10 -07:00
commit 893ab1c3fe
3 changed files with 77 additions and 45 deletions

View File

@ -104,7 +104,7 @@ INCLUDE(GenerateExportHeader)
################################
# Default to shared libs on.
# Default building shared libraries.
OPTION(BUILD_SHARED_LIBS "Configure netCDF as a shared library." ON)
SET (LIB_TYPE STATIC)
IF (BUILD_SHARED_LIBS)
@ -114,20 +114,50 @@ IF (BUILD_SHARED_LIBS)
ENDIF()
ENDIF()
# Supress unused variable and parameter warnings, for the time being,
# on GCC.
#
# Also, set some other default compiler flags.
# Set some default linux gcc & apple compiler options for
# debug builds.
IF(CMAKE_COMPILER_IS_GNUCC OR APPLE)
SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -g -Wall -Wno-unused-variable -Wno-unused-parameter")
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -g -Wall -Wno-unused-variable -Wno-unused-parameter")
ENDIF()
IF(NOT ENABLE_COVERAGE_TESTS)
SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -O2")
SET(CMAKE_CXX_FLAGS "${CMAKE_C_FLAGS} -O2")
ENDIF()
OPTION (ENABLE_COVERAGE_TESTS "Enable compiler flags needed to perform coverage tests." OFF)
OPTION (ENABLE_CONVERSION_WARNINGS "Enable warnings for implicit conversion from 64 to 32-bit datatypes." ON)
OPTION (ENABLE_USED_VAR_PAR_WARNINGS "Enable warnings for unused parameters and variables. Creates very noisy output." OFF)
OPTION (ENABLE_LARGE_FILE_TESTS "Enable large file tests." OFF)
# Debugging flags
SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -g -Wall")
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -g -Wall")
# Coverage tests need to have optimization turned off.
IF(NOT ENABLE_COVERAGE_TESTS)
SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -O2")
SET(CMAKE_CXX_FLAGS "${CMAKE_C_FLAGS} -O2")
ELSE()
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -g -O0 -profile-arcs -ftest-coverage")
SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -g -O0 -fprofile-arcs -ftest-coverage")
SET(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -fprofile-arcs -ftest-coverage")
MESSAGE(STATUS "Coverage Tests: On.")
ENDIF()
# Unused var and parameter warnings create a lot of noise.
IF(NOT ENABLE_UNUSED_VAR_PAR_WARNINGS)
SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wno-unused-variable -Wno-unused-parameter")
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-unused-variable -Wno-unused-parameter")
ENDIF()
# Warnings for 64-to-32 bit conversions.
IF(ENABLE_CONVERSION_WARNINGS)
IF(APPLE)
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wshorten-64-to-32")
SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wshorten-64-to-32")
ELSE()
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wconversion")
SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wconversion")
ENDIF(APPLE)
ENDIF(ENABLE_CONVERSION_WARNINGS)
ENDIF(CMAKE_COMPILER_IS_GNUCC OR APPLE)
# End default linux gcc & apple compiler options.
ADD_DEFINITIONS()
@ -264,6 +294,9 @@ MACRO(print_conf_summary)
ENDIF()
MESSAGE(STATUS "\tUsing pnetcdf:\t\t\t" ${STATUS_PNETCDF})
MESSAGE(STATUS "\tUsing Parallel IO:\t\t" ${STATUS_PARALLEL})
MESSAGE(STATUS "\tCMAKE_C_FLAGS:\t\t" ${CMAKE_C_FLAGS})
MESSAGE(STATUS "\tCMAKE_CXX_FLAGS:\t\t" ${CMAKE_CXX_FLAGS})
MESSAGE(STATUS "\tLinking against:\t\t" "${ALL_TLL_LIBS}")
MESSAGE("")
@ -421,18 +454,6 @@ IF(ENABLE_DISKLESS)
SET(USE_DISKLESS ON)
ENDIF()
OPTION(ENABLE_CONVERSION_WARNINGS "Enable warnings for implicit conversion from 64 to 32-bit datatypes." ON)
IF(ENABLE_CONVERSION_WARNINGS)
IF(NOT MSVC)
IF(APPLE)
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wshorten-64-to-32")
SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wshorten-64-to-32")
ELSE()
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wconversion")
SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wconversion")
ENDIF(APPLE)
ENDIF(NOT MSVC)
ENDIF(ENABLE_CONVERSION_WARNINGS)
# Option Logging, only valid for netcdf4.
OPTION (ENABLE_LOGGING "Enable Logging." OFF)
IF(ENABLE_LOGGING)
@ -651,7 +672,6 @@ IF(ENABLE_TESTS)
ENDIF()
# Enable Large file tests
OPTION (ENABLE_LARGE_FILE_TESTS "Enable large file tests." OFF)
IF(ENABLE_LARGE_FILE_TESTS)
SET(LARGE_FILE_TESTS ON)
ENDIF()
@ -680,18 +700,6 @@ IF(ENABLE_LARGE_FILE_SUPPORT)
ENDIF()
# Provide the option to perform coverage tests.
IF(CMAKE_COMPILER_IS_GNUCC OR APPLE)
OPTION (ENABLE_COVERAGE_TESTS "Enable compiler flags needed to perform coverage tests." OFF)
IF(ENABLE_COVERAGE_TESTS)
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -g -O0 -profile-arcs -ftest-coverage")
SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -g -O0 -fprofile-arcs -ftest-coverage")
SET(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -fprofile-arcs -ftest-coverage")
MESSAGE(STATUS "Coverage Tests: On.")
ENDIF()
ENDIF()
OPTION (ENABLE_EXAMPLE_TESTS "Run extra example tests. Requires GNU Sed. Ignored if netCDF-4 is not Enabled" OFF)
IF(NOT ENABLE_NETCDF_4 AND ENABLE_EXAMPLE_TESTS)
SET (ENABLE_EXAMPLE_TESTS OFF)

View File

@ -55,9 +55,9 @@ NC5_create(const char *path, int cmode,
if((cmode & (NC_MPIIO|NC_MPIPOSIX)) == (NC_MPIIO|NC_MPIPOSIX))
return NC_EINVAL;
/* Appears that this comment is wrong; allow 64 bit offset*/
/* Cannot have 64 bit offset flag */
if(cmode & (NC_64BIT_OFFSET))
return NC_EINVAL;
/*if(cmode & (NC_64BIT_OFFSET)) return NC_EINVAL;*/
comm = ((NC_MPI_INFO *)mpidata)->comm;
info = ((NC_MPI_INFO *)mpidata)->info;
@ -109,9 +109,9 @@ NC5_open(const char *path, int cmode,
if((cmode & (NC_MPIIO|NC_MPIPOSIX)) == (NC_MPIIO|NC_MPIPOSIX))
return NC_EINVAL;
/* Appears that this comment is wrong; allow 64 bit offset*/
/* Cannot have 64 bit offset flag */
if(cmode & (NC_64BIT_OFFSET))
return NC_EINVAL;
/* if(cmode & (NC_64BIT_OFFSET)) return NC_EINVAL; */
if(mpidata != NULL) {
comm = ((NC_MPI_INFO *)mpidata)->comm;

View File

@ -16,6 +16,12 @@ DTS="$SVC/dts"
PARAMS="[log]"
#PARAMS="${PARAMS}[show=fetch]"
# Determine If we're on OSX or Linux
myplatform=`uname -a | cut -d" " -f 1`
#OCLOGFILE=/dev/null
OCLOGFILE="" ; export OCLOGFILE
@ -252,16 +258,34 @@ echo '#DODSRC' >./.dodsrc
for t in ${TESTSET} ; do
# see if we are using constraints
index=`expr index "${t}" ";"`
if test "x$index" = "x0" ; then
constrained=0
#index=`expr index "${t}" ";"`
#echo index: $index
if [ "$myplatform" = "Darwin" ]; then
index=`echo "${t}" | sed -n "s/;.*//p" | wc -c`
if (( $index == 0 )) ; then
constrained=0
else
constrained=1
fi
else
constrained=1
index=`expr index "${t}" ";"`
if test "x$index" = "x0" ; then
constrained=0
else
constrained=1
fi
fi
if test "x$constrained" = "x0" ; then # No constraint
testname=$t
ce=
else # Constrained
testname=`echo $t | cut -d ';' -f1`
testno=`echo $t | cut -d ';' -f2`
ce=`echo $t | cut -d ';' -f3-`