NetCDF  4.5.0
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 
465 int
466 nc_inq_var_chunking(int ncid, int varid, int *storagep, size_t *chunksizesp)
467 {
468  NC *ncp;
469  int stat = NC_check_id(ncid, &ncp);
470  if(stat != NC_NOERR) return stat;
471  TRACE(nc_inq_var_chunking);
472  return ncp->dispatch->inq_var_all(ncid, varid, NULL, NULL, NULL, NULL,
473  NULL, NULL, NULL, NULL, NULL, storagep,
474  chunksizesp, NULL, NULL, NULL, NULL, NULL);
475 }
476 
500 int
501 nc_inq_var_fill(int ncid, int varid, int *no_fill, void *fill_valuep)
502 {
503  NC* ncp;
504  int stat = NC_check_id(ncid,&ncp);
505  if(stat != NC_NOERR) return stat;
506  TRACE(nc_inq_var_fill);
507  return ncp->dispatch->inq_var_all(
508  ncid, varid,
509  NULL, /*name*/
510  NULL, /*xtypep*/
511  NULL, /*ndimsp*/
512  NULL, /*dimidsp*/
513  NULL, /*nattsp*/
514  NULL, /*shufflep*/
515  NULL, /*deflatep*/
516  NULL, /*deflatelevelp*/
517  NULL, /*fletcher32p*/
518  NULL, /*contiguousp*/
519  NULL, /*chunksizep*/
520  no_fill, /*nofillp*/
521  fill_valuep, /*fillvaluep*/
522  NULL, /*endianp*/
523  NULL, /*optionsmaskp*/
524  NULL /*pixelsp*/
525  );
526 }
527 
549 int
550 nc_inq_var_endian(int ncid, int varid, int *endianp)
551 {
552  NC* ncp;
553  int stat = NC_check_id(ncid,&ncp);
554  if(stat != NC_NOERR) return stat;
555  TRACE(nc_inq_var_endian);
556  return ncp->dispatch->inq_var_all(
557  ncid, varid,
558  NULL, /*name*/
559  NULL, /*xtypep*/
560  NULL, /*ndimsp*/
561  NULL, /*dimidsp*/
562  NULL, /*nattsp*/
563  NULL, /*shufflep*/
564  NULL, /*deflatep*/
565  NULL, /*deflatelevelp*/
566  NULL, /*fletcher32p*/
567  NULL, /*contiguousp*/
568  NULL, /*chunksizep*/
569  NULL, /*nofillp*/
570  NULL, /*fillvaluep*/
571  endianp, /*endianp*/
572  NULL, /*optionsmaskp*/
573  NULL /*pixelsp*/
574  );
575 }
576 
599 int
600 nc_inq_unlimdims(int ncid, int *nunlimdimsp, int *unlimdimidsp)
601 {
602  NC* ncp;
603  int stat = NC_check_id(ncid,&ncp);
604  if(stat != NC_NOERR) return stat;
605  TRACE(nc_inq_unlimdims);
606  return ncp->dispatch->inq_unlimdims(ncid, nunlimdimsp,
607  unlimdimidsp);
608 }
609 
610 #endif /* USE_NETCDF4 */
611 
642 int
643 NC_inq_var_all(int ncid, int varid, char *name, nc_type *xtypep,
644  int *ndimsp, int *dimidsp, int *nattsp,
645  int *shufflep, int *deflatep, int *deflate_levelp,
646  int *fletcher32p, int *contiguousp, size_t *chunksizesp,
647  int *no_fill, void *fill_valuep, int *endiannessp,
648  int *options_maskp, int *pixels_per_blockp)
649 {
650  NC* ncp;
651  int stat = NC_check_id(ncid,&ncp);
652  if(stat != NC_NOERR) return stat;
653  return ncp->dispatch->inq_var_all(
654  ncid, varid, name, xtypep,
655  ndimsp, dimidsp, nattsp,
656  shufflep, deflatep, deflate_levelp, fletcher32p,
657  contiguousp, chunksizesp,
658  no_fill, fill_valuep,
659  endiannessp,
660  options_maskp,
661  pixels_per_blockp);
662 }
663  /* End of named group ...*/
int nc_inq_var_endian(int ncid, int varid, int *endianp)
Find the endianness of a variable.
Definition: dvarinq.c:550
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:600
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)
Used in libdap2 and libdap4.
Definition: dvarinq.c:643
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:466
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:24
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:308
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:237
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:501

Return to the Main Unidata NetCDF page.
Generated on Thu Oct 26 2017 08:14:39 for NetCDF. NetCDF is a Unidata library.