NetCDF 4.9.3
Loading...
Searching...
No Matches
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. */
9
10#include "ncdispatch.h"
11
64
66
120int
121nc_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
151int
152nc_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
215int
216nc_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
284int
285nc_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
316int
317nc_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
349int
350nc_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
408int
409nc_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
466int
467nc_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
int nc_inq_ndims(int ncid, int *ndimsp)
Find the number of dimensions.
Definition ddim.c:317
int nc_inq_dimlen(int ncid, int dimid, size_t *lenp)
Find the length of a dimension.
Definition ddim.c:467
int nc_inq_dimname(int ncid, int dimid, char *name)
Find out the name of a dimension.
Definition ddim.c:409
int nc_def_dim(int ncid, const char *name, size_t len, int *idp)
Define a new dimension.
Definition ddim.c:121
int nc_rename_dim(int ncid, int dimid, const char *name)
Rename a dimension.
Definition ddim.c:285
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
int nc_inq_unlimdim(int ncid, int *unlimdimidp)
Find the ID of the unlimited dimension.
Definition ddim.c:350
int nc_inq_dimid(int ncid, const char *name, int *idp)
Find the ID of a dimension from the name.
Definition ddim.c:152
#define NC_NOERR
No Error.
Definition netcdf.h:378