NetCDF 4.9.3
Loading...
Searching...
No Matches
ncfunc.c
1
15
16#include "nc4internal.h"
17#include "nc4dispatch.h"
18
30int
31NC4_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)
48 else
49 *formatp = NC_FORMAT_NETCDF4;
50
51 return NC_NOERR;
52}
53
70int
71NC4_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}
#define NC_NETCDF4
Use netCDF-4/HDF5 format.
Definition netcdf.h:162
#define NC_FORMAT_NETCDF4_CLASSIC
Format specifier for nc_set_default_format() and returned by nc_inq_format.
Definition netcdf.h:196
#define NC_FORMAT_NETCDF4
Format specifier for nc_set_default_format() and returned by nc_inq_format.
Definition netcdf.h:195
#define NC_FORMATX_NC_HDF5
netCDF-4 subset of HDF5
Definition netcdf.h:226
#define NC_CLASSIC_MODEL
Enforce classic model on netCDF-4.
Definition netcdf.h:149
#define NC_NOERR
No Error.
Definition netcdf.h:378
#define NC_EBADID
Not a netcdf id.
Definition netcdf.h:385