NetCDF  4.6.3
 All Data Structures Files Functions Variables Typedefs Macros Modules Pages
ncfunc.c
1 
17 #include "nc4internal.h"
18 #include "nc4dispatch.h"
19 
31 int
32 NC4_inq_format(int ncid, int *formatp)
33 {
34  NC_FILE_INFO_T *nc4_info;
35  int retval;
36 
37  LOG((2, "nc_inq_format: ncid 0x%x", ncid));
38 
39  if (!formatp)
40  return NC_NOERR;
41 
42  /* Find the file metadata. */
43  if ((retval = nc4_find_nc_grp_h5(ncid, NULL, NULL, &nc4_info)))
44  return retval;
45 
46  /* Check if classic NC3 rules are in effect for this file. */
47  if (nc4_info->cmode & NC_CLASSIC_MODEL)
48  *formatp = NC_FORMAT_NETCDF4_CLASSIC;
49  else
50  *formatp = NC_FORMAT_NETCDF4;
51 
52  return NC_NOERR;
53 }
54 
71 int
72 NC4_inq_format_extended(int ncid, int *formatp, int *modep)
73 {
74  NC *nc;
75  int retval;
76 
77  LOG((2, "%s: ncid 0x%x", __func__, ncid));
78 
79  if ((retval = nc4_find_nc_grp_h5(ncid, &nc, NULL, NULL)))
80  return NC_EBADID;
81 
82  if(modep)
83  *modep = nc->mode|NC_NETCDF4;
84 
85  if (formatp)
86  *formatp = NC_FORMATX_NC_HDF5;
87 
88  return NC_NOERR;
89 }
#define NC_CLASSIC_MODEL
Enforce classic model on netCDF-4.
Definition: netcdf.h:138
#define NC_NETCDF4
Use netCDF-4/HDF5 format.
Definition: netcdf.h:151
#define NC_FORMAT_NETCDF4_CLASSIC
Format specifier for nc_set_default_format() and returned by nc_inq_format.
Definition: netcdf.h:183
#define NC_FORMATX_NC_HDF5
netCDF-4 subset of HDF5
Definition: netcdf.h:210
#define NC_EBADID
Not a netcdf id.
Definition: netcdf.h:330
#define NC_FORMAT_NETCDF4
Format specifier for nc_set_default_format() and returned by nc_inq_format.
Definition: netcdf.h:182
#define NC_NOERR
No Error.
Definition: netcdf.h:323

Return to the Main Unidata NetCDF page.
Generated on Sat Apr 6 2019 08:19:00 for NetCDF. NetCDF is a Unidata library.