Commit 68bb046b authored by Uwe Schulzweida's avatar Uwe Schulzweida
Browse files

cdfInqContents: check also x/yvarid to compare curvilinear grids

parent b1b5c7ca
2007-03-05 Uwe Schulzweida <Uwe.Schulzweida@zmaw.de>
2007-05-?? Uwe Schulzweida <Uwe.Schulzweida@zmaw.de>
* cdfInqContents: check also x/yvarid to compare curvilinear grids
* Version 1.0.7 released
2007-03-06 Uwe Schulzweida <Uwe.Schulzweida@zmaw.de>
* using GRIB library version 1.0.5
* use GRIB ltype to define GENERIC zaxis
......
# Process this file with autoconf to produce a configure script.
AC_INIT(cdi, 1.0.6, Uwe.Schulzweida@zmaw.de)
AC_INIT(cdi, 1.0.7, Uwe.Schulzweida@zmaw.de)
CONFIG_ABORT=yes
......
......@@ -4372,10 +4372,21 @@ int cdfInqContents(int streamID)
if ( xdimid == xdimid2 &&
(ydimid == ydimid2 || (xdimid == ydimid && ydimid2 == UNDEFID)) )
{
if ( CDI_Debug )
Message(func, "gridID %d %d %s",
ncvars[ncvarid].gridID, ncvarid2, ncvars[ncvarid2].name);
ncvars[ncvarid2].gridID = ncvars[ncvarid].gridID;
int same_grid = TRUE;
if ( xvarid != -1 && ncvars[ncvarid2].xvarid != UNDEFID &&
xvarid != ncvars[ncvarid2].xvarid ) same_grid = FALSE;
if ( yvarid != -1 && ncvars[ncvarid2].yvarid != UNDEFID &&
yvarid != ncvars[ncvarid2].yvarid ) same_grid = FALSE;
if ( same_grid )
{
if ( CDI_Debug )
Message(func, "gridID %d %d %s",
ncvars[ncvarid].gridID, ncvarid2, ncvars[ncvarid2].name);
ncvars[ncvarid2].gridID = ncvars[ncvarid].gridID;
}
}
}
}
......
......@@ -535,9 +535,10 @@ int grbScanTimestep(int streamID)
ipunp, (int *) gribbuffer, recsize, &iword, "J", &iret);
rcode = ISEC1_Parameter;
if ( ISEC1_LevelType == 100 ) ISEC1_Level1 *= 100;
if ( ISEC1_LevelType == 99 ) ISEC1_LevelType = 100;
level1 = ISEC1_Level1;
level2 = ISEC1_Level2;
if ( ISEC1_LevelType == 100 ) level1 *= 100;
gribDateTime(isec1, &vdate, &vtime);
......@@ -717,7 +718,6 @@ void grbAddRecord(int streamID, int code, int *isec1, int *isec2, double *fsec2,
numavg = ISEC1_AvgNum;
level1 = ISEC1_Level1;
if ( ISEC1_LevelType == 100 ) level1 *= 100;
level2 = ISEC1_Level2;
/* fprintf(stderr, "code %d %d %d %d\n", code, level1, level2, ISEC1_LevelType); */
......@@ -1024,9 +1024,10 @@ void grbScanTimestep1(int streamID)
ipunp, (int *) gribbuffer, recsize, &iword, "J", &iret);
rcode = ISEC1_Parameter;
if ( ISEC1_LevelType == 100 ) ISEC1_Level1 *= 100;
if ( ISEC1_LevelType == 99 ) ISEC1_LevelType = 100;
level1 = ISEC1_Level1;
level2 = ISEC1_Level2;
if ( ISEC1_LevelType == 100 ) level1 *= 100;
if ( ISEC4_NumBits > 0 && ISEC4_NumBits <= 32 )
prec = ISEC4_NumBits;
......@@ -1261,9 +1262,10 @@ int grbScanTimestep2(int streamID)
ipunp, (int *) gribbuffer, recsize, &iword, "J", &iret);
rcode = ISEC1_Parameter;
if ( ISEC1_LevelType == 100 ) ISEC1_Level1 *= 100;
if ( ISEC1_LevelType == 99 ) ISEC1_LevelType = 100;
level1 = ISEC1_Level1;
level2 = ISEC1_Level2;
if ( ISEC1_LevelType == 100 ) level1 *= 100;
gribDateTime(isec1, &vdate, &vtime);
......
......@@ -579,8 +579,11 @@ int zaxisCompare(int zaxisID, int zaxistype, int nlevels, int lbounds, double *l
int differ = 1;
int levelID;
int zlbounds = 0;
int ltype_is_equal = FALSE;
if ( ltype == zaxisInqLtype(zaxisID) && (zaxistype == zaxisInqType(zaxisID) || zaxistype == ZAXIS_GENERIC) )
if ( ltype == zaxisInqLtype(zaxisID) ) ltype_is_equal = TRUE;
if ( ltype_is_equal && (zaxistype == zaxisInqType(zaxisID) || zaxistype == ZAXIS_GENERIC) )
{
if ( zaxisInqLbounds(zaxisID, NULL) > 0 ) zlbounds = 1;
if ( nlevels == zaxisInqSize(zaxisID) && zlbounds == lbounds )
......
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