NetCDF  4.8.1
ddim.c
Go to the documentation of this file.
1 /* Copyright 2018 University Corporation for Atmospheric
2  Research/Unidata. See COPYRIGHT file for more info. */
10 #include "ncdispatch.h"
11 
120 int
121 nc_def_dim(int ncid, const char *name, size_t len, int *idp)
122 {
123  NC* ncp;
124  int stat = NC_check_id(ncid, &ncp);
125  if(stat != NC_NOERR) return stat;
126  TRACE(nc_def_dim);
127  return ncp->dispatch->def_dim(ncid, name, len, idp);
128 }
129 
151 int
152 nc_inq_dimid(int ncid, const char *name, int *idp)
153 {
154  NC* ncp;
155  int stat = NC_check_id(ncid, &ncp);
156  if(stat != NC_NOERR) return stat;
157  TRACE(nc_inq_dimid);
158  return ncp->dispatch->inq_dimid(ncid,name,idp);
159 }
160 
215 int
216 nc_inq_dim(int ncid, int dimid, char *name, size_t *lenp)
217 {
218  NC* ncp;
219  int stat = NC_check_id(ncid, &ncp);
220  if(stat != NC_NOERR) return stat;
221  TRACE(nc_inq_dim);
222  return ncp->dispatch->inq_dim(ncid,dimid,name,lenp);
223 }
224 
284 int
285 nc_rename_dim(int ncid, int dimid, const char *name)
286 {
287  NC* ncp;
288  int stat = NC_check_id(ncid, &ncp);
289  if(stat != NC_NOERR) return stat;
290  TRACE(nc_rename_dim);
291  return ncp->dispatch->rename_dim(ncid,dimid,name);
292 }
293 
316 int
317 nc_inq_ndims(int ncid, int *ndimsp)
318 {
319  NC* ncp;
320  int stat = NC_check_id(ncid, &ncp);
321  if(stat != NC_NOERR) return stat;
322  if(ndimsp == NULL) return NC_NOERR;
323  TRACE(nc_inq_ndims);
324  return ncp->dispatch->inq(ncid,ndimsp,NULL,NULL,NULL);
325 }
326 
349 int
350 nc_inq_unlimdim(int ncid, int *unlimdimidp)
351 {
352  NC* ncp;
353  int stat = NC_check_id(ncid, &ncp);
354  if(stat != NC_NOERR) return stat;
355  TRACE(nc_inq_unlimdim);
356  return ncp->dispatch->inq_unlimdim(ncid,unlimdimidp);
357 }
358 
408 int
409 nc_inq_dimname(int ncid, int dimid, char *name)
410 {
411  NC* ncp;
412  int stat = NC_check_id(ncid, &ncp);
413  if(stat != NC_NOERR) return stat;
414  if(name == NULL) return NC_NOERR;
415  TRACE(nc_inq_dimname);
416  return ncp->dispatch->inq_dim(ncid,dimid,name,NULL);
417 }
418 
466 int
467 nc_inq_dimlen(int ncid, int dimid, size_t *lenp)
468 {
469  NC* ncp;
470  int stat = NC_check_id(ncid, &ncp);
471  if(stat != NC_NOERR) return stat;
472  if(lenp == NULL) return NC_NOERR;
473  TRACE(nc_inq_dimlen);
474  return ncp->dispatch->inq_dim(ncid,dimid,NULL,lenp);
475 }
476 
NC_NOERR
#define NC_NOERR
No Error.
Definition: netcdf.h:333
nc_def_dim
int nc_def_dim(int ncid, const char *name, size_t len, int *idp)
Define a new dimension.
Definition: ddim.c:121
nc_inq_ndims
int nc_inq_ndims(int ncid, int *ndimsp)
Find the number of dimensions.
Definition: ddim.c:317
nc_inq_dim
int nc_inq_dim(int ncid, int dimid, char *name, size_t *lenp)
Find the name and length of a dimension.
Definition: ddim.c:216
nc_inq_dimlen
int nc_inq_dimlen(int ncid, int dimid, size_t *lenp)
Find the length of a dimension.
Definition: ddim.c:467
nc_inq_dimid
int nc_inq_dimid(int ncid, const char *name, int *idp)
Find the ID of a dimension from the name.
Definition: ddim.c:152
nc_inq_unlimdim
int nc_inq_unlimdim(int ncid, int *unlimdimidp)
Find the ID of the unlimited dimension.
Definition: ddim.c:350
nc_rename_dim
int nc_rename_dim(int ncid, int dimid, const char *name)
Rename a dimension.
Definition: ddim.c:285
nc_inq_dimname
int nc_inq_dimname(int ncid, int dimid, char *name)
Find out the name of a dimension.
Definition: ddim.c:409