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
6bdb6ebd
Commit
6bdb6ebd
authored
Jan 30, 2018
by
Uwe Schulzweida
Browse files
Removed call to gridChangeType().
parent
2eedcc93
Changes
2
Hide whitespace changes
Inline
Side-by-side
src/stream_cgribex.c
View file @
6bdb6ebd
...
...
@@ -1633,17 +1633,14 @@ void cgribexDefGrid(int *isec1, int *isec2, double *fsec2, int *isec4, int gridI
(
xsize
==
2
*
ysize
||
xsize
==
1
)
)
{
gridtype
=
GRID_GAUSSIAN
;
gridChangeType
(
gridID
,
gridtype
);
}
else
if
(
gridsize
==
1
)
{
gridtype
=
GRID_LONLAT
;
gridChangeType
(
gridID
,
gridtype
);
}
else
if
(
gridInqXvals
(
gridID
,
NULL
)
&&
gridInqYvals
(
gridID
,
NULL
)
)
{
gridtype
=
GRID_LONLAT
;
gridChangeType
(
gridID
,
gridtype
);
}
}
else
if
(
gridtype
==
GRID_CURVILINEAR
)
...
...
src/stream_gribapi.c
View file @
6bdb6ebd
...
...
@@ -1892,7 +1892,7 @@ getGribApiCompTypeMsg(int comptype, size_t gridsize)
}
static
void
gribapiDefGrid
(
int
editionNumber
,
grib_handle
*
gh
,
int
gridID
,
int
comptype
,
bool
lieee
,
int
datatype
,
int
shapeOfTheEarth
)
void
gribapiDefGrid
(
int
editionNumber
,
grib_handle
*
gh
,
int
gridID
,
int
comptype
,
bool
lieee
,
int
datatype
)
{
bool
lrotated
=
false
;
bool
lcurvi
=
false
;
...
...
@@ -1912,17 +1912,14 @@ void gribapiDefGrid(int editionNumber, grib_handle *gh, int gridID, int comptype
(
xsize
==
2
*
ysize
||
xsize
==
1
)
)
{
gridtype
=
GRID_GAUSSIAN
;
gridChangeType
(
gridID
,
gridtype
);
}
else
if
(
gridsize
==
1
)
{
gridtype
=
GRID_LONLAT
;
gridChangeType
(
gridID
,
gridtype
);
}
else
if
(
gridInqXvals
(
gridID
,
NULL
)
&&
gridInqYvals
(
gridID
,
NULL
)
)
{
gridtype
=
GRID_LONLAT
;
gridChangeType
(
gridID
,
gridtype
);
}
}
else
if
(
gridtype
==
GRID_CURVILINEAR
)
...
...
@@ -1975,7 +1972,6 @@ void gribapiDefGrid(int editionNumber, grib_handle *gh, int gridID, int comptype
if
(
editionNumber
==
2
)
{
GRIB_CHECK
(
my_grib_set_long
(
gh
,
"numberOfValues"
,
(
long
)
gridsize
),
0
);
GRIB_CHECK
(
my_grib_set_long
(
gh
,
"shapeOfTheEarth"
,
(
long
)
shapeOfTheEarth
),
0
);
}
switch
(
gridtype
)
...
...
@@ -3095,9 +3091,14 @@ size_t gribapiEncode(int varID, int levelID, int vlistID, int gridID, int zaxisI
GRIB_CHECK
(
my_grib_set_long
(
gh
,
"bitsPerValue"
,
bitsPerValue
),
0
);
}
int
shapeOfTheEarth
=
0
;
cdiInqKeyInt
(
vlistID
,
varID
,
CDI_KEY_SHAPEOFTHEEARTH
,
&
shapeOfTheEarth
);
if
(
!
gc
->
init
)
gribapiDefGrid
((
int
)
editionNumber
,
gh
,
gridID
,
comptype
,
lieee
,
datatype
,
shapeOfTheEarth
);
if
(
!
gc
->
init
&&
editionNumber
==
2
)
{
int
shapeOfTheEarth
=
0
;
cdiInqKeyInt
(
vlistID
,
varID
,
CDI_KEY_SHAPEOFTHEEARTH
,
&
shapeOfTheEarth
);
GRIB_CHECK
(
my_grib_set_long
(
gh
,
"shapeOfTheEarth"
,
(
long
)
shapeOfTheEarth
),
0
);
}
if
(
!
gc
->
init
)
gribapiDefGrid
((
int
)
editionNumber
,
gh
,
gridID
,
comptype
,
lieee
,
datatype
);
gribapiDefLevel
((
int
)
editionNumber
,
gh
,
zaxisID
,
levelID
,
gc
->
init
,
productDefinitionTemplate
);
...
...
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