Commit 5025b9a8 authored by Uwe Schulzweida's avatar Uwe Schulzweida
Browse files

netCDF: wrong result if type of data and type of attribute valid_range differ [Bug #3727]

parent d99ea749
2013-09-26 Uwe Schulzweida <Uwe.Schulzweida@zmaw.de>
* Version 1.6.2 released
* using CGRIBEX library version 1.6.2
2013-07-08 Uwe Schulzweida <Uwe.Schulzweida@zmaw.de>
* netCDF: wrong result if type of data and type of attribute valid_range differ [Bug #3727]
2013-07-04 Uwe Schulzweida <Uwe.Schulzweida@zmaw.de>
* gribapiDefLevel::ZAXIS_DEPTH_BELOW_LAND: apply scalefactor to dlevel2 (bug fix) [report: Harald Anlauf]
......@@ -6,6 +15,7 @@
2013-06-28 Uwe Schulzweida <Uwe.Schulzweida@zmaw.de>
* Version 1.6.1 released
* using CGRIBEX library version 1.6.1
2013-06-27 Uwe Schulzweida <Uwe.Schulzweida@zmaw.de>
......
CDI NEWS
--------
Version 1.6.2 (26 September 2013):
Fixed bugs:
* netCDF: wrong result if type of data and type of attribute valid_range differ [Bug #3727]
Version 1.6.1 (18 June 2013):
New features:
......
#! /bin/sh
# Guess values for system-dependent variables and create Makefiles.
# Generated by GNU Autoconf 2.68 for cdi 1.6.1.
# Generated by GNU Autoconf 2.68 for cdi 1.6.2.
#
# Report bugs to <http://code.zmaw.de/projects/cdi>.
#
......@@ -570,8 +570,8 @@ MAKEFLAGS=
# Identity of this package.
PACKAGE_NAME='cdi'
PACKAGE_TARNAME='cdi'
PACKAGE_VERSION='1.6.1'
PACKAGE_STRING='cdi 1.6.1'
PACKAGE_VERSION='1.6.2'
PACKAGE_STRING='cdi 1.6.2'
PACKAGE_BUGREPORT='http://code.zmaw.de/projects/cdi'
PACKAGE_URL=''
 
......@@ -1403,7 +1403,7 @@ if test "$ac_init_help" = "long"; then
# Omit some internal or obsolete options to make the list less imposing.
# This message is too long to be a string in the A/UX 3.1 sh.
cat <<_ACEOF
\`configure' configures cdi 1.6.1 to adapt to many kinds of systems.
\`configure' configures cdi 1.6.2 to adapt to many kinds of systems.
 
Usage: $0 [OPTION]... [VAR=VALUE]...
 
......@@ -1473,7 +1473,7 @@ fi
 
if test -n "$ac_init_help"; then
case $ac_init_help in
short | recursive ) echo "Configuration of cdi 1.6.1:";;
short | recursive ) echo "Configuration of cdi 1.6.2:";;
esac
cat <<\_ACEOF
 
......@@ -1630,7 +1630,7 @@ fi
test -n "$ac_init_help" && exit $ac_status
if $ac_init_version; then
cat <<\_ACEOF
cdi configure 1.6.1
cdi configure 1.6.2
generated by GNU Autoconf 2.68
 
Copyright (C) 2010 Free Software Foundation, Inc.
......@@ -2391,7 +2391,7 @@ cat >config.log <<_ACEOF
This file contains any messages produced by compilers while
running configure, to aid debugging if configure makes a mistake.
 
It was created by cdi $as_me 1.6.1, which was
It was created by cdi $as_me 1.6.2, which was
generated by GNU Autoconf 2.68. Invocation command line was
 
$ $0 $@
......@@ -3288,7 +3288,7 @@ fi
 
# Define the identity of the package.
PACKAGE='cdi'
VERSION='1.6.1'
VERSION='1.6.2'
 
 
cat >>confdefs.h <<_ACEOF
......@@ -27453,7 +27453,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
# report actual input values of CONFIG_FILES etc. instead of their
# values after options handling.
ac_log="
This file was extended by cdi $as_me 1.6.1, which was
This file was extended by cdi $as_me 1.6.2, which was
generated by GNU Autoconf 2.68. Invocation command line was
 
CONFIG_FILES = $CONFIG_FILES
......@@ -27519,7 +27519,7 @@ _ACEOF
cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`"
ac_cs_version="\\
cdi config.status 1.6.1
cdi config.status 1.6.2
configured by $0, generated by GNU Autoconf 2.68,
with options \\"\$ac_cs_config\\"
 
......
# Process this file with autoconf to produce a configure script.
AC_INIT([cdi], [1.6.1], [http://code.zmaw.de/projects/cdi])
AC_INIT([cdi], [1.6.2], [http://code.zmaw.de/projects/cdi])
echo "configuring ${PACKAGE_NAME} ${PACKAGE_VERSION}"
......
......@@ -371,6 +371,14 @@ void cdfGetAttText(int fileID, int ncvarid, char *attname, int attlen, char *att
}
}
static
int xtypeIsFloat(int xtype)
{
int isFloat = FALSE;
if ( xtype == NC_FLOAT || xtype == NC_DOUBLE ) isFloat = TRUE;
return isFloat;
}
static
int cdfInqDatatype(int xtype, int lunsigned)
{
......@@ -4786,7 +4794,7 @@ void cdfScanVarAttributes(int nvars, ncvar_t *ncvars, ncdim_t *ncdims,
{
extern int cdiIgnoreValidRange;
int lignore = FALSE;
if ( (atttype == NC_FLOAT || atttype == NC_DOUBLE) && xtype != NC_FLOAT && xtype != NC_DOUBLE ) lignore = TRUE;
if ( xtypeIsFloat(atttype) != xtypeIsFloat(xtype) ) lignore = TRUE;
if ( cdiIgnoreValidRange == FALSE && lignore == FALSE )
{
cdfGetAttDouble(ncid, ncvarid, attname, 2, ncvars[ncvarid].validrange);
......@@ -4807,7 +4815,7 @@ void cdfScanVarAttributes(int nvars, ncvar_t *ncvars, ncdim_t *ncdims,
{
extern int cdiIgnoreValidRange;
int lignore = FALSE;
if ( (atttype == NC_FLOAT || atttype == NC_DOUBLE) && xtype != NC_FLOAT && xtype != NC_DOUBLE ) lignore = TRUE;
if ( xtypeIsFloat(atttype) != xtypeIsFloat(xtype) ) lignore = TRUE;
if ( cdiIgnoreValidRange == FALSE && lignore == FALSE )
{
cdfGetAttDouble(ncid, ncvarid, attname, 1, &(ncvars[ncvarid].validrange)[0]);
......@@ -4825,7 +4833,7 @@ void cdfScanVarAttributes(int nvars, ncvar_t *ncvars, ncdim_t *ncdims,
{
extern int cdiIgnoreValidRange;
int lignore = FALSE;
if ( (atttype == NC_FLOAT || atttype == NC_DOUBLE) && xtype != NC_FLOAT && xtype != NC_DOUBLE ) lignore = TRUE;
if ( xtypeIsFloat(atttype) != xtypeIsFloat(xtype) ) lignore = TRUE;
if ( cdiIgnoreValidRange == FALSE && lignore == FALSE )
{
cdfGetAttDouble(ncid, ncvarid, attname, 1, &(ncvars[ncvarid].validrange)[1]);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment