NetCDF
4.8.1
ncfunc.c
1
16
#include "nc4internal.h"
17
#include "nc4dispatch.h"
18
30
int
31
NC4_inq_format(
int
ncid,
int
*formatp)
32
{
33
NC_FILE_INFO_T *nc4_info;
34
int
retval;
35
36
LOG((2,
"nc_inq_format: ncid 0x%x"
, ncid));
37
38
if
(!formatp)
39
return
NC_NOERR
;
40
41
/* Find the file metadata. */
42
if
((retval = nc4_find_nc_grp_h5(ncid, NULL, NULL, &nc4_info)))
43
return
retval;
44
45
/* Check if classic NC3 rules are in effect for this file. */
46
if
(nc4_info->cmode &
NC_CLASSIC_MODEL
)
47
*formatp =
NC_FORMAT_NETCDF4_CLASSIC
;
48
else
49
*formatp =
NC_FORMAT_NETCDF4
;
50
51
return
NC_NOERR
;
52
}
53
70
int
71
NC4_inq_format_extended(
int
ncid,
int
*formatp,
int
*modep)
72
{
73
NC *nc;
74
int
retval;
75
76
LOG((2,
"%s: ncid 0x%x"
, __func__, ncid));
77
78
if
((retval = nc4_find_nc_grp_h5(ncid, &nc, NULL, NULL)))
79
return
NC_EBADID
;
80
81
if
(modep)
82
*modep = nc->mode|
NC_NETCDF4
;
83
84
if
(formatp)
85
*formatp =
NC_FORMATX_NC_HDF5
;
86
87
return
NC_NOERR
;
88
}
NC_NOERR
#define NC_NOERR
No Error.
Definition:
netcdf.h:333
NC_FORMATX_NC_HDF5
#define NC_FORMATX_NC_HDF5
netCDF-4 subset of HDF5
Definition:
netcdf.h:212
NC_FORMAT_NETCDF4
#define NC_FORMAT_NETCDF4
Format specifier for nc_set_default_format() and returned by nc_inq_format.
Definition:
netcdf.h:181
NC_FORMAT_NETCDF4_CLASSIC
#define NC_FORMAT_NETCDF4_CLASSIC
Format specifier for nc_set_default_format() and returned by nc_inq_format.
Definition:
netcdf.h:182
NC_CLASSIC_MODEL
#define NC_CLASSIC_MODEL
Enforce classic model on netCDF-4.
Definition:
netcdf.h:139
NC_NETCDF4
#define NC_NETCDF4
Use netCDF-4/HDF5 format.
Definition:
netcdf.h:152
NC_EBADID
#define NC_EBADID
Not a netcdf id.
Definition:
netcdf.h:340
Return to the Main Unidata NetCDF page.
Generated on Mon Aug 23 2021 13:28:32 for NetCDF. NetCDF is a
Unidata
library.