37 nc_inq_varids_f(
int ncid,
int *nvars,
int *fvarids)
40 int i, ret = NC_NOERR;
43 if ((ret = nc_inq_varids(ncid, &nvars1, NULL)))
45 if (!(varids = malloc(nvars1 *
sizeof(
int))))
47 if ((ret = nc_inq_varids(ncid, NULL, varids)))
51 for (i = 0; i < nvars1; i++)
52 fvarids[i] = varids[i] + 1;
65 nc_inq_dimids_f(
int ncid,
int *ndims,
int *fdimids,
int parent)
68 int i, ret = NC_NOERR;
71 if ((ret = nc_inq_dimids(ncid, &ndims1, NULL, parent)))
73 if (!(dimids = malloc(ndims1 *
sizeof(
int))))
75 if ((ret = nc_inq_dimids(ncid, NULL, dimids, parent)))
79 for (i = 0; i < ndims1; i++)
80 fdimids[i] = dimids[i] + 1;
93 nc_insert_array_compound_f(
int ncid,
int typeid,
char *name,
94 size_t offset, nc_type field_typeid,
95 int ndims,
int *dim_sizesp)
104 if (!(dim_sizes_f = malloc(ndims *
sizeof(
int))))
108 for (i = 0; i < ndims; i++)
109 dim_sizes_f[i] = dim_sizesp[ndims - i - 1];
112 ret = nc_insert_array_compound(ncid,
typeid, name, offset, field_typeid,
121 nc_inq_compound_field_f(
int ncid, nc_type xtype,
int fieldid,
char *name,
122 size_t *offsetp, nc_type *field_typeidp,
int *ndimsp,
129 if ((ret = nc_inq_compound_field(ncid, xtype, fieldid, NULL, NULL,
130 NULL, &ndims, NULL)))
134 if ((ret = nc_inq_compound_field(ncid, xtype, fieldid, name, offsetp,
135 field_typeidp, ndimsp, dim_sizesp)))
142 for (f = dim_sizesp, b = &dim_sizesp[ndims - 1]; f < b; f++, b--)
160 #ifndef NC_HAVE_RENAME_GRP
162 nc_rename_grp(
int ncid,
const char *name)
164 printf(
"\n*** Warning - nc_rename_grp not supported in this netCDF version\n");
165 printf(
"*** Update your netCDF C libraries to version 4.3.1 or higher\n");