Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
mpim-sw
libcdi
Commits
405e8e93
Commit
405e8e93
authored
Aug 01, 2019
by
Uwe Schulzweida
Browse files
grbGetGridtype: return changed gridID (bug fix).
parent
45f62b8d
Changes
5
Hide whitespace changes
Inline
Side-by-side
ChangeLog
View file @
405e8e93
...
...
@@ -3,6 +3,10 @@
* using CGRIBEX library version 1.9.4
* Version 1.9.8 released
2019-08-01 Uwe Schulzweida
* grbGetGridtype: return changed gridID (bug fix) [report: Florian Prill]
2019-07-22 Uwe Schulzweida
* Moved grib2LocalSectionPresent=0 to gribContainersNew() [report: Florian Prill]
...
...
src/stream_cgribex.c
View file @
405e8e93
...
...
@@ -1772,7 +1772,7 @@ void cgribexDefGrid(int *isec1, int *isec2, double *fsec2, int *isec4, int gridI
int
gridsize
=
(
int
)
gridInqSize
(
gridID
);
bool
gridIsRotated
=
false
;
bool
gridIsCurvilinear
=
false
;
int
gridtype
=
grbGetGridtype
(
gridID
,
gridsize
,
&
gridIsRotated
,
&
gridIsCurvilinear
);
int
gridtype
=
grbGetGridtype
(
&
gridID
,
gridsize
,
&
gridIsRotated
,
&
gridIsCurvilinear
);
switch
(
gridtype
)
{
...
...
src/stream_grb.c
View file @
405e8e93
...
...
@@ -405,14 +405,14 @@ void streamInqGRIBinfo(int streamID, int *intnum, float *fltnum, off_t *bignum)
}
int
grbGetGridtype
(
int
gridID
,
size_t
gridsize
,
bool
*
gridIsRotated
,
bool
*
gridIsCurvilinear
)
int
grbGetGridtype
(
int
*
gridID
,
size_t
gridsize
,
bool
*
gridIsRotated
,
bool
*
gridIsCurvilinear
)
{
int
gridtype
=
gridInqType
(
gridID
);
int
gridtype
=
gridInqType
(
*
gridID
);
if
(
gridtype
==
GRID_GENERIC
)
{
int
xsize
=
(
int
)
gridInqXsize
(
gridID
);
int
ysize
=
(
int
)
gridInqYsize
(
gridID
);
int
xsize
=
(
int
)
gridInqXsize
(
*
gridID
);
int
ysize
=
(
int
)
gridInqYsize
(
*
gridID
);
if
(
(
ysize
==
32
||
ysize
==
48
||
ysize
==
64
||
ysize
==
96
||
ysize
==
160
||
ysize
==
192
||
...
...
@@ -426,17 +426,17 @@ int grbGetGridtype(int gridID, size_t gridsize, bool *gridIsRotated, bool *gridI
{
gridtype
=
GRID_LONLAT
;
}
else
if
(
gridInqXvals
(
gridID
,
NULL
)
&&
gridInqYvals
(
gridID
,
NULL
)
)
else
if
(
gridInqXvals
(
*
gridID
,
NULL
)
&&
gridInqYvals
(
*
gridID
,
NULL
)
)
{
gridtype
=
GRID_LONLAT
;
}
}
else
if
(
gridtype
==
GRID_CURVILINEAR
)
{
int
projID
=
gridInqProj
(
gridID
);
int
projID
=
gridInqProj
(
*
gridID
);
if
(
projID
!=
CDI_UNDEFID
&&
gridInqType
(
projID
)
==
GRID_PROJECTION
)
{
gridID
=
projID
;
*
gridID
=
projID
;
gridtype
=
GRID_PROJECTION
;
}
else
...
...
@@ -454,7 +454,7 @@ int grbGetGridtype(int gridID, size_t gridsize, bool *gridIsRotated, bool *gridI
if
(
gridtype
==
GRID_PROJECTION
)
{
int
projtype
=
gridInqProjType
(
gridID
);
int
projtype
=
gridInqProjType
(
*
gridID
);
if
(
projtype
==
CDI_PROJ_RLL
)
{
gridtype
=
GRID_LONLAT
;
...
...
src/stream_grb.h
View file @
405e8e93
...
...
@@ -31,7 +31,7 @@ int grib2ltypeToZaxisType(int grib_ltype);
int
zaxisTypeToGrib1ltype
(
int
zaxistype
);
int
zaxisTypeToGrib2ltype
(
int
zaxistype
);
int
grbGetGridtype
(
int
gridID
,
size_t
gridsize
,
bool
*
gridIsRotated
,
bool
*
gridIsCurvilinear
);
int
grbGetGridtype
(
int
*
gridID
,
size_t
gridsize
,
bool
*
gridIsRotated
,
bool
*
gridIsCurvilinear
);
struct
cdiGribParamChange
{
...
...
src/stream_gribapi.c
View file @
405e8e93
...
...
@@ -2198,7 +2198,7 @@ void gribapiDefGrid(int editionNumber, grib_handle *gh, int gridID, int comptype
const
size_t
gridsize
=
gridInqSize
(
gridID
);
bool
gridIsRotated
=
false
;
bool
gridIsCurvilinear
=
false
;
const
int
gridtype
=
grbGetGridtype
(
gridID
,
gridsize
,
&
gridIsRotated
,
&
gridIsCurvilinear
);
const
int
gridtype
=
grbGetGridtype
(
&
gridID
,
gridsize
,
&
gridIsRotated
,
&
gridIsCurvilinear
);
bool
lieee
=
(
editionNumber
==
2
&&
(
datatype
==
CDI_DATATYPE_FLT32
||
datatype
==
CDI_DATATYPE_FLT64
));
bool
lspectral
=
(
gridtype
==
GRID_SPECTRAL
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment