NetCDF  4.4.1.1
dvarget.c
Go to the documentation of this file.
1 
9 #include "ncdispatch.h"
10 
11 #undef VARS_USES_VARM
12 #ifndef VARS_USES_VARM
13 
18 struct GETodometer {
19  int rank;
20  size_t index[NC_MAX_VAR_DIMS];
21  size_t start[NC_MAX_VAR_DIMS];
22  size_t edges[NC_MAX_VAR_DIMS];
23  ptrdiff_t stride[NC_MAX_VAR_DIMS];
24  size_t stop[NC_MAX_VAR_DIMS];
25 };
26 
27 
31 static void
32 odom_init(struct GETodometer* odom,
33  int rank,
34  const size_t* start, const size_t* edges, const ptrdiff_t* stride)
35 {
36  int i;
37  memset(odom,0,sizeof(struct GETodometer));
38  odom->rank = rank;
39  assert(odom->rank <= NC_MAX_VAR_DIMS);
40  for(i=0;i<odom->rank;i++) {
41  odom->start[i] = (start != NULL ? start[i] : 0);
42  odom->edges[i] = (edges != NULL ? edges[i] : 1);
43  odom->stride[i] = (stride != NULL ? stride[i] : 1);
44  odom->stop[i] = odom->start[i] + (odom->edges[i]*((size_t)odom->stride[i]));
45  odom->index[i] = odom->start[i];
46  }
47 }
48 
52 static int
53 odom_more(struct GETodometer* odom)
54 {
55  return (odom->index[0] < odom->stop[0]);
56 }
57 
61 static int
62 odom_next(struct GETodometer* odom)
63 {
64  int i;
65  if(odom->rank == 0) return 0;
66  for(i=odom->rank-1;i>=0;i--) {
67  odom->index[i] += (size_t)odom->stride[i];
68  if(odom->index[i] < odom->stop[i]) break;
69  if(i == 0) return 0; /* leave the 0th entry if it overflows*/
70  odom->index[i] = odom->start[i]; /* reset this position*/
71  }
72  return 1;
73 }
74 #endif
75 
80 int
81 NC_get_vara(int ncid, int varid,
82  const size_t *start, const size_t *edges,
83  void *value, nc_type memtype)
84 {
85  NC* ncp;
86  int stat = NC_check_id(ncid, &ncp);
87  if(stat != NC_NOERR) return stat;
88 #ifdef USE_NETCDF4
89  if(memtype >= NC_FIRSTUSERTYPEID) memtype = NC_NAT;
90 #endif
91 
92  if(edges == NULL) {
93  size_t shape[NC_MAX_VAR_DIMS];
94  int ndims;
95  stat = nc_inq_varndims(ncid, varid, &ndims);
96  if(stat != NC_NOERR) return stat;
97  stat = NC_getshape(ncid,varid,ndims,shape);
98  if(stat != NC_NOERR) return stat;
99  stat = ncp->dispatch->get_vara(ncid,varid,start,shape,value,memtype);
100  } else
101  stat = ncp->dispatch->get_vara(ncid,varid,start,edges,value,memtype);
102  return stat;
103 }
104 
108 static int
109 NC_get_var(int ncid, int varid, void *value, nc_type memtype)
110 {
111  int ndims;
112  size_t shape[NC_MAX_VAR_DIMS];
113  int stat = nc_inq_varndims(ncid,varid, &ndims);
114  if(stat) return stat;
115  stat = NC_getshape(ncid,varid, ndims, shape);
116  if(stat) return stat;
117  return NC_get_vara(ncid, varid, NC_coord_zero, shape, value, memtype);
118 }
119 
124 int
125 NCDEFAULT_get_vars(int ncid, int varid, const size_t * start,
126  const size_t * edges, const ptrdiff_t * stride,
127  void *value0, nc_type memtype)
128 {
129 #ifdef VARS_USES_VARM
130  NC* ncp;
131  int stat = NC_check_id(ncid, &ncp);
132 
133  if(stat != NC_NOERR) return stat;
134  return ncp->dispatch->get_varm(ncid,varid,start,edges,stride,NULL,value0,memtype);
135 #else
136  /* Rebuilt get_vars code to simplify and avoid use of get_varm */
137 
138  int status = NC_NOERR;
139  int i,simplestride,isrecvar;
140  int rank;
141  struct GETodometer odom;
142  nc_type vartype = NC_NAT;
143  NC* ncp;
144  int memtypelen;
145  size_t vartypelen;
146  char* value = (char*)value0;
147  size_t numrecs;
148  size_t varshape[NC_MAX_VAR_DIMS];
149  size_t mystart[NC_MAX_VAR_DIMS];
150  size_t myedges[NC_MAX_VAR_DIMS];
151  ptrdiff_t mystride[NC_MAX_VAR_DIMS];
152  char *memptr = NULL;
153 
154  status = NC_check_id (ncid, &ncp);
155  if(status != NC_NOERR) return status;
156 
157  status = nc_inq_vartype(ncid, varid, &vartype);
158  if(status != NC_NOERR) return status;
159 
160  if(memtype == NC_NAT) memtype = vartype;
161 
162  /* compute the variable type size */
163  status = nc_inq_type(ncid,vartype,NULL,&vartypelen);
164  if(status != NC_NOERR) return status;
165 
166  if(memtype > NC_MAX_ATOMIC_TYPE)
167  memtypelen = (int)vartypelen;
168  else
169  memtypelen = nctypelen(memtype);
170 
171  /* Check gross internal/external type compatibility */
172  if(vartype != memtype) {
173  /* If !atomic, the two types must be the same */
174  if(vartype > NC_MAX_ATOMIC_TYPE
175  || memtype > NC_MAX_ATOMIC_TYPE)
176  return NC_EBADTYPE;
177  /* ok, the types differ but both are atomic */
178  if(memtype == NC_CHAR || vartype == NC_CHAR)
179  return NC_ECHAR;
180  }
181 
182  /* Get the variable rank */
183  status = nc_inq_varndims(ncid, varid, &rank);
184  if(status != NC_NOERR) return status;
185 
186  /* Get variable dimension sizes */
187  isrecvar = NC_is_recvar(ncid,varid,&numrecs);
188  NC_getshape(ncid,varid,rank,varshape);
189 
190  /* Optimize out using various checks */
191  if (rank == 0) {
192  /*
193  * The variable is a scalar; consequently,
194  * there s only one thing to get and only one place to put it.
195  * (Why was I called?)
196  */
197  size_t edge1[1] = {1};
198  return NC_get_vara(ncid, varid, start, edge1, value, memtype);
199  }
200 
201  /* Do various checks and fixups on start/edges/stride */
202  simplestride = 1; /* assume so */
203  for(i=0;i<rank;i++) {
204  size_t dimlen;
205  mystart[i] = (start == NULL ? 0 : start[i]);
206  if(edges == NULL) {
207  if(i == 0 && isrecvar)
208  myedges[i] = numrecs - start[i];
209  else
210  myedges[i] = varshape[i] - mystart[i];
211  } else
212  myedges[i] = edges[i];
213  if(myedges[i] == 0)
214  return NC_NOERR; /* cannot read anything */
215  mystride[i] = (stride == NULL ? 1 : stride[i]);
216  if(mystride[i] <= 0
217  /* cast needed for braindead systems with signed size_t */
218  || ((unsigned long) mystride[i] >= X_INT_MAX))
219  return NC_ESTRIDE;
220  if(mystride[i] != 1) simplestride = 0;
221  /* illegal value checks */
222  dimlen = (i == 0 && isrecvar ? numrecs : varshape[i]);
223  /* mystart is unsigned, never < 0 */
224  if(mystart[i] >= dimlen)
225  return NC_EINVALCOORDS;
226  /* myedges is unsigned, never < 0 */
227  if(mystart[i] + myedges[i] > dimlen)
228  return NC_EEDGE;
229  }
230  if(simplestride) {
231  return NC_get_vara(ncid, varid, mystart, myedges, value, memtype);
232  }
233 
234  /* memptr indicates where to store the next value */
235  memptr = value;
236 
237  odom_init(&odom,rank,mystart,myedges,mystride);
238 
239  /* walk the odometer to extract values */
240  while(odom_more(&odom)) {
241  int localstatus = NC_NOERR;
242  /* Read a single value */
243  localstatus = NC_get_vara(ncid,varid,odom.index,nc_sizevector1,memptr,memtype);
244  /* So it turns out that when get_varm is used, all errors are
245  delayed and ERANGE will be overwritten by more serious errors.
246  */
247  if(localstatus != NC_NOERR) {
248  if(status == NC_NOERR || localstatus != NC_ERANGE)
249  status = localstatus;
250  }
251  memptr += memtypelen;
252  odom_next(&odom);
253  }
254  return status;
255 #endif
256 }
257 
261 static int
262 NC_get_var1(int ncid, int varid, const size_t *coord, void* value,
263  nc_type memtype)
264 {
265  return NC_get_vara(ncid, varid, coord, NC_coord_one, value, memtype);
266 }
267 
271 int
272 NCDEFAULT_get_varm(int ncid, int varid, const size_t *start,
273  const size_t *edges, const ptrdiff_t *stride,
274  const ptrdiff_t *imapp, void *value0, nc_type memtype)
275 {
276  int status = NC_NOERR;
277  nc_type vartype = NC_NAT;
278  int varndims,maxidim;
279  NC* ncp;
280  int memtypelen;
281  char* value = (char*)value0;
282 
283  status = NC_check_id (ncid, &ncp);
284  if(status != NC_NOERR) return status;
285 
286 /*
287  if(NC_indef(ncp)) return NC_EINDEFINE;
288 */
289 
290  status = nc_inq_vartype(ncid, varid, &vartype);
291  if(status != NC_NOERR) return status;
292  /* Check that this is an atomic type */
293  if(vartype > NC_MAX_ATOMIC_TYPE)
294  return NC_EMAPTYPE;
295 
296  status = nc_inq_varndims(ncid, varid, &varndims);
297  if(status != NC_NOERR) return status;
298 
299  if(memtype == NC_NAT) {
300  memtype = vartype;
301  }
302 
303  if(memtype == NC_CHAR && vartype != NC_CHAR)
304  return NC_ECHAR;
305  else if(memtype != NC_CHAR && vartype == NC_CHAR)
306  return NC_ECHAR;
307 
308  memtypelen = nctypelen(memtype);
309 
310  maxidim = (int) varndims - 1;
311 
312  if (maxidim < 0)
313  {
314  /*
315  * The variable is a scalar; consequently,
316  * there s only one thing to get and only one place to put it.
317  * (Why was I called?)
318  */
319  size_t edge1[1] = {1};
320  return NC_get_vara(ncid, varid, start, edge1, value, memtype);
321  }
322 
323  /*
324  * else
325  * The variable is an array.
326  */
327  {
328  int idim;
329  size_t *mystart = NULL;
330  size_t *myedges;
331  size_t *iocount; /* count vector */
332  size_t *stop; /* stop indexes */
333  size_t *length; /* edge lengths in bytes */
334  ptrdiff_t *mystride;
335  ptrdiff_t *mymap;
336  size_t varshape[NC_MAX_VAR_DIMS];
337  int isrecvar;
338  size_t numrecs;
339 
340  /* Compute some dimension related values */
341  isrecvar = NC_is_recvar(ncid,varid,&numrecs);
342  NC_getshape(ncid,varid,varndims,varshape);
343 
344  /*
345  * Verify stride argument; also see if stride is all ones
346  */
347  if(stride != NULL) {
348  int stride1 = 1;
349  for (idim = 0; idim <= maxidim; ++idim)
350  {
351  if (stride[idim] == 0
352  /* cast needed for braindead systems with signed size_t */
353  || ((unsigned long) stride[idim] >= X_INT_MAX))
354  {
355  return NC_ESTRIDE;
356  }
357  if(stride[idim] != 1) stride1 = 0;
358  }
359  /* If stride1 is true, and there is no imap
360  then call get_vara directly.
361  */
362  if(stride1 && imapp == NULL) {
363  return NC_get_vara(ncid, varid, start, edges, value, memtype);
364  }
365  }
366 
367  /* assert(sizeof(ptrdiff_t) >= sizeof(size_t)); */
368  /* Allocate space for mystart,mystride,mymap etc.all at once */
369  mystart = (size_t *)calloc((size_t)(varndims * 7), sizeof(ptrdiff_t));
370  if(mystart == NULL) return NC_ENOMEM;
371  myedges = mystart + varndims;
372  iocount = myedges + varndims;
373  stop = iocount + varndims;
374  length = stop + varndims;
375  mystride = (ptrdiff_t *)(length + varndims);
376  mymap = mystride + varndims;
377 
378  /*
379  * Initialize I/O parameters.
380  */
381  for (idim = maxidim; idim >= 0; --idim)
382  {
383  mystart[idim] = start != NULL
384  ? start[idim]
385  : 0;
386 
387  if (edges != NULL && edges[idim] == 0)
388  {
389  status = NC_NOERR; /* read/write no data */
390  goto done;
391  }
392 
393 #ifdef COMPLEX
394  myedges[idim] = edges != NULL
395  ? edges[idim]
396  : idim == 0 && isrecvar
397  ? numrecs - mystart[idim]
398  : varshape[idim] - mystart[idim];
399 #else
400  if(edges != NULL)
401  myedges[idim] = edges[idim];
402  else if (idim == 0 && isrecvar)
403  myedges[idim] = numrecs - mystart[idim];
404  else
405  myedges[idim] = varshape[idim] - mystart[idim];
406 #endif
407 
408  mystride[idim] = stride != NULL
409  ? stride[idim]
410  : 1;
411 
412  /* Remember: in netCDF-2 imapp is byte oriented, not index oriented
413  * Starting from netCDF-3, imapp is index oriented */
414 #ifdef COMPLEX
415  mymap[idim] = (imapp != NULL
416  ? imapp[idim]
417  : (idim == maxidim ? 1
418  : mymap[idim + 1] * (ptrdiff_t) myedges[idim + 1]));
419 #else
420  if(imapp != NULL)
421  mymap[idim] = imapp[idim];
422  else if (idim == maxidim)
423  mymap[idim] = 1;
424  else
425  mymap[idim] =
426  mymap[idim + 1] * (ptrdiff_t) myedges[idim + 1];
427 #endif
428  iocount[idim] = 1;
429  length[idim] = ((size_t)mymap[idim]) * myedges[idim];
430  stop[idim] = (mystart[idim] + myedges[idim] * (size_t)mystride[idim]);
431  }
432 
433  /*
434  * Check start, edges
435  */
436  for (idim = maxidim; idim >= 0; --idim)
437  {
438  size_t dimlen =
439  idim == 0 && isrecvar
440  ? numrecs
441  : varshape[idim];
442  if (mystart[idim] >= dimlen)
443  {
444  status = NC_EINVALCOORDS;
445  goto done;
446  }
447 
448  if (mystart[idim] + myedges[idim] > dimlen)
449  {
450  status = NC_EEDGE;
451  goto done;
452  }
453 
454  }
455 
456 
457  /* Lower body */
458  /*
459  * As an optimization, adjust I/O parameters when the fastest
460  * dimension has unity stride both externally and internally.
461  * In this case, the user could have called a simpler routine
462  * (i.e. ncvar$1()
463  */
464  if (mystride[maxidim] == 1
465  && mymap[maxidim] == 1)
466  {
467  iocount[maxidim] = myedges[maxidim];
468  mystride[maxidim] = (ptrdiff_t) myedges[maxidim];
469  mymap[maxidim] = (ptrdiff_t) length[maxidim];
470  }
471 
472  /*
473  * Perform I/O. Exit when done.
474  */
475  for (;;)
476  {
477  /* TODO: */
478  int lstatus = NC_get_vara(ncid, varid, mystart, iocount,
479  value, memtype);
480  if (lstatus != NC_NOERR) {
481  if(status == NC_NOERR || lstatus != NC_ERANGE)
482  status = lstatus;
483  }
484  /*
485  * The following code permutes through the variable s
486  * external start-index space and it s internal address
487  * space. At the UPC, this algorithm is commonly
488  * called "odometer code".
489  */
490  idim = maxidim;
491  carry:
492  value += (((int)mymap[idim]) * memtypelen);
493  mystart[idim] += (size_t)mystride[idim];
494  if (mystart[idim] == stop[idim])
495  {
496  size_t l = (length[idim] * (size_t)memtypelen);
497  value -= l;
498  mystart[idim] = start[idim];
499  if (--idim < 0)
500  break; /* normal return */
501  goto carry;
502  }
503  } /* I/O loop */
504  done:
505  free(mystart);
506  } /* variable is array */
507  return status;
508 }
509 
513 static int
514 NC_get_vars(int ncid, int varid, const size_t *start,
515  const size_t *edges, const ptrdiff_t *stride, void *value,
516  nc_type memtype)
517 {
518  NC* ncp;
519  int stat = NC_check_id(ncid, &ncp);
520 
521  if(stat != NC_NOERR) return stat;
522 #ifdef USE_NETCDF4
523  if(memtype >= NC_FIRSTUSERTYPEID) memtype = NC_NAT;
524 #endif
525  return ncp->dispatch->get_vars(ncid,varid,start,edges,stride,value,memtype);
526 }
527 
532 static int
533 NC_get_varm(int ncid, int varid, const size_t *start,
534  const size_t *edges, const ptrdiff_t *stride, const ptrdiff_t* map,
535  void *value, nc_type memtype)
536 {
537  NC* ncp;
538  int stat = NC_check_id(ncid, &ncp);
539 
540  if(stat != NC_NOERR) return stat;
541 #ifdef USE_NETCDF4
542  if(memtype >= NC_FIRSTUSERTYPEID) memtype = NC_NAT;
543 #endif
544  return ncp->dispatch->get_varm(ncid,varid,start,edges,stride,map,value,memtype);
545 }
546  /* All these functions are part of this named group... */
551 
626 int
627 nc_get_vara(int ncid, int varid, const size_t *startp,
628  const size_t *countp, void *ip)
629 {
630  NC* ncp = NULL;
631  nc_type xtype = NC_NAT;
632  int stat = NC_check_id(ncid, &ncp);
633  if(stat != NC_NOERR) return stat;
634  stat = nc_inq_vartype(ncid, varid, &xtype);
635  if(stat != NC_NOERR) return stat;
636  return NC_get_vara(ncid, varid, startp, countp, ip, xtype);
637 }
638 
639 int
640 nc_get_vara_text(int ncid, int varid, const size_t *startp,
641  const size_t *countp, char *ip)
642 {
643  NC* ncp;
644  int stat = NC_check_id(ncid, &ncp);
645  if(stat != NC_NOERR) return stat;
646  return NC_get_vara(ncid, varid, startp, countp,
647  (void *)ip, NC_CHAR);
648 }
649 
650 int
651 nc_get_vara_schar(int ncid, int varid, const size_t *startp,
652  const size_t *countp, signed char *ip)
653 {
654  NC* ncp;
655  int stat = NC_check_id(ncid, &ncp);
656  if(stat != NC_NOERR) return stat;
657  return NC_get_vara(ncid, varid, startp, countp,
658  (void *)ip, NC_BYTE);
659 }
660 
661 int
662 nc_get_vara_uchar(int ncid, int varid, const size_t *startp,
663  const size_t *countp, unsigned char *ip)
664 {
665  NC* ncp;
666  int stat = NC_check_id(ncid, &ncp);
667  if(stat != NC_NOERR) return stat;
668  return NC_get_vara(ncid, varid, startp, countp,
669  (void *)ip, T_uchar);
670 }
671 
672 int
673 nc_get_vara_short(int ncid, int varid, const size_t *startp,
674  const size_t *countp, short *ip)
675 {
676  NC* ncp;
677  int stat = NC_check_id(ncid, &ncp);
678  if(stat != NC_NOERR) return stat;
679  return NC_get_vara(ncid, varid, startp, countp,
680  (void *)ip, NC_SHORT);
681 }
682 
683 int
684 nc_get_vara_int(int ncid, int varid,
685  const size_t *startp, const size_t *countp, int *ip)
686 {
687  NC* ncp;
688  int stat = NC_check_id(ncid, &ncp);
689  if(stat != NC_NOERR) return stat;
690  return NC_get_vara(ncid,varid,startp,countp, (void *)ip,NC_INT);
691 }
692 
693 int
694 nc_get_vara_long(int ncid, int varid,
695  const size_t *startp, const size_t *countp, long *ip)
696 {
697  NC* ncp;
698  int stat = NC_check_id(ncid, &ncp);
699  if(stat != NC_NOERR) return stat;
700  return NC_get_vara(ncid,varid,startp,countp, (void *)ip,T_long);
701 }
702 
703 int
704 nc_get_vara_float(int ncid, int varid,
705  const size_t *startp, const size_t *countp, float *ip)
706 {
707  NC* ncp;
708  int stat = NC_check_id(ncid, &ncp);
709  if(stat != NC_NOERR) return stat;
710  return NC_get_vara(ncid,varid,startp,countp, (void *)ip,T_float);
711 }
712 
713 
714 int
715 nc_get_vara_double(int ncid, int varid, const size_t *startp,
716  const size_t *countp, double *ip)
717 {
718  NC* ncp;
719  int stat = NC_check_id(ncid, &ncp);
720  if(stat != NC_NOERR) return stat;
721  return NC_get_vara(ncid,varid,startp,countp, (void *)ip,T_double);
722 }
723 
724 int
725 nc_get_vara_ubyte(int ncid, int varid,
726  const size_t *startp, const size_t *countp, unsigned char *ip)
727 {
728  NC* ncp;
729  int stat = NC_check_id(ncid, &ncp);
730  if(stat != NC_NOERR) return stat;
731  return NC_get_vara(ncid,varid,startp,countp, (void *)ip,T_ubyte);
732 }
733 
734 int
735 nc_get_vara_ushort(int ncid, int varid,
736  const size_t *startp, const size_t *countp, unsigned short *ip)
737 {
738  NC* ncp;
739  int stat = NC_check_id(ncid, &ncp);
740  if(stat != NC_NOERR) return stat;
741  return NC_get_vara(ncid,varid,startp,countp, (void *)ip,T_ushort);
742 }
743 
744 int
745 nc_get_vara_uint(int ncid, int varid,
746  const size_t *startp, const size_t *countp, unsigned int *ip)
747 {
748  NC* ncp;
749  int stat = NC_check_id(ncid, &ncp);
750  if(stat != NC_NOERR) return stat;
751  return NC_get_vara(ncid,varid,startp,countp, (void *)ip,T_uint);
752 }
753 
754 int
755 nc_get_vara_longlong(int ncid, int varid,
756  const size_t *startp, const size_t *countp, long long *ip)
757 {
758  NC* ncp;
759  int stat = NC_check_id(ncid, &ncp);
760  if(stat != NC_NOERR) return stat;
761  return NC_get_vara(ncid,varid,startp,countp, (void *)ip,T_longlong);
762 }
763 
764 int
765 nc_get_vara_ulonglong(int ncid, int varid,
766  const size_t *startp, const size_t *countp, unsigned long long *ip)
767 {
768  NC* ncp;
769  int stat = NC_check_id(ncid, &ncp);
770  if(stat != NC_NOERR) return stat;
771  return NC_get_vara(ncid,varid,startp,countp, (void *)ip,NC_UINT64);
772 }
773 
774 #ifdef USE_NETCDF4
775 int
776 nc_get_vara_string(int ncid, int varid,
777  const size_t *startp, const size_t *countp, char* *ip)
778 {
779  NC* ncp;
780  int stat = NC_check_id(ncid, &ncp);
781  if(stat != NC_NOERR) return stat;
782  return NC_get_vara(ncid,varid,startp,countp, (void *)ip,NC_STRING);
783 }
784 
785 #endif /*USE_NETCDF4*/
786 
822 int
823 nc_get_var1(int ncid, int varid, const size_t *indexp, void *ip)
824 {
825  return NC_get_var1(ncid, varid, indexp, ip, NC_NAT);
826 }
827 
828 int
829 nc_get_var1_text(int ncid, int varid, const size_t *indexp, char *ip)
830 {
831  NC* ncp;
832  int stat = NC_check_id(ncid, &ncp);
833  if(stat != NC_NOERR) return stat;
834  return NC_get_var1(ncid, varid, indexp, (void *)ip, NC_CHAR);
835 }
836 
837 int
838 nc_get_var1_schar(int ncid, int varid, const size_t *indexp, signed char *ip)
839 {
840  NC* ncp;
841  int stat = NC_check_id(ncid, &ncp);
842  if(stat != NC_NOERR) return stat;
843  return NC_get_var1(ncid, varid, indexp, (void *)ip, NC_BYTE);
844 }
845 
846 int
847 nc_get_var1_uchar(int ncid, int varid, const size_t *indexp, unsigned char *ip)
848 {
849  NC* ncp;
850  int stat = NC_check_id(ncid, &ncp);
851  if(stat != NC_NOERR) return stat;
852  return NC_get_var1(ncid, varid, indexp, (void *)ip, NC_UBYTE);
853 }
854 
855 int
856 nc_get_var1_short(int ncid, int varid, const size_t *indexp, short *ip)
857 {
858  NC* ncp;
859  int stat = NC_check_id(ncid, &ncp);
860  if(stat != NC_NOERR) return stat;
861  return NC_get_var1(ncid, varid, indexp, (void *)ip, NC_SHORT);
862 }
863 
864 int
865 nc_get_var1_int(int ncid, int varid, const size_t *indexp, int *ip)
866 {
867  NC* ncp;
868  int stat = NC_check_id(ncid, &ncp);
869  if(stat != NC_NOERR) return stat;
870  return NC_get_var1(ncid, varid, indexp, (void *)ip, NC_INT);
871 }
872 
873 int
874 nc_get_var1_long(int ncid, int varid, const size_t *indexp,
875  long *ip)
876 {
877  NC* ncp;
878  int stat = NC_check_id(ncid, &ncp);
879  if(stat != NC_NOERR) return stat;
880  return NC_get_var1(ncid, varid, indexp, (void *)ip, longtype);
881 }
882 
883 int
884 nc_get_var1_float(int ncid, int varid, const size_t *indexp,
885  float *ip)
886 {
887  NC* ncp;
888  int stat = NC_check_id(ncid, &ncp);
889  if(stat != NC_NOERR) return stat;
890  return NC_get_var1(ncid, varid, indexp, (void *)ip, NC_FLOAT);
891 }
892 
893 int
894 nc_get_var1_double(int ncid, int varid, const size_t *indexp,
895  double *ip)
896 {
897  NC* ncp;
898  int stat = NC_check_id(ncid, &ncp);
899  if(stat != NC_NOERR) return stat;
900  return NC_get_var1(ncid, varid, indexp, (void *)ip, NC_DOUBLE);
901 }
902 
903 int
904 nc_get_var1_ubyte(int ncid, int varid, const size_t *indexp,
905  unsigned char *ip)
906 {
907  NC* ncp;
908  int stat = NC_check_id(ncid, &ncp);
909  if(stat != NC_NOERR) return stat;
910  return NC_get_var1(ncid, varid, indexp, (void *)ip, NC_UBYTE);
911 }
912 
913 int
914 nc_get_var1_ushort(int ncid, int varid, const size_t *indexp,
915  unsigned short *ip)
916 {
917  NC* ncp;
918  int stat = NC_check_id(ncid, &ncp);
919  if(stat != NC_NOERR) return stat;
920  return NC_get_var1(ncid, varid, indexp, (void *)ip, NC_USHORT);
921 }
922 
923 int
924 nc_get_var1_uint(int ncid, int varid, const size_t *indexp,
925  unsigned int *ip)
926 {
927  NC* ncp;
928  int stat = NC_check_id(ncid, &ncp);
929  if(stat != NC_NOERR) return stat;
930  return NC_get_var1(ncid, varid, indexp, (void *)ip, NC_UINT);
931 }
932 
933 int
934 nc_get_var1_longlong(int ncid, int varid, const size_t *indexp,
935  long long *ip)
936 {
937  NC* ncp;
938  int stat = NC_check_id(ncid, &ncp);
939  if(stat != NC_NOERR) return stat;
940  return NC_get_var1(ncid, varid, indexp, (void *)ip, NC_INT64);
941 }
942 
943 int
944 nc_get_var1_ulonglong(int ncid, int varid, const size_t *indexp,
945  unsigned long long *ip)
946 {
947  NC* ncp;
948  int stat = NC_check_id(ncid, &ncp);
949  if(stat != NC_NOERR) return stat;
950  return NC_get_var1(ncid, varid, indexp, (void *)ip, NC_UINT64);
951 }
952 
953 #ifdef USE_NETCDF4
954 int
955 nc_get_var1_string(int ncid, int varid, const size_t *indexp, char* *ip)
956 {
957  NC* ncp;
958  int stat = NC_check_id(ncid, &ncp);
959  if(stat != NC_NOERR) return stat;
960  return NC_get_var1(ncid, varid, indexp, (void *)ip, NC_STRING);
961 }
962 #endif /*USE_NETCDF4*/
963 
1008 int
1009 nc_get_var(int ncid, int varid, void *ip)
1010 {
1011  return NC_get_var(ncid, varid, ip, NC_NAT);
1012 }
1013 
1014 int
1015 nc_get_var_text(int ncid, int varid, char *ip)
1016 {
1017  NC *ncp;
1018  int stat = NC_check_id(ncid, &ncp);
1019  if(stat != NC_NOERR) return stat;
1020  return NC_get_var(ncid, varid, (void *)ip, NC_CHAR);
1021 }
1022 
1023 int
1024 nc_get_var_schar(int ncid, int varid, signed char *ip)
1025 {
1026  NC *ncp;
1027  int stat = NC_check_id(ncid, &ncp);
1028  if(stat != NC_NOERR) return stat;
1029  return NC_get_var(ncid, varid, (void *)ip, NC_BYTE);
1030 }
1031 
1032 int
1033 nc_get_var_uchar(int ncid, int varid, unsigned char *ip)
1034 {
1035  NC *ncp;
1036  int stat = NC_check_id(ncid, &ncp);
1037  if(stat != NC_NOERR) return stat;
1038  return NC_get_var(ncid,varid, (void *)ip, NC_UBYTE);
1039 }
1040 
1041 int
1042 nc_get_var_short(int ncid, int varid, short *ip)
1043 {
1044  NC* ncp;
1045  int stat = NC_check_id(ncid, &ncp);
1046  if(stat != NC_NOERR) return stat;
1047  return NC_get_var(ncid, varid, (void *)ip, NC_SHORT);
1048 }
1049 
1050 int
1051 nc_get_var_int(int ncid, int varid, int *ip)
1052 {
1053  NC* ncp;
1054  int stat = NC_check_id(ncid, &ncp);
1055  if(stat != NC_NOERR) return stat;
1056  return NC_get_var(ncid,varid, (void *)ip, NC_INT);
1057 }
1058 
1059 int
1060 nc_get_var_long(int ncid, int varid, long *ip)
1061 {
1062  NC* ncp;
1063  int stat = NC_check_id(ncid, &ncp);
1064  if(stat != NC_NOERR) return stat;
1065  return NC_get_var(ncid,varid, (void *)ip, longtype);
1066 }
1067 
1068 int
1069 nc_get_var_float(int ncid, int varid, float *ip)
1070 {
1071  NC* ncp;
1072  int stat = NC_check_id(ncid, &ncp);
1073  if(stat != NC_NOERR) return stat;
1074  return NC_get_var(ncid,varid, (void *)ip, NC_FLOAT);
1075 }
1076 
1077 int
1078 nc_get_var_double(int ncid, int varid, double *ip)
1079 {
1080  NC* ncp;
1081  int stat = NC_check_id(ncid, &ncp);
1082  if(stat != NC_NOERR) return stat;
1083  return NC_get_var(ncid,varid, (void *)ip, NC_DOUBLE);
1084 }
1085 
1086 int
1087 nc_get_var_ubyte(int ncid, int varid, unsigned char *ip)
1088 {
1089  NC* ncp;
1090  int stat = NC_check_id(ncid, &ncp);
1091  if(stat != NC_NOERR) return stat;
1092  return NC_get_var(ncid,varid, (void *)ip, NC_UBYTE);
1093 }
1094 
1095 int
1096 nc_get_var_ushort(int ncid, int varid, unsigned short *ip)
1097 {
1098  NC* ncp;
1099  int stat = NC_check_id(ncid, &ncp);
1100  if(stat != NC_NOERR) return stat;
1101  return NC_get_var(ncid,varid, (void *)ip, NC_USHORT);
1102 }
1103 
1104 int
1105 nc_get_var_uint(int ncid, int varid, unsigned int *ip)
1106 {
1107  NC* ncp;
1108  int stat = NC_check_id(ncid, &ncp);
1109  if(stat != NC_NOERR) return stat;
1110  return NC_get_var(ncid,varid, (void *)ip, NC_UINT);
1111 }
1112 
1113 int
1114 nc_get_var_longlong(int ncid, int varid, long long *ip)
1115 {
1116  NC* ncp;
1117  int stat = NC_check_id(ncid, &ncp);
1118  if(stat != NC_NOERR) return stat;
1119  return NC_get_var(ncid,varid, (void *)ip, NC_INT64);
1120 }
1121 
1122 int
1123 nc_get_var_ulonglong(int ncid, int varid, unsigned long long *ip)
1124 {
1125  NC* ncp;
1126  int stat = NC_check_id(ncid, &ncp);
1127  if(stat != NC_NOERR) return stat;
1128  return NC_get_var(ncid,varid, (void *)ip,NC_UINT64);
1129 }
1130 
1131 #ifdef USE_NETCDF4
1132 int
1133 nc_get_var_string(int ncid, int varid, char* *ip)
1134 {
1135  NC* ncp;
1136  int stat = NC_check_id(ncid, &ncp);
1137  if(stat != NC_NOERR) return stat;
1138  return NC_get_var(ncid,varid, (void *)ip,NC_STRING);
1139 }
1140 #endif /*USE_NETCDF4*/
1141 
1183 int
1184 nc_get_vars (int ncid, int varid, const size_t * startp,
1185  const size_t * countp, const ptrdiff_t * stridep,
1186  void *ip)
1187 {
1188  NC* ncp;
1189  int stat = NC_NOERR;
1190 
1191  if ((stat = NC_check_id(ncid, &ncp)))
1192  return stat;
1193  return ncp->dispatch->get_vars(ncid, varid, startp, countp, stridep,
1194  ip, NC_NAT);
1195 }
1196 
1197 int
1198 nc_get_vars_text(int ncid, int varid, const size_t *startp,
1199  const size_t *countp, const ptrdiff_t * stridep,
1200  char *ip)
1201 {
1202  NC* ncp;
1203  int stat = NC_check_id(ncid, &ncp);
1204  if(stat != NC_NOERR) return stat;
1205  return NC_get_vars(ncid,varid,startp, countp, stridep,
1206  (void *)ip, NC_CHAR);
1207 }
1208 
1209 int
1210 nc_get_vars_schar(int ncid, int varid, const size_t *startp,
1211  const size_t *countp, const ptrdiff_t * stridep,
1212  signed char *ip)
1213 {
1214  NC* ncp;
1215  int stat = NC_check_id(ncid, &ncp);
1216  if(stat != NC_NOERR) return stat;
1217  return NC_get_vars(ncid,varid,startp, countp, stridep,
1218  (void *)ip, NC_BYTE);
1219 }
1220 
1221 int
1222 nc_get_vars_uchar(int ncid, int varid, const size_t *startp,
1223  const size_t *countp, const ptrdiff_t * stridep,
1224  unsigned char *ip)
1225 {
1226  NC* ncp;
1227  int stat = NC_check_id(ncid, &ncp);
1228  if(stat != NC_NOERR) return stat;
1229  return NC_get_vars(ncid,varid,startp, countp, stridep,
1230  (void *)ip, T_uchar);
1231 }
1232 
1233 int
1234 nc_get_vars_short(int ncid, int varid, const size_t *startp,
1235  const size_t *countp, const ptrdiff_t *stridep,
1236  short *ip)
1237 {
1238  NC* ncp;
1239  int stat = NC_check_id(ncid, &ncp);
1240  if(stat != NC_NOERR) return stat;
1241  return NC_get_vars(ncid,varid,startp, countp, stridep,
1242  (void *)ip, NC_SHORT);
1243 }
1244 
1245 int
1246 nc_get_vars_int(int ncid, int varid, const size_t *startp,
1247  const size_t *countp, const ptrdiff_t * stridep,
1248  int *ip)
1249 {
1250  NC* ncp;
1251  int stat = NC_check_id(ncid, &ncp);
1252  if(stat != NC_NOERR) return stat;
1253  return NC_get_vars(ncid,varid,startp, countp, stridep,
1254  (void *)ip, NC_INT);
1255 }
1256 
1257 int
1258 nc_get_vars_long(int ncid, int varid, const size_t *startp,
1259  const size_t *countp, const ptrdiff_t * stridep,
1260  long *ip)
1261 {
1262  NC* ncp;
1263  int stat = NC_check_id(ncid, &ncp);
1264  if(stat != NC_NOERR) return stat;
1265  return NC_get_vars(ncid,varid,startp, countp, stridep,
1266  (void *)ip, T_long);
1267 }
1268 
1269 int
1270 nc_get_vars_float(int ncid, int varid, const size_t *startp,
1271  const size_t *countp, const ptrdiff_t * stridep,
1272  float *ip)
1273 {
1274  NC* ncp;
1275  int stat = NC_check_id(ncid, &ncp);
1276  if(stat != NC_NOERR) return stat;
1277  return NC_get_vars(ncid,varid,startp, countp, stridep,
1278  (void *)ip, T_float);
1279 }
1280 
1281 int
1282 nc_get_vars_double(int ncid, int varid, const size_t *startp,
1283  const size_t *countp, const ptrdiff_t * stridep,
1284  double *ip)
1285 {
1286  NC* ncp;
1287  int stat = NC_check_id(ncid, &ncp);
1288  if(stat != NC_NOERR) return stat;
1289  return NC_get_vars(ncid,varid,startp, countp, stridep,
1290  (void *)ip, T_double);
1291 }
1292 
1293 int
1294 nc_get_vars_ubyte(int ncid, int varid, const size_t *startp,
1295  const size_t *countp, const ptrdiff_t * stridep,
1296  unsigned char *ip)
1297 {
1298  NC* ncp;
1299  int stat = NC_check_id(ncid, &ncp);
1300  if(stat != NC_NOERR) return stat;
1301  return NC_get_vars(ncid,varid, startp, countp, stridep,
1302  (void *)ip, T_ubyte);
1303 }
1304 
1305 int
1306 nc_get_vars_ushort(int ncid, int varid, const size_t *startp,
1307  const size_t *countp, const ptrdiff_t * stridep,
1308  unsigned short *ip)
1309 {
1310  NC* ncp;
1311  int stat = NC_check_id(ncid, &ncp);
1312  if(stat != NC_NOERR) return stat;
1313  return NC_get_vars(ncid,varid,startp,countp, stridep,
1314  (void *)ip, T_ushort);
1315 }
1316 
1317 int
1318 nc_get_vars_uint(int ncid, int varid, const size_t *startp,
1319  const size_t *countp, const ptrdiff_t * stridep,
1320  unsigned int *ip)
1321 {
1322  NC* ncp;
1323  int stat = NC_check_id(ncid, &ncp);
1324  if(stat != NC_NOERR) return stat;
1325  return NC_get_vars(ncid,varid,startp, countp, stridep,
1326  (void *)ip, T_uint);
1327 }
1328 
1329 int
1330 nc_get_vars_longlong(int ncid, int varid, const size_t *startp,
1331  const size_t *countp, const ptrdiff_t * stridep,
1332  long long *ip)
1333 {
1334  NC* ncp;
1335  int stat = NC_check_id(ncid, &ncp);
1336  if(stat != NC_NOERR) return stat;
1337  return NC_get_vars(ncid, varid, startp, countp, stridep,
1338  (void *)ip, T_longlong);
1339 }
1340 
1341 int
1342 nc_get_vars_ulonglong(int ncid, int varid, const size_t *startp,
1343  const size_t *countp, const ptrdiff_t * stridep,
1344  unsigned long long *ip)
1345 {
1346  NC* ncp;
1347  int stat = NC_check_id(ncid, &ncp);
1348  if(stat != NC_NOERR) return stat;
1349  return NC_get_vars(ncid, varid, startp, countp, stridep,
1350  (void *)ip, NC_UINT64);
1351 }
1352 
1353 #ifdef USE_NETCDF4
1354 int
1355 nc_get_vars_string(int ncid, int varid,
1356  const size_t *startp, const size_t *countp,
1357  const ptrdiff_t * stridep,
1358  char* *ip)
1359 {
1360  NC* ncp;
1361  int stat = NC_check_id(ncid, &ncp);
1362  if(stat != NC_NOERR) return stat;
1363  return NC_get_vars(ncid, varid, startp, countp, stridep,
1364  (void *)ip, NC_STRING);
1365 }
1366 #endif /*USE_NETCDF4*/
1367 
1424 int
1425 nc_get_varm(int ncid, int varid, const size_t * startp,
1426  const size_t * countp, const ptrdiff_t * stridep,
1427  const ptrdiff_t * imapp, void *ip)
1428 {
1429  NC* ncp;
1430  int stat = NC_NOERR;
1431 
1432  if ((stat = NC_check_id(ncid, &ncp)))
1433  return stat;
1434  return ncp->dispatch->get_varm(ncid, varid, startp, countp,
1435  stridep, imapp, ip, NC_NAT);
1436 }
1437 
1438 int
1439 nc_get_varm_schar(int ncid, int varid,
1440  const size_t *startp, const size_t *countp,
1441  const ptrdiff_t *stridep,
1442  const ptrdiff_t *imapp, signed char *ip)
1443 {
1444  NC *ncp;
1445  int stat = NC_check_id(ncid, &ncp);
1446  if(stat != NC_NOERR) return stat;
1447  return NC_get_varm(ncid, varid, startp, countp,
1448  stridep, imapp, (void *)ip, NC_BYTE);
1449 }
1450 
1451 int
1452 nc_get_varm_uchar(int ncid, int varid,
1453  const size_t *startp, const size_t *countp,
1454  const ptrdiff_t *stridep, const ptrdiff_t *imapp,
1455  unsigned char *ip)
1456 {
1457  NC *ncp;
1458  int stat = NC_check_id(ncid, &ncp);
1459  if(stat != NC_NOERR) return stat;
1460  return NC_get_varm(ncid,varid,startp,countp,stridep,imapp, (void *)ip,T_uchar);
1461 }
1462 
1463 int
1464 nc_get_varm_short(int ncid, int varid, const size_t *startp,
1465  const size_t *countp, const ptrdiff_t *stridep,
1466  const ptrdiff_t *imapp, short *ip)
1467 {
1468  NC *ncp;
1469  int stat = NC_check_id(ncid, &ncp);
1470  if(stat != NC_NOERR) return stat;
1471  return NC_get_varm(ncid,varid,startp,countp,stridep,imapp, (void *)ip,NC_SHORT);
1472 }
1473 
1474 int
1475 nc_get_varm_int(int ncid, int varid,
1476  const size_t *startp, const size_t *countp,
1477  const ptrdiff_t *stridep, const ptrdiff_t *imapp,
1478  int *ip)
1479 {
1480  NC *ncp;
1481  int stat = NC_check_id(ncid, &ncp);
1482  if(stat != NC_NOERR) return stat;
1483  return NC_get_varm(ncid,varid,startp,countp,stridep,imapp, (void *)ip,NC_INT);
1484 }
1485 
1486 int
1487 nc_get_varm_long(int ncid, int varid,
1488  const size_t *startp, const size_t *countp,
1489  const ptrdiff_t *stridep, const ptrdiff_t *imapp,
1490  long *ip)
1491 {
1492  NC *ncp;
1493  int stat = NC_check_id(ncid, &ncp);
1494  if(stat != NC_NOERR) return stat;
1495  return NC_get_varm(ncid,varid,startp,countp,stridep,imapp, (void *)ip,T_long);
1496 }
1497 
1498 int
1499 nc_get_varm_float(int ncid, int varid,
1500  const size_t *startp, const size_t *countp,
1501  const ptrdiff_t *stridep, const ptrdiff_t *imapp,
1502  float *ip)
1503 {
1504  NC *ncp;
1505  int stat = NC_check_id(ncid, &ncp);
1506  if(stat != NC_NOERR) return stat;
1507  return NC_get_varm(ncid,varid,startp,countp,stridep,imapp, (void *)ip,T_float);
1508 }
1509 
1510 int
1511 nc_get_varm_double(int ncid, int varid,
1512  const size_t *startp, const size_t *countp,
1513  const ptrdiff_t *stridep, const ptrdiff_t *imapp,
1514  double *ip)
1515 {
1516  NC *ncp;
1517  int stat = NC_check_id(ncid, &ncp);
1518  if(stat != NC_NOERR) return stat;
1519  return NC_get_varm(ncid,varid,startp,countp,stridep,imapp, (void *)ip,T_double);
1520 }
1521 
1522 int
1523 nc_get_varm_ubyte(int ncid, int varid,
1524  const size_t *startp, const size_t *countp,
1525  const ptrdiff_t *stridep, const ptrdiff_t *imapp,
1526  unsigned char *ip)
1527 {
1528  NC *ncp;
1529  int stat = NC_check_id(ncid, &ncp);
1530  if(stat != NC_NOERR) return stat;
1531  return NC_get_varm(ncid,varid,startp,countp,stridep,
1532  imapp, (void *)ip, T_ubyte);
1533 }
1534 
1535 int
1536 nc_get_varm_ushort(int ncid, int varid,
1537  const size_t *startp, const size_t *countp,
1538  const ptrdiff_t *stridep, const ptrdiff_t *imapp,
1539  unsigned short *ip)
1540 {
1541  NC *ncp;
1542  int stat = NC_check_id(ncid, &ncp);
1543  if(stat != NC_NOERR) return stat;
1544  return NC_get_varm(ncid, varid, startp, countp, stridep,
1545  imapp, (void *)ip, T_ushort);
1546 }
1547 
1548 int
1549 nc_get_varm_uint(int ncid, int varid,
1550  const size_t *startp, const size_t *countp,
1551  const ptrdiff_t *stridep, const ptrdiff_t *imapp,
1552  unsigned int *ip)
1553 {
1554  NC *ncp;
1555  int stat = NC_check_id(ncid, &ncp);
1556  if(stat != NC_NOERR) return stat;
1557  return NC_get_varm(ncid, varid, startp, countp,
1558  stridep, imapp, (void *)ip, T_uint);
1559 }
1560 
1561 int
1562 nc_get_varm_longlong(int ncid, int varid, const size_t *startp,
1563  const size_t *countp, const ptrdiff_t *stridep,
1564  const ptrdiff_t *imapp, long long *ip)
1565 {
1566  NC *ncp;
1567  int stat = NC_check_id(ncid, &ncp);
1568  if(stat != NC_NOERR) return stat;
1569  return NC_get_varm(ncid, varid, startp, countp, stridep, imapp,
1570  (void *)ip, T_longlong);
1571 }
1572 
1573 int
1574 nc_get_varm_ulonglong(int ncid, int varid,
1575  const size_t *startp, const size_t *countp,
1576  const ptrdiff_t *stridep, const ptrdiff_t *imapp,
1577  unsigned long long *ip)
1578 {
1579  NC *ncp;
1580  int stat = NC_check_id(ncid, &ncp);
1581  if(stat != NC_NOERR) return stat;
1582  return NC_get_varm(ncid, varid, startp, countp, stridep, imapp,
1583  (void *)ip, NC_UINT64);
1584 }
1585 
1586 int
1587 nc_get_varm_text(int ncid, int varid, const size_t *startp,
1588  const size_t *countp, const ptrdiff_t *stridep,
1589  const ptrdiff_t *imapp, char *ip)
1590 {
1591  NC *ncp;
1592  int stat = NC_check_id(ncid, &ncp);
1593  if(stat != NC_NOERR) return stat;
1594  return NC_get_varm(ncid, varid, startp, countp, stridep, imapp,
1595  (void *)ip, NC_CHAR);
1596 }
1597 
1598 #ifdef USE_NETCDF4
1599 int
1600 nc_get_varm_string(int ncid, int varid, const size_t *startp,
1601  const size_t *countp, const ptrdiff_t *stridep,
1602  const ptrdiff_t *imapp, char **ip)
1603 {
1604  NC *ncp;
1605  int stat = NC_check_id(ncid, &ncp);
1606  if(stat != NC_NOERR) return stat;
1607  return NC_get_varm(ncid, varid, startp, countp, stridep, imapp,
1608  (void *)ip, NC_STRING);
1609 }
1611 #endif /*USE_NETCDF4*/
1612 
1613  /* End of named group... */
int nc_get_vara_uint(int ncid, int varid, const size_t *startp, const size_t *countp, unsigned int *ip)
Read an array of values from a variable.
Definition: dvarget.c:745
int nc_get_var_uint(int ncid, int varid, unsigned int *ip)
Read an entire variable in one call.
Definition: dvarget.c:1105
int nc_get_var1_text(int ncid, int varid, const size_t *indexp, char *ip)
Read a single datum from a variable.
Definition: dvarget.c:829
#define NC_ENOMEM
Memory allocation (malloc) failure.
Definition: netcdf.h:395
int nc_get_var_ulonglong(int ncid, int varid, unsigned long long *ip)
Read an entire variable in one call.
Definition: dvarget.c:1123
#define NC_CHAR
ISO/ASCII character.
Definition: netcdf.h:39
int nc_get_varm_short(int ncid, int varid, const size_t *startp, const size_t *countp, const ptrdiff_t *stridep, const ptrdiff_t *imapp, short *ip)
Read a mapped array from a variable.
Definition: dvarget.c:1464
int nc_get_varm_ubyte(int ncid, int varid, const size_t *startp, const size_t *countp, const ptrdiff_t *stridep, const ptrdiff_t *imapp, unsigned char *ip)
Read a mapped array from a variable.
Definition: dvarget.c:1523
int nc_get_vara_double(int ncid, int varid, const size_t *startp, const size_t *countp, double *ip)
Read an array of values from a variable.
Definition: dvarget.c:715
int nc_get_varm_float(int ncid, int varid, const size_t *startp, const size_t *countp, const ptrdiff_t *stridep, const ptrdiff_t *imapp, float *ip)
Read a mapped array from a variable.
Definition: dvarget.c:1499
#define NC_UBYTE
unsigned 1 byte int
Definition: netcdf.h:45
#define NC_EMAPTYPE
Mapped access for atomic types only.
Definition: netcdf.h:448
#define NC_ERANGE
Math result not representable.
Definition: netcdf.h:394
#define NC_MAX_VAR_DIMS
max per variable dimensions
Definition: netcdf.h:269
int nc_get_vars_text(int ncid, int varid, const size_t *startp, const size_t *countp, const ptrdiff_t *stridep, char *ip)
Read a strided array from a variable.
Definition: dvarget.c:1198
int nc_get_vars_ubyte(int ncid, int varid, const size_t *startp, const size_t *countp, const ptrdiff_t *stridep, unsigned char *ip)
Read a strided array from a variable.
Definition: dvarget.c:1294
int nc_get_var1_string(int ncid, int varid, const size_t *indexp, char **ip)
Read a single datum from a variable.
Definition: dvarget.c:955
#define NC_UINT
unsigned 4-byte int
Definition: netcdf.h:47
int nc_get_var_long(int ncid, int varid, long *ip)
Read an entire variable in one call.
Definition: dvarget.c:1060
#define NC_EINVALCOORDS
Index exceeds dimension bound.
Definition: netcdf.h:347
int nc_get_varm_schar(int ncid, int varid, const size_t *startp, const size_t *countp, const ptrdiff_t *stridep, const ptrdiff_t *imapp, signed char *ip)
Read a mapped array from a variable.
Definition: dvarget.c:1439
#define NC_INT64
signed 8-byte int
Definition: netcdf.h:48
#define NC_STRING
string
Definition: netcdf.h:50
#define NC_DOUBLE
double precision floating point number
Definition: netcdf.h:44
int nc_get_vars_double(int ncid, int varid, const size_t *startp, const size_t *countp, const ptrdiff_t *stridep, double *ip)
Read a strided array from a variable.
Definition: dvarget.c:1282
EXTERNL 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_get_var_schar(int ncid, int varid, signed char *ip)
Read an entire variable in one call.
Definition: dvarget.c:1024
int nc_get_varm(int ncid, int varid, const size_t *startp, const size_t *countp, const ptrdiff_t *stridep, const ptrdiff_t *imapp, void *ip)
Read a mapped array from a variable.
Definition: dvarget.c:1425
int nc_type
The nc_type type is just an int.
Definition: netcdf.h:28
int nc_get_vara_string(int ncid, int varid, const size_t *startp, const size_t *countp, char **ip)
Read an array of values from a variable.
Definition: dvarget.c:776
#define NC_BYTE
signed 1 byte integer
Definition: netcdf.h:38
int nc_get_var1_longlong(int ncid, int varid, const size_t *indexp, long long *ip)
Read a single datum from a variable.
Definition: dvarget.c:934
int nc_get_varm_int(int ncid, int varid, const size_t *startp, const size_t *countp, const ptrdiff_t *stridep, const ptrdiff_t *imapp, int *ip)
Read a mapped array from a variable.
Definition: dvarget.c:1475
int nc_get_vars_longlong(int ncid, int varid, const size_t *startp, const size_t *countp, const ptrdiff_t *stridep, long long *ip)
Read a strided array from a variable.
Definition: dvarget.c:1330
int nc_get_vara_ushort(int ncid, int varid, const size_t *startp, const size_t *countp, unsigned short *ip)
Read an array of values from a variable.
Definition: dvarget.c:735
int nc_get_var(int ncid, int varid, void *ip)
Read an entire variable in one call.
Definition: dvarget.c:1009
int nc_get_var_int(int ncid, int varid, int *ip)
Read an entire variable in one call.
Definition: dvarget.c:1051
int nc_get_vara_short(int ncid, int varid, const size_t *startp, const size_t *countp, short *ip)
Read an array of values from a variable.
Definition: dvarget.c:673
int nc_get_var_ushort(int ncid, int varid, unsigned short *ip)
Read an entire variable in one call.
Definition: dvarget.c:1096
int nc_get_var_double(int ncid, int varid, double *ip)
Read an entire variable in one call.
Definition: dvarget.c:1078
int nc_get_vara_float(int ncid, int varid, const size_t *startp, const size_t *countp, float *ip)
Read an array of values from a variable.
Definition: dvarget.c:704
int nc_get_varm_uint(int ncid, int varid, const size_t *startp, const size_t *countp, const ptrdiff_t *stridep, const ptrdiff_t *imapp, unsigned int *ip)
Read a mapped array from a variable.
Definition: dvarget.c:1549
int nc_get_var_string(int ncid, int varid, char **ip)
Read an entire variable in one call.
Definition: dvarget.c:1133
#define NC_EBADTYPE
Not a netcdf data type.
Definition: netcdf.h:357
#define NC_EEDGE
Start+count exceeds dimension bound.
Definition: netcdf.h:385
int nc_get_var1_ubyte(int ncid, int varid, const size_t *indexp, unsigned char *ip)
Read a single datum from a variable.
Definition: dvarget.c:904
int nc_get_var1_uchar(int ncid, int varid, const size_t *indexp, unsigned char *ip)
Read a single datum from a variable.
Definition: dvarget.c:847
int nc_get_var1(int ncid, int varid, const size_t *indexp, void *ip)
Read a single datum from a variable.
Definition: dvarget.c:823
int nc_get_vara_int(int ncid, int varid, const size_t *startp, const size_t *countp, int *ip)
Read an array of values from a variable.
Definition: dvarget.c:684
#define NC_ESTRIDE
Illegal stride.
Definition: netcdf.h:386
int nc_get_var1_uint(int ncid, int varid, const size_t *indexp, unsigned int *ip)
Read a single datum from a variable.
Definition: dvarget.c:924
int nc_get_vara_longlong(int ncid, int varid, const size_t *startp, const size_t *countp, long long *ip)
Read an array of values from a variable.
Definition: dvarget.c:755
#define NC_INT
signed 4 byte integer
Definition: netcdf.h:41
int nc_get_vara_ulonglong(int ncid, int varid, const size_t *startp, const size_t *countp, unsigned long long *ip)
Read an array of values from a variable.
Definition: dvarget.c:765
int nc_get_vars_uchar(int ncid, int varid, const size_t *startp, const size_t *countp, const ptrdiff_t *stridep, unsigned char *ip)
Read a strided array from a variable.
Definition: dvarget.c:1222
int nc_get_var_text(int ncid, int varid, char *ip)
Read an entire variable in one call.
Definition: dvarget.c:1015
int nc_get_varm_uchar(int ncid, int varid, const size_t *startp, const size_t *countp, const ptrdiff_t *stridep, const ptrdiff_t *imapp, unsigned char *ip)
Read a mapped array from a variable.
Definition: dvarget.c:1452
int nc_get_vars_ulonglong(int ncid, int varid, const size_t *startp, const size_t *countp, const ptrdiff_t *stridep, unsigned long long *ip)
Read a strided array from a variable.
Definition: dvarget.c:1342
int nc_get_vars_int(int ncid, int varid, const size_t *startp, const size_t *countp, const ptrdiff_t *stridep, int *ip)
Read a strided array from a variable.
Definition: dvarget.c:1246
int nc_get_vara_ubyte(int ncid, int varid, const size_t *startp, const size_t *countp, unsigned char *ip)
Read an array of values from a variable.
Definition: dvarget.c:725
int nc_get_var1_float(int ncid, int varid, const size_t *indexp, float *ip)
Read a single datum from a variable.
Definition: dvarget.c:884
int nc_get_vara_text(int ncid, int varid, const size_t *startp, const size_t *countp, char *ip)
Read an array of values from a variable.
Definition: dvarget.c:640
#define NC_NAT
Not A Type.
Definition: netcdf.h:37
int nc_get_vara_schar(int ncid, int varid, const size_t *startp, const size_t *countp, signed char *ip)
Read an array of values from a variable.
Definition: dvarget.c:651
EXTERNL int nc_inq_vartype(int ncid, int varid, nc_type *xtypep)
Learn the type of a variable.
Definition: dvarinq.c:169
int nc_get_vars_float(int ncid, int varid, const size_t *startp, const size_t *countp, const ptrdiff_t *stridep, float *ip)
Read a strided array from a variable.
Definition: dvarget.c:1270
EXTERNL int nc_inq_type(int ncid, nc_type xtype, char *name, size_t *size)
Inquire about a type.
Definition: dfile.c:1578
#define NC_USHORT
unsigned 2-byte int
Definition: netcdf.h:46
int nc_get_var_ubyte(int ncid, int varid, unsigned char *ip)
Read an entire variable in one call.
Definition: dvarget.c:1087
int nc_get_var_longlong(int ncid, int varid, long long *ip)
Read an entire variable in one call.
Definition: dvarget.c:1114
int nc_get_vars_short(int ncid, int varid, const size_t *startp, const size_t *countp, const ptrdiff_t *stridep, short *ip)
Read a strided array from a variable.
Definition: dvarget.c:1234
int nc_get_var1_ushort(int ncid, int varid, const size_t *indexp, unsigned short *ip)
Read a single datum from a variable.
Definition: dvarget.c:914
int nc_get_varm_text(int ncid, int varid, const size_t *startp, const size_t *countp, const ptrdiff_t *stridep, const ptrdiff_t *imapp, char *ip)
Read a mapped array from a variable.
Definition: dvarget.c:1587
int nc_get_var1_schar(int ncid, int varid, const size_t *indexp, signed char *ip)
Read a single datum from a variable.
Definition: dvarget.c:838
int nc_get_vars_schar(int ncid, int varid, const size_t *startp, const size_t *countp, const ptrdiff_t *stridep, signed char *ip)
Read a strided array from a variable.
Definition: dvarget.c:1210
int nc_get_vars_long(int ncid, int varid, const size_t *startp, const size_t *countp, const ptrdiff_t *stridep, long *ip)
Read a strided array from a variable.
Definition: dvarget.c:1258
int nc_get_vars_ushort(int ncid, int varid, const size_t *startp, const size_t *countp, const ptrdiff_t *stridep, unsigned short *ip)
Read a strided array from a variable.
Definition: dvarget.c:1306
int nc_get_vara_uchar(int ncid, int varid, const size_t *startp, const size_t *countp, unsigned char *ip)
Read an array of values from a variable.
Definition: dvarget.c:662
int nc_get_var_float(int ncid, int varid, float *ip)
Read an entire variable in one call.
Definition: dvarget.c:1069
int nc_get_var1_short(int ncid, int varid, const size_t *indexp, short *ip)
Read a single datum from a variable.
Definition: dvarget.c:856
int nc_get_vars(int ncid, int varid, const size_t *startp, const size_t *countp, const ptrdiff_t *stridep, void *ip)
Read a strided array from a variable.
Definition: dvarget.c:1184
int nc_get_var_short(int ncid, int varid, short *ip)
Read an entire variable in one call.
Definition: dvarget.c:1042
#define NC_SHORT
signed 2 byte integer
Definition: netcdf.h:40
int nc_get_var1_ulonglong(int ncid, int varid, const size_t *indexp, unsigned long long *ip)
Read a single datum from a variable.
Definition: dvarget.c:944
int nc_get_var1_double(int ncid, int varid, const size_t *indexp, double *ip)
Read a single datum from a variable.
Definition: dvarget.c:894
int nc_get_var_uchar(int ncid, int varid, unsigned char *ip)
Read an entire variable in one call.
Definition: dvarget.c:1033
#define NC_NOERR
No Error.
Definition: netcdf.h:315
#define NC_ECHAR
Attempt to convert between text & numbers.
Definition: netcdf.h:376
int nc_get_var1_long(int ncid, int varid, const size_t *indexp, long *ip)
Read a single datum from a variable.
Definition: dvarget.c:874
int nc_get_varm_long(int ncid, int varid, const size_t *startp, const size_t *countp, const ptrdiff_t *stridep, const ptrdiff_t *imapp, long *ip)
Read a mapped array from a variable.
Definition: dvarget.c:1487
int nc_get_var1_int(int ncid, int varid, const size_t *indexp, int *ip)
Read a single datum from a variable.
Definition: dvarget.c:865
int nc_get_varm_ushort(int ncid, int varid, const size_t *startp, const size_t *countp, const ptrdiff_t *stridep, const ptrdiff_t *imapp, unsigned short *ip)
Read a mapped array from a variable.
Definition: dvarget.c:1536
#define NC_FLOAT
single precision floating point number
Definition: netcdf.h:43
int nc_get_varm_string(int ncid, int varid, const size_t *startp, const size_t *countp, const ptrdiff_t *stridep, const ptrdiff_t *imapp, char **ip)
Read a mapped array from a variable.
Definition: dvarget.c:1600
int nc_get_varm_double(int ncid, int varid, const size_t *startp, const size_t *countp, const ptrdiff_t *stridep, const ptrdiff_t *imapp, double *ip)
Read a mapped array from a variable.
Definition: dvarget.c:1511
int nc_get_vara(int ncid, int varid, const size_t *startp, const size_t *countp, void *ip)
Read an array of values from a variable.
Definition: dvarget.c:627
#define NC_UINT64
unsigned 8-byte int
Definition: netcdf.h:49
int nc_get_vara_long(int ncid, int varid, const size_t *startp, const size_t *countp, long *ip)
Read an array of values from a variable.
Definition: dvarget.c:694
int nc_get_varm_longlong(int ncid, int varid, const size_t *startp, const size_t *countp, const ptrdiff_t *stridep, const ptrdiff_t *imapp, long long *ip)
Read a mapped array from a variable.
Definition: dvarget.c:1562
int nc_get_vars_string(int ncid, int varid, const size_t *startp, const size_t *countp, const ptrdiff_t *stridep, char **ip)
Read a strided array from a variable.
Definition: dvarget.c:1355
int nc_get_vars_uint(int ncid, int varid, const size_t *startp, const size_t *countp, const ptrdiff_t *stridep, unsigned int *ip)
Read a strided array from a variable.
Definition: dvarget.c:1318
int nc_get_varm_ulonglong(int ncid, int varid, const size_t *startp, const size_t *countp, const ptrdiff_t *stridep, const ptrdiff_t *imapp, unsigned long long *ip)
Read a mapped array from a variable.
Definition: dvarget.c:1574

Return to the Main Unidata NetCDF page.
Generated on Tue Nov 29 2016 17:35:36 for NetCDF. NetCDF is a Unidata library.