Commit 43c2b095 authored by Uwe Schulzweida's avatar Uwe Schulzweida
Browse files

cdfInqContents: fix problem of wrong stdname for grid description

parent a3f31d28
2010-07-05 Uwe Schulzweida <Uwe.Schulzweida@zmaw.de>
* cdfInqContents: fix problem of wrong stdname for grid description [report: Michael Boettinger]
* Version 1.4.5.1 released
2010-07-05 Edi Kirk <E.Kirk@gmx.de>
* GRIB1 decode: Correct ZeroShiftError of simple packed spherical harmonics
......
......@@ -5163,9 +5163,11 @@ int cdfInqContents(int streamID)
{
if ( ncvars[ncvarid].isvar && ncvars[ncvarid].gridID == UNDEFID )
{
int xdimids[2] = {-1,-1}, ydimids[2] = {-1,-1};
int xdimid = -1, ydimid = -1;
int xvarid = -1, yvarid = -1;
int islon = 0, islat = 0;
int nxdims = 0, nydims = 0;
double xinc = 0, yinc = 0;
xsize = 0;
......@@ -5174,10 +5176,32 @@ int cdfInqContents(int streamID)
ndims = ncvars[ncvarid].ndims;
for ( i = 0; i < ndims; i++ )
{
if ( ncvars[ncvarid].dimtype[i] == X_AXIS )
xdimid = ncvars[ncvarid].dimids[i];
else if ( ncvars[ncvarid].dimtype[i] == Y_AXIS )
ydimid = ncvars[ncvarid].dimids[i];
if ( ncvars[ncvarid].dimtype[i] == X_AXIS && nxdims < 2 )
{
xdimids[nxdims] = ncvars[ncvarid].dimids[i];
nxdims++;
}
else if ( ncvars[ncvarid].dimtype[i] == Y_AXIS && nydims < 2 )
{
ydimids[nydims] = ncvars[ncvarid].dimids[i];
nydims++;
}
}
if ( nxdims == 2 )
{
xdimid = xdimids[0];
ydimid = xdimids[1];
}
else if ( nydims == 2 )
{
xdimid = ydimids[0];
ydimid = ydimids[1];
}
else
{
xdimid = xdimids[0];
ydimid = ydimids[0];
}
if ( ncvars[ncvarid].xvarid != UNDEFID )
......
Supports Markdown
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