Commit 19a05bb1 authored by Uwe Schulzweida's avatar Uwe Schulzweida
Browse files

cdfInqContents: check type of _FillValue

parent c5a8029c
2008-04-?? Uwe Schulzweida <Uwe.Schulzweida@zmaw.de>
* cdfInqContents: check type of _FillValue
* grid_check_cyclic: bug fix
* Version 1.1.1 released
......
......@@ -26,9 +26,9 @@ case "${HOSTNAME}" in
CC=g++ CFLAGS="-g -O2 -Wall -W -Wfloat-equal" CFINT=-Df2cFortran
;;
gata)
./configure --prefix=$HOME/local/LINUX \
./configure --prefix=$HOME/local/etch-ia32 \
--with-netcdf=/client \
CPPFLAGS="-DHAVE_LIBSZ -I$HOME/local/LINUX/include" LIBS=$HOME/local/LINUX/lib/libsz.a \
CPPFLAGS="-DHAVE_LIBSZ -I$HOME/local/etch-ia32/include" LIBS=$HOME/local/etch-ia32/lib/libsz.a \
CC=gcc CFLAGS="-g -O2 -Wall -W -Wfloat-equal" CFINT=-Df2cFortran
;;
# sparc-sun-solaris2.8
......
......@@ -3,6 +3,11 @@
#include <stdlib.h>
#if defined(__cplusplus)
extern "C" {
#endif
/*
* if DEBUG_MEMORY is defined setenv MEMORY_DEBUG to debug memory
*/
......@@ -40,4 +45,8 @@ extern void Free (const char *caller, const char *file, int line, void *ptr
#endif /* DEBUG_MEMORY */
#if defined (__cplusplus)
}
#endif
#endif /* _DMEMORY_H */
......@@ -2138,7 +2138,7 @@ static void grid_check_cyclic(GRID *gridptr)
}
}
}
if ( nc < 2 )
if ( nc < 1 )
{
gridptr->isCyclic = FALSE;
break;
......
......@@ -3506,23 +3506,29 @@ int cdfInqContents(int streamID)
}
else if ( strcmp(attname, "add_offset") == 0 )
{
cdfGetAttDouble(fileID, ncvarid, attname, 1, &ncvars[ncvarid].addoffset);
/*
if ( xtype != NC_BYTE && xtype != NC_SHORT && xtype != NC_INT )
if ( ncvars[ncvarid].addoffset != 0 )
Warning(func, "attribute add_offset not supported for xtype %d\n", xtype);
*/
cdfSetVar(ncvars, ncvarid, TRUE);
if ( xtype != NC_CHAR )
{
cdfGetAttDouble(fileID, ncvarid, attname, 1, &ncvars[ncvarid].addoffset);
/*
if ( xtype != NC_BYTE && xtype != NC_SHORT && xtype != NC_INT )
if ( ncvars[ncvarid].addoffset != 0 )
Warning(func, "attribute add_offset not supported for xtype %d\n", xtype);
*/
cdfSetVar(ncvars, ncvarid, TRUE);
}
}
else if ( strcmp(attname, "scale_factor") == 0 )
{
cdfGetAttDouble(fileID, ncvarid, attname, 1, &ncvars[ncvarid].scalefactor);
/*
if ( xtype != NC_BYTE && xtype != NC_SHORT && xtype != NC_INT )
if ( ncvars[ncvarid].scalefactor != 1 )
Warning(func, "attribute scale_factor not supported for xtype %d\n", xtype);
*/
cdfSetVar(ncvars, ncvarid, TRUE);
if ( xtype != NC_CHAR )
{
cdfGetAttDouble(fileID, ncvarid, attname, 1, &ncvars[ncvarid].scalefactor);
/*
if ( xtype != NC_BYTE && xtype != NC_SHORT && xtype != NC_INT )
if ( ncvars[ncvarid].scalefactor != 1 )
Warning(func, "attribute scale_factor not supported for xtype %d\n", xtype);
*/
cdfSetVar(ncvars, ncvarid, TRUE);
}
}
else if ( strcmp(attname, "bounds") == 0 )
{
......@@ -3676,9 +3682,12 @@ int cdfInqContents(int streamID)
else if ( strcmp(attname, "_FillValue") == 0 ||
strcmp(attname, "missing_value") == 0 )
{
cdfGetAttDouble(fileID, ncvarid, attname, 1, &ncvars[ncvarid].missval);
ncvars[ncvarid].defmiss = TRUE;
/* cdfSetVar(ncvars, ncvarid, TRUE); */
if ( xtype != NC_CHAR )
{
cdfGetAttDouble(fileID, ncvarid, attname, 1, &ncvars[ncvarid].missval);
ncvars[ncvarid].defmiss = TRUE;
/* cdfSetVar(ncvars, ncvarid, TRUE); */
}
}
else if ( strcmp(attname, "axis") == 0 )
{
......
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