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
d7f75359
Commit
d7f75359
authored
May 13, 2013
by
Uwe Schulzweida
Browse files
added patch from Florian Prill: Lesen von Nicht-Standard GRIB-Keys (bug fix)
parent
168404d8
Changes
3
Hide whitespace changes
Inline
Side-by-side
ChangeLog
View file @
d7f75359
2013-05-13 Uwe Schulzweida <Uwe.Schulzweida@zmaw.de>
* added patch from Florian Prill: Lesen von "Nicht-Standard" GRIB-Keys (bug fix)
2013-04-26 Uwe Schulzweida <Uwe.Schulzweida@zmaw.de>
* added patch from Florian Prill: Lesen von "Nicht-Standard" GRIB-Keys
2013-04-25 Uwe Schulzweida <Uwe.Schulzweida@zmaw.de>
* institutInq: check contents of name and longname (bug fix) [Bug #3419]
...
...
src/varscan.c
View file @
d7f75359
...
...
@@ -587,6 +587,31 @@ void cdi_generate_vars(stream_t *streamptr)
vartable
[
varid
].
ensdata
->
ens_count
,
vartable
[
varid
].
ensdata
->
forecast_init_type
);
/* ---------------------------------- */
/* Local change: 2013-04-23, FP (DWD) */
/* ---------------------------------- */
int
i
;
vlist_t
*
vlistptr
;
vlistptr
=
vlist_to_pointer
(
vlistID
);
for
(
i
=
0
;
i
<
vartable
[
varid
].
opt_grib_int_nentries
;
i
++
)
{
int
idx
=
vlistptr
->
vars
[
varID
].
opt_grib_int_nentries
;
vlistptr
->
vars
[
varID
].
opt_grib_int_nentries
++
;
if
(
idx
>=
MAX_OPT_GRIB_ENTRIES
)
Error
(
"Too many optional keyword/integer value pairs!"
);
vlistptr
->
vars
[
varID
].
opt_grib_int_val
[
idx
]
=
vartable
[
varid
].
opt_grib_int_val
[
idx
];
vlistptr
->
vars
[
varID
].
opt_grib_int_keyword
[
idx
]
=
strdupx
(
vartable
[
varid
].
opt_grib_int_keyword
[
idx
]);
}
for
(
i
=
0
;
i
<
vartable
[
varid
].
opt_grib_dbl_nentries
;
i
++
)
{
int
idx
=
vlistptr
->
vars
[
varID
].
opt_grib_dbl_nentries
;
vlistptr
->
vars
[
varID
].
opt_grib_dbl_nentries
++
;
if
(
idx
>=
MAX_OPT_GRIB_ENTRIES
)
Error
(
"Too many optional keyword/double value pairs!"
);
vlistptr
->
vars
[
varID
].
opt_grib_dbl_val
[
idx
]
=
vartable
[
varid
].
opt_grib_dbl_val
[
idx
];
vlistptr
->
vars
[
varID
].
opt_grib_dbl_keyword
[
idx
]
=
strdupx
(
vartable
[
varid
].
opt_grib_dbl_keyword
[
idx
]);
}
/* note: if the key is not defined, we do not throw an error! */
if
(
cdiDefaultTableID
!=
UNDEFID
)
{
int
pdis
,
pcat
,
pnum
;
...
...
@@ -630,7 +655,7 @@ void cdi_generate_vars(stream_t *streamptr)
for ( levelID = 0; levelID < nlevels; levelID++ )
{
lindex = vartable[varid].levelTable[levelID].lindex;
printf("%d %d %d %d %d\n", varID, levelID,
printf("%d %d %d %d %d\n", varID, levelID,
vartable[varid].levelTable[levelID].lindex,
vartable[varid].levelTable[levelID].recID,
vartable[varid].levelTable[levelID].level1);
...
...
@@ -975,9 +1000,9 @@ void varDefOptGribInt(int varID, long lval, const char *keyword)
void
varDefOptGribDbl
(
int
varID
,
double
dval
,
const
char
*
keyword
)
{
int
idx
=
vartable
[
varID
].
opt_grib_
int
_nentries
;
vartable
[
varID
].
opt_grib_
int
_nentries
++
;
if
(
idx
>=
MAX_OPT_GRIB_ENTRIES
)
Error
(
"Too many optional keyword/
integer
value pairs!"
);
int
idx
=
vartable
[
varID
].
opt_grib_
dbl
_nentries
;
vartable
[
varID
].
opt_grib_
dbl
_nentries
++
;
if
(
idx
>=
MAX_OPT_GRIB_ENTRIES
)
Error
(
"Too many optional keyword/
double
value pairs!"
);
vartable
[
varID
].
opt_grib_dbl_val
[
idx
]
=
dval
;
vartable
[
varID
].
opt_grib_dbl_keyword
[
idx
]
=
strdupx
(
keyword
);
}
...
...
src/vlist_var.c
View file @
d7f75359
...
...
@@ -1968,11 +1968,16 @@ int vlistHasVarKey(int vlistID, int varID, const char* name)
vlistptr
=
vlist_to_pointer
(
vlistID
);
for
(
i
=
0
;
i
<
vlistptr
->
vars
[
varID
].
opt_grib_dbl_nentries
;
i
++
)
if
(
strcmp
(
name
,
vlistptr
->
vars
[
varID
].
opt_grib_dbl_keyword
[
i
])
==
0
)
return
1
;
{
if
(
strcmp
(
name
,
vlistptr
->
vars
[
varID
].
opt_grib_dbl_keyword
[
i
])
==
0
)
return
1
;
}
for
(
i
=
0
;
i
<
vlistptr
->
vars
[
varID
].
opt_grib_int_nentries
;
i
++
)
if
(
strcmp
(
name
,
vlistptr
->
vars
[
varID
].
opt_grib_int_keyword
[
i
])
==
0
)
return
1
;
{
if
(
strcmp
(
name
,
vlistptr
->
vars
[
varID
].
opt_grib_int_keyword
[
i
])
==
0
)
return
1
;
}
#endif
return
0
;
}
...
...
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