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
c09a5510
Commit
c09a5510
authored
Feb 03, 2017
by
Uwe Schulzweida
Browse files
GRIB: Check Curvilinear grid for projection.
parent
67820411
Changes
2
Hide whitespace changes
Inline
Side-by-side
src/stream_cgribex.c
View file @
c09a5510
...
...
@@ -1636,14 +1636,23 @@ void cgribexDefGrid(int *isec1, int *isec2, double *fsec2, int *isec4, int gridI
}
else
if
(
gridtype
==
GRID_CURVILINEAR
)
{
static
bool
lwarning
=
true
;
if
(
lwarning
&&
gridInqSize
(
gridID
)
>
1
)
{
lwarning
=
false
;
Warning
(
"Curvilinear grids are unsupported in GRIB1! Created wrong Grid Description Section!"
);
}
gridtype
=
GRID_LONLAT
;
lcurvi
=
true
;
int
projID
=
gridInqProj
(
gridID
);
if
(
projID
!=
CDI_UNDEFID
&&
gridInqType
(
projID
)
==
GRID_PROJECTION
)
{
gridID
=
projID
;
gridtype
=
GRID_PROJECTION
;
}
else
{
static
bool
lwarning
=
true
;
if
(
lwarning
&&
gridInqSize
(
gridID
)
>
1
)
{
lwarning
=
false
;
Warning
(
"Curvilinear grid is unsupported in GRIB1! Created wrong Grid Description Section!"
);
}
lcurvi
=
true
;
gridtype
=
GRID_LONLAT
;
}
}
if
(
gridtype
==
GRID_PROJECTION
&&
gridInqProjType
(
gridID
)
==
CDI_PROJ_RLL
)
...
...
src/stream_gribapi.c
View file @
c09a5510
...
...
@@ -20,10 +20,10 @@
#include "subtype.h"
#
include "cgribex.h"
/* gribGetSize, gribRead, gribGetZip, GRIB1_LTYPE_99 */
#
include "gribapi.h"
#include "cgribex.h"
/* gribGetSize, gribRead, gribGetZip, GRIB1_LTYPE_99 */
#include "gribapi.h"
#
include <grib_api.h>
#include <grib_api.h>
extern
int
cdiInventoryMode
;
...
...
@@ -1918,14 +1918,23 @@ void gribapiDefGrid(int editionNumber, grib_handle *gh, int gridID, int comptype
}
else
if
(
gridtype
==
GRID_CURVILINEAR
)
{
static
bool
lwarning
=
true
;
if
(
lwarning
&&
gridsize
>
1
)
{
lwarning
=
false
;
Warning
(
"Curvilinear grids are unsupported in GRIB format! Created wrong Grid Description Section!"
);
}
gridtype
=
GRID_LONLAT
;
lcurvi
=
true
;
int
projID
=
gridInqProj
(
gridID
);
if
(
projID
!=
CDI_UNDEFID
&&
gridInqType
(
projID
)
==
GRID_PROJECTION
)
{
gridID
=
projID
;
gridtype
=
GRID_PROJECTION
;
}
else
{
static
bool
lwarning
=
true
;
if
(
lwarning
&&
gridsize
>
1
)
{
lwarning
=
false
;
Warning
(
"Curvilinear grid is unsupported in GRIB format! Created wrong Grid Description Section!"
);
}
lcurvi
=
true
;
gridtype
=
GRID_LONLAT
;
}
}
if
(
gridtype
==
GRID_PROJECTION
&&
gridInqProjType
(
gridID
)
==
CDI_PROJ_RLL
)
...
...
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