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
a78196a1
Commit
a78196a1
authored
Oct 17, 2017
by
Uwe Schulzweida
Browse files
Check units of pressure levels.
parent
ed243d7c
Changes
2
Hide whitespace changes
Inline
Side-by-side
src/stream_cgribex.c
View file @
a78196a1
...
...
@@ -1964,7 +1964,7 @@ void cgribexDefLevel(int *isec1, int *isec2, double *fsec2, int zaxisID, int lev
if
(
level
<
0
)
Warning
(
"Pressure level of %f Pa is below zero!"
,
level
);
zaxisInqUnits
(
zaxisID
,
units
);
if
(
(
units
[
0
]
!=
'P'
)
|
(
units
[
1
]
!=
'a'
)
)
level
*=
100
;
if
(
units
[
0
]
&&
(
units
[
0
]
!=
'P'
)
|
(
units
[
1
]
!=
'a'
)
)
level
*=
100
;
double
dum
;
if
(
level
<
32768
&&
(
level
<
100
||
modf
(
level
/
100
,
&
dum
)
>
0
)
)
...
...
src/stream_gribapi.c
View file @
a78196a1
...
...
@@ -2483,7 +2483,7 @@ void gribapiDefLevel(int editionNumber, grib_handle *gh, int zaxisID, int levelI
if
(
level
<
0
)
Warning
(
"Pressure level of %f Pa is below zero!"
,
level
);
zaxisInqUnits
(
zaxisID
,
units
);
if
(
memcmp
(
units
,
"Pa"
,
2
)
!=
0
)
if
(
units
[
0
]
&&
(
units
[
0
]
!=
'P'
)
|
(
units
[
1
]
!=
'a'
)
)
{
level
*=
100
;
dlevel1
*=
100
;
...
...
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