NetCDF  4.6.1
ncfunc.c
1 
17 #include "nc4internal.h"
18 #include "nc4dispatch.h"
19 
29 int
30 NC4_set_base_pe(int ncid, int pe)
31 {
32  return NC_ENOTNC3;
33 }
34 
45 int
46 NC4_inq_base_pe(int ncid, int *pe)
47 {
48  return NC_ENOTNC3;
49 }
50 
62 int
63 NC4_inq_format(int ncid, int *formatp)
64 {
65  NC *nc;
66  NC_HDF5_FILE_INFO_T* nc4_info;
67 
68  LOG((2, "nc_inq_format: ncid 0x%x", ncid));
69 
70  if (!formatp)
71  return NC_NOERR;
72 
73  /* Find the file metadata. */
74  if (!(nc = nc4_find_nc_file(ncid,&nc4_info)))
75  return NC_EBADID;
76 
77  /* Otherwise, this is a netcdf-4 file. Check if classic NC3 rules
78  * are in effect for this file. */
79  if (nc4_info->cmode & NC_CLASSIC_MODEL)
80  *formatp = NC_FORMAT_NETCDF4_CLASSIC;
81  else
82  *formatp = NC_FORMAT_NETCDF4;
83 
84  return NC_NOERR;
85 }
86 
103 int
104 NC4_inq_format_extended(int ncid, int *formatp, int *modep)
105 {
106  NC *nc;
107  NC_HDF5_FILE_INFO_T* h5;
108 
109  LOG((2, "%s: ncid 0x%x", __func__, ncid));
110 
111  /* Find the file metadata. */
112  if (!(nc = nc4_find_nc_file(ncid,&h5)))
113  return NC_EBADID;
114 
115  if(modep) *modep = (nc->mode|NC_NETCDF4);
116 
117  if (formatp)
118  *formatp = NC_FORMATX_NC_HDF5;
119 
120  return NC_NOERR;
121 }
#define NC_ENOTNC3
Attempting netcdf-3 operation on netcdf-4 file.
Definition: netcdf.h:439
#define NC_CLASSIC_MODEL
Enforce classic model on netCDF-4.
Definition: netcdf.h:135
#define NC_NETCDF4
Use netCDF-4/HDF5 format.
Definition: netcdf.h:148
#define NC_FORMAT_NETCDF4_CLASSIC
Format specifier for nc_set_default_format() and returned by nc_inq_format.
Definition: netcdf.h:177
#define NC_FORMATX_NC_HDF5
netCDF-4 subset of HDF5
Definition: netcdf.h:204
#define NC_EBADID
Not a netcdf id.
Definition: netcdf.h:322
#define NC_FORMAT_NETCDF4
Format specifier for nc_set_default_format() and returned by nc_inq_format.
Definition: netcdf.h:176
#define NC_NOERR
No Error.
Definition: netcdf.h:315

Return to the Main Unidata NetCDF page.
Generated on Wed Aug 1 2018 05:36:48 for NetCDF. NetCDF is a Unidata library.