44 int i, ret = NC_NOERR;
47 if ((ret = nc_inq_varids(ncid, &nvars1, NULL)))
49 if (!(varids = malloc(nvars1 *
sizeof(
int))))
51 if ((ret = nc_inq_varids(ncid, NULL, varids)))
55 for (i = 0; i < nvars1; i++)
56 fvarids[i] = varids[i] + 1;
72 int i, ret = NC_NOERR;
75 if ((ret = nc_inq_dimids(ncid, &ndims1, NULL, parent)))
77 if (!(dimids = malloc(ndims1 *
sizeof(
int))))
79 if ((ret = nc_inq_dimids(ncid, NULL, dimids, parent)))
83 for (i = 0; i < ndims1; i++)
84 fdimids[i] = dimids[i] + 1;
98 size_t offset, nc_type field_typeid,
99 int ndims,
int *dim_sizesp)
108 if (!(dim_sizes_f = malloc(ndims *
sizeof(
int))))
112 for (i = 0; i < ndims; i++)
113 dim_sizes_f[i] = dim_sizesp[ndims - i - 1];
116 ret = nc_insert_array_compound(ncid,
typeid, name, offset, field_typeid,
125 nc_inq_compound_field_ndims(
int ncid, nc_type xtype,
int fieldid,
int *ndims)
130 if ((ret = nc_inq_compound_field(ncid, xtype, fieldid, NULL, NULL,
138 size_t *offsetp, nc_type *field_typeidp,
int *ndimsp,
145 if ((ret = nc_inq_compound_field(ncid, xtype, fieldid, NULL, NULL,
146 NULL, &ndims, NULL)))
150 if ((ret = nc_inq_compound_field(ncid, xtype, fieldid, name, offsetp,
151 field_typeidp, ndimsp, dim_sizesp)))
158 for (f = dim_sizesp, b = &dim_sizesp[ndims - 1]; f < b; f++, b--)
170 nc_inq_numgrps(
int ncid,
int *numgrps)
174 if ((ret = nc_inq_grps(ncid, numgrps, NULL)))
180 nc_inq_numtypes(
int ncid,
int *numtypes)
184 if ((ret = nc_inq_typeids(ncid, numtypes, NULL)))
196 #ifndef NC_HAVE_RENAME_GRP 200 printf(
"\n*** Warning - nc_rename_grp not supported in this netCDF version\n");
201 printf(
"*** Update your netCDF C libraries to version 4.3.1 or higher\n");
EXTERNL int nc_insert_array_compound_f(int ncid, int typeid, char *name, size_t offset, nc_type field_typeid, int ndims, int *dim_sizesp)
EXTERNL int nc_inq_compound_field_f(int ncid, nc_type xtype, int fieldid, char *name, size_t *offsetp, nc_type *field_typeidp, int *ndimsp, int *dim_sizesp)
EXTERNL int nc_inq_varids_f(int ncid, int *nvars, int *fvarids)
int nc_rename_grp(int ncid, const char *name)
EXTERNL int nc_inq_dimids_f(int ncid, int *ndims, int *fdimids, int parent)