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
65d9b6a7
Commit
65d9b6a7
authored
Sep 18, 2015
by
Uwe Schulzweida
Browse files
added patch from Florian Prill
parent
4e12dce6
Changes
3
Hide whitespace changes
Inline
Side-by-side
src/gribapi.h
View file @
65d9b6a7
...
...
@@ -72,7 +72,10 @@ static inline int my_grib_set_double(grib_handle* h, const char* key, double val
if
(
cdiGribApiDebug
)
fprintf
(
stderr
,
"grib_set_double(
\t
grib_handle* h,
\"
%s
\"
, %f)
\n
"
,
key
,
val
);
return
grib_set_double
(
h
,
key
,
val
);
int
ret_val
=
grib_set_double
(
h
,
key
,
val
);
if
(
ret_val
!=
0
)
fprintf
(
stderr
,
"!!! failed call to grib_set_double(
\t
grib_handle* h,
\"
%s
\"
, %f) !!!
\n
"
,
key
,
val
);
return
ret_val
;
}
static
inline
int
my_grib_set_long
(
grib_handle
*
h
,
const
char
*
key
,
long
val
)
...
...
@@ -80,7 +83,10 @@ static inline int my_grib_set_long(grib_handle* h, const char* key, long val)
if
(
cdiGribApiDebug
)
fprintf
(
stderr
,
"grib_set_long(
\t
grib_handle* h,
\"
%s
\"
, %ld)
\n
"
,
key
,
val
);
return
grib_set_long
(
h
,
key
,
val
);
int
ret_val
=
grib_set_long
(
h
,
key
,
val
);
if
(
ret_val
!=
0
)
fprintf
(
stderr
,
"!!! failed call to grib_set_long(
\t
grib_handle* h,
\"
%s
\"
, %ld) !!!
\n
"
,
key
,
val
);
return
ret_val
;
}
static
inline
int
my_grib_set_string
(
grib_handle
*
h
,
const
char
*
key
,
const
char
*
val
,
size_t
*
length
)
...
...
@@ -88,7 +94,10 @@ static inline int my_grib_set_string(grib_handle* h, const char* key, const char
if
(
cdiGribApiDebug
)
fprintf
(
stderr
,
"grib_set_string(
\t
grib_handle* h,
\"
%s
\"
,
\"
%s
\"
)
\n
"
,
key
,
val
);
return
grib_set_string
(
h
,
key
,
val
,
length
);
int
ret_val
=
grib_set_string
(
h
,
key
,
val
,
length
);
if
(
ret_val
!=
0
)
fprintf
(
stderr
,
"!!! grib_set_string(
\t
grib_handle* h,
\"
%s
\"
,
\"
%s
\"
) !!!
\n
"
,
key
,
val
);
return
ret_val
;
}
static
inline
void
gribHandleDelete
(
void
*
gh
)
...
...
src/stream_gribapi.c
View file @
65d9b6a7
...
...
@@ -2276,7 +2276,7 @@ void grib2DefLevel(grib_handle *gh, int gcinit, long leveltype1, long leveltype2
}
static
void
gribapiDefLevel
(
int
editionNumber
,
grib_handle
*
gh
,
int
param
,
int
zaxisID
,
int
levelID
,
int
gcinit
)
void
gribapiDefLevel
(
int
editionNumber
,
grib_handle
*
gh
,
int
param
,
int
zaxisID
,
int
levelID
,
int
gcinit
,
int
proddef_template_num
)
{
int
lbounds
=
0
;
static
int
warning
=
1
;
...
...
@@ -2326,7 +2326,15 @@ void gribapiDefLevel(int editionNumber, grib_handle *gh, int param, int zaxisID,
}
else
{
grib2DefLevel
(
gh
,
gcinit
,
grib2ltype
,
grib2ltype
,
lbounds
,
level
,
dlevel1
,
dlevel2
);
/* PRODUCT DEFINITION TEMPLATE NUMBER 32:
"Analysis or forecast at a horizontal level or in a horizontal layer at a point
in time for simulate (synthetic) satellite data"
The key/value pairs that are set in "grib2DefLevel" do not exist for this template.
*/
if
(
proddef_template_num
!=
32
)
grib2DefLevel
(
gh
,
gcinit
,
grib2ltype
,
grib2ltype
,
lbounds
,
level
,
dlevel1
,
dlevel2
);
}
break
;
...
...
@@ -2624,7 +2632,7 @@ size_t gribapiEncode(int varID, int levelID, int vlistID, int gridID, int zaxisI
gribapiDefGrid
((
int
)
editionNumber
,
gh
,
gridID
,
comptype
,
lieee
,
datatype
,
nmiss
,
gc
->
init
);
gribapiDefLevel
((
int
)
editionNumber
,
gh
,
param
,
zaxisID
,
levelID
,
gc
->
init
);
gribapiDefLevel
((
int
)
editionNumber
,
gh
,
param
,
zaxisID
,
levelID
,
gc
->
init
,
productDefinitionTemplate
);
vlist_t
*
vlistptr
=
vlist_to_pointer
(
vlistID
);
//if (!gc->init)
...
...
src/varscan.c
View file @
65d9b6a7
...
...
@@ -1281,7 +1281,7 @@ void varDefOptGribDbl(int varID, int tile_index, double dval, const char *keywor
Free
(
vartable
[
varID
].
opt_grib_kvpair
[
idx
].
keyword
);
}
vartable
[
varID
].
opt_grib_kvpair
[
idx
].
data_type
=
t_double
;
vartable
[
varID
].
opt_grib_kvpair
[
idx
].
dbl_val
=
(
int
)
dval
;
vartable
[
varID
].
opt_grib_kvpair
[
idx
].
dbl_val
=
dval
;
vartable
[
varID
].
opt_grib_kvpair
[
idx
].
keyword
=
strdupx
(
keyword
);
vartable
[
varID
].
opt_grib_kvpair
[
idx
].
subtype_index
=
tile_index
;
}
...
...
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