Loading...
Searching...
No Matches
ncfunc.c
#include "nc4internal.h"
#include "nc4dispatch.h"
int
NC4_inq_format(int ncid, int *formatp)
{
NC_FILE_INFO_T *nc4_info;
int retval;
LOG((2, "nc_inq_format: ncid 0x%x", ncid));
if (!formatp)
return NC_NOERR;
/* Find the file metadata. */
if ((retval = nc4_find_nc_grp_h5(ncid, NULL, NULL, &nc4_info)))
return retval;
/* Check if classic NC3 rules are in effect for this file. */
if (nc4_info->cmode & NC_CLASSIC_MODEL)
*formatp = NC_FORMAT_NETCDF4_CLASSIC;
else
*formatp = NC_FORMAT_NETCDF4;
return NC_NOERR;
}
int
NC4_inq_format_extended(int ncid, int *formatp, int *modep)
{
NC *nc;
int retval;
LOG((2, "%s: ncid 0x%x", __func__, ncid));
if ((retval = nc4_find_nc_grp_h5(ncid, &nc, NULL, NULL)))
return NC_EBADID;
if(modep)
*modep = nc->mode|NC_NETCDF4;
if (formatp)
*formatp = NC_FORMATX_NC_HDF5;
return NC_NOERR;
}
NC_NETCDF4
#define NC_NETCDF4
Use netCDF-4/HDF5 format.
Definition netcdf.h:179
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:217
NC_FORMAT_NETCDF4
#define NC_FORMAT_NETCDF4
Format specifier for nc_set_default_format() and returned by nc_inq_format.
Definition netcdf.h:216
NC_FORMATX_NC_HDF5
#define NC_FORMATX_NC_HDF5
netCDF-4 subset of HDF5
Definition netcdf.h:247
NC_CLASSIC_MODEL
#define NC_CLASSIC_MODEL
Enforce classic model on netCDF-4.
Definition netcdf.h:166
NC_NOERR
#define NC_NOERR
No Error.
Definition netcdf.h:417
NC_EBADID
#define NC_EBADID
Not a netcdf id.
Definition netcdf.h:424