NetCDF  4.4.1
 All Data Structures Files Functions Variables Typedefs Macros Modules Pages
dvarinq.c
Go to the documentation of this file.
1 
8 #include "ncdispatch.h"
9  /* All these functions are part of this named group... */
14 
51 int
52 nc_inq_varid(int ncid, const char *name, int *varidp)
53 {
54  NC* ncp;
55  int stat = NC_check_id(ncid, &ncp);
56  if(stat != NC_NOERR) return stat;
57  return ncp->dispatch->inq_varid(ncid, name, varidp);
58 }
59 
115 int
116 nc_inq_var(int ncid, int varid, char *name, nc_type *xtypep,
117  int *ndimsp, int *dimidsp, int *nattsp)
118 {
119  NC* ncp;
120  int stat = NC_check_id(ncid, &ncp);
121  if(stat != NC_NOERR) return stat;
122  TRACE(nc_inq_var);
123  return ncp->dispatch->inq_var_all(ncid, varid, name, xtypep, ndimsp,
124  dimidsp, nattsp, NULL, NULL, NULL,
125  NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL);
126 }
127 
146 int
147 nc_inq_varname(int ncid, int varid, char *name)
148 {
149  return nc_inq_var(ncid, varid, name, NULL, NULL,
150  NULL, NULL);
151 }
152 
168 int
169 nc_inq_vartype(int ncid, int varid, nc_type *typep)
170 {
171  return nc_inq_var(ncid, varid, NULL, typep, NULL,
172  NULL, NULL);
173 }
174 
191 int
192 nc_inq_varndims(int ncid, int varid, int *ndimsp)
193 {
194  return nc_inq_var(ncid, varid, NULL, NULL, ndimsp, NULL, NULL);
195 }
196 
213 int
214 nc_inq_vardimid(int ncid, int varid, int *dimidsp)
215 {
216  return nc_inq_var(ncid, varid, NULL, NULL, NULL,
217  dimidsp, NULL);
218 }
219 
236 int
237 nc_inq_varnatts(int ncid, int varid, int *nattsp)
238 {
239  if (varid == NC_GLOBAL)
240  return nc_inq_natts(ncid,nattsp);
241  /*else*/
242  return nc_inq_var(ncid, varid, NULL, NULL, NULL, NULL,
243  nattsp);
244 }
245 
246 #ifdef USE_NETCDF4
247 
273 int
274 nc_inq_var_deflate(int ncid, int varid, int *shufflep, int *deflatep,
275  int *deflate_levelp)
276 {
277  NC* ncp;
278  int stat = NC_check_id(ncid,&ncp);
279  if(stat != NC_NOERR) return stat;
280  TRACE(nc_inq_var_deflate);
281  return ncp->dispatch->inq_var_all(
282  ncid, varid,
283  NULL, /*name*/
284  NULL, /*xtypep*/
285  NULL, /*ndimsp*/
286  NULL, /*dimidsp*/
287  NULL, /*nattsp*/
288  shufflep, /*shufflep*/
289  deflatep, /*deflatep*/
290  deflate_levelp, /*deflatelevelp*/
291  NULL, /*fletcher32p*/
292  NULL, /*contiguousp*/
293  NULL, /*chunksizep*/
294  NULL, /*nofillp*/
295  NULL, /*fillvaluep*/
296  NULL, /*endianp*/
297  NULL, /*optionsmaskp*/
298  NULL /*pixelsp*/
299  );
300 }
301 
329 int
330 nc_inq_var_szip(int ncid, int varid, int *options_maskp, int *pixels_per_blockp)
331 {
332  NC* ncp;
333  int stat = NC_check_id(ncid,&ncp);
334  if(stat != NC_NOERR) return stat;
335  TRACE(nc_inq_var_szip);
336  return ncp->dispatch->inq_var_all(
337  ncid, varid,
338  NULL, /*name*/
339  NULL, /*xtypep*/
340  NULL, /*ndimsp*/
341  NULL, /*dimidsp*/
342  NULL, /*nattsp*/
343  NULL, /*shufflep*/
344  NULL, /*deflatep*/
345  NULL, /*deflatelevelp*/
346  NULL, /*fletcher32p*/
347  NULL, /*contiguousp*/
348  NULL, /*chunksizep*/
349  NULL, /*nofillp*/
350  NULL, /*fillvaluep*/
351  NULL, /*endianp*/
352  options_maskp, /*optionsmaskp*/
353  pixels_per_blockp /*pixelsp*/
354  );
355 }
356 
377 int
378 nc_inq_var_fletcher32(int ncid, int varid, int *fletcher32p)
379 {
380  NC* ncp;
381  int stat = NC_check_id(ncid,&ncp);
382  if(stat != NC_NOERR) return stat;
383  TRACE(nc_inq_var_fletcher32);
384  return ncp->dispatch->inq_var_all(
385  ncid, varid,
386  NULL, /*name*/
387  NULL, /*xtypep*/
388  NULL, /*ndimsp*/
389  NULL, /*dimidsp*/
390  NULL, /*nattsp*/
391  NULL, /*shufflep*/
392  NULL, /*deflatep*/
393  NULL, /*deflatelevelp*/
394  fletcher32p, /*fletcher32p*/
395  NULL, /*contiguousp*/
396  NULL, /*chunksizep*/
397  NULL, /*nofillp*/
398  NULL, /*fillvaluep*/
399  NULL, /*endianp*/
400  NULL, /*optionsmaskp*/
401  NULL /*pixelsp*/
402  );
403 }
404 
427 int
428 nc_inq_var_chunking(int ncid, int varid, int *storagep, size_t *chunksizesp)
429 {
430  NC *ncp;
431  int stat = NC_check_id(ncid, &ncp);
432  if(stat != NC_NOERR) return stat;
433  TRACE(nc_inq_var_chunking);
434  return ncp->dispatch->inq_var_all(ncid, varid, NULL, NULL, NULL, NULL,
435  NULL, NULL, NULL, NULL, NULL, storagep,
436  chunksizesp, NULL, NULL, NULL, NULL, NULL);
437 }
438 
462 int
463 nc_inq_var_fill(int ncid, int varid, int *no_fill, void *fill_valuep)
464 {
465  NC* ncp;
466  int stat = NC_check_id(ncid,&ncp);
467  if(stat != NC_NOERR) return stat;
468  TRACE(nc_inq_var_fill);
469  return ncp->dispatch->inq_var_all(
470  ncid, varid,
471  NULL, /*name*/
472  NULL, /*xtypep*/
473  NULL, /*ndimsp*/
474  NULL, /*dimidsp*/
475  NULL, /*nattsp*/
476  NULL, /*shufflep*/
477  NULL, /*deflatep*/
478  NULL, /*deflatelevelp*/
479  NULL, /*fletcher32p*/
480  NULL, /*contiguousp*/
481  NULL, /*chunksizep*/
482  no_fill, /*nofillp*/
483  fill_valuep, /*fillvaluep*/
484  NULL, /*endianp*/
485  NULL, /*optionsmaskp*/
486  NULL /*pixelsp*/
487  );
488 }
489 
511 int
512 nc_inq_var_endian(int ncid, int varid, int *endianp)
513 {
514  NC* ncp;
515  int stat = NC_check_id(ncid,&ncp);
516  if(stat != NC_NOERR) return stat;
517  TRACE(nc_inq_var_endian);
518  return ncp->dispatch->inq_var_all(
519  ncid, varid,
520  NULL, /*name*/
521  NULL, /*xtypep*/
522  NULL, /*ndimsp*/
523  NULL, /*dimidsp*/
524  NULL, /*nattsp*/
525  NULL, /*shufflep*/
526  NULL, /*deflatep*/
527  NULL, /*deflatelevelp*/
528  NULL, /*fletcher32p*/
529  NULL, /*contiguousp*/
530  NULL, /*chunksizep*/
531  NULL, /*nofillp*/
532  NULL, /*fillvaluep*/
533  endianp, /*endianp*/
534  NULL, /*optionsmaskp*/
535  NULL /*pixelsp*/
536  );
537 }
538 
561 int
562 nc_inq_unlimdims(int ncid, int *nunlimdimsp, int *unlimdimidsp)
563 {
564  NC* ncp;
565  int stat = NC_check_id(ncid,&ncp);
566  if(stat != NC_NOERR) return stat;
567  TRACE(nc_inq_unlimdims);
568  return ncp->dispatch->inq_unlimdims(ncid, nunlimdimsp,
569  unlimdimidsp);
570 }
571 
572 #endif /* USE_NETCDF4 */
573 
582 int
583 NC_inq_var_all(int ncid, int varid, char *name, nc_type *xtypep,
584  int *ndimsp, int *dimidsp, int *nattsp,
585  int *shufflep, int *deflatep, int *deflate_levelp,
586  int *fletcher32p, int *contiguousp, size_t *chunksizesp,
587  int *no_fill, void *fill_valuep, int *endiannessp,
588  int *options_maskp, int *pixels_per_blockp)
589 {
590  NC* ncp;
591  int stat = NC_check_id(ncid,&ncp);
592  if(stat != NC_NOERR) return stat;
593  return ncp->dispatch->inq_var_all(
594  ncid, varid, name, xtypep,
595  ndimsp, dimidsp, nattsp,
596  shufflep, deflatep, deflate_levelp, fletcher32p,
597  contiguousp, chunksizesp,
598  no_fill, fill_valuep,
599  endiannessp,
600  options_maskp,
601  pixels_per_blockp);
602 }
603  /* End of named group ...*/
int nc_inq_var_endian(int ncid, int varid, int *endianp)
Find the endianness of a variable.
Definition: dvarinq.c:512
int nc_inq_vardimid(int ncid, int varid, int *dimidsp)
Learn the dimension IDs associated with a variable.
Definition: dvarinq.c:214
int nc_inq_unlimdims(int ncid, int *nunlimdimsp, int *unlimdimidsp)
Return number and list of unlimited dimensions.
Definition: dvarinq.c:562
int NC_inq_var_all(int ncid, int varid, char *name, nc_type *xtypep, int *ndimsp, int *dimidsp, int *nattsp, int *shufflep, int *deflatep, int *deflate_levelp, int *fletcher32p, int *contiguousp, size_t *chunksizesp, int *no_fill, void *fill_valuep, int *endiannessp, int *options_maskp, int *pixels_per_blockp)
Find the ID of a variable, from the name.
Definition: dvarinq.c:583
int nc_inq_var_chunking(int ncid, int varid, int *storagep, size_t *chunksizesp)
This is a wrapper for nc_inq_var_all().
Definition: dvarinq.c:428
int nc_inq_varndims(int ncid, int varid, int *ndimsp)
Learn how many dimensions are associated with a variable.
Definition: dvarinq.c:192
int nc_type
The nc_type type is just an int.
Definition: netcdf.h:28
EXTERNL int nc_inq_natts(int ncid, int *nattsp)
Find number of global or group attributes.
Definition: dattinq.c:149
int nc_inq_var_szip(int ncid, int varid, int *options_maskp, int *pixels_per_blockp)
Learn the szip settings of a variable.
Definition: dvarinq.c:330
int nc_inq_var_fletcher32(int ncid, int varid, int *fletcher32p)
Learn the checksum settings for a variable.
Definition: dvarinq.c:378
int nc_inq_vartype(int ncid, int varid, nc_type *typep)
Learn the type of a variable.
Definition: dvarinq.c:169
int nc_inq_varname(int ncid, int varid, char *name)
Learn the name of a variable.
Definition: dvarinq.c:147
int nc_inq_varid(int ncid, const char *name, int *varidp)
Find the ID of a variable, from the name.
Definition: dvarinq.c:52
int nc_inq_var_deflate(int ncid, int varid, int *shufflep, int *deflatep, int *deflate_levelp)
Learn the storage and deflate settings for a variable.
Definition: dvarinq.c:274
int nc_inq_var(int ncid, int varid, char *name, nc_type *xtypep, int *ndimsp, int *dimidsp, int *nattsp)
Learn about a variable.
Definition: dvarinq.c:116
#define NC_NOERR
No Error.
Definition: netcdf.h:315
int nc_inq_varnatts(int ncid, int varid, int *nattsp)
Learn how many attributes are associated with a variable.
Definition: dvarinq.c:237
#define NC_GLOBAL
Attribute id to put/get a global attribute.
Definition: netcdf.h:244
int nc_inq_var_fill(int ncid, int varid, int *no_fill, void *fill_valuep)
Learn the fill mode of a variable.
Definition: dvarinq.c:463

Return to the Main Unidata NetCDF page.
Generated on Tue Aug 15 2017 19:04:58 for NetCDF. NetCDF is a Unidata library.