Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
mpim-sw
libcdi
Commits
01bb759b
Commit
01bb759b
authored
Aug 26, 2013
by
Uwe Schulzweida
Browse files
gribapiDefLevel: Bug fix for ZAXIS_REFERENCE (Bug #3747)
parent
1ab32a80
Changes
2
Hide whitespace changes
Inline
Side-by-side
ChangeLog
View file @
01bb759b
...
...
@@ -3,6 +3,10 @@
* Version 1.6.2 released
* using CGRIBEX library version 1.6.2
2013-08-26 Uwe Schulzweida <Uwe.Schulzweida@zmaw.de>
* gribapiDefLevel: Bug fix for ZAXIS_REFERENCE (Bug #3747)
2013-08-16 Uwe Schulzweida <Uwe.Schulzweida@zmaw.de>
* netCDF: read reference of an unstructured grid
...
...
src/stream_gribapi.c
View file @
01bb759b
...
...
@@ -2921,21 +2921,63 @@ void gribapiDefLevel(int editionNumber, grib_handle *gh, int param, int zaxisID,
}
case
ZAXIS_REFERENCE
:
{
if
(
editionNumber
<=
1
)
;
// not available
if
(
!
gcinit
)
{
GRIB_CHECK
(
grib_set_long
(
gh
,
"genVertHeightCoords"
,
1
),
0
);
}
if
(
lbounds
)
{
if
(
editionNumber
<=
1
)
;
// not available
else
{
reference
=
zaxisInqReference
(
zaxisID
);
gribapiDefLevelType
(
gh
,
gcinit
,
"typeOfFirstFixedSurface"
,
GRIB2_LTYPE_REFERENCE
);
gribapiDefLevelType
(
gh
,
gcinit
,
"typeOfSecondFixedSurface"
,
GRIB2_LTYPE_REFERENCE
);
GRIB_CHECK
(
grib_set_long
(
gh
,
"NV"
,
6
),
0
);
GRIB_CHECK
(
grib_set_double
(
gh
,
"nlev"
,
(
double
)
zaxisInqSize
(
zaxisID
)
+
1
),
0
);
GRIB_CHECK
(
grib_set_double
(
gh
,
"numberOfVGridUsed"
,
(
double
)
reference
),
0
);
len
=
16
;
if
(
grib_set_bytes
(
gh
,
"uuidOfVGrid"
,
(
unsigned
char
*
)
zaxisInqUUID
(
zaxisID
,
uuid
),
&
len
)
!=
0
)
Warning
(
"Can't write UUID!"
);
GRIB_CHECK
(
grib_set_long
(
gh
,
"topLevel"
,
(
long
)
dlevel1
),
0
);
GRIB_CHECK
(
grib_set_long
(
gh
,
"bottomLevel"
,
(
long
)
dlevel2
),
0
);
}
}
else
{
reference
=
zaxisInqReference
(
zaxisID
);
gribapiDefLevelType
(
gh
,
gcinit
,
"typeOfFirstFixedSurface"
,
GRIB2_LTYPE_REFERENCE
);
GRIB_CHECK
(
grib_set_long
(
gh
,
"NV"
,
6
),
0
);
GRIB_CHECK
(
grib_set_double
(
gh
,
"nlev"
,
(
double
)
zaxisInqSize
(
zaxisID
)),
0
);
GRIB_CHECK
(
grib_set_double
(
gh
,
"numberOfVGridUsed"
,
(
double
)
reference
),
0
);
len
=
16
;
if
(
grib_set_bytes
(
gh
,
"uuidOfVGrid"
,
(
unsigned
char
*
)
zaxisInqUUID
(
zaxisID
,
uuid
),
&
len
)
!=
0
)
Warning
(
"Can't write UUID!"
);
GRIB_CHECK
(
grib_set_double
(
gh
,
"level"
,
level
),
0
);
if
(
editionNumber
<=
1
)
;
// not available
else
{
reference
=
zaxisInqReference
(
zaxisID
);
gribapiDefLevelType
(
gh
,
gcinit
,
"typeOfFirstFixedSurface"
,
GRIB2_LTYPE_REFERENCE
);
GRIB_CHECK
(
grib_set_long
(
gh
,
"NV"
,
6
),
0
);
GRIB_CHECK
(
grib_set_double
(
gh
,
"nlev"
,
(
double
)
zaxisInqSize
(
zaxisID
)),
0
);
GRIB_CHECK
(
grib_set_double
(
gh
,
"numberOfVGridUsed"
,
(
double
)
reference
),
0
);
len
=
16
;
if
(
grib_set_bytes
(
gh
,
"uuidOfVGrid"
,
(
unsigned
char
*
)
zaxisInqUUID
(
zaxisID
,
uuid
),
&
len
)
!=
0
)
Warning
(
"Can't write UUID!"
);
GRIB_CHECK
(
grib_set_double
(
gh
,
"level"
,
level
),
0
);
}
}
// if ( editionNumber <= 1 )
// ; // not available
// else
// {
// reference = zaxisInqReference(zaxisID);
// gribapiDefLevelType(gh, gcinit, "typeOfFirstFixedSurface", GRIB2_LTYPE_REFERENCE);
// GRIB_CHECK(grib_set_long(gh, "NV", 6), 0);
// GRIB_CHECK(grib_set_double(gh, "nlev", (double) zaxisInqSize(zaxisID)), 0);
// GRIB_CHECK(grib_set_double(gh, "numberOfVGridUsed", (double) reference), 0);
// len = 16;
// if (grib_set_bytes(gh, "uuidOfVGrid", (unsigned char *) zaxisInqUUID(zaxisID, uuid), &len) != 0)
// Warning("Can't write UUID!");
// GRIB_CHECK(grib_set_double(gh, "level", level), 0);
// }
break
;
}
case
ZAXIS_GENERIC
:
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new 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