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
ee6ea6ec
Commit
ee6ea6ec
authored
Mar 12, 2018
by
Uwe Schulzweida
Browse files
cdfInqContents: added check for NetCDF4 groups.
parent
60e4c54c
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/stream_cdf_i.c
View file @
ee6ea6ec
...
...
@@ -4,8 +4,6 @@
#ifdef HAVE_LIBNETCDF
//#define TEST_GROUPS 1
#include
<ctype.h>
#include
<limits.h>
...
...
@@ -3717,31 +3715,30 @@ int cdfInqContents(stream_t *streamptr)
ncdim_t
*
ncdims
=
ndims
?
(
ncdim_t
*
)
Malloc
((
size_t
)
ndims
*
sizeof
(
ncdim_t
))
:
NULL
;
init_ncdims
(
ndims
,
ncdims
);
#if defined (TEST_GROUPS)
#if defined (HAVE_NETCDF4)
#ifdef HAVE_NETCDF4
if
(
format
==
NC_FORMAT_NETCDF4
)
{
int
ncid
;
int
numgrps
;
int
numgrps
=
0
;
int
ncids
[
NC_MAX_VARS
];
char
name
1
[
CDI_MAX_NAME
];
char
g
name
[
CDI_MAX_NAME
];
int
gndims
,
gnvars
,
gngatts
,
gunlimdimid
;
nc_inq_grps
(
fileID
,
&
numgrps
,
ncids
);
for
(
int
i
=
0
;
i
<
numgrps
;
++
i
)
{
ncid
=
ncids
[
i
];
nc_inq_grpname
(
ncid
,
name
1
);
nc_inq_grpname
(
ncid
,
g
name
);
cdf_inq
(
ncid
,
&
gndims
,
&
gnvars
,
&
gngatts
,
&
gunlimdimid
);
if
(
CDI_Debug
)
Message
(
"%s: ndims %d, nvars %d, ngatts %d"
,
name
1
,
gndims
,
gnvars
,
gngatts
);
Message
(
"%s: ndims %d, nvars %d, ngatts %d"
,
g
name
,
gndims
,
gnvars
,
gngatts
);
if
(
gndims
==
0
)
{
}
}
if
(
numgrps
)
Warning
(
"NetCDF4 groups not supported! Found %d root group%s."
,
numgrps
,
numgrps
>
1
?
"s"
:
""
);
}
#endif
#endif
if
(
nvars
==
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