Commit d020b9f2 authored by Uwe Schulzweida's avatar Uwe Schulzweida
Browse files

cdfInqContents: bug fix for inconsistent curvilinear grid

parent 19a05bb1
2008-04-?? Uwe Schulzweida <Uwe.Schulzweida@zmaw.de>
* cdfInqContents: bug fix for inconsistent curvilinear grid [report: Holger Goettel]
* cdfInqContents: check type of _FillValue
* gridCompare: compare grid.yinc only if set
* grid_check_cyclic: bug fix
* Version 1.1.1 released
......
......@@ -42,7 +42,7 @@ case "${HOSTNAME}" in
executor | yang | yin)
./configure --prefix=$HOME/local/SUN64 \
--with-netcdf=/scratch/small/m214/m214089/local/SunOS64 \
CC=cc CFLAGS="-g -mt -fast -xtarget=native -xarch=v9a"
CC=cc CFLAGS="-g -mt -fast -xtarget=native -m64"
;;
# sx6-nec-superux12.2
cs*)
......
......@@ -2205,13 +2205,23 @@ int gridCompare(int gridID, GRID grid)
if ( ! (DBL_IS_EQUAL(grid.xfirst, 0) && DBL_IS_EQUAL(grid.xlast, 0) && DBL_IS_EQUAL(grid.xinc, 0)) &&
! (DBL_IS_EQUAL(grid.yfirst, 0) && DBL_IS_EQUAL(grid.ylast, 0) && DBL_IS_EQUAL(grid.yinc, 0)) &&
!DBL_IS_EQUAL(grid.xfirst, grid.xlast) && !DBL_IS_EQUAL(grid.yfirst, grid.ylast) )
if ( !DBL_IS_EQUAL(grid.xfirst, gridInqXval(gridID, 0)) ||
!DBL_IS_EQUAL(grid.yfirst, gridInqYval(gridID, 0)) ||
fabs(fabs(grid.xinc) - fabs(gridInqXinc(gridID))) > fabs(grid.xinc/1000) ||
fabs(fabs(grid.yinc) - fabs(gridInqYinc(gridID))) > fabs(grid.yinc/1000) )
{
differ = 1;
}
{
if ( !DBL_IS_EQUAL(grid.xfirst, gridInqXval(gridID, 0)) ||
!DBL_IS_EQUAL(grid.yfirst, gridInqYval(gridID, 0)))
{
differ = 1;
}
if ( !differ && fabs(grid.xinc) > 0 &&
fabs(fabs(grid.xinc) - fabs(gridInqXinc(gridID))) > fabs(grid.xinc/1000))
{
differ = 1;
}
if ( !differ && fabs(grid.yinc) > 0 &&
fabs(fabs(grid.yinc) - fabs(gridInqYinc(gridID))) > fabs(grid.yinc/1000))
{
differ = 1;
}
}
}
else
differ = 1;
......
......@@ -4255,6 +4255,19 @@ int cdfInqContents(int streamID)
}
else
{
if ( xvarid != UNDEFID && yvarid != UNDEFID )
{
if ( ncvars[xvarid].ndims != ncvars[yvarid].ndims )
{
Warning(func, "Inconsistent grid structure for variable %s!",
ncvars[ncvarid].name);
ncvars[ncvarid].xvarid = UNDEFID;
ncvars[ncvarid].yvarid = UNDEFID;
xvarid = UNDEFID;
yvarid = UNDEFID;
}
}
if ( xvarid != UNDEFID )
{
islon = ncvars[xvarid].islon;
......
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