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
a42ea933
Commit
a42ea933
authored
Sep 07, 2016
by
Uwe Schulzweida
Browse files
Change length of units string to CDI_MAX_NAME.
parent
5fff637f
Changes
3
Hide whitespace changes
Inline
Side-by-side
src/stream_cgribex.c
View file @
a42ea933
...
...
@@ -1847,6 +1847,7 @@ void isec1DefLevel(int *isec1, int leveltype, int level1, int level2)
static
void
cgribexDefLevel
(
int
*
isec1
,
int
*
isec2
,
double
*
fsec2
,
int
zaxisID
,
int
levelID
)
{
char
units
[
CDI_MAX_NAME
];
static
bool
lwarning_vct
=
true
;
double
level
;
...
...
@@ -1918,7 +1919,6 @@ void cgribexDefLevel(int *isec1, int *isec2, double *fsec2, int zaxisID, int lev
level
=
zaxisInqLevel
(
zaxisID
,
levelID
);
if
(
level
<
0
)
Warning
(
"Pressure level of %f Pa is below zero!"
,
level
);
char
units
[
128
];
zaxisInqUnits
(
zaxisID
,
units
);
if
(
(
units
[
0
]
!=
'P'
)
|
(
units
[
1
]
!=
'a'
)
)
level
*=
100
;
...
...
@@ -1935,7 +1935,6 @@ void cgribexDefLevel(int *isec1, int *isec2, double *fsec2, int zaxisID, int lev
{
level
=
zaxisInqLevel
(
zaxisID
,
levelID
);
char
units
[
128
];
zaxisInqUnits
(
zaxisID
,
units
);
if
(
units
[
1
]
==
'm'
&&
!
units
[
2
]
)
{
...
...
@@ -1959,7 +1958,6 @@ void cgribexDefLevel(int *isec1, int *isec2, double *fsec2, int zaxisID, int lev
}
case
ZAXIS_DEPTH_BELOW_LAND
:
{
char
units
[
128
];
zaxisInqUnits
(
zaxisID
,
units
);
double
factor
;
...
...
src/stream_gribapi.c
View file @
a42ea933
...
...
@@ -2325,6 +2325,7 @@ void grib_verfiy_zaxis(int zaxisID, double sf)
static
void
gribapiDefLevel
(
int
editionNumber
,
grib_handle
*
gh
,
int
zaxisID
,
int
levelID
,
int
gcinit
,
int
proddef_template_num
)
{
char
units
[
CDI_MAX_NAME
];
bool
lbounds
=
false
;
double
dlevel1
=
0
,
dlevel2
=
0
;
...
...
@@ -2372,7 +2373,6 @@ void gribapiDefLevel(int editionNumber, grib_handle *gh, int zaxisID, int levelI
if
(
zaxistype
==
ZAXIS_HEIGHT
)
{
double
sf
=
1
;
char
units
[
128
];
zaxisInqUnits
(
zaxisID
,
units
);
if
(
units
[
1
]
==
'm'
&&
!
units
[
2
]
)
{
...
...
@@ -2420,13 +2420,9 @@ void gribapiDefLevel(int editionNumber, grib_handle *gh, int zaxisID, int levelI
case
ZAXIS_ATMOSPHERE
:
{
if
(
editionNumber
<=
1
)
{
grib1DefLevel
(
gh
,
gcinit
,
grib_ltype
,
lbounds
,
level
,
dlevel1
,
dlevel2
);
}
grib1DefLevel
(
gh
,
gcinit
,
grib_ltype
,
lbounds
,
level
,
dlevel1
,
dlevel2
);
else
{
grib2DefLevel
(
gh
,
gcinit
,
grib_ltype
,
grib_ltype
,
lbounds
,
level
,
dlevel1
,
dlevel2
);
}
grib2DefLevel
(
gh
,
gcinit
,
grib_ltype
,
grib_ltype
,
lbounds
,
level
,
dlevel1
,
dlevel2
);
break
;
}
...
...
@@ -2459,7 +2455,6 @@ void gribapiDefLevel(int editionNumber, grib_handle *gh, int zaxisID, int levelI
{
if
(
level
<
0
)
Warning
(
"Pressure level of %f Pa is below zero!"
,
level
);
char
units
[
128
];
zaxisInqUnits
(
zaxisID
,
units
);
if
(
memcmp
(
units
,
"Pa"
,
2
)
!=
0
)
{
...
...
@@ -2499,7 +2494,6 @@ void gribapiDefLevel(int editionNumber, grib_handle *gh, int zaxisID, int levelI
}
case
ZAXIS_DEPTH_BELOW_LAND
:
{
char
units
[
128
];
zaxisInqUnits
(
zaxisID
,
units
);
double
sf
;
//scalefactor
...
...
src/stream_ieg.c
View file @
a42ea933
...
...
@@ -433,7 +433,7 @@ void iegDefLevel(int *pdb, int *gdb, double *vct, int zaxisID, int levelID)
case
ZAXIS_PRESSURE
:
{
double
dum
;
char
units
[
128
];
char
units
[
CDI_MAX_NAME
];
level
=
zaxisInqLevel
(
zaxisID
,
levelID
);
if
(
level
<
0
)
Warning
(
"pressure level of %f Pa is below 0."
,
level
);
...
...
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